# GAP:AllSmallGroups

This article is about a GAP function.

INTERNAL AD: To get summary information on groups of a given order on this wiki, type "groups of order <a>" where a is the order, into the search box. For instance, groups of order 8 gives information on the groups of order 8.

## Definition

### Function type

`AllSmallGroups` is a GAP function that takes as input a natural number and outputs a list of groups.

### Behavior

The function is supposed to return a list of all the groups whose order is the given natural number. This list is based on GAP's in-built library and the groups always appear in the same sequence in the list. GAP does not compute these groups on the spot.

The following caveats should be noted:

- For a finite solvable group, the group is stored as a
`PcGroup`: in other words, it is stored in terms of a polycyclic series for the group. Thus, if the group is solvable, the command`SmallGroup`returns a polycyclic series. - For a finite group that is
*not*solvable, the group is stored as a permutation group.

Error types:

- If the groups of order equal to the input are
*not*stored in the library, GAP returns an error stating that the library of groups of order is not available. - If the input is not a positive integer, GAP returns a usage error.

### Typical use

AllSmallGroups(n);

where is a natural number.

## Related functions

- GAP:SmallGroup: This takes as input an ordered pair of natural numbers , and returns the group of order .
- GAP:OneSmallGroup: This returns only
*one*group of order equal to the given natural number, namely, the first member of the list returned by`AllSmallGroups`. - GAP:SmallGroupsInformation: This provides verbal information on the groups of a given order and how they are stored in GAP's library.