-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: (Maximal) subgroups computation. #2488
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,7 +209,7 @@ end); | |
## the operation of G on the Right Cosets of U. | ||
## | ||
InstallGlobalFunction( IntermediateGroup, function(G,U) | ||
local o,b,img,G1,c,m,hardlimit,gens,t,k,intersize; | ||
local o,b,img,G1,c,m,mt,hardlimit,gens,t,k,intersize; | ||
|
||
if U=G then | ||
return fail; | ||
|
@@ -221,34 +221,38 @@ local o,b,img,G1,c,m,hardlimit,gens,t,k,intersize; | |
return fail; # avoid infinite recursion | ||
fi; | ||
|
||
# use maximals | ||
m:=MaximalSubgroupClassReps(G:cheap,intersize:=intersize); | ||
|
||
m:=Filtered(m,x->Size(x) mod Size(U)=0 and Size(x)>Size(U)); | ||
SortBy(m,x->Size(G)/Size(x)); | ||
|
||
gens:=SmallGeneratingSet(U); | ||
for c in m do | ||
if Index(G,c)<50000 then | ||
t:=RightTransversal(G,c:noascendingchain); # conjugates | ||
for k in t do | ||
if ForAll(gens,x->k*x/k in c) then | ||
Info(InfoCoset,2,"Found Size ",Size(c),"\n"); | ||
# U is contained in c^k | ||
return c^k; | ||
# use maximals, use `Try` as we call with limiting options | ||
IsNaturalAlternatingGroup(G); | ||
IsNaturalSymmetricGroup(G); | ||
m:=TryMaximalSubgroupClassReps(G:cheap,intersize:=intersize,nolattice); | ||
if m<>fail and Length(m)>0 then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. |
||
|
||
m:=Filtered(m,x->Size(x) mod Size(U)=0 and Size(x)>Size(U)); | ||
SortBy(m,x->Size(G)/Size(x)); | ||
|
||
gens:=SmallGeneratingSet(U); | ||
for c in m do | ||
if Index(G,c)<50000 then | ||
t:=RightTransversal(G,c:noascendingchain); # conjugates | ||
for k in t do | ||
if ForAll(gens,x->k*x/k in c) then | ||
Info(InfoCoset,2,"Found Size ",Size(c),"\n"); | ||
# U is contained in c^k | ||
return c^k; | ||
fi; | ||
od; | ||
else | ||
t:=DoConjugateInto(G,c,U,true:intersize:=intersize,onlyone:=true); | ||
if t<>fail and t<>[] then | ||
Info(InfoCoset,2,"Found Size ",Size(c),"\n"); | ||
return c^(Inverse(t)); | ||
fi; | ||
od; | ||
else | ||
t:=DoConjugateInto(G,c,U,true:intersize:=intersize,onlyone:=true); | ||
if t<>fail and t<>[] then | ||
Info(InfoCoset,2,"Found Size ",Size(c),"\n"); | ||
return c^(Inverse(t)); | ||
fi; | ||
fi; | ||
od; | ||
od; | ||
|
||
Info(InfoCoset,2,"Found no intermediate subgroup ",Size(G)," ",Size(U)); | ||
return fail; | ||
Info(InfoCoset,2,"Found no intermediate subgroup ",Size(G)," ",Size(U)); | ||
return fail; | ||
fi; | ||
|
||
# old code -- obsolete | ||
|
||
|
@@ -824,7 +828,7 @@ local c, flip, maxidx, refineChainActionLimit, cano, tryfct, p, r, t, | |
fi; | ||
end; | ||
|
||
for i in MaximalSubgroupClassReps(G:cheap) do | ||
for i in TryMaximalSubgroupClassReps(G:cheap) do | ||
if Index(G,i)<maxidx(c) and Index(G,i)<badlimit then | ||
p:=Intersection(a,i); | ||
if Index(a,p)<uplimit then | ||
|
@@ -846,7 +850,7 @@ local c, flip, maxidx, refineChainActionLimit, cano, tryfct, p, r, t, | |
|
||
if maxidx(c)>10*actlimit then | ||
|
||
r:=ShallowCopy(MaximalSubgroupClassReps(a:cheap)); | ||
r:=ShallowCopy(TryMaximalSubgroupClassReps(a:cheap)); | ||
r:=Filtered(r,x->Index(a,x)<uplimit); | ||
|
||
Sort(r,function(a,b) return Size(a)<Size(b);end); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1357,6 +1357,53 @@ end); | |
## | ||
#M MaximalSubgroups( <G> ) | ||
## | ||
InstallMethod(MaximalSubgroupClassReps,"default, catch dangerous options", | ||
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong. |
||
true,[IsGroup],0, | ||
function(G) | ||
local H,a,m,i,l; | ||
# easy case, go without options | ||
if not HasTryMaximalSubgroupClassReps(G) then | ||
return TryMaximalSubgroupClassReps(G: | ||
# as if options were unset | ||
cheap:=fail,intersize:=fail,inmax:=fail,nolattice:=fail); | ||
fi; | ||
|
||
# hard case -- `Try` is stored | ||
if not IsBound(G!.maxsubtrytaint) or G!.maxsubtrytaint=false then | ||
# stored and untainted, just go on | ||
return TryMaximalSubgroupClassReps(G); | ||
fi; | ||
|
||
# compute anew for new group to avoid taint | ||
H:=Group(GeneratorsOfGroup(G)); | ||
for i in [Size,IsNaturalAlternatingGroup,IsNaturalSymmetricGroup] do | ||
if Tester(i)(G) then Setter(i)(H,i(G));fi; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So how do we ensure that these three attributes are the only relevant ones for computations of maximal subgroups? What about e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are currently the only two for which special methods for maximal subgroups are installed. |
||
od; | ||
m:=TryMaximalSubgroupClassReps(H: | ||
cheap:=false,intersize:=false,inmax:=false,nolattice:=false); | ||
l:=[]; | ||
for i in m do | ||
a:=SubgroupNC(G,GeneratorsOfGroup(i)); | ||
if HasSize(i) then SetSize(a,Size(i));fi; | ||
Add(l,a); | ||
od; | ||
|
||
# now we know list is untained, store | ||
SetTryMaximalSubgroupClassReps(G,l); | ||
return l; | ||
|
||
end); | ||
|
||
InstallMethod(TryMaximalSubgroupClassReps,"fetch known correct data",true, | ||
[IsGroup and HasMaximalSubgroupClassReps],SUM_FLAGS, | ||
MaximalSubgroupClassReps); | ||
|
||
InstallGlobalFunction(TryMaxSubgroupTainter,function(G) | ||
if ForAny(["cheap","intersize","inmax","nolattice"], | ||
x->not ValueOption(x) in [fail,false]) then | ||
G!.maxsubtrytaint:=true; | ||
fi; | ||
end); | ||
|
||
############################################################################# | ||
## | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1767,10 +1767,12 @@ end); | |
#F MaximalSubgroupClassReps(<G>) . . . . reps of conjugacy classes of | ||
#F maximal subgroups | ||
## | ||
InstallMethod(MaximalSubgroupClassReps,"using lattice",true,[IsGroup],0, | ||
InstallMethod(TryMaximalSubgroupClassReps,"using lattice",true,[IsGroup],0, | ||
function (G) | ||
local maxs,lat; | ||
|
||
TryMaxSubgroupTainter(G); | ||
if ValueOption("nolattice")=true then return fail;fi; | ||
#AH special AG treatment | ||
if not HasIsSolvableGroup(G) and IsSolvableGroup(G) then | ||
return MaximalSubgroupClassReps(G); | ||
|
@@ -2345,6 +2347,7 @@ InstallMethod(IntermediateSubgroups,"using maximal subgroups", | |
1, # better than previous if index larger | ||
function(G,U) | ||
local uind,subs,incl,i,j,k,m,gens,t,c,p,conj,bas,basl,r; | ||
|
||
if (not IsFinite(G)) and Index(G,U)=infinity then | ||
TryNextMethod(); | ||
fi; | ||
|
@@ -2359,11 +2362,13 @@ local uind,subs,incl,i,j,k,m,gens,t,c,p,conj,bas,basl,r; | |
gens:=SmallGeneratingSet(U); | ||
while i<=Length(subs) do | ||
if conj[i]<>fail then | ||
m:=MaximalSubgroupClassReps(subs[conj[i][1]]); # fetch attribute | ||
m:=TryMaximalSubgroupClassReps(subs[conj[i][1]]:nolattice); # fetch | ||
if m=fail then TryNextMethod();fi; | ||
m:=List(m,x->x^conj[i][2]); | ||
else | ||
# find all maximals containing U | ||
m:=MaximalSubgroupClassReps(subs[i]); | ||
m:=TryMaximalSubgroupClassReps(subs[i]:nolattice); | ||
if m=fail then TryNextMethod();fi; | ||
fi; | ||
m:=Filtered(m,x->IndexNC(subs[i],U) mod IndexNC(subs[i],x)=0); | ||
|
||
|
@@ -2814,11 +2819,10 @@ InstallGlobalFunction("SubgroupsTrivialFitting",function(G) | |
ValueOption(NO_PRECOMPUTED_DATA_OPTION)<>true then | ||
Info(InfoPerformance,2,"Using Table of Marks Library"); | ||
go:=ImagesSource(tom[1]); | ||
tom:=tom[2]; | ||
Info(InfoLattice,1, "Fetching subgroups of simple ", | ||
Identifier(tom)," from table of marks"); | ||
len:=LengthsTom(tom); | ||
sub:=List([1..Length(len)],x->RepresentativeTom(tom,x)); | ||
Identifier(tom[2])," from table of marks"); | ||
len:=LengthsTom(tom[2]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks plausible to me, thanks. Quick remark on the commit message: It contains the string "partially fixes #2586" -- GitHub sees that, but only the "fixes #2586" bit, it doesn't care about the "partially". As a result, if this commit gets merged, GitHub will close issue #2586. One workaround is to rephrase this to e.g. |
||
sub:=List([1..Length(len)],x->PreImage(tom[1],RepresentativeTom(tom[2],x))); | ||
return sub; | ||
fi; | ||
fi; | ||
|
@@ -2846,14 +2850,15 @@ InstallGlobalFunction("SubgroupsTrivialFitting",function(G) | |
tom:=TomDataAlmostSimpleRecognition(i); | ||
if tom<>fail then | ||
go:=ImagesSource(tom[1]); | ||
tom:=tom[2]; | ||
if tom<>fail and | ||
if tom[2]<>fail and | ||
ValueOption(NO_PRECOMPUTED_DATA_OPTION)<>true then | ||
Info(InfoPerformance,2,"Using Table of Marks Library"); | ||
Info(InfoLattice,1, "Fetching subgroups of simple ", | ||
Identifier(tom)," from table of marks"); | ||
len:=LengthsTom(tom); | ||
sub:=List([1..Length(len)],x->RepresentativeTom(tom,x)); | ||
Identifier(tom[2])," from table of marks"); | ||
len:=LengthsTom(tom[2]); | ||
# different than above -- no preimage. We're setting subgroups | ||
# of go | ||
sub:=List([1..Length(len)],x->RepresentativeTom(tom[2],x)); | ||
sub:=List(sub,x->ConjugacyClassSubgroups(go,x)); | ||
SetConjugacyClassesSubgroups(go,sub); | ||
fi; | ||
|
@@ -2864,7 +2869,6 @@ InstallGlobalFunction("SubgroupsTrivialFitting",function(G) | |
fi; | ||
Add(gold,go); | ||
|
||
|
||
p:=Length(types); | ||
fi; | ||
Add(iso,IsomorphismGroups(i,gold[p])); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# test for MaximalSubgroupClassReps with options (reported through | ||
# observation by S.Alavi with IntermediateGroup | ||
# More complicated to construct w/o AtlasSubgroup to ensure the 325 points | ||
# action, as it is too slow otherwise. | ||
# Also construct the smaller subgroup | ||
# s1 directly. Finally do not slow down with assertions that don't need | ||
# testing here | ||
|
||
gap> START_TEST("noassert"); | ||
gap> SetAssertionLevel(0);; | ||
gap> g:=SU(IsPermGroup,4,4);; | ||
gap> sy:=SylowSubgroup(g,2);; | ||
gap> n:=Filtered(NormalSubgroups(sy),x->IsAbelian(x) and Size(x)=256);; | ||
gap> sub:=Normalizer(g,n[1]);; | ||
gap> g:=Action(g,RightTransversal(g,sub),OnRight);; | ||
gap> NrMovedPoints(g);Size(g); | ||
325 | ||
1018368000 | ||
gap> s:=Stabilizer(g,1);; | ||
gap> s1:=Complementclasses(s,RadicalGroup(s));; | ||
gap> s1:=s1[1];;Size(s1); | ||
4080 | ||
gap> n1:= Normalizer( g, s1 );; Size( n1 ); | ||
24480 | ||
gap> int:=IntermediateGroup(g,s1);; | ||
gap> IsGroup(int); | ||
true | ||
gap> STOP_TEST("noassert"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above two lines are new. I assume they are meant to ensure better methods are applied, if possible? I.e. an optimization, but not a vital part of the fix? (Just trying to understand).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But this optimization is checked for in manual and test examples.