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.

Fixes gap-packages#190.
  • Loading branch information
ssiccha committed Dec 12, 2020
1 parent 174590b commit 5b648ce
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 11 deletions.
35 changes: 25 additions & 10 deletions gap/perm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -347,24 +347,39 @@ 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> does not know whether it is
#! primitive and has fixed points, 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;.
#! @EndChunk
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
9 changes: 9 additions & 0 deletions gap/perm/largebase.gi
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,14 @@ 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. After a call of <C>LargeBasePrimitive</C>,
#! the group <M>H</M> knows that it is primitive. Thus, after
#! LargeBasePrimitive returns <K>NeverApplicable</K>, the function
#! <Ref Func="ThrowAwayFixedPoints"/> will prune away the fixed points and set
#! up a 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 @@ -526,6 +534,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
18 changes: 17 additions & 1 deletion tst/working/quick/PermLargeBasePrimitive.tst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#@local S19OnSets, jellyGroup, n, random, jellyGroupConj, ri
#@local addFixedPointsPerm, jellyGroupWithFixedPoints, riWithFixed

# Test for LargeBasePrimitive
gap> S19OnSets := Action(SymmetricGroup(19), Combinations([1 .. 19], 2), OnSets);;
Expand All @@ -7,7 +8,22 @@ 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.
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 5b648ce

Please sign in to comment.