Skip to content

Commit

Permalink
ENHANCE: Performance improvements to automorphism group computations.
Browse files Browse the repository at this point in the history
Includes improvements to `SmallGeneratingSet` for perm groups.

Also dealt with changed generators in manual examples
  • Loading branch information
hulpke committed Jun 7, 2018
1 parent 95fde48 commit a7eec63
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 20 deletions.
10 changes: 5 additions & 5 deletions doc/tut/group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,9 @@ usual way we now look for the subgroups above <C>u105</C>.
gap> blocks := Blocks( a8, orb );; Length( blocks );
15
gap> blocks[1];
[ (1,2)(3,4)(5,6)(7,8), (1,3)(2,4)(5,8)(6,7), (1,4)(2,3)(5,7)(6,8),
(1,5)(2,6)(3,8)(4,7), (1,6)(2,5)(3,7)(4,8), (1,7)(2,8)(3,6)(4,5),
(1,8)(2,7)(3,5)(4,6) ]
[ (1,2)(3,4)(5,6)(7,8), (1,3)(2,4)(5,7)(6,8), (1,4)(2,3)(5,8)(6,7),
(1,5)(2,6)(3,7)(4,8), (1,6)(2,5)(3,8)(4,7), (1,7)(2,8)(3,5)(4,6),
(1,8)(2,7)(3,6)(4,5) ]
]]></Example>
<P/>
To find the subgroup of index 15 we again use closure. Now we must be a
Expand Down Expand Up @@ -1175,8 +1175,8 @@ gap> aut := AutomorphismGroup( p );; NiceMonomorphism(aut);;
gap> niceaut := NiceObject( aut );
Group([ (1,4,2,3), (1,5,4)(2,6,3), (1,2)(3,4), (3,4)(5,6) ])
gap> IsomorphismGroups( niceaut, SymmetricGroup( 4 ) );
[ (1,4,2,3), (1,5,4)(2,6,3), (1,2)(3,4), (3,4)(5,6) ] ->
[ (1,4,3,2), (1,4,2), (1,3)(2,4), (1,4)(2,3) ]
[ (1,4,2,3), (1,5,4)(2,6,3), (1,2)(3,4), (3,4)(5,6) ] ->
[ (1,4,2,3), (1,2,3), (1,2)(3,4), (1,3)(2,4) ]
]]></Example>
<P/>
The range of a nice monomorphism is in most cases a permutation group,
Expand Down
6 changes: 5 additions & 1 deletion lib/autsr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,11 @@ local d,a,map,possibly,cG,cH,nG,nH,i,j,sel,u,v,asAutomorphism,K,L,conj,e1,e2,
u:=ClosureGroup(i,K);
v:=ClosureGroup(i,L);
if u<>v then
gens:=SmallGeneratingSet(api);
if IsSolvableGroup(api) then
gens:=Pcgs(api);
else
gens:=SmallGeneratingSet(api);
fi;
pre:=List(gens,x->PreImagesRepresentative(iso,x));
map:=RepresentativeAction(SubgroupNC(a,pre),u,v,asAutomorphism);
if map=fail then
Expand Down
4 changes: 2 additions & 2 deletions lib/ctbl.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4382,11 +4382,11 @@ DeclareGlobalFunction( "NormalSubgroupClasses" );
## Character( CharacterTable( S4 ), [ 3, 1, -1, 0, -1 ] ),
## Character( CharacterTable( S4 ), [ 1, 1, 1, 1, 1 ] ) ]
## gap> kernel:= KernelOfCharacter( irr[3] );
## Group([ (1,2)(3,4), (1,3)(2,4) ])
## Group([ (1,2)(3,4), (1,4)(2,3) ])
## gap> HasNormalSubgroupClassesInfo( tbl );
## true
## gap> NormalSubgroupClassesInfo( tbl );
## rec( nsg := [ Group([ (1,2)(3,4), (1,3)(2,4) ]) ],
## rec( nsg := [ Group([ (1,2)(3,4), (1,4)(2,3) ]) ],
## nsgclasses := [ [ 1, 3 ] ], nsgfactors := [ ] )
## gap> ClassPositionsOfNormalSubgroup( tbl, kernel );
## [ 1, 3 ]
Expand Down
42 changes: 33 additions & 9 deletions lib/grpperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1892,10 +1892,20 @@ end);
InstallMethod(SmallGeneratingSet,"random and generators subset, randsims",true,
[IsPermGroup],0,
function (G)
local i, j, U, gens,o,v,a,sel,min;
local i, j, U, gens,o,v,a,sel,min,orb,orp,ok;

# remove obvious redundancies
gens := ShallowCopy(Set(GeneratorsOfGroup(G)));

# try pc methods first. The solvability test should not exceed cost, nor
# the number of points.
if #Length(MovedPoints(G))<50000 and
#((HasIsSolvableGroup(G) and IsSolvableGroup(G)) or IsAbelian(G))
IsSolvableGroup(G)
and Length(gens)>3 then
return MinimalGeneratingSet(G);
fi;

# remove obvious redundancies
o:=List(gens,Order);
SortParallel(o,gens,function(a,b) return a>b;end);
sel:=Filtered([1..Length(gens)],x->o[x]>1);
Expand All @@ -1920,26 +1930,32 @@ local i, j, U, gens,o,v,a,sel,min;
od;
gens:=gens{sel};

# try pc methods first
if Length(MovedPoints(G))<1000 and HasIsSolvableGroup(G)
and IsSolvableGroup(G) and Length(gens)>3 then
return MinimalGeneratingSet(G);
fi;

# store orbit data
orb:=Set(List(Orbits(G,MovedPoints(G)),Set));
orp:=Filtered([1..Length(orb)],x->IsPrimitive(Action(G,orb[x])));

min:=2;
if Length(gens)>2 then
# minimal: AbelianInvariants
min:=Maximum(List(Collected(Factors(Size(G)/Size(DerivedSubgroup(G)))),x->x[2]));
if min=Length(GeneratorsOfGroup(G)) then return GeneratorsOfGroup(G);fi;
i:=Maximum(2,min);
while i<=min+1 and i<Length(gens) do
# try to find a small generating system by random search
j:=1;
while j<=5 and i<Length(gens) do
U:=Subgroup(G,List([1..i],j->Random(G)));
ok:=true;
# first test orbits
if ok then
ok:=Length(orb)=Length(Orbits(U,MovedPoints(U))) and
ForAll(orp,x->IsPrimitive(U,orb[x]));
fi;


StabChainOptions(U).random:=100; # randomized size
#Print("A:",i,",",j," ",Size(G)/Size(U),"\n");
if Size(U)=Size(G) then
if ok and Size(U)=Size(G) then
gens:=Set(GeneratorsOfGroup(U));
fi;
j:=j+1;
Expand All @@ -1955,6 +1971,14 @@ local i, j, U, gens,o,v,a,sel,min;
while i <= Length(gens) and Length(gens)>min do
# random did not improve much, try subsets
U:=Subgroup(G,gens{Difference([1..Length(gens)],[i])});

ok:=true;
# first test orbits
if ok then
ok:=Length(orb)=Length(Orbits(U,MovedPoints(U))) and
ForAll(orp,x->IsPrimitive(U,orb[x]));
fi;

StabChainOptions(U).random:=100; # randomized size
#Print("B:",i," ",Size(G)/Size(U),"\n");
if Size(U)<Size(G) then
Expand Down
6 changes: 3 additions & 3 deletions lib/teaching.g
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ DeclareGlobalFunction("CosetDecomposition");
## <A>H</A>-conjugacy.
## <Example><![CDATA[
## gap> AllHomomorphismClasses(SymmetricGroup(4),SymmetricGroup(3));
## [ [ (2,4,3), (1,2,3,4) ] -> [ (), () ],
## [ (2,4,3), (1,2,3,4) ] -> [ (), (1,2) ],
## [ (2,4,3), (1,2,3,4) ] -> [ (1,2,3), (1,2) ] ]
## [ [ (1,2,3), (2,4) ] -> [ (), () ],
## [ (1,2,3), (2,4) ] -> [ (), (1,2) ],
## [ (1,2,3), (2,4) ] -> [ (1,2,3), (1,2) ] ]
## ]]></Example>
## </Description>
## </ManSection>
Expand Down

0 comments on commit a7eec63

Please sign in to comment.