Skip to content
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

Some improvements for LatticeByCyclicExtension #905

Merged
merged 5 commits into from
Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,33 @@ InstallMethod( IsCyclic,
fi;
end );

InstallMethod( Size,
"for a cyclic group",
[ IsGroup and IsCyclic and HasGeneratorsOfGroup ],
-RankFilter(HasGeneratorsOfGroup),
function(G)
local gens;
if HasMinimalGeneratingSet(G) then
gens:=MinimalGeneratingSet(G);
else
gens:=GeneratorsOfGroup(G);
fi;
if Length(gens) = 1 and gens[1] <> One(G) then
SetMinimalGeneratingSet(G,gens);
return Order(gens[1]);
elif Length(gens) <= 1 then
SetMinimalGeneratingSet(G,[]);
return 1;
fi;
TryNextMethod();
end);

InstallMethod( MinimalGeneratingSet,"cyclic groups",true,
[ IsGroup and IsCyclic and IsFinite ],
RankFilter(IsFinite and IsPcGroup),
function ( G )
local g;
if Size(G)=1 then return [];fi;
if IsTrivial(G) then return []; fi;
g:=Product(IndependentGeneratorsOfAbelianGroup(G),One(G));
Assert( 1, Index(G,Subgroup(G,[g])) = 1 );
return [g];
Expand Down Expand Up @@ -387,9 +408,9 @@ InstallMethod( IsNilpotentGroup,
#M IsPerfectGroup( <G> ) . . . . . . . . . . . . test if a group is perfect
##
InstallImmediateMethod( IsPerfectGroup,
IsGroup and IsSolvableGroup and HasSize,
IsSolvableGroup and HasIsTrivial,
0,
grp -> Size( grp ) = 1 );
IsTrivial );

InstallMethod( IsPerfectGroup,
"method for finite groups",
Expand Down
12 changes: 9 additions & 3 deletions lib/grplatt.gi
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,22 @@ function (G,func)
local zuppos, # set of zuppos,result
c, # a representative of a class of elements
o, # its order
h, # the subgroup < c > of G
N, # normalizer of < c >
t; # loop variable

if HasZuppos(G) then
return Filtered(Zuppos(G), c -> func(Subgroup(G,[c])));
fi;

# compute the zuppos
zuppos:=[One(G)];
for c in List(ConjugacyClasses(G),Representative) do
o:=Order(c);
if func(Group(c)) and IsPrimePowerInt(o) then
h:=Subgroup(G,[c]);
if IsPrimePowerInt(o) and func(h) then
if ForAll([2..o],i -> Gcd(o,i) <> 1 or not c^i in zuppos) then
N:=Normalizer(G,Subgroup(G,[c]));
N:=Normalizer(G,h);
for t in RightTransversal(G,N) do
Add(zuppos,c^t);
od;
Expand Down Expand Up @@ -290,7 +296,7 @@ local G, # group
G:=arg[1];
noperf:=false;
zuppofunc:=false;
if Length(arg)>1 and IsFunction(arg[2]) then
if Length(arg)>1 and (IsFunction(arg[2]) or IsList(arg[2])) then
func:=arg[2];
Info(InfoLattice,1,"lattice discarding function active!");
if IsList(func) then
Expand Down
20 changes: 20 additions & 0 deletions tst/testinstall/opers/LatticeByCyclicExtension.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
gap> START_TEST("LatticeByCyclicExtension.tst");

#
gap> G:=SmallGroup(625,1);
<pc group of size 625 with 4 generators>
gap> A:=AutomorphismGroup(G);
<group of size 500 with 7 generators>
gap> fun:=g->IsInt(4/Size(g));;
gap> LatticeByCyclicExtension(A);
<subgroup lattice of <group of size 500 with 7 generators>, 12 classes,
12 subgroups>
gap> LatticeByCyclicExtension(A, fun);
<subgroup lattice of <group of size 500 with 7 generators>, 3 classes,
3 subgroups, restricted under further condition l!.func>
gap> LatticeByCyclicExtension(A, [fun,fun]);
<subgroup lattice of <group of size 500 with 7 generators>, 3 classes,
3 subgroups, restricted under further condition l!.func>

#
gap> STOP_TEST("LatticeByCyclicExtension.tst", 1);