From 7972ba2cfb8e1889f9933cc4cc0bb020a812da98 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 9 Jul 2026 15:35:25 +0200 Subject: [PATCH] Delete some code we really don't need anymore --- contrib/pete/basics.g | 177 ------------- contrib/pete/bbdecs.g | 506 ------------------------------------- contrib/tensor19.tex | 263 ------------------- misc/obsolete/shortorbs.gi | 351 ------------------------- misc/work/DOWORK | 10 - misc/work/TIMINGS | 44 ---- 6 files changed, 1351 deletions(-) delete mode 100644 contrib/pete/basics.g delete mode 100644 contrib/pete/bbdecs.g delete mode 100644 contrib/tensor19.tex delete mode 100644 misc/obsolete/shortorbs.gi delete mode 100644 misc/work/DOWORK delete mode 100644 misc/work/TIMINGS diff --git a/contrib/pete/basics.g b/contrib/pete/basics.g deleted file mode 100644 index 6c878b4b3..000000000 --- a/contrib/pete/basics.g +++ /dev/null @@ -1,177 +0,0 @@ -#################################################################### -## INPUT: -## (1) (black box with Order oracle) group -## (2) involution of -## OUTPUT: list of one or two elements commuting with -ElementsCommutingWithInvolution := function(gp, i) -local g, y, o, m; - g := PseudoRandom(gp); - y := Comm(i, g); - o := Order(y); - m := (o - o mod 2)/2; - if o mod 2 = 0 then -return [Comm(i, g)^m, Comm(i, g^-1)^m]; - else -return [g*Comm(i, g)^m]; - fi; -end; - -########################################################## -## INPUT: matrix -## OUTPUT: iff is -IsScalarMatrix := function(mat); -return mat[1][1]*mat^0 = mat; -end; - -########################################################## -## INPUT: -## (1) (black box) group -## (2) element supergroup of -## OUTPUT: iff is centralised by -IsCentralisedBy := function(gp, x) -local central, y; - central := true; - for y in GeneratorsOfGroup(gp) do - central := central and IsOne(Comm(x, y)); - od; -return central; -end; - -######################################################################### -## -#F InvolutionCentraliser( , , , , ) -## -## black box "Bray trick" for computing involution centralisers -## is the number of (distinct) gens prescribed by the user before -## the algorithm cuts off; is the number of random choices the -## algorithm will make before reporting failure; is the representation -## of (either "wb" or "bb") -InvolutionCentraliser := function(gp, i, Nrgens, limit, rep) -local cgens, n, gens; - cgens := [i]; - n := 0; - while n < limit and Length(cgens) < Nrgens do - n := n+1; - gens := ElementsCommutingWithInvolution(gp, i); - if rep = "wb" then - gens := Filtered(gens, x->not IsScalarMatrix(x)); - else - gens := Filtered(gens, x->not IsCentralisedBy(gp, x)); - fi; - cgens := Concatenation(gens, cgens); - od; -return Group(cgens); -end; - -##################################################################################### -## INPUT: -## (1) a matrix group -## (2) the (natural) vector space upon which acts -## OUTPUT: the support of -GroupSupport := function(gp, V) -local bas, x, b; - bas := []; - for x in GeneratorsOfGroup(gp) do - for b in Basis(V) do - Add(bas, b-b*x); - od; - od; -return Subspace(V, bas); -end; - -##################################################################################### -## INPUT: -## (1) a matrix group -## (2) the (natural) vector space upon which acts -## OUTPUT: the subspace of centralised by -GroupCentralisedSpace := function(gp, V) -local cent, x, nbasis; - cent := V; - for x in GeneratorsOfGroup(gp) do - nbasis := NullspaceMat( x - x^0 ); - cent := Intersection(cent, Subspace(V, nbasis)); - od; -return cent; -end; - -#################################################################################### -## INPUT: -## (1) x matrix -## (2) integer -## OUTPUT: matrix inserted at the top left of x matrix -InsertBlock := function(block, n) -local m, f, zrow, bas, top; - m := Length(block); - f := Field(block[1][1]); - zrow := List([1..n-m], i->Zero(f)); - bas := Basis( f^n ); - top := List( block, x->Concatenation(x, zrow) ); -return Concatenation(top, bas{[m+1..n]}); -end; - -##################################################################################### -## INPUT: -## (1) a matrix -## (2) s subspace preserved by matrix -## OUTPUT: the transformation induced by the matrix on the subspace -ActionOnSubspace := function(x, W) -return List( Basis(W), w->Coefficients(Basis(W), w*x) ); -end; - - -################################## -### routines for handling SLPs ### -################################## -ProdProg := function(slp1, slp2) -return ProductOfStraightLinePrograms(slp1, slp2); -end; - -############################### -PowerProg := function(slp, n) -local prg; - prg := StraightLineProgram([[1,n]],1); -return CompositionOfStraightLinePrograms(prg, slp); -end; - -################################ -InvProg := function(slp) -return PowerProg(slp, -1); -end; - -############################### -ConjProg := function(slp1, slp2) -return ProdProg( InvProg(slp2) , ProdProg(slp1,slp2) ); -end; - -## writes a nonnegative integer <

^ in base

-NtoPadic := function(p, e, n) -local j, output; - output := []; - for j in [1..e] do - output[j] := (n mod p)*Z(p)^0; - n := ( n - (n mod p) )/p; - od; -return output; -end; - -## writes a vector in GF(

)^ as a nonnegative integer -PadictoN := function(p, e, vector) -local j, output; - output := 0; - for j in [1..e] do - output := output + p^(j-1)*IntFFE(vector[j]); - od; -return output; -end; - -## computes the 2-part of -2part := function(n) -local k, m; - k := 0; - m := n; - while m mod 2 = 0 do - m := m/2; - k := k + 1; - od; -return [k,m]; -end; diff --git a/contrib/pete/bbdecs.g b/contrib/pete/bbdecs.g deleted file mode 100644 index a8caf31a8..000000000 --- a/contrib/pete/bbdecs.g +++ /dev/null @@ -1,506 +0,0 @@ -############################################################################## -## ## -#I This is the declaration file for the constructive recognition package of ## -## black box classical groups. ## -## ## -############################################################################## - -IsBBGpElm := NewCategory ("IsBBGpElm", IsMultiplicativeElementWithInverse); -IsBBGpElmColl := CategoryCollections (IsBBGpElm); - -IsPermBBGpElm := NewCategory ("IsPermBBGpElm", IsBBGpElm); -IsPermBBGpElmColl := CategoryCollections (IsPermBBGpElm); - -IsNaturalPermBBGpElm := NewCategory ("IsNaturalPermBBGpElm", IsBBGpElm); -IsNaturalPermBBGpElmColl := CategoryCollections (IsNaturalPermBBGpElm); - -IsMatrixBBGpElm := NewCategory ("IsMatrixBBGpElm", IsBBGpElm); -IsMatrixBBGpElmColl := CategoryCollections (IsMatrixBBGpElm); - -### PAB 2-10-04 (more generally, we can implement quotient groups wherever we have -### an efficient membership test, but $p$-core is all we need for now...) -IsPQuotientBBGpElm := NewCategory ("IsPQuotientBBGpElm", IsBBGpElm); -IsPQuotientBBGpElmColl := CategoryCollections (IsPQuotientBBGpElm); - -IsBBGp := IsGroup and IsBBGpElmColl; -IsPermBBGp := IsBBGp and IsPermBBGpElmColl; -IsNaturalPermBBGp := IsBBGp and IsNaturalPermBBGpElmColl; -IsMatrixBBGp := IsBBGp and IsMatrixBBGpElmColl; - -### PAB 2-10-04 -IsPQuotientBBGp := IsBBGp and IsPQuotientBBGpElmColl; - -GpAsBBGp := NewOperation("GpAsBBGp", [IsGroup]); -BBGpAsPQuotientBBGp := NewOperation("BBGpAsPQuotientBBGp", [IsBBGp, IsInt]); -SubGpAsBBGp := NewOperation("SubGpAsBBGp", [IsBBGp, IsList]); - - - -############################################################################# -## -#A Chain ( ) -## -## A Black Box Group will only have this attribute if it was constructed from -## a permutation group. The information that it contains is necessary for -## better pseudorandom elements. - -Chain := NewAttribute("Chain", IsPermBBGp); -SetChain := Setter (Chain); -HasChain := Tester (Chain); - - -########################################################################### -## -## NaturalFlag is set true in a permutation group if it has to be converted -## to a black box group with natural group operations - -NaturalFlag := NewProperty("NaturalFlag", IsPermBBGp); -SetNaturalFlag := Setter (NaturalFlag); -HasNaturalFlag := Tester (NaturalFlag); - -############################################################################# -## -#F PermInverseBBGp( , ) . . . . inverse in permutation bb group -## -## given a list of permutations and a stabilizer chain for -## the group $G$, the routine computes the inverse of perm as a list. - -PermInverseBBGp := function (chain, perm) -local i, # loop variable - y, # element of permutation domain - word, # the list collecting the siftee of perm - len, # length of word - inverse, # the inverse of perm as a word; output - len2, # length of inverse - coset, # word representing a coset in a stabilizer - stb; # the stabilizer group we currently work with - - # perm must be a list of permutations itself! - inverse := []; - stb := chain; - word := ShallowCopy(perm); - while IsBound(stb.stabilizer) do - y:=ImageInWord(stb.orbit[1],word); - coset := CosetRepAsWord(stb.orbit[1],y,stb.transversal); - len := Length(word); - len2 := Length(inverse); - for i in [1..Length(coset)] do - word[len+i] := coset[i]; - inverse[len2+i] := coset[i]; - od; - stb:=stb.stabilizer; - od; -return inverse; -end; - - -############################################################################## -## -#F PermAltProd ( , , ) . . . inverse of x*y -## - -PermAltProd := function (chain, x, y) -local concat, # concatenation of the input words - inverse, # the inverse of concat as a word - product; # the inverse of inverse as a word; output - # x,y must be lists of permutations themselves! - concat := Concatenation(x,y); - inverse := PermInverseBBGp( chain, concat ); -return(inverse); -end; - - -############################################################################# -## -#F PermProductBBGp( , , ) . . . . product in permutation bb group -## -## given lists and of permutations and a stabilizer chain for -## the group $G$, the routine computes xy as a list. - -PermProductBBGp := function (chain, x, y) -local inverse, # the inverse of concat as a word - product; # the inverse of inverse as a word; output - - # x,y must be lists of permutations themselves! - inverse:=PermAltProd(chain,x,y); - product := PermInverseBBGp( chain, inverse ); -return product; -end; - - -############################################################################ -## -#F PermEqualsBBGp( , , ) -## -## For two strings, we test equality by tracing base images. - -PermEqualsBBGp:=function( chain , x , y ) -local stb; - stb:=chain; - while IsBound(stb.stabilizer) do - if not ImageInWord(stb.orbit[1],x)=ImageInWord(stb.orbit[1],y) then - return(false); - fi; - stb:=stb.stabilizer; - od; -return(true); -end; - -############################################################################## -## -#F PQuotientEqualsBBGp( ,

, , ) -## -## PAB: 02-12-04 -## this test presumes that the $p$-core of is nilpotent class-2: -## in particular, it covers the setting we -## are interested in, namely extraspecial $p$-groups - -PQuotientEqualsBBGp := function (gp, p, x, y) -local w, gens, conj, comm, ord, i, j, equal, u, v, z, o, one, central; - w:=x*Inverse(y); - ## first test whether has order dividing

( 2 ,

) - one:=One(gp); - ord:=p*Gcd(p,2); - o:=w^ord; - - if not ( o![1]=one![1] ) then return false; fi; - - gens:=GeneratorsOfGroup( gp ); - if ( Length(gens) < 11 ) then - conj:=List( gens, x->w^x ); - else - conj:=List( [1..10], i->w^PseudoRandom(gp) ); - fi; - comm:=[]; - for i in [1..Length(conj)] do - for j in [i+1..Length(conj)] do - Add( comm, Comm( conj[i] , conj[j] ) ); - od; - od; - - equal:=true; - ## first ensure the elements of have order dividing

(2,

) - for z in comm do - o:=z^ord; - equal := equal and (o![1]=one![1]); - ## here we just want to test whether the underlying elements - ## are equal -- essentially this is just testing equality in - ## the original bb group, not the quotient. - od; - if (not equal) then return false; fi; - for u in conj do - for z in comm do - v:=Comm(u,z); - equal := equal and (v![1]=one![1]); - od; - od; - -if ( equal ) then ## want to detect whenever we have a noncentral element - central:=true; - for z in comm do - central:=central and (z![1]=one![1]); - od; - if ( not central ) then ## we have found our non-central element -Error(999); - fi; -fi; - -return equal; -end; - -############################################################################## -## -#F EqualsModPCore( ,

, , ) -## -## PAB: 02-16-04 -## This test presumes that the $p$-core of is nilpotent class-2. -## In particular, it covers the setting we are interested in: extraspecial $p$-groups -## The procedure is exactly as in except the output is either -## a flag ( or ) or a black box group elements (a non-central element -## of the $p$-core of - -EqualsModPCore := function (gp, p, x, y) -local w, gens, conj, comm, ord, i, j, equal, u, v, z, o, one, central; - w:=x*Inverse(y); - ## first test whether has order dividing

( 2 ,

) - one:=One(gp); - ord:=p*Gcd(p,2); - o:=w^ord; - - if not ( o![1]=one![1] ) then return false; fi; - - gens:=GeneratorsOfGroup( gp ); - if ( Length(gens) < 11 ) then - conj:=List( gens, x->w^x ); - else - conj:=List( [1..10], i->w^PseudoRandom(gp) ); - fi; - comm:=[]; - for i in [1..Length(conj)] do - for j in [i+1..Length(conj)] do - Add( comm, Comm( conj[i] , conj[j] ) ); - od; - od; - - equal:=true; - ## first ensure the elements of have order dividing

(2,

) - for z in comm do - o:=z^ord; - equal := equal and (o![1]=one![1]); - ## here we just want to test whether the underlying elements - ## are equal -- essentially this is just testing equality in - ## the original bb group, not the quotient. - od; - if (not equal) then return false; fi; - for u in conj do - for z in comm do - v:=Comm(u,z); - equal := equal and (v![1]=one![1]); - od; - od; - - if ( equal ) then ## want to detect whenever we have a noncentral element - central:=true; - for z in comm do - central:=central and (z![1]=one![1]); - od; - if ( not central ) then ## we have found our non-central element - return w; - fi; - fi; -return equal; -end; - -################################################################################ -## -#F BBGpElmFromList( , ) -## - -BBGpElmFromList := function (elmfam, list) -return Objectify (elmfam!.defaultType, [list]); -end; - - - -############################################################################## -## -#M GpAsBBGp ( ) -## -InstallMethod(GpAsBBGp, "perm group -> black box group", true, [IsPermGroup],0, -function(grp) -local elmfam,gens,i,G; - elmfam:=NewFamily("elements family of bbg",IsObject,IsPermBBGpElm); - elmfam!.defaultType :=NewType(elmfam, - IsPermBBGpElm and IsPositionalObjectRep); - - # now tell the elements family about the underlying permutation group - elmfam!.stabChainGroup:=StabChain(grp); - - SetOne(elmfam,BBGpElmFromList(elmfam,[One(grp)])); - # make black box group elements from the permutation generators - gens:=[]; - for i in GeneratorsOfGroup(grp) do - Add(gens,BBGpElmFromList(elmfam,[i])); - od; - - G:=GroupWithGenerators(gens,BBGpElmFromList(elmfam,[One(grp)])); - SetChain(G,StabChain(grp)); -return G; -end); - -############################################################################## -## -#M GpAsBBGp ( ) -## -InstallMethod(GpAsBBGp, "perm group -> black box group w/ natural operations", - true, [IsPermGroup and NaturalFlag],0, -function(grp) -local elmfam,gens,i,G; - elmfam:=NewFamily("elements family of bbg",IsObject,IsNaturalPermBBGpElm); - elmfam!.defaultType :=NewType(elmfam, - IsNaturalPermBBGpElm and IsPositionalObjectRep); - SetOne(elmfam,BBGpElmFromList(elmfam,One(grp))); - # make black box group elements from the perm group generators - gens:=[]; - for i in GeneratorsOfGroup(grp) do - Add(gens,BBGpElmFromList(elmfam,i)); - od; - - G:=GroupWithGenerators(gens,BBGpElmFromList(elmfam,One(grp))); -return G; -end); - - -############################################################################## -## -#M GpAsBBGp ( ) -## -InstallMethod(GpAsBBGp, "matrix group -> black box group", true, [IsMatrixGroup],0, -function(grp) -local elmfam,gens,i,G; - elmfam:=NewFamily("elements family of bbg",IsObject,IsMatrixBBGpElm); - elmfam!.defaultType :=NewType(elmfam, - IsMatrixBBGpElm and IsPositionalObjectRep); - SetOne(elmfam,BBGpElmFromList(elmfam,One(grp))); - # make black box group elements from the matrix generators - gens:=[]; - for i in GeneratorsOfGroup(grp) do - Add(gens,BBGpElmFromList(elmfam,i)); - od; - G:=GroupWithGenerators(gens,BBGpElmFromList(elmfam,One(grp))); -return G; -end); - -############################################################################### -## -#M BBGpAsPQuotientBBGp( ) ... PAB 2-10-04 -## -InstallMethod( BBGpAsPQuotientBBGp, "bb group -> quotient bb group", true, -[IsBBGp,IsInt],0, -function( bbg , p ) -local elmfam,gens,i,G,x; - elmfam:=NewFamily("elements family of bbg",IsObject,IsPQuotientBBGpElm); - elmfam!.defaultType := NewType( elmfam, IsPQuotientBBGpElm and IsPositionalObjectRep ); - elmfam!.prime:=p; - SetOne(elmfam,BBGpElmFromList(elmfam,One(bbg)![1])); - gens:=[]; - for i in GeneratorsOfGroup( bbg ) do - x:=BBGpElmFromList(elmfam,i![1]); - Add(gens,x); - od; - G:=GroupWithGenerators(gens,BBGpElmFromList(elmfam,One(bbg)![1])); - elmfam!.group:=G; -return G; -end); - -############################################################################# -## Methods for group operations -## - -InstallMethod(PrintObj,"bbg elms",true,[IsBBGpElm],0, -function(e) - Print("BBGpElm ",e![1]); -end); - -InstallMethod(One,"bbg elms",true,[IsBBGpElm],0, -function(e) - return One(FamilyObj(e)); -end); - -InstallMethod(\*,"bbg elms",IsIdenticalObj,[IsPermBBGpElm,IsPermBBGpElm],0, -function(a,b) -local fam; - fam:=FamilyObj(a); - return BBGpElmFromList(fam, - PermProductBBGp(fam!.stabChainGroup, a![1], b![1] )); -end); - -InstallMethod(\=,"bbg elms",IsIdenticalObj,[IsPermBBGpElm,IsPermBBGpElm],0, -function(a,b) -local fam; - fam:=FamilyObj(a); - return PermEqualsBBGp(fam!.stabChainGroup, a![1], b![1] ); -end); - -InstallMethod(InverseOp,"bbg elms",true,[IsPermBBGpElm],0, -function(a) -local fam; - fam:=FamilyObj(a); - return BBGpElmFromList(fam, - PermInverseBBGp(fam!.stabChainGroup, a![1] )); -end); - -InstallMethod(\*,"bbg elms",IsIdenticalObj,[IsNaturalPermBBGpElm, -IsNaturalPermBBGpElm],0, -function(a,b) -local fam; - fam:=FamilyObj(a); - return BBGpElmFromList(fam, a![1] * b![1] ); -end); - -InstallMethod(\=,"bbg elms",IsIdenticalObj,[IsNaturalPermBBGpElm, -IsNaturalPermBBGpElm],0, -function(a,b) - return a![1] =b![1] ; -end); - -InstallMethod(\<,"bbg elms",IsIdenticalObj,[IsNaturalPermBBGpElm, -IsNaturalPermBBGpElm],0, -function(a,b) - return a![1] ) . . . random function in bbg - -InstallMethod( PseudoRandom , "method for permbbgs with chain" , true , - [HasChain] , 0 , -function( bbg ) -local fam, chain; - chain := Chain( bbg ); - fam := FamilyObj(GeneratorsOfGroup(bbg)[1]); -return BBGpElmFromList(fam, RandomElmAsWord( chain ) ); -end); - diff --git a/contrib/tensor19.tex b/contrib/tensor19.tex deleted file mode 100644 index 9acbe6687..000000000 --- a/contrib/tensor19.tex +++ /dev/null @@ -1,263 +0,0 @@ - -randomsubproduct:=function(list) -local len, product, i, eps; - -len:=Length(list); -product:=One(list[1]); -for i in [1..len] do - eps:=Random([0,1]); - product:=product*(list[i]^eps); -od; -return product; -end; - - - -olustur:=function(q) -local g,gens,gensg,mat,c1,c2,i,x,tensorgens,g1,g2,y; -g:=GL(2,q); -gensg:=GeneratorsOfGroup(g); -gens:=[ ]; -for i in [1..5] do - for x in gensg do - mat:=IdentityMat(10,GF(q)); - mat[2*i-1][2*i-1]:=x[1][1]; - mat[2*i-1][2*i]:=x[1][2]; - mat[2*i][2*i-1]:=x[2][1]; - mat[2*i][2*i]:=x[2][2]; - Add(gens,mat); - od; -od; -c1:=IdentityMat(10,GF(q)); -c1[1][1]:=0*Z(q); -c1[2][2]:=0*Z(q); -c1[3][3]:=0*Z(q); -c1[4][4]:=0*Z(q); -c1[1][3]:=Z(q)^0; -c1[2][4]:=Z(q)^0; -c1[3][1]:=Z(q)^0; -c1[4][2]:=Z(q)^0; -c2:=NullMat(10,10,GF(q)); -for i in [1..8] do - c2[i][i+2]:=Z(q)^0; -od; -c2[9][1]:=Z(q)^0; -c2[10][2]:=Z(q)^0; -tensorgens:=[]; -for x in gens do - Add(tensorgens,KroneckerProduct(x,IdentityMat(3,GF(q)))); -od; -Add(tensorgens,KroneckerProduct(c1,IdentityMat(3,GF(q)))); -Add(tensorgens,KroneckerProduct(c2,IdentityMat(3,GF(q)))); -g2:=SL(3,q); -for y in GeneratorsOfGroup(g2) do - Add(tensorgens,KroneckerProduct(IdentityMat(10,GF(q)),y)); -od; -g1:=Group(tensorgens); -return g1; -end; - -create:=function(q) -local g,gens,gensg,mat,c1,c2,i,x,tensorgens,G; -g:=GL(2,q); -gensg:=GeneratorsOfGroup(g); -gens:=[ ]; -for i in [1..5] do - for x in gensg do - mat:=IdentityMat(10,GF(q)); - mat[2*i-1][2*i-1]:=x[1][1]; - mat[2*i-1][2*i]:=x[1][2]; - mat[2*i][2*i-1]:=x[2][1]; - mat[2*i][2*i]:=x[2][2]; - Add(gens,mat); - od; -od; -c1:=IdentityMat(10,GF(q)); -c1[1][1]:=0*Z(q); -c1[2][2]:=0*Z(q); -c1[3][3]:=0*Z(q); -c1[4][4]:=0*Z(q); -c1[1][3]:=Z(q)^0; -c1[2][4]:=Z(q)^0; -c1[3][1]:=Z(q)^0; -c1[4][2]:=Z(q)^0; -c2:=NullMat(10,10,GF(q)); -for i in [1..8] do - c2[i][i+2]:=Z(q)^0; -od; -c2[9][1]:=Z(q)^0; -c2[10][2]:=Z(q)^0; -tensorgens:=[]; -for x in gens do - Add(tensorgens,KroneckerProduct(x,IdentityMat(10,GF(q)))); - Add(tensorgens,KroneckerProduct(IdentityMat(10,GF(q)),x)); -od; -#Add(tensorgens,KroneckerProduct(c1,c1)); -Add(tensorgens,KroneckerProduct(c2,IdentityMat(10,GF(q)))); -Add(tensorgens,KroneckerProduct(IdentityMat(10,GF(q)),c2)); -G:=Group(tensorgens); -return G; -end; - - -separate:=function(g,N) -local r, ready, s, t, order, factor, f1, f2, len, cl, cl2, i, count, divisors, x; -ready:=false; -count:=0; -repeat - r:=PseudoRandom(g); - order:=ProjectiveOrder(r)[1]; - factor:=Collected(Factors(order)); - len:=Length(factor); - if len >1 then - f1:=(factor[len][1])^(factor[len][2]); - f2:=(factor[len-1][1])^(factor[len-1][2]); - s:=r^(order/f1); - t:=r^(order/f2); - cl:=[s]; - for i in [1..10] do - Add(cl,s^PseudoRandom(g)); - od; - if ForAll (cl,x->Comm(x,t)=One(x)) then - cl2:=[t]; - for i in [1..10] do - Add(cl2,t^PseudoRandom(g)); - od; - for i in [1..10] do - Add(cl,randomsubproduct(cl)^PseudoRandom(g)); - Add(cl2,randomsubproduct(cl2)^PseudoRandom(g)); - od; - if ForAll (cl,x->ForAll(cl2,y->Comm(x,y)=One(x))) then - ready:=true; - fi; - fi; - fi; - count:=count+1; -until ready or count>N; -if ready then - for i in [1..2] do - r:=PseudoRandom(g); - divisors:=DivisorsInt(ProjectiveOrder(r)[1]); - for x in divisors do - if CheckAnswer(r^x,cl) then - Add(cl2,r^x); - elif CheckAnswer(r^x,cl2) then - Add(cl,r^x); - fi; - od; - od; - for i in [1..10] do - Add(cl,randomsubproduct(cl)^PseudoRandom(g)); - Add(cl2,randomsubproduct(cl2)^PseudoRandom(g)); - od; - return [Group(cl),Group(cl2)]; -else - return fail; -fi; -end; - - -NextStep := function ( g, a ) - - local b, c,g1; - - b := ProjectiveOrder(g)[1]/a; - if b=1 then return fail; fi; - - if Gcd( b, a ) = 1 then - c := b^-1 mod a; -Print("b=",b," c=",c,"\n"); - return g^(b*c); - - fi; - - return fail; - -end; - - -CheckAnswer := function( x, Bgens ) - - local y; - - if x = fail then return false; fi; - if Length(Bgens) = 0 then return true; fi; - for y in Bgens do - if Comm( x, y ) <> Bgens[1]^0 then - return false; - fi; - od; - - return true; - -end; - - -TensorDecompose := function( G, g, Agens, Bgens, N) - - - local h, a, b, i, B, hs, ans, order; - - - B := Group( Bgens ); - a := ProjectiveOrder(g)[1]; - Print( "aoriginal=",a,"\n"); - hs := []; - for i in [ 1 .. N ] do - h := PseudoRandom( B ); - order:=ProjectiveOrder(g*h)[1]; - Add( hs, [h, order ] ); - a := Gcd( a, order); - od; - Print( " a = ", a, "\n" ); - i := 1; - repeat - h := PseudoRandom(B); - a := Gcd( a, ProjectiveOrder( g*h )[1] ); - ans := NextStep ( g * h, a); -# if ans<>fail then Error(); fi; - if CheckAnswer( ans, Bgens ) then - Print( "i = ", i, "\n" ); - if CheckAnswer( g*ans^(-1), Agens) then - return [ans, g*ans^(-1)]; - fi; - fi; - i := i + 1; - until i > 1000 * N; - -# h := First( hs, i -> Gcd( a, i[2]/a) = 1); - -end; - - -writeeuclid:=function(g,r,Agens,Bgens) -local order,factor,euclid,i,a,parts,b,c,x; -order:=ProjectiveOrder(r)[1]; -factor:=Collected(Factors(order)); -euclid:=[]; -parts:=[]; - for i in [1..Length(factor)] do - euclid[i]:=order/(factor[i][1])^(factor[i][2]); - x:=r^euclid[i]; - if CheckAnswer(x,Bgens) then - parts[i]:=[x,x^0]; - elif CheckAnswer(x,Agens) then - parts[i]:=[x^0,x]; - else - parts[i]:=TensorDecompose(g,x,Agens,Bgens,100); - fi; - od; -a:=GcdRepresentation(euclid); -b:=1; -c:=1; - for i in [1..Length(factor)] do - b:=b*((parts[i][1])^a[i]); - c:=c*((parts[i][2])^a[i]); - od; - if r=b*c then - return [b,c]; - else - return fail; - fi; -end; - diff --git a/misc/obsolete/shortorbs.gi b/misc/obsolete/shortorbs.gi deleted file mode 100644 index 5f80f03e9..000000000 --- a/misc/obsolete/shortorbs.gi +++ /dev/null @@ -1,351 +0,0 @@ -############################################################################# -## -## This file is part of recog, a package for the GAP computer algebra system -## which provides a collection of methods for the constructive recognition -## of groups. -## -## This files's authors include Max Neunhöffer, Ákos Seress. -## -## Copyright of recog belongs to its developers whose names are too numerous -## to list here. Please refer to the COPYRIGHT file for details. -## -## SPDX-License-Identifier: GPL-3.0-or-later -## -## -## A collection of find homomorphism methods for permutation groups. -## -## This is now only used by Mark Stather's code. -## The functionality will eventually go since most stuff is provided -## by the orb package now. -## -############################################################################# - -RECOG.InitHT := function(len, hfun, eqfun); - return rec(len := len, nr := 0, els := [], vals := [], - hf := hfun, eqf := eqfun, colls := 0); -end; - -InstallMethod(ViewObj, "for hash tables", [IsRecord], - function(ht) - if IsBound(ht.len) and IsBound(ht.nr) and IsBound(ht.els) and - IsBound(ht.vals) and IsBound(ht.hf) and IsBound(ht.eqf) and - IsBound(ht.colls) then - # This is obviously a hash table - Print(""); - else - TryNextMethod(); - fi; - end); - -RECOG.LASTNUMBERVALUEHT := 0; -RECOG.ValueHT := function(ht, x) - local h; - h := ht.hf(x); - while IsBound(ht.els[h]) and not(ht.eqf(ht.els[h],x)) do - ht.colls := ht.colls+1; - h := h+1; - if h>ht.len then h:=1; fi; - od; - if not IsBound(ht.els[h]) then - RECOG.LASTNUMBERVALUEHT := h; - return fail; - else - return ht.vals[h]; - fi; -end; - -RECOG.AddHT := function(ht, x, val) - local h; - if ht.len = ht.nr+1000 then - Error("Hash table full!"); - return fail; - fi; - h := ht.hf(x); - while IsBound(ht.els[h]) do - ht.colls := ht.colls+1; - h := h+1; - if h>ht.len then h:=1; fi; - od; - ht.els[h] := x; - ht.vals[h] := val; - ht.nr := ht.nr+1; - return h; -end; - -RECOG.HashFunctionForGF2Vectors := function(v,hashlen,bytelen) - return HASHKEY_BAG(v,256,8,bytelen) mod hashlen + 1; -end; - -RECOG.HashFunctionFor8BitVectors := function(v,hashlen,bytelen) - return HASHKEY_BAG(v,256,12,bytelen) mod hashlen + 1; -end; - -RECOG.MakeHashFunction := function(p,hashlen) - local bytelen,i,q,qq; - if IsGF2VectorRep(p) then - bytelen := QuoInt(Length(p),8); - if bytelen = 0 then - return x->NumberFFVector(x,2) mod hashlen + 1; - fi; - return x->RECOG.HashFunctionForGF2Vectors(x,hashlen,bytelen); - elif Is8BitVectorRep(p) then - q := Q_VEC8BIT(p); - qq := q; - i := 0; - while qq <= 256 do - qq := qq * q; - i := i + 1; - od; - # i is now the number of field elements per byte - bytelen := QuoInt(Length(p),i); - if bytelen = 0 then - return x->NumberFFVector(x,q) mod hashlen + 1; - fi; - return x->RECOG.HashFunctionFor8BitVectors(x,hashlen,bytelen); - else - Error("No hash function for objects like ",p," available!"); - fi; -end; - -RECOG.MyOrbit := function(gens,x,op,hashlen,hashfun) - # This function enumerates the orbit of `x' under the operation of - # the group generated by `gens' with the operation `op'. `hashlen' - # must be an upper bound of the orbit length and will be used as length - # of the hash table. `hashfun' must be a hash function for objects - # in the orbit (that is like `x') and must return values in [1..hashlen]. - # The function returns a record. Its `orbit' entry is a list of points - # beginning with `x'. Its `perms' entry is a list with an entry - # for each generator in `gens' being a permutation of the orbit as - # a list of integers. - local t,l,y,g,yy,eqf,pos,len,perms,p,nrgens; - eqf := ApplicableMethod(EQ,[x,x]); - t := RECOG.InitHT(hashlen,hashfun,eqf); - RECOG.AddHT(t,x,1); - l := [x]; - len := 1; - nrgens := Length(gens); - perms := List(gens,v->[]); - for y in l do - for g in [1..nrgens] do - yy := op(y,gens[g]); - pos := RECOG.ValueHT(t,yy); - if pos = fail then - Add(l,yy); # add to list - len := len + 1; # count point - RECOG.AddHT(t,yy,len); # store in hash table - Add(perms[g],len); # store image of y under gens[g] - else - Add(perms[g],pos); # store image of y under gens[g] - fi; - od; - od; - return rec(orbit := l,perms := perms,t := t); -end; - -RECOG.MyOrbitStart := function(gens,x,op,hashlen,hashfun) - local eqf,orbrec; - if IsGroup(gens) then - gens := GeneratorsOfGroup(gens); - fi; - eqf := ApplicableMethod(EQ,[x,x]); - orbrec := rec( - gens := gens, - nrgens := Length(gens), - op := op, - ht := RECOG.InitHT(hashlen,hashfun,eqf), - orbit := [x], - perms := List(gens,v->[]), - isready := false, - pos := 1, - ); - RECOG.AddHT(orbrec.ht,x,1); - return orbrec; -end; - -RECOG.MyOrbitWork := function(orbrec,limit) - local i,j,orb,perms,pos,yy; - i := orbrec.pos; # we go on here - orb := orbrec.orbit; - perms := orbrec.perms; - while Length(orb) <= limit and i <= Length(orb) do - for j in [1..orbrec.nrgens] do - yy := orbrec.op(orb[i],orbrec.gens[j]); - pos := RECOG.ValueHT(orbrec.ht,yy); - if pos = fail then - Add(orb,yy); - RECOG.AddHT(orbrec.ht,yy,Length(orb)); - Add(perms[j],Length(orb)); - else - Add(perms[j],pos); - fi; - od; - i := i + 1; - od; - orbrec.pos := i; - if i > Length(orb) then - orbrec.isready := true; - fi; - return orbrec.isready; -end; - - - -# Number of random elements generated: -RECOG.ShortOrbitsNrRandoms := 12; -RECOG.ShortOrbitsOrbLimit := 102400; - -RECOG.ShortOrbitsHomFunc := function(data,o) - # o is a matrix in the matrix group. - # We ask for a StabChain (hopefully already there!) of the permutation - # group. We extract the base, pull that back to the orbits consisting - # of vectors, map, lookup with the hash table and finally construct - # the image permutation by the base images. - local base,gp,i,images,orb,w; - gp := data.range; - orb := data.orb; - base := BaseStabChain(StabChain(gp)); - images := ShallowCopy(base); # just to make a list of equal length - # Now run through them, map, and lookup: - for i in [1..Length(base)] do - # First find the orbit we are in: - w := orb.orbit[base[i]] * o; - images[i] := RECOG.ValueHT(orb.ht,w); - od; - return RepresentativeActionOp( gp,base,images,OnTuples ); -end; - -RECOG.ShortOrbitsInterestingVectors := function(g) - local c,f,i,inters,j,l,nw,sortfun,v,vv,w,wb,ww; - l := ShallowCopy(GeneratorsOfGroup(g)); - f := DefaultFieldOfMatrixGroup(g); - for i in [1..RECOG.ShortOrbitsNrRandoms] do - Add(l,PseudoRandom(g)); - od; - c := List(l,x->Set(Factors(CharacteristicPolynomial(x,1)))); - v := []; - for i in [1..Length(l)] do - for j in [1..Length(c[i])] do - vv := []; - Add(vv,[VectorSpace(f,NullspaceMat(Value(c[i][j],l[i]))), - Degree(c[i][j]), - WeightVecFFE(CoefficientsOfLaurentPolynomial(c[i][j])[1]), - 1]); - od; - Add(v,vv); - od; - Info(InfoRecog,3,"Have eigenspaces."); - # Now collect a list of all those spaces together with all possible intersects - w := []; - for i in [1..Length(l)] do - nw := []; - for j in [1..Length(v[i])] do - for ww in w do - inters := Intersection(ww[1],v[i][j][1]); - if Dimension(inters) > 0 then - Add(nw,[inters,Minimum(ww[2],v[i][j][2]), - Minimum(ww[3],v[i][j][3]),ww[4]+v[i][j][4]]); - fi; - od; - Add(nw,v[i][j]); - od; - Append(w,nw); - od; - sortfun := function(a,b) - if a[2] < b[2] then return true; - elif a[2] > b[2] then return false; - elif a[3] < b[3] then return true; - elif a[3] > b[3] then return false; - elif a[4] < b[4] then return true; - elif a[4] > b[4] then return false; - elif Dimension(a[1]) < Dimension(b[1]) then return true; - else return false; - fi; - end; - Sort(w,sortfun); - wb := List(w,ww->Basis(ww[1])[1]); - Info(InfoRecog,3,"Have ",Length(wb)," vectors for possibly short orbits."); - return wb; -end; - -FindHomMethodsMatrix.ShortOrbits := function(ri,g) - # g must be a matrix group - local ThrowAwayOrbit,data,found,hashfun,hashlen,hom,i,imggrp,imgperms, - limit,nrorbs,o,wb; - - wb := RECOG.ShortOrbitsInterestingVectors(g); - - # Now we have a list of vectors with (hopefully) short orbits. - # We start enumerating all those orbits, but first only 50 elements: - nrorbs := Minimum(Length(wb),32); # take only the 32 first - o := []; - hashlen := NextPrimeInt(QuoInt(RECOG.ShortOrbitsOrbLimit * 3,2)); - hashfun := RECOG.MakeHashFunction(wb[1],hashlen); - for i in [1..nrorbs] do - Add(o,RECOG.MyOrbitStart(g,wb[i],OnRight,hashlen,hashfun)); - od; - limit := 50; # first do 50 points everywhere - i := 1; # we start to work on the first one - - ThrowAwayOrbit := function(i) - # This removes orbit number i from o, thereby handling nrorbs and - # Length(o) correctly. If you want to use o[i] further, please - # make a copy (of the reference) before calling this function. - if Length(o) > nrorbs then - o[i] := o[nrorbs+1]; - o{[nrorbs+1..Length(o)-1]} := o{[nrorbs+2..Length(o)]}; - Unbind(o[Length(o)]); - else - o{[i..nrorbs-1]} := o{[i+1..nrorbs]}; - Unbind(o[nrorbs]); - nrorbs := nrorbs-1; - fi; - end; - - repeat - found := RECOG.MyOrbitWork(o[i],limit); - if Length(o[i].orbit) = 1 then - Info(InfoRecog,3,"Orbit Number ",i," has length 1."); - found := false; - # Now throw away this orbit: - ThrowAwayOrbit(i); - # we intentionally do not increase i here! - elif not found then - i := i + 1; - fi; - if i > nrorbs then - Info(InfoRecog,3,"Done ",nrorbs," orbit(s) to limit ",limit,"."); - limit := limit * 2; - if limit > RECOG.ShortOrbitsOrbLimit then - Info(InfoRecog,3,"Limit reached, giving up."); - return fail; - fi; - i := 1; - if nrorbs < i then - Info(InfoRecog,3,"No orbits left, giving up."); - return fail; - fi; - if nrorbs > 1 then - nrorbs := QuoInt((nrorbs+1),2); - fi; - fi; - until found; - Info(InfoRecog,3, - "Found orbit of length ",Length(o[i].orbit)," (#",i,")."); - - o := o[i]; # the others are no longer needed - - imgperms := List(o.perms,PermList); - imggrp := Group(imgperms); - data := rec( source := g, range := imggrp, orb := o ); - hom := GroupHomByFuncWithData(g,imggrp,RECOG.ShortOrbitsHomFunc, data); - Info(InfoRecog,3,"Finished building homomorphism."); - - SetHomom(ri,hom); - Setmethodsforimage(ri,FindHomDbPerm); - - return true; -end; - -#AddMethod( FindHomDbMatrix, FindHomMethodsMatrix.ShortOrbits, -# 500, "ShortOrbits", -# "tries to find a short orbit via O'Brien/Murray heuristics" ); diff --git a/misc/work/DOWORK b/misc/work/DOWORK deleted file mode 100644 index 6429ec8ca..000000000 --- a/misc/work/DOWORK +++ /dev/null @@ -1,10 +0,0 @@ -g := SL(100,256); -t := []; -for i in [1..10] do -gm := GroupWithMemory(g); -pr := ProductReplacer(GeneratorsOfGroup(gm),rec( maxdepth := 500)); -gm!.pseudorandomfunc := [rec(func := Next, args := [pr])]; -tt := Runtime(); r := RECOG.FindStdGens_SL_EvenChar(gm,FieldOfMatrixGroup(g)); -Add(t,Runtime()-tt); Print(t,"\n"); -od; - diff --git a/misc/work/TIMINGS b/misc/work/TIMINGS deleted file mode 100644 index a42ffa81c..000000000 --- a/misc/work/TIMINGS +++ /dev/null @@ -1,44 +0,0 @@ -Machine A: Laptop, Intel(R) Pentium(R) M processor 1.86GHz -Machine B: Desktop, Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz - -all times in milliseconds - -SL(100,2): 10 runs: - A: 4584,3316,5240,3013,2572,4500,2544,7905,5688,2748 - B: 1808,4548,1308,3349,1852,2744,1712,4744,2348,1416 -SL(100,4): 10 runs: - A: 27530,12753,16661,16369,14885,11044,11897,23970,21993,28026 - B: 27114,6900,16873,11565,6164,13357,8741,6408,21101,9057 -SL(100,8): 10 runs: - A: 27802,57623,39215,85445,33750,119124,40790,24014,37310,46519 - B: 24925,27298,17825,38074,42075,63512,33738,45231,34890,12765 -SL(50,256): 1 run: - A: 120659 - B: 58636 - -New method: - -SL(100,2): 10 runs: - A: [ 3420, 3612, 6529, 5948, 2704, 4324, 6613, 3556, 3640, 5501 ] - B: [ 2232, 2092, 4772, 1528, 2284, 3241, 4196, 2196, 1696, 1636 ] -SL(100,4): 10 runs: - A: [ 15677, 11096, 12121, 15105, 10761, 12661, 18381, 19057, 11733, 15153 ] - B: [ 7889, 5536, 7536, 8961, 5660, 5469, 5672, 7369, 8780, 6140 ] -SL(100,8): 10 runs: - A: [ 26837, 23470, 27941, 20406, 38562, 20761, 19494, 27317, 20410, 23669 ] - B: [ 11213, 9881, 11913, 11032, 11005, 11717, 11424, 11013, 8937, 8892 ] -SL(100,16): 10 runs: - A: [ 23266, 25425, 22482, 24993, 27406, 26886, 26349, 24250, 25265, 25770 ] - B: [ 12133, 12433, 13905, 13416, 10073, 12477, 10837, 15412, 17078, 19137 ] -SL(100,256): 10 runs: - A: [ 51439, 61704, 47263, 51399, 86158, 51463, 47019, 47623, 54291, 45715 ] - B: [ 22837, 24706, 19085, 20801, 20025, 26490, 26886, 22577, 22074, 27057 ] - - -Average runtimes: - - 2 4 8 16 256 -before A 4211 18513 51159 - 120659 -before B 2583 12728 34033 - 58636 -after A 4585 14175 24887 25209 54407 -after B 2587 6901 10703 13690 23254