Skip to content

Commit

Permalink
Update ThrowAwayFixedPoints
Browse files Browse the repository at this point in the history
Now ThrowAwayFixedPoints also prunes fixed points if the input group
knows that it is primitive and has fixed points. If the input group does
not know whether it is primitive yet but has fixed points, then
ThrowAwayFixedPoints now returns NotEnoughInformation.

Adds a comment in LargeBasePrimitive which explains how this fixes gap-packages#190.
That is this commit lets recog handle primitive groups which can be
recognized by LargeBasePrimitive, except for the fact that they have
fixed points.

Also changes the tests in PermLargeBasePrimitive.tst to make them run a
bit faster.

Fixes gap-packages#190.

Co-authored-by: Max Horn <[email protected]>
  • Loading branch information
ssiccha and fingolfin committed Apr 7, 2021
1 parent f4cf7d3 commit ffe3f79
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 19 deletions.
44 changes: 32 additions & 12 deletions gap/perm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -355,24 +355,44 @@ end;
#! @BeginChunk ThrowAwayFixedPoints
#! This method defines a homomorphism of a permutation group
#! <A>G</A> to the action on the moved points of <A>G</A> if
#! <A>G</A> does not have too many moved points. In the current setup, the
#! homomorphism is defined if the number <M>k</M> of moved
#! either <A>G</A> has a lot of fixed points, or if <A>G</A> knows that it is
#! primitive and has fixed points. If <A>G</A> has fixed points but does not
#! know whether it is primitive, then it returns <K>NotEnoughInformation</K>
#! so that it may be called again at a later time.
#! In all other cases, it returns <K>NeverApplicable</K>.
#! <P/>
#!
#! In the current setup, the
#! homomorphism is defined if the number <M>n</M> of moved
#! points is at most <M>1/3</M> of the largest moved point of <A>G</A>,
#! or <M>k</M> is at most half of the number of points on which
#! <A>G</A> is stored internally by &GAP;. The method returns
#! <K>NeverApplicable</K> if it does not define a homomorphism indicating that it will
#! never succeed.
#! or <M>n</M> is at most half of the number of points on which
#! <A>G</A> is stored internally by &GAP;.
#! <P/>
#!
#! The fact that this method returns <K>NotEnoughInformation</K> if <A>G</A>
#! has fixed points but does not know whether it is primitive, is important for
#! the efficient handling of large-base primitive groups by
#! <Ref Func="LargeBasePrimitive"/>.
#! @EndChunk
FindHomMethodsPerm.ThrowAwayFixedPoints :=
function( ri, G )
FindHomMethodsPerm.ThrowAwayFixedPoints := function( ri, G )
# Check, whether we can throw away fixed points
local gens,hom,l,n,o;
local gens,nrStoredPoints,n,largest,isApplicable,o,hom;

gens := GeneratorsOfGroup(G);
l := List(gens,StoredPointsPerm);
nrStoredPoints := Maximum(List(gens,StoredPointsPerm));
n := NrMovedPoints(G);
if 2*n > Maximum(l) or 3*n > LargestMovedPoint(G) then # we do nothing
return NeverApplicable;
largest := LargestMovedPoint(G);
# If isApplicable is true, we definitely are applicable.
isApplicable := 3*n <= largest or 2*n <= nrStoredPoints
or (HasIsPrimitive(G) and IsPrimitive(G) and n < largest);
# If isApplicable is false, we might become applicable if G figures out
# that it is primitive.
if not isApplicable then
if not HasIsPrimitive(G) and n < largest then
return NotEnoughInformation;
else
return NeverApplicable;
fi;
fi;
o := MovedPoints(G);
hom := ActionHomomorphism(G,o);
Expand Down
19 changes: 16 additions & 3 deletions gap/perm/largebase.gi
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ end;

#! @BeginChunk LargeBasePrimitive
#! This method tries to determine whether the input group <A>G</A> is a
#! large-base primitive group that neither is a symmetric nor an alternating
#! fixed-point-free large-base primitive group that neither is a symmetric nor an alternating
#! group in its natural action.
#! This method is an implementation of <Cite Key="LNPS06"/>.
#!
Expand All @@ -507,6 +507,19 @@ end;
#! <M>r \cdot k > 1</M>
#! and <M>2 \cdot r \cdot k^2 \le n</M>.
#!
#! A large primitive group <M>H</M> of the above type which does have fixed
#! points is handled as follows: if the group <M>H</M> does not know yet that
#! it is primitive, then <Ref Func="ThrowAwayFixedPoints"/> returns
#! <K>NotEnoughInformation</K>. After the first call to
#! <C>LargeBasePrimitive</C>, the group <M>H</M> knows that it is primitive,
#! but since it has fixed points <C>LargeBasePrimitive</C> returns
#! <K>NeverApplicable</K>. Since <Ref Func="ThrowAwayFixedPoints"/> previously
#! returned <K>NotEnoughInformation</K>, it will be called again. Then it will
#! use the new information about <M>H</M> being primitive, and is guaranteed to
#! prune away the fixed points and set up a reduction homomorphism.
#! <C>LargeBasePrimitive</C> is then applicable to the image of that
#! homomorphism.
#!
#! If <A>G</A> is imprimitive then the output is
#! <K>NeverApplicable</K>. If <A>G</A> is primitive then
#! the output is either a homomorphism into the
Expand All @@ -515,8 +528,7 @@ end;
#! <K>NeverApplicable</K> if no parameters <M>n</M>, <M>k</M>, and <M>r</M> as
#! above exist.
#! @EndChunk
FindHomMethodsPerm.LargeBasePrimitive :=
function(ri,grp)
FindHomMethodsPerm.LargeBasePrimitive := function(ri,grp)
local res,T,seen,imgens,hom;
if not IsPermGroup(grp) then
return NeverApplicable;
Expand All @@ -526,6 +538,7 @@ FindHomMethodsPerm.LargeBasePrimitive :=
fi;
RECOG.SetPseudoRandomStamp(grp,"Jellyfish");
res := RECOG.AllJellyfish(grp);
RECOG.SetPseudoRandomStamp(grp,"PseudoRandom");
if res = NeverApplicable or res = TemporaryFailure then
return res;
fi;
Expand Down
26 changes: 22 additions & 4 deletions tst/working/quick/PermLargeBasePrimitive.tst
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
#@local S19OnSets, jellyGroup, n, random, jellyGroupConj, ri
#@local S17OnSets, jellyGroup, n, random, jellyGroupConj, ri
#@local addFixedPointsPerm, jellyGroupWithFixedPoints, riWithFixed

# Test for LargeBasePrimitive
gap> S19OnSets := Action(SymmetricGroup(19), Combinations([1 .. 19], 2), OnSets);;
gap> jellyGroup := WreathProductProductAction(S19OnSets, Group((1,2)));;
gap> S17OnSets := Action(SymmetricGroup(17), Combinations([1 .. 17], 2), OnSets);;
gap> jellyGroup := WreathProductProductAction(S17OnSets, Group((1,2)));;
gap> n := NrMovedPoints(jellyGroup);;
gap> # Take a random conjugate
gap> random := Random(SymmetricGroup(n));;
gap> jellyGroupConj := jellyGroup ^ random;;
gap> RECOG.TestGroup(jellyGroupConj,
gap> ri := RECOG.TestGroup(jellyGroupConj,
> false,
> Size(jellyGroup),
> rec(tryNonGroupElements := true));;
gap> ri!.fhmethsel.successMethod;
"LargeBasePrimitive"

# Test that groups with fixed points are handled together by
# ThrowAwayFixedPoints and LargeBasePrimitive, confer:
# https://github.com/gap-packages/recog/issues/190
# https://github.com/gap-packages/recog/pull/191
gap> addFixedPointsPerm := Random(SymmetricGroup(5 * QuoInt(n,2)));;
gap> jellyGroupWithFixedPoints := jellyGroup ^ addFixedPointsPerm;;
gap> riWithFixed := RECOG.TestGroup(jellyGroupWithFixedPoints,
> false,
> Size(jellyGroup),
> rec(tryNonGroupElements := true));;
gap> riWithFixed!.fhmethsel.successMethod;
"ThrowAwayFixedPoints"
gap> RIFac(riWithFixed)!.fhmethsel.successMethod;
"LargeBasePrimitive"

0 comments on commit ffe3f79

Please sign in to comment.