-
Notifications
You must be signed in to change notification settings - Fork 162
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
Performance additions to generic 2-cohomology and Automorphism group/Isomorphism test #4219
Changes from all commits
0d5f49e
b8bf767
243e07c
1474417
1e70559
2dbbe7f
3506a28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -939,6 +939,64 @@ InstallMethod( CompositionSeries, | |||||
"for simple group", true, [IsGroup and IsSimpleGroup], 100, | ||||||
S->[S,TrivialSubgroup(S)]); | ||||||
|
||||||
InstallMethod(CompositionSeriesThrough,"intersection/union",IsElmsColls, | ||||||
[IsGroup and IsFinite,IsList],0, | ||||||
function(G,normals) | ||||||
local cs,i,j,pre,post,c,new,rev; | ||||||
cs:=CompositionSeries(G); | ||||||
# find normal subgroups not yet in | ||||||
normals:=Filtered(normals,x->not x in cs); | ||||||
# do we satisfy by sheer dumb luck? | ||||||
if Length(normals)=0 then return cs;fi; | ||||||
|
||||||
SortBy(normals,x->-Size(x)); | ||||||
# check that this is a valid series | ||||||
Assert(0,ForAll([2..Length(normals)],i->IsSubset(normals[i-1],normals[i]))); | ||||||
|
||||||
# Now move series through normals by closure/intersection | ||||||
for j in normals do | ||||||
# first in cs that does not contain j | ||||||
pre:=PositionProperty(cs,x->not IsSubset(x,j)); | ||||||
# first contained in j. | ||||||
post:=PositionProperty(cs,x->Size(j)>=Size(x) and IsSubset(j,x)); | ||||||
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. Minor optimization possible?
Suggested change
|
||||||
|
||||||
# if j is in the series, then pre>post. pre=post impossible | ||||||
if pre<post then | ||||||
# so from pre to post-1 needs to be changed | ||||||
new:=cs{[1..pre-1]}; | ||||||
|
||||||
rev:=[j]; | ||||||
i:=post-1; | ||||||
repeat | ||||||
if not IsSubset(rev[Length(rev)],cs[i]) then | ||||||
c:=ClosureGroup(cs[i],j); | ||||||
if Size(c)>Size(rev[Length(rev)]) then | ||||||
# proper down step | ||||||
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. Why is adding a larger group a "down step"? |
||||||
Add(rev,c); | ||||||
fi; | ||||||
fi; | ||||||
i:=i-1; | ||||||
# at some point this must reach j, then no further step needed | ||||||
until Size(c)=Size(cs[pre-1]) or i<pre; | ||||||
Append(new,Filtered(Reversed(rev),x->Size(x)<Size(cs[pre-1]))); | ||||||
|
||||||
i:=pre; | ||||||
repeat | ||||||
if not IsSubset(cs[i],new[Length(new)]) then | ||||||
c:=Intersection(cs[i],j); | ||||||
if Size(c)<Size(new[Length(new)]) then | ||||||
# proper down step | ||||||
Add(new,c); | ||||||
fi; | ||||||
fi; | ||||||
i:=i+1; | ||||||
until Size(c)=Size(cs[post]); | ||||||
fi; | ||||||
cs:=Concatenation(new,cs{[post+1..Length(cs)]}); | ||||||
od; | ||||||
return cs; | ||||||
end); | ||||||
|
||||||
|
||||||
############################################################################# | ||||||
## | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -449,21 +449,29 @@ DeclareGlobalFunction("LowLayerSubgroups"); | |||||||||
|
||||||||||
############################################################################# | ||||||||||
## | ||||||||||
#O ContainedConjugates(<G>,<A>,<B>) | ||||||||||
#O ContainedConjugates(<G>,<A>,<B>[,<onlyone>]) | ||||||||||
## | ||||||||||
## <#GAPDoc Label="ContainedConjugates"> | ||||||||||
## <ManSection> | ||||||||||
## <Oper Name="ContainedConjugates" Arg='G, A, B'/> | ||||||||||
## <Oper Name="ContainedConjugates" Arg='G, A, B [,onlyone]'/> | ||||||||||
## | ||||||||||
## <Description> | ||||||||||
## For <M>A,B \leq G</M> this operation returns representatives of the <A>A</A> | ||||||||||
## conjugacy classes of subgroups that are conjugate to <A>B</A> under <A>G</A>. | ||||||||||
## The function returns a list of pairs of subgroup and conjugating element. | ||||||||||
## If the optional fourth argument <A>onlyone</A> is given as <A>true</A>, | ||||||||||
## then only one pair (or <A>fail</A> if none exists) is returned. | ||||||||||
Comment on lines
+462
to
+463
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.
Suggested change
|
||||||||||
## <Example><![CDATA[ | ||||||||||
## gap> g:=SymmetricGroup(8);; | ||||||||||
## gap> a:=TransitiveGroup(8,47);;b:=TransitiveGroup(8,7);; | ||||||||||
## gap> a:=TransitiveGroup(8,47);;b:=TransitiveGroup(8,9);; | ||||||||||
## gap> ContainedConjugates(g,a,b); | ||||||||||
## [ [ Group([ (1,4,2,5,3,6,8,7), (1,3)(2,8) ]), (2,4,5,3)(7,8) ] ] | ||||||||||
## [ [ Group([ (1,8)(2,3)(4,5)(6,7), (1,3)(2,8)(4,6)(5,7), (1,5)(2,6)(3,7)(4,8), | ||||||||||
## (4,5)(6,7) ]), () ], | ||||||||||
## [ Group([ (1,8)(2,3)(4,5)(6,7), (1,5)(2,6)(3,7)(4,8), (1,3)(2,8)(4,6)(5,7), | ||||||||||
## (2,3)(6,7) ]), (2,4)(3,5) ] ] | ||||||||||
## gap> ContainedConjugates(g,a,b,true); | ||||||||||
## [ Group([ (1,8)(2,3)(4,5)(6,7), (1,3)(2,8)(4,6)(5,7), (1,5)(2,6)(3,7)(4,8), | ||||||||||
## (4,5)(6,7) ]), () ] | ||||||||||
## ]]></Example> | ||||||||||
## </Description> | ||||||||||
## </ManSection> | ||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3187,21 +3187,22 @@ local act,offset,G,lim,cond,dosub,all,m,i,j,new,old; | |||||||||||||||||||||||||||||||||||
return all; | ||||||||||||||||||||||||||||||||||||
end); | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
############################################################################# | ||||||||||||||||||||||||||||||||||||
## | ||||||||||||||||||||||||||||||||||||
#F ContainedConjugates( <G>, <A>, <B> ) | ||||||||||||||||||||||||||||||||||||
## | ||||||||||||||||||||||||||||||||||||
InstallMethod(ContainedConjugates,"finite groups",IsFamFamFam,[IsGroup,IsGroup,IsGroup],0, | ||||||||||||||||||||||||||||||||||||
function(G,A,B) | ||||||||||||||||||||||||||||||||||||
local l,N,dc,gens,i; | ||||||||||||||||||||||||||||||||||||
DoContainedConjugates:=function(arg) | ||||||||||||||||||||||||||||||||||||
local G,A,B,onlyone,l,N,dc,gens,i; | ||||||||||||||||||||||||||||||||||||
G:=arg[1]; | ||||||||||||||||||||||||||||||||||||
A:=arg[2]; | ||||||||||||||||||||||||||||||||||||
B:=arg[3]; | ||||||||||||||||||||||||||||||||||||
if Length(arg)>3 then onlyone:=arg[4]; else onlyone:=false;fi; | ||||||||||||||||||||||||||||||||||||
Comment on lines
+3190
to
+3195
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. Could also do this:
Suggested change
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. Or this
Suggested change
and then change one InstallMethod below to use the following function instead: |
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
if not IsFinite(G) and IsFinite(A) and IsFinite(B) then | ||||||||||||||||||||||||||||||||||||
TryNextMethod(); | ||||||||||||||||||||||||||||||||||||
fi; | ||||||||||||||||||||||||||||||||||||
if not IsSubset(G,A) and IsSubset(G,B) then | ||||||||||||||||||||||||||||||||||||
Error("A and B must be subgroups of G"); | ||||||||||||||||||||||||||||||||||||
fi; | ||||||||||||||||||||||||||||||||||||
if Size(A) mod Size(B)<>0 then | ||||||||||||||||||||||||||||||||||||
return []; # cannot be contained by order | ||||||||||||||||||||||||||||||||||||
# cannot be contained by order | ||||||||||||||||||||||||||||||||||||
if onlyone then return fail;else return [];fi; | ||||||||||||||||||||||||||||||||||||
fi; | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
l:=[]; | ||||||||||||||||||||||||||||||||||||
|
@@ -3211,15 +3212,30 @@ local l,N,dc,gens,i; | |||||||||||||||||||||||||||||||||||
gens:=SmallGeneratingSet(B); | ||||||||||||||||||||||||||||||||||||
for i in dc do | ||||||||||||||||||||||||||||||||||||
if ForAll(gens,x->x^i[1] in A) then | ||||||||||||||||||||||||||||||||||||
if onlyone then return [B^i[1],i[1]];fi; | ||||||||||||||||||||||||||||||||||||
Add(l,[B^i[1],i[1]]); | ||||||||||||||||||||||||||||||||||||
fi; | ||||||||||||||||||||||||||||||||||||
od; | ||||||||||||||||||||||||||||||||||||
if onlyone then return fail;fi; | ||||||||||||||||||||||||||||||||||||
return l; | ||||||||||||||||||||||||||||||||||||
elif onlyone then | ||||||||||||||||||||||||||||||||||||
l:=DoConjugateInto(G,A,B,true); | ||||||||||||||||||||||||||||||||||||
if IsIdenticalObj(FamilyObj(l),FamilyObj(One(G))) then return [B^l,l]; | ||||||||||||||||||||||||||||||||||||
else return fail;fi; | ||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||
l:=DoConjugateInto(G,A,B,false); | ||||||||||||||||||||||||||||||||||||
return List(l,x->[B^x,x]); | ||||||||||||||||||||||||||||||||||||
fi; | ||||||||||||||||||||||||||||||||||||
end); | ||||||||||||||||||||||||||||||||||||
end; | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
############################################################################# | ||||||||||||||||||||||||||||||||||||
## | ||||||||||||||||||||||||||||||||||||
#F ContainedConjugates( <G>, <A>, <B> ) | ||||||||||||||||||||||||||||||||||||
## | ||||||||||||||||||||||||||||||||||||
InstallMethod(ContainedConjugates,"finite groups",IsFamFamFam, | ||||||||||||||||||||||||||||||||||||
[IsGroup,IsGroup,IsGroup],0,DoContainedConjugates); | ||||||||||||||||||||||||||||||||||||
InstallOtherMethod(ContainedConjugates,"onlyone",IsFamFamFamX, | ||||||||||||||||||||||||||||||||||||
[IsGroup,IsGroup,IsGroup,IsBool],0,DoContainedConjugates); | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
############################################################################# | ||||||||||||||||||||||||||||||||||||
## | ||||||||||||||||||||||||||||||||||||
|
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.
Just out of curiosity, is there a specific reason to use
IsSubset
instead ofIsSubgroup
here?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.
Perhaps there should also be a second assertion (perhaps run only at a higher assertion level) which verifies that
normals
truly consists of normal subgroups; and/or add a warning to the documentation that passing non-normal subgroups may result in wrong output?