Skip to content

Commit

Permalink
ENHANCE: Automorphism group computations
Browse files Browse the repository at this point in the history
Reduce (or be more aggressive in reducing) number of generators and
permutation degree for groups of automorphisms.
Also, the cost of testing for class duplicates exceeds the gain of not testing
duplicates.
  • Loading branch information
hulpke committed Oct 31, 2020
1 parent 93abbf7 commit 6a42bbf
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 16 deletions.
99 changes: 94 additions & 5 deletions lib/autsr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,73 @@
## Automorphism group computation and isomorphism testing in finite groups.
## J. Symb. Comput. 35, No. 3, 241-267 (2003)

# call as big,perm,aut (the latter two can be groups or generator lists,
# optional permiso.
# returns two groups with corresponding generators
AGSRReducedGens:=function(arg)
local big,bp,A,permgens,s,auts,sel,i,sub;
big:=arg[1];
bp:=arg[2];
A:=arg[3];

if IsGroup(bp) then
permgens:=GeneratorsOfGroup(bp);
else
permgens:=bp;
bp:=SubgroupNC(Parent(big),permgens);
fi;
SetSize(bp,Size(big));
if IsGroup(A) then
auts:=GeneratorsOfGroup(A);
else
auts:=A;
A:=fail;
fi;
if Length(permgens)<>Length(auts) then Error("correspondence!");fi;
s:=SmallGeneratingSet(big);
if Length(s)+2>=Length(permgens) then
return fail;
fi;

# first try to reduce by dropping generators
sel:=[1..Length(permgens)];
for i in [1..Length(permgens)] do
sub:=SubgroupNC(Parent(big),permgens{Difference(sel,[i])});
if Size(sub)=Size(big) then
RemoveSet(sel,i);
bp:=sub;
fi;
od;
# good enough?
if Length(s)+2<Length(sel) then
if Length(arg)>3 then
i:=InverseGeneralMapping(arg[4]);
else
i:=GroupHomomorphismByImagesNC(big,Group(auts),permgens,auts);
fi;
auts:=List(s,x->ImagesRepresentative(i,x));
bp:=SubgroupNC(Parent(big),s);
SetSize(bp,Size(big));
auts:=Group(auts);
else
auts:=Group(auts{sel});
fi;
SetIsGroupOfAutomorphismsFiniteGroup(auts,true);
SetIsFinite(auts,true);
SetSize(auts,Size(bp));
if A<>fail then
if HasInnerAutomorphismsAutomorphismGroup(A) then
SetInnerAutomorphismsAutomorphismGroup(auts,
InnerAutomorphismsAutomorphismGroup(A));
fi;
if HasNiceMonomorphism(A) then
SetNiceMonomorphism(auts,NiceMonomorphism(A));
SetNiceObject(auts,NiceObject(A));
fi;
fi;
return [bp,auts];
end;

# If M<=Frat(C_G(M)), try to find relators for C/M that in G evaluate to
# generators of M and for which exponent sums are multiples of p. In this
# case the values of the relators on pre-images in G do not depend on choice
Expand Down Expand Up @@ -499,10 +566,16 @@ local ff,r,d,ser,u,v,i,j,k,p,bd,e,gens,lhom,M,N,hom,Q,Mim,q,ocr,split,MPcgs,
fi;
AQP:=Image(AQiso,AQ);
Info(InfoMorph,3,"Permrep of AQ ",Size(AQ),", deg:",NrMovedPoints(AQP));

if Length(GeneratorsOfGroup(AQP))=Length(GeneratorsOfGroup(AQ)) then
a:=AGSRReducedGens(AQP,AQP,AQ,AQiso);
if a<>fail then
AQP:=a[1];
AQ:=a[2];
fi;
fi;

# force degree down
a:=Size(AQP);
AQP:=Group(SmallGeneratingSet(AQP),One(AQP));
SetSize(AQP,a);
if isBadPermrep(AQP) then
a:=SmallerDegreePermutationRepresentation(AQP:cheap);
if NrMovedPoints(Image(a))<NrMovedPoints(AQP) then
Expand Down Expand Up @@ -705,8 +778,13 @@ local ff,r,d,ser,u,v,i,j,k,p,bd,e,gens,lhom,M,N,hom,Q,Mim,q,ocr,split,MPcgs,

Q:=Image(hom,G);
# degree reduction called for?
if Size(N)>1 and isBadPermrep(Q) then
if IsPermGroup(Q) and Size(N)>1
and (isBadPermrep(Q) or NrMovedPoints(Q)>1000) then
q:=SmallerDegreePermutationRepresentation(Q:cheap);
if NrMovedPoints(Q)>1000
and NrMovedPoints(Q)=NrMovedPoints(Image(q)) then
q:=SmallerDegreePermutationRepresentation(Q);
fi;
if NrMovedPoints(Range(q))<NrMovedPoints(Q) then
Info(InfoMorph,3,"reduced permrep Q ",NrMovedPoints(Q)," -> ",
NrMovedPoints(Range(q)));
Expand Down Expand Up @@ -948,23 +1026,34 @@ local ff,r,d,ser,u,v,i,j,k,p,bd,e,gens,lhom,M,N,hom,Q,Mim,q,ocr,split,MPcgs,
sub:=SubgroupConditionAbove(sub,cond,Aperm);
Info(InfoMorph,2,"end search ",j/Size(sub));

Aperm:=Group(Apa,());
# Note: Aperm is larger than what is generated by Apa
j:=1;
while Size(Aperm)<Size(sub) do
ac:=InnerAutomorphism(OQ,Image(q,GeneratorsOfGroup(Q)[j]));
k:=ImagesRepresentative(AQiso,ac);
if not k in Aperm then
Add(Apa,k);
Aperm:=ClosureGroup(Aperm,k);
Add(A,InnerAutomorphism(Q,GeneratorsOfGroup(Q)[j]));
fi;
j:=j+1;
od;

# remove redundant generators. Note that Aperm could be to big, thus
# make group from Apa
ac:=AGSRReducedGens(SubgroupNC(Parent(sub),Apa),Apa,A);
if ac<>fail then
Apa:=GeneratorsOfGroup(ac[1]);
A:=GeneratorsOfGroup(ac[2]);
fi;

Info(InfoMorph,2,"Lift Index ",Size(AQP)/Size(sub));

# now make the new automorphism group
innB:=List(SmallGeneratingSet(Q),x->InnerAutomorphism(Q,x));
gens:=ShallowCopy(innB);
Info(InfoMorph,2,"|gens|=",Length(gens),"+",Length(C),
"+",Length(B),"+",Length(A));
Append(gens,C);
Append(gens,B);
Append(gens,A);
Expand Down
10 changes: 6 additions & 4 deletions lib/morpheus.gi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#############################################################################
#
###########################################################################
##
## This file is part of GAP, a system for computational discrete algebra.
## This file's authors include Alexander Hulpke.
Expand Down Expand Up @@ -572,11 +573,12 @@ local hom, allinner, gens, c, ran, r, cen, img, dom, u, subs, orbs, cnt,
o:=cl;
cl:=[];
for i in o do
if not ForAny(cl,x->Order(Representative(i))=Order(Representative(x))
and (Size(x) mod Size(i)=0) and Representative(i) in x) then
# test to avoid duplicates is more expensive than it is worth
# if not ForAny(cl,x->Order(Representative(i))=Order(Representative(x))
# and (Size(x) mod Size(i)=0) and Representative(i) in x) then
r:=ConjugacyClass(g,Representative(i));
Add(cl,r);
fi;
# fi;
od;

Info(InfoMorph,2,"actbase ",Length(cl), " classes");
Expand Down
9 changes: 2 additions & 7 deletions tst/teststandard/opers/AutomorphismGroup.tst
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,12 @@ true

#
gap> G:=GL(IsPermGroup,3,3);;
gap> H:=AutomGrpSR(G);;
gap> StructureDescription(H);
"PSL(3,3) : C2"

#
gap> G:=GL(IsPermGroup,3,3);;
gap> H:=AutomorphismGroupMorpheus(G);;
gap> H:=AutomorphismGroup(G);;
gap> StructureDescription(H);
"PSL(3,3) : C2"

#
gap> SetAssertionLevel(0);
gap> g:=PerfectGroup(IsPermGroup,15360,1);;
gap> h:=g^(1,129);;
gap> AutomorphismGroup(g);; # pull out of isom. test (reduce timeout risk)
Expand Down

0 comments on commit 6a42bbf

Please sign in to comment.