# 37.9 The 3-Groups Library

The library of 3-groups contains all the 3-groups of size dividing 729. There are a total of 594 such groups, 1 of size 3, 2 of size 9, 5 of size 27, 15 of size 81, 67 of size 243, and 504 of size 729.

`AllThreeGroups( fun1, val1, fun2, val2, ... )`

`AllThreeGroups` returns the list of all the 3-groups that have the properties given as arguments. Each property is specified by passing a pair of arguments, the first is a function that can be applied to each group, the second is either a single value or a list of values that the function must return in order to select that group.

```    gap> l := AllThreeGroups( Size, 243, Rank, [2..4], pClass, 3 );;
gap> Length ( l );
33
gap>  List( l, g -> Length( ConjugacyClasses( g ) ) );
[ 35, 35, 35, 35, 35, 35, 35, 243, 99, 99, 51, 51, 51, 51, 51, 51,
51, 51, 99, 35, 243, 99, 99, 51, 51, 51, 51, 51, 35, 35, 35, 35, 35
] ```

`OneThreeGroup( fun1, val1, fun2, val2, ... )`

`OneThreeGroup` returns a single 3-group that has the properties given as arguments. Each property is specified by passing a pair of arguments, the first is a function that can be applied to each group, the second is either a single value or a list of values that the function must return in order to select that group.

```    gap> g := OneThreeGroup( Size, 729, Rank, 4, pClass, [3..5] );
Group( a1, a2, a3, a4, a5, a6 )
gap> IsAbelian( g );
true ```

`AllThreeGroups` and `OneThreeGroup` recognize the following functions and handle them usually very efficiently. `Size`, `Rank` for the rank of the Frattini quotient of the group, and `pClass` for the exponent-p class of the group. Note that `Rank` and `pClass` are dummy functions that can be used only in this context, i.e., they cannot be applied to arbitrary groups.

`ThreeGroup( size, nr )`

`ThreeGroup` returns the nr-th group of size size. The group is returned as a finite polycyclic group (see Finite Polycyclic Groups). `ThreeGroup` will signal an error if size is not a power of 3 between 3 and 729, or nr is larger than the number of groups of size size.

Within each size the following criteria have been used, in turn, to determine the index position of a group in the list

1:
increasing generator number;

2:
increasing exponent-3 class;

3:
the position of its parent in the list of groups of appropriate size;

4:
the list in which the Newman and O'Brien implementation of the p-group generation algorithm outputs the immediate descendants of a group.

```    gap> g := ThreeGroup( 243, 56 );
Group( a1, a2, a3, a4, a5 )
gap> pClass( g );
3
gap> g.abstractRelators;
[ a1^3, a2^3, a2^-1*a1^-1*a2*a1*a4^-1, a3^3, a3^-1*a1^-1*a3*a1,
a3^-1*a2^-1*a3*a2*a5^-1, a4^3, a4^-1*a1^-1*a4*a1*a5^-1,
a4^-1*a2^-1*a4*a2, a4^-1*a3^-1*a4*a3, a5^3, a5^-1*a1^-1*a5*a1,
a5^-1*a2^-1*a5*a2, a5^-1*a3^-1*a5*a3, a5^-1*a4^-1*a5*a4 ] ```

Apart from the usual components described in Group Records, the group records returned by the above functions have the following components.

`rank`:

rank of Frattini quotient of G.

`pclass`:

exponent-p class of G.

`abstractGenerators`:

a list of abstract generators of G (see AbstractGenerator).

`abstractRelators`:

a list of relators of G stored as words in the abstract generators.

Descriptions of the algorithms used in constructing the library data may be found in citeOBr90,OBr91.

The library was generated and brought into GAP format by E.A.~O'Brien and Colin Rhodes. David Baldwin, M.F.~Newman, and Maris Ozols have contributed in various ways to this project and to correctly determining these groups. The library design is modelled on and borrows extensively from the 2-groups library, which was brought into GAP format by Werner Nickel, Alice Niemeyer, and E.A.~O'Brien.

GAP 3.4.4
April 1997