# I need some help in GAP System

I am new to GAP system. I would like to find all groups of order $$p^n$$ with $$\text{Aut}(G) \to \text{Aut}(G/\Phi(G))$$ surjective.

$$\text{Aut}(G/Φ(G))=\text{GL}(L,p) \text{ and } G/Φ(G)= C^L× ......× C^L \text{ (p-times)}.$$

I'm trying to do that in GAP but i don't know how to find all groups. or is that true or not? As example the group is SmallGroup(n,p)

G:= SmallGroup(n,p);
StructureDescription(G);
A:= AutomorphismGroupPGroup(G);
l:= RankPGroup(G);
p:= PrimePGroup(G);

if Size(A) = Size(GL(n,l))*p^(l*(n-l)) then
return true;

TestCondition := function( G, d, p )
local A;

A := AutomorphismGroupPGroup(Factor(G, FrattiniSubgroup(G)));
if IsomorphismGroups(A, GL(d,p)) <> fail then
return true;
else
return false;
fi;
end;

for n in [1..100] do
if IsPrimePowerInt(n) then
for m in [1..NumberSmallGroups(n)] do
if TestCondition(SmallGroup(n,m)) = true then
# ...
fi;
od;
fi;
od;


Your condition test is quite expensive in testing for abstract isomorphism. It will be much cheaper to induce the matrix action on a basis of $$G/\Phi(G)$$ and check that the resulting group indeed is thew full GL. GAP code for this is:

TestCondition:=function(G)
local p,A,phi,pcgs,mats,m;
p:=PrimePGroup(G);
A:=AutomorphismGroup(G);
phi:=FrattiniSubgroup(G);
pcgs:=ModuloPcgs(G,phi);
mats:=List(GeneratorsOfGroup(A),hom->
List(pcgs,a->ExponentsOfPcElement(pcgs,ImagesRepresentative(hom,a))));
m:=Group(mats*One(GF(p)));
return Size(m)=Size(GL(Length(pcgs),p));
end;

• Thank you so much for this answer. Can I put this test inside a repetition to find all groups which have this property ? and which is better using command "for .... do" or "Repeat" i want test small group for n=1.......100 and prime p= 3...7. Nov 5, 2019 at 17:46
• @Elias have you seen alex-konovalov.github.io/gap-lesson/05-small-groups - you can use code from there with this TestCondition function. BTW, the library does not contain groups of order $p^n$ for all $n=1,...,100$ and prime $p= 3,...,7$. Nov 5, 2019 at 21:33
• Yes, i have already seen and thinking about this statement i dont know if its usefull " gap> for n in [1..360] do > if not IsPrimePowerInt(n) then ".. i thought maybe there is another code to make iteraton.. thanks alot for your advice! Im new with GAP, so that i ask alot. Nov 6, 2019 at 7:53
• @Elias no problem, please ask! Of course you can adapt the code to iterate only over those orders which you need, etc. Nov 6, 2019 at 11:25