Skip to content

Commit

Permalink
ENHANCE: Improvement to perm rep of fp.
Browse files Browse the repository at this point in the history
Try to use induced permutation representation, if we cannot find easily
coreless subgroup that finishes coset enumeration.

This resolves #5222
  • Loading branch information
hulpke authored and fingolfin committed Dec 5, 2022
1 parent 55da583 commit df91fdb
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 32 deletions.
7 changes: 7 additions & 0 deletions lib/ghomfp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,10 @@ DeclareGlobalFunction("LargerQuotientBySubgroupAbelianization");
## <#/GAPDoc>
##
DeclareGlobalFunction("ProcessEpimorphismToNewFpGroup");

#############################################################################
##
#M InducedRepFpGroup(<hom>,<u> )
##
## induce <hom> def. on <u> up to the full group
DeclareGlobalFunction("InducedRepFpGroup");
2 changes: 1 addition & 1 deletion lib/ghomfp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ end);
#M InducedRepFpGroup(<hom>,<u> )
##
## induce <hom> def. on <u> up to the full group
BindGlobal("InducedRepFpGroup",function(thom,s)
InstallGlobalFunction(InducedRepFpGroup,function(thom,s)
local t,w,c,q,chom,tg,hi,u;
w:=FamilyObj(s)!.wholeGroup;

Expand Down
100 changes: 69 additions & 31 deletions lib/grpfp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -3989,7 +3989,7 @@ InstallGlobalFunction(IsomorphismPermGroupOrFailFpGroup,
function(arg)
local mappow, G, max, p, gens, rels, comb, i, l, m, H, t, gen, silent, sz,
t1, bad, trial, b, bs, r, nl, o, u, rp, eo, rpo, e, e2, sc, j, z,
timerFunc;
timerFunc,amax,iso,useind;

timerFunc := GET_TIMER_FROM_ReproducibleBehaviour();

Expand Down Expand Up @@ -4101,36 +4101,70 @@ local mappow, G, max, p, gens, rels, comb, i, l, m, H, t, gen, silent, sz,
max:=sz*10;
fi;

# Do not die on large coset table
amax:=max;
if max>10^4*sz then
max:=10^3*sz;
fi;

useind:=false;
t1:=timerFunc();
bad:=[];
i:=1;
while Size(H)<sz and i<=Length(comb) do
trial:=comb[i];
if not ForAny(bad,i->IsSubset(i,trial)) then
Info(InfoFpGroup,1,"Try subgroup ",trial);
t:=CosetTableFromGensAndRels(gens,rels,trial:silent:=true,max:=max );
if t<>fail then
Info(InfoFpGroup,1,"has index ",IndexCosetTab(t));
p:=t{[1,3..Length(t)-1]};
Unbind(t);
for j in [1..Length(p)] do
p[j]:=PermList(p[j]);
od;
H:= GroupByGenerators( p );
# compute stabilizer chain with size info.
if Length(trial)=0 then
# regular is faithful
SetSize(H,sz);
else
StabChain(H,rec(limit:=sz));
fi;
else
# note that this subset fails a coset enumeration
Add(bad,Set(trial));
while max<amax do
bad:=[];
i:=1;
while Size(H)<sz and i<=Length(comb) do
trial:=comb[i];
if not ForAny(bad,i->IsSubset(i,trial)) then
Info(InfoFpGroup,1,"Try subgroup ",trial," with ",max);
t:=CosetTableFromGensAndRels(gens,rels,trial:silent:=true,max:=max );
if t<>fail then
Info(InfoFpGroup,1,"has index ",IndexCosetTab(t));
p:=t{[1,3..Length(t)-1]};
Unbind(t);
for j in [1..Length(p)] do
p[j]:=PermList(p[j]);
od;
H:= GroupByGenerators( p );
# compute stabilizer chain with size info.
if Length(trial)=0 then
# regular is faithful
SetSize(H,sz);
else
StabChain(H,rec(limit:=sz));
fi;


# try to use induced rep
if Size(H)<sz and Size(H)>1 then
iso:=IsomorphismFpGroup(SubgroupNC(G,
List(trial,x->ElementOfFpGroup(FamilyObj(One(G)),x))
):silent:=true,max:=2*max);
H:=Range(iso);
t:=IsomorphismPermGroupOrFailFpGroup(H,max);
if t<>fail then
t:=iso*t;
iso:=InducedRepFpGroup(t,Source(iso));
H:=Group(List(GeneratorsOfGroup(G),
x->ImagesRepresentative(iso,x)));
StabChain(H,rec(limit:=sz));
if IsAbelian(H) then
t:=MinimalFaithfulPermutationRepresentation(H);
H:=Group(List(GeneratorsOfGroup(H),
x->ImagesRepresentative(t,x)));
StabChain(H,rec(limit:=sz));
fi;
useind:=true;
fi;
fi;
else
# note that this subset fails a coset enumeration
Add(bad,Set(trial));
fi;
fi;
fi;

i:=i+1;
i:=i+1;
od;
max:=Minimum(amax,max*10);
od;

if Size(H)<sz then
Expand All @@ -4140,8 +4174,8 @@ local mappow, G, max, p, gens, rels, comb, i, l, m, H, t, gen, silent, sz,

Info(InfoFpGroup,1,"faithful representation of degree ",NrMovedPoints(H));

# regular case?
if Size(H)=NrMovedPoints(H) then
# regular case (unless induced)?
if Size(H)=NrMovedPoints(H) and not useind then
t1:=timerFunc()-t1;
# try to find a cyclic subgroup that gives a faithful rep.
b:=fail;
Expand Down Expand Up @@ -4198,7 +4232,11 @@ local mappow, G, max, p, gens, rels, comb, i, l, m, H, t, gen, silent, sz,

fi;

p:=SmallerDegreePermutationRepresentation(H:cheap);
if NrMovedPoints(H)*10>=Size(H) then
p:=SmallerDegreePermutationRepresentation(H);
else
p:=SmallerDegreePermutationRepresentation(H:cheap);
fi;
# tell the family that we can now compare elements
SetCanEasilyCompareElements(FamilyObj(One(G)),true);
SetCanEasilySortElements(FamilyObj(One(G)),true);
Expand Down

0 comments on commit df91fdb

Please sign in to comment.