# Using GAP for finite soluble groups

```
gap> g := DihedralGroup(8);
<pc group of size 8 with 3 generators>
gap> List( [g.1, g.2, g.3], Order );
[ 2, 4, 2 ]
gap> g.2^2 = g.3;
true
gap> g.2^g.1 = g.2^-1;
true
gap> Center(g);
Group([ f3 ])
gap> x := Random(g); y := Random(g); x*y;
f1*f3
f1*f2
f2*f3
gap> g.2*g.1;
f1*f2*f3
gap> DihedralGroup(8) = DihedralGroup(8);
false
gap> IsomorphismGroups( DihedralGroup(8), DihedralGroup(8) );
[ f1, f2, f3 ] -> [ f1, f2, f3 ]
gap> g = Group( g.1, g.2 );
true
gap> SmallGroupsInformation(12);

There are 5 groups of order 12.
1 is of type 6.2.
2 is of type c12.
3 is of type A4.
4 is of type D12.
5 is of type 2^2x3.

The groups whose order factorises in at most 3 primes
have been classified by O. Hoelder. This classification is
used in the SmallGroups library.

This size belongs to layer 1 of the SmallGroups library.
IdSmallGroup is available for this size.

gap> NumberSmallGroups(12);
5
gap> h := SmallGroup(8,4);
<pc group of size 8 with 3 generators>
gap> StructureDescription(h);
"Q8"
gap> IdGroup(DihedralGroup(8));
[ 8, 3 ]
gap> StructureDescription(SmallGroup(8,3));
"D8"
gap> mytestfunction:=g->Order(g)=10^7;;
gap> for n in [1..20] do
> Print("Working on the ",NrSmallGroups(n)," groups of order ",n,"\n");
> for k in [1..NrSmallGroups(n)] do
> sg:=SmallGroup(n,k);
> if mytestfunction(sg)
> then Error("Got one! ",[n,k]);
> fi; od; od;
Working on the 1 groups of order 1
Working on the 1 groups of order 2
Working on the 1 groups of order 3
Working on the 2 groups of order 4
Working on the 1 groups of order 5
Working on the 2 groups of order 6
Working on the 1 groups of order 7
Working on the 5 groups of order 8
Working on the 2 groups of order 9
Working on the 2 groups of order 10
Working on the 1 groups of order 11
Working on the 5 groups of order 12
Working on the 1 groups of order 13
Working on the 2 groups of order 14
Working on the 1 groups of order 15
Working on the 14 groups of order 16
Working on the 1 groups of order 17
Working on the 5 groups of order 18
Working on the 1 groups of order 19
Working on the 5 groups of order 20
gap> IdsOfAllSmallGroups( Size, [3,6..12],
> IsAbelian, false,
> g -> IsNormal(g,SylowSubgroup(g,3)),true );
[ [ 6, 1 ], [ 12, 1 ], [ 12, 4 ] ]
gap> NrSmallGroups(1024);
49487365422
gap> f := FreeGroup( 3 );
<free group on the generators [ f1, f2, f3 ]>
gap> g := f/[f.1^2, f.2^2/f.3, f.3^2, f.2^f.1/f.2^-1,f.3^f.1/f.3, f.3^f.2/f.3 ];
<fp group on the generators [ f1, f2, f3 ]>
gap> Order(g);
8
gap> hom := IsomorphismPcGroup(g);
[ f1, f2, f3 ] -> [ f2, f1, f3 ]
gap> IsPcGroup(h);
true
gap> IsFpGroup(g);
true
gap> PcGroupFpGroup(g);
<pc group of size 8 with 3 generators>
gap> g:=ElementaryAbelianGroup(4);;
gap> a:=AutomorphismGroup(g);;
gap> ag:=SemidirectProduct(a,g);
<pc group with 4 generators>
gap> StructureDescription(ag);
"S4"
gap> quit;
```