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

Add FrattiniSubgroup for nilpotent groups #583

Merged
merged 3 commits into from
Mar 28, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
26 changes: 26 additions & 0 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,32 @@ RedispatchOnCondition( FittingSubgroup, true, [IsGroup], [IsFinite], 0);
##
#M FrattiniSubgroup( <G> ) . . . . . . . . . . Frattini subgroup of a group
##
InstallMethod( FrattiniSubgroup, "generic method for nilpotent groups",
[ IsGroup ],
RankFilter( IsGroup and IsNilpotentGroup )
- RankFilter( IsGroup ),
function(G)
local i, p, q, gen, Gf;
if IsTrivial(G) then
return G;
elif IsAbelian(G) then
gen := [ ];
for i in [1..Length(AbelianInvariants(G))] do
q := AbelianInvariants(G)[i];
if q<>0 and not IsPrime(q) then
p := SmallestRootInt(q);
Add(gen, IndependentGeneratorsOfAbelianGroup(G)[i]^p);
fi;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling AbelianInvariants and IndependentGeneratorsOfAbelianGroup again and again like that makes me cringe. While we cache these values, each of these calls incurs an overhead, as the system has to perform a lookup in a component object. So please store those into temporary variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fingolfin Ok, now I call them in the beginning and then use the elements of this stored list.
The reason I did not want to do this was that if an abelian group has only invariants of 0 and prime then we would not even need to call IndependentGenerators, which could be more expensive than AbelianInvariants.

od;
return SubgroupNC(G, gen);
elif IsNilpotentGroup(G) then
Gf := CommutatorFactorGroup(G);
return PreImage(NaturalHomomorphism(Gf), FrattiniSubgroup(Gf));
else
TryNextMethod();
fi;
end);

InstallMethod( FrattiniSubgroup, "generic method for groups", [ IsGroup ],0,
function(G)
local m;
Expand Down
9 changes: 4 additions & 5 deletions lib/grpperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1593,15 +1593,14 @@ end );
##
InstallMethod( FrattiniSubgroup,"for permgrp", true, [ IsPermGroup ], 0,
function( G )
local fac, p, l, k, i, j;
local p, l, k, i, j;

fac := Set( FactorsInt( Size( G ) ) );
if Length( fac ) > 1 then
if not IsPGroup( G ) then
TryNextMethod();
elif fac[1]=1 then
elif IsTrivial( G ) then
return G;
fi;
p := fac[ 1 ];
p := PrimePGroup( G );
l := GeneratorsOfGroup( G );
k := [ l[1]^p ];
for i in [ 2 .. Length(l) ] do
Expand Down
20 changes: 20 additions & 0 deletions tst/testinstall/opers/FrattiniSubgroup.tst
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
gap> START_TEST("FrattiniSubgroup.tst");

#
gap> FrattiniSubgroup(Group(()));
Group(())
gap> FrattiniSubgroup(Group((1,3),(1,2,3,4)));
Group([ (1,3)(2,4) ])
gap> D := DihedralGroup(IsFpGroup,8);;
gap> FrattiniSubgroup(D)=Group([ D.1^2 ]);
true
gap> F := FreeGroup("x", "y", "z");; x := F.1;; y := F.2;; z := F.3;;
gap> G := F/[x^(-1)*y^(-1)*x*y, x^(-1)*z^(-1)*x*z, z^(-1)*y^(-1)*z*y, x^180, y^168];;
gap> HasIsAbelian(FrattiniSubgroup(G));
true
gap> GeneratorsOfGroup(FrattiniSubgroup(G));
[ (x^-195*y^196)^6, (x^-1*y)^630, (x^-1*y)^840 ]
gap> F := FrattiniSubgroup(DirectProduct(DihedralGroup(IsFpGroup,8), SmallGroup(27,4)));;
gap> IdGroup(F);
[ 6, 2 ]
gap> HasIsNilpotentGroup(F);
true

#
gap> FrattiniSubgroup(SymmetricGroup(3));
Group(())
Expand Down