Skip to content

Commit 8dffef2

Browse files
committed
ENHANCE: Performance improvements to automorphism group computations.
Includes improvements to `SmallGeneratingSet` for perm groups. Also dealt with changed generators in manual examples
1 parent 29e61b3 commit 8dffef2

File tree

5 files changed

+48
-20
lines changed

5 files changed

+48
-20
lines changed

doc/tut/group.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,9 @@ usual way we now look for the subgroups above <C>u105</C>.
833833
gap> blocks := Blocks( a8, orb );; Length( blocks );
834834
15
835835
gap> blocks[1];
836-
[ (1,2)(3,4)(5,6)(7,8), (1,3)(2,4)(5,8)(6,7), (1,4)(2,3)(5,7)(6,8),
837-
(1,5)(2,6)(3,8)(4,7), (1,6)(2,5)(3,7)(4,8), (1,7)(2,8)(3,6)(4,5),
838-
(1,8)(2,7)(3,5)(4,6) ]
836+
[ (1,2)(3,4)(5,6)(7,8), (1,3)(2,4)(5,7)(6,8), (1,4)(2,3)(5,8)(6,7),
837+
(1,5)(2,6)(3,7)(4,8), (1,6)(2,5)(3,8)(4,7), (1,7)(2,8)(3,5)(4,6),
838+
(1,8)(2,7)(3,6)(4,5) ]
839839
]]></Example>
840840
<P/>
841841
To find the subgroup of index 15 we again use closure. Now we must be a
@@ -1175,8 +1175,8 @@ gap> aut := AutomorphismGroup( p );; NiceMonomorphism(aut);;
11751175
gap> niceaut := NiceObject( aut );
11761176
Group([ (1,4,2,3), (1,5,4)(2,6,3), (1,2)(3,4), (3,4)(5,6) ])
11771177
gap> IsomorphismGroups( niceaut, SymmetricGroup( 4 ) );
1178-
[ (1,4,2,3), (1,5,4)(2,6,3), (1,2)(3,4), (3,4)(5,6) ] ->
1179-
[ (1,4,3,2), (1,4,2), (1,3)(2,4), (1,4)(2,3) ]
1178+
[ (1,4,2,3), (1,5,4)(2,6,3), (1,2)(3,4), (3,4)(5,6) ] ->
1179+
[ (1,4,2,3), (1,2,3), (1,2)(3,4), (1,3)(2,4) ]
11801180
]]></Example>
11811181
<P/>
11821182
The range of a nice monomorphism is in most cases a permutation group,

lib/autsr.gi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,11 @@ local d,a,map,possibly,cG,cH,nG,nH,i,j,sel,u,v,asAutomorphism,K,L,conj,e1,e2,
941941
u:=ClosureGroup(i,K);
942942
v:=ClosureGroup(i,L);
943943
if u<>v then
944-
gens:=SmallGeneratingSet(api);
944+
if IsSolvableGroup(api) then
945+
gens:=Pcgs(api);
946+
else
947+
gens:=SmallGeneratingSet(api);
948+
fi;
945949
pre:=List(gens,x->PreImagesRepresentative(iso,x));
946950
map:=RepresentativeAction(SubgroupNC(a,pre),u,v,asAutomorphism);
947951
if map=fail then

lib/ctbl.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4380,11 +4380,11 @@ DeclareGlobalFunction( "NormalSubgroupClasses" );
43804380
## Character( CharacterTable( S4 ), [ 3, 1, -1, 0, -1 ] ),
43814381
## Character( CharacterTable( S4 ), [ 1, 1, 1, 1, 1 ] ) ]
43824382
## gap> kernel:= KernelOfCharacter( irr[3] );
4383-
## Group([ (1,2)(3,4), (1,3)(2,4) ])
4383+
## Group([ (1,2)(3,4), (1,4)(2,3) ])
43844384
## gap> HasNormalSubgroupClassesInfo( tbl );
43854385
## true
43864386
## gap> NormalSubgroupClassesInfo( tbl );
4387-
## rec( nsg := [ Group([ (1,2)(3,4), (1,3)(2,4) ]) ],
4387+
## rec( nsg := [ Group([ (1,2)(3,4), (1,4)(2,3) ]) ],
43884388
## nsgclasses := [ [ 1, 3 ] ], nsgfactors := [ ] )
43894389
## gap> ClassPositionsOfNormalSubgroup( tbl, kernel );
43904390
## [ 1, 3 ]

lib/grpperm.gi

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,10 +1892,20 @@ end);
18921892
InstallMethod(SmallGeneratingSet,"random and generators subset, randsims",true,
18931893
[IsPermGroup],0,
18941894
function (G)
1895-
local i, j, U, gens,o,v,a,sel,min;
1895+
local i, j, U, gens,o,v,a,sel,min,orb,orp,ok;
18961896

1897-
# remove obvious redundancies
18981897
gens := ShallowCopy(Set(GeneratorsOfGroup(G)));
1898+
1899+
# try pc methods first. The solvability test should not exceed cost, nor
1900+
# the number of points.
1901+
if #Length(MovedPoints(G))<50000 and
1902+
#((HasIsSolvableGroup(G) and IsSolvableGroup(G)) or IsAbelian(G))
1903+
IsSolvableGroup(G)
1904+
and Length(gens)>3 then
1905+
return MinimalGeneratingSet(G);
1906+
fi;
1907+
1908+
# remove obvious redundancies
18991909
o:=List(gens,Order);
19001910
SortParallel(o,gens,function(a,b) return a>b;end);
19011911
sel:=Filtered([1..Length(gens)],x->o[x]>1);
@@ -1920,26 +1930,32 @@ local i, j, U, gens,o,v,a,sel,min;
19201930
od;
19211931
gens:=gens{sel};
19221932

1923-
# try pc methods first
1924-
if Length(MovedPoints(G))<1000 and HasIsSolvableGroup(G)
1925-
and IsSolvableGroup(G) and Length(gens)>3 then
1926-
return MinimalGeneratingSet(G);
1927-
fi;
1928-
1933+
# store orbit data
1934+
orb:=Set(List(Orbits(G,MovedPoints(G)),Set));
1935+
orp:=Filtered([1..Length(orb)],x->IsPrimitive(Action(G,orb[x])));
19291936

19301937
min:=2;
19311938
if Length(gens)>2 then
19321939
# minimal: AbelianInvariants
19331940
min:=Maximum(List(Collected(Factors(Size(G)/Size(DerivedSubgroup(G)))),x->x[2]));
1941+
if min=Length(GeneratorsOfGroup(G)) then return GeneratorsOfGroup(G);fi;
19341942
i:=Maximum(2,min);
19351943
while i<=min+1 and i<Length(gens) do
19361944
# try to find a small generating system by random search
19371945
j:=1;
19381946
while j<=5 and i<Length(gens) do
19391947
U:=Subgroup(G,List([1..i],j->Random(G)));
1948+
ok:=true;
1949+
# first test orbits
1950+
if ok then
1951+
ok:=Length(orb)=Length(Orbits(U,MovedPoints(U))) and
1952+
ForAll(orp,x->IsPrimitive(U,orb[x]));
1953+
fi;
1954+
1955+
19401956
StabChainOptions(U).random:=100; # randomized size
19411957
#Print("A:",i,",",j," ",Size(G)/Size(U),"\n");
1942-
if Size(U)=Size(G) then
1958+
if ok and Size(U)=Size(G) then
19431959
gens:=Set(GeneratorsOfGroup(U));
19441960
fi;
19451961
j:=j+1;
@@ -1955,6 +1971,14 @@ local i, j, U, gens,o,v,a,sel,min;
19551971
while i <= Length(gens) and Length(gens)>min do
19561972
# random did not improve much, try subsets
19571973
U:=Subgroup(G,gens{Difference([1..Length(gens)],[i])});
1974+
1975+
ok:=true;
1976+
# first test orbits
1977+
if ok then
1978+
ok:=Length(orb)=Length(Orbits(U,MovedPoints(U))) and
1979+
ForAll(orp,x->IsPrimitive(U,orb[x]));
1980+
fi;
1981+
19581982
StabChainOptions(U).random:=100; # randomized size
19591983
#Print("B:",i," ",Size(G)/Size(U),"\n");
19601984
if Size(U)<Size(G) then

lib/teaching.g

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ DeclareGlobalFunction("CosetDecomposition");
194194
## <A>H</A>-conjugacy.
195195
## <Example><![CDATA[
196196
## gap> AllHomomorphismClasses(SymmetricGroup(4),SymmetricGroup(3));
197-
## [ [ (2,4,3), (1,2,3,4) ] -> [ (), () ],
198-
## [ (2,4,3), (1,2,3,4) ] -> [ (), (1,2) ],
199-
## [ (2,4,3), (1,2,3,4) ] -> [ (1,2,3), (1,2) ] ]
197+
## [ [ (1,2,3), (2,4) ] -> [ (), () ],
198+
## [ (1,2,3), (2,4) ] -> [ (), (1,2) ],
199+
## [ (1,2,3), (2,4) ] -> [ (1,2,3), (1,2) ] ]
200200
## ]]></Example>
201201
## </Description>
202202
## </ManSection>

0 commit comments

Comments
 (0)