Presentation for hand calculation I am looking for a presentation of SmallGroup(32,7) which is  more amenable to hand calculation. More precisely, I used the following comments to find a presentation of the above group and $$\langle a,b\mid b^2=(aba)^2=(a^{-1}bab)^2=a^8=1 \rangle$$ is obtained.
gap> G:=SmallGroup(m,n);
     H:=Image(IsomorphismFpGroup(G));
     RelatorsOfFpGroup(H);
     SimplifiedFpGroup(H);

On the other hand, from the library of GAP, we know that $SmallGroup(32,7)$  is isomorphic to $(\mathbb Z_8\rtimes \mathbb Z_2)\rtimes \mathbb Z_2$. But the above presentation does not interpret $(\mathbb Z_8\rtimes \mathbb Z_2)\rtimes \mathbb Z_2$. Now my question is
How can I find a presentation for $G$ such that it interprets $(\mathbb Z_8\rtimes \mathbb Z_2)\rtimes \mathbb Z_2$?
 A: The routines for computing presentations try foremost to produce a reasonably small presentation and don't focus on trying to reflect possible semi direct product structures. So to get a presentation that reflects this structure, it probably is quickest to build it by hand. First lets find the (sub)normal subgroups of order 16 and 8:
gap> G:=SmallGroup(32,7);
<pc group of size 32 with 5 generators>
gap> n:=Filtered(NormalSubgroups(G),x->Size(x)=16
> and Length(Complementclasses(G,x))>0);
[ Group([ f1*f2, f3, f4, f5 ]), Group([ f1, f3, f4, f5 ]) ]
gap> StructureDescription(n[1]);
"C8 : C2"
gap> u:=Filtered(NormalSubgroups(n[1]),x->Size(x)=8 and IsCyclic(x));
[ Group([ f1*f2*f4, f3*f4, f5 ]), Group([ f1*f2, f3*f4, f5 ]) ]
gap> Complementclasses(n[1],u[1]);
[ <pc group with 1 generators> ]

So n[1] and u[1] are suitable subgroups, having complements. Now we pick generators:
gap> b:=last[1].1;Order(b);
f3*f5
2
gap> a:=SmallGeneratingSet(u[1])[1];Order(a);
f1*f2*f3*f5
8
gap> Complementclasses(G,n[1]);   
[ <pc group with 1 generators>, <pc group with 1 generators> ]
gap> c:=last[1].1;Order(c);
f2
2

Now identify how $b$ acts on $\langle a\rangle$, and how $c$ acts on $\langle a,b\rangle$:
gap> Factorization(Group(a),a^b);
x1^-3
gap> h:=Group(a,b);           
<pc group with 2 generators>
gap> Factorization(h,a^c);
x2*x1
gap> Factorization(h,b^c);
x2

We now have a presentation $\langle a,b,c\mid a^8=b^2=c^2=1,a^b=a^{-3},a^c=ba,b^c=b\rangle$. The semidirect product stucture implies that the order is not larger than 32, but we can check this:
gap> f:=FreeGroup("a","b","c");
<free group on the generators [ a, b, c ]>
gap> g:=f/ParseRelators(f,"a^8=b^2=c^2=1,a^b=a^-3,a^c=ba,b^c=b");  
<fp group on the generators [ a, b, c ]>
gap> Size(g);
32
gap> IsomorphismGroups(g,G);
[ a, b, c ] -> [ f1*f3*f4*f5, f3*f5, f2*f3 ]

(Ot that this isomorphism does not find images as we chose them, we could also build the isomorphism by hand (constructing the homomorphism verifies the isomorphism property):
gap> isom:=GroupHomomorphismByImages(g,G,GeneratorsOfGroup(g),[a,b,c]);
[ a, b, c ] -> [ f1*f2*f3*f5, f3*f5, f2 ]
gap> IsBijective(isom);
true

