# Basic Group Properties

## Infrastructure

The functions described here provide access to basic information stored for a pc-group $G$.

### `G . i: GrpPC, RngIntElt -> GrpPCElt`

The $i$-th pc-generator for $G$. A negative subscript indicates that the inverse of the generator is to be created. $G.0$ is `Identity(G)`.

### `Generators(G): GrpPC -> SetEnum`

A set containing the defining generators for $G$. If $G$ is a $p$-group, this is guaranteed to be a minimal set of generators. For non-$p$-groups, this will be the set of pc-generators.

### `NumberOfGenerators(G): GrpPC -> RngIntElt`

### `Ngens(G): GrpPC -> RngIntElt`

The number of defining generators for $G$.

### `PCGenerators(G): GrpPC -> SetIndx`

An indexed set containing the pc-generators for $G$.

### `NumberOfPCGenerators(G): GrpPC -> RngIntElt`

### `NPCGenerators(G): GrpPC -> RngIntElt`

### `NPCgens(G): GrpPC -> RngIntElt`

The number of pc-generators for $G$.

### `PCPrimes(G): GrpPC -> [RngIntElt]`

A sequence [$p_1,\ldots,p_n$] containing the primes associated with the pc-generators of $G$. The $i$-th term of the sequence contains the prime associated with generator $a_i$ of $G$ for $i = 1,\ldots,n$.

## Numerical Invariants

Magma has built-in functions to compute the order and exponent of a group.

### `Order(G): GrpPC -> RngIntElt`

### `# G: GrpPC -> RngIntElt`

The order of the group $G$, returned as an ordinary integer.

### `FactoredOrder(G): GrpPC -> [<RngIntElt, RngIntElt>]`

The factored order of the group $G$.

### `Exponent(G): GrpPC -> RngIntElt`

The exponent of the group $G$.

## Predicates

Magma has built-in functions to check standard group properties.

### `IsAbelian(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is abelian, `false` otherwise.

### `IsCyclic(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is cyclic, `false` otherwise.

### `IsElementaryAbelian(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is elementary abelian, `false` otherwise.

### `IsNilpotent(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is nilpotent, `false` otherwise.

### `IsPerfect(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is perfect, `false` otherwise. A soluble group $G$ is perfect only if it is trivial.

### `IsSimple(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is simple, `false` otherwise.

### `IsSoluble(G): GrpPC -> BoolElt`

### `IsSolvable(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is soluble, `false` otherwise. It always returns the value `true` for a pc-group.

### `IsTrivial(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ has order 1, `false` otherwise.

### `IsSpecial(G): GrpPC -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is special, `false` otherwise.

### `IsExtraSpecial(G): GrpPC -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is extra-special, `false` otherwise.

### `Example: Group Props (ex-e86fe2)`

We use a presentation to define an extraspecial 3-group of exponent 9.

```magma
> E := PolycyclicGroup<a1,a2,b1,b2,z|a1^3,a2^3,b1^3=z,b2^3=z,
>   z^3,b1^a1=b1*z,b2^a2=b2*z>;

```

The sequence of base, exponent pairs from `FactoredOrder` shows us that the group has order $3^5$.

```magma
> FactoredOrder(E);
[ <3, 5> ]
> Exponent(E);
9

```

As well as with the `Order` function, one can get the size of a group by using the `#` shorthand.

```magma
> D3 := DihedralGroup(GrpPC, 3);
> #D3;
6
> IsNilpotent(D3);
false

```
