File size: 461,280 Bytes
803451e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{"text": "\n##  Copyright (c) 2018-2021, Carnegie Mellon University\n##  See LICENSE for details\n\nClass(HockneyOpts, FFTXConvOpts, rec(\n    tags := [],\n    operations := rec(Print := s -> Print(\"<FFTX Hockney options record>\"))    \n));\n\nhockneyOpts := function(arg) \n    local opts, maxSize, argrec;\n    opts := Copy(FFTXConvOpts);\n\n    argrec := rec(\n        globalUnrolling := opts.globalUnrolling, \n        prunedBasemaxSize := opts.globalUnrolling / 2\n    );\n\n    if IsBound(arg[1].args) and Length(arg[1].args) >= 2 and IsRec(arg[1].args[2]) then\n           argrec := CopyFields(argrec, arg[1].args[2]);\n    fi;\n    opts.globalUnrolling := argrec.globalUnrolling;\n   \n    opts.useDeref := false;\n    opts.breakdownRules.PRDFT := List([ PRDFT1_Base2, PRDFT1_CT, PRDFT_PD], _noT);\n    opts.breakdownRules.IPRDFT := List([ IPRDFT1_Base1, IPRDFT1_Base2, IPRDFT1_CT, IPRDFT_PD], _noT);\n    opts.breakdownRules.IPRDFT2 := List([ IPRDFT2_Base1, IPRDFT2_Base2, IPRDFT2_CT], _noT);\n    opts.breakdownRules.PRDFT3 := List([ PRDFT3_Base1, PRDFT3_Base2, PRDFT3_CT, PRDFT3_OddToPRDFT1], _noT);\n    opts.breakdownRules.URDFT := List([ URDFT1_Base1, URDFT1_Base2, URDFT1_Base4, URDFT1_CT ], _noT);\n    opts.breakdownRules.DFT := [DFT_Base, DFT_PD, DFT_CT];\n    opts.breakdownRules.IOPrunedMDRConv := [IOPrunedMDRConv_3D_2trip_zyx_freqdata];\n    opts.breakdownRules.MDDFT := [ MDDFT_Base, MDDFT_RowCol ];\n    opts.breakdownRules.GT := [ GT_NthLoop ];\n    opts.breakdownRules.DFT := [ DFT_Base, DFT_CT, DFT_Rader, CopyFields(DFT_GoodThomas, rec(maxSize := 15)), DFT_PD ];\n    opts.topTransforms := [DFT, MDDFT, PrunedDFT, PrunedIDFT, IOPrunedConv, PrunedPRDFT, PrunedIPRDFT, TTensorI, IOPrunedMDRConv, \n        PRDFT, IPRDFT, PRDFT1, IPRDFT1, PRDFT2, IPRDFT2, PRDFT3, IPRDFT3, TTensorI ];\n    opts.breakdownRules.MDRConv := [ MDRConv_3D_2trip_zyx_freqdata ]; # [MDRConv_Base]\n\n    opts.breakdownRules.PrunedPRDFT := [ CopyFields(PrunedPRDFT_base, rec(maxSize := argrec.prunedBasemaxSize)), PrunedPRDFT_CT_rec_block ];\n    opts.breakdownRules.PrunedIPRDFT := [ CopyFields(PrunedIPRDFT_base, rec(maxSize := argrec.prunedBasemaxSize)), PrunedIPRDFT_CT_rec_block ];\n    opts.breakdownRules.PrunedDFT := [ CopyFields(PrunedDFT_base, rec(maxSize := argrec.prunedBasemaxSize)), PrunedDFT_CT_rec_block ];\n\n    return opts;\nend;\n\n\nhockneyConf := rec(\n    defaultName := \"defaultHockneyConf\",\n    defaultOpts := (arg) >> rec(useHockney := true, args := arg),\n    confHandler := hockneyOpts \n);\n\nfftx.FFTXGlobals.registerConf(hockneyConf);\n\n\n\n", "meta": {"hexsha": "0bf089f149dcea190a5d736fabc6c2b873b0131f", "size": 2508, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "knowledgebase/hockney.gi", "max_stars_repo_name": "franzfranchetti/spiral-package-fftx", "max_stars_repo_head_hexsha": "3149606d3d60a9b50c225ec1e8450628d543698b", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2021-06-15T12:40:19.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-15T12:40:19.000Z", "max_issues_repo_path": "knowledgebase/hockney.gi", "max_issues_repo_name": "franzfranchetti/spiral-package-fftx", "max_issues_repo_head_hexsha": "3149606d3d60a9b50c225ec1e8450628d543698b", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 8, "max_issues_repo_issues_event_min_datetime": "2021-01-05T20:58:29.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-18T20:10:45.000Z", "max_forks_repo_path": "knowledgebase/hockney.gi", "max_forks_repo_name": "franzfranchetti/spiral-package-fftx", "max_forks_repo_head_hexsha": "3149606d3d60a9b50c225ec1e8450628d543698b", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 5, "max_forks_repo_forks_event_min_datetime": "2020-12-14T18:24:29.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-15T12:40:20.000Z", "avg_line_length": 44.0, "max_line_length": 143, "alphanum_fraction": 0.711722488, "num_tokens": 871, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.6723317123102956, "lm_q2_score": 0.5195213219520929, "lm_q1q2_score": 0.349290659969759}}
{"text": "#############################################################################\n##\n#W  extend.gi                                                   Karel Dekimpe\n#W                                                               Bettina Eick\n##\n\n#############################################################################\n##\n#F FiniteSubgroupsAreCyclic( G )\n##\nFiniteSubgroupsAreCyclic := function( G )\n    local fin, rep, flg;\n    fin := FiniteSubgroupClasses( G );\n    rep := List( fin, Representative );\n    flg := ForAll( rep, IsCyclic );\n    return flg;\nend;\n\n#############################################################################\n##\n#F AllActionsHolonomy( G ) \n##\n## Computes all actions of G on Z which can lead to a torsion-free\n## extension centralizing Fit(G). Thus all finite subgroups of G and Fit(G)\n## centralizes Z and the kernel of the action has index at most 2.\n##\nAllActionsHolonomy := function( G )\n    local mats, acts, fins, reps, gens, U, hom, F, low, H, i;\n\n    # first we add the trivial action\n    mats := List( Igs(G), x -> IdentityMat(1));\n    acts := [mats];\n\n    # determine the subgroup known to centralize Z\n    U := FittingSubgroup(G);\n\n    # determine all subgroups of index 2 in G/U\n    hom := NaturalHomomorphismByNormalSubgroup( G, U );\n    F   := Image( hom );\n    low := LowIndexSubgroupClasses( F, 2 );\n    low := List( low, Representative );\n    low := List( low, x -> PreImage( hom, x ) );\n\n    # for each subgroup we get one action\n    for H in low do\n        mats := List( Igs(G), x -> IdentityMat(1));\n        for i in [1..Length(Igs(G))] do\n            if not Igs(G)[i] in H then\n                mats[i] := - mats[i];\n            fi;\n        od;\n        Add( acts, mats );\n    od;\n    return acts;\nend;\n\n#############################################################################\n##\n#F AllActionsForTorsionFreeExtension( G ) \n##\n## Computes all actions of G on Z which can lead to a torsion-free\n## extension centralizing Fit(G). Thus all finite subgroups of G and Fit(G)\n## centralizes Z and the kernel of the action has index at most 2.\n##\nAllActionsForTorsionFreeExtension := function( G )\n    local mats, acts, fins, reps, gens, U, hom, F, low, H, i;\n\n    # first we add the trivial action\n    mats := List( Igs(G), x -> IdentityMat(1));\n    acts := [mats];\n\n    # determine the subgroup known to centralize Z\n    fins := FiniteSubgroupClasses( G );\n    reps := List( fins, Representative );\n    gens := Flat( List( reps, Igs ) );\n    Append( gens, GeneratorsOfGroup( FittingSubgroup(G) ) );\n    U := NormalClosure( G, Subgroup( G, gens ) );\n    if Index( G, U ) = 1 then return acts; fi;\n\n    # determine all subgroups of index 2 in G/U\n    hom := NaturalHomomorphismByNormalSubgroup( G, U );\n    F   := Image( hom );\n    low := LowIndexSubgroupClasses( F, 2 );\n    low := List( low, Representative );\n    low := List( low, x -> PreImage( hom, x ) );\n\n    # for each subgroup we get one action\n    for H in low do\n        mats := List( Igs(G), x -> IdentityMat(1));\n        for i in [1..Length(Igs(G))] do\n            if not Igs(G)[i] in H then\n                mats[i] := - mats[i];\n            fi;\n        od;\n        Add( acts, mats );\n    od;\n    return acts;\nend;\n\n#############################################################################\n##\n#F ExpandedTail( tail, d )\n##\nExpandedTail := function( t, d )\n    local r, i;\n    r := List( [1..d], x -> 0 );\n    for i in [1..Length(t)] do\n        if IsBound( t[i] ) then r[i] := t[i][1][1]; fi;\n    od;\n    return r;\nend;\n\n#############################################################################\n##\n#F HasTorsionFreeExtension( G, CR )\n##\n## Check if G has a torsion-free extension. We assume that all finite \n## subgroups of G are cyclic (otherwise, no torsion-free extension exists).\n## CR ist a record describing the second cohomology group of G by Z.\n##\nHasTorsionFreeExtension := function( G, CR )\n    local fins, reps, repp, cc, d, subs, U, g, e, p, w, v, i, t, r, pr, \n          f, V, spcs, sub;\n\n    # compute the finite subgroups of prime order up to conjugacy\n    fins := FiniteSubgroupClasses( G );\n    reps := List( fins, Representative );\n    repp := Filtered( reps, x -> IsPrime( Size(x) ) );\n    if Length( repp ) = 0 then return true; fi;\n\n    # extract second cohomology\n    cc := CR.twocohom;\n\n    # for each finite subgroup of prime order compute the corresponding\n    # relation on cc.gcc\n    subs := [];\n    for U in repp do\n        g := GeneratorsOfGroup( U )[1];\n        e := Exponents( g );\n        p := Order( g );\n        w := rec( word := e, tail := [] );\n        v := ShallowCopy( w );\n        for i in [2..p] do\n            v := CollectedTwoCR( CR, v, w );\n        od;\n        r := ExpandedTail( v.tail, Length( CR. enumrels ) );\n        sub := NullspaceIntMod( cc.factor.prei, r, p );\n        Add( subs, sub );\n    od;\n\n    e := Lcm( List( repp, Size ) );\n    d := Length( cc.factor.prei );\n    return SizeOfUnionMod( subs, e ) < e^d;\nend;\n\n#############################################################################\n##\n#F HasMinimalCentreExtension( G, CR )\n##\n## Check if there is an extension of G that has minimal centre; that is,\n## Z(Fit(E)) = Z. This is only implemented for groups G with abelian \n## Fitting subgroup.\n##\nHasMinimalCentreExtension := function( G, CR )\n    local cc, d, t, F, f, g, l, c, i, j, v, w, a, b;\n\n    # get cohomology and generic elements\n    cc := CR.twocohom;\n    d  := Length( CR.enumrels );\n    t  := List( [1..Length(cc.gcc)], x -> Indeterminate( Integers, x ) );\n    t  := t * cc.gcc;\n\n    # get Fitting subgroup generators\n    F := FittingSubgroup( G );\n\n    # the abelian case is more effective - consider this first\n    if IsAbelian( F ) then \n        f := GeneratorsOfGroup( F );\n        l := Length( f );\n\n        # find tails of commutators\n        c := NullMat( l, l );\n        for i in [1..l] do\n            for j in [i+1..l] do\n                v := rec( word := Exponents( f[i]^-1 ), tail := [] );\n                w := rec( word := Exponents( f[j]^-1 ), tail := [] );\n                v := CollectedTwoCR( CR, v, w );\n                w := rec( word := Exponents( f[i] ), tail := [] );\n                v := CollectedTwoCR( CR, v, w );\n                w := rec( word := Exponents( f[j] ), tail := [] );\n                v := CollectedTwoCR( CR, v, w );\n                b := ExpandedTail( v.tail, d );\n                a := b * t;\n                c[i][j] := a;\n                c[j][i] := -a;\n            od;\n        od;\n        \n        # get determinant\n        c := GenericDeterminantMat( c );\n        return Length( ExtRepPolynomialRatFun(c) ) <> 0;\n    fi;\n\n    # the non-abelian case \n    f := MinimalGeneratingSet( F );\n    g := GeneratorsOfGroup( Centre( F ) );\n    if Length(f) < Length( g ) then return false; fi;\n\n    # find tails of commutators\n    c := NullMat( Length(f), Length(g) );\n    for i in [1..Length(f)] do\n        for j in [1..Length(g)] do\n            v := rec( word := Exponents( f[i]^-1 ), tail := [] );\n            w := rec( word := Exponents( g[j]^-1 ), tail := [] );\n            v := CollectedTwoCR( CR, v, w );\n            w := rec( word := Exponents( f[i] ), tail := [] );\n            v := CollectedTwoCR( CR, v, w );\n            w := rec( word := Exponents( g[j] ), tail := [] );\n            v := CollectedTwoCR( CR, v, w );\n            b := ExpandedTail( v.tail, d );\n            c[i][j] := b * t;\n        od;\n    od;\n\n    # get determinant of rxr submats\n    Error(\"not yet implemented\");\n    c := Determinant( c );\n    c := ExtRepPolynomialRatFun( c );\n    c := Filtered( c, x -> IsInt(x) );\n    return ForAny( c, x -> x <> 0 ); \nend;\n\n#############################################################################\n##\n#F HasExtensionOfType( G, torfree, mincent )\n##\n## Let G be a pcp group. This function checks if G has a torsion-free\n## extension or an extension with Z(Fit(H)) = Z$ with the free abelian\n## module Z. \n##\nInstallGlobalFunction( HasExtensionOfType, function( G, torfree, mincent )\n    local mats, CR, found, i;\n\n    # if both flags are false, then there is nothing to do\n    if not torfree and not mincent then return true; fi;\n\n    # first check if G is torsion-free or has non-cyclic finite subgrps\n    Print(\"    check that all finite subgroups are cyclic\\n\");\n    if not FiniteSubgroupsAreCyclic( G ) then return false; fi;\n\n    # if G is torsion-free, then all extensions of G are torsion-free\n    if Length( FiniteSubgroupClasses(G) ) = 1 then torfree := false; fi;\n    if not torfree and not mincent then return true; fi;\n\n    # now loop over actions - the trivial action first\n    Print(\"    consider trivial action \\n\");\n    mats := List( Igs(G), x -> IdentityMat( 1 ) );\n    CR := CRRecordByMats( G, mats );\n    CR.twocohom := TwoCohomologyCR( CR );\n    if mincent then \n        found := HasMinimalCentreExtension( G, CR );\n        #if found <> HasMinimalCentreExtensionByCRRec2( G, CR ) then \n        #    Error(\"something wrong with min cent\");\n        #fi;\n    fi;\n    if (not mincent) or (found and torfree) then \n        found := HasTorsionFreeExtension( G, CR );\n    fi;\n    if found then return true; fi;\n\n    # now consider the remaining actions\n    mats := AllActionsForTorsionFreeExtension( G );\n    for i in [2..Length(mats)] do\n        Print(\"    consider non-trivial action number \",i-1,\"\\n\");\n        CR := CRRecordByMats( G, mats[i] );\n        CR.twocohom := TwoCohomologyCR( CR );\n        if mincent then \n            found := HasMinimalCentreExtension( G, CR );\n            #if found <> HasMinimalCentreExtensionByCRRec2( G, CR ) then \n            #    Error(\"something wrong with min cent\");\n            #fi;\n        fi;\n        if (not mincent) or (found and torfree) then \n            found := HasTorsionFreeExtension( G, CR );\n        fi;\n        if found then return true; fi;\n    od;\n\n    # we have not found a suitable extension\n    return false;\nend );\n", "meta": {"hexsha": "ae1f4764927722d32ee7af05639fd4763cfa81bc", "size": 9928, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "gap/extend.gi", "max_stars_repo_name": "alex-konovalov/aclib", "max_stars_repo_head_hexsha": "d1afb020805bfd60a8bbb0a9a4adac77fe9b44f1", "max_stars_repo_licenses": ["Artistic-2.0"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "gap/extend.gi", "max_issues_repo_name": "alex-konovalov/aclib", "max_issues_repo_head_hexsha": "d1afb020805bfd60a8bbb0a9a4adac77fe9b44f1", "max_issues_repo_licenses": ["Artistic-2.0"], "max_issues_count": 6, "max_issues_repo_issues_event_min_datetime": "2018-03-07T16:35:34.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-26T23:51:07.000Z", "max_forks_repo_path": "gap/extend.gi", "max_forks_repo_name": "alex-konovalov/aclib", "max_forks_repo_head_hexsha": "d1afb020805bfd60a8bbb0a9a4adac77fe9b44f1", "max_forks_repo_licenses": ["Artistic-2.0"], "max_forks_count": 1, "max_forks_repo_forks_event_min_datetime": "2018-03-10T19:58:42.000Z", "max_forks_repo_forks_event_max_datetime": "2018-03-10T19:58:42.000Z", "avg_line_length": 34.0, "max_line_length": 77, "alphanum_fraction": 0.5209508461, "num_tokens": 2690, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.6825737473266735, "lm_q2_score": 0.5117166047041654, "lm_q1q2_score": 0.34928432044220425}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\n## Vector Multiplication operator\n## VOLMultiplication(<number inputs>, <length inputs>, <length vector>) \nClass(VOLMultiplication, RewritableObject, BaseMat, OLBase, rec(\n    dims := self >> [self.rChildren()[2] * self.rChildren()[3], StripList(Replicate(self.rChildren()[1], self.rChildren()[2] * self.rChildren()[3]))],\n));\n\n#F RCVOLMultiplication(<number inputs>, <length inputs>, <length vector>)\n#F   is a vRC(VOLMultiplication(<number inputs>, <length inputs>, <length vector>/2))\n#F   inputs/output is in inteleaved complex format: [re1, im1, re2, im2, ...]\n\nClass(RCVOLMultiplication, RewritableObject, BaseMat, OLBase, rec(\n    dims := self >> [self.rChildren()[2] * self.rChildren()[3], StripList(Replicate(self.rChildren()[1], self.rChildren()[2] * self.rChildren()[3]))],\n));\n\n#F VRCOLMultiplication(<number inputs>, <length inputs>, <length vector>)\n#F   inputs/output is in vector inteleaved complex format: \n#F     [[re1, re2, ..., re_v], [im1, im2, ..., im_v], [re_(v+1), ...], ...]\n\nClass(VRCOLMultiplication, RewritableObject, BaseMat, OLBase, rec(\n    dims := self >> [2 * self.rChildren()[2] * self.rChildren()[3], StripList(Replicate(self.rChildren()[1], 2 * self.rChildren()[2] * self.rChildren()[3]))],\n));\n\n## VOLConjMultiplication(<number inputs>, <length inputs>, <length vector>) \nClass(VOLConjMultiplication, RewritableObject, BaseMat, OLBase, rec(\n    dims := self >> [self.rChildren()[2] * self.rChildren()[3], StripList(Replicate(self.rChildren()[1], self.rChildren()[2] * self.rChildren()[3]))],\n));\n\n#F RCVOLConjMultiplication(<complex input length>, <length vector>)\n#F   is a vRC(VTensor(OLConjMultiplication(<complex input length>), <length vector>/2))\n#F   inputs/output is in inteleaved complex format: [re1, im1, re2, im2, ...]\n\nClass(RCVOLConjMultiplication, RewritableObject, BaseMat, OLBase, rec(\n    dims := self >> [self.rChildren()[2] * self.rChildren()[3], StripList(Replicate(self.rChildren()[1], self.rChildren()[2] * self.rChildren()[3]))],\n));\n\n#F VRCOLConjMultiplication(<complex input length>, <length vector>)\n#F   inputs/output is in vector inteleaved complex format: \n#F     [[re1, re2, ..., re_v], [im1, im2, ..., im_v], [re_(v+1), ...], ...]\n\nClass(VRCOLConjMultiplication, RewritableObject, BaseMat, OLBase, rec(\n    dims := self >> [2 * self.rChildren()[2] * self.rChildren()[3], StripList(Replicate(self.rChildren()[1], 2 * self.rChildren()[2] * self.rChildren()[3]))],\n));\n\n", "meta": {"hexsha": "8625b0e8f792cd64e6480a751e454a1e7e9c5410", "size": 2519, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/paradigms/vector/sigmaspl/ol.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/paradigms/vector/sigmaspl/ol.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/paradigms/vector/sigmaspl/ol.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 51.4081632653, "max_line_length": 158, "alphanum_fraction": 0.6820166733, "num_tokens": 747, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.7248702761768248, "lm_q2_score": 0.480478678047907, "lm_q1q2_score": 0.348284712053662}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\n# VGath_sv/VScat_sv may have bigger dimensions than their function domain so we need padding  \n# to have Diag with correct dimensions when commuting diag through VGath_sv and VScat_sv\n_fComposeVGathScatSv_Diag := (m, dim, d) -> let( \n    g := fTensor(m.func, fId(m.sv)),\n    mdim := dim(m),\n    rem := Cond(m.rem _is Unk, g.domain() mod mdim, m.rem=0, 0, m.v - m.rem * m.sv),\n    f := fCompose(d.element, g),\n    When(rem = 0, f, diagDirsum(f, fConst(TReal, mdim-rem, 0.0)))\n);\n\nClass(RulesVDiag, RuleSet);\nRulesVDiag.__transparent__ := [ [Compose, [vRC]] ];  # creates extra rules, A*B->C is made into vRC(A)*vRC(B) -> vRC(C)\n\nRewriteRules(RulesVDiag, rec(\n    DiagConst_AnyScat := ARule(Compose, [[Diag, [fConst, @(1), @(2), @(3)]], @(4).cond(IsVScat)],\n\te -> [ @(4).val, VDiag(fConst(@(1).val, Cols(@(4).val), @(3).val), getV(@(4).val))]),\n\n    AnyGath_DiagConst := ARule(Compose, [@(4).cond(IsVGath), [Diag, [fConst, @(1), @(2), @(3)]]],\n\te -> [ VDiag(fConst(@(1).val, Rows(@(4).val), @(3).val), getV(@(4).val)), @(4).val]),\n\n    DiagConst_NoDiagPullin := ARule(Compose, [[Diag, [fConst, @(1), @(2), @(3)]], @(4, NoDiagPullin)],\n\te -> [ @(4).val, Diag(fConst(@(1).val, Cols(@(4).val), @(3).val))]),\n\n    # VGath * IDirSum\n     CommuteVGathIDirSum := ARule( Compose,\n\t [ [@(1, VGath), @(3)],\n\t   [@(0, [PushL, PushLR]), @(4, IDirSum, e -> (@(1).val.v mod Rows(e.child(1))) = 0)] ],\n       e -> let(\n             ratio := @(1).val.v / Rows(@(4).val.child(1)),\n             f := When(ratio=1, @(3).val, fTensor(@(3).val, fId(ratio))),\n             j := @(4).val.var,\n             jj := Ind(f.domain()),\n\n             [ ObjId(@(0).val)(IDirSum(jj,\n                   Data(j, f.at(jj), SubstTopDown(@(4).val.child(1), @(5,fBase,e->e.params[2]=j),\n                                       e -> fCompose(f, fBase(jj)))))),\n               @(1).val ])\n    ),\n\n    # IDirSum * VScat\n    CommuteIDirSumVScat := ARule( Compose,\n       [ [@(0,[PushR, PushLR]), @(4, IDirSum)],\n         [@(1, VScat, e -> (e.v mod Cols(@(4).val.child(1)))=0), @(3)] ],\n\n       e -> let(\n             ratio := @(1).val.v / Cols(@(4).val.child(1)),\n             f := When(ratio=1, @(3).val, fTensor(@(3).val, fId(ratio))),\n             j := @(4).val.var,\n             jj := Ind(f.domain()),\n\n             [ @(1).val,\n               ObjId(@(0).val)(IDirSum(jj,\n                   Data(j, f.at(jj), SubstTopDown(@(4).val.child(1), @(5,fBase,e->e.params[2]=j),\n                                       e -> fCompose(f, fBase(jj)))))) ])\n    ),\n\n    # Gath * RCDiag\n    CommuteVGathVRCDiag_fTensor := ARule( Compose,\n       [ [@(1, VGath), [@(0,fTensor), ..., [fId, @(2).cond(_isEven)]]], @(4, VRCDiag) ],\n       e -> [ VRCDiag(fCompose(@(4).val.element, @(0).val), @(4).val.v), @(1).val ]),\n\n    # Gath * RCDiag\n    CommuteVGathVRCDiag_H := ARule( Compose,\n       [ [@(1, VGath), [@(2, H), @, @.cond(_isEven), @.cond(_isEven), _1]], @(4, VRCDiag) ],\n       e -> [ VRCDiag(fCompose(@(4).val.element, @(2).val), @(4).val.v), @(1).val ]),\n\n    # RCVDiag * VScat\n    CommuteRCVDiagVScat := ARule( Compose,\n       [ @(1, RCVDiag), @(2, VScat) ], # <-1 <-2 o\n        e -> [ @2.val, RCVDiag(fCompose(@1.val.element, @2.val.func), @2.val.v).attrs(@(1).val) ]),\n\n    # RCVDiagSplit * VScat\n    CommuteRCVDiagSplitVScat := ARule( Compose,\n       [ @(1, RCVDiagSplit), @(2, VScat) ], # <-1 <-2 o\n        e -> [ @2.val, RCVDiagSplit(fCompose(@1.val.element, fTensor(@2.val.func, fId(2))), @2.val.v).attrs(@(1).val) ]),\n\n\n    # VRCDiag * VScat\n    CommuteVRCDiagVScat_fTensor := ARule( Compose, \n        [ @(4, VRCDiag), [@(1, VScat), [@(0,fTensor), ..., [fId, @(2).cond(_isEven)]]] ],\n        e -> [ @(1).val, VRCDiag(fCompose(@(4).val.element, @(0).val), @(4).val.v) ]),\n\n    # VRCDiag * VScat\n    CommuteVRCDiagVScat_H := ARule( Compose, \n        [ @(4, VRCDiag), [@(1, VScat), [@(2, H), @, @.cond(_isEven), @.cond(_isEven), _1]] ],\n        e -> [ @(1).val, VRCDiag(fCompose(@(4).val.element, @(2).val), @(4).val.v) ]),\n\n    # VGath * Diag\n    CommuteVGathDiag := ARule( Compose,\n       [ @(1, VGath), @(2, Diag) ], # o 1-> 2->\n        e -> [ VDiag(fCompose(@2.val.element, fTensor(@1.val.func, fId(@1.val.v))), @1.val.v).attrs(@(2).val), @1.val ]),\n\n    # VGath * VDiag\n    CommuteVGathVDiag := ARule( Compose,\n       [ @(1, VGath), @(2, VDiag) ], # o 1-> 2->\n        e -> [ VDiag(fCompose(@2.val.element, fTensor(@1.val.func, fId(@1.val.v))), @1.val.v).attrs(@(2).val), @1.val ]),\n\n    # Diag * VScat\n    CommuteDiagVScat := ARule( Compose,\n       [ @(1, Diag), @(2, VScat) ], # <-1 <-2 o\n        e -> [ @2.val, VDiag(fCompose(@1.val.element, fTensor(@2.val.func, fId(@2.val.v))), @2.val.v).attrs(@(1).val) ]),\n\n    # VDiag * VScat\n    CommuteVDiagVScat := ARule( Compose,\n       [ @(1, VDiag), @(2, VScat) ], # <-1 <-2 o\n        e -> [ @2.val, VDiag(fCompose(@1.val.element, fTensor(@2.val.func, fId(@2.val.v))), @2.val.v).attrs(@(1).val) ]),\n\n    # RCVDiag * VScat\n    CommuteRCVDiagVScat := ARule( Compose,\n       [ @(1, RCVDiag), @(2, VScat) ], # <-1 <-2 o\n        e -> [ @2.val, RCVDiag(fCompose(@1.val.element, @2.val.func), @2.val.v).attrs(@(1).val) ]),\n\n    # RCVDiagSplit * VScat\n    CommuteRCVDiagSplitVScat := ARule( Compose,\n       [ @(1, RCVDiagSplit), @(2, VScat) ], # <-1 <-2 o\n        e -> [ @2.val, RCVDiagSplit(fCompose(@1.val.element, fTensor(@2.val.func, fId(2))), @2.val.v).attrs(@(1).val) ]),\n\n    # VGath * VDiag_x_I\n    CommuteVGathVDiag_x_I := ARule( Compose,\n        [ @(1, VGath), @(2, VDiag_x_I) ], # o 1-> 2->\n    e -> [ VDiag_x_I(fCompose(@2.val.element, @1.val.func), @2.val.v).attrs(@(2).val), @1.val ]),\n\n    # VDiag_x_I * VScat\n    CommuteVDiag_x_IVScat := ARule( Compose,\n        [ @(1, VDiag_x_I), @(2, VScat) ], # <-1 <-2 o\n    e -> [ @2.val, VDiag_x_I(fCompose(@1.val.element, @2.val.func), @1.val.v).attrs(@(1).val) ]),\n\n    #------------------------\n    # VGath_sv * Diag\n    CommuteVGathsvDiag := ARule( Compose,\n       [ @(1, VGath_sv), @(2, Diag) ], # o 1-> 2->\n       e -> [ VDiag(_fComposeVGathScatSv_Diag(@1.val, Rows, @2.val), @1.val.v).attrs(@2.val), @1.val ]\n    ),\n\n    # VGath_sv * VDiag\n    CommuteVGathsvVDiag := ARule( Compose,\n       [ @(1, VGath_sv), @(2, VDiag) ], # o 1-> 2->\n       e -> [ VDiag(_fComposeVGathScatSv_Diag(@1.val, Rows, @2.val), @1.val.v).attrs(@2.val), @1.val ]\n    ),\n\n    # Diag * VScat_sv\n    CommuteDiagVScatsv := ARule( Compose,\n       [ @(1, Diag), @(2, VScat_sv) ], # <-1 <-2 o\n       e -> [ @2.val, VDiag(_fComposeVGathScatSv_Diag(@2.val, Cols, @1.val), @2.val.v).attrs(@1.val) ]\n    ),\n\n    # VDiag * VScat_sv\n    CommuteVDiagVScatsv := ARule( Compose,\n       [ @(1, VDiag), @(2, VScat_sv) ], # <-1 <-2 o\n       e -> [ @2.val, VDiag(_fComposeVGathScatSv_Diag(@2.val, Cols, @1.val), @2.val.v).attrs(@1.val) ]\n    ),\n\n    #-----------------------------------------------------------\n    # VStretchGath * Diag\n    CommuteVStretchGathDiag := ARule( Compose,\n       [ @(1, VStretchGath), @(2, Diag) ], # o 1-> 2->\n       e -> let( vg := @1.val, den := vg.func.domain()/vg.part, num := _roundup(den, vg.v),\n            [ VDiag(fStretch(fCompose(@2.val.element, @1.val.func), num, den), @1.val.v).attrs(@2.val), @1.val ])\n    ),\n    \n    # Diag * VStretchScat\n    CommuteVStretchScatDiag := ARule( Compose,\n       [ @(1, Diag), @(2, VStretchGath)], \n       e -> let( vg := @2.val, den := vg.func.domain()/vg.part, num := _roundup(den, vg.v),\n            [ @2.val, VDiag(fStretch(fCompose(@1.val.element, @2.val.func), num, den), @2.val.v).attrs(@1.val) ])\n    ),\n\n    #-----------------------------------------------------------\n    # Diag * IxVScat_pc\n    CommuteDiagIxVScat_pc := ARule( Compose, \n\t[ @(1, [Diag, VDiag]), @(2, IxVScat_pc) ], # <-1 <-2 o\n        e -> let(s:=@(2).val, [ s, VDiag(fStretch(@(1).val.element, _roundup(s.n, s.v), s.n), s.v) ])),\n\n    # IxVGath_pc * Diag\n    CommuteIxVGath_pcDiag := ARule( Compose,\n\t[ @(1, IxVGath_pc), @(2, [Diag, VDiag]) ], # o 1-> 2->\n        e -> let(g:=@(1).val, [ VDiag(fStretch(@(2).val.element, _roundup(g.n, g.v), g.n), g.v), g ])),\n\n    # Diag * VScat_pc\n    CommuteDiagVScat_pc := ARule(Compose,\n       [ @(1, [Diag, VDiag]), @(2, VScat_pc) ], # <-1 <-2 o\n       e -> let(s := @(2).val, f := @(1).val.element,\n\t   [ s, VDiag(fStretch(fCompose(f, fAdd(f.domain(), s.n, s.ofs)), \n\t\t\t       _roundup(s.n, s.v), s.n), s.v) ])),\n\n    # VGath_pc * Diag \n    CommuteVGath_pcDiag := ARule( Compose, # o 1-> 2->\n       [ @(1, VGath_pc), @(2, [Diag, VDiag]) ], \n       e -> let(g := @(1).val, f := @(2).val.element,\n\t   [ VDiag(fStretch(fCompose(f, fAdd(f.domain(), g.n, g.ofs)), \n\t\t            _roundup(g.n, g.v), g.n), g.v), g ])),\n\n\n    #-----------------------------------------------------------\n    # YSV: Below 2 rules have limitations which can be removed, \n    #      But it seems that fStretch has built-in assumptions which makes it difficult\n    #      to remove these limitations.. \n    \n    # NOTE: Remove limitations, the rule as is, is invalid for g.ofs <> 0, or if g.N > g.v\n    #        Hence the precondition \n    ## Diag * IxRCVScat_pc\n    CommuteDiagIxRCVScat_pc := ARule(Compose,\n       [ @(1, [Diag, VDiag]), @(2, IxRCVScat_pc, e->e.ofs = 0 and not IsSymbolic(e.n) and e.n <= e.v) ], # <-1 <-2 o\n       e -> let(s := @(2).val, \n\t   [ s, VDiag(fStretch(@(1).val.element, \n\t\t\t       _roundup(s.n, 2*s.v), 2*s.n), s.v) ])),\n\n    # NOTE: Remove limitations, the rule as is, is invalid for g.ofs <> 0, or if g.N > g.v\n    #        Hence the precondition \n    # IxRCVGath_pc * Diag \n    CommuteIxRCVGath_pcDiag := ARule( Compose, # o 1-> 2->\n       [ @(1, IxRCVGath_pc, e->e.ofs = 0 and not IsSymbolic(e.n) and e.n <= e.v), @(2, [Diag, VDiag]) ], \n       e -> let(g := @(1).val, \n\t   [ VDiag(fStretch(@(2).val.element, \n\t\t            _roundup(g.n, 2*g.v), 2*g.n), g.v), g ])),\n    #-----------------------------------------------------------\n    \n\n    #-----------------------------------------------------------\n# NOTE: unclear how to do. Rewriting rule missing: f^{n->N} o \\pi^{n} -> \\rho^{N} o h^{n->N}\n#    # BlockVPerm * VDiag\n#    CommuteBlockVPermVDiag := ARule( Compose,\n#       [ @(1, BlockVPerm), @(2, VDiag) ], # o 1-> 2->\n#         e -> let(vdiag := Copy(@2.val), bperm := Copy(@1.val),\n#         [ VDiag(fCompose(vdiag.element, fTensor(fId(bperm.n), bperm.perm)), vdiag.v).attrs(vdiag), BlockVPerm2(bperm.n, bperm._children[1], bperm.perm) ])),\n#\n#    # VDiag * BlockVPerm\n#    CommuteVDiagBlockVPerm := ARule( Compose,\n#       [ @(1, VDiag), @(2, BlockVPerm) ], # <-1 <-2 o\n#         e -> let(vdiag := Copy(@1.val), bperm := Copy(@2.val),\n#        [ BlockVPerm2(bperm.n, bperm._children[1], bperm.perm), VDiag(fCompose(vdiag.element, fTensor(fId(bperm.n), bperm.perm)), vdiag.v).attrs(vdiag) ])),\n\n# this is a hack that *DOES NOT* produce correct code\n#    # BlockVPerm * VDiag: HACK that *DOES NOT* produce correct code\n#    CommuteBlockVPermVDiag := ARule( Compose,\n#       [ @(1, BlockVPerm), @(2, VDiag) ], # o 1-> 2->\n#         e -> let(vdiag := Copy(@2.val), bperm := Copy(@1.val),\n#         [ vdiag, BlockVPerm2(bperm.n, bperm._children[1], bperm.perm) ])),\n#\n#    # VDiag * BlockVPerm: HACK that *DOES NOT* produce correct code\n#    CommuteVDiagBlockVPerm := ARule( Compose,\n#       [ @(1, VDiag), @(2, BlockVPerm) ], # <-1 <-2 o\n#         e -> let(vdiag := Copy(@1.val), bperm := Copy(@2.val),\n#        [ BlockVPerm2(bperm.n, bperm._children[1], bperm.perm), vdiag ])),\n\n\n    #--------------------------------------------------\n    #   vectorize constructs\n    ParDiagVPerm := ARule(Compose, [@(1, Diag), @(2, VPerm)],\n        e -> [VDiag(@1.val.element, @(2).val.vlen), @(2).val]\n    ),\n    ParVPermDiag := ARule(Compose, [@(1, VPerm), @(2, Diag)],\n        e -> [@(1).val, VDiag(@2.val.element, @(1).val.vlen)]\n    ),\n    ParScatVDiag := ARule(Compose,\n    [[Scat, [@(0,fTensor), ..., @(2,fId)]], @(1,VDiag,e->@(2).val.size=Rows(e))],\n    e -> let(ch := @(0).val.children(), X := @(1).val, v := X.v,\n               [VTensor(Scat(fTensor(DropLast(ch,1), fId(Rows(X)/v))), v), X])\n    ),\n    ParVTensorDiag := ARule(Compose, [@(1, VTensor), @(2, Diag)],\n        e -> [ @(1).val, VDiag(@2.val.element, @(1).val.vlen)]\n    ),\n    ParDiagVTensor := ARule(Compose, [@(1, Diag), @(2, VTensor)],\n        e -> [ VDiag(@1.val.element, @(2).val.vlen), @(2).val ]\n    ),\n\n    ParVSDiag := ARule(Compose, [@(1, VS), @(2, Diag)],\n        e -> [ @(1).val, VDiag(@2.val.element, @(1).val.v)]\n    ),\n\n    ParDiagVS := ARule(Compose, [@(1, Diag), @(2, VS)],\n        e -> [ VDiag(@1.val.element, @(2).val.v), @(2).val ]\n    )\n));\n\n\nRewriteRules(RulesFuncSimp, rec(\n\n    RCData_VDupOnline := Rule( [RCData, VDupOnline], \n        e -> VDupOnline(RCData(e.func.func), e.func.v)),\n\n    RCVData_VDupOnline := Rule( [RCVData, VDupOnline],\n        e -> VDupOnline(RCVData(VDup(e.func.func, 1)), e.func.v)),\n\n    RCVDataSplitVec_VDupOnline := Rule( [RCVDataSplitVec, VDupOnline],\n        e -> VDupOnline(RCVDataSplitVec(VDup(e.func.func, 1)), e.func.v)),\n\n    fCompose_VDupOnline_FList := ARule(fCompose, [@(1, VDupOnline), @(2, FList)], \n        e -> [VDupOnline(fCompose(@(1).val.func, @(2).val), @(1).val.v)]),\n\n    fPrecompute_VDupOnline := Rule( [fPrecompute, VDupOnline],\n        e -> VDupOnline(fPrecompute(e.child(1).func), e.child(1).v)),\n    \n    RCVData_VDup_CRData := Rule([RCVData, [VDup, [CRData, @(1)], @(2)]],\n        e -> VDup( VData(@(1).val, 2), @(2).val) ),\n));\n\n", "meta": {"hexsha": "c5fae5598de46acc861781d155157ec6570825c8", "size": 13461, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/paradigms/vector/rewrite/diag.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/paradigms/vector/rewrite/diag.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/paradigms/vector/rewrite/diag.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 44.4257425743, "max_line_length": 158, "alphanum_fraction": 0.5134833965, "num_tokens": 4968, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6992544335934766, "lm_q2_score": 0.4960938294709195, "lm_q1q2_score": 0.3468958097359066}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\nClass(BaseVGath, BaseMat, SumsBase, rec(\n    isVGath := true,\n    sums := self >> self,\n    isReal := self >> true,\n    dims := self >> Error(ObjId(self), \".dims() is undefined\"),\n    needInterleavedLeft := False,\n    needInterleavedRight := False,\n    conjTranspose := self >> self.transpose(), \n));\n\nClass(BaseSVGath, BaseMat, SumsBase, rec(\n    isVGath := true,\n    isSVGath := true,\n    #-----------------------------------------------------------------------\n    abbrevs := [\n\t(func, v, sv) -> Checked(\n\t    IsFunction(func) or IsFuncExp(func), IsInt(v), IsInt(sv), \n\t    [func, v, sv, Cond(CanBeFullyEvaluated(func.domain()), EvalScalar((func.domain()*sv mod v) / sv), Unk(TInt))]),\n\t(func, v, sv, rem) -> Checked(\n\t    IsFunction(func) or IsFuncExp(func), IsInt(v), IsInt(sv), rem _is Unk or IsInt(_unwrap(rem)),\n\t    [func, v, sv, rem]),\n    ],\n    #-----------------------------------------------------------------------\n    new := (self, func, v, sv, rem) >> SPL(WithBases(self, \n        rec(func := func, v := v, sv := sv, rem := rem))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> Error(ObjId(self), \".dims() is undefined\"),\n    #-----------------------------------------------------------------------\n    print := (self,i,is) >> Print(self.__name__, \"(\", self.func, \", \",\n        self.v, \", \", self.sv, \", \", self.rem, \")\", self.printA()),\n    #-----------------------------------------------------------------------\n    getConstantRem := self >> Cond(\n\tself.rem _is Unk and not IsSymbolic(EvalScalar(self.func.domain())),\n\t    EvalScalar(imod(self.func.domain()*self.sv, self.v) / self.sv), \n\tself.rem _is Unk,\n\t    Error(\"Can't generate sub-vector gather/scatter code for <self>, because its dimensions are unknown\"),\n\tself.rem\n    ),\n    #-----------------------------------------------------------------------\n    conjTranspose := self >> self.transpose(), \n\n    sums := self >> self,\n    isReal := self >> true,\n    needInterleavedLeft := False,\n    needInterleavedRight := True\n));\n\nIsVGath := x -> IsRec(x) and IsBound(x.isVGath) and x.isVGath;\nIsSVGath := x -> IsRec(x) and IsBound(x.isSVGath) and x.isSVGath;\n\n#F ==========================================================================\n#F VGath(<func>, <v>) - vector gather (read) matrix, assumes aligned input\n#F \n#F <func> must be a vector index function returning vector indices\n#F\n#F VGath(f, v) == Gath(fTensor(f, fId(v)))\n#F ==========================================================================\nClass(VGath, BaseVGath, SumsBase, rec(\n    #-----------------------------------------------------------------------\n    #F NOTE: rChildren: does not expose .v!\n    rChildren := self >> [self.func],\n    rSetChild := rSetChildFields(\"func\"),\n    from_rChildren := (self, rch) >> ObjId(self)(rch[1], self.v),\n    #-----------------------------------------------------------------------\n    new := (self, func, v) >> SPL(WithBases(self,\n        rec(func := func, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> [self.v*self.func.domain(), self.v*self.func.range()],\n    #-----------------------------------------------------------------------\n    area := self >> self.func.domain() * self.v,\n    transpose := self >> VScat(self.func, self.v),\n    #-----------------------------------------------------------------------\n    print := (self,i,is) >> Print(self.name, \"(\", self.func, \", \", self.v,\")\", self.printA()),\n    #-----------------------------------------------------------------------\n    toAMat := self >> let(v:=self.v, n := EvalScalar(v*self.func.domain()),\n        N := EvalScalar(v*self.func.range()),\n        func := fTensor(self.func, fId(v)).lambda(),\n        AMatMat(List([0..n-1], row -> BasisVec(N, EvalScalar(func.at(row).ev()))))),\n));\n\n\n#F ==========================================================================\n#F VGath_u(<func>, <v>) -- assumes input is unaligned, and uses scalar <func>\n#F\n#F VGath_u performs an unaligned gather operations. Thus <func> must be an\n#F index function returning scalar, not vector, addresses (unlike VGath).\n#F\n#F In particular:\n#F   VGath(func, vlen) = VGath_u(fTensor(func, fBase(vlen, 0)), vlen)\n#F ==========================================================================\nClass(VGath_u, VGath, rec(\n    new := (self, func, v) >> SPL(WithBases(self,\n        rec(func := func, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> [self.v*self.func.domain(), self.func.range()],\n    #-----------------------------------------------------------------------\n    toAMat := self >> let(v:=self.v, \n        n := EvalScalar(v*self.func.domain()),\n        N := EvalScalar(self.func.range()),\n        func := self.func.lambda(),\n        AMatMat(List([0..n-1], row -> BasisVec(N, EvalScalar(add(func.at(idiv(row,v)), imod(row, v)).ev()))))),\n    #-----------------------------------------------------------------------\n    transpose := self >> VScat_u(self.func, self.v)\n));\n\n#F ==========================================================================\n#F VGath_zero(N, n, <v>) - vector gather matrix\n#F ==========================================================================\nClass(VGath_zero, BaseVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.N, self.n, self.v],\n    rSetChild := rSetChildFields(\"N\", \"n\", \"v\"),\n    #-----------------------------------------------------------------------\n    new := (self, N, n, v) >> SPL(WithBases(self,\n        rec(n := n, N := N, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> [self.v * self.n, self.v * self.N], \n    #-----------------------------------------------------------------------\n    transpose := self >> VScat_zero(self.N, self.n, self.v),\n    toAMat := self >> VGath(fAdd(self.N, self.n, 0), self.v).toAMat(),\n ));\n\n\n#F ==========================================================================\n#F VGath_dup(<func>, <v>) - gathers scalar values and replicates <v> times to\n#F                          obtain a vector values (read) matrix\n#F Example:\n#F spiral> PrintMat(MatSPL(VGath_dup(fId(4), 2)));\n#F [ [ 1,  ,  ,   ],\n#F   [ 1,  ,  ,   ],\n#F   [  , 1,  ,   ],\n#F   [  , 1,  ,   ],\n#F   [  ,  , 1,   ],\n#F   [  ,  , 1,   ],\n#F   [  ,  ,  , 1 ],\n#F   [  ,  ,  , 1 ] ]\n#F\n#F This is performed using shuffles in SSE/SSE2, or movddup in SSE4.\n#F\n#F The transpose of VGath_dup is VScat_red (red = reduce) incurs\n#F arithmetic ops.\n#F\n#F spiral> PrintMat(MatSPL(VScat_red(fId(4), 2)));\n#F [ [ 1, 1,  ,  ,  ,  ,  ,   ],\n#F   [  ,  , 1, 1,  ,  ,  ,   ],\n#F   [  ,  ,  ,  , 1, 1,  ,   ],\n#F   [  ,  ,  ,  ,  ,  , 1, 1 ] ]\n#F\n#F Some architectures have special instructions for this operation. \n#F For example, SSE4 has 'hadd' == horizontal add.\n#F\n#F ==========================================================================\nDeclare(VGath_dup);\nClass(VGath_dup, VGath, rec(\n    #-----------------------------------------------------------------------\n    new := (self, func, v) >> SPL(WithBases(self,\n        rec(func := func, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> [self.v*self.func.domain(), self.func.range()],\n    #-----------------------------------------------------------------------\n    transpose := self >> Error(\"not yet supported\"), #VScat_red(self.func, self.v),\n    #-----------------------------------------------------------------------\n    toAMat := self >> Tensor(\n        Gath(self.func),\n        Mat(TransposedMat([Replicate(self.v, 1)]))).toAMat(),\n    #-----------------------------------------------------------------------\n    toloop := (self, bksize) >> let(i := Ind(self.func.domain() / bksize),\n\tISum(i, i.range,\n            VScat(fTensor(fBase(i), fId(bksize)),self.v) *\n            VGath_dup(fCompose(self.func, fTensor(fBase(i), fId(bksize))),self.v)))\n    #-----------------------------------------------------------------------\n));\n\n#F ==========================================================================\n#F VGath_dup_x_I(<func>, <v>) - gathers vector values and replicates <v> times\n#F NOTE: EXPLAIN THIS\n#F ==========================================================================\nVGath_dup_x_I := (func, v) -> Cond(\n    func.domain() = 1,\n        VReplicate(v),\n    # else\n    let(i := Ind(func.domain()), \n\tISum(i, i.range,\n\t    VScat(fTensor(fBase(i),fId(v)), v) *\n\t    VReplicate(v) *\n\t    VGath(fBase(i),v)) *\n        VGath(func,v)\n    )\n);\n\n#F ==========================================================================\n#F VGath_sv(<func>, <v>, <sv>) - vector gather (read) matrix on subvectors\n#F NOTE: EXPLAIN THIS\n#F ==========================================================================\nClass(VGath_sv, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.func],    # self >> [self.func, self.v, self.sv],\n    rSetChild := rSetChildFields(\"func\"), # rSetChildFields(\"func\", \"v\", \"sv\"),\n    from_rChildren := (self, rch) >> ObjId(self)(rch[1], self.v, self.sv, self.rem),\n    #-----------------------------------------------------------------------\n    dims := self >> [_roundup(self.sv * self.func.domain(), self.v),\n                     self.sv * self.func.range() ],\n    #-----------------------------------------------------------------------\n    area := self >> 2 * self.func.domain() * self.sv,\n    #-----------------------------------------------------------------------\n    transpose := self >> VScat_sv(self.func, self.v, self.sv, self.rem),\n    #-----------------------------------------------------------------------\n    toAMat := self >> let(sv:=self.sv,\n        n := EvalScalar(sv * self.func.domain()), N := EvalScalar(Cols(self)),\n        nv := EvalScalar(Rows(self)), \n\tfunc := fTensor(self.func, fId(sv)).lambda(),\n        Scat(fAdd(nv, n, 0)).toAMat() *\n        AMatMat(List([0..n-1], row -> BasisVec(N, EvalScalar(func.at(row)))))),\n));\n\n#F ==========================================================================\n#F RCVGath_sv(<func>, <v>, <sv>) - vector gather (read) matrix on subvectors\n#F NOTE: EXPLAIN THIS\n#F ==========================================================================\nClass(RCVGath_sv, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.func],    # self >> [self.func, self.v, self.sv],\n    rSetChild := rSetChildFields(\"func\"), # rSetChildFields(\"func\", \"v\", \"sv\"),\n    from_rChildren := (self, rch) >> ObjId(self)(rch[1], self.v, self.sv, self.rem),\n    #-----------------------------------------------------------------------\n    dims := self >> let(\n        n := self.func.domain() * self.sv, nv := _roundup(n, self.v),\n\tN := self.func.range() * self.sv,  \n        2 * [nv, N]),\n    #-----------------------------------------------------------------------\n    area := self >> 2 * self.func.domain() * self.sv,\n    #-----------------------------------------------------------------------\n    transpose := self >> RCVScat_sv(self.func, self.v, self.sv, self.rem),\n    #-----------------------------------------------------------------------\n    toAMat := self >> let(\n\tsv := EvalScalar(self.sv), n := EvalScalar(self.func.domain()), \n\tN  := EvalScalar(self.func.range()),\n        func := fTensor(self.func, fId(sv), fId(2)).lambda(),\n        Scat(fTensor(fAdd(_roundup(n, self.v), n, 0), fId(2))).toAMat() * \n\tAMatMat(List([0..2*n-1], row -> BasisVec(2*N, EvalScalar(func.at(row).ev()))))),\n));\n\n#F ==========================================================================\n#F VStretchGath(<func>, <part>, <v>) -\n#F   vector gather (read) matrix on subvectors\n#F   reads according to func but fills up entire vectors\n#F NOTE: EXPLAIN THIS\n#F ==========================================================================\nClass(VStretchGath, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.func],\n    rSetChild := rSetChildFields(\"func\"),\n    from_rChildren := (self, rch) >> ObjId(self)(rch[1], self.part, self.v),\n    #-----------------------------------------------------------------------\n    dims := self >> let(\n\tn  := self.func.domain(), N := self.func.range(), \n\tnv := self.part * _roundup(n/self.part, self.v),\n        [nv, N]),\n    #-----------------------------------------------------------------------\n    abbrevs := [],\n    new := (self, func, part, v) >> SPL(WithBases(self,\n        rec(func := func, part := part, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    area := self >> self.func.domain(),\n    #-----------------------------------------------------------------------\n    transpose := self >> VStretchScat(self.func, self.part, self.v),\n    #-----------------------------------------------------------------------\n    print := (self,i,is) >> Print(self.name, \"(\", self.func, \", \",\n        self.part, \", \", self.v, \")\", self.printA()),\n    #-----------------------------------------------------------------------\n    toAMat := self >> let(\n\tn  := EvalScalar(self.func.domain()), \n\tN  := EvalScalar(self.func.range()), \n\tnv := self.part * _roundup(n/self.part, self.v),\n        Tensor(I(self.part), Scat(fAdd(nv/self.part, n/self.part, 0))).toAMat() *\n\tAMatMat(List([0..n-1], row -> \n\t\t    BasisVec(N, EvalScalar(self.func.at(row).ev()))))),\n));\n\n\n#F ==========================================================================\n#F vRCStretchGath(<func>, <parts>, <v>) -\n#F   vector gather (read) matrix on subvectors\n#F   reads according to func but fills up entire vectors\n#F NOTE: EXPLAIN THIS\n#F ==========================================================================\nClass(vRCStretchGath, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.func],\n    rSetChild := rSetChildFields(\"func\"),\n    from_rChildren := (self, rch) >> ObjId(self)(rch[1], self.part, self.v),\n    #-----------------------------------------------------------------------\n    dims := self >> let(\n\tn  := self.func.domain(), N := self.func.range(), \n\tnv := self.part * _roundup(n/self.part, self.v/2),\n\t2*[nv, N]),\n    #-----------------------------------------------------------------------\n    abbrevs := [],\n    new := (self, func, part, v) >> SPL(WithBases(self, \n        rec(func := func, part := part, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    area := self >> 2 * self.func.domain(),\n    #-----------------------------------------------------------------------\n    transpose := self >> vRCStretchScat(self.func, self.part, self.v),\n    #-----------------------------------------------------------------------\n    print := (self,i,is) >> Print(self.name, \"(\", self.func, \", \",\n        self.part, \", \", self.v, \")\", self.printA()),\n    #-----------------------------------------------------------------------\n    toAMat := self >> let(\n\tn  := self.func.domain(), N := self.func.range(), \n\tnv := self.part * _roundup(n/self.part, self.v/2),\n        func := fTensor(self.func, fId(2)),\n        Tensor(I(self.part), \n\t       Scat(fAdd(nv/self.part, n/self.part, 0)), I(2)).toAMat() *\n\tAMatMat(List([0..2*n-1], row -> BasisVec(2*N, EvalScalar(func.at(row).ev()))))),\n));\n\n\n#F ==========================================================================\n#F RCVStretchGath(<func>, <parts>, <v>) -\n#F   vector gather (read) matrix on subvectors\n#F   reads according to func but fills up entire vectors\n#F NOTE: EXPLAIN THIS\n#F ==========================================================================\nClass(RCVStretchGath, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.func],\n    rSetChild := rSetChildFields(\"func\"),\n    from_rChildren := (self, rch) >> ObjId(self)(rch[1], self.part, self.v),\n    #-----------------------------------------------------------------------\n    dims := self >> let(\n\tn  := self.func.domain(), N := self.func.range(), \n\tnv := self.part * _roundup(n/self.part, self.v),\n\t2*[nv, N]),\n    #-----------------------------------------------------------------------\n    abbrevs := [],\n    new := (self, func, part, v) >> SPL(WithBases(self, \n        rec(func := func, part := part, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    area := self >> 2 * self.func.domain() * self.v,\n    #-----------------------------------------------------------------------\n    transpose := self >> RCVStretchScat(self.func, self.part, self.v),\n    #-----------------------------------------------------------------------\n    print := (self,i,is) >> Print(self.name, \"(\", self.func, \", \",\n        self.part, \", \", self.v, \")\", self.printA()),\n    #-----------------------------------------------------------------------\n    toAMat := self >> Tensor(VStretchGath(self.func, self.part, self.v),\n                             I(2)).toAMat(),\n));\n\n\n#F ==========================================================================\n#F VGath_pc(N, n, ofs, v) - gather for unaligned partial contiguous vectors\n#F   reads <n> contiguous values out of <N> at an offset <ofs>\n#F   outputs ceil(<n> / <v>) vectors\n#F\n#F   .N   -- input size, only affects dimensions of VGath_pc matrix\n#F   .n   -- how many contiguous points we are reading\n#F   .ofs -- starting offset \n#F   .v   -- vector length\n#F\n#F Example:\n#F\n#F spiral> PrintMat(MatSPL(VGath_pc(5, 3, 0, 4)));\n#F [ [ 1,  ,  ,  ,   ], \n#F   [  , 1,  ,  ,   ], \n#F   [  ,  , 1,  ,   ], \n#F   [  ,  ,  ,  ,   ] ]\n#F\n#F ==========================================================================\nClass(VGath_pc, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.N, self.n, self.ofs, self.v],\n    rSetChild := rSetChildFields(\"N\", \"n\", \"ofs\", \"v\"),\n    #-----------------------------------------------------------------------\n    abbrevs := [],\n    new := (self, N, n, ofs, v) >> SPL(WithBases(self, rec(\n        N := N, n := n, ofs := ofs, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> [ _roundup(self.n, self.v), self.N ],\n    #-----------------------------------------------------------------------\n    area := self >> self.n,\n    #-----------------------------------------------------------------------\n    transpose := self >> VScat_pc(self.N, self.n, self.ofs, self.v),\n    #-----------------------------------------------------------------------\n    toAMat := self >> let(n := self.n, N := self.N, nv := _roundup(n, self.v), \n        Scat(fAdd(nv, n, 0)).toAMat() * Gath(fAdd(N, n, self.ofs)).toAMat()),\n    #-----------------------------------------------------------------------\n    print :=  (self, i, is) >> Print(self.__name__, \"(\", self.N, \n        \", \", self.n, \", \", self.ofs, \", \", self.v, \")\", self.printA()),\n));\n\n#F ==========================================================================\n#F IxVGath_pc(k, N, n, ofs, v)\n#F \n#F Performs multiple stacked VGath_pc operations\n#F   \n#F IxVGath_pc(k, N, n, ofs, v) = I(k) tensor VGath_pc(N, n, ofs, v)\n#F\n#F See also: VGath_pc\n#F\n#F Example: \n#F\n#F spiral> PrintMat(MatSPL(VGath_pc(5, 3, 0, 4)));\n#F [ [ 1,  ,  ,  ,   ], \n#F   [  , 1,  ,  ,   ], \n#F   [  ,  , 1,  ,   ], \n#F   [  ,  ,  ,  ,   ] ]\n#F\n#F spiral> PrintMat(MatSPL(IxVGath_pc(2, 5, 3, 0, 4)));\n#F [ [ 1,  ,  ,  ,  ,  ,  ,  ,  ,   ], \n#F   [  , 1,  ,  ,  ,  ,  ,  ,  ,   ], \n#F   [  ,  , 1,  ,  ,  ,  ,  ,  ,   ], \n#F   [  ,  ,  ,  ,  ,  ,  ,  ,  ,   ], \n#F   [  ,  ,  ,  ,  , 1,  ,  ,  ,   ], \n#F   [  ,  ,  ,  ,  ,  , 1,  ,  ,   ], \n#F   [  ,  ,  ,  ,  ,  ,  , 1,  ,   ], \n#F   [  ,  ,  ,  ,  ,  ,  ,  ,  ,   ] ]\n#F\n#F ==========================================================================\nClass(IxVGath_pc, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.k, self.N, self.n, self.ofs, self.v],\n    rSetChild := rSetChildFields(\"k\", \"N\", \"n\", \"ofs\", \"v\"),\n    #-----------------------------------------------------------------------\n    abbrevs := [],\n    new := (self, k, N, n, ofs, v) >> SPL(WithBases(self, rec(\n        k := k, N := N, n:= n, ofs := ofs, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> [ self.k*_roundup(self.n, self.v), self.k*self.N ],\n    #-----------------------------------------------------------------------\n    area := self >> self.k * self.n, \n    #-----------------------------------------------------------------------\n    transpose := self >> IxVScat_pc(self.k, self.N, self.n, self.ofs, self.v),\n    #-----------------------------------------------------------------------\n    toloop := (self, bksize) >> let(\n\tj := Ind(self.k),\n\tgath := VGath_pc(self.k*self.N, self.n, self.ofs + j*self.N, self.v),\n\tnvecs := Rows(gath) / self.v,\n\tISum(j, j.range, \n             VScat(HH(self.k*nvecs, nvecs, j*nvecs, [1]), self.v) *\n\t     gath).split(bksize)),\n    #-----------------------------------------------------------------------\n    toAMat := self >> \n        Tensor(I(self.k), VGath_pc(self.N, self.n, self.ofs, self.v)).toAMat(),\n    #-----------------------------------------------------------------------\n    print :=  (self, i, is) >> Print(self.__name__, \"(\", self.k, \", \", self.N, \n        \", \", self.n, \", \", self.ofs, \", \", self.v, \")\", self.printA()),\n));\n\n#F ==========================================================================\n#F IxRCVGath_pc(k, N, n, ofs, v)\n#F   vector gather (read) matrix reading unaligned\n#F   partial contiguous COMPLEX vectors\n#F\n#F   IxRCVGath_pc(..params..) == IxVGath_pc(..params..) tensor I(2)\n#F\n#F  Note: IxRCVGath_pc(k, N, n, ofs, v) == IxVGath_pc(k, 2*N, 2*n, 2*ofs, 2*v)\n#F        observe 2*v inside IxVGath_pc.\n#F\n#F        IxVGath_pc(j, 2*N, 2*n, 2*ofs, v), however, is not exactly equal\n#F        it has a different # of rows, if n < v/2\n#F ==========================================================================\nClass(IxRCVGath_pc, BaseSVGath, rec(\n    #-----------------------------------------------------------------------\n    rChildren := self >> [self.k, self.N, self.n, self.ofs, self.v],\n    rSetChild := rSetChildFields(\"k\", \"N\", \"n\", \"ofs\", \"v\"),\n    #-----------------------------------------------------------------------\n    abbrevs := [],\n    new := (self, k, N, n, ofs, v) >> SPL(WithBases(self, rec(\n        k := k, N := N, n := n, ofs := ofs, v := v))).setDims(),\n    #-----------------------------------------------------------------------\n    dims := self >> [ 2*self.k*_roundup(self.n, self.v),  2*self.k*self.N ],\n    #-----------------------------------------------------------------------\n    area := self >> 2 * self.k * self.n, \n    #-----------------------------------------------------------------------\n    transpose := self >> IxRCVScat_pc(self.k, self.N, self.n, self.ofs, self.v),\n    #-----------------------------------------------------------------------\n    toAMat := self >> \n        Tensor(IxVGath_pc(self.k, self.N, self.n, self.ofs, self.v), I(2)).toAMat(),\n    #-----------------------------------------------------------------------\n    print :=  (self, i, is) >> Print(self.__name__, \"(\", self.k, \", \", self.N, \n        \", \", self.n, \", \", self.ofs, \", \", self.v, \")\", self.printA()),\n));\n", "meta": {"hexsha": "7566a7a028e1e56b579f821bd9ce53c3dc3bc9fc", "size": 23791, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/paradigms/vector/sigmaspl/gather.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/paradigms/vector/sigmaspl/gather.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/paradigms/vector/sigmaspl/gather.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 48.5530612245, "max_line_length": 116, "alphanum_fraction": 0.3701820016, "num_tokens": 5769, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.731058578630005, "lm_q2_score": 0.4726834766204328, "lm_q1q2_score": 0.3455593105600228}}
{"text": "\nlocal reps,tori,labels,I,II,ords,blocks;\n\nreps:=[[[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1]],              # E_8\n#       [[1,1],[2,1],[10,1],[11,1],[5,1],[6,1],[7,1],[8,1]],            # E_8(a_1)\n       [[1,1],[2,1],[10,1],[11,1],[5,1],[6,1],[7,1],[8,1]],            # E_8(a_1)\n#       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1],[8,1]],          # E_8(a_2)\n       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1],[8,1]],          # E_8(a_2)\n       [[1,1],[4,1],[6,1],[7,1],[8,1],[17,1],[18,1],[19,1]],           # E_8(a_3) e cel de mai jos dar ordonat\n#       [[8,1],[18,1],[7,1],[6,1],[19,1],[1,1],[17,1],[4,1]],           # E_8(a_3)  merge si in char 5\n#       [[7,1],[8,1],[9,1],[10,1],[11,1],[12,1],[13,1],[19,1]],         # E_8(a_3)\n       [[1,1],[4,1],[6,1],[8,1],[17,1],[18,1],[19,1],[21,1]],          # E_8(a_4) e cel de mai jos dar ordonat\n#       [[18,1],[6,1],[19,1],[1,1],[17,1],[21,1],[4,1],[8,1]],          # E_8(a_4) merge si in char 5\n#       [[9,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[19,1]],       # E_8(a_4)\n       [[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1]],                    # E_7\n       [[1,1],[4,1],[7,1],[8,1],[14,1],[17,1],[19,1],[26,1]],          # E_8(b_4) e cel de mai jos dar ordonat\n#       [[8,1],[7,1],[14,1],[26,1],[19,1],[1,1],[17,1],[4,1]],          # E_8(b_4) merge si in char 5\n#       [[7,1],[8,1],[9,1],[17,1],[18,1],[19,1],[20,1],[21,1]],         # E_8(b_4)\n#       [[18,1],[22,1],[19,1],[1,1],[17,1],[20,1],[21,1],[4,1],[6,1]],  # E_8(a_5)\n       [[1,1],[12,1],[14,1],[15,1],[17,1],[21,1],[26,1],[27,1]],       # E_8(a_5) D_8(a_1) in a D_8: deduced from Seitz' E_8(a_6) used in proof\n#       [[9,1],[14,1],[15,1],[17,1],[18,1],[19,1],[20,1],[26,1]],       # E_8(a_5)\n#       [[1,1],[2,1],[11,1],[10,1],[5,1],[6,1],[7,1]],                  # E_7(a_1)\n       [[1,1],[3,1],[10,1],[11,1],[5,1],[6,1],[7,1]],                  # E_7(a_1)\n#       [[18,1],[8,1],[31,1],[7,1],[33,1],[4,1],[19,1],[23,1]],         # E_8(b_5) # works in char 5\n       [[4,1],[7,1],[8,1],[18,1],[19,1],[23,1],[31,1],[33,1]],         # E_8(b_5) # e cel de sus ordonat\n#       [[8,1],[16,1],[17,1],[18,1],[20,1],[21,1],[24,1],[33,1]],       # E_8(b_5)\n       [[8,1],[7,1],[6,1],[5,1],[4,1],[2,1],[3,1]],                    # D_7\n#       [[18,1],[31,1],[7,1],[33,1],[4,1],[29,1],[23,1],[19,1]],        # E_8(a_6) # works in char 5\n       [[4,1],[7,1],[18,1],[19,1],[23,1],[29,1],[31,1],[33,1]],        # E_8(a_6) # e cel de sus ordonat\n#       [[4,1],[10,1],[12,1],[14,1],[15,1],[26,1],[27,1],[30,1]],       # E_8(a_6)\n#       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1]],                # E_7(a_2)\n       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1]],                # E_7(a_2)\n       [[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[8,1]],                    # E_6A_1\n\n#      [[2,1],[3,1],[10,1],[12,1],[6,1],[7,1],[8,1],[83,1]],            # (D_7(a_1))^{(2)}    char 2\n#       [[8,1],[7,1],[6,1],[5,1],[10,1],[11,-1],[2,1],[3,1]],            # D_7(a_1)\n       [[2,1],[3,1],[10,1],[12,1],[6,1],[7,1],[8,1]],                   # D_7(a_1)\n#       [[4,1],[15,1],[18,1],[19,1],[23,1],[31,1],[33,1],[39,1]],       # E_8(b_6) # deduced from E_8(b_5) ?gp de componente?\n       [[4,1],[8,1],[18,1],[19,1],[23,1],[31,1],[33,1],[39,-1],[41,1]], # E_8(b_6) # cel de mai jos ordonat\n#       [[31,1],[33,1],[18,1],[4,1],[39,-1],[41,1],[8,1],[19,1],[23,1]], # E_8(b_6) # cu - merge si in char 5\n#       [[4,1],[17,1],[12,1],[29,1],[30,1],[31,1],[34,1],[35,1]],        # E_8(b_6) Seitz' used in proof\n#       [[15,1],[22,1],[23,1],[24,1],[25,1],[26,1],[27,1],[28,1]],       # E_8(b_6)\n       [[1,1],[4,1],[6,1],[7,1],[17,1],[18,1],[19,1]],                  # E_7(a_3) e cel de mai jos dar ordonat\n#       [[17,1],[1,1],[19,1],[6,1],[7,1],[18,1],[4,1]],                  # E_7(a_3) merge si in char 5\n#       [[1,1],[4,1],[7,1],[12,1],[13,1],[17,1],[19,1]],                 # E_7(a_3)\n#       [[3,1],[5,1],[1,1],[6,1],[11,1],[12,1],[2,1],[8,1]],             # E_6(a_1)A_1\n       [[1,1],[2,1],[11,1],[12,1],[5,1],[6,1],[8,1]],                   # E_6(a_1)+A_1\n#       [[1,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1],[67,1]],             # (A_7)^{(3)}     char 3\n       [[1,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1]],                     # A_7\n#       [[8,1],[7,1],[13,1],[10,1],[11,-1],[12,1],[2,1],[3,1]],          # D_7(a_2)\n       [[2,1],[3,1],[10,1],[12,1],[13,1],[14,1],[8,1]],                 # D_7(a_2)\n       [[1,1],[2,1],[3,1],[4,1],[5,1],[6,1]],                           # E_6\n       [[7,1],[6,1],[5,1],[4,1],[2,1],[3,1]],                           # D_6\n#       [[1,1],[2,1],[3,1],[4,1],[5,1],[7,1],[8,1],[51,1]],             # (D_5+A_2)^{(2)}     char 2\n       [[1,1],[3,1],[4,1],[2,1],[5,1],[7,1],[8,1]],                     # D_5A_2\n#       [[3,1],[5,1],[1,1],[6,1],[11,1],[12,1],[2,1]],                   # E_6(a_1)\n       [[1,1],[2,1],[11,1],[12,1],[5,1],[6,1]],                         # E_6(a_1)\n       [[1,1],[4,1],[7,1],[14,1],[17,1],[18,1],[19,1],[26,1]],          # E_7(a_4) e cel de mai jos dar ordonat\n#       [[17,1],[1,1],[19,1],[14,1],[26,1],[7,1],[18,1],[4,1]],          # E_7(a_4) merge si in char 5\n#       [[1,1],[4,1],[7,1],[11,1],[25,1],[26,1],[27,1]],                 # E_7(a_4)\n       [[2,1],[4,1],[5,1],[6,1],[7,1],[8,1],[1,1]],                     # A_6A_1\n#       [[7,1],[6,1],[5,1],[10,1],[11,-1],[2,1],[3,1]],                  # D_6(a_1)\n       [[2,1],[3,1],[10,1],[12,1],[6,1],[7,1]],                         # D_6(a_1)\n       [[2,1],[4,1],[5,1],[6,1],[7,1],[8,1]],                           # A_6\n#       [[47,1],[49,1],[5,1],[45,1],[44,1],[42,1],[27,1],[46,1]],        # E_8(a_7)\n       [[30,1],[33,1],[35,1],[36,1],[40,1],[45,1],[53,1],[58,1]],       # E_8(a_7)\n\n       [[1,1],[3,1],[4,1],[2,1],[5,1],[7,1]],                # D_5A_1\n#       [[24,1],[26,1],[7,1],[27,1],[23,1],[4,1],[25,1]],     # E_7(a_5)\n       [[4,1],[7,1],[23,1],[24,1],[25,1],[26,1],[27,1]],     # E_7(a_5) e cel de sus ordonat\n#       [[4,1],[11,1],[14,1],[16,1],[24,1],[25,1],[26,1]],    # E_7(a_5)\n       [[1,1],[4,1],[6,1],[8,1],[17,1],[18,1],[19,1]],       # E_6(a_3)A_1  e cel de mai jos dar ordonat\n#       [[17,1],[1,1],[19,1],[6,1],[18,1],[4,1],[8,1]],       # E_6(a_3)A_1 merge si in char 5\n#       [[4,1],[6,1],[9,1],[11,1],[18,1],[19,1],[8,1]],       # E_6(a_3)+A_1\n#       [[7,1],[13,1],[10,1],[11,-1],[12,1],[2,1],[3,1]],     # D_6(a_2)\n       [[2,1],[3,1],[10,1],[12,1],[13,1],[14,1]],            # D_6(a_2)\n#       [[1,1],[3,1],[10,1],[12,1],[2,1],[5,1],[7,1],[8,1]],  # D_5(a_1)A_2\n       [[1,1],[10,1],[11,1],[2,1],[5,1],[7,1],[8,1]],        # D_5(a_1)+A_2\n       [[2,1],[4,1],[5,1],[6,1],[7,1],[1,1]],                # A_5A_1\n       [[1,1],[3,1],[4,1],[2,1],[6,1],[7,1],[8,1]],          # A_4A_3\n       [[1,1],[3,1],[4,1],[2,1],[5,1]],                      # D_5\n       [[1,1],[4,1],[6,1],[17,1],[18,1],[19,1]],             # E_6(a_3)  e cel de mai jos dar ordonat\n#       [[17,1],[1,1],[19,1],[6,1],[18,1],[4,1]],             # E_6(a_3) merge si in char 5\n#       [[4,1],[6,1],[9,1],[11,1],[18,1],[19,1]],             # E_6(a_3)\n#       [[2,1],[3,1],[4,1],[5,1],[7,1],[8,1],[63,1]],        # (D_4+A_2)^{(2)}     char 2\n       [[3,1],[4,1],[2,1],[5,1],[7,1],[8,1]],                # D_4A_2\n       [[5,1],[6,1],[7,1],[8,1],[1,1],[3,1],[2,1]],          # A_4A_2A_1\n#       [[1,1],[3,1],[10,1],[12,1],[2,1],[5,1],[7,1]],        # D_5(a_1)A_1\n       [[1,1],[10,1],[11,1],[2,1],[5,1],[7,1]],              # D_5(a_1)+A_1\n       [[1,1],[3,1],[4,1],[5,1],[6,1]],                      # A_5\n       [[1,1],[3,1],[4,1],[2,1],[6,1],[7,1]],                # A_4A_2\n       [[1,1],[3,1],[4,1],[2,1],[6,1],[8,1]],                # A_4A_1^2\n#       [[1,1],[3,1],[10,1],[12,1],[2,1],[5,1]],              # D_5(a_1)\n       [[1,1],[10,1],[11,1],[2,1],[5,1]],                    # D_5(a_1)\n\n       [[1,1],[3,1],[4,1],[6,1],[7,1],[8,1]],          # A_3^2\n       [[1,1],[3,1],[4,1],[2,1],[6,1]],                # A_4A_1\n#       [[3,1],[10,1],[12,1],[2,1],[5,1],[7,1],[8,1]],  # D_4(a_1)A_2\n       [[2,1],[3,1],[10,1],[12,1],[7,1],[8,1]],        # D_4(a_1)+A_2\n       [[3,1],[4,1],[2,1],[5,1],[7,1]],                # D_4A_1\n       [[5,1],[6,1],[7,1],[1,1],[3,1],[2,1]],          # A_3A_2A_1\n       [[1,1],[3,1],[4,1],[2,1]],                      # A_4\n#       [[1,1],[3,1],[4,1],[6,1],[7,1],[44,1]],        # (A_3+A_2)^{(2)}     char 2\n       [[3,1],[4,1],[2,1],[6,1],[7,1]],                # A_3A_2\n#       [[3,1],[10,1],[12,1],[2,1],[5,1],[7,1]],        # D_4(a_1)A_1\n       [[2,1],[3,1],[10,1],[12,1],[7,1]],              # D_4(a_1)+A_1 Ross'\n#       [[2,1],[5,1],[10,1],[11,1],[7,1]],              # D_4(a_1)+A_1 Seitz'\n       [[5,1],[6,1],[7,1],[2,1],[3,1]],                # A_3A_1^2\n       [[1,1],[3,1],[5,1],[6,1],[2,1],[8,1]],          # A_2^2A_1^2\n       [[3,1],[4,1],[2,1],[5,1]],                      # D_4\n#       [[3,1],[10,1],[12,1],[2,1],[5,1]],              # D_4(a_1)\n       [[2,1],[3,1],[10,1],[12,1]],                    # D_4(a_1)\n       [[1,1],[3,1],[4,1],[6,1]],                      # A_3A_1\n       [[1,1],[3,1],[5,1],[6,1],[2,1]],                # A_2^2A_1\n       [[1,1],[3,1],[5,1],[6,1]],                      # A_2^2\n       [[1,1],[3,1],[2,1],[5,1],[7,1]],                # A_2A_1^3\n       [[1,1],[3,1],[4,1]],                            # A_3\n       [[2,1],[4,1],[1,1],[6,1]],                      # A_2A_1^2\n       [[1,1],[3,1],[2,1]],                            # A_2A_1\n       [[2,1],[3,1],[5,1],[7,1]],                      # A_1^4\n       [[1,1],[3,1]],                                  # A_2\n       [[1,1],[4,1],[6,1]],                            # A_1^3\n       [[1,1],[6,1]],                                  # A_1^2\n       [[1,1]]                                         # A_1\n       ];\n\n\nI:=[[],\n    [4],           #??? E_8(a_1)\n    [4,6],         #??? E_8(a_2)\n    [2,3,5],       # E_8(a_3)\n    [2,3,5,7],     # E_8(a_4)\n    [],            # E_7\n    [2,3,5,6],     # E_8(b_4)\n    [2,3,5,6,8],   # E_8(a_5)\n    [4],           # E_7(a_1)\n    [1,2,3,5,6],   # E_8(b_5)\n    [],            # D_7\n    [1,2,3,5,6,8], # E_8(a_6)\n    [4,6],         #??? E_7(a_2)\n    [],            # E_6A_1\n\n#    [4],             # (D_7(a_1))^{(2)}     char 2\n    [4],             # D_7(a_1)\n    [1,2,3,5,6,7],   # E_8(b_6)\n    [2,3,5],         # E_7(a_3)\n    [4],             # E_6(a_1)A_1\n#    [],              # (A_7)^{(3)}     char 3\n    [],              # A_7\n    [4,5],           #??? D_7(a_2)\n    [],              # E_6\n    [],              # D_6\n#    [],              # (D_5+A_2)^{(2)}     char 2\n    [],              # D_5A_2 \n    [4],             # E_6(a_1)\n    [2,3,5,6],       # E_7(a_4)\n    [],              # A_6A_1\n    [4],             # D_6(a_1)\n    [],              # A_6\n    [1,2,3,4,6,7,8], # E_8(a_7)\n    \n    [],          # D_5A_1\n    [1,2,3,5,6], # E_7(a_5)\n    [2,3,5],     # E_6(a_3)A_1\n    [4,5],       #??? D_6(a_2)\n    [4],         # D_5(a_1)A_2 \n    [],          # A_5A_1\n    [],          # A_4A_3\n    [],          # D_5\n    [2,3,5],     # E_6(a_3)\n#    [],          # (D_4+A_2)^{(2)}     char 2\n    [],          # D_4A_2\n    [],          # A_4A_2A_1\n    [4],         # D_5(a_1)A_1 \n    [],          # A_5\n    [],          # A_4A_2\n    [],          # A_4A_1\n    [4],         # D_5(a_1) check this also\n    \n    [],  # A_3^2\n    [],  # A_4A_1\n    [4], # D_4(a_1)A_2\n    [],  # D_4A_1\n    [],  # A_3A_2A_1\n    [],  # A_4\n#    [],  # (A_3+A_2)^{(2)}     char 2\n    [],  # A_3A_2\n    [4], # D_4(a_1)A_1\n    [],  # A_3A_1^2\n    [],  # A_2^2A_1^2\n    [],  # D_4\n    [4], # D_4(a_1)\n    [],  # A_3A_1\n    [],  # A_2^2A_1\n    [],  # A_2^2\n    [],  # A_2A_1^3\n    [],  # A_3\n    [],  # A_2A_1^2\n    [],  # A_2A_1\n    [],  # A_1^4\n    [],  # A_2\n    [],  # A_1^3\n    [],  # A_1^2\n    []   # A_1\n    ];\n\n\n#\n# The parabolic where the representative is distinguished\n#\nII:=[[1,2,3,4,5,6,7,8], # E_8\n     [1,2,3,4,5,6,7,8], # E_8(a_1)\n     [1,2,3,4,5,6,7,8], # E_8(a_2)\n     [1,2,3,4,5,6,7,8], # E_8(a_3)\n     [1,2,3,4,5,6,7,8], # E_8(a_4)\n     [1,2,3,4,5,6,7],   # E_7\n     [1,2,3,4,5,6,7,8], # E_8(b_4)\n     [1,2,3,4,5,6,7,8], # E_8(a_5)\n     [1,2,3,4,5,6,7],   # E_7(a_1)\n     [1,2,3,4,5,6,7,8], # E_8(b_5)\n     [2,3,4,5,6,7,8],   # D_7\n     [1,2,3,4,5,6,7,8], # E_8(a_6)\n     [1,2,3,4,5,6,7],   # E_7(a_2)\n     [1,2,3,4,5,6,8],   # E_6A_1\n\n#     [2,3,4,5,6,7,8],   # D_7(a_1)^{(2)}     char 2\n     [2,3,4,5,6,7,8],   # D_7(a_1)\n     [1,2,3,4,5,6,7,8], # E_8(b_6)\n     [1,2,3,4,5,6,7],   # E_7(a_3)\n     [1,2,3,4,5,6,8],   # E_6(a_1)A_1\n#     [1,3,4,5,6,7,8],   # A_7^{(3)}     char 3\n     [1,3,4,5,6,7,8],   # A_7\n     [2,3,4,5,6,7,8],   # D_7(a_2)\n     [1,2,3,4,5,6],     # E_6\n     [2,3,4,5,6,7],     # D_6\n#     [1,2,3,4,5,7,8],   # D_5A_2^{(2)}     char 2\n     [1,2,3,4,5,7,8],   # D_5A_2\n     [1,2,3,4,5,6],     # E_6(a_1)\n     [1,2,3,4,5,6,7],   # E_7(a_4)\n     [1,2,4,5,6,7,8],   # A_6A_1\n     [2,3,4,5,6,7],     # D_6(a_1)\n     [2,4,5,6,7,8],     # A_6\n     [1,2,3,4,5,6,7,8], # E_8(a_7)\n\n     [1,2,3,4,5,7],   # D_5A_1\n     [1,2,3,4,5,6,7], # E_7(a_5)\n     [1,2,3,4,5,6,8], # E_6(a_3)A_1\n     [2,3,4,5,6,7],   # D_6(a_2)\n     [1,2,3,4,5,7,8], # D_5(a_1)A_2\n     [1,2,4,5,6,7],   # A_5A_1\n     [1,2,3,4,6,7,8], # A_4A_3\n     [1,2,3,4,5],     # D_5\n     [1,2,3,4,5,6],   # E_6(a_3)\n#     [2,3,4,5,7,8],   # D_4A_2^{(2)}     char 2\n     [2,3,4,5,7,8],   # D_4A_2\n     [1,2,3,5,6,7,8], # A_4A_2A_1\n     [1,2,3,4,5,7],   # D_5(a_1)A_1\n     [1,3,4,5,6],     # A_5\n     [1,2,3,4,6,7],   # A_4A_2\n     [1,2,3,4,6,8],   # A_4A_1^2\n     [1,2,3,4,5],     # D_5(a_1)\n\n     [1,3,4,6,7,8], # A_3^2\n     [1,2,3,4,6],   # A_4A_1\n     [2,3,4,5,7,8], # D_4(a_1)A_2\n     [2,3,4,5,7],   # D_4A_1\n     [1,2,3,5,6,7], # A_3A_2A_1\n     [1,2,3,4],     # A_4\n#     [2,3,4,6,7],   # A_3A_2^{(2)}     char 2\n     [2,3,4,6,7],   # A_3A_2\n     [2,3,4,5,7],   # D_4(a_1)A_1\n     [2,3,5,6,7],   # A_3A_1^2\n     [1,2,3,5,6,8], # A_2^2A_1^2\n     [2,3,4,5],     # D_4\n     [2,3,4,5],     # D_4(a_1)\n     [1,3,4,6],     # A_3A_1\n     [1,2,3,5,6],   # A_2^2A_1\n     [1,3,5,6],     # A_2^2\n     [1,2,3,5,7],   # A_2A_1^3\n     [1,3,4],       # A_3\n     [1,2,4,6],     # A_2A_1^2\n     [1,2,3],       # A_2A_1\n     [2,3,5,7],     # A_1^2\n     [1,3],         # A_2\n     [1,4,6],       # A_1^3\n     [1,6],         # A_1^2\n     [1]            # A_1\n     ];\n     \n\nlabels:=[\"E_8\",\n         \"E_8(a_1)\",\n         \"E_8(a_2)\",\n         \"E_8(a_3)\",\n         \"E_8(a_4)\",\n         \"E_7\",\n         \"E_8(b_4)\",\n         \"E_8(a_5)\",\n         \"E_7(a_1)\",\n         \"E_8(b_5)\",\n         \"D_7\",\n         \"E_8(a_6)\",\n         \"E_7(a_2)\",\n         \"E_6A_1\",\n\n#         \"D_7(a_1)^{(2)}\",\n         \"D_7(a_1)\",\n         \"E_8(b_6)\",\n         \"E_7(a_3)\",\n         \"E_6(a_1)A_1\",\n#         \"A_7^{(3)}\",\n         \"A_7\",\n         \"D_7(a_2)\",\n         \"E_6\",\n         \"D_6\",\n#         \"D_5A_2^{(2)}\",\n         \"D_5A_2\",\n         \"E_6(a_1)\",\n         \"E_7(a_4)\",\n         \"A_6A_1\",\n         \"D_6(a_1)\",\n         \"A_6\",\n         \"E_8(a_7)\",\n         \n         \"D_5A_1\",\n         \"E_7(a_5)\",\n         \"E_6(a_3)A_1\",\n         \"D_6(a_2)\",\n         \"D_5(a_1)A_2\",\n         \"A_5A_2\",\n         \"A_4A_3\",\n         \"D_5\",\n         \"E_6(a_3)\",\n#         \"D_4A_2^{(2)}\",\n         \"D_4A_2\",\n         \"A_4A_2A_1\",\n         \"D_5(a_1)A_1\",\n         \"A_5\",\n         \"A_4A_2\",\n         \"A_4A_1^2\",\n         \"D_5(a_1)\",\n         \n         \"A_3^2\",\n         \"A_4A_1\",\n         \"D_4(a_1)A_2\",\n         \"D_4A_1\",\n         \"A_3A_2A_1\",\n         \"A_4\",\n#         \"A_3A_2^{(2)}\",\n         \"A_3A_2\",\n         \"D_4(a_1)A_1\",\n         \"A_3A_1^2\",\n         \"A_2^2A_1^2\",\n         \"D_4\",\n         \"D_4(a_1)\",\n         \"A_3A_1\",\n         \"A_2^2A_1\",\n         \"A_2^2\",\n         \"A_2A_1^3\",\n         \"A_3\",\n         \"A_2A_1^2\",\n         \"A_2A_1\",\n         \"A_1^4\",\n         \"A_2\",\n         \"A_1^3\",\n         \"A_1^2\",\n         \"A_1\"\n         ];\n\ntori:=[\n    [2,2,2,2,2,2,2,2],   # E_8\n    [2,2,2,0,2,2,2,2],   # E_8(a_1)\n    [2,2,2,0,2,0,2,2],   # E_8(a_2)\n    [2,0,0,2,0,2,2,2],   # E_8(a_3)\n    [2,0,0,2,0,2,0,2],   # E_8(a_4)\n    [2,2,2,2,2,2,2,-27], # E_7\n    [2,0,0,2,0,0,2,2],   # E_8(b_4)\n    [2,0,0,2,0,0,2,0],   # E_8(a_5)\n    [2,2,2,0,2,2,2,-21], # E_7(a_1)\n    [0,0,0,2,0,0,2,2],   # E_8(b_5)\n    [-21,2,2,2,2,2,2,2], # D_7\n    [0,0,0,2,0,0,2,0],   # E_8(a_6)\n    [2,2,2,0,2,0,2,-17], # E_7(a_2)\n    [2,2,2,2,2,2,-17,2], # E_6A_1\n\n#    [-16,2,0,2,2,2,2,2],   # D_7(a_1)^{(2)}     char 2\n    [-16,2,2,0,2,2,2,2],   # D_7(a_1)\n    [0,0,0,2,0,0,0,2],     # E_8(b_6)\n    [2,0,0,2,0,2,2,-15],   # E_7(a_3)\n    [2,2,2,0,2,2,-13,2],   # E_6(a_1)A_1\n#    [2,-15,2,2,2,2,2,2],   # A_7^{(3)}     char 4\n    [2,-15,2,2,2,2,2,2],   # A_7\n    [-13,2,2,0,2,0,2,2],   # D_7(a_2)\n    [2,2,2,2,2,2,-16,0],   # E_6\n    [-15,2,2,2,2,2,2,-10], # D_6\n#    [2,2,2,2,2,-12,2,2],   # D_5A_2^{(2)}     char 2\n    [2,2,2,2,2,-12,2,2],   # D_5A_2\n    [2,2,2,0,2,2,-12,0],   # E_6(a_1)\n    [2,0,0,2,0,0,2,-11],   # E_7(a_4)\n    [2,2,-11,2,2,2,2,2],   # A_6(a_1)\n    [-11,2,2,0,2,2,2,-8],  # D_6(a_1)\n    [0,2,-10,2,2,2,2,2],   # A_6\n    [0,0,0,0,2,0,0,0],     # E_8(a_7)\n\n    [2,2,2,2,2,-11,2,-1], # D_5A_1\n    [0,0,0,2,0,0,2,-9],   # E_7(a_5)\n    [2,0,0,2,0,2,-9,2],   # E_6(a_3)A_1\n    [-9,2,2,0,2,0,2,-6],  # D_6(a_2)\n    [2,2,2,0,2,-9,2,2],   # D_5(a_1)A_2\n    [2,2,-9,2,2,2,2,-5],  # A_5A_1\n    [2,2,2,2,-9,2,2,2],   # A_4A_3\n    [2,2,2,2,2,-10,0,0],  # D_5\n    [2,0,0,2,0,2,-8,0],   # E_6(a_3)\n#    [-6,2,2,2,2,-8,2,2],  # D_4A_2^{(2)}     char 2\n    [-6,2,2,2,2,-8,2,2],  # D_4A_2\n    [2,2,2,-7,2,2,2,2],   # A_4A_2A_1\n    [2,2,2,0,2,-8,2,-1],  # D_5(a_1)A_1\n    [2,-9,2,2,2,2,-5,0],  # A_5\n    [2,2,2,2,-8,2,2,-2],  # A_4A_2\n    [2,2,2,2,-7,2,-2,2],  # A_4A_1^2\n    [2,2,2,0,2,-7,0,0],    # D_5(a_1)\n\n    [2,-3,2,2,-6,2,2,2],   # A_3^2\n    [2,2,2,2,-7,2,-1,0],   # A_4A_1\n    [-4,2,2,0,2,-6,2,2],   # D_4(a_1)A_2\n    [-6,2,2,2,2,-7,2,-1],  # D_4A_1\n    [2,2,2,-6,2,2,2,-3],   # A_3A_2A_1\n    [2,2,2,2,-6,0,0,0],    # A_4\n#    [-3,2,2,2,-6,2,2,-2],  # A_3A_2^{(2)}     char 2\n    [-3,2,2,2,-6,2,2,-2],  # A_3A_2\n    [-4,2,2,0,2,-5,2,-1],  # D_4(a_1)A_1\n    [-1,2,2,-5,2,2,2,-3],  # A_3A_1^2\n    [2,2,2,-5,2,2,-3,2],   # A_2^2A_1^2\n    [-6,2,2,2,2,-6,0,0],   # D_4\n    [-4,2,2,0,2,-4,0,0],   # D_4(a_1)\n    [2,-3,2,2,-4,2,-1,0],  # A_3A_1\n    [2,2,2,-5,2,2,-2,0],   # A_2^2A_1\n    [2,0,2,-4,2,2,-2,0],   # A_2^2\n    [2,2,2,-4,2,-2,2,-1],  # A_2A_1^3\n    [2,-3,2,2,-3,0,0,0],   # A_3\n    [2,2,-3,2,-3,2,-1,0],  # A_2A_1^2\n    [2,2,2,-3,0,0,0,0],    # A_2A_1\n    [-1,2,2,-3,2,-2,2,-1], # A_1^4\n    [2,0,2,-2,0,0,0,0],    # A_2\n    [2,-1,-2,2,-2,2,-1,0], # A_1^3\n    [2,0,-1,0,-1,2,-1,0],  # A_1^2\n    [2,0,-1,0,0,0,0,0]     # A_1\n    ];\n\n#blocks:=[];\nblocks:=[\n    [[51, 1], [47, 1], [35, 1], [25, 4], [15, 1]],\n    [[25, 9], [23, 1]],\n    [[25, 7], [23, 1], [20, 2], [5, 2]],\n    [[25, 5], [23, 2], [21, 1], [15, 2], [10, 2], [3, 2]],\n    [[25, 3], [23, 1], [20, 2], [15, 4], [10, 4], [5, 2]],\n    [[25, 4], [24, 2], [22, 2], [15, 2], [10, 2], [3, 1], [1, 3]],\n    [[25, 2], [23, 1], [21, 1], [19, 1], [17, 2], [15, 2], [13, 1], [11, 3], [7, 2], [5, 1], [3, 2]],\n    [[23, 2], [21, 1], [19, 1], [17, 1], [15, 3], [13, 2], [11, 3], [10, 2], [7, 1], [5, 1], [3, 3]],\n    [[25, 2], [22, 2], [19, 1], [17, 1], [16, 2], [15, 1], [12, 2], [11, 2], [7, 1], [6, 2], [3, 1], [1, 3]],\n    [[23, 1], [19, 2], [17, 3], [15, 3], [11, 1], [10, 4], [9, 1], [7, 2], [5, 1], [3, 4]],\n    [[23, 1], [22, 2], [19, 1], [16, 2], [15, 1], [13, 3], [12, 2], [11, 1], [10, 2], [7, 1], [4, 2], [3, 1], [1, 3]],\n    [[19, 2], [15, 5], [11, 1], [10, 8], [9, 1], [5, 7]],\n    [[23, 1], [19, 1], [18, 2], [17, 1], [16, 2], [15, 2], [11, 1], [10, 4], [8, 2], [7, 1], [4, 2], [3, 2], [1, 3]],\n    [[23, 1], [18, 2], [17, 3], [16, 2], [15, 1], [11, 1], [10, 2], [9, 3], [8, 2], [3, 2], [2, 4], [1, 3]],\n    [[19, 1], [17, 2], [15, 3], [13, 1], [11, 3], [10, 6], [7, 2], [5, 4], [3, 3], [1, 1]],\n    [[17, 1], [15, 3], [13, 2], [11, 3], [10, 6], [7, 3], [5, 8], [3, 2]],\n    [[19, 1], [17, 1], [16, 2], [15, 2], [12, 2], [11, 2], [10, 6], [7, 1], [6, 2], [5, 3], [3, 1], [2, 2], [1, 3]],\n    [[17, 1], [15, 1], [14, 2], [13, 2], [12, 2], [11, 1], [10, 4], [9, 2], [8, 2], [7, 1], [5, 7], [3, 2], [2, 2], [1, 1]],\n    [[16, 2], [15, 1], [13, 3], [12, 2], [11, 1], [10, 2], [9, 3], [8, 4], [7, 1], [5, 7], [3, 1], [1, 3]],\n    [[15, 1], [14, 2], [11, 1], [10, 10], [9, 2], [5, 15], [1, 1]],\n    [[23, 1], [17, 7], [15, 1], [11, 1], [9, 7], [3, 1], [1, 14]],\n    [[19, 1], [16, 4], [15, 1], [11, 6], [10, 4], [6, 4], [5, 2], [1, 10]],\n    [[15, 1], [13, 2], [11, 3], [10, 8], [9, 1], [7, 2], [5, 11], [3, 5], [1, 1]],\n    [[17, 1], [15, 1], [13, 6], [11, 1], [10, 2], [9, 6], [7, 1], [5, 7], [3, 1], [1, 8]],\n    [[15, 1], [13, 1], [12, 2], [11, 2], [10, 8], [8, 2], [7, 1], [5, 10], [4, 2], [3, 2], [2, 2], [1, 3]],\n    [[13, 3], [12, 2], [11, 1], [10, 2], [9, 3], [8, 4], [7, 5], [6, 4], [5, 3], [4, 2], [3, 2], [2, 2], [1, 3]],\n    [[15, 1], [12, 4], [11, 1], [10, 6], [9, 4], [7, 1], [5, 10], [3, 5], [1, 6]],\n    [[13, 3], [11, 5], [9, 3], [7, 13], [5, 3], [3, 5], [1, 6]],\n    [[11, 1], [10, 6], [9, 3], [7, 5], [5, 20], [3, 5]],\n    [[15, 1], [12, 2], [11, 5], [10, 4], [9, 3], [8, 2], [5, 10], [3, 1], [2, 6], [1, 6]],\n    [[11, 1], [10, 6], [9, 1], [8, 4], [7, 2], [6, 2], [5, 18], [4, 2], [3, 3], [1, 3]],\n    [[11, 1], [10, 4], [9, 3], [8, 4], [7, 3], [6, 2], [5, 17], [3, 3], [2, 4], [1, 3]],\n    [[11, 1], [10, 6], [8, 4], [7, 5], [5, 17], [4, 4], [3, 1], [1, 6]],\n    [[11, 1], [10, 2], [9, 3], [8, 6], [7, 4], [6, 4], [5, 10], [4, 2], [3, 7], [2, 4], [1, 3]],\n    [[11, 1], [10, 4], [9, 3], [8, 2], [7, 4], [6, 6], [5, 13], [4, 2], [3, 1], [2, 4], [1, 6]],\n    [[5, 48], [4, 2]],\n    [[15, 1], [11, 9], [9, 7], [5, 10], [1, 21]],\n    [[11, 1], [10, 2], [9, 7], [7, 7], [5, 17], [3, 2], [1, 14]],\n    [[11, 1], [9, 6], [7, 14], [5, 7], [3, 14], [1, 8]],\n    [[5, 46], [4, 2], [3, 2], [2, 2]],\n    [[11, 1], [9, 3], [8, 6], [7, 8], [6, 6], [5, 3], [4, 2], [3, 7], [2, 10], [1, 6]],\n    [[11, 1], [10, 2], [9, 7], [6, 14], [5, 9], [4, 2], [1, 17]],\n    [[5, 46], [3, 5], [1, 3]],\n    [[5, 45], [3, 4], [2, 4], [1, 3]],\n    [[11, 1], [9, 1], [8, 8], [7, 8], [6, 8], [5, 1], [3, 8], [2, 8], [1, 15]],\n    [[5, 38], [4, 12], [1, 10]],\n    [[5, 45], [3, 1], [2, 6], [1, 8]],\n    [[5, 36], [3, 20], [1, 8]],\n    [[11, 1], [8, 6], [7, 14], [6, 6], [3, 2], [2, 14], [1, 21]],\n    [[5, 32], [4, 8], [3, 10], [2, 10], [1, 6]],\n    [[5, 45], [1, 23]],\n    [[5, 30], [4, 8], [3, 13], [2, 8], [1, 11]],\n    [[5, 29], [4, 6], [3, 14], [2, 14], [1, 9]],\n    [[5, 25], [4, 10], [3, 14], [2, 14], [1, 13]],\n    [[5, 18], [4, 12], [3, 20], [2, 20], [1, 10]],\n    [[11, 1], [7, 26], [3, 1], [1, 52]],\n    [[5, 29], [3, 25], [1, 28]],\n    [[5, 21], [4, 16], [3, 9], [2, 14], [1, 24]],\n    [[5, 14], [4, 14], [3, 23], [2, 18], [1, 17]],\n    [[5, 14], [3, 50], [1, 28]],\n    [[5, 7], [4, 14], [3, 28], [2, 28], [1, 17]],\n    [[5, 13], [4, 32], [1, 55]],\n    [[5, 3], [4, 16], [3, 27], [2, 32], [1, 24]],\n    [[5, 1], [4, 12], [3, 32], [2, 32], [1, 35]],\n    [[4, 8], [3, 28], [2, 48], [1, 36]],\n    [[5, 1], [3, 55], [1, 78]],\n    [[4, 2], [3, 27], [2, 52], [1, 55]],\n    [[3, 14], [2, 64], [1, 78]],\n    [[3, 1], [2, 56], [1, 133]]\n    ];\n\n#ords:=[];\nords:=[ 125, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 5, 25, 25,  25, 5, 25, 25, 5, 5, 25, 5, 5, 5, 25, 5, 5, 5, 5, 5, 5, 25, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];\n\nreturn [reps,tori,labels,I,II,ords,blocks];\n", "meta": {"hexsha": "40e3934093e52164a0ba6b09e2fa7af26ec85085", "size": 23449, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/data/dataE8char5Mix.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/data/dataE8char5Mix.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/data/dataE8char5Mix.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 44.495256167, "max_line_length": 261, "alphanum_fraction": 0.318137234, "num_tokens": 13421, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.6688802735722128, "lm_q2_score": 0.5117166047041654, "lm_q1q2_score": 0.342277142545966}}
{"text": "#\n# cls 15: A_2\n#\nhandle15char2:=function()\n    local tmp1,tmp2,o,info,rep,cent,u;\n    o:=AllClasses(orbs)[15];\n    info:=infos[15];\n    \n    rep:=Representative(o);\n    #pr[7]=[0,0,1,1]-->[0,1,1,0]\n    #pr[13]=[0,1,2,1]-->[1,1,2,0]\n    tmp1:=ApplyRootsReflections(rep,[7,13]);\n    u:=Unipotent(algebraicU(orbs),[[4,1]]);\n    tmp1:=Conj(tmp1,u);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[7,13]);\n    tmp2:=Conj(tmp2,u);\n\n    return [tmp1,tmp2];\nend;\n\n#\n# cls 14: \\tilde A_2\n#\nhandle14char2:=function()\n    local tmp1,tmp2,o,info,rep,cent,u;\n    o:=AllClasses(orbs)[14];\n    info:=infos[14];\n    \n    rep:=Representative(o);\n    #pr[8]=[1,0,1,1]-->[0,1,1,1]  \n    #pr[10]=[0,0,2,1]-->[0,1,2,0] \n    # merge si [13,11],[19,20] \n    tmp1:=ApplyRootsReflections(rep,[8,10]);\n    u:=Unipotent(chevalleyAdj(rep),[[3,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,u);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[8,10]);\n    u:=Unipotent(chevalleyAdj(rep),[[3,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,u);\n\n    return [tmp1,tmp2];\nend;\n\n\n#\n# cls 12: B_2\n#\nhandle12char2:=function()\n    local tmp1,tmp2,o,info,rep,cent;\n    o:=AllClasses(orbs)[12];\n    info:=infos[12];\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[9]);#pr[9]=[0,1,1,1]-->[1,1,1,0]\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[9]);#pr[9]=[0,1,1,1]-->[1,1,1,0]\n    return [tmp1,tmp2];\nend;\n\n#\n# cls 11: B_2^{(2)} [6,12,22]\n#\n# here there is no component group\n#\nhandle11char2:=function()\n    local rep,cc,zz,uu;\n    \n    rep:=Unipotent(alg,[[6,1],[12,1],[22,1]]);\n    cc:=UnipotentCentralizer(rep);\n    zz:=Zentrum(cc[1]);\n    uu:=Unipotent(alg,[[1,1]],Ordering(rep));# A_1 the reductive part of the Levi\n    \n    return [rep,cc,zz,uu,TorusWeights(zz,[1])];\nend;\n\n#\n# cls 8: C_3(a_1)\n#\n# here there is no component group\n#\nhandle8char2:=function()\n    local o,rep,cc,ccc,zz,zzz,uu,dist_par;\n\n    o:=AllClasses(orbs)[8];\n    rep:=BorelRep(o);\n    vals:=ShallowCopy(avars);\n    vals[1]:=Zero(APR);\n    vals[2]:=Zero(APR);\n    vals[5]:=Zero(APR);\n    vals[6]:=Zero(APR);\n    vals[8]:=Zero(APR);\n    vals[12]:=vals[11];\n    vals[15]:=vals[9];\n    vals[18]:=vals[13];\n    vals[20]:=vals[16];\n    cc:=Value(generic,avars,vals);\n    # a_9+a_9^2+a_11^2=0\n    #ccc:=Value(cc,[avars[9]],[Zero(APR)]); NU: a_9=0 <=> a_11=0\n    \n    zz:=Zentrum(infos[8][1]); # centrul centralizatorului calculat inainte\n    dist_par:=ToPositiveBorel(o,0Level(DistinguishedParabolic(o)));\n    zzz:=Subword(zz,dist_par);\n#    uu:=Unipotent(alg,[[1,1]],Ordering(rep));# A_1 the reductive part of the Levi\n    \n    return [cc,zz,zzz];\nend;\n\n\n##\n## cls 7: C_3(a_1)\n##\n#handle7char3:=function()\n#    local tmp1,tmp2,o,info,rep,cent;\n#    o:=AllClasses(orbs)[7];\n#    info:=infos[7];\n#    \n#    rep:=Representative(o);\n#    tmp1:=ConjugateByTorus(rep,1,-1);# h_1 --> h_4\n#    cent:=FromPositiveBorel(o,info[5]);\n#    tmp2:=ConjugateByTorus(cent,1,-1);# h_1 --> h_4\n#    return [tmp1,tmp2];\n#end;\n\n\n#\n# cls 6: F_4(a_3) [4,6,10,18] (finished?)\n#\nhandle6char2:=function()\n    local tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,o,info,rep,cent,uu;\n    o:=AllClasses(orbs)[6];\n    info:=infos[6];\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[3]);#pr[3]=[0,0,1,0]-->[0,0,1,0]\n    uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[6,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    #tmp1:=ConjugateByTori(tmp1,[1,2,3,4],[1,-1,aaa,aaa^2]);\n\n    tmp3:=ApplyRootsReflections(rep,[5,1]);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1]],Ordering(rep));#[1..24]);\n    tmp3:=Conj(tmp3,uu);\n    tmp3:=ConjNegUa(tmp3,2,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[6,1],[4,1]],Ordering(rep));\n    tmp3:=Conj(tmp3,uu);\n\n    #tmp5:=ConjugateByTori(rep,[3],[-1]);\n    \n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[3]);#pr[3]=[0,0,1,0]-->[0,0,1,0]\n    uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[6,1]]);\n    tmp2:=Conj(tmp2,uu);\n    #tmp2:=ConjugateByTori(tmp2,[1,2,3,4],[1,-1,aaa,aaa^2]);\n\n    tmp4:=ApplyRootsReflections(cent,[5,1]);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1]],Ordering(cent));#[1..24]);\n    tmp4:=Conj(tmp4,uu);\n    tmp4:=ConjNegUa(tmp4,2,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[6,1],[4,1]],Ordering(cent));\n    tmp4:=Conj(tmp4,uu);\n    #tmp4:=ConjugateByTori(tmp4,[3],[aaa]);\n\n    #tmp6:=ConjugateByTori(cent,[3],[-1]);\n\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n#\n# cls 3: F_4(a_2) (finished?)\n#\nhandle3char2:=function()\n    local tmp1,tmp2,o,info,rep,cent,uu,\n    avars,vals,comp1,comp2;\n    o:=AllClasses(orbs)[3];\n    info:=infos[3];\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[2,3]);\n    uu:=Unipotent(chevalleyAdj(rep),[[1,1],[10,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[2,3]);\n    uu:=Unipotent(chevalleyAdj(cent),[[1,1],[10,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    avars:=IndeterminatesOfPolynomialRing(ring(chevalleyAdj(rep)));\n    vals:=ShallowCopy(avars);\n    vals[1]:=One(APR);\n    vals[2]:=Zero(APR);\n    vals[3]:=Zero(APR);\n    vals[4]:=vals[7];\n    vals[6]:=vals[7]+One(APR);\n    vals[9]:=vals[7];\n    vals[5]:=vals[6]+vals[9];\n    vals[10]:=One(APR)+vals[7];\n    vals[11]:=vals[16]+vals[7]+vals[7]^2;\n    vals[12]:=vals[7]*vals[9]+vals[7]+vals[16];\n    vals[13]:=vals[9];\n    vals[15]:=vals[16]+vals[7]^2;\n    vals[17]:=vals[19]+vals[16]+vals[7]+vals[7]^2;\n    vals[18]:=vals[16]+vals[7]+vals[7]^2;\n    vals[20]:=vals[16]^2+vals[7]+vals[7]^4;\n    vals[22]:=vals[7]^4+vals[7]^2+vals[16]^2+vals[7]+vals[16];\n    comp1:=Value(generic,avars,vals);\n\n\n    vals:=ShallowCopy(avars);\n    vals[1]:=Zero(APR);\n    vals[2]:=Zero(APR);\n    vals[3]:=Zero(APR);\n    vals[7]:=vals[4];\n    vals[6]:=vals[7];\n    vals[9]:=vals[7];\n    vals[5]:=vals[6]+vals[9];\n    vals[10]:=vals[7];\n    vals[13]:=vals[9];\n    vals[12]:=vals[7]*vals[9]+vals[16];\n    vals[11]:=vals[16]+vals[7]^2;\n    vals[15]:=vals[16]+vals[7]^2;\n    vals[17]:=vals[19]+vals[16]+vals[7]^2;\n    vals[18]:=vals[16]+vals[7]^2;\n    vals[20]:=vals[16]^2+vals[7]^4;\n    vals[22]:=vals[7]^4+vals[7]^2+vals[16]^2+vals[16];\n    comp2:=Value(generic,avars,vals);\n\n    return [comp1,comp2,tmp1,tmp2];\nend;\n#vals:=ShallowCopy(avars);\n#vals[1]:=One(APR);\n#vals[2]:=Zero(APR);\n#vals[3]:=Zero(APR);\n#vals[4]:=vals[7];\n#vals[6]:=vals[7]+One(APR);\n#vals[9]:=vals[7];\n#vals[5]:=vals[6]+vals[9];\n#vals[10]:=One(APR)+vals[7];\n#vals[11]:=vals[16]+vals[7]+vals[7]^2;\n#vals[12]:=vals[7]*vals[9]+vals[7]+vals[16];\n#vals[13]:=vals[9];\n#vals[15]:=vals[16]+vals[7]^2;\n#vals[17]:=vals[19]+vals[16]+vals[7]+vals[7]^2;\n#vals[18]:=vals[16]+vals[7]+vals[7]^2;\n#vals[20]:=vals[16]^2+vals[7]+vals[7]^4;\n#vals[22]:=vals[7]^4+vals[7]^2+vals[16]^2+vals[7]+vals[16];\n#\n#xx:=Value(generic,avars,vals);\n#vals:=List([1..Length(avars)],i->Zero(APR));\n#vals[7]:=One(APR);\n#xx0:=Value(xx,avars,vals);\n#xxx:=Value(cc[1],[avars[1],avars[2],avars[3],avars[4],avars[5]],[Zero(APR),Zero(APR),Zero(APR),avars[7]^2+avars[8]*avars[7]+a#vars[7]*avars[14]+One(APR),One(APR)]);\n#\n#vals:=ShallowCopy(avars);\n#vals[1]:=Zero(APR);\n#vals[2]:=Zero(APR);\n#vals[3]:=Zero(APR);\n#vals[7]:=vals[4];\n#vals[6]:=vals[7];\n#vals[9]:=vals[7];\n#vals[5]:=vals[6]+vals[9];\n#vals[10]:=vals[7];\n#vals[13]:=vals[9];\n#vals[12]:=vals[7]*vals[9]+vals[16];\n#vals[11]:=vals[16]+vals[7]^2;\n#vals[15]:=vals[16]+vals[7]^2;\n#vals[17]:=vals[19]+vals[16]+vals[7]^2;\n#vals[18]:=vals[16]+vals[7]^2;\n#vals[20]:=vals[16]^2+vals[7]^4;\n#vals[22]:=vals[7]^4+vals[7]^2+vals[16]^2+vals[16];\n##Print(\"ok\");\n#yy:=Value(generic,avars,vals);\n#vals[8]:=avars[1];#\n#vals[16]:=avars[2];#\n#vals[14]:=avars[3];#\n#vals[19]:=avars[5];#\n#vals[21]:=avars[6];#\n#vals[23]:=avars[9];#\n#vals[24]:=avars[10];#\n##vals:=ShallowCopy(avars);\n#yy0:=Value(yy,avars,vals);\n#yyy:=Value(cc[1],[avars[1],avars[2],avars[3],avars[4],avars[5]],[Zero(APR),Zero(APR),Zero(APR),avars[8]*avars[7]+avars[7]*avars[14],Zero(APR)]);\n#\n#vals:=List([1..Length(avars)],i->Zero(APR));\n#vals[4]:=One(APR);\n#vals[16]:=One(APR);\n#yy1:=Value(yy,avars,vals);\n\n\n\n\n#\n# cls 2: F_4(a_1)\n#\nhandle2char2:=function()\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=AllClasses(orbs)[2];\n    info:=infos[2];\n    \n    rep:=Representative(o);\n    tmp1:=ConjugateByTori(rep,[3,1],[-1,-1]);# h_1 --> h_4, h_3 --> h_3\n    uu:=Unipotent(chevalleyAdj(rep),[[3,-1]],Ordering(rep));#pr[3]=[0,0,1,0]-->[0,0,1,0]\n    tmp1:=Conj(tmp1,uu);\n    \n    cent:=FromPositiveBorel(o,info[5]);\n    tmp2:=ConjugateByTori(cent,[3,1],[-1,-1]);# h_1 --> h_4, h_3 --> h_3\n    uu:=Unipotent(chevalleyAdj(cent),[[3,-1]],Ordering(cent));#pr[3]=[0,0,1,0]-->[0,0,1,0]\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n", "meta": {"hexsha": "d0ef73974e9efddcf247ee131b824f94e0d4a41b", "size": 8718, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/components/F4char2.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/components/F4char2.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/components/F4char2.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 27.5015772871, "max_line_length": 165, "alphanum_fraction": 0.5884377151, "num_tokens": 3640, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.66192288918838, "lm_q2_score": 0.5078118642792044, "lm_q1q2_score": 0.33613229636782854}}
{"text": "########################################################################\n#\n# walrus: Computational Methods for Finitely Generated Monoids and Groups\n#\n# WARNING\n#\n########################################################################\n#\n# TODO (documentation)\n#  - Examples\n#  - notes on the implementation (design decisions etc)\n#\n# TODO (technical)\n#  - MakeIsReducedDiagram an operation\n#  - Sort out families of elements etc\n#  - what to do about the __ID hack?\n#  - What to do about float vs rational?\n#  - provide a way to label generators\n#  - Introduce an InfoLevel and log things with info levels, remove Print\n#    statements\n#  - Put relators of different presentations into different families\n#  - Check whether some sub-functions could be cleaned out from functions\n#    and would become more generally useful\n#  - Better indexing of locations on relator/places\n#  - Better datastructure for storing one step reachables\n#    (basically a hashmap from orb I think) plus wrapper functions\n#  - PlaceQuadruples should be an object or a record\n#  - Add proper error messages for \"This shouldn't happen\" with a pointer\n#    towards the github issue tracker\n#  - Make a reasonably standard format (and exporter/importer) to exchange\n#    pregroup presentations so we can move them between GAP/other\n#    implementations for cross-checking\n\n#\n# TODO (mathematical/functional)\n#  - Write tests\n#  - Interleaving\n#  - Preparing the presentation (User choosing Pregroup/removing generators, relators)\n#  - check LocationBlobGraph + distances\n#  - Make the distance computation in LBG more efficient?\n#  - Check OneStepReachables\n#  - Check RSymTest\n#\n########################################################################\n#\n# Some notes on the implementation\n#\n# - Stored curvature is always \"negative curvature\", so in most cases a\n#   positive value.\n# - Curvature values are stored as rationals at first, later converted to\n#   floats. This might not be the best way to do this (we might want to\n#   always use rationals or always use floats)\n#\n\n# Alternative to LocationBlobGraph, only has pairs, coloured Green for location pair\n# and red for intermult pair\n# a bit hacky though\nInstallMethod(VertexGraph, \"for a pregroup presentation\",\n              [IsPregroupPresentation and IsPregroupPresentationRep],\nfunction(pres)\n    local mat, v, vd, vg, e, loc, loc2, pg, p, ploc, ploc2, imp, i, backmap, len, li, labels;\n\n    pg := Pregroup(pres);\n\n    li := LocationIndex(pres);\n\n    # Green vertices [[a, b], 0] correspond to locations\n    v := List(Keys(li), l -> [l, 0]);\n    # Red vertices correspond to intermult pairs\n    Append(v, List(IntermultPairs(pg), p -> [p, 1]));\n\n    e := function(a,b)\n        if (a[2] = 0) and (b[2] = 0) then              # both vertices are green\n            if PregroupInverse(a[1][2]) = b[1][1] then # There are locations R(i,a,b) and R'(j,b^-1,c)\n                ploc := li[a[1]];\n                ploc2 := li[b[1]];\n                for loc in ploc do\n                    for loc2 in ploc2 do\n                        if CheckReducedDiagram(loc, loc2) then\n                            return 1;\n                        fi;\n                    od;\n                od;\n                return infinity;\n            fi;\n        elif (a[2] = 0) and (b[2] = 1) then            # a is green, b is red\n            if PregroupInverse(a[1][2]) = b[1][1] then # There is location R(i,a,b)\n                return 1;\n            fi;\n        elif (a[2] = 1) and (b[2] = 0) then            # a is red, b is green\n            if PregroupInverse(a[1][2]) = b[1][1] then #\n                return 0;\n            fi;\n        fi;\n        return infinity;\n    end;\n\n    backmap := HashMap();\n    for i in [1..Length(v)] do\n        backmap[ [__ID(v[i][1][1]), __ID(v[i][1][2]), v[i][2] ] ] := i;\n    od;\n\n    vg := Digraph(v, {i,j} -> e(i,j) <> infinity);\n    SetDigraphVertexLabels(vg, v);\n \n    mat := List(DigraphVertices(vg), i -> List(DigraphVertices(vg), j -> e(v[i], v[j]) ) );\n    vg!.mat := mat;\n    vg!.backmap := backmap;\n\n    return vg;\nend);\n\nInstallMethod(VertexGraphDistances, \"for a pregroup presentation\",\n              [IsPregroupPresentation and IsPregroupPresentationRep],\nfunction(pres)\n    local vg, wt, f, vertices, n, mat, i, j, k, a, b, t, out;\n\n    vg := VertexGraph(pres);\n    vertices := DigraphVertices(vg);\n    mat := vg!.mat;\n\n#    SC_FLOYD_WARSHALL(mat);\n\n    for k in vertices do\n        for i in vertices do\n            for j in vertices do\n                t := mat[i, k] + mat[k, j];\n                if t < mat[i,j] then\n                    mat[i,j] := t;\n                fi;\n            od;\n        od;\n    od;\n    # Can there be more than one such entry?\n    return mat;\nend);\n\nInstallMethod(VertexTriples, \"for a pregroup presentation\",\n            [IsPregroupPresentation and IsPregroupPresentationRep],\nfunction(pres)\n    local v, v1, v2, v1l, v2l, vl, vg, lv, vgd, dist, vtl;\n\n    vg := VertexGraph(pres);\n    vgd := VertexGraphDistances(pres);\n    vtl := HashMap(16384);\n\n    for v in DigraphVertices(vg) do\n\n        vl := DigraphVertexLabel(vg, v);\n        # Only green vertices\n        if (vl[2] = 0) then\n          for v1 in InNeighboursOfVertex(vg, v) do\n              v1l := DigraphVertexLabel(vg, v1);\n              for v2 in OutNeighboursOfVertex(vg, v) do\n                  v2l := DigraphVertexLabel(vg, v2);\n                  dist := vgd[v2][v1];\n                  if (v1l[2] = 0) and (v2l[2] = 0) then\n                      if dist = 1 then\n                          vtl[ [v, v1, v2 ] ] := 1/6;\n                      elif dist = 2 then\n                          vtl[ [ v, v1, v2 ] ] := 1/4;\n                      elif dist = 3 then\n                          vtl[ [ v, v1, v2 ] ] := 3/10;\n                      elif dist > 3 then\n                          vtl[ [ v, v1, v2 ] ] := 1/3;\n                      else\n                          Error(\"this shouldn't happen\");\n                      fi;\n                  elif (v1l[2] = 0) and (v2l[2] = 1) then\n                      if dist = 0 then\n                          vtl[ [ v, v1, v2 ] ] := 0;\n                      elif dist = 1 then\n                          vtl[ [ v, v1, v2 ] ] := 1/6;\n                      elif dist > 1 then\n                          vtl[ [ v, v1, v2 ] ] := 1/4;\n                      else\n                          Error(\"this shouldn't happen\");\n                      fi;\n                  elif (v1l[2] = 1) and (v2l[2] = 0) then\n                      if dist = 1 then\n                          vtl[ [ v, v1, v2 ] ] := 0;\n                      elif dist = 2 then\n                          vtl[ [ v, v1, v2 ] ] := 1/6;\n                      elif dist > 2 then\n                          vtl[ [ v, v1, v2 ] ] := 1/4;\n                      else\n                          Error(\"this shouldn't happen\");\n                      fi;\n                  elif (v1l[2] = 1) and (v2l[2] = 1) then\n                      vtl[ [ v, v1, v2 ] ] := 0;\n                      # what if dist=infinity (i.e. no path)\n                  else\n                      Error(\"this should not happen\");\n                  fi;\n              od;\n          od;\n        fi;\n    od;\n    return vtl;\nend);\n\nInstallGlobalFunction(Vertex,\nfunction(pres, v1, v, v2)\n    local vt, t;\n\n    t := VertexTriples(pres)[ [v, v1, v2] ];\n    if t <> fail then\n        return t;\n    else\n        return 1/3;\n    fi;\nend);\n\n#XXX Computes triples (a,b,c) that are infixes\n#    of strings found here with appropriate numbers\nInstallMethod(ShortRedBlobIndex, \"for a pregroup presentation\",\n              [IsPregroupPresentation],\nfunction(pres)\n    local pg, n, imm, index, nrl, cand, word, nonrletts, len, c;\n\n    pg := Pregroup(pres);\n    n := Size(pg);\n    imm := IntermultMapIDs(pg);\n\n    # TODO: This would be better done by a tree structure\n    index := HashMap();\n\n    cand := [[2..n]];\n\n    nonrletts := [];\n    word := [];\n\n    len := 1;\n\n    # minimum length 3\n    while (len > 0) and (len < 7) do\n        if Length(cand[len]) > 0 then\n            c := Remove(cand[len], 1);\n            word[len] := pg[c];\n            nonrletts[len] := not IsRLetter(pres, pg[c]);\n            # Possible not go further if we have too many R-letters?\n            if IsIntermultPair(word[len], word[1]) and\n               ReduceUPregroupWord(word{ [1..len] }) = [] then\n                nrl := SizeBlist(nonrletts{[1..len]});\n                if len = 3 then\n                    # if len = 3 then no proper subword can be equal to 1\n                    # because we only look at intermult pairs, and pairs\n                    # of inverses are explicitly not intermult pairs\n                    if nrl = 0 then\n                        EnterAllSubwords(index, word{[1..len]}, 1/6);\n                    elif nrl = 1 then\n                        EnterAllSubwords(index, word{[1..len]}, 1/4);\n                    else\n                        # Print(\"? nrl\", nrl, \"\\n\");\n                    fi;\n                elif len = 4 then\n                    if nrl = 0 then\n                        EnterAllSubwords(index, word{[1..len]}, 1/4);\n                    elif nrl = 1 then\n                        EnterAllSubwords(index, word{[1..len]}, 1/3);\n                    else\n                        # Print(\"? nrl\", nrl, \"\\n\");\n                    fi;\n                elif len = 5 then\n                    if (nrl = 0) then\n                        EnterAllSubwords(index, word{[1..len]}, 3/10);\n                    fi;\n                elif (len = 6)\n                     and (ReduceUPregroupWord(word{[2,3,4]}) <> [])\n                     and (ReduceUPregroupWord(word{[3,4,5]}) <> []) then\n                    if nrl = 0 then\n                        EnterAllSubwords(index, word{[1..len]}, 1/3);\n                    else\n                        # Print(\"? nrl\", nrl, \"\\n\");\n                    fi;\n                fi;\n                # We have entered, so backtrack\n                len := len - 1;\n            else\n                if (len = 6) then\n                    len := len - 1;\n                else\n                    len := len + 1;\n                    cand[len] := ShallowCopy(imm[c]);\n                fi;\n            fi;\n        else\n            len := len - 1;\n        fi;\n    od;\n    return index;\nend);\n\n# This should become an operation\nInstallMethod(Blob, \"for a pregroup presentation, an element, an element, and an element\"\n              , [ IsPregroupPresentation\n                , IsElementOfPregroup\n                , IsElementOfPregroup\n                , IsElementOfPregroup ],\nfunction(pres, a, b, c)\n    local it, v, n;\n\n    n := Size(Pregroup(pres));\n    it := ShortRedBlobIndex(pres);\n    v := it[ [__ID(a), __ID(b), __ID(c)] ];\n\n    if v <> fail then\n        return v;\n    fi;\n    return 5/14;\nend);\n\n# TODO: Use a map\nInstallGlobalFunction(VertexFor,\nfunction(vg, trip)\n    return vg!.backmap[ [ __ID(trip[1]), __ID(trip[2]), trip[3] ] ];\nend);\n\n# Compute a list of\n#  - places reachable from loc1 on Relator(loc1), and\n#  - the corresponding location on Relator(loc2)\n# by a consolidated edge between Relator(loc1) and Relator(loc2)\nInstallGlobalFunction(ConsolidatedEdgePlaces,\nfunction(loc1, loc2)\n    local res, length, r1_loc, r2_loc, r1_length;\n\n    res := [];\n    length := 0;\n\n    r1_loc := loc1;\n    r2_loc := loc2;\n    r1_length := Length(Relator(loc1));\n\n    if OutLetter(r1_loc) <> PregroupInverse(InLetter(r2_loc)) then\n        Error(\"This shouldn't happen\");\n#        return [];\n    fi;\n\n    repeat\n        r1_loc := NextLocation(r1_loc);\n        r2_loc := PrevLocation(r2_loc);\n        length := length + 1;\n        Append(res, List(Places(r1_loc), x -> [x, r2_loc, length]));\n    until (OutLetter(r1_loc) <> PregroupInverse(InLetter(r2_loc)))\n          or (length = r1_length);\n\n    # Meh.\n    if (length = r1_length) or\n       (length = Length(Relator(loc2))) then\n        return [];\n    else\n        return res;\n    fi;\nend);\n\n# Helper function to add or update\n# a \"place quadruple\"\nAddOrUpdatePQ := function(L, pq)\n    local pp;\n\n    pp := PositionProperty(L, x -> x[1] = pq[1] and x[2] = pq[2]);\n    if pp = fail then\n        Add(L, Immutable(pq));\n    else\n        if L[pp][4] < pq[4] then\n            L[pp] := Immutable(pq);\n        fi;\n    fi;\nend;\n\n# The RSym tester\n# The epsilon is chosen by the user\nInstallMethod(RSymTestOp, \"for a pregroup presentation, and a rational\",\n              [IsPregroupPresentation, IsRat],\nfunction(pres, eps)\n    local i, j, rel, R, pplaces,\n          places, Ps, P, Q, Pq,\n          osrp, # a one-step reachable place\n          osrpp,\n          L,\n          zeta,\n          xi, psip, pp;\n    # Make sure epsilon is a float\n    # FIXME: To experiment and find out about rounding errors\n    #        we try running this thing with rationals\n    eps := Rat(eps);\n    # FIXME: CAREFUL, if the zeta value is wrong, the RSymTester\n    #        does not work correctly\n    zeta := Minimum(Int(6 * (1 + eps) + 1) - 1,\n                    LengthLongestRelator(pres));\n    Info(InfoWalrus, 10\n         , \"RSymTest start\");\n    Info(InfoWalrus, 10\n         , \"zeta: \", zeta);\n\n    # Precompute some things so it doesn't show up in weird places\n    # in the profiling data\n    # Some of this we might want to compute on demand?\n    VertexGraphDistances(pres);\n    pplaces := Places(pres);\n    if not IsEmpty(pplaces) then\n        OneStepReachablePlaces(pplaces[1]);\n    fi;\n\n    for rel in Relators(pres) do\n        Info(InfoWalrus, 20\n             , \"relator: \", ViewString(rel), \"\\n\");\n        places := Places(rel);\n        for Ps in places do\n            Info(InfoWalrus, 20\n                 , \"  start place: \"\n                 , ViewString(Ps)\n                 , \"\\n\" );\n            L := [ [__ID(Ps), 0, 0, 0] ]; # This list is called L in the paper\n            # This is the list of possible decompositions\n            # The meaning of the components of the quadruples q is\n            # - q[1] is a place\n            # - q[2] is the distance of q[1] from Ps\n            # - q[3] is the number of steps that q[1] is from Ps\n            # - q[4] is a curvature value\n            for i in [1..zeta] do\n                Info(InfoWalrus, 30\n                     , STRINGIFY(\"L = \", ViewString(L)), \", i = \", i);\n                for Pq in L do      # Pq is for \"PlaceQuadruple\", which is\n                                    # a silly name\n                    Info(InfoWalrus, 30,\n                         STRINGIFY(\"Considering: \", Pq));\n                    if Pq[3] = i - 1 then  # Reachable in i - 1 steps\n                        osrpp := OneStepReachablePlaces(pplaces[Pq[1]]);\n                        for osrp in Keys(osrpp) do\n                            Info(InfoWalrus, 30,\n                                 STRINGIFY(\"OneStepReachable: \", osrp));\n                            if Pq[2] + osrp[2] <= Length(rel) then\n                                psip := Pq[4]\n                                        + osrp[2] * (1 + eps) / Length(rel)\n                                        # storing positive values -> subtract here\n                                        - osrpp[osrp];\n                                Info(InfoWalrus, 30\n                                     , STRINGIFY(\"psi' = \"\n                                                , Pq[4], \" + \"\n                                                , osrp[2] * (1+eps) / Length(rel), \" - \"\n                                                , osrpp[osrp], \" = \"\n                                                , psip, \"\\n\")\n                                    );\n                                if psip < 0 then\n                                elif (Pq[4] > 0) and\n                                     (osrp[1] = __ID(Ps)) and\n                                     (Pq[2] + osrp[2] = Length(rel)) then\n                                    # Add the place that caused the failure\n                                    Add( L, Immutable( [ osrp[1], Pq[2] + osrp[2], i, psip ] ) );\n                                    return [fail, L, Pq];\n                                else\n                                    AddOrUpdatePQ(L, [osrp[1], Pq[2] + osrp[2], i, psip]);\n                                fi;\n                            fi;\n                        od;\n                    fi;\n                od;\n            od;\n        od;\n    od;\n    return true;\nend);\n\n\nInstallGlobalFunction(RSymTest,\nfunction(args...)\n    local pg, pgp, rgreen, inv;\n\n    if Length(args) >= 2 then\n        if IsPregroupPresentation(args[1]) then\n            return RSymTestOp(args[1], args[2]);\n        fi;\n        if IsFreeGroup(args[1]) then\n            pgp := PregroupPresentationFromFp(args[1], args[2], args[3]);\n            return RSymTestOp(pgp, args[4]);\n        fi;\n    else\n        # TODO: Usage message\n    fi;\nend);\n\nInstallMethod(IsHyperbolic, \"for a free group, a list, a list, and a rational number\",\n              [IsFreeGroup, IsObject, IsObject, IsRat],\n              {freeg, rrel, grel, eps} -> RSymTest(freeg, rrel, grel, eps));\n\n\nInstallMethod(IsHyperbolic, \"for a pregroup presentation, and a rational number\",\n              [IsPregroupPresentation, IsRat],\n              {pres, eps} -> RSymTest(pres,eps));\n\n", "meta": {"hexsha": "d1092448d1784b0a94f327a3feef9bcaadfb0c8e", "size": 17209, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "gap/walrus.gi", "max_stars_repo_name": "wilfwilson/walrus", "max_stars_repo_head_hexsha": "4af44a0cc9acfd756be8009f7cdf8450a2ba3722", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2021-10-02T14:55:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-02T14:55:52.000Z", "max_issues_repo_path": "gap/walrus.gi", "max_issues_repo_name": "wilfwilson/walrus", "max_issues_repo_head_hexsha": "4af44a0cc9acfd756be8009f7cdf8450a2ba3722", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": 26, "max_issues_repo_issues_event_min_datetime": "2018-11-22T11:15:07.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-21T13:31:01.000Z", "max_forks_repo_path": "gap/walrus.gi", "max_forks_repo_name": "wilfwilson/walrus", "max_forks_repo_head_hexsha": "4af44a0cc9acfd756be8009f7cdf8450a2ba3722", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": 4, "max_forks_repo_forks_event_min_datetime": "2019-02-11T14:47:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-20T10:22:09.000Z", "avg_line_length": 34.9776422764, "max_line_length": 102, "alphanum_fraction": 0.4789354408, "num_tokens": 4548, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.6513548646660542, "lm_q2_score": 0.5156199157230156, "lm_q1q2_score": 0.3358515404248871}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\n#Class(RulesConj, RuleSet);\nRewriteRules(RulesVDiag, rec(\n#    conj_LR_L := ARule(Compose, [@(1,ConjLR), @(2,ConjL)],\n#                    e -> let(c1:=@(1).val.children(), c2:=@(2).val.children(),\n#                    [ ConjL(c1[1] * Prm(fCompose(c1[3], c2[2])) * c2[1], c1[2]) ])),\n#\n#    conj_LR_LR := ARule(Compose, [@(1,ConjLR), @(2,ConjLR)],\n#                    e -> let(c1:=@(1).val.children(), c2:=@(2).val.children(),\n#                    [ ConjLR(c1[1] * Prm(fCompose(c1[3], c2[2])) * c2[1], c1[2], c2[3]) ])),\n#\n#    conj_R_LR := ARule(Compose, [@(1,ConjR), @(2,ConjLR)],\n#                    e -> let(c1:=@(1).val.children(), c2:=@(2).val.children(),\n#                    [ ConjR(c1[1] * Prm(fCompose(c1[2], c2[2])) * c2[1], c2[3]) ])),\n\n    #--------------------------------------------------\n    # handle RCDiag\n\n    VGath_Conj_RCDiag := ARule(Compose, [@(1,VGath), [@(2,ConjDiag), @(3,RCDiag), @(4), @(5) ]],\n       e -> let(f:=@(1).val.func, d:=@(3).val.element, v:=@(1).val.v, prm:=@(4).val,\n                [ VRCDiag(VData(fCompose(d, prm, fTensor(f, fId(v))), v), v),@(1).val ] )),\n\n    Conj_RCDiag_VScat := ARule(Compose, [[@(1,ConjDiag), @(2,RCDiag), @(3), @(4) ], @(5,VScat)],\n       e -> let(f:=@(5).val.func, d:=@(2).val.element, v:=@(5).val.v, prm:=@(3).val,\n                [ @(5).val, VRCDiag(VData(fCompose(d, prm, fTensor(f, fId(v))), v), v) ] )),\n\n    VTensor_Conj_RCDiag := ARule(Compose, [@(1,VTensor), [@(2,ConjDiag), @(3,RCDiag), @(4, L, e->e.params[2] = e.params[1]/@(1).val.vlen), @(5, L,e->e.params[2] = @(1).val.vlen) ]],\n        e -> let(d:=@(3).val.element, v:=@(1).val.vlen, prm:=@(4).val,\n                [ @(1).val, VRCDiag(VData(fCompose(d, prm), v), v) ] )),\n\n    PullInRightConjDiag := ARule( Compose,\n        [ @(1, ConjDiag),\n            @(2, [RecursStep, Grp, BB, SUM, Buf, ISum, Data, COND]) ],\n        e -> [ CopyFields(@(2).val, rec(\n                _children :=  List(@(2).val._children, c -> @(1).val * c),\n                dimensions := [Rows(@(1).val), Cols(@(2).val)] )) ]),\n\n    PullInLeftConjDiag := ARule( Compose,\n        [ @(1, [RecursStep, Grp, BB, SUM, SUMAcc, Buf, ISum, ISumAcc, Data, COND]),\n            @(2, ConjDiag) ],\n        e -> [ CopyFields(@(1).val, rec(\n                _children := List(@(1).val._children, c -> c * @(2).val),\n                dimensions := [Rows(@(1).val), Cols(@(2).val)] )) ])\n));\n\n\n#_leftPerm := (m,n,v) -> Compose(VTensor(Tensor(I(m/(2*v)),L(n, v)), v), Tensor(I(m*n/(2*v^2)), VL(v^2, v)), VTensor(L(m*n/(2*v), m/v), v)).sums();\n#_rightPerm := (m,n,v) -> VTensor(Tensor(I(n/2), L(m/v,m/(2*v))), v).sums();\n#\n#Class(RulesConjTerm, RuleSet);\n#RewriteRules(RulesConjTerm, rec(\n#    ConjR_VRC_Diag := ARule(Compose, [ [ConjR, @(1), @(2,L)], [@(3,VRC), @(4,Diag) ] ],\n#                    e -> let(l := @(2).val, mn_by_2:=l.params[1], m:=l.params[2], n:=2*mn_by_2/m, v:=@(3).val.v,\n#                        [ @(1).val * _leftPerm(m,n,v) * VRCL(@(3).val.child(1), v) ])),\n#\n#    VRCL_VRC := ARule(Compose, [ @(1, VRCL), @(2, VRC) ],\n#                    e -> let(v:=@(1).val.v, [ VRCLR(@(1).val.child(1), v), VRCL(@(2).val.child(1), v) ])),\n#\n#    VRCL_L_ConjL := ARule(Compose, [ [ @(1,VRCL), [Prm, @(5), @(2,L), @(6)] ], [ ConjL, @(3),\n#                        @(4,L, e->let(m2:=e.params[2], n2:=@(2).val.params[2], m2*n2 = @(2).val.params[1])) ] ],\n#                    e -> let(lbar := @(2).val, n:= 2*lbar.params[2], m:=2*@(4).val.params[2], v:=@(1).val.v,\n#                            [ _rightPerm(m,n,v) * @(3).val]))\n#));\n", "meta": {"hexsha": "a2b65bf63baca61aa0eacfc29999945fdab41084", "size": 3605, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/paradigms/vector/rewrite/conj.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/paradigms/vector/rewrite/conj.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/paradigms/vector/rewrite/conj.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 53.0147058824, "max_line_length": 181, "alphanum_fraction": 0.4624133148, "num_tokens": 1364, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.6334102498375401, "lm_q2_score": 0.523420348936324, "lm_q1q2_score": 0.3315398139898095}}
{"text": "#\n# walrus: Computational Methods for Finitely Generated Monoids and Groups\n#\n\n## Presentations\nInstallGlobalFunction(NewPregroupPresentation,\nfunction(pg, rels)\n    local res;\n\n    res := rec( pg := pg );\n    res.rels := List([1..Length(rels)], x -> NewPregroupRelator(res, rels[x], x));\n    # Orgh. Make sure Locations and Places are all computed for the moment\n    Objectify(PregroupPresentationType, res);\n    Locations(res);\n    Places(res);\n    SetVertexTripleCache(res, HashMap());\n\n    return res;\nend);\n\nInstallGlobalFunction(PregroupPresentationFromFp,\nfunction(F, rred, rgreen)\n    local inv, pg, rgreens, inv_test;\n\n    inv_test := function(x)\n        local lr;\n        if Length(x) = 2 then\n            lr := LetterRepAssocWord(x);\n            return lr[1] = lr[2];\n        fi;\n        return false;\n    end;\n\n    # Get the involutions\n    inv := Filtered(rgreen, inv_test);\n    rgreens := Filtered(rgreen, x -> not inv_test(x));\n    pg := PregroupByRedRelators(F, rred, List(inv, x -> LetterRepAssocWord(x)[1]));\n\n    rgreens := List(rgreens, pg!.convert_word);\n\n    return NewPregroupPresentation(pg, rgreens);\nend);\n\nInstallMethod(ViewString\n             , \"for a pregroup presentation\"\n             , [IsPregroupPresentationRep],\nfunction(pgp)\n    # Note that we do not really regard 1 as a generator\n    local res;\n\n    return STRINGIFY(\"<pregroup presentation with \"\n                    , Size(pgp!.pg)-1, \" generators and \"\n                    , Length(pgp!.rels), \" relators>\");\nend);\n\nInstallMethod(Pregroup\n             , \"for a pregroup presentation\"\n             , [IsPregroupPresentation],\n             pgp -> pgp!.pg);\n\nInstallMethod(Generators\n             , \"for a pregroup presentation\"\n             , [IsPregroupPresentation],\nfunction(pres)\n    local gens;\n\n    gens := List(Pregroup(pres), x->x);\n    Remove(gens, 1);\n    return gens;\nend);\n\nInstallMethod(Relators\n             , \"for a pregroup presentation\"\n             , [IsPregroupPresentation],\n             pgp -> pgp!.rels);\n\nInstallMethod(RelatorsAndInverses\n             , \"for a pregroup presentation\"\n             , [IsPregroupPresentation],\nfunction(pgp)\n    local r;\n    r := Relators(pgp);\n    return Concatenation(r, List(r, Inverse));\nend);\n\nInstallMethod(Powers\n             , \"for a pregroup presentation\"\n             , [IsPregroupPresentation],\n             x -> x!.powers);\n\nInstallMethod(RLetters\n             , \"for a pregroup presentation\"\n             , [IsPregroupPresentation],\nfunction(pres)\n    local rels, gens, x, r, rlett;\n\n    rels := RelatorsAndInverses(pres);\n    gens := Generators(pres);\n    rlett := Set([]);\n    for r in rels do\n        for x in gens do\n            if x in r then AddSet(rlett, x); fi;\n        od;\n    od;\n    return rlett;\nend);\n\n# An R-letter is a letter that occurs in any (interleave) of\n# a relation (Definition 7.4)\n# XXX: Note that the code below does not do interleaves yet!\nInstallGlobalFunction(IsRLetter,\nfunction(pres, x)\n    # determine whether x occurs in I(R)\n    return x in RLetters(pres);\nend);\n\nInstallMethod(Locations, \"for a pregroup presentation\",\n              [IsPregroupPresentation and IsPregroupPresentationRep],\nfunction(pres)\n    local rel, locs, w, i, index;\n\n    locs := [];\n\n    for rel in RelatorsAndInverses(pres) do\n        Append(locs, Locations(rel));\n    od;\n\n    # Hack\n    # In particular this ID is ID within presentation\n    index := HashMap(x -> HashBasic([__ID(x[1]), __ID(x[2])]));\n    for i in [1..Length(locs)] do\n        locs[i]![6] := i;\n\n        if IsBound( index[ [ InLetter(locs[i]), OutLetter(locs[i]) ] ] ) then\n            Add( index[ [ InLetter(locs[i]), OutLetter(locs[i]) ] ], locs[i] );\n        else\n            index[ [ InLetter(locs[i]), OutLetter(locs[i]) ] ] := [ locs[i] ];\n        fi;\n    od;\n    SetLocationIndex(pres, index);\n    return locs;\nend);\n\n\n# For a location R(i,a,b) find a matching location\n# R'(j,b^(-1),c) such that a reduced diagram only\n# containing R and R' exists\nFindMatchingLocation := function(loc, c)\n    local locs, b, binv, loc2;\n\n    b := OutLetter(loc);\n    binv := PregroupInverse(b);\n    locs := LocationIndex(PregroupPresentationOf(loc));\n    locs := locs[ [binv, c] ];\n\n    if locs <> fail then\n        for loc2 in locs do\n            if CheckReducedDiagram(loc, loc2) then\n                return loc2;\n            fi;\n        od;\n    fi;\n    return fail;\nend;\n\n# Given a pregroup presentation as the input, find all places\n# B is true if a place will always occur on the boundary\nInstallMethod(Places, \"for a pregroup presentation\",\n              [IsPregroupPresentation and IsPregroupPresentationRep],\nfunction(pres)\n    local loc, loc2,\n          places, a, b, c,\n          rels,\n          locs, i;\n\n    # rels := RelatorsAndInverses(pres);\n    rels := Relators(pres);\n    locs := Locations(pres);\n    places := [];\n\n    for loc in locs do\n        a := InLetter(loc);\n        b := OutLetter(loc);\n        for c in Generators(pres) do\n            # Colour is \"red\"\n            if IsIntermultPair(PregroupInverse(b), c) then\n                Add(places, NewPlace(loc, c, \"red\"));\n            fi;\n            # Colour is \"green\"\n            # find location R'(j,b^(-1),c) and check that a diagram that\n            # meets at the edge b doesn't collapse.\n\n            if FindMatchingLocation(loc, c) <> fail then\n                Add(places, NewPlace(loc, c, \"green\"));\n            fi;\n        od;\n    od;\n    # Hack\n    for i in [1..Length(places)] do\n        places[i]![5] := i;\n    od;\n    return places;\nend);\n\nInstallMethod(LengthLongestRelator, \"for a pregroup presentation\",\n              [IsPregroupPresentation and IsPregroupPresentationRep],\nfunction(pres)\n    return Maximum(List(Relators(pres), Length));\nend);\n\n# Definition 3.3: A diagram is semi-reduced, if no distinct adjacent faces\n# are labelled by ww_1 and w_1^{-1}w for a relator ww_1 and have a common\n# consolidated edge labelled by w and w^-1\n# it is reduced if this also holds for a face incident with itself.\n#\n# test whether label on Relator(l2) beginning at b^(-1) is equal to inverse\n# of label on Relator(l1) ending at b\nInstallGlobalFunction(CheckReducedDiagram,\nfunction(l1, l2)\n    local i, j, r1, r2, iend, jend;\n\n    r1 := Relator(l1);\n    i := Position(l1);\n    iend := i + 1;\n    if iend > Length(r1) then iend := iend - Length(r1); fi;\n\n    r2 := Relator(l2);\n    j := Position(l2) - 1;\n    jend := j - 1;\n    if jend < 0 then jend := jend + Length(r2); fi;\n\n    # Here inverses should match, or otherwise the passed\n    # locations are already incompatible\n    if r1[i] <> PregroupInverse(r2[j]) then\n        Error(\"loc1 and loc2 are not compatible\");\n        return fail;\n    fi;\n\n    repeat\n        i := i - 1;\n        if i = 0 then i := Length(r1); fi;\n        j := j + 1;\n        if j > Length(r2) then j := 1; fi;\n\n#        # Print(\"r1[\", i, \"] = \", r1[i], \" r2[\", j, \"] = \", r2[j], \"\\n\");\n        if r1[i] <> PregroupInverse(r2[j]) then\n            return true;\n        fi;\n    until (i = iend) or (j = jend);\n\n    return false;\nend);\n\nInstallGlobalFunction(PregroupPresentationToFpGroup,\nfunction(pres)\n    local d, F, rels, gens, pg, p, i, j;\n\n    # By Definition 2.2 of the paper\n    d := Size(Pregroup(pres)) - 1;\n    F := FreeGroup(d);\n    pg := Pregroup(pres);\n\n    rels := [];\n    # rels := List([1..d], x -> [ F.(x) * F.(pg!.inv(x+1)-1), One(F) ]);\n    for i in [2..d+1] do\n        for j in [2..d+1] do\n            p := pg[i] * pg[j];\n            if p <> fail then\n                if p = One(pg) then\n                    Add(rels, [F.(i-1) * F.(j-1), One(F)]);\n                else\n                    Add(rels, [F.(i-1) * F.(j-1) * F.(__ID(PregroupInverse(p))-1), One(F)]);\n                fi;\n            fi;\n        od;\n    od;\n    Append(rels, List(Relators(pres), x -> [Product(List(List(x), y -> F.(__ID(y)-1))), One(F)]));\n\n    return F / rels;\nend);\n\n\n\n#T Put pregroup relations in (if pregroup is not the pregroup of the free group)\n#T Choose sensible generator names and print them (maybe just use x1,x2,... or a,b,c))\nif WALRUS_kbmag_available then\n\nInstallGlobalFunction(PregroupPresentationToKBMAG,\n    pres -> KBMAGRewritingSystem(PregroupPresentationToFpGroup(pres)));\n\nfi;\n\n# Writes out pregroup as a multiplication table\n# and then the relators, intended as a simple exchange\n# format\nInstallGlobalFunction(PregroupPresentationToSimpleStream,\nfunction(stream, pres)\n    local row, col, table, n, i, rel;\n\n    table := MultiplicationTableIDs(Pregroup(pres));\n    n := Length(table);\n    AppendTo(stream, \"pregroup:\\n\" );\n\n    for row in [1..n] do\n        AppendTo(stream, \"  \");\n        for col in [1..n-1] do\n            AppendTo(stream, String(table[row][col]));\n            AppendTo(stream, \" \");\n        od;\n        AppendTo(stream, String(table[row][n]));\n        AppendTo(stream, \"\\n\");\n    od;\n\n    AppendTo(stream, \"relators:\\n\");\n    for rel in Relators(pres) do\n        AppendTo(stream, \"  \");\n        for i in [1..Length(rel)-1] do\n            AppendTo(stream, String(__ID(rel[i])));\n            AppendTo(stream, \" \");\n        od;\n        AppendTo(stream, String(__ID(rel[Length(rel)])));\n        AppendTo(stream, \"\\n\");\n    od;\nend);\n\n# Serialises a pregroup presentation as a GAP record\n# that GAP can read back easily\nInstallGlobalFunction(PregroupPresentationToStream,\nfunction(stream, pres)\n    local res, rel, rels;\n\n    res := rec( table := MultiplicationTableIDs(Pregroup(pres)),\n                rels := List(Relators(pres), r -> List(r, x -> __ID(x))));\n\n    PrintTo(stream, res, \";\\n\");\nend);\n\nInstallGlobalFunction(PregroupPresentationFromStream,\nfunction(stream)\n    local res, r, pg, rels;\n    res := READ_ALL_COMMANDS(stream, false, false, IdFunc);\n\n    if Length(res) = 1\n       and res[1][1] = true\n       and IsBound(res[1][2])\n       and IsRecord(res[1][2]) then\n        # FIXME: Store element names, at least don't put arbitarary\n        #        restriction o nnumber of pregroup elts here\n        r := res[1][2];\n        pg := PregroupByTable(\"1abcdefghijklmnopqrstuvwxyz\"{[1..Length(r.table)]}, r.table);\n        return NewPregroupPresentation(pg, List(r.rels, x -> pg_word(pg, x)));\n    else\n        Error(\"Could not read pregroup presentation from stream\");\n    fi;\nend);\n\nInstallGlobalFunction(PregroupPresentationToFile,\nfunction(filename, pres)\n    local outs;\n\n    outs := OutputTextFile(filename, false);\n    SetPrintFormattingStatus(outs, false);\n    PregroupPresentationToStream(outs, pres);\n    CloseStream(outs);\nend);\n\nInstallGlobalFunction(PregroupPresentationToSimpleFile,\nfunction(filename, pres)\n    local outs;\n\n    outs := OutputTextFile(filename, false);\n    SetPrintFormattingStatus(outs, false);\n    PregroupPresentationToSimpleStream(outs, pres);\n    CloseStream(outs);\nend);\n\n\n", "meta": {"hexsha": "bd41ec3e52f9911941ced7bf9ca881ceaeccefdd", "size": 10784, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "gap/presentation.gi", "max_stars_repo_name": "RussWoodroofe/walrus", "max_stars_repo_head_hexsha": "f7a4e3597f288c6d9518aaa39091826dadc864b8", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2021-10-02T14:55:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-02T14:55:52.000Z", "max_issues_repo_path": "gap/presentation.gi", "max_issues_repo_name": "RussWoodroofe/walrus", "max_issues_repo_head_hexsha": "f7a4e3597f288c6d9518aaa39091826dadc864b8", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": 26, "max_issues_repo_issues_event_min_datetime": "2018-11-22T11:15:07.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-21T13:31:01.000Z", "max_forks_repo_path": "gap/presentation.gi", "max_forks_repo_name": "RussWoodroofe/walrus", "max_forks_repo_head_hexsha": "f7a4e3597f288c6d9518aaa39091826dadc864b8", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": 4, "max_forks_repo_forks_event_min_datetime": "2019-02-11T14:47:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-20T10:22:09.000Z", "avg_line_length": 28.5291005291, "max_line_length": 98, "alphanum_fraction": 0.6010756677, "num_tokens": 2988, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.6261241632752915, "lm_q2_score": 0.5273165233795671, "lm_q1q2_score": 0.33016561698226715}}
{"text": "#############################################################################\n##\n#W    pcpgrp3.gi                                                Karel Dekimpe\n#W                                                               Bettina Eick\n##\n##    This file contains the 3-dimensional almost crystallographic groups\n##    as pcp groups. There are 17 types groups.\n##\n\nACPcpGroupDim3Nr01 := function (k1) \nlocal FTL;\n  FTL := FromTheLeftCollector( 3 );\n  SetConjugate( FTL, 2, 1, [2,1,  3,k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr02 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 4 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [2,0,  3,0,  4,k4] );\n  SetConjugate( FTL, 2, 1, [2,-1,  3,0,  4,k2] );\n  SetConjugate( FTL, 3, 1, [2,0,  3,-1,  4,k3] );\n  SetConjugate( FTL, 4, 1, [2,0,  3,0,  4,1] );\n  SetConjugate( FTL, 3, 2, [3,1,  4,k1] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,1] );\n  SetConjugate( FTL, 4, 3, [4,1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr03 := function (k1, k2) \nlocal FTL;\n  FTL := FromTheLeftCollector( 4 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [2,0,  3,0,  4,0] );\n  SetConjugate( FTL, 2, 1, [2,1,  3,0,  4,-k2] );\n  SetConjugate( FTL, 3, 1, [2,0,  3,-1,  4,0] );\n  SetConjugate( FTL, 4, 1, [2,0,  3,0,  4,-1] );\n  SetConjugate( FTL, 3, 2, [3,1,  4,k1] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,1] );\n  SetConjugate( FTL, 4, 3, [4,1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr04 := function (k1, k2) \nlocal FTL;\n  FTL := FromTheLeftCollector( 4 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [2,1,  3,0,  4,k2] );\n  SetConjugate( FTL, 2, 1, [2,1,  3,0,  4,2*k2] );\n  SetConjugate( FTL, 3, 1, [2,0,  3,-1,  4,-k1] );\n  SetConjugate( FTL, 4, 1, [2,0,  3,0,  4,-1] );\n  SetConjugate( FTL, 3, 2, [3,1,  4,2*k1] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,1] );\n  SetConjugate( FTL, 4, 3, [4,1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr05 := function (k1, k2) \nlocal FTL;\n  FTL := FromTheLeftCollector( 4 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [2,0,  3,0,  4,0] );\n  SetConjugate( FTL, 2, 1, [2,0,  3,1,  4,-k2] );\n  SetConjugate( FTL, 3, 1, [2,1,  3,0,  4,-k2] );\n  SetConjugate( FTL, 4, 1, [2,0,  3,0,  4,-1] );\n  SetConjugate( FTL, 3, 2, [3,1,  4,k1] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,1] );\n  SetConjugate( FTL, 4, 3, [4,1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr06 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,0,  4,0,  5,0] );\n  SetConjugate( FTL, 2, 1, [2, 1 ,  3,0,  4,0,  5,-k4] );\n  SetConjugate( FTL, 3, 1, [3,1,  4,0,  5,-k2] );\n  SetConjugate( FTL, 4, 1, [3,0,  4,-1,  5,0] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 2 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,-1,  4,0,  5,k2] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,-1,  5,k3] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr07 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,0,  4,0,  5,0] );\n  SetConjugate( FTL, 2, 1, [2, 1 ,  3,0,  4,-1,  5,-2*k3 - k4] );\n  SetConjugate( FTL, 3, 1, [3,1,  4,0,  5,k1 - k2] );\n  SetConjugate( FTL, 4, 1, [3,0,  4,-1,  5,0] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 2 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k3] );\n  SetConjugate( FTL, 3, 2, [3,-1,  4,0,  5,k2] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,-1,  5,-2*(k3 + k4)] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,2*k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr08 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,1,  4,0,  5,-k3] );\n  SetConjugate( FTL, 2, 1, [2, 1 ,  3,1,  4,-1,  5,-2*k1 + k2 - 2*k3 - k4] );\n  SetConjugate( FTL, 3, 1, [3,1,  4,0,  5,-2*k3] );\n  SetConjugate( FTL, 4, 1, [3,0,  4,-1,  5,-k1] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 2 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,-1,  4,0,  5,k1 + 2*k3] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,-1,  5,-k1 + 2*k2 - 2*k3] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,2*k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr09 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,0,  4,0,  5,0] );\n  SetConjugate( FTL, 2, 1, [2, 1 ,  3,0,  4,0,  5,-k4] );\n  SetConjugate( FTL, 3, 1, [3,0,  4,1,  5,-k3] );\n  SetConjugate( FTL, 4, 1, [3,1,  4,0,  5,-k3] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 2 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,-1,  4,0,  5,k2] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,-1,  5,-k2 + 2*k3] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr10 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 4 );\n  SetRelativeOrder( FTL, 1, 4 );\n  SetPower( FTL, 1, [2,0,  3,0,  4,k4] );\n  SetConjugate( FTL, 2, 1, [2,0,  3,-1,  4,k3] );\n  SetConjugate( FTL, 3, 1, [2,1,  3,0,  4,-k2] );\n  SetConjugate( FTL, 4, 1, [2,0,  3,0,  4,1] );\n  SetConjugate( FTL, 3, 2, [3,1,  4,k1] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,1] );\n  SetConjugate( FTL, 4, 3, [4,1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr11 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,0,  4,0,  5,0] );\n  SetConjugate( FTL, 2, 1, [2, 3 ,  3,0,  4,0,  5,-k4] );\n  SetConjugate( FTL, 3, 1, [3,1,  4,0,  5,-k2 - k3] );\n  SetConjugate( FTL, 4, 1, [3,0,  4,-1,  5,0] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 4 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,0,  4,-1,  5,k3] );\n  SetConjugate( FTL, 4, 2, [3,1,  4,0,  5,-k2] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr12 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,1,  4,0,  5,k3] );\n  SetConjugate( FTL, 2, 1, [2, 3 ,  3,0,  4,-1,  5,-k2 - k3 - k4] );\n  SetConjugate( FTL, 3, 1, [3,1,  4,0,  5,2*k3] );\n  SetConjugate( FTL, 4, 1, [3,0,  4,-1,  5,-k1] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 4 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,0,  4,-1,  5,k1 - k2 - 2*k3] );\n  SetConjugate( FTL, 4, 2, [3,1,  4,0,  5,-k2] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,2*k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr13 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 4 );\n  SetRelativeOrder( FTL, 1, 3 );\n  SetPower( FTL, 1, [2,0,  3,0,  4,k4] );\n  SetConjugate( FTL, 2, 1, [2,-1,  3,-1,  4,k2 + k3] );\n  SetConjugate( FTL, 3, 1, [2,1,  3,0,  4,-k2] );\n  SetConjugate( FTL, 4, 1, [2,0,  3,0,  4,1] );\n  SetConjugate( FTL, 3, 2, [3,1,  4,k1] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,1] );\n  SetConjugate( FTL, 4, 3, [4,1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr14 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,0,  4,0,  5,0] );\n  SetConjugate( FTL, 2, 1, [2, 2 ,  3,0,  4,0,  5,-k4] );\n  SetConjugate( FTL, 3, 1, [3,0,  4,-1,  5,-k2] );\n  SetConjugate( FTL, 4, 1, [3,-1,  4,0,  5,k2] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 3 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,-1,  4,-1,  5,k2 + k3] );\n  SetConjugate( FTL, 4, 2, [3,1,  4,0,  5,-k2] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr15 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,0,  4,0,  5,0] );\n  SetConjugate( FTL, 2, 1, [2, 2 ,  3,0,  4,0,  5,-k4] );\n  SetConjugate( FTL, 3, 1, [3,0,  4,1,  5,-k2] );\n  SetConjugate( FTL, 4, 1, [3,1,  4,0,  5,-k2] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 3 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,-1,  4,-1,  5,k1 + 3*k2 - k3] );\n  SetConjugate( FTL, 4, 2, [3,1,  4,0,  5,-k1 - 3*k2 + 2*k3] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr16 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 4 );\n  SetRelativeOrder( FTL, 1, 6 );\n  SetPower( FTL, 1, [2,0,  3,0,  4,k4] );\n  SetConjugate( FTL, 2, 1, [2,0,  3,-1,  4,k3] );\n  SetConjugate( FTL, 3, 1, [2,1,  3,1,  4,k1 - k2 - k3] );\n  SetConjugate( FTL, 4, 1, [2,0,  3,0,  4,1] );\n  SetConjugate( FTL, 3, 2, [3,1,  4,k1] );\n  SetConjugate( FTL, 4, 2, [3,0,  4,1] );\n  SetConjugate( FTL, 4, 3, [4,1] );\nreturn PcpGroupByCollector(FTL);\nend;\n \nACPcpGroupDim3Nr17 := function (k1, k2, k3 , k4) \nlocal FTL;\n  FTL := FromTheLeftCollector( 5 );\n  SetRelativeOrder( FTL, 1, 2 );\n  SetPower( FTL, 1, [3,0,  4,0,  5,0] );\n  SetConjugate( FTL, 2, 1, [2, 5 ,  3,0,  4,0,  5,-k4] );\n  SetConjugate( FTL, 3, 1, [3,0,  4,1,  5,-k3] );\n  SetConjugate( FTL, 4, 1, [3,1,  4,0,  5,-k3] );\n  SetConjugate( FTL, 5, 1, [3,0,  4,0,  5,-1] );\n  SetRelativeOrder( FTL, 2, 6 );\n  SetPower( FTL, 2, [3,0,  4,0,  5,k4] );\n  SetConjugate( FTL, 3, 2, [3,0,  4,-1,  5,k3] );\n  SetConjugate( FTL, 4, 2, [3,1,  4,1,  5,k1 - k2 - k3] );\n  SetConjugate( FTL, 5, 2, [3,0,  4,0,  5,1] );\n  SetConjugate( FTL, 4, 3, [4,1,  5,k1] );\nreturn PcpGroupByCollector(FTL);\nend;\n\n#############################################################################\n##\n## some small helpers\n##\nACPcpDim3Funcs := [ ACPcpGroupDim3Nr01, ACPcpGroupDim3Nr02,\nACPcpGroupDim3Nr03,\nACPcpGroupDim3Nr04, ACPcpGroupDim3Nr05, ACPcpGroupDim3Nr06,\nACPcpGroupDim3Nr07, ACPcpGroupDim3Nr08, ACPcpGroupDim3Nr09,\nACPcpGroupDim3Nr10, ACPcpGroupDim3Nr11, ACPcpGroupDim3Nr12,\nACPcpGroupDim3Nr13, ACPcpGroupDim3Nr14, ACPcpGroupDim3Nr15,\nACPcpGroupDim3Nr16, ACPcpGroupDim3Nr17 ];\nMakeReadOnlyGlobal( \"ACPcpDim3Funcs\" );\n\n", "meta": {"hexsha": "3422aff908b35ae2c9e9d173717993f450151e5d", "size": 10710, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "gap/pcpgrp3.gi", "max_stars_repo_name": "alex-konovalov/aclib", "max_stars_repo_head_hexsha": "d1afb020805bfd60a8bbb0a9a4adac77fe9b44f1", "max_stars_repo_licenses": ["Artistic-2.0"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "gap/pcpgrp3.gi", "max_issues_repo_name": "alex-konovalov/aclib", "max_issues_repo_head_hexsha": "d1afb020805bfd60a8bbb0a9a4adac77fe9b44f1", "max_issues_repo_licenses": ["Artistic-2.0"], "max_issues_count": 6, "max_issues_repo_issues_event_min_datetime": "2018-03-07T16:35:34.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-26T23:51:07.000Z", "max_forks_repo_path": "gap/pcpgrp3.gi", "max_forks_repo_name": "alex-konovalov/aclib", "max_forks_repo_head_hexsha": "d1afb020805bfd60a8bbb0a9a4adac77fe9b44f1", "max_forks_repo_licenses": ["Artistic-2.0"], "max_forks_count": 1, "max_forks_repo_forks_event_min_datetime": "2018-03-10T19:58:42.000Z", "max_forks_repo_forks_event_max_datetime": "2018-03-10T19:58:42.000Z", "avg_line_length": 36.9310344828, "max_line_length": 77, "alphanum_fraction": 0.5455648926, "num_tokens": 5916, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.7185943805178139, "lm_q2_score": 0.4571367168274948, "lm_q1q2_score": 0.3284958758406009}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\n#Concatenation(Conf(\"spiral_dir\"), Conf(\"path_sep\"), \"libgen\", Conf(\"path_sep\"), \n\n#F InitLibgen(<opts>)\n#F  opts must have a .libgen field.\n#F  Example: opts := InitLibgen(LibgenDefaults);\n#F\nInitLibgen := function(opts) \n    local base_opts, bench;\n    opts := Copy(opts);\n\n    base_opts := CopyFields(opts, rec(\n            globalUnrolling := opts.libgen.basesUnrolling,\n            breakdownRules  := opts.libgen.basesBreakdowns, \n            hashFile        := opts.libgen.basesHashFile,\n            benchTransforms := opts.libgen.bases));\n\n    bench:= CopyFields(DPBench(rec(bases := base_opts), rec(verbosity:=0)), \n                       rec(generateCfiles := false, generateSums := true, matrixVerify := false));\n    bench.resumeAll();\n\n    opts.libgen.baseBench := bench;\n    opts.baseHashes := Concatenation(opts.baseHashes, [ CreateRecursBaseHash(bench.exp.bases.hashTable) ]);\n    return opts;\nend;\n\n_bases := function(max)\n   local t, facs, sizesTwoPower, sizesGeneral;\n   sizesTwoPower := List([1..Log2Int(max)], x->2^x);\n   facs := [2, 3, 5, 7, 11];\n   sizesGeneral := Filtered([2 .. max], i -> ForAll(FactorsInt(i), f -> f in (facs)));\n   t := []; \n   Append(t, List(sizesTwoPower, PRDFT3));\n   Append(t, List(sizesTwoPower, n -> PRDFT3(n, -1).transpose()));\n   Append(t, List(sizesTwoPower, n -> DFT(n, -1 mod n)));\n#  Append(t, List(sizesTwoPower, URDFT));\n   Append(t, List(sizesGeneral, PRDFT));\n   Append(t, List(sizesGeneral, DFT));\n   return t;\nend;\n\nLibgenDefaultsMixin := rec(\n    codegen := RecCodegen,\n    verbosity := 1,\n    hashTable := HashTableDP(),\n\n    formulaStrategies := rec(\n\tsigmaSpl    := [ StandardSumsRules, HfuncSumsRules ],\n\tpreRC       := [],      \n\trc          := [ StandardSumsRules, HfuncSumsRules ],\n        postProcess := [\n\t    (s, opts) -> BlockSums(opts.globalUnrolling, s),\n\t    (s, opts) -> Process_fPrecompute(s, opts),\n            RecursStepTerm            \n        ]   \n    ),\n\n    libgen := rec(\n\tcodeletTab := CreateCodeletHashTable(),\n\tterminateStrategy := [ HfuncSumsRules ], # used in SumsCodelet\n\n\tbases := _bases(34),\n\tbasesUnrolling := 2^16, \n        basesHashFile := let(p:=Conf(\"path_sep\"), \n            Concat(Conf(\"spiral_dir\"), p, \"spiral\", p, \"libgen\", p, \"realbases.hash\")),\n\tbasesBreakdowns := rec(\n\t    DFT    := [DFT_Base, DFT_CT, DFT_GoodThomas, DFT_PD, DFT_Rader],\n\t    PRDFT  := [PRDFT1_Base2, PRDFT1_CT, PRDFT1_PF, PRDFT_Rader, PRDFT_PD],\n\t    PRDFT3 := [PRDFT3_Base1, PRDFT3_Base2, PRDFT3_CT, PRDFT3_OddToPRDFT1])\n    )\n);\n\nLibgenDefaults := CopyFields(SpiralDefaults, LibgenDefaultsMixin, rec(\n    globalUnrolling := 66,\n    breakdownRules := rec(\n\tDFT    := [DFT_Base, DFT_CT],\n\tPRDFT  := [PRDFT1_Base2, PRDFT1_CT],\n\tPRDFT3 := [PRDFT3_Base2, PRDFT3_CT],\n\tPDCT4  := [PDCT4_Base2, PDCT4_CT],\n\tPDST4  := [PDST4_Base2, PDST4_CT],\n\tInfoNt := [Info_Base]),\n    libgen := Copy(LibgenDefaultsMixin.libgen)\n));\n\nCplxLibgenDefaults := CopyFields(CplxSpiralDefaults, LibgenDefaultsMixin, rec(\n    globalUnrolling := 34, \n    breakdownRules := rec(\n\tDFT    := [DFT_Base, DFT_CT],\n\tPRDFT  := [PRDFT1_Base2, PRDFT1_CT],\n\tPRDFT3 := [PRDFT3_Base2, PRDFT3_CT],\n\tInfoNt := [Info_Base]),\n    libgen := CopyFields(Copy(LibgenDefaultsMixin.libgen), rec(\n\tbases := List([1..5], x->DFT(2^x)), \n        basesHashFile := let(p:=Conf(\"path_sep\"), \n            Concat(Conf(\"spiral_dir\"), p, \"spiral\", p, \"libgen\", p, \"cplxbases.hash\")),\n\tbasesBreakdowns := rec(\n\t    DFT    := [DFT_Base, DFT_PRDFT],\n\t    PRDFT  := [PRDFT1_Base1, PRDFT1_Base2, PRDFT1_CT, PRDFT1_PF, PRDFT_PD, PRDFT_Rader],\n\t    PRDFT3 := [PRDFT3_Base1, PRDFT3_Base2, PRDFT3_CT, PRDFT3_OddToPRDFT1])\n    ))\n));\n", "meta": {"hexsha": "e34ae2bd3d99d36edf0d6db4b1a4f2244b34ae30", "size": 3716, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/libgen/defaults.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/libgen/defaults.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/libgen/defaults.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 35.0566037736, "max_line_length": 107, "alphanum_fraction": 0.6391280947, "num_tokens": 1225, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6791787121629465, "lm_q2_score": 0.48047867804790706, "lm_q1q2_score": 0.32633088977833247}}
{"text": "Read(\"SchreierSims.gi\");\n\n#######################################################################\n# Description: The deterministic verification, parallelized w.r.t.    #       \n#              base points, described as method 1 in section 5.1.     #                             \n# Input: - BSGS data structure returned by RandomSchreierSims         # \n# Output: - boolean, true if BSGS is correct, else false              #\n#######################################################################\n\nMethod1 := function(BSGS)\n    local l, tasks, results;\n    \n    Print(\"Start verification.\\n\");\n    Print(\"Apply parallel computing method w.r.t. base points.\\n\");\n    \n    tasks := [1..Length(BSGS[1])];  results := [1..Length(BSGS[1])];\n    \n    for l in [1..Length(BSGS[1])] do\n        tasks[l] := RunTask(SimpleVerify, BSGS, l);\n    od;\n    for l in [1..Length(BSGS[1])] do\n        results[l] := TaskResult(tasks[l]);\n    od;\n    \n    Print(\"\\nVerification done.\");\n    \n    if false in results then\n        Print(\"\\nBSGS is wrong!\\n\");\n    else\n        Print(\"\\nCorrectness of BSGS verified!\\n\");\n    fi;\n    Print(\"*********************************************************\\n\");\nend;\n\n#######################################################################\n#######################################################################\n\n#######################################################################\n# Description: The deterministic verification, parallelized w.r.t.    #       \n#              orbit points, described as method 2 in section 5.1.    #                             \n# Input: - BSGS data structure returned by RandomSchreierSims         # \n# Output: - boolean, true if BSGS is correct, else false              #\n#######################################################################\n\nMethod2 := function(BSGS)\n    local l, tasks, results;\n    \n    Print(\"Start verification.\\n\");\n    Print(\"Apply parallel computing method w.r.t. orbit points.\\n\");\n    \n    tasks := [1..Length(BSGS[1])];  results := [1..Length(BSGS[1])];\n        \n    for l in Reversed([1..Length(BSGS[1])]) do\n        results[l] := ParallelVerify(BSGS, l);\n        if false in results then\n            break;\n        fi;\n    od;\n    \n    Print(\"\\nVerification done.\");\n    \n    if false in results then\n        Print(\"\\nBSGS is wrong!\\n\");\n    else\n        Print(\"\\nCorrectness of BSGS verified!\\n\");\n    fi;\n    Print(\"*********************************************************\\n\");\nend;\n", "meta": {"hexsha": "66047fcac82f56fe1968de92df7e6809c329e67a", "size": 2473, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "src/Verify.gi", "max_stars_repo_name": "AlexanderKlemps/parallel-schreier-sims", "max_stars_repo_head_hexsha": "7a2fc1637f85067ba8162aefbde3f26b1b6da12e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/Verify.gi", "max_issues_repo_name": "AlexanderKlemps/parallel-schreier-sims", "max_issues_repo_head_hexsha": "7a2fc1637f85067ba8162aefbde3f26b1b6da12e", "max_issues_repo_licenses": ["Apache-2.0"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/Verify.gi", "max_forks_repo_name": "AlexanderKlemps/parallel-schreier-sims", "max_forks_repo_head_hexsha": "7a2fc1637f85067ba8162aefbde3f26b1b6da12e", "max_forks_repo_licenses": ["Apache-2.0"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 35.8405797101, "max_line_length": 100, "alphanum_fraction": 0.432672867, "num_tokens": 540, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.5926665999540698, "lm_q2_score": 0.5506073655352404, "lm_q1q2_score": 0.3263265952414386}}
{"text": "\nlocal reps,tori,labels,I,II,ords,mizuno,blocks;\n\nmizuno:=[[1,2,3,4,5,6,7,\n          9,10,11,12,\n          13,14,16,17,\n          19,18,20,21,\n          23,24,25,27,\n          26,28,30,31,\n          32,33,35,34,\n          37,38,39,40,\n          41,44,45,46,\n          48,49,51,52,\n          53,55,57,58,\n          59,61,63,64,\n          66,69,70,71,\n          75,76,80,82,\n          85,89,93,97],\n         [8,\n          15,22,29,36,\n          43,42,47,50,\n          54,56,60,62,\n          65,67,68,72,\n          73,74,77,78,\n          79,81,83,84,\n          86,87,88,90,\n          91,92,94,95,\n          96,98,99,100,\n          101,102,103,104,\n          105,106,107,108,\n          109,110,111,112,\n          114,113,115,116,\n          117,118,119,120]];\n\nreps:=[[[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],[101,1]],          # E_8\n       [[1,1],[2,1],[9,1],[10,1],[5,1],[6,1],[7,1],[101,1]],         # E_8(a_1)\n       [[1,1],[3,1],[2,1],[9,1],[11,1],[12,1],[13,1],[101,1]],       # E_8(a_2)\n       [[8,1],[9,1],[10,1],[11,1],[16,1],[12,1],[7,1],[101,1]],      # E_7+A_1\n       [[1,1],[15,1],[16,1],[17,1],[6,1],[7,1],[101,1]],             # E_7\n       [[8,1],[9,1],[10,1],[11,1],[16,1],[12,1],[13,1],[102,1]],     # D_8\n       [[8,1],[15,1],[16,1],[17,1],[18,1],[19,1],[7,1],[101,1]],     # E_7(a_1)+A_1\n       [[1,1],[15,1],[16,1],[17,1],[24,1],[13,1],[101,1]],           # E_7(a_1)\n       [[1,1],[15,1],[16,1],[17,1],[18,1],[24,1],[13,1],[102,1]],    # D_8(a_1)       ?\n       [[1,1],[15,1],[16,1],[17,1],[18,1],[19,1],[103,1]],           # D_7\n       [[14,1],[15,1],[21,1],[17,1],[18,1],[29,1],[19,1],[101,1]],   # E_7(a_2)+A_1\n       [[20,1],[21,1],[17,1],[23,1],[24,1],[7,1],[101,1]],           # E_7(a_2)\n       [[14,1],[20,1],[21,1],[22,1],[18,1],[33,1],[13,1],[102,1]],   # A_8\n       [[20,1],[21,1],[28,1],[23,1],[24,1],[7,1],[101,1]],           # E_6+A_1\n       [[14,1],[22,1],[23,1],[24,1],[19,1],[25,1],[35,1],[102,1]],   # D_7(a_1)\n#       [[14,1],[22,1],[23,1],[24,1],[19,1],[25,1],[102,1]],          # (D_7(a_1))_2\n       [[20,1],[21,1],[23,1],[24,1],[7,1],[101,1]],                  # E_6\n       [[20,1],[21,1],[22,1],[23,1],[24,1],[25,1],[102,1],[103,1]],  # D_8(a_2)\n       [[8,1],[28,1],[23,1],[24,1],[25,1],[30,1],[102,1]],           # D_6+A_1\n       [[20,1],[21,1],[28,1],[23,1],[24,1],[10,1],[40,1],[103,1]],   # A_7\n       [[20,1],[21,1],[28,1],[23,1],[24,1],[19,1],[103,1]],          # (A_7)_3\n       [[20,1],[21,1],[28,1],[23,1],[31,1],[101,1],[102,1]],         # E_6(a_1)+A_1\n       [[1,1],[28,1],[29,1],[30,1],[31,1],[101,1]],                  # D_6\n       [[20,1],[21,1],[28,1],[29,1],[25,1],[31,1],[103,1]],          # D_7(a_2)\n       [[20,1],[21,1],[23,1],[31,1],[101,1],[102,1]],                # E_6(a_1)\n       [[26,1],[28,1],[27,1],[29,1],[30,1],[31,1],[102,1],[103,1]],  # D_5+A_2\n#       [[26,1],[28,1],[27,1],[29,1],[30,1],[31,1],[102,1]],          # (D_5+A_2)_2\n       [[20,1],[21,1],[28,1],[29,1],[30,1],[31,1],[105,1]],          # A_6+A_1\n       [[28,1],[27,1],[29,1],[30,1],[31,1],[39,1],[102,1]],          # D_6(a_1)+A_1\n       [[28,1],[29,1],[33,1],[31,1],[34,1],[101,1]],                 # D_6(a_1)\n       [[29,1],[21,1],[20,1],[30,1],[31,1],[105,1]],                 # A_6\n#       [[32,1],[33,1],[30,1],[32,1],[40,1],[101,1]],                 # D_5+A_1        ??? two times 32\n       [[26,1],[29,1],[35,1],[38,1],[30,1],[44,1],[47,1],[105,1]],   # 2A_4           ? 26\n       [[32,1],[37,1],[29,1],[31,1],[34,1],[105,1],[107,1]],         # A_5+A_2\n       [[32,1],[37,1],[27,1],[33,1],[40,1],[36,1],[105,1]],          # A_5+2A_1\n       [[32,1],[29,1],[31,1],[34,1],[106,1],[108,1]],                # D_6(a_2)\n       [[30,1],[31,1],[32,1],[33,1],[101,1]],                        # D_5\n       [[37,1],[33,1],[40,1],[34,1],[36,1],[41,1],[105,1]],          # D_5(a_1)+A_2   ? 26/20\n       [[26,1],[27,1],[40,1],[41,1],[106,1],[107,1]],                # (A_5+A_1)'\n       [[32,1],[27,1],[37,1],[33,1],[36,1],[105,1]],                 # (A_5+A_1)''\n       [[37,1],[38,1],[40,1],[49,1],[41,1],[104,1],[108,1]],         # D_4+A_2\n #      [[37,1],[38,1],[40,1],[49,1],[41,1],[104,1]],                 # (D_4+A_2)_2\n       [[37,1],[38,1],[40,1],[34,1],[36,1],[106,1],[107,1]],         # A_4+A_3\n       [[20,1],[21,1],[49,1],[106,1],[107,1]],                       # A_5\n       [[37,1],[42,1],[43,1],[44,1],[45,1],[103,1]],                 # D_5(a_1)+A_1\n       [[37,1],[38,1],[39,1],[40,1],[41,1],[108,1],[109,1]],         # A_4+A_2+A_1\n       \n       [[38,1],[40,1],[39,1],[41,1],[108,1],[109,1]],       # A_4+A_2\n       [[42,1],[43,1],[48,1],[49,1],[102,1]],               # D_5(a_1)\n       [[47,1],[48,1],[49,1],[53,1],[101,1]],               # D_4+A_1\n       [[42,1],[43,1],[44,1],[45,1],[107,1],[108,1]],       # A_4+2A_1\n       [[47,1],[48,1],[49,1],[101,1]],                      # D_4\n       [[42,1],[48,1],[49,1],[106,1],[107,1]],              # A_4+A_1\n       [[37,1],[38,1],[39,1],[49,1],[108,1],[113,1]],       # 2A_3\n       [[42,1],[48,1],[106,1],[107,1]],                     # A_4\n       [[42,1],[44,1],[48,1],[49,1],[110,1],[113,1]],       # D_4(a_1)+A_2\n       [[46,1],[47,1],[48,1],[49,1],[112,1],[113,1]],       # A_3+A_2+A_1\n       [[46,1],[47,1],[48,1],[112,1],[116,1],[119,1]],      # A_3+A_2\n#       [[46,1],[47,1],[48,1],[112,1],[116,1]],              # (A_3+A_2)_2\n       [[53,1],[47,1],[48,1],[115,1],[116,1]],              # D_4(a_1)+A_1\n       [[53,1],[54,1],[55,1],[112,1],[113,1]],              # A_3+2A_1\n       [[47,1],[48,1],[115,1],[116,1]],                     # D_4(a_1)\n       [[53,1],[54,1],[55,1],[117,1],[118,1],[119,1]],      # 2A_2+2A_1\n       [[55,1],[56,1],[112,1],[113,1]],                     # A_3+A_1\n       [[56,1],[57,1],[117,1],[118,1],[119,1]],             # 2A_2+A_1\n       [[63,1],[106,1],[107,1]],                            # A_3\n       [[56,1],[57,1],[117,1],[118,1]],                     # 2A_2\n       [[60,1],[126,1],[127,1],[128,1]],                    # A_2+2A_1\n       [[58,1],[59,1],[123,1],[124,1],[125,1]],             # A_2+3A_1\n       [[63,1],[128,1],[129,1]],                            # A_2+A_1\n       [[127,1],[130,1]],                                   # A_2\n       [[63,1],[135,1],[136,1],[137,1]],                    # 4A_1\n       [[141,1],[142,1],[143,1]],                           # 3A_1\n       [[150,1],[151,1]],                                   # 2A_1\n       [[157,1]]                                            # A_1\n       ];\n\nlabels:=[\"E_8\",\n         \"E_8(a_1)\",\n         \"E_8(a_2)\",\n         \"E_7+A_1\",\n         \"E_7\",\n         \"D_8\",\n         \"E_7(a_1)+A_1\",\n         \"E_7(a_1)\",\n         \"D_8(a_1)\",\n         \"D_7\",\n         \"E_7(a_2)+A_1\",\n         \"E_7(a_2)\",\n         \"A_8\",\n         \"E_6+A_1\",\n         \"D_7(a_1)\",\n#         \"(D_7(a_1))_2\",\n         \"E_6\",\n         \"D_8(a_2)\",\n         \"D_6+A_1\",\n         \"A_7\",\n         \"(A_7)_3\",\n         \"E_6(a_1)+A_1\",\n         \"D_6\",\n         \"D_7(a_2)\",\n         \"E_6(a_1)\",\n         \"D_5+A_2\",\n#         \"(D_5+A_2)_2\",\n         \"A_6+A_1\",\n         \"D_6(a_1)+A_1\",\n         \"D_6(a_1)\",\n         \"A_6\",\n#         \"D_5+A_1\",\n         \"2A_4\",\n         \"A_5+A_2\",\n         \"A_5+2A_1\",\n         \"D_6(a_2)\",\n         \"D_5\",\n         \"D_5(a_1)+A_2\",\n         \"(A_5+A_1)'\",\n         \"(A_5+A_1)''\",\n         \"D_4+A_2\",\n#         \"(D_4+A_2)_2\",\n         \"A_4+A_3\",\n         \"A_5\",\n         \"D_5(a_1)+A_1\",\n         \"A_4+A_2+A_1\",\n       \n         \"A_4+A_2\",\n         \"D_5(a_1)\",\n         \"D_4+A_1\",\n         \"A_4+2A_1\",\n         \"D_4\",\n         \"A_4+A_1\",\n         \"2A_3\",\n         \"A_4\",\n         \"D_4(a_1)+A_2\",\n         \"A_3+A_2+A_1\",\n         \"A_3+A_2\",\n#         \"(A_3+A_2)_2\",\n         \"D_4(a_1)+A_1\",\n         \"A_3+2A_1\",\n         \"D_4(a_1)\",\n         \"2A_2+2A_1\",\n         \"A_3+A_1\",\n         \"2A_2+A_1\",\n         \"A_3\",\n         \"2A_2\",\n         \"A_2+2A_1\",\n         \"A_2+3A_1\",\n         \"A_2+A_1\",\n         \"A_2\",\n         \"4A_1\",\n         \"3A_1\",\n         \"2A_1\",\n         \"A_1\",\n         ];\n\nI:=[ [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ] ];#, [  ], [  ], [  ], [  ], [  ] ];\n\nII:=[ [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ] ];#, [  ], [  ], [  ], [  ], [  ] ];\n\ntori:=[ [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ] ];#, [  ], [  ], [  ], [  ], [  ] ];\n\n#blocks:=[];\nblocks:=[[[55, 1], [45, 1], [39, 1], [27, 3], [19, 1], [9, 1]], [[27, 8], [25, 1], [7, 1]], [[27, 6], [25, 1], [21, 1], [19, 1], [9, 2], [3, 1]], [[27, 4], [25, 1], [19, 1], [18, 2], [15, 1], [12, 2], [9, 2], [3, 1]], [[27, 3], [26, 2], [19, 1], [18, 2], [15, 1], [12, 2], [9, 2], [1, 3]], [[27, 2], [25, 1], [21, 2], [18, 2], [15, 2], [12, 2], [9, 3], [7, 1], [3, 1]], [[27, 1], [21, 1], [19, 2], [18, 4], [15, 1], [9, 8], [3, 1]], [[27, 1], [20, 2], [19, 1], [18, 4], [15, 1], [9, 8], [1, 3]], [[19, 1], [15, 8], [9, 9], [3, 8], [2, 2]], [[23, 1], [22, 2], [19, 1], [16, 2], [15, 1], [13, 3], [12, 2], [11, 1], [10, 2], [7, 1], [4, 2], [3, 1], [1, 3]], [[19, 1], [18, 4], [15, 1], [12, 2], [9, 12], [7, 1], [3, 1]], [[19, 1], [18, 4], [15, 1], [12, 2], [9, 11], [8, 2], [1, 3]], [[19, 1], [18, 2], [15, 3], [13, 3], [9, 9], [7, 1], [6, 2], [3, 3]], [[19, 1], [15, 8], [9, 9], [3, 8], [2, 2]], [[19, 1], [17, 2], [15, 3], [12, 2], [11, 4], [9, 5], [6, 4], [3, 4], [1, 1]], [[19, 1], [15, 8], [9, 9], [3, 7], [1, 7]], [[9, 25], [8, 2], [2, 2], [1, 3]], [[19, 1], [17, 1], [16, 2], [15, 2], [12, 2], [11, 2], [10, 4], [9, 3], [6, 4], [3, 2], [2, 2], [1, 3]], [[9, 3], [7, 5], [6, 16], [5, 3], [3, 24], [1, 3]], [[9, 25], [8, 2], [2, 2], [1, 3]], [[9, 26], [7, 1], [3, 1], [2, 2]], [[19, 1], [16, 4], [15, 1], [11, 5], [10, 4], [9, 2], [6, 4], [3, 1], [1, 10]], [[9, 23], [7, 1], [6, 2], [5, 2], [4, 2], [3, 1], [1, 1]], [[9, 26], [7, 1], [1, 7]], [[9, 21], [7, 2], [6, 4], [3, 7]], [[9, 19], [8, 2], [7, 4], [6, 2], [3, 6], [1, 3]], [[9, 20], [8, 2], [7, 1], [6, 4], [3, 6], [1, 3]], [[9, 19], [8, 4], [6, 4], [3, 5], [1, 6]], [[9, 19], [7, 8], [3, 5], [1, 6]], [[9, 14], [7, 2], [6, 8], [5, 6], [3, 10]], [[9, 13], [8, 2], [7, 1], [6, 8], [5, 3], [4, 6], [3, 6], [1, 3]], [[9, 10], [7, 1], [6, 16], [3, 17], [2, 2]], [[9, 13], [7, 5], [6, 4], [5, 5], [4, 8], [3, 3], [1, 6]], [[9, 19], [7, 8], [1, 21]], [[9, 9], [8, 2], [6, 16], [3, 17], [2, 2]], [[9, 9], [8, 2], [6, 16], [3, 16], [2, 2], [1, 3]], [[9, 10], [7, 1], [6, 16], [3, 16], [1, 7]], [[9, 3], [8, 8], [7, 6], [6, 10], [3, 8], [2, 8], [1, 15]], [[9, 7], [8, 2], [7, 6], [6, 6], [5, 6], [4, 6], [3, 10], [2, 2], [1, 3]], [[9, 9], [8, 2], [6, 16], [3, 15], [1, 10]], [[9, 5], [8, 6], [7, 4], [6, 12], [3, 11], [2, 8], [1, 6]], [[9, 3], [8, 2], [7, 1], [6, 18], [5, 3], [3, 25]], [[9, 3], [7, 5], [6, 16], [5, 3], [3, 24], [1, 3]], [[9, 3], [8, 8], [7, 6], [6, 10], [3, 8], [2, 8], [1, 15]], [[9, 2], [8, 6], [7, 13], [6, 6], [3, 2], [2, 14], [1, 21]], [[9, 1], [8, 4], [7, 3], [6, 12], [5, 7], [4, 4], [3, 17], [2, 4], [1, 4]], [[9, 2], [7, 25], [3, 1], [1, 52]], [[9, 1], [8, 2], [7, 7], [6, 8], [5, 9], [4, 6], [3, 12], [2, 6], [1, 9]], [[8, 4], [7, 6], [6, 4], [5, 10], [4, 16], [3, 6], [2, 4], [1, 10]], [[9, 1], [7, 11], [5, 21], [3, 11], [1, 24]], [[7, 1], [6, 14], [5, 6], [3, 42], [1, 1]], [[7, 1], [6, 14], [5, 3], [4, 6], [3, 37], [2, 2], [1, 3]], [[7, 1], [6, 12], [5, 5], [4, 8], [3, 34], [1, 10]], [[7, 1], [6, 8], [5, 12], [4, 6], [3, 28], [2, 8], [1, 9]], [[7, 1], [6, 6], [5, 11], [4, 14], [3, 19], [2, 12], [1, 13]], [[7, 1], [6, 2], [5, 24], [3, 27], [1, 28]], [[3, 80], [2, 4]], [[7, 1], [6, 2], [5, 15], [4, 18], [3, 10], [2, 14], [1, 24]], [[3, 79], [2, 2], [1, 7]], [[7, 1], [5, 11], [4, 32], [3, 1], [1, 55]], [[3, 78], [1, 14]], [[3, 65], [2, 16], [1, 21]], [[3, 70], [2, 14], [1, 10]], [[3, 58], [2, 20], [1, 34]], [[3, 57], [1, 77]], [[3, 44], [2, 40], [1, 36]], [[3, 31], [2, 50], [1, 55]], [[3, 14], [2, 64], [1, 78]], [[3, 1], [2, 56], [1, 133]]];\n\n#ords:=[];\nords:=[ 81, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 9, 27, 9, 9, 9, 27, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 9, 3, 9, 3, 3, 3, 3, 3, 3, 3, 3, 3 ];\n\nreturn [reps,tori,labels,I,II,ords,blocks,mizuno];\n", "meta": {"hexsha": "e2e9fc18be4063bcb6bac5633fe449ba064c5b01", "size": 13178, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/data/dataE8char3Mizuno.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/data/dataE8char3Mizuno.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/data/dataE8char3Mizuno.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 65.2376237624, "max_line_length": 3534, "alphanum_fraction": 0.283958112, "num_tokens": 6960, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.7371581626286833, "lm_q2_score": 0.43782349911420193, "lm_q1q2_score": 0.32274516616268606}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\nsame_params := (pat1, targ, pat2) -> pat1.target(targ).cond(e->e.params = pat2.val.params);\none_by_one := x -> x.range() = 1 and x.domain() = 1;\n\n# does not work with .cond (!!!) NOTE\nEnum(100, x->@(x), @z, @n, @m, @k, @l, @j, @g, @phi, @r, @s, @ss, @b, @bb);\nEnum(200, x->@(x), @M, @N, @R, @S, @W, @F, @G, @D);\n\nIsIndexMapping := x -> IsBound(x._perm) and x._perm;\n\n# L^mn_n\nltensor_flip := function(match, mn, n)\n    local m, i, pos, dom, ldom, lran, ll, rr, res, ldom;\n    dom := Product(match, x->x.domain());\n    ldom := 1; lran := 1; pos := 1;\n    while lran<>n do\n        lran:=lran*range(match[pos]);\n        ldom:=ldom*domain(match[pos]);\n\tpos:=pos+1;\n    od;\n    ll := match{[1..pos-1]};\n    rr := match{[pos..Length(match)]};\n    res := fTensor(Concatenation(rr, ll));\n\n    if ldom=1 or ldom=dom then\n    return res;\n    else\n    return fCompose(res, L(dom, ldom));\n    fi;\nend;\n\n# for given diagDirsum looking for child which relative domain start <= offset and relative domain end >= (offset + domain)\n# returns [child index, offset relative to child]\n_findDirsumChild := function( dirsum, offset, domain)\n    local i, ch, d;\n    ch := dirsum.children();\n    d := 0;\n    for i in [1..Length(ch)] do\n        if offset >= d then\n            d := d + ch[i].domain();\n            if offset + domain <= d then\n                return [i, offset - d + ch[i].domain()];\n            fi;\n        else\n            return [0, 0];\n        fi;\n    od;\n    return [0, 0];\nend;\n\n# *******************************************************************\nClass(RulesFuncSimp, RuleSet);\nRewriteRules(RulesFuncSimp, rec(\n # ===================================================================\n # Operator flattening and identity\n # ===================================================================\n FlattenTensor  := ARule(fTensor,  [@(1, fTensor) ], e -> @(1).val.children()),\n FlattenCompose := ARule(fCompose, [@(1, fCompose)], e -> @(1).val.children()),\n\n ComposeId1 := ARule(fCompose, [@(1), fId ], e -> [@(1).val]),\n ComposeId2 := ARule(fCompose, [fId,  @(1)], e -> [@(1).val]),\n\n fBase_1x1 := Rule(@(1, fBase, one_by_one), e->fId(1)),\n\n fId_drop_Value := Rule([@(1, fId), @(2, Value)], e->fId(@(2).val.v)),\n\n Const_fbase := ARule(fCompose, [@(1), @(2, fBase, e -> IsInt(e.params[2]))],\n     e -> [ When(IsInt(@(1).val.range()),\n                 fBase(@(1).val.range(), @(1).val.at(@(2).val.params[2])),\n                 fConst(@(1).val.range(), 1, @(1).val.at(@(2).val.params[2]))) ]),\n\n Compose1x1_1 := ARule(fCompose, [@(1).cond(one_by_one), @(2)],  e -> [@(2).val]),\n Compose1x1_2 := ARule(fCompose, [@(2), @(1).cond(one_by_one) ], e -> [@(2).val]),\n\n TensorId1 := ARule(fTensor, [@(1), [@(2,[fId,J]), 1]], e -> [@(1).val]),\n TensorId2 := ARule(fTensor, [[@(2,[fId,J]), 1], @(1)], e -> [@(1).val]),\n\n TensorId1V := ARule(fTensor, [@(1), [@(2,[fId,J]), @(3, Value, e->e.v=1)]], e -> [@(1).val]),\n TensorId2V := ARule(fTensor, [[@(2,[fId,J]), @(3, Value, e->e.v=1)], @(1)], e -> [@(1).val]),\n\n diagTensorId1  := ARule(diagTensor, [@(1), [fConst, @(2), 1, 1]], e -> [@(1).val]),\n diagTensorIdV1 := ARule(diagTensor, [@(1), [fConst, @(2), 1, _1]], e -> [@(1).val]),\n diagTensorId2  := ARule(diagTensor, [[fConst, @(2), 1, 1], @(1)], e -> [@(1).val]),\n diagTensorIdV2 := ARule(diagTensor, [[fConst, @(2), 1, _1], @(1)], e -> [@(1).val]),\n\n diagTensorZero1  := ARule(diagTensor, [@(1), [fConst, @(2), 1, 0]], e -> [fConst(@(1).val.domain(), 0)]),\n diagTensorZeroV1 := ARule(diagTensor, [@(1), [fConst, @(2), 1, _0]], e -> [fConst(@(1).val.domain(), 0)]),\n diagTensorZero2  := ARule(diagTensor, [[fConst, @(2), 1, 0], @(1)], e -> [fConst(@(1).val.domain(), 0)]),\n diagTensorZeroV2 := ARule(diagTensor, [[fConst, @(2), 1, _0], @(1)], e -> [fConst(@(1).val.domain(), 0)]),\n\n DropL := Rule(@(1, [L,OS], e -> e.params[2] = 1 or e.params[2] = e.params[1]), e -> fId(@1.val.params[1])),\n DropTr := Rule(@(1, Tr, e -> e.params[1] = 1 or e.params[2] = 1), e -> fId(@1.val.domain())),\n\n IP_toI  := Rule([IP, @(2), fId], e -> fId(@(2).val)),\n J_1   := Rule([J, 1], e->fId(1)),\n OS_2  := Rule([OS, 2, @], e->fId(2)),\n\n OS_fAdd := ARule(fCompose, [ [OS, @(1), @(2).cond(e -> e in [@(1).val-1, -1])],\n                              [fAdd, @(3), @(4).cond(e -> e = @(3).val - 1), 1] ],\n     e -> [ fAdd(@(3).val, @(4).val, 1), J(@(4).val) ]),\n\n Lfold := ARule(fCompose, [@(1,L), @(2,L),e->let(\n             prod := @(1).val.params[2] * @(2).val.params[2],\n             a:=@(1).val.params[1],\n             When(prod < a, prod in FactorsInt(a), (prod / a) in FactorsInt(a)))],\n     e -> let(\n         prod := @(1).val.params[2] * @(2).val.params[2], a:=@(1).val.params[1],\n         [ L(a, When(prod < a, prod, prod / a)) ])),\n\n Hfold :=  ARule(fCompose, [@(1,H), @(2,H)],\n     e-> [H(@(1).val.params[1],\n             @(2).val.params[2],\n             @(1).val.params[3]+@(2).val.params[3]*@(1).val.params[4],\n             @(1).val.params[4]*@(2).val.params[4])]),\n\n # ===================================================================\n # Diagonal Functions\n # ===================================================================\n ComposePrecompute := Rule([fCompose, ..., [fPrecompute, @(1)], ...],\n     e -> fPrecompute(ApplyFunc(fCompose, List(e.children(),\n         x->When(ObjId(x)=fPrecompute, x.child(1), x))))),\n\n PrecomputePrecompute := Rule([fPrecompute, [fPrecompute, @(1)]], e->fPrecompute(@(1).val)),\n\n # drop diagDirsum when H refers to only one its child\n drop_diagDirsum_H := ARule( fCompose, [ @(1, diagDirsum), @(2, H, x -> x.params[4] = 1 and _findDirsumChild(@(1).val, x.params[3], x.params[2])[1]>0)],\n     e -> let( f := _findDirsumChild(@(1).val, @(2).val.params[3], @(2).val.params[2]),\n               obj := @(1).val.children()[f[1]],\n               [ obj, H(obj.domain(), @(2).val.params[2], f[2], 1) ] )),\n\n RCData_fCompose_TReal := Rule([RCData, [@(1,fCompose), @(2).cond(e->e.range = TReal), ...]], \n     e -> fCompose(RCData(@(2).val), diagTensor(fCompose(Drop(@(1).val.children(),1)), fId(2)))),\n\n RCData_fCompose_TInt := Rule([RCData, [@(1,fCompose), @(2).cond(e->e.range = TInt), ...]], \n     e -> fCompose(RCData(@(2).val), fTensor(fCompose(Drop(@(1).val.children(),1)), fId(2)))),\n\n# RCData_fCompose := Rule([RCData, [@(1,fCompose), @(2), ...]], \n#     e -> fCompose(RCData(@(2).val), fTensor(fCompose(Drop(@(1).val.children(),1)), fId(2)))),\n\n\n RCData_Precompute := Rule([RCData, [fPrecompute, @(1)]], e->fPrecompute(RCData(@(1).val))),\n RCData_CRData     := Rule([RCData, [CRData, @(1)]], e -> @(1).val),\n CRData_RCData     := Rule([CRData, [RCData, @(1)]], e -> @(1).val),\n \n FConj_Precompute := Rule([@(0,[FConj,FRConj]), [fPrecompute, @(1)]], e->fPrecompute(ObjId(@(0).val)(@(1).val))),\n\n ComposeConstX := ARule(fCompose, [@(1,fConst), @(2)],\n     e -> [fConst(@(1).val.params[1], @(2).val.domain(), @(1).val.params[3])]),\n\n fAdd0 := Rule([fAdd, @(1), @(2).cond(e->e=@(1).val), 0], e->fId(@(1).val)),\n\n fAddPair := ARule(fCompose, [@(1, fAdd), @(2, fAdd)],\n     e -> [ fAdd(@(1).val.range(), @(2).val.domain(),\n             @(1).val.params[3] + @(2).val.params[3]) ]),\n\n fTensor_fAdd_H := ARule(fTensor, [ [@(1, fAdd),@, _1, @], @(2, H)],\n     e -> [ H(@(1).val.params[1] * @(2).val.params[1], \n              @(2).val.params[2], \n              @(2).val.params[1] * @(1).val.params[3] + @(2).val.params[3],\n              @(2).val.params[4]) ]),\n\n # ===================================================================\n # fTensor\n # ===================================================================\n # fId(m) (X) fId(n) -> fId(m*n)\n  TensorIdId := ARule(fTensor, [@(1,fId), @(2,fId)],\n    e -> [ fId(@(1).val.params[1] * @(2).val.params[1]) ]),\n\n  TensorId1 := ARule(fTensor, [@(1, fId, x->x.params[1]=1)],\n    e -> []),\n\n # L(mn,m) o (fBase(m,j) (X) f) -> f (X) fBase(j,m)\n LTensorFlip := ARule(fCompose,\n      [ @(1,L), [ @(3,fTensor), @(2).cond(e->range(e) = @(1).val.params[2] and domain(e)=1), ...] ],\n \te -> [ fTensor(Copy(Drop(@(3).val.children(), 1)), Copy(@(2).val)) ] ),\n\n # L(mn,n) o f (X) fBase(j,m) -> (fBase(m,j) (X) f)\n LTensorFlip1 := ARule(fCompose,\n      [ @(1,L), [ @(3,fTensor), ...,\n             @(2, fBase, e->range(e) = @(1).val.params[1]/@(1).val.params[2]) ]],\n    e -> [fTensor(Copy(Last(@(3).val.children())), Copy(DropLast(@(3).val.children(), 1)))] ),\n    \n L_H := ARule(fCompose, [ @(1, L), [ @(2, fTensor), @(3, fBase), @(4, fId, e->IsInt(@(1).val.params[1]/(@(1).val.params[2] * e.params[1])))] ],\n    e-> [ H(@(1).val.params[1], @(4).val.params[1], \n            @(4).val.params[1] * @(1).val.params[2] * imod(@(3).val.params[2], @(1).val.params[1] / (@(4).val.params[1] * @(1).val.params[2])) +\n            idiv(@(3).val.params[2], @(1).val.params[1] / (@(4).val.params[1] * @(1).val.params[2])), \n            @(1).val.params[2]) ]),   \n\n  Refl0_u_H0 := ARule(fCompose, [@(1, Refl0_u), @(2, H, e -> e.params[3]=0 and e.params[4]=1)], e -> [ let(\n     k := @(1).val.params[1],\n     H(@(1).val.range(), @(2).val.domain(), 0, k)) ]),\n\n  Refl0_u_Hrest := ARule(fCompose, [\n          @(1, Refl0_u),\n          @(2, H, e -> e.params[3]=@(1).val.params[2] and e.params[4]=1),\n          [fTensor, @(3,fBase), @(4, fId, e->e.params[1]=@(1).val.params[2])]],\n      e -> [ let(k := @(1).val.params[1],\n              BH(@(1).val.range(), 2*@(1).val.range(), @(4).val.domain(), 1+@(3).val.params[2], 2*k)) ]),\n\n  Refl0_u_Hrest_1it := ARule(fCompose, [\n          @(1, Refl0_u),\n          @(2, H, e -> e.params[3]=@(1).val.params[2] and e.params[4]=1 and e.params[3]=e.params[2]) ],\n      e -> [ let(k := @(1).val.params[1],\n              BH(@(1).val.range(), 2*@(1).val.range(), @(2).val.domain(), 1, 2*k)) ]),\n\n  Refl1_H := ARule(fCompose, [@(1, Refl1), [fTensor, @(2,fBase), @(3, fId, e->e.params[1]=@(1).val.params[2])]],\n      e -> let(\n          k := @(1).val.params[1],\n          [ BH(@(1).val.range(), 2*@(1).val.range() - 1, @(3).val.domain(), @(2).val.params[2], 2*k) ])),\n\n  fTensor_X_fId_H := ARule(fCompose, [[@(1, fTensor), ..., [fId, @(2)]], # NOTE: assumes d|base\n        [@(3, H), @(4).cond(e->_divides(@(2).val,e)), @(5).cond(e->_divides(@(2).val,e)),\n                  @(6).cond(e->_divides(@(2).val,e)), _1]], e ->\n       let(p := @(3).val.params, d := @(2).val, base := p[3],\n           [ @(1).val, fTensor(H(p[1]/d, p[2]/d, base/d, 1), fId(d)) ])),\n\n TrTensor := ARule(fCompose, [@(1, Tr), [ fTensor, @(2), @(3).cond(e->e.range()=@(1).val.params[1]) ]],\n     e -> [ fCompose(fTensor(@(3).val, @(2).val), Tr(@(3).val.domain(), @(2).val.domain())) ]\n ),\n\n LTensorGeneral := ARule(\nfCompose, \n[@(1,[L,Tr]),\n @(2,fTensor,\n e -> let(\n    p := @(1).val.params,\n    a := When(ObjId(@(1).val)=Tr, p[1], p[1]/p[2]), \n    b := p[2],\n    ForAll(e.children(), x->AnySyms(x.domain(), x.range()) or x.domain()>1 and x.range()>1) and # workaround old fId(1) bug \n    full_merge_tensor_chains(@(3), [b, a], e.children(), (x,y)->y,\n Product, fTensor,\n                             fId, x->x, x->x, range) <> false))],\n     e -> [ ltensor_flip(@(3).val, @(1).val.params[1], @(1).val.params[2]) ]\n ),\n\n # fTensor o fTensor -> fTensor( ..o.., ..o.. , ...)\n TensorMerge := ARule(fCompose,\n      [ @(1,fTensor), @(2,fTensor,e->full_merge_tensor_chains(\n          @(3), @(1).val.children(), e.children(),\n                fCompose, fTensor, fTensor, x->x, x->x, domain, range) <> false) ],\n e -> [ fTensor(@(3).val) ]\n ),\n\n TensorMerge_fIdInt := ARule(fCompose,\n      [ @(1,fTensor,e->let(l1:=Last(e.children()), ObjId(l1)=fId and IsInt(l1.domain()))),\n        @(2,fTensor, e->let(l1:=Last(@(1).val.children()), l2 := Last(e.children()), IsInt(l2.domain()) and ObjId(l2)=fId and Gcd(l1.domain(), l2.domain())>1))],\n        e -> let(l1 := Last(@(1).val.children()).domain(), l2 := Last(@(2).val.children()).domain(), gcd := Gcd(l1, l2),\n            [ fTensor(fCompose(fTensor(DropLast(@(1).val.children(), 1), fId(l1/gcd)), fTensor(DropLast(@(2).val.children(), 1), fId(l2/gcd))), fId(gcd)) ])\n    ),\n\n # diagTensor o fTensor -> diagTensor( ..o.., ..o.. , ...)\n diagTensorMerge := ARule(fCompose,\n      [ @(1,diagTensor), @(2,fTensor,e->full_merge_tensor_chains(\n          @(3), @(1).val.children(), e.children(),\n                fCompose, diagTensor, fTensor, x->x, x->fConst(range(x), 1), domain, range) <> false) ],\n e -> [ diagTensor(@(3).val) ]\n ),\n\n # fTensor(..., Y, ...) o X -> fTensor(..., Y o X, ...)\n TensorComposeMergeRight := ARule(fCompose,\n      [ @(1,fTensor), @(2).cond(e -> compat_tensor_chains(\n                                @(1).val.children(), [e], domain, range)) ],\n e -> [ fTensor(merge_tensor_chains(\n         @(1).val.children(), [@(2).val], fCompose, x->x, x->x, domain, range)) ]\n ),\n\n # X o fTensor(..., Y, ...) -> fTensor(..., X o Y, ...)\n TensorComposeMergeLeft := ARule(fCompose,\n      [ @(1), @(2,fTensor,e-> IsInt(@(1).val.range()) and compat_tensor_chains(  # NOTE: BAD HACK!!! Cannot do that with diag functions...\n                             [@(1).val], e.children(), domain, range)) ],\n e -> [ fTensor(merge_tensor_chains(\n         [@(1).val], @(2).val.children(), fCompose, x->x, x->x, domain, range)) ]\n ),\n\n # [fBase,fId] X (fB o fAny) -> fB2 o (fI X fAny)\n TensorB := ARule(fTensor, [\n        @(1, [fBase, fId], e -> Is2Power(e.range())),\n        @(2, fCompose, e -> ObjId(e.child(1)) = fB)\n    ],\n    e -> [fCompose(\n        let(i := @(1).val,\n            b := @(2).val.child(1),\n            fB(i.range() * b.range(), List(b.params[3], e -> Log2Int(i.range()) + e))\n        ),\n        fTensor(\n            @(1).val,\n            @(2).val.child(2)\n        )\n    )]\n ),\n\n # ===================================================================\n # Other\n # ===================================================================\n\n # primitive constant folding for functions\n Compose_FList_const := ARule(fCompose, [@(1, FList), @(2).cond(x->x.free()=[])], \n     e -> let(\n\t lst := @(1).val,  idx := List(@(2).val.tolist(), EvalScalar),\n\t [ FList(lst.t, lst.list{1+idx}) ])),\n\n # fCond o f  (note: fCond o fCond should only be handled by Compose_fCond_lft)\n Compose_fCond_rt := ARule(fCompose, [[fCond, @(1), @(2), @(3)], @(4).cond(e->ObjId(e)<>fCond)],\n     e -> [ fCond(fCompose(@(1).val, @(4).val), fCompose(@(2).val, @(4).val), fCompose(@(3).val, @(4).val)) ]),\n\n Compose_fCond_lft := ARule(fCompose, [@(4), [fCond, @(1), @(2), @(3)]],\n     e -> [ fCond(@(1).val, fCompose(@(4).val, @(2).val), fCompose(@(4).val, @(3).val)) ]),\n\n fCond_fold0  := Rule([fCond, [fConst, @, @,  0], @(2), @(3)], e -> @(3).val),\n fCond_foldV0 := Rule([fCond, [fConst, @, @, _0], @(2), @(3)], e -> @(3).val),\n\n fCond_fold1  := Rule([fCond, [fConst, @, @,  1], @(2), @(3)], e -> @(2).val),\n fCond_foldV1 := Rule([fCond, [fConst, @, @, _1], @(2), @(3)], e -> @(2).val),\n\n\n # B2 o fTensor\n\n    fCompose_B2_fTensor := ARule(fCompose, [@(1,B2), @(2,fTensor)],\n        e -> [fB2(@(1).val.getES(), @(2).val.children())]\n    ),\n\n # L(abc,b) o L(abc,c) -> L(abc,bc)\n fCompose_Tr := ARule( fCompose, [ [@(1, [Tr, L]), @, @(2)], [@(3, [Tr, L]), @, @(4).cond( x -> let( abc := @(1).val.range(), @(3).val.domain() = abc and (abc mod (@(2).val*x) = 0)))]],\n     e -> let( abc := @(1).val.range(), bc := @(2).val*@(4).val, \n         When( ObjId(@(1).val) = L, [L(abc, bc)], [Tr(abc/bc, bc)] ))),\n\n fDirsum_fIds := ARule( fDirsum, [@(1, fId), @(2, fId)], e -> [fId(@(1).val.range()+@(2).val.range())]),\n\n));\n", "meta": {"hexsha": "ec535728f7f6ed46ddcde33321264ccb1bc68765", "size": 15418, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/sigma/func_rules.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/sigma/func_rules.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/sigma/func_rules.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 46.1616766467, "max_line_length": 185, "alphanum_fraction": 0.4851472305, "num_tokens": 5419, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.5467381519846138, "lm_q2_score": 0.588889130767832, "lm_q1q2_score": 0.32196815507983007}}
{"text": "\n# Copyright 2018-2019, Carnegie Mellon University\n# See LICENSE for details\n\n\nClass(SIMDchain, chain);\n\nupdate_opts_params:= function(opts, new_param)\n   opts.params := opts.params::[new_param];\nend;\n\nupdate_opts_includes:= function(opts, new_param)\n   opts.includes := opts.includes::[new_param];\nend;\n\nClass(HCOLFuncGen, rec(\n    generate := (self, ss, opts) >>  let(\n          err_chk := When(opts.errorCheck,\n            let( x:= var.fresh_t(\"x\", T_Real(32)), j := Ind(1),\n                 ch := List(Filtered(opts.params, v->v.t in [T_Real(32), T_Real(64)]),\n                                        vv-> PointWise(1, Lambda([x, j], cond(isinf(vv), 1, cond(isnan(vv), 2, 0))))),   \n                 n := Length(ch),\n                 t :=\n                 OLCompose(\n                    VStack(\n                        Reduction(n, (a, b)->add(a, b), V(0), False),\n                        I(n)\n                    ),\n                    VStack(    ch )\n                 ),\n                 tt := Rewrite(SumsSPL(t, opts), [RulesSumsHCOL, RulesTerminateReductionHCOL, RulesSumsHCOL], opts),\n                 rtn_var := var(\"err\", TPtr(TBool)), rtn := var(\"err_rtn\", TBool),\n                 update_opts_params(opts, rtn_var),\n                 update_opts_includes(opts, \"<math.h>\"),                  \n                 decl([rtn],\n                    chain(\n                      SubstBottomUp(opts.codegen.OLCompose(tt, rtn_var, self.getX(opts), opts),\n                                    [nth, @(4, var, e->e.id = rtn_var.id), @(5, Value, e->e.v=0)], e->rtn),\n                      creturnCond(neq(rtn, 0), -2)\n                 ))),\n            chain([])),\n       \n          code := opts.codegen.(ss.name)(ss, self.getY(opts), self.getX(opts), opts),\n         \n          finalCode := When(opts.useCReturn,            \n                let( w:= var.fresh_t(\"w\", self.getRetType(opts)),               \n                     decl([w],                  \n                        chain(\n                            When(opts.errorCheck, err_chk, chain([])),\n                            SIMDchain(\n                                SubstBottomUp(code,\n                                    [nth, @(2, var, e->e.id = self.getY(opts).id),\n                                          @(3, Value, e->e.v=0)], e->w),\n                               creturn(w))))),\n             SIMDchain(err_chk, code)),\n             \n        func(self.getRetType(opts), \"transform\", self.getParams(finalCode, opts), finalCode)) ,\n     \n     \n        getParams := (self, fc, opts) >> let(\n       \n            y := self.getY(opts), x := self.getX(opts),\n            usedX := Length(Collect(fc, @(1, var, e->e.id=x.id)))>0,           \n            Cond(\n                opts.useCReturn and not usedX,       opts.params,\n                not opts.useCReturn and not usedX,   [y]::opts.params,\n                opts.useCReturn and usedX,           [x]::opts.params,\n                not opts.useCReturn and usedX,       [y, x]::opts.params\n        )\n    ),\n    getRetType := (self, opts) >> When(opts.useCReturn, opts.YType.t, TVoid),\n    getX :=  (self, opts) >> CopyFields(X, rec(t:=opts.XType)),\n    getY :=  (self, opts) >> CopyFields(Y, rec(t:=opts.YType))\n));\n", "meta": {"hexsha": "a56c9d784f34b740acd2a5ee2c77c2a57f3b2568", "size": 3225, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "funcgen.gi", "max_stars_repo_name": "spiral-software/spiral-package-hcol", "max_stars_repo_head_hexsha": "b4a0118382e3bba91ecd82a6c667f2cdb6389ceb", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "funcgen.gi", "max_issues_repo_name": "spiral-software/spiral-package-hcol", "max_issues_repo_head_hexsha": "b4a0118382e3bba91ecd82a6c667f2cdb6389ceb", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "funcgen.gi", "max_forks_repo_name": "spiral-software/spiral-package-hcol", "max_forks_repo_head_hexsha": "b4a0118382e3bba91ecd82a6c667f2cdb6389ceb", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 1, "max_forks_repo_forks_event_min_datetime": "2019-11-26T05:21:02.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-26T05:21:02.000Z", "avg_line_length": 43.0, "max_line_length": 121, "alphanum_fraction": 0.4443410853, "num_tokens": 772, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.600188359260205, "lm_q2_score": 0.5350984286266115, "lm_q1q2_score": 0.32115984792011987}}
{"text": "#############################################################################\n####\n##\n#W  anupqi.gi              ANUPQ package                          Greg Gamble\n##\n##  This file installs interactive functions that execute individual pq  menu\n##  options.\n##\n#Y  Copyright (C) 2001  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany\n##\n\n#############################################################################\n##\n#F  PQ_UNBIND( <datarec>, <fields> ) . . . . . unbind fields of a data record\n##\n##  unbinds the fields in the list <fields> of that data record <datarec>.\n##\nInstallGlobalFunction( PQ_UNBIND, function( datarec, fields )\nlocal field;\n  for field in fields do\n    Unbind( datarec.(field) );\n  od;\nend );\n\n#############################################################################\n##\n#F  PQ_AUT_GROUP( <G> ) . . . . . . . . . . . . . . . . .  automorphism group\n##\n##  returns the automorphism group of  a  $p$-group  as  a  record,  avoiding\n##  computation if possible (currently it *isn't*  possible),  or  else  uses\n##  {\\AutPGrp}'s `AutomorphismGroupPGroup'.\n##\nInstallGlobalFunction( PQ_AUT_GROUP, function( G )\n\n  local autgrp;\n\n  if not IsPGroup(G) then\n      Error(\"group <G> must be a p-group\\n\");\n  fi;\n  if false and HasANUPQAutomorphisms(G) then\n      # Can't use this because we currently don't know how to interpret\n      # the automorphism information returned by the standalone properly.\n\n      autgrp := PqSupplementInnerAutomorphisms(G);\n    \n  elif false and HasAutomorphismGroup(G) then\n\n      # Can't use existing automorphism information because it does not\n      # contain the information required by the standalone.\n\n      autgrp := AutomorphismGroup( G );\n\n  elif LoadPackage(\"autpgrp\") = true or IsAbelian(G) then\n\n      autgrp := AutomorphismGroupPGroup(G);\n\n  else\n      return Error( \"since package `AutPGrp' is not installed\\n\",\n                    \"<G> must have class 1 or <G>'s aut. group must be known.\\n\",\n                    \"Please install the `AutPGrp' package\\n\" );\n  fi;\n  return autgrp;\nend );\n\n#############################################################################\n##\n#F  PQ_AUT_INPUT( <datarec>, <G> : <options> ) . . . . . . automorphism input\n##\n##  inputs automorphism data for `<datarec>.group' given by <options> to  the\n##  `pq' binary derived from the pc group  <G>  (used  in  option  1  of  the\n##  $p$-Group Generation menu and option 2 of the Standard Presentation menu).\n##\nInstallGlobalFunction( PQ_AUT_INPUT, function( datarec, G )\n\n  local   autrec,  nrautos,  rank,  gens,  i,  aut,  j,  g, exponents;\n    \n  autrec  := PQ_AUT_GROUP( G );\n  nrautos := Length( autrec.glAutos ) + Length( autrec.agAutos );\n\n  ## the automorphisms have to be in a special form which PQ_AUT_GROUP()\n  ## *must* deliver.\n  \n  rank := RankPGroup( G );\n  gens := PcgsPCentralSeriesPGroup( G );\n\n  ToPQ(datarec, [ nrautos ], [ \"  #number of automorphisms\" ]);\n\n  ##  First write out the automorphisms generating a soluble normal subgroup \n  ##  of the automorphism group of the p-group.  These automorphisms may\n  ##  not have a faithful representation on the Frattini quotient of the\n  ##  p-group and are treated accordingly by the standalone.\n  ##\n  ##  They are written out in bottom up fashion as this is the order in\n  ##  which the orbit algorithm for a group given by an ag-system needs\n  ##  them.  \n  for i in Reversed([1..Length(autrec.agAutos)]) do\n      aut := autrec.agAutos[i];\n\n      for j in [1..rank] do\n          g := gens[j];\n          exponents := Flat( List( ExponentsOfPcElement(gens, Image( aut, g )),\n                                   e -> [ String(e), \" \"] ) );\n\n          ToPQ(datarec, [ exponents ],\n               [ \" #gen'r exp'ts of im(ag aut \", i, \", gen \", j, \")\" ]);\n      od;\n  od;\n\n  ##  Now output the automorphisms from the insoluble quotient of the\n  ##  automorphism group of the p-group.  These have a faithful\n  ##  representation on the Frattini quotient of the p-group and are\n  ##  treated accordingly by the standalone.\n  for i in Reversed( [1..Length(autrec.glAutos)] ) do\n      aut := autrec.glAutos[i];\n\n      for j in [1..rank] do\n          g := gens[j];\n          exponents := Flat( List( ExponentsOfPcElement(gens, Image( aut, g )),\n                                   e -> [ String(e), \" \"] ) );\n\n          ToPQ(datarec, [ exponents ],\n               [ \" #gen'r exp'ts of im(gl aut \", i, \", gen \", j, \")\" ]);\n      od;\n  od;\n\n  if PQ_MENU(datarec) = \"pG\" then\n      ##  ?? Why only the pG menu ??\n      ##  Finally, tell the standalone the number of soluble automorphisms\n      ##  and the relative order of each automorphism. \n      ToPQ(datarec, [ Length(autrec.agOrder) ], \n           [ \"  #number of soluble automorphisms\" ]);\n    \n      for i in Reversed( [1..Length( autrec.agOrder )] ) do\n          ToPQ( datarec, [ autrec.agOrder[i] ], \n                [ \"  #rel order of \", i, \"th ag automorphism\" ] );\n      od;\n  fi;\n\nend );\n\n#############################################################################\n##\n#F  PQ_MANUAL_AUT_INPUT(<datarec>,<mlist>) . automorphism input w/o an Aut gp\n##\n##  inputs automorphism data for `<datarec>.group' given by  <mlist>  to  the\n##  `pq' binary.\n##\nInstallGlobalFunction( PQ_MANUAL_AUT_INPUT, function( datarec, mlist )\nlocal line, nauts, nsolauts, rank, nexpts, i, j, aut, exponents;\n  nauts  := Length(mlist);\n  rank   := Length(mlist[1]);\n  ToPQ(datarec, [ nauts ], [ \"  #no. of auts\" ]);\n  if datarec.line = \"Input the number of exponents: \" then\n    nexpts := Length(mlist[1][1]);\n    ToPQ(datarec, [ nexpts ], [ \"  #no. of exponents\" ]);\n  fi;\n  for i in [1..nauts] do\n    aut := mlist[i];\n    for j in [1..rank] do\n      exponents := Flat( List( aut[j], e -> [ String(e), \" \"] ) );\n      ToPQ(datarec, [ exponents ], \n                    [ \" #gen'r exp'ts of im(aut \", i, \", gen \", j, \")\" ]);\n    od;\n  od;\n  if PQ_MENU(datarec) = \"pG\" then\n    ##  ?? Why only the pG menu ??\n    ##  Finally, tell the standalone the number of soluble automorphisms\n    ##  and the relative order of each automorphism. \n    ToPQ(datarec, [ datarec.NumberOfSolubleAutomorphisms ], \n                  [ \"  #number of soluble automorphisms\" ]);\n    if datarec.NumberOfSolubleAutomorphisms > 0 then\n      for i in datarec.RelativeOrders do\n        ToPQ( datarec, [ datarec.RelativeOrders[i] ], \n                       [ \"  #rel order of \", i, \"th ag automorphism\" ] );\n      od;\n    fi;\n  fi;\nend );\n\n#############################################################################\n##\n#F  PQ_AUT_ARG_CHK(<minnargs>, <args>) . checks args for a func defining auts\n##\n##  checks that  the  arguments  make  sense  for  a  function  that  defines\n##  automorphisms, and if one fo the arguments is a list checks as much as is\n##  possible that it is a list of  matrices  that  will  be  valid  input  as\n##  automorphisms for the `pq' binary.  If  the  arguments  look  ok  a  list\n##  containing the `ANUPQData.io' index of the data record and, if  relevant,\n##  a list of matrices is returned.\n##\nInstallGlobalFunction( PQ_AUT_ARG_CHK, function( minnargs, args )\nlocal ioIndex, datarec, mlist, rank, nexpts;\n  if Length(args) < minnargs then\n    Error(\"expected at least 1 argument\\n\"); #minnargs is 0 or 1\n  elif 2 < Length(args) then\n    Error(\"expected at most 2 arguments\\n\");\n  fi;\n  if not IsEmpty(args) and IsList(args[ Length(args) ]) then\n    mlist := args[ Length(args) ];\n    args := args{[1 .. Length(args) - 1]};\n  fi;\n  ioIndex := CallFuncList(PqProcessIndex, args);\n  if not IsBound(mlist) then\n    return [ioIndex];\n  elif not( IsList(mlist) and ForAll(mlist, IsMatrix) and\n            ForAll(Flat(mlist), i -> IsInt(i) and i >= 0) ) then\n    Error(\"<mlist> must be a list of matrices with \",\n          \"non-negative integer coefficients\\n\");\n  fi;\n  datarec := ANUPQData.io[ ioIndex ];\n  if IsBound( datarec.pQuotient ) then\n    rank := RankPGroup( datarec.pQuotient );\n  else\n    rank := Length(mlist[1]); # Should we allow this?\n  fi;\n  if not ForAll(mlist, mat -> Length(mat) = rank) then\n    Error(\"no. of rows in each matrix of <mlist> must be the rank of \",\n          \"p-quotient (\", rank, \")\\n\");\n  fi;\n  nexpts := Length(mlist[1][1]);\n  if not ForAll(mlist, mat -> Length(mat[1]) = nexpts) then\n    Error(\"each matrix of <mlist> must have the same no. of columns\\n\");\n  fi;\n  return [ioIndex, mlist];\nend );\n\n#############################################################################\n##\n#F  PQ_PC_PRESENTATION( <datarec>, <menu> ) . . . . . .  p-Q/SP menu option 1\n##\n##  inputs  data  given  by  <options>  to  the   `pq'   binary   for   group\n##  `<datarec>.group' to compute a  pc  presentation  (do  option  1  of  the\n##  relevant menu) according to the  <menu>  menu,  where  <menu>  is  either\n##  `\"pQ\"' (main $p$-Quotient menu) or `\"SP' (Standard Presentation menu).\n##\nInstallGlobalFunction( PQ_PC_PRESENTATION, function( datarec, menu )\nlocal gens, rels, p, fpgrp, identities, pcgs, len, strp, i, j, Rel, line;\n\n  p := VALUE_PQ_OPTION(\"Prime\", fail, datarec); # \"Prime\" is a `global' option\n\n  PQ_MENU(datarec, menu);\n\n  identities := menu = \"pQ\" and\n                VALUE_PQ_OPTION(\"Identities\", [], datarec) <> [];\n\n  # Option 1 of p-Quotient/Standard Presentation Menu: defining the group\n  ToPQk(datarec, [1], [\"  #define group\"]);\n  if VALUE_PQ_OPTION(\"GroupName\", \"[grp]\", datarec) = \"[grp]\" and\n     IsBound(datarec.group) and IsBound(datarec.group!.Name) then\n    datarec.GroupName := datarec.group!.Name;\n  fi;\n  ToPQk(datarec, [\"name \",  datarec.GroupName], []);\n  ToPQk(datarec, [\"prime \", p], []);\n  if identities then\n    datarec.prevngens := 0;\n    ToPQk(datarec, [\"class \", 1], []);\n  else\n    ToPQk(datarec, [\"class \", VALUE_PQ_OPTION(\"ClassBound\", 63, datarec)], []);\n  fi;\n  ToPQk(datarec, [\"exponent \", VALUE_PQ_OPTION(\"Exponent\", 0, datarec)], []);\n                                             # \"Exponent\" is a `global' option\n  if VALUE_PQ_OPTION( \"Metabelian\", false, datarec ) = true then\n    ToPQk(datarec, [ \"metabelian\" ], []);\n  fi;\n  ToPQk(datarec, [\"output \", VALUE_PQ_OPTION(\"OutputLevel\", 0, datarec)], []);\n\n  if IsFpGroup(datarec.group) then\n    gens := FreeGeneratorsOfFpGroup(datarec.group);\n    rels := VALUE_PQ_OPTION(\"Relators\", datarec);\n    if rels = fail then\n      rels := RelatorsOfFpGroup(datarec.group);\n    elif ForAll( rels, rel -> PqParseWord(datarec.group, rel) ) then\n      Info(InfoANUPQ, 2, \"Relators parsed ok.\");\n    fi;\n  elif not( IsPGroup(datarec.group) ) then\n    fpgrp := FpGroupPcGroup( datarec.group );\n    gens := FreeGeneratorsOfFpGroup(fpgrp);\n    rels := RelatorsOfFpGroup(fpgrp);\n  else\n    pcgs := PcgsPCentralSeriesPGroup(datarec.group);\n    datarec.pcgs := pcgs;\n    len  := Length(pcgs);\n    gens := List( [1..len], i -> Concatenation( \"g\", String(i) ) );\n    strp := String(p);\n\n    Rel := function(elt, eltstr)\n      local rel, expts, factors;\n\n      rel := eltstr;\n      expts := ExponentsOfPcElement( pcgs, elt );\n      if ForAny( expts, x -> x<>0 )  then\n        factors \n            := Filtered(\n                   List( [1..len], \n                         function(i)\n                           if expts[i] = 0 then\n                             return \"\";\n                           fi;\n                           return Concatenation(gens[i], \"^\", String(expts[i]));\n                         end ),\n                   factor -> factor <> \"\");\n        Append(rel, \"=\");\n        Append(rel, JoinStringsWithSeparator(factors, \"*\"));\n      fi;\n      return rel;\n    end;\n\n    rels := List( [1..len], \n                  i -> Rel( pcgs[i]^p, Concatenation(gens[i], \"^\", strp) ) );\n    for i in [1..len] do\n      for j in [1..i-1]  do\n        Add(rels, Rel( Comm( pcgs[i], pcgs[j] ), \n                       Concatenation(\"[\", gens[i], \",\", gens[j], \"]\") ));\n      od;\n    od;\n  fi;\n  if Length(gens) > 511 then\n    # The pq program defines MAXGENS to be 511 in `../include/runtime.h'\n    # ... on the other hand, the number of pc gen'rs can be up to 65535\n    Error(\"number of defining generators, \", Length(gens), \", too large.\\n\",\n          \"The pq program defines MAXGENS (the maximum number of defining\\n\",\n          \"generators) to be 511.\\n\");\n  fi;\n  datarec.gens := gens;\n  datarec.rels := rels;\n  ToPQk(datarec, \"gens\", []);\n  datarec.match := true;\n  ToPQ(datarec, \"rels\", []);\n  ## pq is intolerant of long lines and integers that are split over lines\n  #rels := Concatenation(\n  #            \"relators   { \", JoinStringsWithSeparator( rels, \", \" ), \" };\");\n  #while Length(rels) >= 69 do\n  #  i := 68;\n  #  while not (rels[i] in \"*^, \") do i := i - 1; od;\n  #  ToPQk(datarec, [ rels{[1 .. i]} ], []);\n  #  rels := Concatenation( \"  \", rels{[i + 1 .. Length(rels)]} );\n  #od;\n  #ToPQ(datarec, [ rels ], []);\n  datarec.haspcp := true;\n  # The `pq' only sets OutputLevel locally within the menu item\n  # ... for the GAP interface this would be too confusing; so we\n  # set it `globally'\n  PQ_SET_OUTPUT_LEVEL(datarec, datarec.OutputLevel);\n  PQ_SET_GRP_DATA(datarec);\n  if identities and datarec.ngens[1] <> 0 then\n    PQ_EVALUATE_IDENTITIES(datarec);\n    VALUE_PQ_OPTION(\"ClassBound\", 63, datarec);\n    while datarec.class < datarec.ClassBound and \n          datarec.prevngens <> datarec.ngens[ datarec.class ] do\n      PQ_NEXT_CLASS(datarec);\n    od;\n  fi;\nend );\n\n#############################################################################\n##\n#F  PqPcPresentation( <i> : <options> ) . . user version of p-Q menu option 1\n#F  PqPcPresentation( : <options> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to compute the pc presentation  of  the  quotient  (determined  by\n##  <options>) of the group of the process, which for process <i>  is  stored\n##  as `ANUPQData.io[<i>].group'.\n##\n##  The  possible  <options>  are  the  same  as  for  the  interactive  `Pq'\n##  (see~\"Pq!interactive\")   function,   namely:    `Prime',    `ClassBound',\n##  `Exponent', `Relators', `GroupName', `Metabelian' and `OutputLevel'  (see\n##  Chapter~\"ANUPQ options\" for a detailed description  for  these  options).\n##  The option `Prime' is required  unless  already  provided  to  `PqStart'.\n##  Also, option `ClassBound' *must* be supplied.\n##\n##  *Notes*\n##\n##  The pc presentation is held by the `pq' binary. There is no output  of  a\n##  {\\GAP} pc group; see~`PqCurrentGroup' (\"PqCurrentGroup\") if you need  the\n##  corresponding {\\GAP} pc group.\n##\n##  For those familiar with the `pq' binary, `PqPcPresentation' performs menu\n##  item 1 of the main $p$-Quotient menu.\n##\nInstallGlobalFunction( PqPcPresentation, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqPcPresentation\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_PC_PRESENTATION( datarec, \"pQ\" );\nend );\n\n#############################################################################\n##\n#F  PQ_SAVE_PC_PRESENTATION( <datarec>, <filename> ) . . .  p-Q menu option 2\n##\n##  directs the `pq' binary to save the pc presentation  previously  computed\n##  for  `<datarec>.group'  to  <filename>  using  option  2  of   the   main\n##  $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_SAVE_PC_PRESENTATION, function( datarec, filename )\n  PQ_MENU(datarec, \"pQ\");\n  ToPQ(datarec, [ 2 ], [ \"  #save pc presentation to file\" ]);\n  datarec.filter := [\"Presentation\"];\n  ToPQ(datarec, [ filename ], [ \"  #filename\" ]);\n  Unbind(datarec.filter);\nend );\n\n#############################################################################\n##\n#F  PQ_PATH_CURRENT_DIRECTORY() . . . . . . . . . .  essentially the UNIX pwd\n##\n##  returns a string that is the path of the current directory.\n##\nInstallGlobalFunction( PQ_PATH_CURRENT_DIRECTORY, function()\nlocal path, stream;\n  path := \"\";\n  stream := OutputTextString(path, true);\n  if 0 = Process( DirectoryCurrent(), \n                  Filename(DirectoriesSystemPrograms(), \"pwd\"),\n                  InputTextNone(), \n                  stream,\n                  [] ) then\n    CloseStream(stream);\n    return Chomp(path);\n  fi;\n  Error(\"could not determine the path of the current directory!?!\\n\");\nend );\n\n#############################################################################\n##\n#F  PQ_CHK_PATH(<filename>, <rw>, <datarec>) . . . . . . .  check/add to path\n##\n##  checks <filename> is a non-empty string, if it doesn't begin with  a  `/'\n##  prepends a path for the current directory, and checks the result  is  the\n##  name of a readable (resp. writable) if <rw> is `\"r\"' (resp.  if  <rw>  is\n##  `\"w\"') and if there is no error returns the result.\n##\nInstallGlobalFunction( PQ_CHK_PATH, function( filename, rw, datarec )\n  if not IsString(filename) or filename = \"\" then\n    Error( \"argument <filename> must be a non-empty string\\n\" );\n  fi;\n  if filename[1] <> '/' then\n    # we need to do this as pq executes in ANUPQData.tmpdir\n    filename := Concatenation(PQ_PATH_CURRENT_DIRECTORY(), \"/\", filename);\n  fi;\n  if rw = \"r\" then\n    if IsReadableFile(filename) <> true then\n      Error( \"file with name <filename> is not readable\\n\" );\n    fi;\n  else # rw = \"w\"\n    if not IsBound(datarec.setupfile) then\n      PrintTo(filename, \"\"); # This is what will generate the error\n                             # but it also ensures it's empty\n    fi;\n    if IsWritableFile(filename) <> true then\n      Error( \"file with name <filename> cannot be written to\\n\" );\n    fi;\n  fi;\n  return filename;\nend );\n\n#############################################################################\n##\n#F  PqSavePcPresentation( <i>, <filename> ) . .  user ver. of p-Q menu opt. 2\n#F  PqSavePcPresentation( <filename> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  program to save the pc presentation previously computed for the  quotient\n##  of the group of that process to the file with  name  <filename>.  If  the\n##  first character of the  string  <filename>  is  not  `/',  <filename>  is\n##  assumed to be the path of a writable file relative to  the  directory  in\n##  which  {\\GAP}  was  started.  A   saved   file   may   be   restored   by\n##  `PqRestorePcPresentation' (see~\"PqRestorePcPresentation\").\n##\n##  *Note:* For those familiar with the `pq'  binary,  `PqSavePcPresentation'\n##  performs menu item 2 of the main $p$-Quotient menu.\n##\nInstallGlobalFunction( PqSavePcPresentation, function( arg )\nlocal datarec, filename;\n  if 0 = Length(arg) or Length(arg) > 2 then\n    Error( \"expected 1 or 2 arguments\\n\" );\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1..Length(arg) - 1]});\n  filename := PQ_CHK_PATH( arg[Length(arg)], \"w\", datarec );\n  PQ_SAVE_PC_PRESENTATION( datarec, filename );\nend );\n\n#############################################################################\n##\n#F  PQ_RESTORE_PC_PRESENTATION( <datarec>, <filename> ) . . p-Q menu option 3\n##\n##  directs the `pq' binary to restore the pc presentation  previously  saved\n##  to <filename> using option 3 of the main $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_RESTORE_PC_PRESENTATION, function( datarec, filename )\n  PQ_MENU(datarec, \"pQ\");\n  ToPQ(datarec, [ 3 ], [ \"  #restore pc presentation from file\" ]);\n  datarec.match := true;\n  ToPQ(datarec, [ filename ], [ \"  #filename\" ]);\n  datarec.haspcp := true;\n  PQ_SET_GRP_DATA(datarec);\nend );\n\n#############################################################################\n##\n#F  PqRestorePcPresentation( <i>, <filename> ) . user ver. of p-Q menu opt. 3\n#F  PqRestorePcPresentation( <filename> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  program to restore the pc presentation previously saved to <filename>, by\n##  `PqSavePcPresentation'   (see~\"PqSavePcPresentation\").   If   the   first\n##  character of the string <filename> is not `/', <filename> is  assumed  to\n##  be the path of a readable file relative to the directory in which  {\\GAP}\n##  was started.\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,  `PqRestorePcPresentation'\n##  performs menu item 3 of the main $p$-Quotient menu.\n##\nInstallGlobalFunction( PqRestorePcPresentation, function( arg )\nlocal datarec, filename;\n  if 0 = Length(arg) or Length(arg) > 2 then\n    Error( \"expected 1 or 2 arguments\\n\" );\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1..Length(arg) - 1]});\n  filename := PQ_CHK_PATH( arg[Length(arg)], \"r\", datarec );\n  PQ_RESTORE_PC_PRESENTATION( datarec, filename );\nend );\n\n#############################################################################\n##\n#F  PQ_DISPLAY_PRESENTATION( <datarec> ) . . . . . . . . .  any menu option 4\n##\n##  directs the `pq' binary to display the pc presentation of  the  group  to\n##  the current class, using option 4 of the current menu.\n##\nInstallGlobalFunction( PQ_DISPLAY_PRESENTATION, function( datarec )\n  if datarec.menu[ Length(datarec.menu) ] <> 'G' and\n     VALUE_PQ_OPTION(\"OutputLevel\", datarec) <> fail then\n    PQ_SET_OUTPUT_LEVEL( datarec, datarec.OutputLevel );\n  fi;\n  ToPQ(datarec, [ 4 ], [ \"  #display presentation\" ]);\nend );\n\n#############################################################################\n##\n#F  PQ_GRP_EXISTS_CHK( <datarec> ) . . check the `pq' binary knows about a gp\n##\n##  checks that `<datarec>.ngens' is set and non-empty (which can only happen\n##  if the `pq' binary has been fed a group) and generates an error if not.\n##\nInstallGlobalFunction( PQ_GRP_EXISTS_CHK, function( datarec )\n  if not IsBound(datarec.ngens) or IsEmpty(datarec.ngens) then\n    Error( \"huh! No current group defined for this process!?\\n\" );\n  fi;\nend );\n\n#############################################################################\n##\n#F  PQ_SET_GRP_DATA( <datarec> ) .  save group data of current class of group\n##\n##  If `<datarec>.matchedline' is not  set  the  `pq'  binary  is  called  to\n##  display the presentation; usually  `<datarec>.matchedline'  is  set  when\n##  filtering `pq' output for lines starting with `\"Group\"' (the  value  set\n##  for `<datarec>.match'), but no such  lines  occur  when  computing  a  pc\n##  presentation with the `OutputLevel' option set to 0, or when restoring  a\n##  pc presentation, or when computing tails etc. From this line  the  fields\n##  `name', `class' and `forder' of the record <datarec> are set to the name,\n##  class  and  factored   order   of   that   group,   respectively.   Also,\n##  `<datarec>.ngens' is updated, and if it is afterwards incomplete and  the\n##  call to `PQ_SET_GRP_DATA' was not initiated by `PQ_DATA'  then  `PQ_DATA'\n##  is called to ensure `<datarec>.ngens' is complete.\n##\nInstallGlobalFunction( PQ_SET_GRP_DATA, function( datarec )\nlocal line, classpos;\n  if IsBound(datarec.setupfile) then \n    # A fudge ... some things we can only know by actually running it!\n    Info(InfoANUPQ + InfoWarning,1, \n         \"Guess made of `class' and `ngens' fields\");\n    Info(InfoANUPQ + InfoWarning,1, \n         \"... please check commands ok by running without `SetupFile' option\");\n    Info(InfoANUPQ + InfoWarning,1, \n         \"and comparing with `ToPQ> ' commands observed at InfoANUPQ level 4\");\n    datarec.class := datarec.ClassBound;\n    datarec.ngens := [ 1 ];\n    return;\n  fi;\n  # Either datarec.matchedline is of one of the following forms:\n  # Group completed. Lower exponent-<p> central class = <c>, Order = <p>^<n>\n  # Group: [grp] to lower exponent-<p> central class <c> has order <p>^<n>\n  if not IsBound(datarec.matchedline) then\n    PushOptions(rec(nonuser := true));\n    ToPQ(datarec, [ 4 ], [ \"  #display presentation\" ]);\n    PopOptions();\n  fi;\n  line := SplitString(datarec.matchedline, \"\", \":,. ^\\n\");\n  if line[2] = \"completed\" then\n    classpos := Position(line, \"class\") + 2;\n    #if not IsBound(datarec.name) then #do we need to bother?\n    #  datarec.name := \"[grp]\";\n    #fi;\n  else\n    # Only the ``incomplete'' form of datarec.matchedline gives the name\n    datarec.name := line[2];\n    datarec.gpnum := JoinStringsWithSeparator( \n                         line{[3 .. Position(line, \"to\") - 1]}, \" \" );\n    classpos := Position(line, \"class\") + 1;\n  fi;\n  datarec.class  := Int( line[classpos] );\n  datarec.forder := List( line{[classpos + 3, classpos + 4]}, Int);\n  PQ_UNBIND(datarec, [\"match\", \"matchedline\"]);\n  # First see if we can update datarec.ngens cheaply\n  if not IsBound(datarec.ngens) then\n    datarec.ngens := [];\n  fi;\n  if datarec.class > 0 then\n    datarec.ngens[ datarec.class ] := datarec.forder[2];\n    #The `pq' binary reduces the class by 1 \n    #if the no. of gen'rs doesn't increase\n    Unbind( datarec.ngens[ datarec.class + 1 ] );\n  fi;\n\n  if not IsBound(datarec.inPQ_DATA) and not IsDenseList(datarec.ngens) then\n    # It wasn't possible to update datarec.ngens cheaply\n    PQ_DATA( datarec );\n  fi;\nend );\n\n#############################################################################\n##\n#F  PQ_DATA( <datarec> ) . . . . gets class/gen'r data from (A)p-Q menu opt 4\n##\n##  ensures that the menu is a $p$-Quotient menu and that the output level is\n##  3 and using option 4 of the now  current  menu  extracts  the  number  of\n##  generators of each class currently known to the `pq' binary.  (The  order\n##  of each $p$-class quotient is taken as $p^n$ where $n$ is the  number  of\n##  generators for the class; this may be an over-estimate if tails have been\n##  added  and  the  necessary  consistency  checks,  relation   collections,\n##  exponent law checks and redundant generator eliminations  have  not  been\n##  done for a class.) All output that would  have  appeared  at  `InfoANUPQ'\n##  levels 1 or 2 if user-initiated is `Info'-ed at `InfoANUPQ' level 3.  The\n##  menu and output level are reset to their original values (if changed)  on\n##  leaving.\n##\nInstallGlobalFunction( PQ_DATA, function( datarec )\nlocal menu, lev, ngen, i, line, class;\n  if not( IsBound(datarec.haspcp) and datarec.haspcp ) then\n    Error( \"a pc presentation for the group of the process \",\n           \"has not yet been defined\\n\" );\n  fi;\n  PushOptions(rec(nonuser := true));\n  datarec.inPQ_DATA := true;\n  if datarec.menu[ Length(datarec.menu) ] <> 'Q' then\n    menu := datarec.menu;\n    PQ_MENU(datarec, \"pQ\");\n  fi;\n  if not IsBound(datarec.OutputLevel) then\n    lev := 0;\n    PQ_SET_OUTPUT_LEVEL( datarec, 3 );\n  elif datarec.OutputLevel < 3 then\n    lev := datarec.OutputLevel;\n    PQ_SET_OUTPUT_LEVEL( datarec, 3 );\n  fi;\n  datarec.matchlist := [\"Group\", \"Class\", \" is defined on \"];\n  datarec.matchedlines := [];\n  ToPQ(datarec, [ 4 ], [ \"  #display presentation\" ]);\n  datarec.matchedline := datarec.matchedlines[1];\n  PQ_SET_GRP_DATA(datarec);\n  for i in [2 .. Length(datarec.matchedlines)] do\n    line := SplitString(datarec.matchedlines[i], \"\", \" \\n\");\n    if line[1] = \"Class\" then\n      class := Int( line[2] );\n      if class > 1 then\n        datarec.ngens[class - 1] := Int(ngen);\n        if class = datarec.class then\n          break;\n        fi;\n      fi;\n    else\n      ngen := line[1];\n    fi;\n  od;\n  if IsBound(menu) then\n    PQ_MENU(datarec, menu);\n  fi;\n  if IsBound(lev) then\n    PQ_SET_OUTPUT_LEVEL( datarec, lev );\n  fi;\n  PQ_UNBIND( datarec, [\"matchlist\", \"matchedlines\", \"inPQ_DATA\"] );\n  PopOptions();\nend );\n\n#############################################################################\n##\n#F  PQ_DATA_CHK( <args> ) . . .  call PQ_DATA if class/gen'r data out-of-date\n##\n##  determines the data record <datarec>, calls `PQ_DATA'  if  necessary  and\n##  returns <datarec>.\n##\nInstallGlobalFunction( PQ_DATA_CHK, function( args )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, args);\n  if not IsBound(datarec.ngens) or IsEmpty(datarec.ngens) or \n     not IsDenseList(datarec.ngens) then\n    PQ_DATA( datarec );\n  fi;\n  return datarec;\nend );\n\n#############################################################################\n##\n#F  PqFactoredOrder( <i> ) . the `pq' binary's current group's factored order\n#F  PqFactoredOrder()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, return an estimate\n##  of the factored order of the lower exponent  $p$-class  quotient  of  the\n##  group currently determined by the process as a list `[<p>, <n> ]'.\n##\n##  *Note:* The order of each $p$-class quotient is taken as $p^n$ where  $n$\n##  is the number of generators for the class; this may be  an  over-estimate\n##  if tails have been added and the necessary consistency  checks,  relation\n##  collections, exponent law checks  and  redundant  generator  eliminations\n##  have not yet been done for a class.\n##\nInstallGlobalFunction( PqFactoredOrder, function( arg )\n  return PQ_DATA_CHK(arg).forder;\nend );\n\n#############################################################################\n##\n#F  PqOrder( <i> ) . . . .  the order of the current group of the `pq' binary\n#F  PqOrder()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, return an estimate\n##  of the order of the  lower  exponent  $p$-class  quotient  of  the  group\n##  currently determined by the process.\n##\n##  *Note:* The order of each $p$-class quotient is taken as $p^n$ where  $n$\n##  is the number of generators for the class; this may be  an  over-estimate\n##  if tails have been added and the necessary consistency  checks,  relation\n##  collections, exponent law checks  and  redundant  generator  eliminations\n##  have not been done for a class.\n##\nInstallGlobalFunction( PqOrder, function( arg )\nlocal forder;\n  forder := CallFuncList( PqFactoredOrder, arg );\n  return forder[1]^forder[2];\nend );\n\n#############################################################################\n##\n#F  PqPClass( <i> ) . . . the p class of the current group of the `pq' binary\n#F  PqPClass()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, return  the  lower\n##  exponent $p$-class of the quotient  group  currently  determined  by  the\n##  process.\n##\nInstallGlobalFunction( PqPClass, function( arg )\n  return PQ_DATA_CHK(arg).class;\nend );\n\n#############################################################################\n##\n#F  PqNrPcGenerators( <i> ) . number of pc gen'rs of `pq' binary's current gp\n#F  PqNrPcGenerators()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, return the  number\n##  of pc generators of the lower exponent $p$-class quotient  of  the  group\n##  currently determined by the process.\n##\nInstallGlobalFunction( PqNrPcGenerators, function( arg )\n  return PQ_DATA_CHK(arg).forder[2];\nend );\n\n#############################################################################\n##\n#F  PqWeight( <i>, <j> ) . . . . . . . . . . . . . . .  weight of a generator\n#F  PqWeight( <j> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, return the  weight\n##  of the <j>th pc generator of the lower exponent $p$-class quotient of the\n##  group currently determined by the process, or `fail' if there is no  such\n##  numbered pc generator.\n##\nInstallGlobalFunction( PqWeight, function( arg )\nlocal ngens, i, j;\n  if not Length(arg) in [1, 2] then\n    Error( \"expected 1 or 2 arguments\\n\" );\n  fi;\n  j := arg[ Length(arg) ];\n  if not IsPosInt(j) then\n    Error( \"argument <j> should be a positive integer\\n\" );\n  fi;\n  Unbind( arg[ Length(arg) ] );\n  ngens := PQ_DATA_CHK(arg).ngens;\n  return First([1 .. Length(ngens)], i -> ngens[i] >= j);\nend );\n\n#############################################################################\n##\n#F  PqCurrentGroup( <i> ) . extracts current p-quotient or p-cover as a pc gp\n#F  PqCurrentGroup()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, return  the  lower\n##  exponent $p$-class quotient of the group or $p$-covering group  currently\n##  determined by the process as a {\\GAP} pc group.\n##\nInstallGlobalFunction( PqCurrentGroup, function( arg )\nlocal datarec, out;\n  datarec := PQ_DATA_CHK(arg);\n  datarec.outfname := ANUPQData.outfile;\n  PushOptions( rec(nonuser := true) );\n  PQ_WRITE_PC_PRESENTATION(datarec, datarec.outfname);\n  PopOptions();\n  if IsBound(datarec.pcoverclass) and datarec.pcoverclass = datarec.class then\n    out := \"pCover\";\n  else\n    out := \"pQuotient\";\n  fi;\n  PQ_GROUP_FROM_PCP( datarec, out );\n  return datarec.(out);\nend );\n\n#############################################################################\n##\n#F  PqDisplayPcPresentation( <i> ) . . . .  user version of any menu option 4\n#F  PqDisplayPcPresentation()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to display the pc presentation of  the  lower  exponent  $p$-class\n##  quotient of the group currently determined by the process.\n##\n##  Except if the last command communicating  with  the  `pq'  binary  was  a\n##  $p$-group generation command (for which there is only  a  verbose  output\n##  level), to set the amount of information this command  displays  you  may\n##  wish  to  call  `PqSetOutputLevel'  first  (see~\"PqSetOutputLevel\"),   or\n##  equivalently pass the option `OutputLevel' (see~\"option OutputLevel\").\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,  `PqDisplayPcPresentation'\n##  performs menu item 4 of the current menu of the `pq' binary.\n##\nInstallGlobalFunction( PqDisplayPcPresentation, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_GRP_EXISTS_CHK( datarec );\n  PQ_DISPLAY_PRESENTATION( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_SET_OUTPUT_LEVEL(<datarec>, <lev>) . . . .  p-Q/SP/A p-Q menu option 5\n##\n##  inputs data to the `pq' binary to set the print level  to  <lev>  in  the\n##  current menu or the ``basic'' $p$-Quotient menu if the current menu is  a\n##  $p$-Group generation menu.\n##\nInstallGlobalFunction( PQ_SET_OUTPUT_LEVEL, function( datarec, lev )\n  if datarec.menu[ Length(datarec.menu) ] = 'G' then\n    PQ_MENU(datarec, \"pQ\");\n  fi;\n  ToPQ(datarec, [ 5 ], [ \"  #set output level\" ]);\n  ToPQ(datarec, [ lev ], [ \"  #output level\" ]);\n  datarec.OutputLevel := lev;\nend );\n\n#############################################################################\n##\n#F  PqSetOutputLevel( <i>, <lev> ) .  user version of p-Q/SP/A p-Q menu opt 5\n#F  PqSetOutputLevel( <lev> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to set the output level of the `pq' binary to <lev>.\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary,  `PqSetOutputLevel'\n##  performs menu item 5 of the main (or advanced) $p$-Quotient menu, or  the\n##  Standard Presentation menu.\n##\nInstallGlobalFunction( PqSetOutputLevel, function( arg )\nlocal datarec, lev;\n  if not(Length(arg) in [1, 2]) then\n    Error( \"1 or 2 arguments expected\\n\");\n  fi;\n  lev := arg[Length(arg)];\n  if not(lev in [0..3]) then\n    Error( \"argument <lev> should be an integer in [0 .. 3]\\n\" );\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1..Length(arg) - 1]});\n  PQ_SET_OUTPUT_LEVEL( datarec, lev);\nend );\n\n#############################################################################\n##\n#F  PQ_NEXT_CLASS( <datarec> ) . . . . . . . . . . . . . .  p-Q menu option 6\n##\n##  directs the `pq' binary to calculate the next class of `<datarec>.group',\n##  using option 6 of the main $p$-Quotient menu.\n##\n#T  Another possibility for checking for whether a queue factor is needed\n#T  is to test for `<datarec>.hasAuts'.\n##\nInstallGlobalFunction( PQ_NEXT_CLASS, function( datarec )\nlocal line;\n  PQ_MENU(datarec, \"pQ\");\n  PQ_UNBIND(datarec, [\"pQuotient\", \"pQepi\", \"pCover\"]);\n  if VALUE_PQ_OPTION(\"Identities\", [], datarec) <> [] then\n    if datarec.class >= 1 then\n      datarec.prevngens := datarec.ngens[ datarec.class ];\n    fi;\n    PQ_P_COVER(datarec);\n    PQ_FINISH_NEXT_CLASS(datarec);\n  else\n    datarec.match := true;\n    ToPQ(datarec, [ 6 ], [ \"  #calculate next class\" ]);\n    if IsMatchingSublist(datarec.line, \"Input queue factor:\") then\n      ToPQ(datarec, [ VALUE_PQ_OPTION(\"QueueFactor\", 15) ],\n                    [ \" #queue factor\"]);\n    fi;\n    PQ_SET_GRP_DATA(datarec);\n  fi;\nend );\n\n#############################################################################\n##\n#F  PqNextClass( <i> [: <option>]) . . . .  user version of p-Q menu option 6\n#F  PqNextClass( [: <option>])\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, direct the `pq' to\n##  calculate the next class of `ANUPQData.io[<i>].group'.\n##\n##  \\atindex{option QueueFactor}{@option \\noexpand`QueueFactor'}\n##  `PqNextClass'  accepts  the  option   `QueueFactor'   (see   also~\"option\n##  QueueFactor\") which should be a positive integer  if  automorphisms  have\n##  been previously supplied. If the `pq' binary requires a queue factor  and\n##  none is supplied via the option `QueueFactor' a default of 15 is taken.\n##\n##  *Notes*\n##\n##  The single command: `PqNextClass(<i>);' is equivalent to executing\n##\n##  \\){\\kernttindent}PqSetupTablesForNextClass(<i>);\n##  \\){\\kernttindent}PqTails(<i>, 0);\n##  \\){\\kernttindent}PqDoConsistencyChecks(<i>, 0, 0);\n##  \\){\\kernttindent}PqCollectDefiningRelations(<i>);\n##  \\){\\kernttindent}PqDoExponentChecks(<i>);\n##  \\){\\kernttindent}PqEliminateRedundantGenerators(<i>);\n##\n##  For those familiar with the `pq' binary, `PqNextClass' performs menu item\n##  6 of the main $p$-Quotient menu.\n##\nInstallGlobalFunction( PqNextClass, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqNextClass\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_GRP_EXISTS_CHK( datarec );\n  PQ_NEXT_CLASS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_P_COVER( <datarec> ) . . . . . . . . . . . . . . . . p-Q menu option 7\n##\n##  directs  the  `pq'  binary  to  compute   the   $p$-covering   group   of\n##  `<datarec>.group', using option 7 of the main $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_P_COVER, function( datarec )\nlocal savefile;\n  PQ_MENU(datarec, \"pQ\");\n  Unbind( datarec.pCover );\n  datarec.match := true;\n  ToPQ(datarec, [ 7 ], [ \"  #compute p-cover\" ]);\n  PQ_SET_GRP_DATA(datarec);\n  datarec.pcoverclass := datarec.class;\n  Unbind(datarec.capable);\nend );\n\n#############################################################################\n##\n#F  PqComputePCover( <i> ) . . . . . . . .  user version of p-Q menu option 7\n#F  PqComputePCover()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, direct the `pq' to\n##  compute the $p$-covering group of `ANUPQData.io[<i>].group'.\n##\n##  *Notes*\n##\n##  The single command: `PqComputePCover(<i>);' is equivalent to executing\n##\n##  \\){\\kernttindent}PqSetupTablesForNextClass(<i>);\n##  \\){\\kernttindent}PqTails(<i>, 0);\n##  \\){\\kernttindent}PqDoConsistencyChecks(<i>, 0, 0);\n##  \\){\\kernttindent}PqEliminateRedundantGenerators(<i>);\n##\n##  For those familiar with the `pq' binary, `PqComputePCover' performs  menu\n##  item 7 of the main $p$-Quotient menu.\n##\nInstallGlobalFunction( PqComputePCover, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_GRP_EXISTS_CHK( datarec );\n  PQ_P_COVER( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_EVALUATE_IDENTITIES(<datarec>) . evaluate Identities option identities\n##\nInstallGlobalFunction( PQ_EVALUATE_IDENTITIES, function( datarec )\nlocal identity, procId;\n  procId := datarec.procId;\n  for identity in VALUE_PQ_OPTION(\"Identities\", [], datarec) do\n    PQ_EVALUATE_IDENTITY(procId, identity);\n  od;\n  PQ_ELIMINATE_REDUNDANT_GENERATORS( datarec );\n  Info(InfoANUPQ, 1, \"Class \", datarec.class, \" with \",\n                     PqNrPcGenerators(procId), \" generators.\" );\nend );\n\n#############################################################################\n##\n#F  PqEvaluateIdentities( <i> ) . . . . evaluate Identities option identities\n#F  PqEvaluateIdentities()\n##\n##  for the  <i>th  or  default  interactive  {\\ANUPQ}  process,  invoke  the\n##  evaluation  of  identities  defined  by  the  `Identities'  option,   and\n##  eliminate any redundant pc generators formed. Since a previous  value  of\n##  `Identities'  is  saved  in  the  data  record  of  the  process,  it  is\n##  unnecessary to pass the `Identities' if set previously.\n##\n##  *Note:* This function is mainly implemented at the {\\GAP} level. It  does\n##  not correspond to a menu item of the `pq' program.\n##\nInstallGlobalFunction( PqEvaluateIdentities, function( arg )\n  PQ_OTHER_OPTS_CHK(\"PqEvaluateIdentities\", true);\n  PQ_EVALUATE_IDENTITIES( CallFuncList(ANUPQDataRecord, arg) );\nend );\n\n#############################################################################\n##\n#F  PQ_FINISH_NEXT_CLASS( <datarec> ) . . .  take the p-cover to a next class\n##\n##  does the usual operations required after calculating the  <p>-cover  that\n##  brings the pcp back to a next class, except that it  also  slips  in  the\n##  evaluation of the identities of the `Identities' option.\n##\nInstallGlobalFunction( PQ_FINISH_NEXT_CLASS, function( datarec )\n  PushOptions( rec(nonuser := true) );\n  PQ_COLLECT_DEFINING_RELATIONS( datarec );\n  PQ_DO_EXPONENT_CHECKS( datarec, [1, datarec.class] );\n  PQ_EVALUATE_IDENTITIES( datarec );\n  PopOptions();\nend );\n\n#############################################################################\n##\n#F  PQ_COLLECT( <datarec>, <word> ) . . . . . . . . . . . A p-Q menu option 1\n##\n##  instructs the  `pq'  binary  to  do  a  collection  on  <word>  a  string\n##  representing a word in the  current  pc  generators,  e.g.  `\"x3*x2*x1\"',\n##  using option 1 of the interactive $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_COLLECT, function( datarec, word )\n\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 1 ], [ \"  #do individual collection\" ]);\n  datarec.match := \"The result of collection is\";\n  ToPQ(datarec, [ word, \";\"], [ \"  #word to be collected\" ]);\n  return PQ_WORD(datarec);\nend );\n\n#############################################################################\n##\n#F  PQ_CHECK_WORD( <datarec>, <wordOrList>, <ngens> ) . .  check word or list\n##\n##  checks that <wordOrList> is a valid word in  the  current  pc  generators\n##  (<ngens> is the number of current pc  generators)  or  a  valid  list  of\n##  generator number-exponent pairs that  will  generate  such  a  word,  and\n##  either emits an error or returns the valid word.\n##\nInstallGlobalFunction( PQ_CHECK_WORD, function( datarec, wordOrList, ngens )\nlocal parts, gens;\n  if not IsList(wordOrList) or \n     not IsString(wordOrList) and \n     not ForAll(wordOrList, pair -> IsList(pair) and 2 = Length(pair) and\n                                    ForAll(pair, IsInt) ) then\n    Error( \"argument <wordOrList> should be a string e.g. \\\"x3*x2^2*x1\\\",\\n\",\n           \"or a list of gen'r no.-exponent pairs from which such a word \",\n           \"may be generated\\n\" );\n  fi;\n  if IsString(wordOrList) then\n    #check word makes sense\n    PqParseWord(ngens, wordOrList);\n    \n  elif IsList(wordOrList) then\n    if not ForAll(wordOrList, \n                  pair -> IsPosInt(pair[1]) and pair[1] <= ngens) then\n      Error( \"generator numbers in argument <wordOrList> must be in the \",\n             \"range: \", \"[1 .. \", ngens, \"]\\n\" );\n    fi;\n    wordOrList := JoinStringsWithSeparator(\n                      List( wordOrList, \n                            pair -> Concatenation( \"x\", String(pair[1]),\n                                                   \"^\", String(pair[2]) ) ),\n                      \"*\" );\n  fi;\n  if IsEmpty(wordOrList) then\n    wordOrList := \"x1^0\";\n  fi;\n  return wordOrList;\nend );\n\n#############################################################################\n##\n#F  PQ_WORD( <datarec> ) . . . .  parse pq output for a word in pc generators\n##\n##  parses `<datarec>.matchedline' for a word in the  current  pc  generators\n##  and returns it as a list of gen'r no.-exponent  pairs;  `<datarec>.match'\n##  must have previously been set.\n##\nInstallGlobalFunction( PQ_WORD, function( datarec )\nlocal word;\n  word := SplitString( datarec.matchedline{[Length(datarec.match) + 1 ..\n                                            Length(datarec.matchedline)]},\n                       \"\", \" \\n\" );\n  if word = [ \"IDENTITY\" ] then\n    word := [];\n  else\n    word := List( word, \n                  function(syl)\n                    syl := List( SplitString(syl, \"\", \".^\"), Int );\n                    if 1 = Length(syl) then\n                      Add(syl, 1);\n                    fi;\n                    return syl;\n                  end );\n  fi;\n  PQ_UNBIND(datarec, [\"match\", \"matchedline\"]);\n  return word;\nend );\n\n#############################################################################\n##\n#F  PQ_CHK_COLLECT_COMMAND_ARGS( <args> ) . . check args for a collect cmd ok\n##\n##  returns a list of valid arguments for  a  low-level  collect  command  or\n##  generates an error.\n##\nInstallGlobalFunction( PQ_CHK_COLLECT_COMMAND_ARGS, function( args )\nlocal datarec, wordOrList, ngens;\n  if IsEmpty(args) or 2 < Length(args) then\n    Error( \"1 or 2 arguments expected\\n\");\n  fi;\n  wordOrList := args[Length(args)];\n  datarec := CallFuncList(ANUPQDataRecord, args{[1..Length(args) - 1]});\n  ngens := datarec.ngens[ Length(datarec.ngens) ];\n  wordOrList := PQ_CHECK_WORD(datarec, wordOrList, ngens);\n  return [datarec, wordOrList];\nend );\n\n#############################################################################\n##\n#F  PqCollect( <i>, <word> ) . . . . . .  user version of A p-Q menu option 1\n#F  PqCollect( <word> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, instruct the  `pq'\n##  program to do a collection on <word>, a word in the current pc generators\n##  (the form of <word> required is described below). `PqCollect' returns the\n##  resulting word of the collection as a list of generator number,  exponent\n##  pairs (the same form as the second allowed  input  form  of  <word>;  see\n##  below).\n##\n##  The argument <word> may be input in either of the following ways:\n##\n##  \\beginlist%ordered\n##\n##  \\item{1.}\n##  <word> may be a string, where the <i>th pc generator  is  represented  by\n##  `x<i>', e.g.~`\"x3*x2^2*x1\"'. This way is quite versatile  as  parentheses\n##  and left-normed commutators -- using square brackets, in the same way  as\n##  `PqGAPRelators' (see~\"PqGAPRelators\") -- are permitted; <word> is checked\n##  for correct syntax via `PqParseWord' (see~\"PqParseWord\").\n##\n##  \\item{2.}\n##  Otherwise, <word> must be a list of generator number, exponent  pairs  of\n##  integers, i.e.~ each pair represents a ``syllable'' so that  `[  [3,  1],\n##  [2, 2], [1, 1] ]' represents the same word as that of the  example  given\n##  for the first allowed form of <word>.\n##\n##  \\endlist\n##\n##  *Note:* For those familiar with the  `pq'  program,  `PqCollect'  performs\n##  menu item 1 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqCollect, function( arg )\n  return CallFuncList( PQ_COLLECT, PQ_CHK_COLLECT_COMMAND_ARGS(arg) );\nend );\n\n#############################################################################\n##\n#F  PQ_SOLVE_EQUATION( <datarec>, <a>, <b> ) . . . . . .  A p-Q menu option 2\n##\n##  inputs data to the `pq' binary for option 2 of the Advanced  $p$-Quotient\n##  menu, to solve $<a> * <x> = <b>$ for <x>.\n##\nInstallGlobalFunction( PQ_SOLVE_EQUATION, function( datarec, a, b )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 2 ], [ \"  #solve equation\" ]);\n  ToPQ(datarec, [ a, \";\" ], [ \"  #word a\" ]);\n  ToPQ(datarec, [ b, \";\" ], [ \"  #word b\" ]);\nend );\n\n#############################################################################\n##\n#F  PqSolveEquation( <i>, <a>, <b> ) . .  user version of A p-Q menu option 2\n#F  PqSolveEquation( <a>, <b> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to solve $<a> * <x> = <b>$ for <x>.\n##\n##  *Note:*\n##  For those familiar  with  the  `pq'  binary,  `PqSolveEquation'  performs\n##  menu item 2 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqSolveEquation, function( arg )\nlocal len, datarec;\n  len := Length(arg);\n  if not(len in [2,3]) then\n    Error(\"expected 2 or 3 arguments\\n\");\n  fi;\n  #@need to add argument checking for a and b@\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1 .. len - 2]});\n  PQ_SOLVE_EQUATION( datarec, arg[len - 1], arg[len] );\nend );\n\n#############################################################################\n##\n#F  PQ_COMMUTATOR( <datarec>, <words>, <pow>, <item> ) . A p-Q menu opts 3/24\n##\n##  inputs data to the `pq' binary  for  option  3  or  24  of  the  Advanced\n##  $p$-Quotient menu, to compute the left  normed  commutator  of  the  list\n##  <words> of words in the generators raised to  the  integer  power  <pow>,\n##  where <item> is `\"3 #commutator\"' for option 3  or  `\"24  #commutator  of\n##  defining genrs\"' for option 24.\n##\nInstallGlobalFunction( PQ_COMMUTATOR, function( datarec, words, pow, item )\nlocal i;\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, item[1], item[2]);\n  ToPQ(datarec, [ Length(words) ], [ \"  #no. of components\" ]);\n  for i in [1..Length(words)] do\n    ToPQ(datarec, [ words[i], \";\" ], [ \"  #word \", i ]);\n  od;\n  datarec.match := \"The commutator is\";\n  ToPQ(datarec, [ pow ], [ \"  #power\" ]);\n  return PQ_WORD(datarec);\nend );\n\n#############################################################################\n##\n#F  PQ_COMMUTATOR_CHK_ARGS( <args> ) . . . . check args for commutator cmd ok\n##\n##  returns a list of valid arguments for a low-level commutator  command  or\n##  generates an error.\n##\nInstallGlobalFunction( PQ_COMMUTATOR_CHK_ARGS, function( args )\nlocal len, words, pow, item, datarec, ngens;\n  len := Length(args);\n  if not(len in [3, 4]) then\n    Error(\"expected 3 or 4 arguments\\n\");\n  fi;\n  words := args[len - 2];\n  pow   := args[len - 1];\n  item  := args[len];\n  if not IsPosInt(pow) then\n    Error( \"argument <pow> must be a positive integer\\n\" );\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, args{[1 .. len - 3]});\n  if item[1][1] = 3 then\n    ngens := datarec.ngens[ Length(datarec.ngens) ];\n  else\n    ngens := datarec.ngens[ 1 ];\n  fi;\n  words := List( words, w -> PQ_CHECK_WORD(datarec, w, ngens) );\n  return [datarec, words, pow, item];\nend );\n\n#############################################################################\n##\n#F  PqCommutator( <i>, <words>, <pow> ) . user version of A p-Q menu option 3\n#F  PqCommutator( <words>, <pow> )\n##\n##  for  the  <i>th  or  default  interactive  {\\ANUPQ}  process,  compute  a\n##  user-defined commutator in the pc generators of  the  class  1  quotient,\n##  i.e.~the pc generators that correspond to the original fp or pc group  of\n##  the process, and return  the  result  as  a  list  of  generator  number,\n##  exponent pairs. The form required for each word of <words> is the same as\n##  that required for the <word> argument of  `PqCollect'  (see~\"PqCollect\").\n##  The form of  the  output  word  is  also  the  same  as  for  `PqCollect'\n##  (see~\"PqCollect\").\n##\n##  *Notes*\n##\n##  It is illegal for any word of <words> to contain pc generators of  weight\n##  larger      than      1.      Except      for      this      distinction,\n##  `PqCommutatorDefiningGenerators'   works   just    like    `PqCommutator'\n##  (see~\"PqCommutator\"). \n##\n##  For those familiar with the `pq' program, `PqCommutatorDefiningGenerators'\n##  performs menu item 24 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqCommutator, function( arg )\n  return CallFuncList( PQ_COMMUTATOR, \n                       PQ_COMMUTATOR_CHK_ARGS( \n                           Concatenation( arg, [[[3], [\"  #commutator\"]]] ) ) );\nend );\n\n#############################################################################\n##\n#F  PQ_SETUP_TABLES_FOR_NEXT_CLASS( <datarec> ) . . . . . A p-Q menu option 6\n##\n##  inputs data to the `pq' binary for option 6 of the Advanced  $p$-Quotient\n##  menu to set up tables for next class.\n##\nInstallGlobalFunction( PQ_SETUP_TABLES_FOR_NEXT_CLASS, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 6 ], [ \"  #set up tables for next class\" ]);\n  datarec.match := true;\n  PQ_SET_GRP_DATA(datarec); #Just to be sure it's up-to-date\n  datarec.setupclass := datarec.class;\nend );\n\n#############################################################################\n##\n#F  PqSetupTablesForNextClass( <i> ) . .  user version of A p-Q menu option 6\n#F  PqSetupTablesForNextClass()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary  to  set  up  tables  for  the  next  class.  As  as  side-effect,\n##  after   `PqSetupTablesForNextClass(<i>)'   the    value    returned    by\n##  `PqPClass(<i>)' will be one more than it was previously.\n##\n##  *Note:*\n##  For those familiar  with  the  `pq'  binary,  `PqSetupTablesForNextClass'\n##  performs menu item 6 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqSetupTablesForNextClass, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_SETUP_TABLES_FOR_NEXT_CLASS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_INSERT_TAILS( <datarec>, <weight>, <which> )  . .  A p-Q menu option 7\n##\n##  inputs data to the `pq' binary for option 7 of the Advanced  $p$-Quotient\n##  menu, to add and/or compute tails.\n##\nInstallGlobalFunction( PQ_INSERT_TAILS, function( datarec, weight, which )\nlocal intwhich;\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  intwhich := Position( [ \"compute and add\", \"add\", \"compute\" ], which ) - 1;\n  ToPQ(datarec, [ 7 ], [ \"  #\", which, \" tails\" ]);\n  ToPQ(datarec, [ weight ], [ \" #weight of tails\" ]);\n  ToPQ(datarec, [ intwhich ], [ \"  #\", which ]);\n  if intwhich <= 1 then\n    datarec.match := true;\n    PQ_SET_GRP_DATA(datarec);\n  fi;\nend );\n\n#############################################################################\n##\n#F  PQ_CHK_TAILS_ARGS( <args> ) . . . . .  check args for insert tails cmd ok\n##\nInstallGlobalFunction( PQ_CHK_TAILS_ARGS, function( args )\nlocal weight, datarec;\n  if IsEmpty(args) or 2 < Length(args) then\n    Error( \"1 or 2 arguments expected\\n\");\n  fi;\n  weight := args[Length(args)];\n  datarec := CallFuncList(ANUPQDataRecord, args{[1 .. Length(args) - 1]});\n  if not IsBound(datarec.setupclass) or datarec.class <> datarec.setupclass then\n    Error( \"tables to start next class have not been set up.\\n\",\n           \"Please call `PqSetupTablesForNextClass' first\\n\" );\n  fi;\n  if not(weight = 0 or weight in [2 .. datarec.class]) then\n    Error( \"argument <weight> should be an integer in [0] U [2 .. <class>],\\n\",\n           \"where <class> is the current class (\", datarec.class, \")\\n\" );\n  fi;\n  return datarec;\nend );\n\n#############################################################################\n##\n#F  PqAddTails( <i>, <weight> ) . . . .  adds tails using A p-Q menu option 7\n#F  PqAddTails( <weight> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to add tails of weight <weight> if  <weight>  is  in  the  integer\n##  range `[2 .. PqPClass(<i>)]' (assuming <i> is the number of the  process)\n##  or for all weights if `<weight> = 0'. See `PqTails' (\"PqTails\") for  more\n##  details.\n##\n##  *Note:*\n##  For those familiar with the `pq' binary, `PqAddTails' uses menu item 7 of\n##  the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqAddTails, function( arg )\n  PQ_INSERT_TAILS( PQ_CHK_TAILS_ARGS(arg), arg[Length(arg)], \"add\" );\nend );\n\n#############################################################################\n##\n#F  PqComputeTails( <i>, <weight> ) . . computes tails using A p-Q menu opt 7\n#F  PqComputeTails( <weight> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to compute tails of weight <weight> if <weight> is in the  integer\n##  range `[2 .. PqPClass(<i>)]' (assuming <i> is the number of the  process)\n##  or for all weights if `<weight> = 0'. See `PqTails' (\"PqTails\") for  more\n##  details.\n##\n##  *Note:*\n##  For those familiar with the `pq' binary, `PqComputeTails' uses menu  item\n##  7 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqComputeTails, function( arg )\n  PQ_INSERT_TAILS( PQ_CHK_TAILS_ARGS(arg), arg[Length(arg)], \"compute\" );\nend );\n\n#############################################################################\n##\n#F  PqTails( <i>, <weight> ) . computes and adds tails using A p-Q menu opt 7\n#F  PqTails( <weight> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to compute and add tails of weight <weight> if <weight> is in  the\n##  integer range `[2 .. PqPClass(<i>)]' (assuming <i> is the number  of  the\n##  process) or for all weights if `<weight> = 0'.\n##\n##  If <weight> is non-zero, then tails that  introduce  new  generators  for\n##  only weight <weight> are computed and added, and  in  this  case  and  if\n##  `<weight> \\< PqPClass(<i>)', it is assumed that the tails that  introduce\n##  new  generators  for  each  weight  from  `PqPClass(<i>)'  downto  weight\n##  `<weight>  +  1'  have  already  been  added.  You  may  wish   to   call\n##  `PqSetMetabelian' (see~\"PqSetMetabelian\") prior to calling `PqTails'.\n##\n##  *Notes*\n##\n##  For its use in the context of finding the next class  see  \"PqNextClass\";\n##  in     particular,     a     call     to      `PqSetupTablesForNextClass'\n##  (see~\"PqSetupTablesForNextClass\")  needs  to  have  been  made  prior  to\n##  calling `PqTails'.\n##\n##  The single command: `PqTails(<i>, <weight>);' is equivalent to\n##\n##  \\){\\kernttindent}PqComputeTails(<i>, <weight>);\n##  \\){\\kernttindent}PqAddTails(<i>, <weight>);\n##\n##  For those familiar with the `pq' binary, `PqTails' uses menu  item  7  of\n##  the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqTails, function( arg )\n  PQ_INSERT_TAILS(PQ_CHK_TAILS_ARGS(arg), arg[Length(arg)], \"compute and add\");\nend );\n\n#############################################################################\n##\n#F  PQ_DO_CONSISTENCY_CHECKS(<datarec>, <weight>, <type>) .  A p-Q menu opt 8\n##\n##  inputs data to the `pq' binary for option 8 of the Advanced  $p$-Quotient\n##  menu, to do consistency checks.\n##\nInstallGlobalFunction( PQ_DO_CONSISTENCY_CHECKS, \nfunction( datarec, weight, type )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 8 ], [ \"  #check consistency\" ]);\n  ToPQ(datarec, [ weight ], [ \" #weight to be checked\" ]);\n  ToPQ(datarec, [ type ], [ \"  #type\" ]);\nend );\n\n#############################################################################\n##\n#F  PqDoConsistencyChecks(<i>,<weight>,<type>) . user ver of A p-Q menu opt 8\n#F  PqDoConsistencyChecks( <weight>, <type> )\n##\n##  for the <i>th or default interactive  {\\ANUPQ}  process,  do  consistency\n##  checks for weight <weight> if <weight> is in the  integer  range  `[3  ..\n##  PqPClass(<i>)]' (assuming <i> is the number of the process)  or  for  all\n##  weights if `<weight> = 0', and for type <type> if <type> is in the  range\n##  `[1, 2, 3]' (see below) or for all types if `<type> = 0'. (For its use in\n##  the context of finding the next class see \"PqNextClass\".)\n##\n##  The  *type*   of   a   consistency   check   is   defined   as   follows.\n##  `PqDoConsistencyChecks(<i>, <weight>, <type>)' for  <weight>  in  `[3  ..\n##  PqPClass(<i>)]' and the given  value  of  <type>  invokes  the  following\n##  `PqJacobi' checks (see~\"PqDoConsistencyCheck\"):\n##\n##  \\beginitems\n##\n##  `<type> = 1':&\n##  `PqJacobi(<i>, <a>, <a>, <a>)' checks for  pc  generators  of  index  <a>\n##  satisfying `2 * PqWeight(<i>, <a>) + 1 = <weight>'.\n##\n##  `<type> = 2':&\n##  `PqJacobi(<i>, <b>, <b>, <a>)' checks for pc generators of  indices  <b>,\n##  <a> satisfying `<b> > <a>' and `PqWeight(<i>, <b>) + PqWeight(<i>, <a>) +\n##  1 = <weight>'.\n##\n##  `<type> = 3':&\n##  `PqJacobi(<i>, <c>, <b>, <a>)' checks for pc generators of  indices  <c>,\n##  <b>, <a> satisfying `<c> > <b> > <a>' and the sum of the weights of these\n##  generators equals <weight>.\n##\n##  \\enditems\n##\n##  *Notes*\n##\n##  `PqWeight(<i>, <j>)' returns the weight of the <j>th  pc  generator,  for\n##  process <i> (see~\"PqWeight\").\n##\n##  It is assumed that tails for the given weight (or weights)  have  already\n##  been added (see~\"PqTails\").\n##\n##  For those familiar with the `pq' binary, `PqDoConsistencyChecks' performs\n##  menu item 8 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqDoConsistencyChecks, function( arg )\nlocal len, datarec, weight, type;\n  len := Length(arg);\n  if not(len in [2, 3]) then\n    Error(\"expected 2 or 3 arguments\\n\");\n  fi;\n  weight := arg[len - 1];\n  type   := arg[len];\n  arg := arg{[1 .. len - 2]};\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  if not IsBound(datarec.setupclass) or datarec.class <> datarec.setupclass then\n    Error( \"tables to start next class have not been set up.\\n\",\n           \"Please call `PqSetupTablesForNextClass' first\\n\" );\n  fi;\n  if not(weight = 0 or weight in [3 .. datarec.class]) then\n    Error( \"argument <weight> should be an integer in [0] U [3 .. <class>],\\n\",\n           \"where <class> is the current class (\", datarec.class, \")\\n\" );\n  fi;\n  if not(type in [0..3]) then\n    Error( \"argument <type> should be in [0,1,2,3]\\n\" );\n  fi;\n  PQ_DO_CONSISTENCY_CHECKS( datarec, weight, type );\nend );\n\n#############################################################################\n##\n#F  PQ_COLLECT_DEFINING_RELATIONS( <datarec> ) . . . . .  A p-Q menu option 9\n##\n##  inputs data to the `pq' binary for option 9 of the Advanced  $p$-Quotient\n##  menu, to collect defining relations.\n##\nInstallGlobalFunction( PQ_COLLECT_DEFINING_RELATIONS, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 9 ], [ \"  #collect defining relations\" ]);\nend );\n\n#############################################################################\n##\n#F  PqCollectDefiningRelations( <i> ) . . user version of A p-Q menu option 9\n#F  PqCollectDefiningRelations()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to collect the images of the defining relations of the original fp\n##  group of the process, with respect to the current pc presentation, in the\n##  context of finding the  next  class  (see~\"PqNextClass\").  If  the  tails\n##  operation  is  not  complete  then  the  relations   may   be   evaluated\n##  incorrectly.\n##\n##  *Note:*\n##  For those familiar with  the  `pq'  binary,  `PqCollectDefiningRelations'\n##  performs menu item 9 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqCollectDefiningRelations, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_COLLECT_DEFINING_RELATIONS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_DO_EXPONENT_CHECKS( <datarec>, <bnds> ) . . . . . A p-Q menu option 10\n##\n##  inputs data to the `pq' binary to do exponent checks for weights  between\n##  <bnds> inclusive, using option 10 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_DO_EXPONENT_CHECKS, function( datarec, bnds )\n  #@does default only at the moment@\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  datarec.match := \"Group is complete\";\n  ToPQ(datarec, [ 10 ], [ \" #do exponent checks\" ]);\n  if IsBound(datarec.matchedline) and\n     IsMatchingSublist(datarec.matchedline, \"Group is complete\") then\n    PQ_UNBIND(datarec, [\"match\", \"matchedline\"]);\n    datarec.complete := true;\n    return;\n  elif IsMatchingSublist(datarec.line, \"Input exponent law\") then\n    ToPQ(datarec, [ VALUE_PQ_OPTION(\"Exponent\", 0, datarec) ],\n                  [ \"  #exponent\" ]);\n  fi;\n  ToPQ(datarec, [ bnds[1] ], [ \" #start weight\" ]);\n  ToPQ(datarec, [ bnds[2] ], [ \" #end weight\"   ]);\n  ToPQ(datarec, [ 1 ], [ \"  #do default check\" ]);\n  Unbind(datarec.match);\nend );\n\n#############################################################################\n##\n#F  PqDoExponentChecks(<i>[: Bounds := <list>]) . user ver A p-Q menu opt. 10\n#F  PqDoExponentChecks([: Bounds := <list>])\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, direct  the  `pq'\n##  binary to do exponent checks for weights (inclusively) between the bounds\n##  of `Bounds' or for all weights if `Bounds' is not given. The value <list>\n##  of `Bounds' (assuming the interactive process is numbered <i>) should  be\n##  a list of  two  integers  <low>,  <high>  satisfying  $1  \\le  <low>  \\le\n##  <high> \\le `PqPClass(<i>)'$ (see~\"PqPClass\").\n##\n##  *Note:*\n##  For those familiar with the `pq'  binary,  `PqDoExponentChecks'  performs\n##  menu item 10 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqDoExponentChecks, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqDoExponentChecks\", true);\n  datarec := PQ_DATA_CHK(arg);\n  PQ_DO_EXPONENT_CHECKS( datarec, PQ_BOUNDS(datarec, datarec.class) );\nend );\n\n#############################################################################\n##\n#F  PQ_ELIMINATE_REDUNDANT_GENERATORS( <datarec> ) . . . A p-Q menu option 11\n##\n##  inputs data to the `pq' binary for option 11 of the Advanced $p$-Quotient\n##  menu, to eliminate redundant generators.\n##\nInstallGlobalFunction( PQ_ELIMINATE_REDUNDANT_GENERATORS, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 11 ], [ \" #eliminate redundant generators\" ]);\n  datarec.match := true;\n  PQ_SET_GRP_DATA(datarec);\nend );\n\n#############################################################################\n##\n#F  PqEliminateRedundantGenerators( <i> ) .  user ver of A p-Q menu option 11\n#F  PqEliminateRedundantGenerators()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to eliminate redundant generators of the current $p$-quotient.\n##\n##  *Note:*\n##  For those familiar with the `pq' binary, `PqEliminateRedundantGenerators'\n##  performs menu item 11 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqEliminateRedundantGenerators, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_ELIMINATE_REDUNDANT_GENERATORS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_REVERT_TO_PREVIOUS_CLASS( <datarec> ) . . . . . . A p-Q menu option 12\n##\n##  inputs data to the `pq' binary for option 12 of the Advanced $p$-Quotient\n##  menu, to abandon the current class and revert to the previous class.\n##\nInstallGlobalFunction( PQ_REVERT_TO_PREVIOUS_CLASS, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 12 ], [ \" #revert to previous class\" ]);\n  Unbind( datarec.ngens[ datarec.class ] );\n  datarec.match := true;\n  PQ_SET_GRP_DATA(datarec); #Just to be sure it's up-to-date\n  datarec.setupclass := datarec.class - 1;\nend );\n\n#############################################################################\n##\n#F  PqRevertToPreviousClass( <i> ) . . . user version of A p-Q menu option 12\n#F  PqRevertToPreviousClass()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, direct  the  `pq'\n##  binary to abandon the current class and revert to the previous class.\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,  `PqRevertToPreviousClass'\n##  performs menu item 12 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqRevertToPreviousClass, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_REVERT_TO_PREVIOUS_CLASS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_SET_MAXIMAL_OCCURRENCES( <datarec>, <noccur> ) . .  A p-Q menu opt. 13\n##\n##  inputs data to the  `pq'  binary,  to  set  the  maximal  occurrences  of\n##  generators of weight 1 in generator definitions, using option 13  of  the\n##  Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_SET_MAXIMAL_OCCURRENCES, function( datarec, noccur )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 13 ], [ \" #set maximal occurrences\" ]);\n  ToPQ(datarec, [ JoinStringsWithSeparator( List(noccur, String), \" \" ) ],\n                [ \" #max occurrences of weight 1 gen'rs\"]);\nend );\n\n#############################################################################\n##\n#F  PqSetMaximalOccurrences( <i>, <noccur> ) . user ver of A p-Q menu opt. 13\n#F  PqSetMaximalOccurrences( <noccur> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to set maximal occurrences of  the  weight  1  generators  in  the\n##  definitions of pcp generators of the group of the process; <noccur>  must\n##  be a list of non-negative integers of  length  the  number  of  weight  1\n##  generators (i.e.~the rank of the class 1 $p$-quotient of the group of the\n##  process). An entry of `0' for a particular generator indicates that there\n##  is no limit on the number of occurrences for the generator.\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,  `PqSetMaximalOccurrences'\n##  performs menu item 13 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqSetMaximalOccurrences, function( arg )\nlocal len, noccur, datarec;\n  len := Length(arg);\n  if not(len in [1, 2]) then\n    Error( \"expected 1 or 2 arguments\\n\");\n  fi;\n  noccur := arg[len];\n  if not IsList(noccur) or not ForAll(noccur, x -> IsInt(x) and x >= 0) then\n    Error( \"<noccur> argument must be a list of non-negative integers\\n\" );\n  fi;\n  arg := arg{[1 .. len - 1]};\n  datarec := PQ_DATA_CHK(arg);\n  if Length(noccur) <> datarec.ngens[1] then\n    Error( \"<noccur> argument must be a list of length equal to\\n\",\n           \"the no. of generators of weight 1 (\",  datarec.ngens[1], \")\\n\" );\n  fi;\n  PQ_SET_MAXIMAL_OCCURRENCES( datarec, noccur );\nend );\n\n#############################################################################\n##\n#F  PQ_SET_METABELIAN( <datarec> ) . . . . . . . . . . . A p-Q menu option 14\n##\n##  inputs data to the `pq' binary for option 14 of the Advanced $p$-Quotient\n##  menu, to set the metabelian flag.\n##\nInstallGlobalFunction( PQ_SET_METABELIAN, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 14 ], [ \" #set metabelian\" ]);\nend );\n\n#############################################################################\n##\n#F  PqSetMetabelian( <i> ) . . . . . . . user version of A p-Q menu option 14\n#F  PqSetMetabelian()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to enforce metabelian-ness.\n##\n##  *Note:* \n##  For those familiar  with  the  `pq'  binary,  `PqSetMetabelian'  performs\n##  menu item 14 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqSetMetabelian, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_SET_METABELIAN( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_DO_CONSISTENCY_CHECK( <datarec>, <c>, <b>, <a> ) . A p-Q menu option 15\n##\n##  inputs data to the `pq' binary for option 15 of the Advanced $p$-Quotient\n##  menu, to do a consistency check.\n##\nInstallGlobalFunction( PQ_DO_CONSISTENCY_CHECK, function( datarec, c, b, a )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 15 ], [ \" #do individual consistency check\" ]);\n  ToPQ(datarec, [ c, \" \", b, \" \", a ], [ \"  #generator indices\"]);\nend );\n\n#############################################################################\n##\n#F  PqDoConsistencyCheck(<i>, <c>, <b>, <a>) .  user ver of A p-Q menu opt 15\n#F  PqDoConsistencyCheck( <c>, <b>, <a> )\n#F  PqJacobi(<i>, <c>, <b>, <a>)\n#F  PqJacobi( <c>, <b>, <a> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to do the Jacobi consistency check  for  the  pc  generators  with\n##  indices <c>, <b>, <a> which should be non-increasing  positive  integers,\n##  i.e.~$<c>   \\ge   <b>   \\ge   <a>$.   For   further   explanation,    see\n##  `PqDoConsistencyChecks' (\"PqDoConsistencyChecks\").\n##\n##  *Note:*\n##  For those familiar  with  the  `pq'  binary,  `PqDoConsistencyCheck'  and\n##  `PqJacobi' perform menu item 15 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqDoConsistencyCheck, function( arg )\nlocal len, c, b, a, datarec;\n  len := Length(arg);\n  if not(len in [3, 4]) then\n    Error( \"expected 3 or 4 arguments\\n\" );\n  fi;\n  c := arg[len - 2];\n  b := arg[len - 1];\n  a := arg[len];\n  arg := arg{[1 .. len - 3]};\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  if not IsBound(datarec.setupclass) or datarec.class <> datarec.setupclass then\n    Error( \"tables to start next class have not been set up.\\n\",\n           \"Please call `PqSetupTablesForNextClass' first\\n\" );\n  fi;\n  if not ForAll([c, b, a], IsPosInt) or datarec.class < c or c < b or b < a then\n    Error( \"pc generator indices must be non-increasing \",\n           \"integers in [1 .. <class>],\\n\",\n           \"where <class> is the current class (\", datarec.class, \")\\n\" );\n  fi;\n  PQ_DO_CONSISTENCY_CHECK( datarec, c, b, a );\nend );\n\n#############################################################################\n##\n#F  PQ_COMPACT( <datarec> ) . . . . . . . . . . . . . .  A p-Q menu option 16\n##\n##  inputs data to the `pq' binary for option 16 of the Advanced $p$-Quotient\n##  menu, to do a compaction.\n##\nInstallGlobalFunction( PQ_COMPACT, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 16 ], [ \" #compact\" ]);\nend );\n\n#############################################################################\n##\n#F  PqCompact( <i> ) . . . . . . . . . . user version of A p-Q menu option 16\n#F  PqCompact()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to do a compaction.\n##\n##  *Note:*\n##  For those familiar with the `pq' binary, `PqCompact' performs  menu  item\n##  16 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqCompact, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_COMPACT( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_ECHELONISE( <datarec> ) . . . . . . . . . . . . . A p-Q menu option 17\n##\n##  inputs data to the `pq' binary for option 17 of the Advanced $p$-Quotient\n##  menu, to echelonise.\n##\nInstallGlobalFunction( PQ_ECHELONISE, function( datarec )\nlocal line, redgen;\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  datarec.match := \"Generator\";\n  ToPQ(datarec, [ 17 ], [ \" #echelonise\" ]);\n  if IsBound(datarec.matchedline) and \n     PositionSublist(datarec.matchedline, \"redundant\") <> fail then\n    line := SplitString(datarec.matchedline, \"\", \" \\n\");\n    redgen := Int( line[2] );\n  else\n    redgen := fail;\n  fi;\n  PQ_UNBIND(datarec, [\"match\", \"matchedline\"]);\n  return redgen;\nend );\n\n#############################################################################\n##\n#F  PqEchelonise( <i> ) . . . . . . . .  user version of A p-Q menu option 17\n#F  PqEchelonise()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  program to echelonise the word most recently collected by `PqCollect'  or\n##  `PqCommutator' against the relations of the current pc presentation,  and\n##  return the number of  the  generator  made  redundant  or  `fail'  if  no\n##  generator was made redundant. A call to `PqCollect' (see~\"PqCollect\")  or\n##  `PqCommutator' (see~\"PqCommutator\") needs to be performed prior to  using\n##  this command.\n##\n##  *Note:*\n##  For those familiar with the `pq'  binary,  `PqEchelonise'  performs  menu\n##  item 17 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqEchelonise, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  return PQ_ECHELONISE( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_SUPPLY_OR_EXTEND_AUTOMORPHISMS(<datarec>[,<mlist>])  A p-Q menu opt 18\n##\n##  inputs data to the `pq' binary for option 18 of the Advanced $p$-Quotient\n##  menu.  If  a  list  <mlist>  of  matrices   with   non-negative   integer\n##  coefficients  is  supplied  it  is  used  to  ``supply''   automorphisms;\n##  otherwise, previously supplied automorphisms are ``extended''.\n##\nInstallGlobalFunction( PQ_SUPPLY_OR_EXTEND_AUTOMORPHISMS, function( arg )\nlocal datarec;\n  datarec := arg[1];\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  if 1 = Length(arg) then\n    ToPQ(datarec, [ 18 ], [ \" #extend auts\" ]);\n  else\n    ToPQ(datarec, [ 18 ], [ \" #supply auts\" ]);\n    CallFuncList(PQ_MANUAL_AUT_INPUT, arg);\n  fi;\n  datarec.hasAuts := true;\nend );\n\n#############################################################################\n##\n#F  PqSupplyAutomorphisms(<i>, <mlist>) . . supply auts via A p-Q menu opt 18\n#F  PqSupplyAutomorphisms( <mlist> )\n##\n##  for the  <i>th  or  default  interactive  {\\ANUPQ}  process,  supply  the\n##  automorphism  data  provided  by  the  list  <mlist>  of  matrices   with\n##  non-negative integer coefficients. Each matrix in <mlist> must  have  the\n##  same dimensions; in particular, the number of rows of each matrix must be\n##  the number of pc generators of the  current  $p$-quotient  of  the  group\n##  associated with the interactive {\\ANUPQ} process.\n##\n##  *Note:*\n##  For those familiar with the  `pq'  binary,  `PqSupplyAutomorphisms'  uses\n##  menu item 18 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqSupplyAutomorphisms, function( arg )\nlocal args;\n  args := PQ_AUT_ARG_CHK(1, arg);\n  args[1] := ANUPQData.io[ args[1] ];\n  if IsBound(args[1].hasAuts) and args[1].hasAuts then\n    Error(\"huh! already have automorphisms.\\n\",\n          \"Perhaps you wanted to use `PqExtendAutomorphisms'\\n\");\n  fi;\n  CallFuncList( PQ_SUPPLY_OR_EXTEND_AUTOMORPHISMS, args );\nend );\n\n#############################################################################\n##\n#F  PqExtendAutomorphisms( <i> ) . . . . .  extend auts via A p-Q menu opt 18\n#F  PqExtendAutomorphisms()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to extend previously-supplied automorphisms.\n##\n##  *Note:*\n##  For those familiar with the  `pq'  binary,  `PqExtendAutomorphisms'  uses\n##  menu item 18 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqExtendAutomorphisms, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  if not(IsBound(datarec.hasAuts) and datarec.hasAuts) then\n    Error(\"huh! don't have any automorphisms to extend.\\n\",\n          \"Perhaps you wanted to use `PqSupplyAutomorphisms'\\n\");\n  fi;\n  PQ_SUPPLY_OR_EXTEND_AUTOMORPHISMS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_CLOSE_RELATIONS( <datarec>, <qfac> ) . . . . . .  A p-Q menu option 19\n##\n##  inputs data to the `pq' binary for option 19 of the Advanced $p$-Quotient\n##  menu, to apply automorphisms.\n##\nInstallGlobalFunction( PQ_CLOSE_RELATIONS, function( datarec, qfac )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 19 ], [ \" #close relations\"  ]);\n  ToPQ(datarec, [ qfac ], [ \" #queue factor\" ]);\nend );\n\n#############################################################################\n##\n#F  PqApplyAutomorphisms( <i>, <qfac> ) . .  user ver of A p-Q menu option 19\n#F  PqApplyAutomorphisms( <qfac> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to apply automorphisms; <qfac> is the queue factor e.g. `15'.\n##\n##  *Note:*\n##  For those familiar with  the  `pq'  binary,  `PqCloseRelations'  performs\n##  menu item 19 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqApplyAutomorphisms, function( arg )\nlocal len, datarec, qfac;\n  len := Length(arg);\n  if not(len in [1, 2]) then\n    Error(\"expected 1 or 2 arguments\\n\");\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1 .. len - 1]});\n  PQ_CLOSE_RELATIONS( datarec, arg[len] );\nend );\n\n#############################################################################\n##\n#F  PQ_DISPLAY( <datarec>, <opt>, <type>, <bnds> ) .  A p-Q menu option 20/21\n##\n##  inputs data to the `pq' binary  for  Advanced  $p$-Quotient  menu  option\n##  <opt> (<opt> should be 20 or 21) to display the generator  structure  (if\n##  `<opt> = 20' and `<type> = \"structure\"') or to display automorphisms  (if\n##  `<opt> = 21' and `<type> =  \"automorphisms\"'),  for  the  pcp  generators\n##  numbered between the bounds determined by the option `Bounds' or for  all\n##  pcp generators if `Bounds' is not set.\n##\nInstallGlobalFunction( PQ_DISPLAY, function( datarec, opt, type, bnds )\n  PQ_MENU(datarec, \"ApQ\");\n  if VALUE_PQ_OPTION(\"OutputLevel\", datarec) <> fail then\n    PQ_SET_OUTPUT_LEVEL( datarec, datarec.OutputLevel );\n  fi;\n  ToPQ(datarec, [ opt ],     [ \" #display \", type ]);\n  ToPQ(datarec, [ bnds[1] ], [ \" #no. of first generator\" ]);\n  ToPQ(datarec, [ bnds[2] ], [ \" #no. of last generator\"  ]);\nend );\n\n#############################################################################\n##\n#F  PQ_BOUNDS( <datarec>, <hibnd> ) . . provide bounds from option or default\n##\n##  extracts a list of two integer bounds from option  `Bounds'  if  set,  or\n##  otherwise uses `[1 .. <hibnd>]' as default. If `Bounds' is set  they  are\n##  checked to lie in the range `[1 .. <hibnd>]' and an error is generated if\n##  they are not. If there is no error the list of two bounds  determined  by\n##  the above is returned.\n##\nInstallGlobalFunction( PQ_BOUNDS, function( datarec, hibnd )\nlocal bounds;\n  bounds := VALUE_PQ_OPTION(\"Bounds\");\n  if bounds = fail then\n    return [1, hibnd];\n  elif bounds[2] > hibnd then \n    # most checking has already been done by VALUE_PQ_OPTION\n    Info(InfoWarning + InfoANUPQ, 1, \n         \"2nd bound \", bounds[2], \" of `Bounds' can be at most \", hibnd);\n    Info(InfoWarning + InfoANUPQ, 1, \n         \"... replacing this bound most with\", hibnd);\n    return [bounds[1], hibnd];\n  else\n    return bounds;\n  fi;\nend );\n\n#############################################################################\n##\n#F  PqDisplayStructure(<i>[: Bounds := <list>]) . user ver A p-Q menu opt. 20\n#F  PqDisplayStructure([: Bounds := <list>])\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary  to  display  the  structure  for  the  pcp  generators   numbered\n##  (inclusively) between the bounds of `Bounds' or  for  all  generators  if\n##  `Bounds' is not  given.  The  value  <list>  of  `Bounds'  (assuming  the\n##  interactive process is numbered <i>) should be a  list  of  two  integers\n##  <low>,  <high>  satisfying  `1  \\<=  <low>   \\<=   PqNrPcGenerators(<i>)'\n##  (see~\"PqNrPcGenerators\"). `PqDisplayStructure' also  accepts  the  option\n##  `OutputLevel' (see e.g.~\"Pq\" where the option is listed).\n##\n##  *Note:*\n##  For those familiar with the `pq'  binary,  `PqDisplayStructure'  performs\n##  option 20 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqDisplayStructure, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqDisplayStructure\", true);\n  datarec := PQ_DATA_CHK(arg);\n  PQ_DISPLAY( datarec, 20, \"structure\", \n              PQ_BOUNDS(datarec, datarec.forder[2]) );\nend );\n\n#############################################################################\n##\n#F  PqDisplayAutomorphisms(<i>[: Bounds := <list>]) . u ver A p-Q menu opt 21\n#F  PqDisplayAutomorphisms([: Bounds := <list>])\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to display the automorphism actions on the pcp generators numbered\n##  (inclusively) between the bounds of `Bounds' or  for  all  generators  if\n##  `Bounds' is not  given.  The  value  <list>  of  `Bounds'  (assuming  the\n##  interactive process is numbered <i>) should be a  list  of  two  integers\n##  <low>,   <high>   satisfying   $1    \\le    <low>    \\le    <high>    \\le\n##  `PqNrPcGenerators(<i>)'$  (see~\"PqNrPcGenerators\").  `PqDisplayStructure'\n##  also accepts the option `OutputLevel' (see \"option OutputLevel\").\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,   `PqDisplayAutomorphisms'\n##  performs menu item 21 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqDisplayAutomorphisms, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqDisplayAutomorphisms\", true);\n  datarec := PQ_DATA_CHK(arg);\n  PQ_DISPLAY( datarec, 21, \"automorphisms\", \n              PQ_BOUNDS(datarec, datarec.forder[2]) );\nend );\n\n#############################################################################\n##\n#F  PQ_COLLECT_DEFINING_GENERATORS( <datarec>, <word> ) . . A p-Q menu opt 23\n##\n##  instructs the  `pq'  binary  to  do  a  collection  on  <word>  a  string\n##  representing a word in the  weight 1  pc  generators,  e.g.  `\"x2^2*x1\"',\n##  using option 23 of the interactive $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_COLLECT_DEFINING_GENERATORS, function( datarec, word )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 23 ], [ \" #collect defining generators\" ]);\n  datarec.match := \"The result of collection is\";\n  ToPQ(datarec, [ word, \";\" ], [ \"  #word to be collected\" ]);\n  return PQ_WORD(datarec);\nend );\n\n#############################################################################\n##\n#F  PqCollectWordInDefiningGenerators(<i>,<word>) . u ver of A p-Q menu op 23\n#F  PqCollectWordInDefiningGenerators( <word> )\n##\n##  for  the  <i>th  or  default  interactive  {\\ANUPQ}  process,  collect  a\n##  user-defined word in the pc generators of the class 1 quotient,  i.e.~the\n##  pc generators that correspond to the original  fp  or  pc  group  of  the\n##  process, with respect to the current pc presentation, in the  context  of\n##  finding the next class (see~\"PqNextClass\"), and return the result of  the\n##  collection as a list of generator  number,  exponent  pairs.  The  <word>\n##  argument may be input in either of the two ways described for `PqCollect'\n##  (see~\"PqCollect\"). It is not illegal for <word> to contain pc  generators\n##  of weight larger than 1, but they are  intrepreted  as  representing  the\n##  identity;   `PqCollectWordInDefiningGenerators'   works   exactly    like\n##  `PqCollect' except for this distinction.\n##\n##  *Note:*\n##  For those familiar with the  `pq'  program,  `PqCollectDefiningGenerators'\n##  performs menu item 23 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqCollectWordInDefiningGenerators, function( arg )\n  return CallFuncList( PQ_COLLECT_DEFINING_GENERATORS, \n                       PQ_CHK_COLLECT_COMMAND_ARGS(arg) );\nend );\n\n#############################################################################\n##\n#F  PqCommutatorDefiningGenerators(<i>,<words>,<pow>) . user ver A p-Q opt 24\n#F  PqCommutatorDefiningGenerators( <words>, <pow> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to compute the left norm commutator of the list <words>  of  words\n##  in the generators raised to the integer power <pow>.\n##\n##  *Note:*\n##  For those familiar with the `pq' binary, `PqCommutatorDefiningGenerators'\n##  performs option 24 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqCommutatorDefiningGenerators, function( arg )\n  return CallFuncList( PQ_COMMUTATOR, \n                       PQ_COMMUTATOR_CHK_ARGS(\n                           Concatenation(\n                               arg, \n                               [[[24], [\" #commutator of defining genrs\"]]] )\n                           ) );\nend );\n\n#############################################################################\n##\n#F  PQ_WRITE_PC_PRESENTATION( <datarec>, <filename> ) .  A p-Q menu option 25\n##\n##  tells the `pq' binary to write a pc presentation to the  file  with  name\n##  <filename> for group `<datarec>.group'  (option  25  of  the  interactive\n##  $p$-Quotient menu).\n##\nInstallGlobalFunction( PQ_WRITE_PC_PRESENTATION, function( datarec, filename )\n  if not IsBound(datarec.setupfile) then\n    PrintTo(filename, \"\");   #to ensure it's writable and empty\n  fi;\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 25 ], [ \" #set output file\" ]);\n  ToPQ(datarec, [ filename ], []);\n  ToPQ(datarec, [ 2 ], [ \"  #output in GAP format\" ]);\nend );\n\n#############################################################################\n##\n#F  PqWritePcPresentation( <i>, <filename> ) . user ver. of A p-Q menu opt 25\n#F  PqWritePcPresentation( <filename> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to write a pc presentation to the file with  name  <filename>  for\n##  the group of that process for which a pc presentation has been previously\n##  computed, where the group of a process is the one given as first argument\n##  when `PqStart' was called to initiate that process (for process  <i>  the\n##  group is stored as `ANUPQData.io[<i>].group'). If the first character  of\n##  the string <filename> is not `/', <filename> is assumed to be the path of\n##  a writable file relative to the directory in which {\\GAP} was started. If\n##  a pc presentation has not been previously computed by  the  `pq'  binary,\n##  then  `pq'  is  called  to  compute  it   first,   effectively   invoking\n##  `PqPcPresentation' (see~\"PqPcPresentation\").\n##\n##  *Note:* For those familiar with the `pq' binary,  `PqPcWritePresentation'\n##  performs menu item 25 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqWritePcPresentation, function( arg )\nlocal filename, datarec;\n  if 2 < Length(arg) or IsEmpty(arg) then\n    Error(\"expected one or two arguments.\\n\");\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1..Length(arg) - 1]});\n  filename := PQ_CHK_PATH( arg[Length(arg)], \"w\", datarec );\n  if not( IsBound(datarec.pCover) and datarec.pcoverclass = datarec.class or\n          IsBound(datarec.pQuotient) ) then\n    Error( \"no p-quotient or p-cover has been computed\\n\" );\n  fi;\n  PQ_WRITE_PC_PRESENTATION( datarec, filename );\nend );\n\n#############################################################################\n##\n#F  PQ_WRITE_COMPACT_DESCRIPTION( <datarec> ) . . . . .  A p-Q menu option 26\n##\n##  tells the `pq' binary to write a compact description to a file.\n##\nInstallGlobalFunction( PQ_WRITE_COMPACT_DESCRIPTION, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 26 ], [ \" #write compact description to file\" ]);\nend );\n\n#############################################################################\n##\n#F  PqWriteCompactDescription( <i> ) . . user version of A p-Q menu option 26\n#F  PqWriteCompactDescription()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to write a compact description to a file.\n##\n##  *Note:*\n##  For those familiar  with  the  `pq'  binary,  `PqWriteCompactDescription'\n##  performs menu item 26 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqWriteCompactDescription, function( arg )\n  PQ_WRITE_COMPACT_DESCRIPTION( CallFuncList(ANUPQDataRecord, arg) );\nend );\n\n#############################################################################\n##\n#F  PQ_EVALUATE_CERTAIN_FORMULAE( <datarec> ) . . . . .  A p-Q menu option 27\n##\n##  inputs data to the `pq' binary for option 27 of the Advanced $p$-Quotient\n##  menu, to evaluate certain formulae.\n##\nInstallGlobalFunction( PQ_EVALUATE_CERTAIN_FORMULAE, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 27 ], [ \" #evaluate certain formulae\" ]);\nend );\n\n#############################################################################\n##\n#F  PqEvaluateCertainFormulae( <i> ) . . user version of A p-Q menu option 27\n#F  PqEvaluateCertainFormulae()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to evaluate certain formulae.\n##\n##  *Note:*\n##  For those familiar  with  the  `pq'  binary,  `PqEvaluateCertainFormulae'\n##  performs option 27 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqEvaluateCertainFormulae, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_EVALUATE_CERTAIN_FORMULAE( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_EVALUATE_ACTION( <datarec> ) . . . . . . . . . .  A p-Q menu option 28\n##\n##  inputs data to the `pq' binary for option 28 of the Advanced $p$-Quotient\n##  menu, to evaluate the action.\n##\nInstallGlobalFunction( PQ_EVALUATE_ACTION, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 28 ], [ \" #evaluate action\" ]);\nend );\n\n#############################################################################\n##\n#F  PqEvaluateAction( <i> ) . . . . . .  user version of A p-Q menu option 28\n#F  PqEvaluateAction()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to evaluate the action.\n##\n##  *Note:*\n##  For those familiar with  the  `pq'  binary,  `PqEvaluateAction'  performs\n##  option 28 of the Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqEvaluateAction, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_EVALUATE_ACTION( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_EVALUATE_ENGEL_IDENTITY( <datarec> ) . . . . . .  A p-Q menu option 29\n##\n##  inputs data to the `pq' binary for option 29 of the\n##  Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_EVALUATE_ENGEL_IDENTITY, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 29 ], [ \" #evaluate Engel identity\" ]);\nend );\n\n#############################################################################\n##\n#F  PqEvaluateEngelIdentity( <i> ) . . . user version of A p-Q menu option 29\n#F  PqEvaluateEngelIdentity()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqEvaluateEngelIdentity' performs option 29 of the\n##  Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqEvaluateEngelIdentity, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_EVALUATE_ENGEL_IDENTITY( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_PROCESS_RELATIONS_FILE( <datarec> ) . . . . . . . A p-Q menu option 30\n##\n##  inputs data to the `pq' binary for option 30 of the\n##  Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PQ_PROCESS_RELATIONS_FILE, function( datarec )\n  PQ_MENU(datarec, \"ApQ\"); #we need options from the Advanced p-Q Menu\n  ToPQ(datarec, [ 30 ], [ \" #process relations file\" ]);\nend );\n\n#############################################################################\n##\n#F  PqProcessRelationsFile( <i> ) . . .  user version of A p-Q menu option 30\n#F  PqProcessRelationsFile()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqProcessRelationsFile' performs option 30 of the\n##  Advanced $p$-Quotient menu.\n##\nInstallGlobalFunction( PqProcessRelationsFile, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_PROCESS_RELATIONS_FILE( datarec );\nend );\n\n#############################################################################\n##\n#F  PqSPComputePcpAndPCover(<i> : <options>) . . . user ver of SP menu opt. 1\n#F  PqSPComputePcpAndPCover( : <options> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to compute for the group of that process a pc presentation  up  to\n##  the $p$-quotient of maximum class or the value of the option `ClassBound'\n##  and the $p$-cover of that  quotient,  and  sets  up  tabular  information\n##  required for computation of a standard presentation. Here the group of  a\n##  process is the one given as first argument when `PqStart' was  called  to\n##  initiate  that  process  (for  process  <i>  the  group  is   stored   as\n##  `ANUPQData.io[<i>].group').\n##\n##  The possible <options> are `Prime', `ClassBound', `Relators', `Exponent',\n##  `Metabelian' and `OutputLevel' (see Chapter~\"ANUPQ Options\" for  detailed\n##  descriptions of these options). The option `Prime' is normally determined\n##  via `PrimePGroup', and so is not required unless the group  doesn't  know\n##  it's a $p$-group and `HasPrimePGroup' returns `false'.\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,  `PqSPComputePcpAndPCover'\n##  performs option 1 of the Standard Presentation menu.\n##\nInstallGlobalFunction( PqSPComputePcpAndPCover, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqSPComputePcpAndPCover\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_PC_PRESENTATION( datarec, \"SP\" );\nend );\n\n#############################################################################\n##\n#F  PQ_SP_STANDARD_PRESENTATION(<datarec>[,<mlist>] :<options>) SP menu opt 2\n##\n##  inputs data given by <options> to the `pq' binary to compute  a  standard\n##  presentation for group `<datarec>.group'. If argument <mlist> is given it\n##  is assumed to be the automorphism group data required.  Otherwise  it  is\n##  assumed that `<datarec>.pQuotient' exists and that {\\GAP} can compute its\n##  automorphism group and the  necessary  automorphism  group  data  can  be\n##  derived from `<datarec>.pQuotient'. This uses option 2  of  the  Standard\n##  Presentation menu.\n##\nInstallGlobalFunction( PQ_SP_STANDARD_PRESENTATION, function( arg )\nlocal datarec, savefile;\n  datarec := arg[1];\n  savefile := PQ_CHK_PATH( \n                  VALUE_PQ_OPTION( \"StandardPresentationFile\",\n                                   Filename( ANUPQData.tmpdir, \"SPres\" ) ),\n                  \"w\", datarec);\n  PQ_MENU(datarec, \"SP\");\n  ToPQ(datarec, [ 2 ], [ \"  #compute standard presentation\" ]);\n  ToPQ(datarec, [ savefile ], [ \"  #file for saving pres'n\" ]);\n  ToPQ(datarec, [ VALUE_PQ_OPTION(\"ClassBound\", 63)], [ \"  #class bound\" ]);\n\n  if 1 = Length(arg) then\n    PQ_AUT_INPUT( datarec, datarec.pQuotient );\n  else\n    PQ_MANUAL_AUT_INPUT( datarec, arg[2] );\n  fi;\n  ToPQ_BOOL(datarec, VALUE_PQ_OPTION(\"PcgsAutomorphisms\", false, datarec),\n                     \"compute pcgs gen. seq. for auts.\");\nend );\n\n#############################################################################\n##\n#F  PqSPStandardPresentation(<i>[,<mlist>]:<options>)  user ver SP menu opt 2\n#F  PqSPStandardPresentation([<mlist>] : <options> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data  given\n##  by <options> to compute a standard presentation for  the  group  of  that\n##  process.  If  argument  <mlist>  is  given  it  is  assumed  to  be   the\n##  automorphism group data required. Otherwise it is assumed that a call  to\n##  either      `Pq'      (see~\"Pq!interactive\")      or      `PqEpimorphism'\n##  (see~\"PqEpimorphism!interactive\") has generated a $p$-quotient  and  that\n##  {\\GAP} can compute  its  automorphism  group  from  which  the  necessary\n##  automorphism group data can be derived. The group of the process  is  the\n##  one given as first argument when `PqStart' was  called  to  initiate  the\n##  process (for process <i> the group is stored as `ANUPQData.io[<i>].group'\n##  and     the     $p$-quotient     if     existent     is     stored     as\n##  `ANUPQData.io[<i>].pQuotient').  If  <mlist>   is   not   given   and   a\n##  $p$-quotient of the group has not been  previously  computed  a  class  1\n##  $p$-quotient is computed.\n##\n##  `PqSPStandardPresentation' accepts three options, all optional:\n##\n##  \\beginitems\n##\n##  `StandardPresentationFile := <filename>'&\n##  Specifies that the file to which the standard presentation is written has\n##  name <filename>. If the first character of the string <filename>  is  not\n##  `/', <filename> is assumed to be the path of a writable file relative  to\n##  the directory in which {\\GAP} was started. If this option is  omitted  it\n##  is written to the file with the name generated by the command  `Filename(\n##  ANUPQData.tmpdir, \"SPres\" );', i.e.~the file with name  `\"SPres\"' in  the\n##  temporary directory in which the `pq' binary executes.\n##\n##  `ClassBound := <n>' &\n##  Specifies that the $p$-quotient computed has lower exponent-$p$ class  at\n##  most <n>. If this option is omitted a default of 63 is used.\n##\n##  `PcgsAutomorphisms' &\n##  Specifies that a polycyclic  generating  sequence  for  the  automorphism\n##  group of the group of the process (which must be *soluble*), be  computed\n##  and passed to the `pq' binary.  This  increases  the  efficiency  of  the\n##  computation;  it  also  prevents  the  `pq'  from  calling   {\\GAP}   for\n##  orbit-stabilizer calculations. See section \"Computing  Descendants  of  a\n##  p-Group\" for further explanations.\n##\n##  \\enditems\n##\n##  *Note:* For those familiar with  the  `pq'  binary,  `PqSPPcPresentation'\n##  performs option 2 of the Standard Presentation menu.\n##\nInstallGlobalFunction( PqSPStandardPresentation, function( arg )\nlocal args, datarec;\n  args := PQ_AUT_ARG_CHK(0, arg);\n  datarec := ANUPQData.io[ args[1] ];\n  if 1 = Length(args) and not IsBound(datarec.pQuotient) then\n    PQ_EPI_OR_PCOVER( args[1] : PqEpiOrPCover := \"pQuotient\");\n  fi;\n  args[1] := datarec;\n  CallFuncList( PQ_SP_STANDARD_PRESENTATION, args );\nend );\n\n#############################################################################\n##\n#F  PQ_SP_SAVE_PRESENTATION( <datarec>, <filename> ) . . . . SP menu option 3\n##\n##  directs the `pq' binary to  save  the  standard  presentation  previously\n##  computed for `<datarec>.group'  to  <filename>  using  option  3  of  the\n##  Standard Presentation menu.\n##\nInstallGlobalFunction( PQ_SP_SAVE_PRESENTATION, function( datarec, filename )\n  PQ_MENU(datarec, \"SP\");\n  ToPQ(datarec, [ 3 ], [ \"  #save standard presentation to file\" ]);\n  ToPQ(datarec, [ filename ], [ \"  #filename\" ]);\nend );\n\n#############################################################################\n##\n#F  PqSPSavePresentation( <i>, <filename> ) . .  user ver of SP menu option 3\n#F  PqSPSavePresentation( <filename> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to save the standard  presentation  previously  computed  for  the\n##  group of that process to the file with name <filename>, where  the  group\n##  of a process is the one given as first argument when `PqStart' was called\n##  to initiate that process. If the first character of the string <filename>\n##  is not `/' <filename> is assumed to  be  the  path  of  a  writable  file\n##  relative to the directory in which {\\GAP} was started.\n##\n##  *Note:* For those familiar with the `pq'  binary,  `PqSPSavePresentation'\n##  performs option 3 of the Standard Presentation menu.\n##\nInstallGlobalFunction( PqSPSavePresentation, function( arg )\nlocal datarec, filename;\n  PQ_OTHER_OPTS_CHK(\"PqSPSavePresentation\", true);\n  if 0 = Length(arg) or Length(arg) > 2 then\n    Error( \"expected 1 or 2 arguments\\n\" );\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1..Length(arg) - 1]});\n  filename := PQ_CHK_PATH( arg[Length(arg)], \"w\", datarec );\n  PQ_SP_SAVE_PRESENTATION( datarec, filename );\nend );\n\n#############################################################################\n##\n#F  PQ_SP_COMPARE_TWO_FILE_PRESENTATIONS(<datarec>,<f1>,<f2>) . SP menu opt 6\n##\n##  inputs data to the `pq' binary for option 6 of the Standard  Presentation\n##  menu, to compare the presentations in the files with names <f1> and  <f2>\n##  and returns `true' if they are identical and `false' otherwise.\n##\nInstallGlobalFunction( PQ_SP_COMPARE_TWO_FILE_PRESENTATIONS, \nfunction( datarec, f1, f2 )\nlocal line;\n  PQ_MENU(datarec, \"SP\");\n  ToPQ( datarec, [ 6 ], [ \"  #compare two file presentations\" ]);\n  ToPQ( datarec, [ f1 ], [ \"  #1st filename\" ]);\n  datarec.match := \"Identical\";\n  datarec.filter := [\"Identical\"];\n  ToPQ(datarec, [ f2 ], [ \"  #2nd filename\" ]);\n  line := SplitString(datarec.matchedline, \"\", \"? \\n\");\n  PQ_UNBIND(datarec, [\"match\", \"matchedline\", \"filter\"]);\n  return EvalString( LowercaseString( line[3] ) );\nend );\n\n#############################################################################\n##\n#F  PqSPCompareTwoFilePresentations(<i>,<f1>,<f2>)  user ver of SP menu opt 6\n#F  PqSPCompareTwoFilePresentations(<f1>,<f2>)\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to compare the presentations in the files with names <f1> and <f2>\n##  and returns `true' if they are identical and `false' otherwise. For  each\n##  of the strings <f1> and <f2>, if the first character is not a `/' then it\n##  is assumed to be the path of a readable file relative to the directory in\n##  which {\\GAP} was started.\n##\n##  *Notes*\n##\n##  The presentations in files <f1> and <f2> must have been generated by  the\n##  `pq' binary but they do *not* need to be *standard* presentations.\n##\n##   For      those      familiar      with      the       `pq'       binary,\n##   `PqSPCompareTwoFilePresentations' performs  option  6  of  the  Standard\n##   Presentation menu.\n##\nInstallGlobalFunction( PqSPCompareTwoFilePresentations, function( arg )\nlocal len, datarec, f1, f2;\n  len := Length(arg);\n  if not(len in [2, 3]) then\n    Error( \"expected 2 or 3 arguments\\n\" );\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1..len - 2]});\n  f1 := PQ_CHK_PATH( arg[len - 1], \"r\", datarec );\n  f2 := PQ_CHK_PATH( arg[len], \"r\", datarec );\n  return PQ_SP_COMPARE_TWO_FILE_PRESENTATIONS( datarec, f1, f2 );\nend );\n\n#############################################################################\n##\n#F  PQ_SP_ISOMORPHISM( <datarec> ) . . . . . . . . . . . . . SP menu option 8\n##\n##  computes the mapping  from  the  automorphism  group  generators  to  the\n##  generators of the standard presentation,  using  option  8  of  the  main\n##  Standard Presentation menu.\n##\nInstallGlobalFunction( PQ_SP_ISOMORPHISM, function( datarec )\n  PQ_MENU(datarec, \"SP\");\n  ToPQ(datarec, [ 8 ], [ \"  #compute isomorphism\" ]);\nend );\n\n#############################################################################\n##\n#F  PqSPIsomorphism( <i> ) . . . . . . . . . user version of SP menu option 8\n#F  PqSPIsomorphism()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  program to compute the isomorphism mapping  from  the  $p$-group  of  the\n##  process  to  its  standard  presentation.  This   function   provides   a\n##  description      only;      for      a      {\\GAP}      object,       use\n##  `EpimorphismStandardPresentation'\n##  (see~\"EpimorphismStandardPresentation!interactive\").\n##\n##  *Note:* For  those  familiar  with  the  `pq'  program,  `PqSPIsomorphism'\n##  performs menu item 8 of the Standard Presentation menu.\n##\nInstallGlobalFunction( PqSPIsomorphism, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_SP_ISOMORPHISM( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_PG_SUPPLY_AUTS( <datarec>[, <mlist>], <menu> ) .  p-G/A p-G menu opt 1\n##\n##  defines the automorphism group of `<datarec>.group', using  option  1  of\n##  the main or Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_PG_SUPPLY_AUTS, function( arg )\n  local datarec;\n\n  CallFuncList( PQ_MENU, arg{[1, Length(arg)]});\n  datarec := arg[1];\n  if 2 < Length(arg) and \n     VALUE_PQ_OPTION(\"NumberOfSolubleAutomorphisms\", 0, datarec) > 0 and\n     Length(VALUE_PQ_OPTION(\"RelativeOrders\", [], datarec)) \n        <> datarec.NumberOfSolubleAutomorphisms then\n    Error(\"the number of elements of option \\\"RelativeOrders\\\" should equal\\n\",\n          \"the value of option \\\"NumberOfSolubleAutomorphisms\\\" (\",\n          datarec.NumberOfSolubleAutomorphisms, \")\\n\");\n  fi;\n  ToPQ(datarec, [ 1 ], [ \"  #supply automorphism data\" ]);\n  if 2 = Length(arg) then\n    PQ_AUT_INPUT( datarec, datarec.group );\n  else\n    CallFuncList( PQ_MANUAL_AUT_INPUT, arg{[1 .. 2]} );\n  fi;\nend );\n\n#############################################################################\n##\n#F  PqPGSupplyAutomorphisms( <i>[, <mlist>] ) .  user ver of pG menu option 1\n#F  PqPGSupplyAutomorphisms([<mlist>])\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  supply  the  `pq'\n##  binary with the automorphism group data needed  for  the  group  of  that\n##  process    (for    process    <i>    the    group    is     stored     as\n##  `ANUPQData.io[<i>].group'). If  the  argument  <mlist>  is  omitted  then\n##  {\\GAP} *must* be able to determine the automorphism group of the group of\n##  the process. Otherwise the automorphism data  is  provided  from  <mlist>\n##  which  should  be  a  list  of   matrices   with   non-negative   integer\n##  coefficients, where  each  matrix  must  have  the  same  dimensions;  in\n##  particular, the number of rows of each matrix must be  the  rank  of  the\n##  group of the process.\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,  `PqPGSupplyAutomorphisms'\n##  performs option 1 of the main $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqPGSupplyAutomorphisms, function( arg )\nlocal args;\n  args := PQ_AUT_ARG_CHK(0, arg);\n  args[1] := ANUPQData.io[ args[1] ];\n  Add(args, \"pG\");\n  CallFuncList( PQ_PG_SUPPLY_AUTS, args );\nend );\n\n#############################################################################\n##\n#F  PQ_PG_EXTEND_AUTOMORPHISMS( <datarec> ) . . . . . p-G/A p-G menu option 2\n##\n##  inputs data to the `pq' binary for option  2  of  the  main  or  Advanced\n##  $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_PG_EXTEND_AUTOMORPHISMS, function( datarec )\n  if not(PQ_MENU(datarec) in [\"pG\", \"ApG\"]) then\n    PQ_MENU(datarec, \"pG\");\n  fi;\n  ToPQ(datarec, [ 2 ], [ \"  #extend automorphisms\" ]);\nend );\n\n#############################################################################\n##\n#F  PqPGExtendAutomorphisms( <i> ) .  user version of p-G/A p-G menu option 2\n#F  PqPGExtendAutomorphisms()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, directs  the  `pq'\n##  binary to compute the extensions of the automorphisms defined by  calling\n##  `PqPGSupplyAutomorphisms' (see~\"PqPGSupplyAutomorphisms\"). You  may  wish\n##  to set the `InfoLevel' of `InfoANUPQ' to 2 (or more) in order to see  the\n##  output from the `pq' (see~\"InfoANUPQ\").\n##\n##  *Note:*\n##  For  those  familiar  with  the  `pq'  binary,  `PqPGExtendAutomorphisms'\n##  performs option 2 of the main or advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqPGExtendAutomorphisms, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_PG_EXTEND_AUTOMORPHISMS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_PG_RESTORE_GROUP(<datarec>, <cls>, <n>) . . . . . p-G/A p-G menu opt 3\n##\n##  inputs data to the `pq' binary to restore group <n> of  class  <cls>  for\n##  option 3 of the main or Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_PG_RESTORE_GROUP, function( datarec, cls, n )\n  if not(PQ_MENU(datarec) in [\"pG\", \"ApG\"]) then\n    PQ_MENU(datarec, \"pG\");\n  fi;\n  ToPQ(datarec, [ 3 ], [ \"  #restore group from file\" ]);\n  if IsString(cls) then\n    ToPQ(datarec, [ cls ], [ \"  #filename\" ]);\n  else\n    ToPQ(datarec, [ datarec.GroupName, \"_class\", cls ], [ \"  #filename\" ]);\n  fi;\n  ToPQ(datarec, [ n ], [ \"  #no. of group\" ]);\n  if IsInt(cls) then\n    datarec.match := true;\n    PQ_SET_GRP_DATA(datarec);\n    datarec.capable := datarec.class > cls;\n    datarec.pcoverclass := datarec.class;\n  fi;\nend );\n\n#############################################################################\n##\n#F  PqPGSetDescendantToPcp( <i>, <cls>, <n> ) . u ver of p-G/A p-G menu opt 3\n#F  PqPGSetDescendantToPcp( <cls>, <n> )\n#F  PqPGSetDescendantToPcp( <i> [: Filename := <name> ])\n#F  PqPGSetDescendantToPcp([: Filename := <name> ])\n#F  PqPGRestoreDescendantFromFile(<i>, <cls>, <n>)\n#F  PqPGRestoreDescendantFromFile( <cls>, <n> )\n#F  PqPGRestoreDescendantFromFile( <i> [: Filename := <name> ])\n#F  PqPGRestoreDescendantFromFile([: Filename := <name> ])\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to restore group <n> of class <cls> from a temporary  file,  where\n##  <cls> and <n> are positive integers,  or  the  group  stored  in  <name>.\n##  `PqPGSetDescendantToPcp'    and    `PqPGRestoreDescendantFromFile'    are\n##  synonyms;  they  make  sense  only  after  a  prior  call  to   construct\n##  descendants          by          say           `PqPGConstructDescendants'\n##  (see~\"PqPGConstructDescendants\")  or  the   interactive   `PqDescendants'\n##  (see~\"PqDescendants!interactive\"). In the `Filename'  option  forms,  the\n##  option defaults to the last filename in which a presentation  was  stored\n##  by the `pq' binary.\n##\n##  *Note:*\n##  For those familiar with the  `pq'  binary,  `PqPGSetDescendantToPcp'  and\n##  `PqPGRestoreDescendantFromFile' perform  menu  item  3  of  the  main  or\n##  advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqPGSetDescendantToPcp, function( arg )\nlocal len, datarec, cls, n;\n  PQ_OTHER_OPTS_CHK(\"PqPGSetDescendantToPcp\", true);\n  len := Length(arg);\n  if len > 3 or not(ForAll(arg, IsPosInt)) then\n    Error(\"expected at most 3 positive integer arguments\\n\");\n  fi;\n  if len in [2, 3] then\n    cls := arg[len - 1];\n    n   := arg[len];\n    arg := arg{[1 .. len - 2]};\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  if len in [2, 3] then\n    if not( IsBound(datarec.ndescendants) and \n            IsBound( datarec.ndescendants[cls] ) ) then\n      Error( \"descendants for class \", cls, \" have not been constructed\\n\" );\n    elif datarec.ndescendants[cls][1] < n then\n      Error( \"there is no group \", n, \" saved (<n> must be <= \",\n             datarec.ndescendants[cls][1], \")\\n\" );\n    fi;\n    PQ_PG_RESTORE_GROUP(datarec, cls, n);\n  else\n    PQ_PG_RESTORE_GROUP(datarec, VALUE_PQ_OPTION(\"Filename\", datarec.des), 1);\n  fi;\nend );\n\n#############################################################################\n##\n#F  PQ_PG_CONSTRUCT_DESCENDANTS( <datarec> : <options> ) .  p-G menu option 5\n##\n##  inputs  data  given  by  <options>  to  the  `pq'  binary  to   construct\n##  descendants, using option 5 of the main $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_PG_CONSTRUCT_DESCENDANTS, function( datarec )\nlocal nodescendants, class, firstStep, expectedNsteps, optrec, line, ngroups,\n      cls, totngroups, onestage;\n\n  onestage := IsBound(datarec.des) and IsBound(datarec.des.onestage) and\n              datarec.des.onestage;\n  if not onestage then\n    datarec.des := rec();\n  fi;\n  VALUE_PQ_OPTION(\"CustomiseOutput\", false, datarec.des);\n  if not onestage then\n    # deal with the easy answer\n    if VALUE_PQ_OPTION(\"OrderBound\", 0, datarec.des) <> 0 and \n       HasIsFinite(datarec.group) and IsFinite(datarec.group) and\n       IsPGroup(datarec.group) and\n       datarec.des.OrderBound <= LogInt(Size(datarec.group), \n                                        PrimePGroup(datarec.group)) then\n      return 0;\n    fi;\n\n    # We do these here to ensure an error doesn't occur mid-input of the menu\n    # item data \n    if IsBound(datarec.capable) then\n      #group has come from a `PqPGRestoreGroupFromFile' command\n      if not datarec.capable then\n        Info(InfoWarning + InfoANUPQ, 1, \"group restored from file is incapable\");\n        return 0;\n      fi;\n    fi;\n    if not IsBound(datarec.pcoverclass) or \n       datarec.pcoverclass <> datarec.class then\n      Error(\"the p-cover of the last p-quotient has not yet been computed!\\n\");\n    fi;\n\n    # sanity checks\n    if VALUE_PQ_OPTION(\"ClassBound\", datarec.pcoverclass, datarec.des)\n       < datarec.pcoverclass then\n      Error(\"option `ClassBound' must be at least \", datarec.pcoverclass, \"\\n\");\n    fi;\n  fi;\n\n  if     VALUE_PQ_OPTION(\"SpaceEfficient\", false, datarec.des) and \n     not VALUE_PQ_OPTION(\"PcgsAutomorphisms\", false, datarec) then\n    Info(InfoWarning + InfoANUPQ, 1,\n         \"\\\"SpaceEfficient\\\" ignored since \\\"PcgsAutomorphisms\\\" is set.\");\n  fi;\n\n  if not onestage then\n    if VALUE_PQ_OPTION(\"StepSize\", datarec.des) <> fail then\n      if datarec.des.OrderBound <> 0 then\n        Error(\"\\\"StepSize\\\" and \\\"OrderBound\\\" \",\n              \"must not be set simultaneously\\n\");\n      fi;\n      expectedNsteps := datarec.des.ClassBound - datarec.pcoverclass + 1;\n      if IsList(datarec.des.StepSize) then\n        firstStep := datarec.des.StepSize[1];\n        if Length(datarec.des.StepSize) <> expectedNsteps then\n          Error( \"the number of step-sizes in the \\\"StepSize\\\" list must\\n\",\n                 \"equal \", expectedNsteps, \" (one more than the difference\\n\",\n                 \"of \\\"ClassBound\\\" and the class of the p-covering group)\\n\" );\n        fi;\n      else\n        firstStep := datarec.des.StepSize;\n      fi;\n      if HasNuclearRank(datarec.group) and \n         firstStep > NuclearRank(datarec.group) then\n#          Error(\"the first \\\"StepSize\\\" element (= \", firstStep, \") must not be\\n\",\n#                \"greater than the \\\"Nuclear Rank\\\" (= \",\n#                NuclearRank(datarec.group), \")\\n\");\n          return 0;\n      fi;\n    fi;\n\n    PQ_MENU(datarec, \"pG\");\n    datarec.matchlist := [\" is an invalid starting group\"];\n    datarec.matchedlines := [];\n    ToPQ(datarec, [ 5 ], [ \"  #construct descendants\" ]);\n    nodescendants := not IsEmpty(datarec.matchedlines);\n    PQ_UNBIND( datarec, [\"matchlist\", \"matchedlines\"] );\n    if nodescendants then\n      return 0;\n    fi;\n    ToPQ(datarec, [ datarec.des.ClassBound ], [ \" #class bound\" ]);\n\n    #Construct all descendants?\n    if not IsBound(datarec.des.StepSize) then\n      ToPQ(datarec, [ 1 ], [ \"  #do construct all descendants\" ]);\n      #Set an order bound for descendants?\n      if datarec.des.OrderBound <> 0 then\n        ToPQ(datarec, [ 1 ], [ \"  #do set an order bound\" ]);\n        ToPQ(datarec, [ datarec.des.OrderBound ], [ \" #order bound\" ]);\n      else\n        ToPQ(datarec, [ 0 ], [ \"  #do not set an order bound\" ]);\n      fi;\n    else\n      ToPQ(datarec, [ 0 ], [ \"  #do not construct all descendants\" ]);\n      if expectedNsteps = 1 then\n        # Input step size\n        ToPQ(datarec, [ firstStep ], [ \"  #step size\" ]);\n\n        # Constant step size?\n      elif IsInt(datarec.des.StepSize) then\n        ToPQ(datarec, [ 1 ], [ \"  #set constant step size\" ]);\n        ToPQ(datarec, [ datarec.des.StepSize ], [ \"  #step size\" ]);\n      else\n        ToPQ(datarec, [ 0 ], [ \"  #set variable step size\" ]);\n        ToPQ(datarec, [ JoinStringsWithSeparator(\n                            List(datarec.des.StepSize, String), \" \") ],\n                      [ \"  #step sizes\" ]);\n      fi;\n    fi;\n\n  else\n    PQ_MENU(datarec, \"ApG\");\n    ToPQ(datarec, [ 5 ], [ \"  #single stage\" ]);\n    ToPQ(datarec, [ VALUE_PQ_OPTION(\"StepSize\", datarec.des) ],\n                  [ \" #step size\" ]);\n  fi;\n  ToPQ_BOOL(datarec, VALUE_PQ_OPTION(\"PcgsAutomorphisms\", false, datarec),\n                     \"compute pcgs gen. seq. for auts.\");\n  ToPQ_BOOL(datarec, VALUE_PQ_OPTION(\"BasicAlgorithm\", false, datarec.des),\n                     \"use default algorithm\");\n  if not datarec.des.BasicAlgorithm then\n    ToPQ(datarec, [ VALUE_PQ_OPTION(\n                        \"RankInitialSegmentSubgroups\", 0, datarec.des) ],\n                  [ \"  #rank of initial segment subgrp\" ]);\n    if datarec.PcgsAutomorphisms then\n      ToPQ_BOOL(datarec, datarec.des.SpaceEfficient, \"be space efficient\");\n    fi;\n    VALUE_PQ_OPTION(\"AllDescendants\", true, datarec.des);\n    ToPQ_BOOL(datarec,\n              not VALUE_PQ_OPTION( \"CapableDescendants\", \n                                   not datarec.des.AllDescendants,\n                                   datarec.des ),\n              \"completely process terminal descendants\");\n    ToPQ(datarec, [ VALUE_PQ_OPTION(\"Exponent\", 0, datarec) ],\n                  [ \"  #exponent\" ]); # \"Exponent\" is a `global' option\n    ToPQ_BOOL(datarec, VALUE_PQ_OPTION(\"Metabelian\", false, datarec.des),\n                       \"enforce metabelian law\");\n  fi;\n  datarec.matchlist := [ \"group saved on file\", \"groups saved on file\" ];\n  datarec.matchedlines := [];\n  if IsRecord(datarec.des.CustomiseOutput) and\n     not IsEmpty( Intersection( RecNames(datarec.des.CustomiseOutput),\n                                [\"perm\", \"orbit\", \"group\", \"autgroup\", \"trace\"]\n                                ) ) then\n    ToPQ(datarec, [ 0 ], [ \"  #customise output\" ]);\n    PQ_CUSTOMISE_OUTPUT( datarec, \"perm\", \"perm. grp output\",\n                         [\"print degree\",\n                          \"print extended auts\",\n                          \"print aut. matrices\",\n                          \"print permutations\"] );\n    PQ_CUSTOMISE_OUTPUT( datarec, \"orbit\", \"orbit output\",\n                         [\"print orbit summary\",\n                          \"print complete orbit listing\"] );\n    PQ_CUSTOMISE_OUTPUT( datarec, \"group\", \"group output\",\n                         [\"print allowable subgp standard matrix\",\n                          \"print pres'n of reduced p-covers\",\n                          \"print pres'n of immediate descendants\",\n                          \"print nuclear rank of descendants\",\n                          \"print p-mult'r rank of descendants\"] );\n    PQ_CUSTOMISE_OUTPUT( datarec, \"autgroup\", \"aut. grp output\",\n                         [\"print commutator matrix\",\n                          \"print aut. grp descriptions of descendants\",\n                          \"print aut. grp orders of descendants\"] );\n    PQ_CUSTOMISE_OUTPUT( datarec, \"trace\", \"provide algorithm trace\", [] );\n  else\n    ToPQ(datarec, [ 1 ], [ \"  #default output\" ]);\n  fi;\n  if onestage then\n    ToPQ(datarec, [ VALUE_PQ_OPTION(\"Filename\", \"onestage\", datarec.des) ],\n                  [ \" #output filename\" ]);\n    Unbind(datarec.des.onestage);\n  else\n    if not IsBound(datarec.ndescendants) then\n      datarec.ndescendants := [];\n    fi;\n    totngroups := 0;\n    for line in datarec.matchedlines do\n      line := SplitString(line, \"\", \" \\n\");\n      ngroups := Int( line[1] );\n      cls := SplitString( line[ Length(line) ], \"\", \"_\" );\n      cls := Int( cls[2]{[6 .. Length( cls[2] )]} );\n      datarec.ndescendants[cls] := [ngroups, line[2] = \"capable\"];\n      totngroups := totngroups + ngroups;\n    od;\n    PQ_UNBIND(datarec, [\"matchlist\", \"matchedlines\"]);\n    return totngroups;\n  fi; \nend );\n\n#############################################################################\n##\n#F  PqPGConstructDescendants( <i> : <options> ) . user ver. of p-G menu op. 5\n#F  PqPGConstructDescendants( : <options> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to construct descendants prescribed by <options>, and  return  the\n##  number of descendants constructed. The options possible are `ClassBound',\n##  `OrderBound',              `StepSize',               `PcgsAutomorphisms',\n##  `RankInitialSegmentSubgroups',  `SpaceEfficient',   `CapableDescendants',\n##  `AllDescendants',     `Exponent',     `Metabelian',     `BasicAlgorithm',\n##  `CustomiseOutput'. (Detailed descriptions of these options may  be  found\n##  in Chapter~\"ANUPQ Options\".)\n##\n##  `PqPGConstructDescendants' requires that the `pq' binary  has  previously\n##  computed a pc presentation and a $p$-cover for  a  $p$-quotient  of  some\n##  class of the group of the process.\n##\n##  *Note:* \n##  For those  familiar  with  the  `pq'  binary,  `PqPGConstructDescendants'\n##  performs menu item 5 of the main $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqPGConstructDescendants, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqPGConstructDescendants\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  return PQ_PG_CONSTRUCT_DESCENDANTS( datarec );\nend );\n\n#############################################################################\n##\n#F  PqAPGSupplyAutomorphisms( <i>[, <mlist>] ) . user ver of A p-G menu opt 1\n#F  PqAPGSupplyAutomorphisms([<mlist>])\n##\n#T  This is implemented, but not documented in the manual. There is one line\n#T  different in the C code between this menu item and the corresponding p-G\n#T  menu item. I don't understand the difference. - GG\n##  for the <i>th or default interactive {\\ANUPQ} process,  supply  the  `pq'\n##  binary with the automorphism group data needed  for  the  group  of  that\n##  process    (for    process    <i>    the    group    is     stored     as\n##  `ANUPQData.io[<i>].group'). If  the  argument  <mlist>  is  omitted  then\n##  {\\GAP} *must* be able to determine the automorphism group of the group of\n##  the process. Otherwise the automorphism data  is  provided  from  <mlist>\n##  which  should  be  a  list  of   matrices   with   non-negative   integer\n##  coefficients, where  each  matrix  must  have  the  same  dimensions;  in\n##  particular, the number of rows of each matrix must be  the  rank  of  the\n##  group of the process.\n##\n##  *Note:*\n##  For those  familiar  with  the  `pq'  binary,  `PqAPGSupplyAutomorphisms'\n##  performs menu item 1 of the Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGSupplyAutomorphisms, function( arg )\nlocal args;\n  args := PQ_AUT_ARG_CHK(0, arg);\n  args[1] := ANUPQData.io[ args[1] ];\n  Add(args, \"ApG\");\n  CallFuncList( PQ_PG_SUPPLY_AUTS, args );\nend );\n\n#############################################################################\n##\n#F  PqAPGSingleStage( <i> : <options> ) . user version of A p-G menu option 5\n#F  PqAPGSingleStage( : <options> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to do a single stage of the descendants construction algorithm  as\n##  prescribed  by  <options>.   The   possible   options   are   `StepSize',\n##  `PcgsAutomorphisms',   `RankInitialSegmentSubgroups',   `SpaceEfficient',\n##  `CapableDescendants',   `AllDescendants',    `Exponent',    `Metabelian',\n##  `BasicAlgorithm' and `CustomiseOutput'. (Detailed descriptions  of  these\n##  options may be found in Chapter~\"ANUPQ Options\".)\n##\n##  *Note:*\n##  For those familiar with  the  `pq'  binary,  `PqAPGSingleStage'  performs\n##  option 5 of the Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGSingleStage, function( arg )\nlocal datarec, ngroups;\n  PQ_OTHER_OPTS_CHK(\"PqAPGSingleStage\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_MENU(datarec, \"ApG\");\n  datarec.des.onestage := true;\n  PQ_PG_CONSTRUCT_DESCENDANTS(datarec);\nend );\n\n#############################################################################\n##\n#F  PQ_APG_DEGREE( <datarec>, <step>, <rank> ) . . . . .  A p-G menu option 6\n##\n##  inputs data to the `pq' binary for option 6  of  the  Advanced  $p$-Group\n##  Generation menu, to compute definition sets and find the degree.\n##\nInstallGlobalFunction( PQ_APG_DEGREE, function( datarec, step, rank )\nlocal expt, line;\n  expt := VALUE_PQ_OPTION(\"Exponent\", 0, datarec);\n  PQ_MENU(datarec, \"ApG\");\n  ToPQ(datarec, [ 6 ], [ \"  #compute defn sets and find degree\" ]);\n  ToPQ(datarec, [ step ], [ \" #step size\" ]);\n  ToPQ(datarec, [ rank ], [ \" #rank of initial segment subgroup\" ]);\n  datarec.match := \"Degree of permutation group\";\n  ToPQ(datarec, [ expt ], [ \" #exponent\" ]);\n  line := SplitString(datarec.matchedline, \"\", \" \\n\");\n  Unbind(datarec.match);\n  return Int( line[6] );\nend );\n\n#############################################################################\n##\n#F  PqAPGDegree(<i>,<step>,<rank>[: Exponent := <n>]) . u ver A p-G menu op 6\n#F  PqAPGDegree( <step>, <rank> [: Exponent := <n> ])\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary  to  compute  definition  sets  and  return  the  degree  of   the\n##  permutation group. Here the step-size <step> and the rank <rank>  of  the\n##  initial segment subgroup are positive integers. See~\"option Exponent\" for\n##  the one recognised option `Exponent'.\n##\n##  *Note:* For those familiar with the `pq' binary,  `PqAPGDegree'  performs\n##  menu item 6 of the Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGDegree, function( arg )\nlocal len, datarec;\n  PQ_OTHER_OPTS_CHK(\"PqAPGDegree\", true);\n  len := Length(arg);\n  if not(len in [2, 3] or ForAll(arg, IsPosInt)) then\n    Error(\"expected 2 or 3 positive integer arguments\\n\");\n  fi;\n  datarec := CallFuncList(ANUPQDataRecord, arg{[1 .. len - 2]});\n  return PQ_APG_DEGREE( datarec, arg[len - 1], arg[len] );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_PERMUTATIONS( <datarec> ) . . . . . . . . . .  A p-G menu option 7\n##\n##  inputs data to the `pq' binary for option 7  of  the  Advanced  $p$-Group\n##  Generation menu, to compute permutations of subgroups.\n##\nInstallGlobalFunction( PQ_APG_PERMUTATIONS, function( datarec )\nlocal pcgsauts, efficient, printauts, printperms;\n  pcgsauts  := VALUE_PQ_OPTION(\"PcgsAutomorphisms\", false, datarec);\n  efficient := VALUE_PQ_OPTION(\"SpaceEfficient\", false, datarec.des);\n  printauts := VALUE_PQ_OPTION(\"PrintAutomorphisms\", false);\n  printperms := VALUE_PQ_OPTION(\"PrintPermutations\", false);\n  PQ_MENU(datarec, \"ApG\");\n  ToPQ(datarec, [ 7 ], [ \"  #compute permutations\" ]);\n  ToPQ_BOOL(datarec, pcgsauts, \"compute pcgs gen. seq. for auts.\");\n  ToPQ_BOOL(datarec, efficient, \"be space efficient\");\n  ToPQ_BOOL(datarec, printauts, \"print automorphism matrices\");\n  ToPQ_BOOL(datarec, printperms, \"print permutations\");\nend );\n\n#############################################################################\n##\n#F  PqAPGPermutations( <i> : <options> ) . user version of A p-G menu optn. 7\n#F  PqAPGPermutations( : <options> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to compute permutations of subgroups. Here the  options  <options>\n##  recognised       are        `PcgsAutomorphisms',        `SpaceEfficient',\n##  `PrintAutomorphisms' and `PrintPermutations' (see Chapter~\"ANUPQ Options\"\n##  for details).\n##\n##  *Note:* For those familiar  with  the  `pq'  binary,  `PqAPGPermutations'\n##  performs menu item 7 of the Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGPermutations, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqAPGPermutations\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_PERMUTATIONS( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_ORBITS( <datarec> ) . . . . . . . . . . . . .  A p-G menu option 8\n##\n##  inputs data to the `pq' binary for menu item 8 of the Advanced  $p$-Group\n##  Generation menu, to compute orbits.\n##\nInstallGlobalFunction( PQ_APG_ORBITS, function( datarec )\nlocal pcgsauts, efficient, output, summary, listing, line, norbits;\n  pcgsauts  := VALUE_PQ_OPTION(\"PcgsAutomorphisms\", false, datarec);\n  efficient := VALUE_PQ_OPTION(\"SpaceEfficient\", false, datarec.des);\n  output := VALUE_PQ_OPTION(\"CustomiseOutput\", rec(orbit := []), datarec.des);\n  if not( IsRecord(output) and IsBound(output.orbit) and \n          IsList(output.orbit) ) then\n    output := rec(orbit := []);\n  fi;\n  summary   := IsBound( output.orbit[1] ) and output.orbit[1] in [1, true];\n  listing   := IsBound( output.orbit[2] ) and output.orbit[2] in [1, true];\n  PQ_MENU(datarec, \"ApG\");\n  ToPQ(datarec, [ 8 ], [ \"  #compute orbits\" ]);\n  ToPQ_BOOL(datarec, pcgsauts, \"compute pcgs gen. seq. for auts.\");\n  ToPQ_BOOL(datarec, efficient, \"be space efficient\");\n  if summary then\n    datarec.match := \"Number of orbits is\";\n  elif listing then\n    datarec.match := \"Orbit \";\n  fi;\n  PQ_APG_CUSTOM_OUTPUT( datarec, \"orbit\", \"orbit output\",\n                        [\"print orbit summary\",\n                         \"print complete orbit listing\"] );\n  if summary or listing then\n    line := SplitString(datarec.matchedline, \"\", \" \\n\");\n    if summary then\n      norbits := Int( line[5] );\n    else\n      norbits := Int( line[2] );\n    fi;\n    Unbind(datarec.match);\n  else\n    norbits := \"\";\n  fi;\n  return norbits;\nend );\n\n#############################################################################\n##\n#F  PqAPGOrbits( <i> : <options> ) . . .  user version of A p-G menu option 8\n#F  PqAPGOrbits( : <options> )\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to compute the orbit action of the automorphism group, and  return\n##  the number of orbits, if either a summary or a complete listing (or both)\n##  of orbit information was requested. Here the options <options> recognised\n##  are `PcgsAutomorphisms',  `SpaceEfficient',  and  `CustomiseOutput'  (see\n##  Chapter~\"ANUPQ Options\" for details). For  the  `CustomiseOutput'  option\n##  only the setting of the `orbit' is recognised (all other  fields  if  set\n##  are ignored).\n##\n##  *Note:* For those familiar with the `pq' binary,  `PqAPGOrbits'  performs\n##  menu item 8 of the Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGOrbits, function( arg )\nlocal datarec, norbits;\n  PQ_OTHER_OPTS_CHK(\"PqAPGOrbits\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  norbits := PQ_APG_ORBITS( datarec );\n  if norbits <> \"\" then\n    return norbits;\n  fi;\nend );\n\n#############################################################################\n##\n#F  PQ_APG_ORBIT_REPRESENTATIVES( <datarec> ) . . . . . . A p-G menu option 9\n##\n##  inputs data to the `pq' binary for menu item 9 of the Advanced  $p$-Group\n##  Generation menu, to process orbit representatives.\n##\nInstallGlobalFunction( PQ_APG_ORBIT_REPRESENTATIVES, function( datarec )\nlocal pcgsauts, efficient, exponent, metabelian, alldescend, outputfile;\n  pcgsauts  := VALUE_PQ_OPTION(\"PcgsAutomorphisms\", false, datarec);\n  efficient := VALUE_PQ_OPTION(\"SpaceEfficient\", false, datarec.des);\n  exponent  := VALUE_PQ_OPTION(\"Exponent\", false, datarec);\n  metabelian := VALUE_PQ_OPTION(\"Metabelian\", false, datarec);\n  alldescend := not VALUE_PQ_OPTION(\n                        \"CapableDescendants\",\n                        VALUE_PQ_OPTION(\"AllDescendants\", true),\n                        datarec.des);\n  outputfile := VALUE_PQ_OPTION(\"Filename\", \"redPCover\", datarec.des);\n  VALUE_PQ_OPTION(\"CustomiseOutput\", rec(), datarec.des);\n  PQ_MENU(datarec, \"ApG\");\n  ToPQ(datarec, [ 9 ], [ \"  #process orbit reps\" ]);\n  ToPQ_BOOL(datarec, pcgsauts, \"compute pcgs gen. seq. for auts.\");\n  ToPQ_BOOL(datarec, efficient, \"be space efficient\");\n  ToPQ_BOOL(datarec, alldescend, \"completely process terminal descendants\");\n  ToPQ(datarec, [ exponent ], [ \" #exponent\" ]);\n  ToPQ_BOOL(datarec, metabelian, \" set metabelian\");\n  PQ_APG_CUSTOM_OUTPUT( datarec, \"group\", \"group output\",\n                        [\"print allowable subgp standard matrix\",\n                         \"print pres'n of reduced p-covers\",\n                         \"print pres'n of immediate descendants\",\n                         \"print nuclear rank of descendants\",\n                         \"print p-mult'r rank of descendants\"] );\n  PQ_APG_CUSTOM_OUTPUT( datarec, \"autgroup\", \"aut. grp output\",\n                        [\"print commutator matrix\",\n                         \"print aut. grp descriptions of descendants\",\n                         \"print aut. grp orders of descendants\"] );\n  ToPQ(datarec, [ outputfile ], [ \" #output filename\" ]);\nend );\n\n#############################################################################\n##\n#F  PqAPGOrbitRepresentatives(<i> : <options>) . user ver of A p-G menu opt 9\n#F  PqAPGOrbitRepresentatives(: <options>)\n##\n##  for the <i>th or default interactive {\\ANUPQ} process,  direct  the  `pq'\n##  binary to process  the  orbit  representatives  and  output  the  reduced\n##  $p$-cover to a file. The options <options> may be any of  the  following:\n##  are  `PcgsAutomorphisms',  `SpaceEfficient',  `Exponent',   `Metabelian',\n##  `CapableDescendants' (or `AllDescendants'), `CustomiseOutput' (where only\n##  the `group' and `autgroup' fields are  recognised)  and  `Filename'  (see\n##  Chapter~\"ANUPQ Options\"  for  details).  If  `Filename'  is  omitted  the\n##  reduced $p$-cover is written to the file `\"redPCover\"' in  the  temporary\n##  directory whose name is stored in `ANUPQData.tmpdir'.\n##\n##  *Note:*\n##  For those familiar  with  the  `pq'  binary,  `PqAPGOrbitRepresentatives'\n##  performs option 9 of the Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGOrbitRepresentatives, function( arg )\nlocal datarec;\n  PQ_OTHER_OPTS_CHK(\"PqAPGOrbitRepresentatives\", true);\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_ORBIT_REPRESENTATIVES( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_ORBIT_REPRESENTATIVE( <datarec> ) . . . . . . A p-G menu option 10\n##\n##  inputs data to the `pq' binary for option 10 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_ORBIT_REPRESENTATIVE, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGOrbitRepresentative( <i> ) . .  user version of A p-G menu option 10\n#F  PqAPGOrbitRepresentative()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGOrbitRepresentative' performs option 10 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGOrbitRepresentative, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_ORBIT_REPRESENTATIVE( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_STANDARD_MATRIX_LABEL( <datarec> ) . . . . .  A p-G menu option 11\n##\n##  inputs data to the `pq' binary for option 11 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_STANDARD_MATRIX_LABEL, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGStandardMatrixLabel( <i> ) . .  user version of A p-G menu option 11\n#F  PqAPGStandardMatrixLabel()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGStandardMatrixLabel' performs option 11 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGStandardMatrixLabel, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_STANDARD_MATRIX_LABEL( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_MATRIX_OF_LABEL( <datarec> ) . . . . . . . .  A p-G menu option 12\n##\n##  inputs data to the `pq' binary for option 12 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_MATRIX_OF_LABEL, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGMatrixOfLabel( <i> ) . . . . .  user version of A p-G menu option 12\n#F  PqAPGMatrixOfLabel()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGMatrixOfLabel' performs option 12 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGMatrixOfLabel, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_MATRIX_OF_LABEL( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_IMAGE_OF_ALLOWABLE_SUBGROUP( <datarec> ) . .  A p-G menu option 13\n##\n##  inputs data to the `pq' binary for option 13 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_IMAGE_OF_ALLOWABLE_SUBGROUP, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGImageOfAllowableSubgroup( <i> ) user version of A p-G menu option 13\n#F  PqAPGImageOfAllowableSubgroup()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGImageOfAllowableSubgroup' performs option 13 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGImageOfAllowableSubgroup, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_IMAGE_OF_ALLOWABLE_SUBGROUP( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_RANK_CLOSURE_OF_INITIAL_SEGMENT( <datarec> )  A p-G menu option 14\n##\n##  inputs data to the `pq' binary for option 14 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_RANK_CLOSURE_OF_INITIAL_SEGMENT, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGRankClosureOfInitialSegment( <i> )  user version of A p-G menu option 14\n#F  PqAPGRankClosureOfInitialSegment()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGRankClosureOfInitialSegment' performs option 14 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGRankClosureOfInitialSegment, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_RANK_CLOSURE_OF_INITIAL_SEGMENT( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_ORBIT_REPRESENTATIVE_OF_LABEL( <datarec> ) .  A p-G menu option 15\n##\n##  inputs data to the `pq' binary for option 15 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_ORBIT_REPRESENTATIVE_OF_LABEL, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGOrbitRepresentativeOfLabel( <i> )  user version of A p-G menu option 15\n#F  PqAPGOrbitRepresentativeOfLabel()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGOrbitRepresentativeOfLabel' performs option 15 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGOrbitRepresentativeOfLabel, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_ORBIT_REPRESENTATIVE_OF_LABEL( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_WRITE_COMPACT_DESCRIPTION( <datarec> ) . . .  A p-G menu option 16\n##\n##  inputs data to the `pq' binary for option 16 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_WRITE_COMPACT_DESCRIPTION, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGWriteCompactDescription( <i> )  user version of A p-G menu option 16\n#F  PqAPGWriteCompactDescription()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGWriteCompactDescription' performs option 16 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGWriteCompactDescription, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_WRITE_COMPACT_DESCRIPTION( datarec );\nend );\n\n#############################################################################\n##\n#F  PQ_APG_AUTOMORPHISM_CLASSES( <datarec> ) . . . . . . A p-G menu option 17\n##\n##  inputs data to the `pq' binary for option 17 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PQ_APG_AUTOMORPHISM_CLASSES, function( datarec )\nend );\n\n#############################################################################\n##\n#F  PqAPGAutomorphismClasses( <i> ) . .  user version of A p-G menu option 17\n#F  PqAPGAutomorphismClasses()\n##\n##  for the <i>th or default interactive {\\ANUPQ} process, inputs data\n##  to the `pq' binary\n##\n##  *Note:* For those  familiar  with  the  `pq'  binary, \n##  `PqAPGAutomorphismClasses' performs option 17 of the\n##  Advanced $p$-Group Generation menu.\n##\nInstallGlobalFunction( PqAPGAutomorphismClasses, function( arg )\nlocal datarec;\n  datarec := CallFuncList(ANUPQDataRecord, arg);\n  PQ_APG_AUTOMORPHISM_CLASSES( datarec );\nend );\n\n#E  anupqi.gi . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here \n", "meta": {"hexsha": "e4a3ad1fa13bebe5a429606fd96e9b88b2d7fa11", "size": 145027, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/anupqi.gi", "max_stars_repo_name": "gap-system/anupq", "max_stars_repo_head_hexsha": "075d27ffe985d561f377a253563605ffea726448", "max_stars_repo_licenses": ["Artistic-2.0"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/anupqi.gi", "max_issues_repo_name": "gap-system/anupq", "max_issues_repo_head_hexsha": "075d27ffe985d561f377a253563605ffea726448", "max_issues_repo_licenses": ["Artistic-2.0"], "max_issues_count": 8, "max_issues_repo_issues_event_min_datetime": "2015-03-04T12:41:28.000Z", "max_issues_repo_issues_event_max_datetime": "2015-09-27T22:17:27.000Z", "max_forks_repo_path": "lib/anupqi.gi", "max_forks_repo_name": "gap-system/anupq", "max_forks_repo_head_hexsha": "075d27ffe985d561f377a253563605ffea726448", "max_forks_repo_licenses": ["Artistic-2.0"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 40.9912379876, "max_line_length": 84, "alphanum_fraction": 0.6065836017, "num_tokens": 41758, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.5851011686727232, "lm_q2_score": 0.5428632831725052, "lm_q1q2_score": 0.3176299414137443}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\nTempArrayType := (child, y, x, index) ->     \n    When( IsBound(child.a.t_in), child.a.t_in[index], let(\n          X := Flat([x])[1], # without type unification everything has same type\n          When(X.t.t=TComplex or Flat([y])[1].t.t=TComplex, TComplex, X.t.t)\n));\n\nTempArray := (y, x, child) -> let(\n    cols := Flat([Cols(child)]),\n    StripList( List( [1..Length(cols)], i ->\n        TempVec( TArray( TempArrayType(child, y, x, i), cols[i]))\n)));\n\n# HACKed in. This should just be rolled into TempArray or otherwise be handled cleanly.\nTempArraySeq := function(y, x, child) \n    local dims, P;\n    if ObjId(child)=BB then \n      dims := child.child(1).dims();\n      P    := child.child(1).P;\n    else\n      dims := child.dims();\n      P    := child.P;\n    fi;\n\n    return(\n        StripList(List(\n          Flat([ dims[2]/P ]), z ->\n            TempVec(\n                #TArray(TempArrayType(child, Flat([y])[1], Flat([x])[1]), z))\n                TArray(TempArrayType(child, y, x, 1), z))\n            )));\nend;\n\n#F _CodeSums(<sums-spl>, <y-output-var>, <x-input-var>)\n#F\n#F Generates unoptimize loop code for <sums-spl>\n#F\n_CodeSums := function(sums, y, x)\n    local code;\n    code := sums.code(y,x);\n    code.dimensions := sums.dimensions;\n    code.root := sums;\n    return code;\nend;\n\n#CodeSums := _CodeSums;\n\n_CodeSumsAcc := function(sums, y, x)\n    local code;\n    code := _CodeSums(sums, y, x);\n    code := SubstTopDownNR(code, [assign, [@(0,nth), @(1, var, e->Same(e,y)), ...], @(3)], \n                     e -> assign_acc(@(0).val, @(3).val));\n    return code;\nend;\n\n# =======================================================================================\n# Code generation templates\n# [ Data, Blk, Blk1, Prm, R, W, SUM, ISum, Compose ]\n# =======================================================================================\nFormula.code := (self,y,x) >> self.child(1).code(y, x);\n\nBB.code := (self,y,x) >> MarkForUnrolling(_CodeSums(self.child(1), y, x));\n\nBuf.code := (self,y,x) >> _CodeSums(self.child(1), y, x);\n\nCOND.code := (self,y,x) >>\n    IF(self.cond, \n    _CodeSums(self.child(1), y, x),\n    _CodeSums(self.child(2), y, x));\n\nData.code := meth(self, y, x) \n    local val, t;\n    if self.inline then\n    # we set live_out to prevent copy propagation \n    # self.var.setAttr(\"live_out\")\n    return decl(self.var, chain(\n        assign(self.var, self.value.tolist()),\n        _CodeSums(self.child(1), y, x)));\n    else\n    val := self.value;\n    if IsBound(val.tolist) then\n        if IsBound(val.range) and val.range() <> false then\n        t := TArray(val.range(), val.domain());\n        val := t.value(val.tolist());\n        else\n        val := V(val.tolist());\n        fi;\n    else val := Cond(IsSPL(val), V(MatSPL(val)), val);\n    fi;\n    return data(self.var, val, _CodeSums(self.child(1), y, x));\n    fi;\nend;\n\nDiag.code := meth(self, y, x)\n    local i, elt;\n    i := Ind(); \n    elt := self.element.lambda().at(i);\n    return loop(i, self.element.domain(), assign(nth(y,i), elt * nth(x,i)));\nend;\n\nRCDiag.code := meth(self, y, x)\n    local i, elt, re, im;\n    i := Ind(); \n    elt := self.element.lambda();\n    re := elt.at(2*i);\n    im := elt.at(2*i+1);\n    return loop(i, self.element.domain()/2, chain(\n\t    assign(nth(y,2*i),   re * nth(x,2*i) - im * nth(x,2*i+1)), \n\t    assign(nth(y,2*i+1), im * nth(x,2*i) + re * nth(x,2*i+1))));\nend;\n\nColVec.code := meth(self, y, x)\n    local i, datavar, diag, func;\n    i := Ind();\n    func := self.element;\n    if IsBound(self.inline) and self.inline then\n    return loop(i, Rows(self), assign(nth(y,i), mul(func.lambda().at(i), nth(x,0))));\n    else\n    diag := V(func.lambda().tolist());\n    datavar := Dat(diag.t);\n    return\n    data(datavar, diag,\n        loop(i, Rows(self), assign(nth(y,i), mul(nth(datavar,i), nth(x,0)))));\n    fi;\nend;\n\nRowVec.code := meth(self, y, x)\n    local i, datavar, diag, func, t;\n    i := Ind();\n    t := TempVar(x.t.t);\n    func := self.element;\n    if IsBound(self.inline) and self.inline then\n    return chain(\n        assign(t,0),\n        loop(i, Cols(self), assign(t, add(t, mul(func.lambda().at(i), nth(x,i))))),\n        assign(nth(y,0), t));\n    else\n    diag := V(func.lambda().tolist());\n    datavar := Dat(diag.t);\n    return\n    data(datavar, diag,\n        chain(\n        assign(t,0),\n        loop(i, Cols(self), assign(t, add(t, mul(nth(datavar,i), nth(x,i))))),\n        assign(nth(y,0), t)));\n    fi;\nend;\n\nScale.code := (self, y, x) >> let(i := Ind(), \n    chain(\n\t_CodeSums(self.child(1), y, x),\n\tloop(i, Rows(self), \n\t    assign(nth(y,i), mul(self.scalar, nth(y,i))))));\n\nI.code := (self, y, x) >> let(i := Ind(), \n    loop(i, Rows(self), assign(nth(y,i), nth(x,i))));\n\n\nBlk2code := (blk, y, x) -> let(b := V(blk.element).v, \n    t0 := TempVar(x.t.t), t1 := TempVar(x.t.t), \n    decl([t0, t1], chain(\n\t    assign(t0, mul(b[1].v[1], nth(x,0)) + mul(b[1].v[2], nth(x,1))),\n\t    assign(t1, mul(b[2].v[1], nth(x,0)) + mul(b[2].v[2], nth(x,1))),\n\t    assign(nth(y,0), t0),\n\t    assign(nth(y,1), t1)\n\t)));\n\nBlk4code := (blk, y, x) -> let(b := V(blk.element).v, \n    t0 := TempVar(x.t.t), t1 := TempVar(x.t.t), \n    t2 := TempVar(x.t.t), t3 := TempVar(x.t.t), \n\n    x0 := TempVar(x.t.t), x1 := TempVar(x.t.t), \n    x2 := TempVar(x.t.t), x3 := TempVar(x.t.t), \n    decl([x0,x1,x2,x3, t0, t1, t2, t3], chain(\n\t    assign(x0, nth(x,0)),\n\t    assign(x1, nth(x,1)),\n\t    assign(x2, nth(x,2)),\n\t    assign(x3, nth(x,3)),\n\n\t    assign(t0, mul(b[1].v[1], x0) + mul(b[1].v[2], x1) + \n\t\t       mul(b[1].v[3], x2) + mul(b[1].v[4], x3)),\n\t    assign(t1, mul(b[2].v[1], x0) + mul(b[2].v[2], x1) + \n\t\t       mul(b[2].v[3], x2) + mul(b[2].v[4], x3)),\n\t    assign(t2, mul(b[3].v[1], x0) + mul(b[3].v[2], x1) + \n\t\t       mul(b[3].v[3], x2) + mul(b[3].v[4], x3)),\n\t    assign(t3, mul(b[4].v[1], x0) + mul(b[4].v[2], x1) + \n\t\t       mul(b[4].v[3], x2) + mul(b[4].v[4], x3)),\n\t    assign(nth(y,0), t0),\n\t    assign(nth(y,1), t1),\n\t    assign(nth(y,2), t2),\n\t    assign(nth(y,3), t3)\n    )));\n\nBlk.code := meth(self, y, x) \n    local i, j, t, datavar, matval;\n    if Rows(self)=2 and Cols(self)=2 then return Blk2code(self, y, x); fi;\n    if Rows(self)=4 and Cols(self)=4 then return Blk4code(self, y, x); fi;\n    j := Ind();\n    i := Ind();\n    t := TempVar(x.t.t);\n    matval := V(self.element);\n    datavar := Dat(matval.t);\n    return \n    data(datavar, matval,\n    loop(j, Rows(self),\n        decl(t, \n        chain(\n            assign(t, 0),\n            loop(i, Cols(self),\n            assign(t, add(t, mul(nth(nth(datavar, j), i), nth(x, i))))),\n            assign(nth(y,j), t)))));\nend;\n\ntoeplitz.code := meth(self, y, x) \n    local i, j, t, datavar, matval, dataload;\n    j := Ind();\n    i := Ind();\n    t := TempVar(x.t.t);\n    matval := V(self.obj.element);\n    datavar := Dat(matval.t);\n    dataload := TempVec(TArray(TDouble, Rows(self)*Cols(self)));\n    return \n    data(datavar, matval, decl(dataload, chain(\n    loop(j, Rows(self),\n        loop(i, Cols(self),\n        assign(nth(dataload, j*Cols(self)+i), nth(nth(datavar,j),i)))),\n    \n    loop(j, Rows(self),\n        decl(t, \n        chain(\n            assign(t, 0),\n            loop(i, Cols(self),\n            assign(t, add(t, mul(nth(dataload, j*Cols(self)+i), nth(x, i))))),\n            assign(nth(y,j), t)))))));\nend;\n\nBlk1.code := (self, y, x) >> \n   assign(nth(y,0), mul(toExpArg(self.element), nth(x,0)));\n\nBlkConj.code := (self, y, x) >> \n   assign(nth(y,0), conj(nth(x,0)));\n\nPrm.code := (self, y, x) >> let(i := Ind(), func := self.func.lambda(),\n    loop(i, Rows(self), \n    assign(nth(y, i),\n           nth(x, func.at(i)))));\n\nZ.code := (self, y, x) >> let(i := Ind(), ii := Ind(), z := self.params[2],\n    chain(\n    loop(i, Rows(self)-z, \n        assign(nth(y, i), nth(x, i+z))),\n    loop(i, z, \n        assign(nth(y, i+(Rows(self)-z)), nth(x, i)))));\n\nO.code := (self, y, x) >> let(i := Ind(), \n    loop(i, self.params[1], \n        assign(nth(y, i), V(0))));\n\nGath.code := meth(self, y, x)\n    local i, func, rfunc, ix;\n    i := Ind(); func := self.func.lambda();\n\n    if IsBound(self.func.rlambda) then\n\trfunc := self.func.rlambda();\n\tix := var.fresh_t(\"ix\", TInt);\n\treturn chain(\n\t    assign(ix, func.at(0)),\n\t    assign(nth(y, 0), nth(x, ix)),\n\t    loop(i, self.func.domain()-1, \n\t\tchain(assign(ix, rfunc.at(ix)), \n\t\t      assign(nth(y, i+1), nth(x, ix)))));\n    else \n\treturn loop(i, self.func.domain(), assign(nth(y,i), nth(x, func.at(i))));\n    fi;\nend;\n\nScat.code := meth(self, y, x)\n    local i, func, rfunc, ix;\n    i := Ind(); func := self.func.lambda();\n    if IsBound(self.func.rlambda) then\n\trfunc := self.func.rlambda();\n\tix := var.fresh_t(\"ix\", TInt);\n\treturn chain(\n\t    assign(ix, func.at(0)),\n\t    assign(nth(y, ix), nth(x, 0)),\n\t    loop(i, self.func.domain()-1, \n\t\tchain(assign(ix, rfunc.at(ix)), \n\t\t      assign(nth(y, ix), nth(x, i+1)))));\n    else \n\treturn loop(i, self.func.domain(), assign(nth(y,func.at(i)), nth(x, i)));\n    fi;\nend;\n\nSUM.code := (self, y, x) >>\n       chain(List(self.children(), c -> _CodeSums(c, y, x))); \n\nSUMAcc.code := (self, y, x) >>\n   let(ii := Ind(), \n       When(not Same(ObjId(self.child(1)), Gath),  # NOTE: come up with a general condition\n       chain(\n           loop(ii, Rows(self), assign(nth(y, ii), V(0))), \n           List(self.children(), c -> _CodeSumsAcc(c, y, x))),\n       chain(\n           _CodeSums(self.child(1), y, x),\n           List(Drop(self.children(), 1), c -> _CodeSumsAcc(c, y, x)))));\n\n\nISum.code := (self, y, x) >> let(myloop := When(IsSymbolic(self.domain), loopn, loop),\n   myloop(self.var, self.domain, \n        _CodeSums(self.child(1), y, x)));\n\nISumAcc.code := (self, y, x) >> \n   let(ii := Ind(),\n       chain(\n       loop(ii, Rows(self), \n           assign(nth(y, ii), V(0))), \n       loop(self.var, \n            self.domain, \n        _CodeSumsAcc(self.child(1), y, x))));\n\nCompose.code := meth(self,y,x) \n    local ch, numch, vecs, allow, i;\n#VIENNA filtering DMPGath, DMPScat out here because they do not generate code \n#    ch := self.children();\n    ch := Filtered(self.children(), i-> not i.name in [\"DMPGath\",\"DMPScat\"]);\n    numch := Length(ch);\n    vecs := [y];\n    allow := (x<>y);\n    for i in [1..numch-1] do\n        if allow and ObjId(ch[i])=Inplace then vecs[i+1] := vecs[i]; \n\telse vecs[i+1] := TempVec(TArray(TempArrayType(y, x), Cols(ch[i])));\n\tfi;\n    od;\n    vecs[numch+1] := x;\n    for i in Reversed([1..numch]) do\n        if allow and ObjId(ch[i])=Inplace then vecs[i] := vecs[i+1]; \n\tfi;\n    od;\n\n#Print(vecs, \"\\n\");\n    if vecs[1] = vecs[numch+1] then # everything was inplace\n\tvecs[1] := y;\n    fi;\n    if vecs[1] = vecs[numch+1] then # everything was inplace\n\tvecs[numch+1] := x;\n    fi;\n#Print(vecs, \"\\n\");\n    vecs := Reversed(vecs);\n    ch := Reversed(ch);\n    return decl( Difference(vecs{[2..Length(vecs)-1]}, [x,y]),\n\tchain( List([1..numch], i -> When(vecs[i+1]=vecs[i], \n\t\t    compiler._IPCodeSums(ch[i], vecs[i]), \n\t\t    _CodeSums(ch[i], vecs[i+1], vecs[i])))));\nend;\n\nICompose.code := (self, y, x) >> \n\n#DoneSpiralHelp - How to make this work for any datatype (var t)\n#Look into Compose.code for tempvec\n\n  chain([let(\n    t :=  Dat1d(x.t.t, Rows(self)),\n    newind := Ind(self.domain),\n    decl([t], chain(\n       When(IsOddInt(self.domain),\n       SubstVars(Copy(_CodeSums(self.child(1), y, x)), tab((self.var.id) := (V(0)))),\n          skip()\n       ),\n       When(IsEvenInt(self.domain),\n          chain(\n          SubstVars(Copy(_CodeSums(self.child(1), t, x)), tab((self.var.id) := (V(0)))),\n          SubstVars(Copy(_CodeSums(self.child(1), y, t)), tab((self.var.id) := (V(1))))\n          ),\n          skip()\n       ),\n      loop(newind, (self.domain/2), \n        chain([\n        SubstVars(Copy(_CodeSums(self.child(1), x, y)), tab((self.var.id) := (2*newind)+2)),\n        SubstVars(Copy(_CodeSums(self.child(1), y, x)), tab((self.var.id) := (2*newind)+3))\n        ])\n      )\n    ))\n  )]);\n\n", "meta": {"hexsha": "df72d0bdc1961bb69d65fa3a2941b19821ab9890", "size": 11984, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/compiler/sums2code.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/compiler/sums2code.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/compiler/sums2code.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 30.8071979434, "max_line_length": 92, "alphanum_fraction": 0.5226134846, "num_tokens": 3943, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.596433160611502, "lm_q2_score": 0.5312093733737562, "lm_q1q2_score": 0.31683088550776484}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\nVarFrontier := (e, depth) -> Cond(\n    IsBound(e.isExpComposite) and e.isExpComposite, \n        Union(List(VarArgsExp(e), x->VarFrontier(x, depth))),\n    IsVar(e), \n        When(depth=0, \n            Set([e]),  \n            Union([e], Union(List(PredLoc(e), x->VarFrontier(x, depth-1))))), \n    Set([])\n);\n\nIsXRef := exp -> Intersection([var.table.X,var.table.X1,var.table.XY1], VarFrontier(exp, -1)) <> [];\n\nIsYRef := exp -> Intersection([var.table.Y,var.table.Y1,var.table.XY1], VarFrontier(exp, -1)) <> []; \n\nCollectLoads := cmd -> Collect(cmd, [assign, @, @(1, [deref, nth], IsXRef)]);\n\nCollectStores := cmd -> Collect(cmd, [assign, @(1, [deref, nth], IsYRef), @]);\n", "meta": {"hexsha": "a78adbf18225c0d1c98b31697c7a9dc5ef151365", "size": 753, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/compiler/io.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/compiler/io.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/compiler/io.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 32.7391304348, "max_line_length": 101, "alphanum_fraction": 0.598937583, "num_tokens": 232, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.6224593452091673, "lm_q2_score": 0.5078118642792044, "lm_q1q2_score": 0.3160922405286802}}
{"text": "\nlocal reps,tori,labels,I,II,ords,blocks;\n\n# Permutation from standard to gap\n# / 1 2 3 4 \\\n# \\ 2 4 3 1 /\n# Position(pr,Permuted([2,3,4,2],(2,4,1)))=24;\n\n\n#......Ross Jordan Block Sizes........Donna & Ross nilpotents........(in GAP notation)\nreps:=[[[2,1],[4,1],[3,1],[1,1]],    # F_4\n       [[2,1],[4,1],[7,1],[5,1]],    # F_4(a_1) [[2,1],[4,1],[10,1],[1,1]],\n       #[[6,1],[10,1],[1,1],[5,1]],   # F_4(a_2) [[9,1],[1,1],[10,1],[4,1]],\n       # F_4(a_2): s_11s_9*[4,3,1,24]=[4,5,9,10] also good .. has 2 semisimple elements?\n       [[1,1],[4,1],[9,1],[10,1]],   # F_4(a_2) good for all p\\neq 2 <C_3A_1\n       [[4,1],[3,1],[1,1]],          # C_3      [[1,1],[3,1],[4,1]],\n       [[2,1],[4,1],[3,1]],          # B_3      the same\n       [[4,1],[6,1],[10,1],[18,1]],  # F_4(a_3) [[4,1],[13,1],[11,1],[12,1]],\n       [[4,1],[1,1],[10,1]],         # C_3(a_1) [[1,1],[10,1],[4,1]],\n       [[2,1],[3,1],[1,1]],          # sA_2A_1  [[3,1],[1,1],[2,1]],\n       [[4,1],[3,1]],                # B_2      the same\n       [[2,1],[4,1],[1,1]],          # A_2sA_1  the same\n       [[3,1],[1,1]],                # sA_2     the same\n       [[2,1],[4,1]],                # A_2      the same\n#       [[2,1],[3,1]],                # A_1sA_1  [[2,1],[1,1]],\n#       [[3,1]],                      # sA_1     [[1,1]],\n#       [[2,1]]                       # A_1      [[2,1]]\n       [[2,1],[1,1]],                # A_1sA_1  [[2,1],[1,1]],\n       [[1,1]],                      # sA_1     [[1,1]],\n       [[2,1]]                       # A_1      [[2,1]]\n       ];\n\nI:=[[],     # F_4\n    [3],    # F_4(a_1)\n    [3,4],  # F_4(a_2)\n    [],     # C_3\n    [],     # B_3\n    [2,3,1],# F_4(a_3)\n    [3],    # C_3(a_1)\n    [],     # sA_2A_1\n    [],     # B_2\n    [],     # A_2sA_1\n    [],     # sA_2\n    [],     # A_2\n    [],     # A_1sA_1\n    [],     # sA_1\n    []      # A_1\n    ];\n\n#\n# The parabolic where the representative is distinguished\n#\nII:=[[1,2,3,4],   # F_4\n     [1,2,3,4],   # F_4(a_1)\n     [1,2,3,4],   # F_4(a_2)\n     [4,3,1],     # C_3\n     [2,4,3],     # B_3\n     [1,2,3,4],   # F_4(a_3)\n     [4,3,1],     # C_3(a_1)\n     [3,1,2],     # sA_2A_1\n     [4,3],       # B_2\n     [2,4,1],     # A_2sA_1\n     [3,1],       # sA_2\n     [2,4],       # A_2\n     [2,1],       # A_1sA_1\n     [1],         # sA_1\n     [2]          # A_1\n     ];\n\nlabels:=[\"F_4\",\n         \"F_4(a_1)\",\n         \"F_4(a_2)\",\n         \"C_3\",\n         \"B_3\",\n         \"F_4(a_3)\",\n         \"C_3(a_1)\",\n         \"\\\\tilde A_2A_1\",\n         \"B_2\",\n         \"A_2\\\\tilde A_1\",\n         \"\\\\tilde A_2\",\n         \"A_2\",\n         \"A_1\\\\tilde A_1\",\n         \"\\\\tilde A_1\",\n         \"A_1\"\n         ];\n\ntori:=[\n       [2,2,2,2],  # F_4\n       [2,2,0,2],  # F_4(a_1)\n       [2,0,0,2],  # F_4(a_2)\n       [2,-9,2,2], # C_3\n       [-6,2,2,2], # B_3\n       [0,0,0,2],  # F_4(a_3)\n       [2,-5,0,2], # C_3(a_1)\n       [2,2,2,-5], # sA_2A_1\n       [-3,-4,2,2],# B_2\n       [2,2,-3,2], # A_2sA_1\n       [2,0,2,-4], # sA_2\n       [0,2,-2,2], # A_2\n       [2,2,-1,-1],# A_1sA_1\n       [2,0,-1,0], # sA_1\n       [0,2,0,-1]  # A_1\n    ];\n\n#blocks:=[];\nblocks:=[[[19, 1], [15, 1], [9, 2]],                      # F_4\n         [[9, 5], [7, 1]],                                # F_4(a_1)\n         [[9, 3], [7, 1],[6, 2], [3, 2]],                 # F_4(a_2)\n         [[9, 2], [8, 2], [6, 2], [3, 1], [1, 3]],        # C_3\n         [[9, 2], [7, 4], [3, 1], [1, 3]],                # B_3\n         [[7, 1], [6, 2], [5, 3], [3, 6]],                # F_4(a_3)\n         [[7, 1], [6, 2], [5, 1], [4, 4], [3, 3], [1, 3]],# C_3(a_1)\n         [[3, 16], [2, 2]],                               # sA_2A_1\n         [[7, 1], [5, 4], [4, 4], [3, 1], [1, 6]],        # B_2\n         [[3, 16], [2, 2]],                               # A_2sA_1\n         [[3, 15], [1, 7]],                               # sA_2\n         [[3, 15], [1, 7]],                               # A_2\n         [[3, 10], [2, 8], [1, 6]],                       # A_1sA_1\n         [[3, 7], [2, 8], [1, 15]],                       # sA_1\n         [[3, 1], [2, 14], [1, 21]]                       # A_1\n         ];\n\n#ords:=[];\nords:=[ 27, 9, 9, 9, 9, 9, 9, 3, 9, 3, 3, 3, 3, 3, 3 ];\n\nreturn [reps,tori,labels,I,II,ords,blocks];\n", "meta": {"hexsha": "099ec81df789a1601043afd7df0c8df357eb093e", "size": 4196, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/data/dataF4char3.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/data/dataF4char3.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/data/dataF4char3.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 33.0393700787, "max_line_length": 88, "alphanum_fraction": 0.2959961868, "num_tokens": 1985, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.665410572017153, "lm_q2_score": 0.4687906266262437, "lm_q1q2_score": 0.31193823901964846}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\ndomain := f -> f.domain(); pdomain := p -> p.val.domain();\nrange  := f -> f.range();  prange := p -> p.val.range();\nis_perm := f -> f.isPermutation();\n\nClass(fId, PermClass, rec(\n    domain := self >> self.params[1],\n    range  := self >> self.params[1],\n    def    := size -> Checked(IsPosInt0Sym(size), rec(size := size)),\n    lambda := self >> let(i := Ind(self.params[1]), Lambda(i,i)),\n    transpose := self >> self,\n    isIdentity := True\n));\n\nClass(fBase, FuncClass, rec(\n    abbrevs := [ var -> Checked(IsVar(var) or ObjId(var)=ind, [var.range, var]) ],\n    def    := (N, pos) -> rec(),\n    domain := self >> 1,\n    range  := self >> self.params[1],\n    print  := (self, i, is) >> Print(self.name, \"(\", \n        When(ObjId(self.params[2]) in [var, ind], Print(self.params[2]), PrintCS(self.params)), \")\"),\n    lambda := self >> let(i := Ind(1), Lambda(i, self.params[2]))\n));\n\n# used for I_n dirsum J_n\n# below represent an alternator <I_n | J_n>_x o fBase(j)\n# x = (pos+par) mod 2\nClass(fXbase, FuncClass, rec(\n    def := (n,j,par,pos) -> rec(),\n    domain := self >> 1,\n    range := self >> self.params[1],\n    lambda := self >> let(\n\tn:=self.params[1], j:=self.params[2], par:=self.params[3],\n\tpos:=self.params[4], i := Ind(1),\n\tLambda(i, j + imod(pos+par, 2)*(n - 1 - 2*j))\n    )\n));\n\n# used for I_n dirsum (I_1 dirsum J_n-1)\n# below represent an alternator <I_n | I_1 dirsum J_n_1>_x o fBase(j)\n# x = (pos+par) mod 2\nClass(fYbase, FuncClass, rec(\n    def := (n,j,par,pos) -> rec(),\n    lambda := self >> let(\n\tn := self.params[1], j := self.params[2], par := self.params[3],\n\tpos := self.params[4], i := Ind(1),\n\tLambda(i, cond(eq(j, 0), 0, j + imod(pos+par, 2)*(n - 2*j)))\n    )\n));\n\nClass(fDot, FuncClass, rec(\n    def    := (v, func) -> Chain(v.setRange(func.domain()), rec()),\n    range  := self >> self.params[2].range(),\n    domain := self >> self.params[2].domain(),\n    lambda := self >> let(\n        v    := self.params[1],\n        func := self.params[2],\n        i    := Ind(func.domain()),\n        Lambda(i, SubstVars(func.at(i), tab((v.id) := i)))) \n));\n\nClass(fPlaceholder, FuncClass, rec(\n    def := func -> rec(),\n    range := self >> self.params[1].range(),\n    domain := self >> self.params[1].domain(),\n    lambda := self >> self.params[1].lambda(),\n    at := (self, n) >> self.params[1].at(n)\n));\n\n#F fAdd is the \"add constant\" index-mapping function\n#F fAdd(N, n, k): II_n -> II_N, i->i+k\n#F References: \"Formal Loop Merging for Signal Transforms\"\nClass(fAdd, FuncClass, rec(\n    def := (N, n, val) -> rec(), \n    range  := self >> self.params[1],\n    domain := self >> self.params[2],\n    lambda := self >> let(i := Ind(self.params[2]), Lambda(i, i + self.params[3]))\n));\n\n#F fSub is the \"subtract constant\" index-mapping function\n#F fSub(N, n, k): II_n -> II_N, i->i-k\n#F References: \"fAdd\" function\nClass(fSub, FuncClass, rec(\n    def := (N, n, val) -> rec(N := N, n := n),\n    lambda := self >> let(i := Ind(self.params[2]), Lambda(i, i - self.params[3]))\n));\n\nFunction.hash := false;\n\nClass(FuncClassOper, Function, rec(\n    _perm := true,\n    _children := [],\n\n    child := (self, n) >> self._children[n],\n    children := self >> self._children,\n    numChildren := self >> Length(self._children),\n\n    from_rChildren := (self, rch) >> ApplyFunc(ObjId(self), rch),\n    rChildren := self >> self._children,\n    rSetChild := meth(self, n, what)\n        self._children[n] := what;\n    end,\n    free := self >> Union(List(self.rChildren(), FreeVars)),\n\n    skipOneChild := false,\n\n    advdims   := self >> [ [[ self.range() ]], [[ self.domain() ]] ],\n    advrange  := self >> [[ self.range() ]],\n    advdomain := self >> [[ self.domain() ]],\n    # dimensionality of range (1-d, 2-d, etc)\n    advrangeDim := self >> Length(self.advrange()[1]),\n    # dimensionality of domain (1-d, 2-d, etc)\n    advdomainDim := self >> Length(self.advdomain()[1]),\n  \n    __call__ := meth(arg)\n        local self, children, lkup, res, h;\n        self := arg[1];\n        children := Flat(Drop(arg, 1));\n\tConstraint(ForAll(children, c -> IsFunction(c) or IsFuncExp(c)));\n        if self.skipOneChild and Length(children)=1 then return children[1]; fi;\n\n        h := self.hash;\n        if h<>false then\n            lkup := h.objLookup(self, children);\n            if lkup[1]<>false then return lkup[1]; fi;\n        fi;\n        res := WithBases(self, rec(operations := RewritableObjectOps, _children := children));\n        if h<>false then return h.objAdd(res, lkup[2]);\n        else return res;\n        fi;\n    end,\n\n    print := self >> Print(self.name, \"(\", PrintCS(self._children), \")\"),\n    range := self >> Error(\"not implemented\"), \n    domain := self >> Error(\"not implemented\"), \n\n    rightBinary := self >> FoldR1(self._children, (p,x) -> let(base:=self.__bases__[1], base(x, p))),\n    leftBinary  := self >> FoldL1(self._children, (p,x) -> let(base:=self.__bases__[1], base(p, x))),\n\n    equals := (self, o) >> ObjId(o) = ObjId(self) and self.rChildren() = o.rChildren(),\n\n    lessThan := (self, o) >> Cond(\n        ObjId(self) <> ObjId(o), ObjId(self) < ObjId(o), \n        [ ObjId(self), self.rChildren() ] < [ ObjId(o), o.rChildren() ]\n    ),\n));\n\nFuncClass.tensor_op := (v,range,domain,fl,gl) ->\n    Lambda(v, range * fl.at(idiv(v, domain)) + gl.at(imod(v, domain)));\n\nFuncClassOper.tensor_op := FuncClass.tensor_op;\n\nClass(fTensorBase, SumsBase, FuncClassOper, rec(\n    domain := self >> Product(self._children, x->x.domain()),\n\n    range := self >> let(cht := List(self._children, x->x.range()),\n        Cond(ForAll(cht, x->not IsType(x)), Product(cht),\n             ForAll(cht, x->not IsType(x) or x=TInt), TInt,\n             Error(\"self.range() can't handle this combination of self._children ranges\"))),\n\n    skipOneChild := true,\n\n    split_op := self >> let(\n        c := self.children(), v := Ind(self.domain()),\n        c1dom := c[1].domain(), c2dom := c[2].domain(),\n        Checked(Length(c)=2,\n            [ Cond(c1dom=1, 0, c2dom=1, v, idiv(v, c2dom)),\n              Cond(c1dom=1, v, c2dom=1, 0, imod(v, c2dom)),\n              v ])),\n\n    lambda := self >> Cond(\n\tself.numChildren() > 2, \n\t    self.rightBinary().lambda(),\n        let(split := self.split_op(), \n            f := self.child(1).lambda(), \n            g := self.child(2).lambda(),\n            jv := DropLast(When(Length(f.vars) > Length(g.vars), f.vars, g.vars), 1),\n            Lambda(Concatenation(jv, [split[3]]),\n                   self.combine_op(jv, split, f, g)))),\n    \n    isIdentity := self >> ForAll(self._children, IsIdentity),\n));\n\nClass(fTensor, fTensorBase, rec(\n    combine_op := (self, jv, split, f, g) >> \n        self.child(2).range() * f.relaxed_at(jv, split[1]) + g.relaxed_at(jv, split[2]),\n\n    transpose := self >> self.__bases__[1](List(self.children(), c->c.transpose()))\n));\n\nClass(diagTensor, fTensorBase, rec(\n    print := FuncClassOper.print,\n    range := self >> UnifyTypes(List(self.children(), x->x.range())),\n    combine_op := (self, jv, split, f, g) >> f.relaxed_at(jv, split[1]) * g.relaxed_at(jv, split[2])\n));\n\nClass(gammaTensor, fTensorBase, rec(\n    isCyclic := true,\n    print := FuncClassOper.print,\n    combine_op := (self, jv, split, f, g) >> let(\n        r := self.child(1).range(), s := self.child(2).range(),\n        imod(s * no_mod(f.relaxed_at(jv,split[1])) + r * no_mod(g.relaxed_at(jv,split[2])), self.range()))\n));\n\n_rankedLambdaCompose := function(l1, l2) \n    local jv, v, vars;\n    l1.expr := l1.expr.eval(); \n    l2.expr := l2.expr.eval(); \n\n    vars := When(Length(l1.vars) > Length(l2.vars), l1.vars, l2.vars);\n    v := Last(vars);\n    jv := vars{[1..Length(vars)-1]};\n\n    return Lambda(vars, l1.relaxed_at(jv, l2.relaxed_at(jv, v)));\nend;\n\nClass(fCompose, FuncClassOper, rec(\n    domain := self >> Last(self._children).domain(),\n    range := self >> self._children[1].range(),\n    advdomain := self >> Last(self._children).advdomain(),\n    advrange := self >> self._children[1].advrange(),\n    skipOneChild := true,\n\n    lambda := self >>\n        FoldL1(List(self.children(), z->z.lambda()), _rankedLambdaCompose),\n\n    transpose := self >> self.__bases__[1](List(Reversed(self.children()), c->c.transpose())),\n\n    isIdentity := self >> ForAll(self._children, IsIdentity),\n));\n\nClass(fDirsum, FuncClassOper, rec(\n    domain := self >> Sum(self._children, x->x.domain()),\n    range  := self >> Sum(self._children, x->x.range()),\n    skipOneChild := true,\n\n    lambda := meth(self)\n        local dom_spans, row_spans, i, conds, v;\n        # spans uses 1-based offsets\n        dom_spans := BaseOverlap.spans(0, List(self.children(), x->x.domain())) - 1;\n        row_spans := BaseOverlap.spans(0, List(self.children(), x->x.range())) - 1;\n        conds := [];\n        v := Ind(self.domain());\n        for i in [1..self.numChildren()] do\n            Add(conds, leq(dom_spans[i][1], v, dom_spans[i][2]));\n            Add(conds, row_spans[i][1] + self.child(i).lambda().at(v - dom_spans[i][1]));\n        od;\n        return Lambda(v, ApplyFunc(cond, conds));\n    end,\n\n    transpose := self >> self.__bases__[1](List(self.children(), c->c.transpose()))\n));\n\nClass(fStack, FuncClassOper, rec(\n    domain := self >> Sum(self._children, x->x.domain()),\n    # NB: use lowercase max that handles symbolics\n    range := self >> ApplyFunc(max, List(self._children, x->x.range())),  \n    subdomainsDivisibleBy := (self, n) >> ForAll(self._children, x -> x.domain() mod n = 0),\n    skipOneChild := true,\n\n    lambda := meth(self)\n        local dom_spans, i, conds, v;\n        # spans uses 1-based offsets\n        dom_spans := BaseOverlap.spans(0, List(self.children(), x->x.domain())) - 1;\n        conds := [];\n        v := Ind(self.domain());\n        for i in [1..self.numChildren()] do\n            Add(conds, leq(dom_spans[i][1], v, dom_spans[i][2]));\n            Add(conds, self.child(i).lambda().at(v - dom_spans[i][1]));\n        od;\n\t# Else branch needed below (=errExp), it ensures that cond(..).ev() does not crash \n\t# with nested conds. For example:\n\t#   cond(c1, cond(...., errExp), b)\n\t# if c1 is false, our inner cond can be invalid, because then b is taken instead\n\tAdd(conds, errExp(conds[2].t)); \n        return Lambda(v, ApplyFunc(cond, conds));\n    end\n));\n\nClass(diagDirsum, fStack, rec(\n    range := self >> UnifyTypes(List(self.children(), x->x.range()))\n));\n\n# Function for Pease twiddle access. Maps n->n to index into\n#   Diag(TC(n,2,0)) based upon iteration l.\n#   fAccPease(n, r, l)\nClass(fAccPease, FuncClass, rec(\n   def := (n, r, l) -> rec(N:=n, n:=n),\n   lambda := self >> let(\n       N := self.params[1], k := Ind(N),\n       R := self.params[2], l := self.params[3],\n\n       Lambda(k, let(\n           bits:=Log2Int(N)-Log2Int(R),\n\t       rCyclicShift(\n               bin_and(\n                   k, \n                   concat(\n                       bin_shl(\n                           2^(bits)-1, \n                           l*Log2Int(R), \n                           bits\n                       ),\n\t\t               R-1, \n                       Log2Int(R)\n                   )\n               ), \n               Log2Int(R), \n               Log2Int(N)\n           )\n\t   )))\n));\n\t   \n\n#F fPad(<diag_func>)\n#F\n#F   Index function with 0 range and non zero domain. \n#F   Returns result of <diag_func> diagonal function wrapped into funcExp().\n#F   Relies on rewriting nth(<loc>, funcExp(A)) -> A.\n\nClass(fPad, FuncClass, rec(\n    def       := (f) -> rec(), \n    \n    domain    := self >> self.params[1].domain(),\n    range     := self >> 0,\n    \n    lambda    := self >> let(\n                    i := Ind(self.domain()), \n                    l := self.params[1].lambda(),\n                    Lambda(i, funcExp(l.at(i)))),\n\n    transpose := self >> Error(\"fPad is not transposable, needs inert form\"),\n));\n\n#F fInsert(<map>, <value>)\n#F\n#F Index function with padding.\n#F\n#F   Ex: Gath(fInsert([1, 1, 0, 1, 0], 3))*X ==\n#F\n#F   [ [ 1, 0, 0 ],\n#F     [ 0, 1, 0 ],\n#F     [ 0, 0, 0 ],  * X + [ 0, 0, 3, 0, 3 ]^T \n#F     [ 0, 0, 1 ],\n#F     [ 0, 0, 0 ] ]\n#F\n#F\n\nClass(fInsert, FuncClass, rec(\n    def := (map, val) -> rec(), \n    domain := self >> Length(self.params[1]),\n    range  := self >> Sum(self.params[1]),\n    lambda := self >> let(\n        i := Ind(self.domain()), \n        map := self.params[1],\n        v   := funcExp(self.params[2]),\n        ctr := Counter(0),\n        Lambda(i, ApplyFunc( cond, \n            ConcatList([1..Length(map)], j ->[eq(i, j-1), Cond(map[j]<>0, ctr.next(), v)])\n            :: [errExp(TInt)]))),\n    transpose := self >> Error(\"fInsert is not transposable, needs inert form\"),\n));\n\n", "meta": {"hexsha": "126605b6d41a4e60ad59a32cdf4b681f102d62d9", "size": 12669, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/spl/perms2.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/spl/perms2.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/spl/perms2.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 34.4266304348, "max_line_length": 106, "alphanum_fraction": 0.551661536, "num_tokens": 3777, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES\n\n", "lm_q1_score": 0.5926665999540698, "lm_q2_score": 0.523420348936324, "lm_q1q2_score": 0.31021375855086397}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\nDimLength := (l) -> When(IsList(l), Length(l), 1); \n               \nClass(CrossBase, BaseOperation, rec(\n  abbrevs := [ arg -> [Flat(arg)] ],\n\n   new := meth(self, L)\n        if Length(L)=1 then return L[1]; fi;\n        return SPL(WithBases(self, rec(_children:=L, dimensions := TransposedMat(List(L, e -> e.dims())))));\n   end,\n\n   area := self >> Sum(self.children(), x->x.area()),\n   \n   normalizedArithCost := self >> Sum(self.children(), x -> x.normalizedArithCost()),\n\n));\n\nDeclare(Cross);\n\nClass(Cross, CrossBase, rec(\n   codeletName:=\"C\",\n\n   isPermutation := self >> false,\n\n   dmn:=self>>let(li:=[],Flat(List(self._children, x-> x.dmn()))),\n\n   rng:=self>>let(li:=[],Flat(List(self._children, x-> x.rng()))),\n\n   sums:= self>>ObjId(self)(List(self.rChildren(),x->x.sums())),\n\n   transpose := self >> self,\n\n   isIdentity := self >> ForAll(self._children, IsIdentitySPL),\n\n   isBlockTransitive := true,\n));\n\nDeclare(fCross);\nClass(fCross, FuncClassOper, rec(\n   _perm := true,\n\n   isFunction := true,\n   skipOneChild := true,\n\n   range := (self) >> StripList(List(self.rChildren(), (x) -> x.range())),\n\n   advrange := (self) >> List(self.rChildren(), (x) -> x.advrange()[1]),\n\n   domain := (self) >> StripList(List(self.rChildren(), (x) -> x.domain())),\n\n   advdomain := (self) >> List(self.rChildren(), (x) -> x.advdomain()[1]),\n\n   toSpl := (self, allinds, cols) >> \n       fCross(List([1..Length(self.rChildren())], \n               i -> self.rChildren()[i].toSpl(allinds,cols[i]))),\n\n   downRank := (self, loopid, ind) >>\n       fCross(List(self.rChildren(),\n           c -> c.downRank(loopid, ind))),\n\n   downRankFull := (self, allinds) >>\n       fCross(List(self.rChildren(),\n           c -> c.downRankFull(allinds))),\n\n   isIdentity := self >> ForAll(self._children, IsIdentity),\n   \n   transpose  := self >> ObjId(self)(List(self._children, e -> e.transpose())),\n));\n\nClass(ExplicitGath, Gath);\nClass(ExplicitCross, Cross);\n\nClass(ExplicitOLRuleset, RuleSet);\nRewriteRules(ExplicitOLRuleset, rec(\n   Gath_f2DTrExpR := Rule([Gath, [@(2,fCompose), @(3,f2DTrExplicitR), ...]],\n      e-> Gath(fCompose(Drop(@(2).val.rChildren(),1)))*ExplicitGath(ApplyFunc(f2DTr,@(3).val.rChildren()))),\n\n   Gath_f2DTrExpLR := Rule([Gath, [@(2,fCompose), @(3,f2DTrExplicitL), @(4,f2DTrExplicitR), ...]],\n      e-> Gath(fCompose([ApplyFunc(f2DTr,@(4).val.rChildren())]::Drop(@(2).val.rChildren(),2)))\n      *ExplicitGath(ApplyFunc(f2DTr,@(3).val.rChildren()))),\n\n   Cross_Compose_ExplicitGath_1 := Rule([Cross, [@(1,Compose), ..., @(2,ExplicitGath)], @(3) ],\n       e -> \n       Compose(Cross(Compose(DropLast(@(1).val.rChildren(),1)), @(3).val),\n       ExplicitCross(ApplyFunc(Gath, @(2).val.rChildren()), ApplyFunc(2DI, @(3).val.advdims()[2][1])))),\n\n   Cross_Compose_ExplicitGath_2 := Rule([Cross, @(3), [@(1,Compose), ..., @(2,ExplicitGath)] ],\n       e -> \n       Compose(Cross(@(3).val, Compose(DropLast(@(1).val.rChildren(),1))),\n       ExplicitCross(ApplyFunc(2DI, @(3).val.advdims()[2][1]), ApplyFunc(Gath, @(2).val.rChildren())))),\n));\n\nClass(FinalOLRuleset, RuleSet);\nRewriteRules(FinalOLRuleset, rec(\n   ExplicitCross := Rule(@(1,ExplicitCross),\n       e -> ApplyFunc(Cross, @(1).val.rChildren()))\n));\n", "meta": {"hexsha": "f46c62e6499e95e950467d229feed6fe5a879494", "size": 3291, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/sigma/ol.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/sigma/ol.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/sigma/ol.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 32.2647058824, "max_line_length": 108, "alphanum_fraction": 0.6034639927, "num_tokens": 1005, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6334102775181399, "lm_q2_score": 0.4882833952958347, "lm_q1q2_score": 0.30928372092183426}}
{"text": "#\n# cls 70: A_2\n#\nhandle70char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[70];\n    info:=infos[70];\n    \n    rep:=Representative(o);\n    #pr[19]=[0,0,1,1,1,0,0,0]\n    #pr[17]=[0,1,1,1,0,0,0,0]\n    #pr[37]=[1,1,1,2,1,0,0,0]\n    tmp1:=ApplyRootsReflections(rep,[19,17,37]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,1]]);\n    tmp1:=Conj(tmp1,uu);\n    #tmp1:=ConjugateByTori(tmp1,[3],[-1]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[19,17,37]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,1]]);\n    tmp2:=Conj(tmp2,uu);\n    #tmp2:=ConjugateByTori(tmp2,[3],[-1]);\n\n    return [tmp1,tmp2];\nend;\n\n#\n# cls 68: A_2A_1\n#\nhandle68char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[68];\n    info:=infos[68];\n    \n    rep:=Representative(o);\n    #pr[53]=[1,1,1,2,1,1,1,0]\n    #pr[52]=[1,1,1,2,2,1,0,0]\n    #pr[93]=[1,2,3,4,3,2,1,0]\n    tmp1:=ApplyRootsReflections(rep,[53,52,93]);\n    uu:=Unipotent(chevalleyAdj(rep),[[1,-1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[1],[-1]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[53,52,93]);\n    uu:=Unipotent(chevalleyAdj(cent),[[1,-1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[1],[-1]);\n\n    return [tmp1,tmp2];\nend;\n\n#\n# cls 64: A_2^2\n#\nhandle64char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[64];\n    info:=infos[64];\n    \n    rep:=Representative(o);\n    #pr[43]=[0,0,1,1,1,1,1,1]\n    #pr[41]=[0,1,1,1,1,1,1,0]\n    #pr[79]=[1,1,1,2,2,2,2,1]\n    tmp1:=ApplyRootsReflections(rep,[43,41,79]);\n    uu:=Unipotent(chevalleyAdj(rep),[[1,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[3],[-1]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[43,41,79]);\n    uu:=Unipotent(chevalleyAdj(cent),[[1,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[3],[-1]);\n\n    return [tmp1,tmp2];\nend;\n\n\n#\n# cls 61: D_4(a_1)\n#\nhandle61char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[61];\n    info:=infos[61];\n    \n    rep:=Representative(o);\n    #pr[4] =[0,0,0,1,0,0,0,0]\n    #pr[51]=[1,1,2,2,1,1,0,0]\n    #pr[52]=[1,1,1,2,2,1,0,0]\n    tmp1:=ApplyRootsReflections(rep,[4,51,52]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[5,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[4,1,2,6],[-1,-1,-1,-1]);\n\n    #pr[26]=[0,1,0,1,1,1,0,0]\n    #pr[27]=[0,0,1,1,1,1,0,0]\n    tmp3:=ApplyRootsReflections(rep,[26,27]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,1],[4,1],[5,-1],[11,1],[12,-1]],Ordering(rep));\n    tmp3:=Conj(tmp3,uu);\n    tmp3:=ConjugateByTori(tmp3,[2,4],[-1,-1,-1,-1]);\n    \n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[4,51,52]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[5,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[4,1,2,6],[-1,-1,-1,-1]);\n\n    tmp4:=0;\n    tmp4:=ApplyRootsReflections(cent,[26,27]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,1],[4,1],[5,-1],[11,1],[12,-1]],Ordering(cent));\n    tmp4:=Conj(tmp4,uu);\n    tmp4:=ConjugateByTori(tmp4,[2,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n#\n# NOT FINISHED .. Should be an S_3\n#\n# cls 57: D_4(a_1)A_1 ([2,5,9,10,7] in E_7) [2,5,10,11,7] in E_8  ?CHANGE THE REPRESENTATIVE IN CHARACTERISTIC 2?\n#\nhandle57char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[57];\n    info:=infos[57];\n    \n    rep:=Representative(o);\n\n    #pr[23]=[1,1,1,1,0,0,0,0]\n    #pr[24]=[1,0,1,1,1,0,0,0]\n    tmp1:=ApplyRootsReflections(rep,[23,24]);\n    tmp1:=ConjNegUa(tmp1,4,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    #pr[65]=[1,1,2,2,1,1,1,1]\n    #pr[67]=[1,1,1,2,2,1,1,1]\n    tmp3:=ApplyRootsReflections(rep,[65,67,4]);\n    uu:=Unipotent(chevalleyAdj(rep),[[12,1],[11,1]],Ordering(rep));\n    tmp3:=Conj(tmp3,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[23,24]);\n    tmp2:=ConjNegUa(tmp2,4,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    tmp4:=0;\n    tmp4:=ApplyRootsReflections(cent,[65,67,4]);\n    uu:=Unipotent(chevalleyAdj(cent),[[12,1],[11,1]],Ordering(cent));\n    tmp4:=Conj(tmp4,uu);\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n#\n# cls 54: A_4 [1,2,3,4] \n#\nhandle54char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[54];\n    info:=infos[54];\n    \n    rep:=Representative(o);\n\n    #pr[33]=[0,1,1,1,1,1,0,0]\n    #pr[31]=[1,0,1,1,1,1,0,0]\n    #pr[64]=[1,1,2,2,2,1,1,0]\n    #pr[89]=[1,2,2,4,3,2,1,0]\n    tmp1:=ApplyRootsReflections(rep,[33,31,64,89]);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1],[3,1],[9,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[33,31,64,89]);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1],[3,1],[9,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 51: D_4(a_1)A_2 [2,5,10,11,7,8] in E_8\n#\nhandle51char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[51];\n    info:=infos[51];\n    \n    rep:=Representative(o);\n\n    #pr[23]=[1,1,1,1,0,0,0,0]  asta merge si cu rep=[2,3,10,12,7,8] urmat de ConjNegUa(tmp1,4,1)\n    #pr[24]=[1,0,1,1,1,0,0,0]\n    tmp1:=ApplyRootsReflections(rep,[23,24]);\n    tmp1:=ConjNegUa(tmp1,4,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[5,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[23,24]);\n    tmp2:=ConjNegUa(tmp2,4,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[5,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 50: A_4A_1\n#\nhandle50char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[50];\n    info:=infos[50];\n\n    rep:=Representative(o);\n\n    #pr[41]=[0,1,1,1,1,1,1,0]\n    #pr[39]=[1,0,1,1,1,1,1,0]\n    #pr[57]=[1,1,2,2,2,1,0,0]\n    #pr[89]=[1,2,2,4,3,2,1,0]\n    tmp1:=ApplyRootsReflections(rep,[41,39,57,89]);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1],[3,1],[9,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[41,39,57,89]);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1],[3,1],[9,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 48: D_5(a_1)\n#\nhandle48char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[48];\n    info:=infos[48];\n    \n    rep:=Representative(o);\n\n    #pr[82]=[1,1,2,3,3,2,1,0]\n    #pr[80]=[1,2,2,3,2,2,1,0]\n    tmp1:=ApplyRootsReflections(rep,[82,80]);\n    uu:=Unipotent(chevalleyAdj(rep),[[4,1],[12,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[2,4],[-1,-1,-1,-1]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[82,80]);\n    uu:=Unipotent(chevalleyAdj(cent),[[4,1],[11,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[2,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n\n#\n# cls 47: A_4A_1^2\n#\nhandle47char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[47];\n    info:=infos[47];\n\n    rep:=Representative(o);\n\n    #pr[71]=[1,1,2,2,2,2,1,0]\n    #pr[72]=[1,1,2,2,2,1,1,1]\n    #pr[112]=[1,3,3,5,4,3,2,1]\n    #pr[111]=[2,2,3,5,4,3,2,1]\n    tmp1:=ApplyRootsReflections(rep,[71,72,112,111]);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1],[3,1],[9,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[71,72,112,111]);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1],[3,1],[9,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n# THE COMPONENT GROUP IS GENERATED BY u IN CHARACTERISTIC 2\n#\n# cls 40: D_4A_2 \n#\n#handle40char3:=function(orbs,infos)\n#    local tmp1,tmp2,o,info,rep,cent,uu;\n#    o:=Classes(orbs)[40];\n#    #info:=infos[40];\n#\n#    rep:=Representative(o);\n#\n#    #pr[34]=[0,1,0,1,1,1,1,0]\n#    #pr[35]=[0,0,1,1,1,1,1,0]\n#    #pr[68]=[0,1,1,2,2,2,1,1]\n#    tmp1:=ApplyRootsReflections(rep,[34,35,68]);\n#    uu:=Unipotent(chevalleyAdj(rep),[[8,-1]],Ordering(rep));\n#    tmp1:=Conj(tmp1,uu);\n#    tmp1:=ConjugateByTori(tmp1,[4,6,7,8],[-1,-1,-1,-1]);\n#\n#    tmp2:=0;\n#    #cent:=FromPositiveBorel(o,info[2]);\n#    #tmp2:=ApplyRootsReflections(cent,[36,34,46,61]);\n#    #uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[4,1]],Ordering(cent));\n#    #tmp2:=Conj(tmp2,uu);\n#    #tmp2:=ConjugateByTori(tmp2,[2,3,4],[-1,-1,-1,-1]);\n#    \n#    return [tmp1,tmp2];\n#end;\n\n\n#\n# cls 40: E_6(a_3)\n#\nhandle40char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[40];\n    info:=infos[40];\n    \n    rep:=Representative(o);\n    tmp1:=ConjNegUa(rep,3,1);\n    tmp1:=ConjNegUa(tmp1,2,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[5,1],[6,1],[9,1],[10,1],[17,1],[18,1],[25,1],[26,1],[33,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ConjNegUa(cent,3,1);\n    tmp2:=ConjNegUa(tmp2,2,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[5,1],[6,1],[9,1],[10,1],[17,1],[18,1],[25,1],[26,1],[33,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 35: D_6(a_2) \n#\nhandle35char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[35];\n    info:=infos[35];\n\n    rep:=Representative(o);\n\n    #pr[42]=[0,1,0,1,1,1,1,0]\n    #pr[43]=[0,0,1,1,1,1,1,0]\n    tmp1:=ApplyRootsReflections(rep,[42,43]);\n    uu:=Unipotent(chevalleyAdj(rep),[[4,1],[6,1],[10,1],[13,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[42,43]);\n    uu:=Unipotent(chevalleyAdj(cent),[[4,1],[6,1],[10,1],[13,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 34: E_6(a_3)A_1 \n#\nhandle34char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[34];\n    info:=infos[34];\n    \n    rep:=Representative(o);\n    tmp1:=ConjNegUa(rep,3,1);\n    tmp1:=ConjNegUa(tmp1,2,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[5,1],[6,1],[9,1],[10,1],[17,1],[18,1],[25,1],[26,1],[33,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ConjNegUa(cent,3,1);\n    tmp2:=ConjNegUa(tmp2,2,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[5,1],[6,1],[9,1],[10,1],[17,1],[18,1],[25,1],[26,1],[33,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 33: E_7(a_5)    \n#\nhandle33char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[33];\n    info:=infos[33];\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[2,3,5]);\n    uu:=Unipotent(chevalleyAdj(rep),[[4,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp3:=ConjugateByTori(rep,[2,3,5],[aaa,aaa,aaa]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[2,3,5]);\n    uu:=Unipotent(chevalleyAdj(cent),[[4,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    tmp4:=0;\n    tmp4:=ConjugateByTori(cent,[2,3,5],[aaa,aaa,aaa]);\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n#\n# cls 31: E_8(a_7)       NOT FINISHED IN CHARACTERISTIC 2 !!!! \n#\nhandle31char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent;\n    o:=Classes(orbs)[31];\n    #info:=infos[31];\n    \n    rep:=Representative(o);\n\n    tmp2:=0;\n    #cent:=FromPositiveBorel(o,info[2]);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 30: A_6       NOT FINISHED IN CHARACTERISTIC 2 !!!! \n#\nhandle30char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[30];\n    info:=infos[30];\n    \n    rep:=Representative(o);\n    tmp1:=rep^-1;              # longest words in E7 and E6: n_0*w_0=(17)(36)(45)\n    #uu:=Unipotent(chevalleyAdj(rep),[[3,1],[5,1],[7,1],[10,1],[11,1],[24,1],[25,1]],Ordering(rep)); in E_7\n    uu:=Unipotent(chevalleyAdj(rep),[[3,1],[5,1],[7,1],[11,1],[12,1],[27,1],[28,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);# =[27,28,24,39]\n    tmp2:=coefficients(cent);# =[27,28,24,39]\n    tmp2:=Unipotent(chevalleyAdj(cent),[tmp2[1],tmp2[3],tmp2[2],tmp2[4]],Ordering(cent));# =[27,24,28,39]\n    uu:=Unipotent(chevalleyAdj(cent),[[3,1],[5,1],[7,1],[11,1],[12,1],[27,1],[28,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 29: D_6(a_1) \n#\nhandle29char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[29];\n    info:=infos[29];\n\n    rep:=Representative(o);\n\n    #pr[42]=[0,1,0,1,1,1,1,0]\n    #pr[43]=[0,0,1,1,1,1,1,0]\n    tmp1:=ApplyRootsReflections(rep,[42,43]);\n    uu:=Unipotent(chevalleyAdj(rep),[[4,1],[11,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[3,4],[-1,-1,-1,-1]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[42,43]);\n    uu:=Unipotent(chevalleyAdj(cent),[[4,1],[11,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    #tmp2:=ConjugateByTori(tmp2,[2,3,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n# NO COMPONENT GROUP IN CHARACTERISTIC 2 FOR THIS CLASS\n#\n# cls 27: E_7(a_4)\n#\n#handle27char2:=function(orbs,infos)\n#    local tmp1,tmp2,o,info,rep,cent;\n#    o:=Classes(orbs)[27];\n#    #info:=infos[27];\n#    \n#    rep:=Representative(o);\n#    tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n#\n#    tmp2:=0;\n#    #cent:=FromPositiveBorel(o,info[2]);\n#    #tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n#    \n#    return [tmp1,tmp2];\n#end;\n\n#\n# cls 26: E_6(a_1)\n#\nhandle26char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[26];\n    info:=infos[26];\n\n    #pr[61]=[0,1,1,2,2,2,1]\n    #pr[59]=[1,1,1,2,2,1,1]\n    #pr[58]=[1,1,2,2,1,1,1]\n\n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[58,59,61]);\n    tmp1:=ConjNegUa(tmp1,4,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1],[6,1],[10,1],[11,1],[16,1],[17,1],[23,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[58,59,61]);\n    tmp2:=ConjNegUa(tmp2,4,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1],[6,1],[10,1],[11,1],[16,1],[17,1],[23,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2,uu];\nend;\n\n# THE COMPONENT GROUP IS GENERATED BY u IN CHARACTERISTIC 2\n#\n# cls 24: D_5A_2 \n#\n#handle24char3:=function(orbs,infos)\n#    local tmp1,tmp2,o,info,rep,cent,uu;\n#    o:=Classes(orbs)[24];\n#    #info:=infos[24];\n#\n#    rep:=Representative(o);\n#\n#    #pr[87]=[1,1,2,3,3,2,1,1]\n#    #pr[86]=[1,2,2,3,2,2,1,1]\n#    #pr[119]=[2,3,4,6,5,4,3,1]\n#    tmp1:=ApplyRootsReflections(rep,[87,86,119]);\n#    uu:=Unipotent(chevalleyAdj(rep),[[8,-1]],Ordering(rep));\n#    tmp1:=Conj(tmp1,uu);\n#    tmp1:=ConjugateByTori(tmp1,[1,4,7],[-1,-1,-1,-1,-1]);\n#\n#    tmp2:=0;\n#    #cent:=FromPositiveBorel(o,info[2]);\n#    #tmp2:=ApplyRootsReflections(cent,[36,34,46,61]);\n#    #uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[4,1]],Ordering(cent));\n#    #tmp2:=Conj(tmp2,uu);\n#    #tmp2:=ConjugateByTori(tmp2,[2,3,4],[-1,-1,-1,-1]);\n#    \n#    return [tmp1,tmp2];\n#end;\n\n#\n# cls 21: D_7(a_2)\n#\nhandle21char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[21];\n    info:=infos[21];\n\n    rep:=Representative(o);\n\n    #pr[113]=[2,3,3,5,4,3,2,1]\n    #pr[114]=[0,0,1,1,1,1,1,0]\n    tmp1:=ApplyRootsReflections(rep,[113,114]);\n    uu:=Unipotent(chevalleyAdj(rep),[[4,1],[6,1],[11,1],[13,1],[20,1],[27,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[113,114]);\n    uu:=Unipotent(chevalleyAdj(cent),[[4,1],[6,1],[11,1],[13,1],[20,1],[27,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n#\n# THIS IS FOR THE D_7(a_2) class in E_8 characteristic 2\n#\n#set:=Filtered(subs,i->i<=63);\n#Sort(set);\n#uu:=Unipotent(alg,List(set,i->[i,avars[i]]),Ordering(rep));\n#vals:=ShallowCopy(avars);\n#vals[3]:=-vals[2];\n#vals[4]:=-One(APR);\n#vals[5]:=0;\n#vals[6]:=One(APR);\n#vals[7]:=0;\n#vals[8]:=-vals[3];\n#vals[11]:=-(vals[2]+vals[10]+One(APR));\n#vals[12]:=-vals[3];\n#vals[13]:=-(vals[2]+One(APR));\n#vals[14]:=-vals[8];\n#vals[15]:=-(vals[2]^2+vals[2]);\n#vals[18]:=-(vals[2]^2+vals[2]+vals[17]);\n#vals[19]:=-(vals[2]^2+vals[2]+vals[18]);\n#vals[20]:=-(vals[2]+vals[10]+vals[13]);\n#vals[21]:=-vals[15];\n#vals[22]:=-(vals[2]^2+vals[19]);\n#vals[26]:=-(vals[2]^2+vals[2]*vals[10]+vals[10]^2+vals[2]+vals[10]+vals[17]);\n#vals[27]:=-(vals[2]^2+vals[2]*vals[13]+vals[10]*vals[13]+vals[11]*vals[13]+vals[2]+vals[10]+vals[11]+vals[13]+vals[17]+vals[20]+vals[26]+One(APR));\n#vals[28]:=-vals[19];\n#vals[29]:=-(vals[2]^3+vals[2]^2+vals[17]+vals[25]);\n\n#vals[33]:=-(vals[2]^3+vals[2]^2*vals[10]+vals[2]*vals[10]+vals[2]+vals[17]+vals[32]);\n#vals[34]:=-(vals[2]^3+vals[2]^2+vals[25]+vals[32]);\n#vals[35]:=-(vals[2]^3+vals[2]^2+vals[17]+vals[25]+vals[34]);\n#vals[36]:=-(vals[2]^2*vals[10]+vals[2]^2+vals[2]*vals[10]+vals[2]+vals[29]+vals[34]);\n#vals[41]:=-(vals[2]^2*vals[17]+vals[2]*vals[17]+vals[17]^2+vals[25]);\n#vals[43]:=-(vals[2]^4+vals[2]^2*vals[17]+vals[2]^2+vals[2]*vals[17]+vals[17]+vals[25]+vals[34]+vals[35]+vals[36]+vals[41]+vals[42]);\n#vals[48]:=-(vals[2]^3*vals[10]+vals[2]^3+vals[2]*vals[10]+vals[10]*vals[17]+vals[2]+vals[17]+vals[25]+vals[32]+vals[42]);\n#vals[49]:=-(vals[2]^4+vals[2]^3*vals[10]+vals[2]^2*vals[10]^2+vals[2]^3+vals[2]*vals[10]^2+vals[2]*vals[10]+vals[2]*vals[17]+vals[25]+vals[32]+vals[34]+vals[41]+vals[42]);\n\n#vals[55]:=-(vals[2]^5+vals[2]^4*vals[10]+vals[2]^4+vals[2]^3+vals[2]^2*vals[10]+vals[2]^2+vals[17]^2+vals[17]*vals[25]+vals[25]+vals[50]);\n#vals[61]:=-(vals[2]^5+vals[2]^4*vals[10]+vals[2]^4+vals[2]^3*vals[10]+vals[2]^3*vals[17]+vals[2]^2*vals[10]^2+vals[2]^2*vals[10]*vals[17]+vals[2]^2*vals[17]+vals[2]*vals[10]^2+vals[2]*vals[10]*vals[17]+vals[2]^2+vals[2]*vals[17]+vals[10]*vals[17]+vals[2]+vals[17]+vals[32]+vals[48]+vals[56]);\n#vals[62]:=-(vals[2]^6+vals[2]^4*vals[10]^2+vals[2]^5+vals[2]^4*vals[10]+vals[2]^4*vals[17]+vals[2]^4+vals[2]^2*vals[10]^2+vals[2]^2*vals[10]*vals[17]+vals[2]^2*vals[10]*vals[25]+vals[2]^2*vals[17]^2+vals[2]^3+vals[2]^2*vals[10]+vals[2]^2*vals[25]+vals[2]*vals[10]*vals[17]+vals[2]*vals[10]*vals[25]+vals[17]^3+vals[2]*vals[17]+vals[2]*vals[25]+vals[17]^2+vals[17]*vals[25]+vals[32]^2+vals[25]+vals[50]);\n\n#vv:=Value(uu,avars,vals);\n#vvv:=Value(vv,avars,List(avars,i->0));\n\n\n\n#\n# cls 19: E_6(a_1)A_1\n#\nhandle19char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[19];\n    info:=infos[19];\n\n    #pr[106]=[1,2,2,4,4,3,2,1]\n    #pr[105]=[1,2,3,4,3,3,2,1]\n    #pr[104]=[2,2,3,4,3,2,2,1]\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[106,105,104]);\n    tmp1:=ConjNegUa(tmp1,4,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1],[11,1],[10,1],[6,1],[16,1],[17,1],[23,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[106,105,104]);\n    tmp2:=ConjNegUa(tmp2,4,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1],[11,1],[10,1],[6,1],[16,1],[17,1],[23,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2,uu];\nend;\n\n\n#\n# cls 18: E_7(a_3)\n#\nhandle18char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[18];\n    info:=infos[18];\n    \n    rep:=Representative(o);\n    tmp1:=ConjNegUa(rep,3,1);\n    tmp1:=ConjNegUa(tmp1,2,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[5,1],[18,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ConjNegUa(cent,3,1);\n    tmp2:=ConjNegUa(tmp2,2,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[5,1],[18,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 17: E_8(b_6)\n#\nhandle17char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[17];\n    info:=infos[17];\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[1,2,5]);\n    uu:=Unipotent(chevalleyAdj(rep),[[7,1],[8,1],[18,1],[23,1],[31,1],[39,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp3:=ConjugateByTori(rep,[1,2,5],[aaa,aaa,aaa^2]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[1,2,5]);\n    uu:=Unipotent(chevalleyAdj(cent),[[7,1],[8,1],[18,1],[23,1],[31,1],[39,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    tmp4:=0;\n    tmp4:=ConjugateByTori(cent,[1,2,5],[aaa,aaa,aaa^2]);\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n# THIS WORKS BUT HERE THE COMPONENT GROUP IS GENERATED BY U\n#\n# cls 16: D_7(a_1)\n#\nhandle16char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[16];\n    info:=infos[16];\n\n    rep:=Representative(o);\n\n    #pr[113]=[2,3,3,5,4,3,2,1]\n    #pr[114]=[0,0,1,1,1,1,1,0]\n    tmp1:=ApplyRootsReflections(rep,[113,114]);\n    #uu:=Unipotent(chevalleyAdj(rep),[[4,1],[10,-1]],Ordering(rep)); si asta merge\n    uu:=Unipotent(chevalleyAdj(rep),[[4,1],[11,-1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    #tmp1:=ConjugateByTori(tmp1,[2,3,4],[aaa,aaa,-1]); IN CHAR 2 I DON'T NEED THIS\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[113,114]);\n    uu:=Unipotent(chevalleyAdj(cent),[[4,1],[11,-1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    #tmp2:=ConjugateByTori(tmp2,[2,3,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 12: E_8(a_6) \n#\nhandle12char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[12];\n    info:=infos[12];\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[2,3,8,13]);\n    uu:=Unipotent(chevalleyAdj(rep),[[18,1],[29,1],[31,1],[33,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp3:=ConjugateByTori(rep,[2,3,5,6,8],[aaa,aaa,aaa,aaa,aaa^2]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[2,3,8,13]);\n    uu:=Unipotent(chevalleyAdj(cent),[[18,1],[29,1],[31,1],[33,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    tmp4:=0;\n    tmp4:=ConjugateByTori(cent,[2,3,5,6,8],[aaa,aaa,aaa,aaa,aaa^2]);\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n#\n# cls 10: E_8(b_5)\n#\nhandle10char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[10];\n    info:=infos[10];\n    \n    rep:=Representative(o);\n    tmp1:=ApplyRootsReflections(rep,[1,2,5]);\n    uu:=Unipotent(chevalleyAdj(rep),[[19,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp3:=ConjugateByTori(rep,[1,2,5],[aaa,aaa,aaa^2]);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[1,2,5]);\n    uu:=Unipotent(chevalleyAdj(cent),[[19,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    tmp4:=0;\n    tmp4:=ConjugateByTori(cent,[1,2,5],[aaa,aaa,aaa^2]);\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n#\n# cls 8: E_8(a_5)       NOT FINISHED IN CHARACTERISTIC 2 !!!! \n#\nhandle8char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[8];\n    info:=infos[8];\n    \n    rep:=Representative(o);\n    uu:=Unipotent(chevalleyAdj(rep),[ [ 2, 1 ], [ 3, 1 ], [ 6, 1 ], [ 8, 1 ], [ 21, 1 ], [ 25, 1 ] ],Ordering(rep));\n    tmp1:=Conj(rep,uu);\n\n    uu:=Unipotent(chevalleyAdj(rep),[ [ 1, 1 ], [ 7, 1 ], [ 10, 1 ], [ 12, 1 ], [ 14, 1 ], [ 16, 1 ], [ 19, 1 ], [ 21, 1 ], [ 23, 1 ], [ 25, 1 ], [ 28, 1 ], [ 37, 1 ], [ 44, 1 ], [ 46, 1 ], [ 53, 1 ], [ 55, 1 ], [ 59, 1 ], [ 66, 1 ], [ 67, 1 ], [ 69, 1 ], [ 71, 1 ], [ 74, 1 ], [ 76, 1 ], [ 77, 1 ], [ 81, 1 ], [ 107, 1 ], [ 110, 1 ], [ 114, 1 ], [ 115, 1 ] ],Ordering(rep));\n    tmp3:=Conj(rep,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    uu:=Unipotent(chevalleyAdj(cent),[ [ 2, 1 ], [ 3, 1 ], [ 6, 1 ], [ 8, 1 ], [ 21, 1 ], [ 25, 1 ] ],Ordering(cent));\n    tmp2:=Conj(cent,uu);\n   \n    tmp4:=0;\n    uu:=Unipotent(chevalleyAdj(cent),[ [ 1, 1 ], [ 7, 1 ], [ 10, 1 ], [ 12, 1 ], [ 14, 1 ], [ 16, 1 ], [ 19, 1 ], [ 21, 1 ], [ 23, 1 ], [ 25, 1 ], [ 28, 1 ], [ 37, 1 ], [ 44, 1 ], [ 46, 1 ], [ 53, 1 ], [ 55, 1 ], [ 59, 1 ], [ 66, 1 ], [ 67, 1 ], [ 69, 1 ], [ 71, 1 ], [ 74, 1 ], [ 76, 1 ], [ 77, 1 ], [ 81, 1 ], [ 107, 1 ], [ 110, 1 ], [ 114, 1 ], [ 115, 1 ] ],Ordering(cent));\n    tmp4:=Conj(cent,uu);\n \n    return [tmp1,tmp3,tmp2,tmp4,uu];\nend;\n\n# THE COMPONENT GROUP IS GENERATED BY u IN CHARACTERISTIC 2\n#\n# cls 7: E_8(b_4) [1,4,7,8,14,17,19,26]  this doesn't work in char2 \n#\n#handle7char3:=function(orbs,infos)\n#    local tmp1,tmp2,o,info,rep,cent;\n#    o:=Classes(orbs)[7];\n#    #info:=infos[7];\n#    \n#    rep:=Representative(o);\n#    tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n#\n#    tmp2:=0;\n#    #cent:=FromPositiveBorel(o,info[2]);\n#    #tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n#    \n#    return [tmp1,tmp2];\n#end;\n\n#\n# cls 5: E_8(a_4)       NOT FINISHED IN CHARACTERISTIC 2 !!!!  \n#\nhandle5char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[5];\n    info:=infos[5];\n    \n    rep:=Representative(o);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1],[3,1],[5,1],[7,1]],Ordering(rep));\n    tmp1:=Conj(rep,uu);\n    uu:=Unipotent(chevalleyAdj(rep),[ [ 1, 1 ], [ 4, 1 ], [ 6, 1 ], [ 8, 1 ], [ 11, 1 ], [ 12, 1 ], [ 14, 1 ], [ 16, 1 ], [ 19, 1 ], [ 25, 1 ], [ 27, 1 ], [ 28, 1 ], [ 30, 1 ], [ 31, 1 ], [ 32, 1 ], [ 33, 1 ], [ 35, 1 ], [ 37, 1 ], [ 38, 1 ], [ 39, 1 ], [ 40, 1 ], [ 41, 1 ], [ 45, 1 ], [ 46, 1 ], [ 48, 1 ], [ 49, 1 ], [ 52, 1 ], [ 53, 1 ], [ 59, 1 ], [ 64, 1 ], [ 66, 1 ], [ 67, 1 ], [ 72, 1 ], [ 77, 1 ], [ 80, 1 ], [ 81, 1 ], [ 85, 1 ], [ 98, 1 ], [ 99, 1 ], [ 100, 1 ], [ 102, 1 ], [ 106, 1 ], [ 107, 1 ], [ 110, 1 ], [ 112, 1 ], [ 114, 1 ], [ 115, 1 ], [ 116, 1 ] ],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1],[3,1],[5,1],[7,1]],Ordering(cent));\n    tmp2:=Conj(cent,uu);\n    uu:=Unipotent(chevalleyAdj(cent),[ [ 1, 1 ], [ 4, 1 ], [ 6, 1 ], [ 8, 1 ], [ 11, 1 ], [ 12, 1 ], [ 14, 1 ], [ 16, 1 ], [ 19, 1 ], [ 25, 1 ], [ 27, 1 ], [ 28, 1 ], [ 30, 1 ], [ 31, 1 ], [ 32, 1 ], [ 33, 1 ], [ 35, 1 ], [ 37, 1 ], [ 38, 1 ], [ 39, 1 ], [ 40, 1 ], [ 41, 1 ], [ 45, 1 ], [ 46, 1 ], [ 48, 1 ], [ 49, 1 ], [ 52, 1 ], [ 53, 1 ], [ 59, 1 ], [ 64, 1 ], [ 66, 1 ], [ 67, 1 ], [ 72, 1 ], [ 77, 1 ], [ 80, 1 ], [ 81, 1 ], [ 85, 1 ], [ 98, 1 ], [ 99, 1 ], [ 100, 1 ], [ 102, 1 ], [ 106, 1 ], [ 107, 1 ], [ 110, 1 ], [ 112, 1 ], [ 114, 1 ], [ 115, 1 ], [ 116, 1 ] ],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2,uu];\nend;\n\n#\n# cls 4: E_8(a_3)       NOT FINISHED IN CHARACTERISTIC 2 !!!!  \n#\nhandle4char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[4];\n    info:=infos[4];\n    \n    rep:=Representative(o);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,1],[3,1],[5,1],[19,1]],Ordering(rep));\n    tmp1:=Conj(rep,uu);\n\n    tmp2:=0;\n    cent:=FromPositiveBorel(o,info[2]);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,1],[3,1],[5,1],[19,1]],Ordering(cent));\n    tmp2:=Conj(cent,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n\n\n\n", "meta": {"hexsha": "8699997bc74395c7123feb9e4b80a7bb6799b261", "size": 27514, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/components/E8char2.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/components/E8char2.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/components/E8char2.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 30.5033259424, "max_line_length": 589, "alphanum_fraction": 0.5729810278, "num_tokens": 12097, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6548947425132315, "lm_q2_score": 0.46879062662624377, "lm_q1q2_score": 0.3070085167170104}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\n####################################################\n##\n## NOTE: Chained unparser!\n##\n\n_bitsInt := (bits) -> Sum(List([1..Length(bits)], i -> bits[i]*2^(i-1)));\n\n\n_sklr_unaligned_store := (bits) -> meth(self, o, i, is )\n    local loc0, loc1, offs, p, loffs, mask, l;\n\n    if  IsUnalignedPtrT(o.loc.t) then\n        Error(\"cannot do unaligned store when base pointer is not aligned\");\n    fi;\n\n    loc0 := vtref(o.exp.t, o.loc, idiv(o.offs, bits));\n    loc1 := vtref(o.exp.t, o.loc, idiv(o.offs, bits)+1);\n    offs := _unwrap(o.offs) mod bits;\n    p    := _unwrap(o.p);\n    loffs:= p+offs-bits;\n    mask := (n) -> o.exp.t.value(Replicate(n, 1) :: Replicate(bits-n, 0));\n    l    := Cond(\n                (IsSymbolic(offs) and (p>1)) or (not IsSymbolic(offs) and (offs + p > bits)),\n                          # a0 = a0 xor (( a0 xor (val << offs)) & (mask << offs));\n                          # a1 = (offs + p <= bits) ? a1 :\n                          #          ((a1 >> loffs) << loffs) | ((val & mask) >> bits-offs)\n                        [ assign(loc0, bin_xor(loc0, bin_and(bin_shl(mask(p), offs), bin_xor(loc0, bin_shl(o.exp, offs))))),\n                          assign(loc1, cond(leq(offs + p, bits), loc1, bin_or(bin_shl(bin_shr(loc1, loffs), loffs), bin_shr(bin_and(o.exp, mask(p)), bits-offs))))],\n                p = bits and offs = 0,\n                        [ assign(loc0, o.exp) ],\n                #else\n                        [ assign(loc0, bin_xor(loc0, bin_and(bin_shl(mask(p), offs), bin_xor(loc0, bin_shl(o.exp, offs))))) ]);\n    return Print(Blanks(i), self.infix(ESReduce(l, self.opts), Blanks(i)));\nend;\n\nClass(SKLRBUnparser, SSEUnparser, rec(\n   # none exp must be gone before it reaches unparser\n   noneExp := (self, o, i, is) >> self(o.args[1].zero(), i, is),\n\n   utype := (self, t) >> (ObjId(t) = BitVector or (ObjId(t) = TVect and t.t in  [T_Int(1), T_UInt(1), TInt, TUInt])) \n                         and t.size in [16, 32, 64],\n\n   BitVector := (self, t, vars, i, is) >> self.T_UInt(T_UInt(t.size), vars, i, is),\n\n   Value := (self, o, i, is) >> When( self.utype(o.t), \n        #self(T_UInt(o.t.size).value(_bitsInt(o.v)), i, is), \n        Print(\"0x\", HexStringInt(_bitsInt(o.v)), When(o.t.size=64, \"LL\", \"\")),\n        Inherited(o, i, is)),\n   \n   mul := (self, o, i, is) >> Cond( self.utype(o.t), Print(\"(\", self.infix(o.args, \")&(\"), \")\"), \n                                    # NOTE: HACK HACK 16x8i mul -> binary and \n                                    o.t = TVect(T_Int(8), 16), self( ApplyFunc(bin_and, o.args), i, is ),\n                                    Inherited(o, i, is)),\n   add := (self, o, i, is) >> When( self.utype(o.t), Print(\"(\", self.infix(o.args, \")^(\"), \")\"), Inherited(o, i, is)),\n   sub := ~.add,\n\n   rCyclicShift := (self, o, i, is) >> When( not self.utype(o.t), Inherited(o, i, is),\n                      Cond( o.t.size = 16, self.printf(\"__rotl16($1, $2)\", [o.args[1], o.args[2]]),\n                            o.t.size = 32, self.printf(\"__rotl32($1, $2)\", [o.args[1], o.args[2]]),\n                            o.t.size = 64, self.printf(\"__rotl64($1, $2)\", [o.args[1], o.args[2]]),\n                            Error(\"unsupported size\")\n                      )),\n\n   sklr_bcast_32x1i := (self, o, i, is) >> self.printf(\"$1\", [tcast(o.t, arith_shr(tcast(T_Int(32), bin_shl(o.args[1], 31-o.args[2])), 31))]),\n   sklr_bcast_64x1i := (self, o, i, is) >> self.printf(\"$1\", [tcast(o.t, arith_shr(tcast(T_Int(64), bin_shl(o.args[1], 63-o.args[2])), 63))]),\n\n   sklr_storeu_32x1i := _sklr_unaligned_store(32),\n   sklr_storeu_64x1i := _sklr_unaligned_store(64),\n));\n\nSKLRBUnparser.bin_shl := (self, o, i, is) >> When( self.utype(o.t) or IsOrdT(o.t), \n         self.printf(\"(($1)<<($2))\", [o.args[1], o.args[2]]), \n     # else\n         Inherited(o, i, is));\nSKLRBUnparser.bin_shr := (self, o, i, is) >> Cond( \n       self.utype(o.t) or IsUIntT(o.t), self.printf(\"(($1)>>($2))\", [o.args[1], o.args[2]]), \n       self.utype(o.t) or IsIntT(o.t), \n           Print(\"((\", self.declare(o.t, [], 0, 0), \")(((\", self.declare(When(ObjId(o.t)=T_Int, T_UInt(o.t.params[1]), TUInt), [], 0, 0), \")(\",\n               self(o.args[1], i, is), \"))>>(\", self(o.args[2], i, is), \")))\"), \n       Inherited(o, i, is));\nSKLRBUnparser.arith_shr := (self, o, i, is) >> Cond( \n       IsIntT(o.t), self.printf(\"(($1)>>($2))\", [o.args[1], o.args[2]]), \n       self.utype(o.t) or ObjId(o.t)=T_UInt, \n           Print(\"((\", self.declare(o.t, [], 0, 0), \")(((\", self.declare(T_Int(When(ObjId(o.t)=T_Int,o.t.params[1], o.t.size)), [], 0, 0), \")(\",\n               self(o.args[1], i, is), \"))>>(\", self(o.args[2], i, is), \")))\"), \n       Inherited(o, i, is));\nSKLRBUnparser.bin_and := (self, o, i, is) >> When( self.utype(o.t) or o.t in [T_Int(32), T_UInt(32), T_Int(64), T_UInt(64)], \n       Print(\"((\", self.infix(o.args, \")&(\"), \"))\"), \n       Inherited(o, i, is));\nSKLRBUnparser.bin_xor := (self, o, i, is) >> When( self.utype(o.t) or o.t in [T_Int(32), T_UInt(32), T_Int(64), T_UInt(64)], \n       Print(\"(\", self.infix(o.args, \")^(\"), \")\"), \n       Inherited(o, i, is));\nSKLRBUnparser.bin_or := (self, o, i, is) >> When( self.utype(o.t) or o.t in [T_Int(32), T_UInt(32), T_Int(64), T_UInt(64)], \n       Print(\"(\", self.infix(o.args, \")|(\"), \")\"), \n       Inherited(o, i, is));\nSKLRBUnparser.tcast := (self, o, i, is) >> When( not self.utype(o.t), Inherited(o, i, is), \n       Print(\"((\", self.declare(o.args[1], [], i, is), \")(\", self(o.args[2], i, is), \"))\"));\n\n", "meta": {"hexsha": "6297d34958a34399053686c84ffaf7d5e1ddf52f", "size": 5562, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/platforms/scalar/bitisa/unparse.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/platforms/scalar/bitisa/unparse.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/platforms/scalar/bitisa/unparse.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 53.4807692308, "max_line_length": 164, "alphanum_fraction": 0.5003595829, "num_tokens": 1897, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6477982179521103, "lm_q2_score": 0.47268347662043286, "lm_q1q2_score": 0.3062035138101244}}
{"text": "#\n# cls 40: A_2\n#\nhandle40char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[40];\n    info:=infos[40];\n    \n    rep:=Representative(o);\n    #pr[17]=[0,0,1,1,1,0,0]\n    #pr[15]=[0,1,1,1,0,0,0]\n    #pr[32]=[1,1,1,2,1,0,0]\n    tmp1:=ApplyRootsReflections(rep,[17,15,32]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,1]]);\n    tmp1:=Conj(tmp1,uu);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[17,15,32]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,1]]);\n    tmp2:=Conj(tmp2,uu);\n\n    return [tmp1,tmp2];\nend;\n\n#\n# cls 38: A_2A_1\n#\nhandle38char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[38];\n    info:=infos[38];\n    \n    rep:=Representative(o);\n    #pr[44]=[1,1,1,2,1,1,1]\n    #pr[43]=[1,1,1,2,2,1,0]\n    #pr[62]=[1,2,3,4,3,2,1]\n    tmp1:=ApplyRootsReflections(rep,[44,43,62]);\n    uu:=Unipotent(chevalleyAdj(rep),[[1,-1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[44,43,62]);\n    uu:=Unipotent(chevalleyAdj(cent),[[1,-1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n\n    return [tmp1,tmp2];\nend;\n\n\n#\n# cls 30: D_4(a_1)\n#\nhandle30char2:=function(orbs,infos)\n    local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n    o:=Classes(orbs)[30];\n    info:=infos[30];\n    \n    rep:=Representative(o);\n    #pr[4] =[0,0,0,1,0,0,0]\n    #pr[42]=[1,1,2,2,1,1,0]\n    #pr[43]=[1,1,1,2,2,1,0]\n    tmp1:=ApplyRootsReflections(rep,[4,42,43]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[5,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[4,1,2,6],[-1,-1,-1,-1]);\n\n    #pr[23]=[0,1,0,1,1,1,0]\n    #pr[24]=[0,0,1,1,1,1,0]\n    tmp3:=ApplyRootsReflections(rep,[23,24]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,1],[4,1],[5,-1],[10,1],[11,-1]],Ordering(rep));\n    tmp3:=Conj(tmp3,uu);\n    tmp3:=ConjugateByTori(tmp3,[2,4],[-1,-1,-1,-1]);\n    \n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[4,42,43]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[5,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[4,1,2,6],[-1,-1,-1,-1]);\n\n    tmp4:=ApplyRootsReflections(cent,[23,24]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,1],[4,1],[5,-1],[10,1],[11,-1]],Ordering(cent));\n    tmp4:=Conj(tmp4,uu);\n    tmp4:=ConjugateByTori(tmp4,[2,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n#\n# cls 27: D_4(a_1)A_1 [2,5,9,10,7]\n#\nhandle27char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[27];\n    #o:=orbs;\n    info:=infos[27];\n    #info:=infos;\n    \n    rep:=Representative(o);\n\n    #pr[20]=[1,1,1,1,0,0,0]\n    #pr[21]=[1,0,1,1,1,0,0]\n    tmp1:=ApplyRootsReflections(rep,[20,21]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[4,-1],[5,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[1,4],[-1,-1,-1,-1]);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[20,21]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[4,-1],[5,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[1,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 26: A_3A_2^{(2)} from [1,3,4,6,7,37] we get [31,20,40,30,27,37] has no component group\n#\nhandle26char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[27];\n    #o:=orbs;\n    info:=infos[27];\n    #info:=infos;\n    \n    rep:=Representative(o);\n\n    #pr[20]=[1,1,1,1,0,0,0]\n    #pr[21]=[1,0,1,1,1,0,0]\n    tmp1:=ApplyRootsReflections(rep,[20,21]);\n    uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[4,-1],[5,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[1,4],[-1,-1,-1,-1]);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[20,21]);\n    uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[4,-1],[5,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[1,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n\n##\n## cls 26: A_3A_2 [3,4,2,6,7] (not finished - check it)\n##\n#handle26char3:=function(orbs,infos)\n#    local tmp1,tmp2,o,info,rep,cent,uu;\n#    o:=Classes(orbs)[26];\n#    info:=infos[26];\n#    \n#    rep:=Representative(o);\n#\n#    #pr[23]=[0,1,0,1,1,1,0]\n#    #pr[24]=[0,0,1,1,1,1,0]\n#    #pr[45]=[0,1,1,2,2,1,1]\n#    tmp1:=ApplyRootsReflections(rep,[23,24,45]);\n#    uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[3,1],[6,-1]],Ordering(rep));\n#    tmp1:=Conj(tmp1,uu);\n#    tmp1:=ConjugateByTori(tmp1,[4],[-1]);\n#    \n#    cent:=FromPositiveBorel(o,info[2]);\n#    tmp2:=ApplyRootsReflections(cent,[23,24,45]);\n#    uu:=Unipotent(chevalleyAdj(cent),[[6,-1]],Ordering(cent));\n#    tmp2:=Conj(tmp2,uu);\n#    tmp2:=ConjugateByTori(tmp2,[4],[-1]);\n#    \n#    return [tmp1,tmp2];\n#end;\n\n\n#\n# cls 25: A_4 [1,2,3,4]\n#\nhandle25char3:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[25];\n    info:=infos[25];\n    \n    rep:=Representative(o);\n\n    #pr[29]=[0,1,1,1,1,1,0]\n    #pr[27]=[1,0,1,1,1,1,0]\n    #pr[51]=[1,1,2,2,2,1,1]\n    #pr[61]=[1,2,2,4,3,2,1]\n    tmp1:=ApplyRootsReflections(rep,[29,27,51,61]);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[4,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[1,2,3,4],[-1,-1,-1,-1]);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[29,27,51,61]);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[4,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[1,2,3,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 20: D_5(a_1) (not finished)? cred ca e gata\n#\nhandle20char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[20];\n    info:=infos[20];\n    \n    rep:=Representative(o);\n\n    #pr[59]=[1,1,2,3,3,2,1]\n    #pr[58]=[1,2,2,3,2,2,1]\n    tmp1:=ApplyRootsReflections(rep,[59,58]);\n    uu:=Unipotent(chevalleyAdj(rep),[[4,-1],[11,-1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[1,2,4,5],[-1,-1,-1,-1]);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[59,58]);\n    uu:=Unipotent(chevalleyAdj(cent),[[4,-1],[11,-1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[1,2,4,5],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 21: A_4A_1 \n#\nhandle21char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[21];\n    info:=infos[21];\n    \n    rep:=Representative(o);\n\n    #pr[36]=[0,1,1,1,1,1,1]\n    #pr[34]=[1,0,1,1,1,1,1]\n    #pr[46]=[1,1,2,2,2,1,0]\n    #pr[61]=[1,2,2,4,3,2,1]\n    tmp1:=ApplyRootsReflections(rep,[36,34,46,61]);\n    uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[4,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[1,2,3,4],[-1,-1,-1,-1]);\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[36,34,46,61]);\n    uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[4,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    tmp2:=ConjugateByTori(tmp2,[1,2,3,4],[-1,-1,-1,-1]);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 6: E_6(a_1) (not finished)\n#\nhandle6char3:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[6];\n    info:=infos[6];\n\n    #pr[47]=[1,1,2,2,1,1,1]\n    #pr[48]=[1,1,1,2,2,1,1]\n    #pr[49]=[0,1,1,2,2,2,1]\n\n    rep:=Representative(o);\n    rep:=Unipotent(alg,coefficients(rep),[1..Length(pr)]);#ordered rep\n    tmp1:=ApplyRootsReflections(rep,[47,48,49]);\n    tmp1:=ConjNegUa(tmp1,4,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[1,1],[8,1],[6,-1]],Ordering(rep));# this works for orderd rep\n    tmp1:=Conj(tmp1,uu);\n    tmp1:=ConjugateByTori(tmp1,[3,7],[-1,-1]);\n    tmp1:=Unipotent(chevalleyAdj(rep),coefficients(tmp1),Ordering(Representative(o)));\n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ApplyRootsReflections(cent,[47,48,49]);\n    tmp2:=ConjNegUa(tmp2,4,1);\n    #tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 14: E_6(a_3) for ([1,8,9,11,14,19] in E6) [1,9,10,12,16,22] in E7\n#\nhandle14char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[14];\n    info:=infos[14];\n    \n    rep:=Representative(o);\n    tmp1:=ConjNegUa(rep,3,1);\n    tmp1:=ConjNegUa(tmp1,2,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[5,1],[6,1],[8,1],[9,1],[15,1],[16,1],[22,1],[23,1],[29,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    \n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ConjNegUa(cent,3,1);\n    tmp2:=ConjNegUa(tmp2,2,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[5,1],[6,1],[8,1],[9,1],[15,1],[16,1],[22,1],[23,1],[29,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n\n#\n# cls 4: E_7(a_3) [1,7,9,10,12,16,22] in E7\n#\nhandle4char2:=function(orbs,infos)\n    local tmp1,tmp2,o,info,rep,cent,uu;\n    o:=Classes(orbs)[4];\n    info:=infos[4];\n    \n    rep:=Representative(o);\n    tmp1:=ConjNegUa(rep,3,1);\n    tmp1:=ConjNegUa(tmp1,2,1);\n    uu:=Unipotent(chevalleyAdj(rep),[[5,1],[6,1],[8,1],[9,1],[15,1],[16,1],[22,1],[23,1],[29,1]],Ordering(rep));\n    tmp1:=Conj(tmp1,uu);\n    \n    \n    cent:=FromPositiveBorel(o,info[2]);\n    tmp2:=ConjNegUa(cent,3,1);\n    tmp2:=ConjNegUa(tmp2,2,1);\n    uu:=Unipotent(chevalleyAdj(cent),[[5,1],[6,1],[8,1],[9,1],[15,1],[16,1],[22,1],[23,1],[29,1]],Ordering(cent));\n    tmp2:=Conj(tmp2,uu);\n    \n    return [tmp1,tmp2];\nend;\n", "meta": {"hexsha": "3163df085ac8758ea743e8c0e72bb4de604b62ef", "size": 9401, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/components/E7char2.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/components/E7char2.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/components/E7char2.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 28.2312312312, "max_line_length": 114, "alphanum_fraction": 0.5817466227, "num_tokens": 4041, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6334102636778401, "lm_q2_score": 0.48047867804790706, "lm_q1q2_score": 0.3043401261539049}}
{"text": "\nlocal reps,tori,labels,I,II,ords;\n\nreps:=[[[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1]],              # E_8\n#       [[1,1],[2,1],[10,1],[11,1],[5,1],[6,1],[7,1],[8,1]],            # E_8(a_1)\n       [[1,1],[2,1],[10,1],[11,1],[5,1],[6,1],[7,1],[8,1]],            # E_8(a_1)\n#       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1],[8,1]],          # E_8(a_2)\n       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1],[8,1]],          # E_8(a_2)\n#       [[8,1],[18,1],[7,1],[6,1],[19,1],[1,1],[17,1],[4,1]],           # E_8(a_3)\n       [[7,1],[8,1],[9,1],[10,1],[11,1],[12,1],[13,1],[19,1]],         # E_8(a_3)\n#       [[18,1],[6,1],[19,1],[1,1],[17,1],[21,1],[4,1],[8,1]],          # E_8(a_4)\n       [[9,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[19,1]],       # E_8(a_4)\n       [[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1]],                    # E_7\n#       [[8,1],[7,1],[14,1],[26,1],[19,1],[1,1],[17,1],[4,1]],          # E_8(b_4)\n       [[7,1],[8,1],[9,1],[17,1],[18,1],[19,1],[20,1],[21,1]],         # E_8(b_4)\n#       [[18,1],[22,1],[19,1],[1,1],[17,1],[20,1],[21,1],[4,1],[6,1]],  # E_8(a_5)\n       [[9,1],[14,1],[15,1],[17,1],[18,1],[19,1],[20,1],[26,1]],       # E_8(a_5)\n#       [[1,1],[2,1],[11,1],[10,1],[5,1],[6,1],[7,1]],                  # E_7(a_1)\n       [[1,1],[3,1],[10,1],[11,1],[5,1],[6,1],[7,1]],                  # E_7(a_1)\n#       [[18,1],[8,1],[31,1],[7,1],[33,1],[4,1],[19,1],[23,1]],         # E_8(b_5)\n       [[8,1],[16,1],[17,1],[18,1],[20,1],[21,1],[24,1],[33,1]],       # E_8(b_5)\n       [[8,1],[7,1],[6,1],[5,1],[4,1],[2,1],[3,1]],                    # D_7\n#       [[18,1],[31,1],[7,1],[33,1],[4,1],[29,1],[23,1],[19,1]],        # E_8(a_6)\n       [[4,1],[10,1],[12,1],[14,1],[15,1],[26,1],[27,1],[30,1]],       # E_8(a_6)\n#       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1]],                # E_7(a_2)\n       [[1,1],[2,1],[3,1],[10,1],[12,1],[13,1],[14,1]],                # E_7(a_2)\n       [[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[8,1]],                    # E_6A_1\n\n#      [[2,1],[3,1],[10,1],[12,1],[6,1],[7,1],[8,1],[83,1]],            # (D_7(a_1))^{(2)}    char 2\n#       [[8,1],[7,1],[6,1],[5,1],[10,1],[11,-1],[2,1],[3,1]],            # D_7(a_1)\n       [[2,1],[3,1],[10,1],[12,1],[6,1],[7,1],[8,1]],                   # D_7(a_1)\n#       [[31,1],[33,1],[18,1],[4,1],[39,-1],[41,1],[8,1],[19,1],[23,1]], # E_8(b_6)\n       [[15,1],[22,1],[23,1],[24,1],[25,1],[26,1],[27,1],[28,1]],       # E_8(b_6)\n#       [[17,1],[1,1],[19,1],[6,1],[7,1],[18,1],[4,1]],                  # E_7(a_3)\n       [[1,1],[4,1],[7,1],[12,1],[13,1],[17,1],[19,1]],                 # E_7(a_3)\n#       [[3,1],[5,1],[1,1],[6,1],[11,1],[12,1],[2,1],[8,1]],             # E_6(a_1)A_1\n       [[1,1],[2,1],[11,1],[12,1],[5,1],[6,1],[8,1]],                   # E_6(a_1)+A_1\n#       [[1,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1],[67,1]],             # (A_7)^{(3)}     char 3\n       [[1,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1]],                     # A_7\n#       [[8,1],[7,1],[13,1],[10,1],[11,-1],[12,1],[2,1],[3,1]],          # D_7(a_2)\n       [[2,1],[3,1],[10,1],[12,1],[13,1],[14,1],[8,1]],                 # D_7(a_2)\n       [[1,1],[2,1],[3,1],[4,1],[5,1],[6,1]],                           # E_6\n       [[7,1],[6,1],[5,1],[4,1],[2,1],[3,1]],                           # D_6\n#       [[1,1],[2,1],[3,1],[4,1],[5,1],[7,1],[8,1],[51,1]],             # (D_5+A_2)^{(2)}     char 2\n       [[1,1],[3,1],[4,1],[2,1],[5,1],[7,1],[8,1]],                     # D_5A_2\n#       [[3,1],[5,1],[1,1],[6,1],[11,1],[12,1],[2,1]],                   # E_6(a_1)\n       [[1,1],[2,1],[11,1],[12,1],[5,1],[6,1]],                         # E_6(a_1)\n#       [[17,1],[1,1],[19,1],[14,1],[26,1],[7,1],[18,1],[4,1]],          # E_7(a_4)\n       [[1,1],[4,1],[7,1],[11,1],[25,1],[26,1],[27,1]],                 # E_7(a_4)\n       [[2,1],[4,1],[5,1],[6,1],[7,1],[8,1],[1,1]],                     # A_6A_1\n#       [[7,1],[6,1],[5,1],[10,1],[11,-1],[2,1],[3,1]],                  # D_6(a_1)\n       [[2,1],[3,1],[10,1],[12,1],[6,1],[7,1]],                         # D_6(a_1)\n       [[2,1],[4,1],[5,1],[6,1],[7,1],[8,1]],                           # A_6\n#       [[47,1],[49,1],[5,1],[45,1],[44,1],[42,1],[27,1],[46,1]],        # E_8(a_7)\n       [[30,1],[33,1],[35,1],[36,1],[40,1],[45,1],[53,1],[58,1]],       # E_8(a_7)\n\n       [[1,1],[3,1],[4,1],[2,1],[5,1],[7,1]],                # D_5A_1\n#       [[24,1],[26,1],[7,1],[27,1],[23,1],[4,1],[25,1]],     # E_7(a_5)\n       [[4,1],[11,1],[14,1],[16,1],[24,1],[25,1],[26,1]],    # E_7(a_5)\n#       [[17,1],[1,1],[19,1],[6,1],[18,1],[4,1],[8,1]],       # E_6(a_3)A_1\n       [[4,1],[6,1],[9,1],[11,1],[18,1],[19,1],[8,1]],       # E_6(a_3)+A_1\n#       [[7,1],[13,1],[10,1],[11,-1],[12,1],[2,1],[3,1]],     # D_6(a_2)\n       [[2,1],[3,1],[10,1],[12,1],[13,1],[14,1]],            # D_6(a_2)\n#       [[1,1],[3,1],[10,1],[12,1],[2,1],[5,1],[7,1],[8,1]],  # D_5(a_1)A_2\n       [[1,1],[10,1],[11,1],[2,1],[5,1],[7,1],[8,1]],        # D_5(a_1)+A_2\n       [[2,1],[4,1],[5,1],[6,1],[7,1],[1,1]],                # A_5A_1\n       [[1,1],[3,1],[4,1],[2,1],[6,1],[7,1],[8,1]],          # A_4A_3\n       [[1,1],[3,1],[4,1],[2,1],[5,1]],                      # D_5\n#       [[17,1],[1,1],[19,1],[6,1],[18,1],[4,1]],             # E_6(a_3)\n       [[4,1],[6,1],[9,1],[11,1],[18,1],[19,1]],             # E_6(a_3)\n#       [[2,1],[3,1],[4,1],[5,1],[7,1],[8,1],[63,1]],        # (D_4+A_2)^{(2)}     char 2\n       [[3,1],[4,1],[2,1],[5,1],[7,1],[8,1]],                # D_4A_2\n       [[5,1],[6,1],[7,1],[8,1],[1,1],[3,1],[2,1]],          # A_4A_2A_1\n#       [[1,1],[3,1],[10,1],[12,1],[2,1],[5,1],[7,1]],        # D_5(a_1)A_1\n       [[1,1],[10,1],[11,1],[2,1],[5,1],[7,1]],              # D_5(a_1)+A_1\n       [[1,1],[3,1],[4,1],[5,1],[6,1]],                      # A_5\n       [[1,1],[3,1],[4,1],[2,1],[6,1],[7,1]],                # A_4A_2\n       [[1,1],[3,1],[4,1],[2,1],[6,1],[8,1]],                # A_4A_1^2\n#       [[1,1],[3,1],[10,1],[12,1],[2,1],[5,1]],              # D_5(a_1)\n       [[1,1],[10,1],[11,1],[2,1],[5,1]],                    # D_5(a_1)\n\n       [[1,1],[3,1],[4,1],[6,1],[7,1],[8,1]],          # A_3^2\n       [[1,1],[3,1],[4,1],[2,1],[6,1]],                # A_4A_1\n#       [[3,1],[10,1],[12,1],[2,1],[5,1],[7,1],[8,1]],  # D_4(a_1)A_2\n       [[2,1],[3,1],[10,1],[12,1],[7,1],[8,1]],        # D_4(a_1)+A_2\n       [[3,1],[4,1],[2,1],[5,1],[7,1]],                # D_4A_1\n       [[5,1],[6,1],[7,1],[1,1],[3,1],[2,1]],          # A_3A_2A_1\n       [[1,1],[3,1],[4,1],[2,1]],                      # A_4\n#       [[1,1],[3,1],[4,1],[6,1],[7,1],[44,1]],        # (A_3+A_2)^{(2)}     char 2\n       [[3,1],[4,1],[2,1],[6,1],[7,1]],                # A_3A_2\n#       [[3,1],[10,1],[12,1],[2,1],[5,1],[7,1]],        # D_4(a_1)A_1\n       [[2,1],[3,1],[10,1],[12,1],[7,1]],              # D_4(a_1)+A_1\n       [[5,1],[6,1],[7,1],[2,1],[3,1]],                # A_3A_1^2\n       [[1,1],[3,1],[5,1],[6,1],[2,1],[8,1]],          # A_2^2A_1^2\n       [[3,1],[4,1],[2,1],[5,1]],                      # D_4\n#       [[3,1],[10,1],[12,1],[2,1],[5,1]],              # D_4(a_1)\n       [[2,1],[3,1],[10,1],[12,1]],                    # D_4(a_1)\n       [[1,1],[3,1],[4,1],[6,1]],                      # A_3A_1\n       [[1,1],[3,1],[5,1],[6,1],[2,1]],                # A_2^2A_1\n       [[1,1],[3,1],[5,1],[6,1]],                      # A_2^2\n       [[1,1],[3,1],[2,1],[5,1],[7,1]],                # A_2A_1^3\n       [[1,1],[3,1],[4,1]],                            # A_3\n       [[2,1],[4,1],[1,1],[6,1]],                      # A_2A_1^2\n       [[1,1],[3,1],[2,1]],                            # A_2A_1\n       [[2,1],[3,1],[5,1],[7,1]],                      # A_1^4\n       [[1,1],[3,1]],                                  # A_2\n       [[1,1],[4,1],[6,1]],                            # A_1^3\n       [[1,1],[6,1]],                                  # A_1^2\n       [[1,1]]                                         # A_1\n       ];\n\n\nI:=[[],\n    [4],           #??? E_8(a_1)\n    [4,6],         #??? E_8(a_2)\n    [2,3,5],       # E_8(a_3)\n    [2,3,5,7],     # E_8(a_4)\n    [],            # E_7\n    [2,3,5,6],     # E_8(b_4)\n    [2,3,5,6,8],   # E_8(a_5)\n    [4],           # E_7(a_1)\n    [1,2,3,5,6],   # E_8(b_5)\n    [],            # D_7\n    [1,2,3,5,6,8], # E_8(a_6)\n    [4,6],         #??? E_7(a_2)\n    [],            # E_6A_1\n\n#    [4],             # (D_7(a_1))^{(2)}     char 2\n    [4],             # D_7(a_1)\n    [1,2,3,5,6,7],   # E_8(b_6)\n    [2,3,5],         # E_7(a_3)\n    [4],             # E_6(a_1)A_1\n#    [],              # (A_7)^{(3)}     char 3\n    [],              # A_7\n    [4,5],           #??? D_7(a_2)\n    [],              # E_6\n    [],              # D_6\n#    [],              # (D_5+A_2)^{(2)}     char 2\n    [],              # D_5A_2 \n    [4],             # E_6(a_1)\n    [2,3,5,6],       # E_7(a_4)\n    [],              # A_6A_1\n    [4],             # D_6(a_1)\n    [],              # A_6\n    [1,2,3,4,6,7,8], # E_8(a_7)\n    \n    [],          # D_5A_1\n    [1,2,3,5,6], # E_7(a_5)\n    [2,3,5],     # E_6(a_3)A_1\n    [4,5],       #??? D_6(a_2)\n    [4],         # D_5(a_1)A_2 \n    [],          # A_5A_1\n    [],          # A_4A_3\n    [],          # D_5\n    [2,3,5],     # E_6(a_3)\n#    [],          # (D_4+A_2)^{(2)}     char 2\n    [],          # D_4A_2\n    [],          # A_4A_2A_1\n    [4],         # D_5(a_1)A_1 \n    [],          # A_5\n    [],          # A_4A_2\n    [],          # A_4A_1\n    [4],         # D_5(a_1) check this also\n    \n    [],  # A_3^2\n    [],  # A_4A_1\n    [4], # D_4(a_1)A_2\n    [],  # D_4A_1\n    [],  # A_3A_2A_1\n    [],  # A_4\n#    [],  # (A_3+A_2)^{(2)}     char 2\n    [],  # A_3A_2\n    [4], # D_4(a_1)A_1\n    [],  # A_3A_1^2\n    [],  # A_2^2A_1^2\n    [],  # D_4\n    [4], # D_4(a_1)\n    [],  # A_3A_1\n    [],  # A_2^2A_1\n    [],  # A_2^2\n    [],  # A_2A_1^3\n    [],  # A_3\n    [],  # A_2A_1^2\n    [],  # A_2A_1\n    [],  # A_1^4\n    [],  # A_2\n    [],  # A_1^3\n    [],  # A_1^2\n    []   # A_1\n    ];\n\n\n#\n# The parabolic where the representative is distinguished\n#\nII:=[[1,2,3,4,5,6,7,8], # E_8\n     [1,2,3,4,5,6,7,8], # E_8(a_1)\n     [1,2,3,4,5,6,7,8], # E_8(a_2)\n     [1,2,3,4,5,6,7,8], # E_8(a_3)\n     [1,2,3,4,5,6,7,8], # E_8(a_4)\n     [1,2,3,4,5,6,7],   # E_7\n     [1,2,3,4,5,6,7,8], # E_8(b_4)\n     [1,2,3,4,5,6,7,8], # E_8(a_5)\n     [1,2,3,4,5,6,7],   # E_7(a_1)\n     [1,2,3,4,5,6,7,8], # E_8(b_5)\n     [2,3,4,5,6,7,8],   # D_7\n     [1,2,3,4,5,6,7,8], # E_8(a_6)\n     [1,2,3,4,5,6,7],   # E_7(a_2)\n     [1,2,3,4,5,6,8],   # E_6A_1\n\n#     [2,3,4,5,6,7,8],   # D_7(a_1)^{(2)}     char 2\n     [2,3,4,5,6,7,8],   # D_7(a_1)\n     [1,2,3,4,5,6,7,8], # E_8(b_6)\n     [1,2,3,4,5,6,7],   # E_7(a_3)\n     [1,2,3,4,5,6,8],   # E_6(a_1)A_1\n#     [1,3,4,5,6,7,8],   # A_7^{(3)}     char 3\n     [1,3,4,5,6,7,8],   # A_7\n     [2,3,4,5,6,7,8],   # D_7(a_2)\n     [1,2,3,4,5,6],     # E_6\n     [2,3,4,5,6,7],     # D_6\n#     [1,2,3,4,5,7,8],   # D_5A_2^{(2)}     char 2\n     [1,2,3,4,5,7,8],   # D_5A_2\n     [1,2,3,4,5,6],     # E_6(a_1)\n     [1,2,3,4,5,6,7],   # E_7(a_4)\n     [1,2,4,5,6,7,8],   # A_6A_1\n     [2,3,4,5,6,7],     # D_6(a_1)\n     [2,4,5,6,7,8],     # A_6\n     [1,2,3,4,5,6,7,8], # E_8(a_7)\n\n     [1,2,3,4,5,7],   # D_5A_1\n     [1,2,3,4,5,6,7], # E_7(a_5)\n     [1,2,3,4,5,6,8], # E_6(a_3)A_1\n     [2,3,4,5,6,7],   # D_6(a_2)\n     [1,2,3,4,5,7,8], # D_5(a_1)A_2\n     [1,2,4,5,6,7],   # A_5A_1\n     [1,2,3,4,6,7,8], # A_4A_3\n     [1,2,3,4,5],     # D_5\n     [1,2,3,4,5,6],   # E_6(a_3)\n#     [2,3,4,5,7,8],   # D_4A_2^{(2)}     char 2\n     [2,3,4,5,7,8],   # D_4A_2\n     [1,2,3,5,6,7,8], # A_4A_2A_1\n     [1,2,3,4,5,7],   # D_5(a_1)A_1\n     [1,3,4,5,6],     # A_5\n     [1,2,3,4,6,7],   # A_4A_2\n     [1,2,3,4,6,8],   # A_4A_1^2\n     [1,2,3,4,5],     # D_5(a_1)\n\n     [1,3,4,6,7,8], # A_3^2\n     [1,2,3,4,6],   # A_4A_1\n     [2,3,4,5,7,8], # D_4(a_1)A_2\n     [2,3,4,5,7],   # D_4A_1\n     [1,2,3,5,6,7], # A_3A_2A_1\n     [1,2,3,4],     # A_4\n#     [2,3,4,6,7],   # A_3A_2^{(2)}     char 2\n     [2,3,4,6,7],   # A_3A_2\n     [2,3,4,5,7],   # D_4(a_1)A_1\n     [2,3,5,6,7],   # A_3A_1^2\n     [1,2,3,5,6,8], # A_2^2A_1^2\n     [2,3,4,5],     # D_4\n     [2,3,4,5],     # D_4(a_1)\n     [1,3,4,6],     # A_3A_1\n     [1,2,3,5,6],   # A_2^2A_1\n     [1,3,5,6],     # A_2^2\n     [1,2,3,5,7],   # A_2A_1^3\n     [1,3,4],       # A_3\n     [1,2,4,6],     # A_2A_1^2\n     [1,2,3],       # A_2A_1\n     [2,3,5,7],     # A_1^2\n     [1,3],         # A_2\n     [1,4,6],       # A_1^3\n     [1,6],         # A_1^2\n     [1]            # A_1\n     ];\n     \n\nlabels:=[\"E_8\",\n         \"E_8(a_1)\",\n         \"E_8(a_2)\",\n         \"E_8(a_3)\",\n         \"E_8(a_4)\",\n         \"E_7\",\n         \"E_8(b_4)\",\n         \"E_8(a_5)\",\n         \"E_7(a_1)\",\n         \"E_8(b_5)\",\n         \"D_7\",\n         \"E_8(a_6)\",\n         \"E_7(a_2)\",\n         \"E_6A_1\",\n\n#         \"D_7(a_1)^{(2)}\",\n         \"D_7(a_1)\",\n         \"E_8(b_6)\",\n         \"E_7(a_3)\",\n         \"E_6(a_1)A_1\",\n#         \"A_7^{(3)}\",\n         \"A_7\",\n         \"D_7(a_2)\",\n         \"E_6\",\n         \"D_6\",\n#         \"D_5A_2^{(2)}\",\n         \"D_5A_2\",\n         \"E_6(a_1)\",\n         \"E_7(a_4)\",\n         \"A_6A_1\",\n         \"D_6(a_1)\",\n         \"A_6\",\n         \"E_8(a_7)\",\n         \n         \"D_5A_1\",\n         \"E_7(a_5)\",\n         \"E_6(a_3)A_1\",\n         \"D_6(a_2)\",\n         \"D_5(a_1)A_2\",\n         \"A_5A_2\",\n         \"A_4A_3\",\n         \"D_5\",\n         \"E_6(a_3)\",\n#         \"D_4A_2^{(2)}\",\n         \"D_4A_2\",\n         \"A_4A_2A_1\",\n         \"D_5(a_1)A_1\",\n         \"A_5\",\n         \"A_4A_2\",\n         \"A_4A_1^2\",\n         \"D_5(a_1)\",\n         \n         \"A_3^2\",\n         \"A_4A_1\",\n         \"D_4(a_1)A_2\",\n         \"D_4A_1\",\n         \"A_3A_2A_1\",\n         \"A_4\",\n#         \"A_3A_2^{(2)}\",\n         \"A_3A_2\",\n         \"D_4(a_1)A_1\",\n         \"A_3A_1^2\",\n         \"A_2^2A_1^2\",\n         \"D_4\",\n         \"D_4(a_1)\",\n         \"A_3A_1\",\n         \"A_2^2A_1\",\n         \"A_2^2\",\n         \"A_2A_1^3\",\n         \"A_3\",\n         \"A_2A_1^2\",\n         \"A_2A_1\",\n         \"A_1^4\",\n         \"A_2\",\n         \"A_1^3\",\n         \"A_1^2\",\n         \"A_1\"\n         ];\n\ntori:=[\n    [2,2,2,2,2,2,2,2],   # E_8\n    [2,2,2,0,2,2,2,2],   # E_8(a_1)\n    [2,2,2,0,2,0,2,2],   # E_8(a_2)\n    [2,0,0,2,0,2,2,2],   # E_8(a_3)\n    [2,0,0,2,0,2,0,2],   # E_8(a_4)\n    [2,2,2,2,2,2,2,-27], # E_7\n    [2,0,0,2,0,0,2,2],   # E_8(b_4)\n    [2,0,0,2,0,0,2,0],   # E_8(a_5)\n    [2,2,2,0,2,2,2,-21], # E_7(a_1)\n    [0,0,0,2,0,0,2,2],   # E_8(b_5)\n    [-21,2,2,2,2,2,2,2], # D_7\n    [0,0,0,2,0,0,2,0],   # E_8(a_6)\n    [2,2,2,0,2,0,2,-17], # E_7(a_2)\n    [2,2,2,2,2,2,-17,2], # E_6A_1\n\n#    [-16,2,0,2,2,2,2,2],   # D_7(a_1)^{(2)}     char 2\n    [-16,2,0,2,2,2,2,2],   # D_7(a_1)\n    [0,0,0,2,0,0,0,2],     # E_8(b_6)\n    [2,0,0,2,0,2,2,-15],   # E_7(a_3)\n    [2,2,2,0,2,2,-13,2],   # E_6(a_1)A_1\n#    [2,-15,2,2,2,2,2,2],   # A_7^{(3)}     char 4\n    [2,-15,2,2,2,2,2,2],   # A_7\n    [-13,2,2,0,2,0,2,2],   # D_7(a_2)\n    [2,2,2,2,2,2,-16,0],   # E_6\n    [-15,2,2,2,2,2,2,-10], # D_6\n#    [2,2,2,2,2,-12,2,2],   # D_5A_2^{(2)}     char 2\n    [2,2,2,2,2,-12,2,2],   # D_5A_2\n    [2,2,2,0,2,2,-12,0],   # E_6(a_1)\n    [2,0,0,2,0,0,2,-11],   # E_7(a_4)\n    [2,2,-11,2,2,2,2,2],   # A_6(a_1)\n    [-11,2,2,0,2,2,2,-8],  # D_6(a_1)\n    [0,2,-10,2,2,2,2,2],   # A_6\n    [0,0,0,0,2,0,0,0],     # E_8(a_7)\n\n    [2,2,2,2,2,-11,2,-1], # D_5A_1\n    [0,0,0,2,0,0,2,-9],   # E_7(a_5)\n    [2,0,0,2,0,2,-9,2],   # E_6(a_3)A_1\n    [-9,2,2,0,2,0,2,-6],  # D_6(a_2)\n    [2,2,2,0,2,-9,2,2],   # D_5(a_1)A_2\n    [2,2,-9,2,2,2,2,-5],  # A_5A_1\n    [2,2,2,2,-9,2,2,2],   # A_4A_3\n    [2,2,2,2,2,-10,0,0],  # D_5\n    [2,0,0,2,0,2,-8,0],   # E_6(a_3)\n#    [-6,2,2,2,2,-8,2,2],  # D_4A_2^{(2)}     char 2\n    [-6,2,2,2,2,-8,2,2],  # D_4A_2\n    [2,2,2,-7,2,2,2,2],   # A_4A_2A_1\n    [2,2,2,0,2,-8,2,-1],  # D_5(a_1)A_1\n    [2,-9,2,2,2,2,-5,0],  # A_5\n    [2,2,2,2,-8,2,2,-2],  # A_4A_2\n    [2,2,2,2,-7,2,-2,2],  # A_4A_1^2\n    [2,2,2,0,2,7,0,0],    # D_5(a_1)\n\n    [2,-3,2,2,-6,2,2,2],   # A_3^2\n    [2,2,2,2,-7,2,-1,0],   # A_4A_1\n    [-4,2,2,0,2,-6,2,2],   # D_4(a_1)A_2\n    [-6,2,2,2,2,-7,2,-1],  # D_4A_1\n    [2,2,2,-6,2,2,2,-3],   # A_3A_2A_1\n    [2,2,2,2,-6,0,0,0],    # A_4\n#    [-3,2,2,2,-6,2,2,-2],  # A_3A_2^{(2)}     char 2\n    [-3,2,2,2,-6,2,2,-2],  # A_3A_2\n    [-4,2,2,0,2,-5,2,-1],  # D_4(a_1)A_1\n    [-1,2,2,-5,2,2,2,-3],  # A_3A_1^2\n    [2,2,2,-5,2,2,-3,2],   # A_2^2A_1^2\n    [-6,2,2,2,2,-6,0,0],   # D_4\n    [-4,2,2,0,2,-4,0,0],   # D_4(a_1)\n    [2,-3,2,2,-4,2,-1,0],  # A_3A_1\n    [2,2,2,-5,2,2,-2,0],   # A_2^2A_1\n    [2,0,2,-4,2,2,-2,0],   # A_2^2\n    [2,2,2,-4,2,-2,2,-1],  # A_2A_1^3\n    [2,-3,2,2,-3,0,0,0],   # A_3\n    [2,2,-3,2,-3,2,-1,0],  # A_2A_1^2\n    [2,2,2,-3,0,0,0,0],    # A_2A_1\n    [-1,2,2,-3,2,-2,2,-1], # A_1^4\n    [2,2,0,-2,0,0,0,0],    # A_2\n    [2,-1,-2,2,-2,2,-1,0], # A_1^3\n    [2,0,-1,0,-1,2,-1,0],  # A_1^2\n    [2,0,-1,0,0,0,0,0]     # A_1\n    ];\n\nords:=[];\n\nreturn [reps,tori,labels,I,II,ords];\n", "meta": {"hexsha": "117c9fcdee4743dbadaaf5d7b099c93d2449690d", "size": 16770, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/data/dataE8Mix.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/data/dataE8Mix.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/data/dataE8Mix.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 38.2876712329, "max_line_length": 100, "alphanum_fraction": 0.311627907, "num_tokens": 9379, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.7279754489059774, "lm_q2_score": 0.41489884579676883, "lm_q1q2_score": 0.3020361735194747}}
{"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\n# PR(<dom>, <m>, <n>, <j>) - scatter function for our older PRDFT agorithm,\n#                            still used in PRDFT rule for Circulant\nClass(PR, FuncClass, rec(\n    def := (dom,m,n,j) -> rec(N := approx.FloorRat(m*n/2)+1, n := dom),\n    lambda := self >> let(\n        m := self.params[2], n := self.params[3], j := self.params[4],\n        i := Ind(self.params[1]),\n        Lambda(i, cond(leq(i, approx.CeilingRat(m/2)-1), i*n + j, m*n - i*n - j)))\n));\n\n#####################\n# Matrices\n#####################\n\nClass(BotHalf, Sym, rec(\n    def := (m, conj) -> let(mc := idiv(m+1, 2), mf := idiv(m, 2),\n    DirectSum(I(2*mc), Tensor(I(mf), conj)))\n));\nClass(TopHalf, Sym, rec(\n    def := (m, conj) -> let(mc := idiv(m+1, 2), mf := idiv(m, 2),\n    DirectSum(Tensor(I(mc), conj), I(2*mf)))\n));\n\nClass(BHD, DiagFunc, rec(\n    def := (m, e0, e1) -> Checked(IsPosIntSym(m), rec(size := 2*m)),\n    domain := self >> 2*self.params[1],\n    range := self >> TReal,\n    lambda := self >> let(\n\tm := self.params[1], mc := idiv(m+1, 2), mf := idiv(m, 2),\n\te0:=self.params[2], e1:=self.params[3], i := Ind(2*m),\n\tLambda(i, cond(leq(i, 2*mc-1), 1.0, cond(neq(imod(i,2),0), e1, e0))))\n));\n\nClass(BHN, DiagFunc, rec(\n    def := (m) -> Checked(IsPosIntSym(m), rec(size := m)),\n    domain := self >> self.params[1],\n    range := self >> TReal,\n    lambda := self >> let(\n    m := self.params[1], mc := idiv(m+1, 2), i := Ind(m),\n    Lambda(i, cond(leq(i, mc-1), 1, -1)))\n));\n\nClass(HTwid, Sym, rec(\n    def := (N, n, k, a, b, i, hconj_mat) -> let(\n    na := Numerator(a),   nb := Numerator(b),\n    da := Denominator(a), db := Denominator(b),\n    w := Global.Conjugate(E(N*da*db)^k),\n    DirectSum(List([0..n-1],\n        j -> hconj_mat * Mat(RealMatComplexMat([[w ^ ((i*da+na)*(j*db+nb))]])) )))\n));\n\nX13 := (n,blk) -> DirectSum(I(1), Tensor(I(n-1), blk)) ^ (Z(2*n-1,-1)*LIJ(2*n-1));\nSymSplit1 := n -> DirectSum(I(n+1), J(n-1)) * DirectSum(I(1), X13(n,F(2)));\nSymSplit3 := n -> IJ(2*n,n)   * DirectSum(I(1), X13(n,J(2)*F(2)));\n\nX24 := (n,blk) -> Tensor(blk, I(n)) * IJ(2*n,n);\nSymSplit2 := n -> X24(n,F(2));\nSymSplit4 := n -> X24(n,J(2)*F(2));\n\nrpdiag := p -> Tensor(pdiag(Int(p/2)+1), I(2));\nrperm_ev := p -> Tensor(J((p+1)/2), Diag(1,-1));\nrperm_od := p -> Tensor(J((p+1)/2), Diag(-1,1));\n\n\n# YSV: Many rules below turned out to be invalid for odd stride in H, so I added guards\n#\nRewriteRules(RulesFuncSimp, rec(\n BHD_Stride_fId := ARule(fCompose,\n     [ [BHD, @(1),@(2),@(3)], [fTensor, [H,@,@(4),@,@.cond(e->IsEvenInt(e) and e>1)], [fId, 2]] ],\n     e -> [BHD(@(4).val, @(2).val, @(3).val)] ),\n\n BHD_HH_fId := ARule(fCompose,\n     [ [BHD, @(1),@(2),@(3)], [fTensor, [HH,@,@(4),_0,[ListClass, @.cond(e->IsEvenInt(e) and e>1), _1]], [fId, 2]] ],\n     e -> [BHD(@(4).val, @(2).val, @(3).val)] ),\n\n BHD_Stride_H := ARule(fCompose,\n     [ [BHD, @(1),@(2),@(3)], [fTensor, [H,@,@(4),@,@.cond(e->IsEvenInt(e) and e>1)], [H,2,2,0,1]] ],\n     e -> [BHD(@(4).val, @(2).val, @(3).val)] ),\n\n BHN_H := ARule(fCompose,\n     [ BHN, [@(1,H),@,@,@, @.cond(e->IsEvenInt(e) and e>1)] ],\n     e -> [BHN(@(1).val.domain())] ),\n\n# ******* TOGGLE THIS RULE\n # NOTE: IsSymbolic in the condition is dangerous! this rule is not valid if stride is odd.\n #        which is precisely what happens with ASPF_CT1Odd_RFT rule, but this rule is still needed for DCTs\n# BHN_HH := ARule(fCompose,\n#     [ BHN, [@(1,HH),@,@,_0,[ListClass, @.cond(e->IsSymbolic(e) or (IsEvenInt(e) and e>1)), _1]] ], # vector stride = 1 means stride <> 1\n#     e -> [BHN(@(1).val.domain())] ),\n##############\n\n# NOTE: breaks for odd sizes -> guard\n BHN_fTensor := ARule(fCompose,\n     [ BHN, [@(1, fTensor), @(2,fId,e->IsEvenInt(e.range())), @(3,fBase,e->IsEvenInt(e.range()))] ],\n     e -> [BHN(@(1).val.domain())] ),\n\n BHD_fTensor := ARule(fCompose,\n     [ @(0,BHD), [@(1, fTensor), @(2,fId,e->IsEvenInt(e.range())), @(3,fBase,e->IsEvenInt(e.range())), [fId, 2]] ],\n     e -> [BHD(@(2).val.params[1], @(0).val.params[2], @(0).val.params[3])] ),\n\n ## BH o H -> BH\n BH_H := ARule(fCompose, [ [@(1,BH), @N, @r, @n, @b, @s], [H, @n, @m, @bb, @(2).cond(e->e>1 and IsEvenInt(e))] ],\n     (e, cx) -> [ BH(@N.val, @r.val, @m.val,\n                 memo(cx, \"g\", @b.val + @s.val * @bb.val), # new base\n             @s.val * @(2).val) ]),                     # new stride\n\n ## H o BH -> BH\n H_BH := ARule(fCompose, [ [H, @N, @n, @b, @(2).cond(e->e>1)], [@(1,BH), @n, @r, @m, @bb, @ss] ],\n     (e, cx) -> [ When(@b.val<>0, H(@N.val,@N.val,@b.val, 1), fId(@N.val)),\n              BH(@N.val, @r.val * @(2).val, @m.val,\n                 memo(cx, \"g\", @(2).val * @bb.val), # new base\n             @(2).val * @ss.val) ]),            # new stride\n\n));\n", "meta": {"hexsha": "3ee80725e05c8a49cd40ae0cabe47f2f44aa21c4", "size": 4757, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/transforms/realdft/symbols.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/transforms/realdft/symbols.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/transforms/realdft/symbols.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 39.6416666667, "max_line_length": 138, "alphanum_fraction": 0.5028379231, "num_tokens": 1821, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.5544704649604273, "lm_q2_score": 0.5428632831725052, "lm_q1q2_score": 0.30100165703060305}}