# Conjugacy

## `Class(H, x): GrpMat, GrpMatElt -> { GrpMatElt }`

## `Conjugates(H, x): GrpMat, GrpMatElt -> { GrpMatElt }`

Given a group $H$ and an element $x$ belonging to a group $K$ such that $H$ and $K$ are subgroups of the same general linear group, this function returns the set of conjugates of $x$ under the action of $H$. If $H = K$, the function returns the conjugacy class of $x$ in $H$.

## `ClassMap(G): GrpMat -> Map`

Given a group $G$, construct the conjugacy classes and the class map $f$ for $G$. For any element $x$ of $G$, $f(x)$ will be the conjugacy class representative chosen by the `Classes` function.

## `ConjugacyClasses(G: parameters): GrpMat -> [ < RngIntElt, RngIntElt, GrpMatElt > ]`

## `Classes(G: parameters): GrpMat -> [ < RngIntElt, RngIntElt, GrpMatElt > ]`

```magma
WeakLimit  : RngIntElt                    Default: 500
StrongLimit: RngIntElt                    Default: 5000
Al         : MonStgElt                    Default: 
```

Construct a set of representatives for the conjugacy classes of the matrix group $G$. The classes are returned as a sequence of triples containing the element order, the class length and a representative element for the class. The parameter `Al` enables the user to select the algorithm that is to be used.

`Al := "Action"`: Create the classes of $G$ by computing the orbits of the set of elements of $G$ under the action of conjugation. This option is only feasible for small groups.

`Al := "Random"`: Construct the conjugacy classes of elements for a matrix group $G$ using an algorithm that searches for representatives of all conjugacy of $G$ by examining a random selection of group elements and their powers. The behaviour of this algorithm is controlled by two associated optional parameters `WeakLimit` and `StrongLimit`, whose values are positive integers $n_1$ and $n_2$, say. Before describing the effect of these parameters, some definitions are needed: A mapping $f: G\rightarrow I$ is called a class invariant if $f(g) = f(g^h)$ for all $g, h\in G$. In matrix groups, the primary invariant factors are used where possible, or the characteristic or minimal polynomials otherwise. Two matrices $g$ and $h$ are said to be *weakly conjugate* with respect to the class invariant $f$ if $f(g) = f(h)$. By definition, conjugacy implies weak conjugacy, but the converse is false. The random algorithm first examines $n_1$ random elements and their powers, using a test for weak conjugacy. It then proceeds to examine a further $n_2$ random elements and their powers, using a test for ordinary conjugacy. The idea behind this strategy is that the algorithm should attempt to find as many classes as possible using the very cheap test for weak conjugacy, before employing the more expensive ordinary conjugacy test to recognize the remaining classes.

`Al := "Extend"`: Construct the conjugacy classes of $G$ by first computing classes in a quotient $G/N$ and then extending these classes to successively larger quotients $G/H$ until the classes for $G/1$ are known. More precisely, a series of subgroups $1 = G_0 < G_1 < \cdots < G_r = R < G$ is computed such that $R$ is the (solvable) radical of $G$ and $G_{i+1}/G_i$ is elementary abelian. The radical quotient $G/R$ is computed and its classes and centralizers of their representatives found using the permutation group algorithm, and pulled back to $G$. The parameters `TFAl` and `ASAl` control the algorithm used to compute the classes of $G/R$. See the `GrpPerm` chapter for more information on these parameters.

To extend from $G/G_{i+1}$ to the next larger quotient $G/G_i$, an affine action of each centralizer on a quotient of the elementary abelian layer $G_{i+1}/G_i$ is computed. Each distinct orbit in that action gives rise to a new class of the larger quotient (see Mecky and Neubuser [[Mecky and Neubüser, 1989](../../references.md#cite-mecky-neubuser)]).

`Al := "Lifting"`: Construct a permutation representation for $G$, compute the classes of the representation, and lift them back to $G$ through the kernel of the representation. Successful when the kernel is small. Currently uses the permutation action of $G$ on its first basic orbit as the permutation representation.

`Al := "Classic"`: Construct the conjugacy classes by the enumeration of class invariants or by the algorithms described in [[Franceschi, 2020](../../references.md#cite-defranceschi-2020)]. This option is available only for the following classical groups.

**(i)**
groups containing the special linear group;

**(ii)**
the symplectic groups;

**(iii)**
in odd characteristic, the subgroups of the conformal symplectic group that contain the symplectic group;

**(iv)**
the conformal unitary group;

**(v)**
subgroups of the general unitary group that contain the special unitary group;

**(vi)**
the general and special orthogonal groups and the derived groups of the special orthogonal groups;

**(vii)**
the conformal orthogonal groups in odd characteristic.

*Default*: The `Classic` algorithm will be used if $G$ is recognised to be one of the groups in the above list and $|G| > 100$.

The action algorithm will be used if $|G| \leq 2000$. If $G$ is soluble, classes are computed in a PC-representation of $G$.

When $|G| >  2000$, $G$ is not classical and the base ring of $G$ is a finite field, the `Extension` algorithm is used.

Otherwise the `Lifting` algorithm is used, unless the kernel size exceeds 10000. If there is a big kernel and the base ring of the group can be embedded in a field then the extension algorithm is used. If this does not succeed the random algorithm will be applied with the limits given by the parameters `WeakLimit` and `StrongLimit`. If that fails to compute all the classes and $|G|\leq 100000$, then the action algorithm will be used.

## `ClassRepresentative(G, x): GrpMat, GrpMatElt -> GrpMatElt`

## `ClassRepresentative(G, i): GrpMat, RngIntElt -> GrpMatElt`

Given a group $G$ for which the conjugacy classes are known, return the designated representative for the conjugacy class of $G$ containing $x$ or the stored representative for conjugacy class $i$.

## `ClassCentraliser(G, i): GrpMat, RngIntElt -> GrpMat`

## `ClassCentralizer(G, i): GrpMat, RngIntElt -> GrpMat`

The centraliser of the representative element stored for conjugacy class number $i$ in group $G$. The group computed is stored with the class table for reference by future calls to this function.

## `ClassRepresentativeFromInvariants(G, p, h, t): GrpMat, SeqEnum, SeqEnum, FldFinElt -> GrpMatElt`

Given a group $G$, for which the *classic* algorithm for computing conjugacy classes is available, and the class invariants $p$, $h$ and $t$, return the standard class representative for the conjugacy class in $G$ with the given invariants. Currently this is available only for the general linear group and the conformal unitary group.

## `IsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt | Unass`

Given a group $G$ and elements $g$ and $h$ belonging to $G$, return the value `true` if $g$ and $h$ are conjugate in $G$. The function returns a second value in the event that the elements are conjugate: an element $k$ which conjugates $g$ into $h$.

## `NumberOfClasses(G): GrpMat -> RngIntElt`

## `Nclasses(G): GrpMat -> RngIntElt`

The number of conjugacy classes of elements for the group $G$.

## `PowerMap(G): GrpMat -> Map`

Given a group $G$, construct the power map for $G$. Suppose that the order of $G$ is $m$ and that $G$ has $r$ conjugacy classes. When the classes are determined by Magma, they are numbered from $1$ to $r$. Let $C$ be the set of class indices $\{ 1, \ldots, r \rbrace$ and let $P$ be the set of integers $\{ 1, \ldots, m \rbrace$. The *power map* $f$ for $G$ is the mapping,  $f : C \times P \rightarrow C$ where the value of $f(i, j)$ for $i \in C$ and $j \in P$ is the number of the class which contains $x_i^j$, where $x_i$ is a representative of the $i$-th conjugacy class.

## `AssertAttribute(G, "Classes", Q): GrpMat, MonStgElt, SeqEnum`

The preferred method for setting this attribute is `G`Classes := Q;` and this should be used instead of `AssertAttribute`. Given a group $G$, and a sequence $Q$ of $k$ distinct elements of $G$, one from each conjugacy class, use $Q$ to define the classes attribute of $G$. The sequence $Q$ may be one of 3 options. The first is a sequence of elements of $G$. The second is a sequence of pairs `<GrpMatElt, RngIntElt>` giving class representatives and their class length. In these cases the ordering of the classes may not be preserved. The third possibility is giving the classes by element order, class length, and class representative as a sequence of triples `<RngIntElt, RngIntElt, GrpMatElt>`. In this last case the triples must be ordered by element order, then by class length, and then the classes are installed into $G$ in the order given.

## `Example: Rational Matrix Group Database (ex-f393ee)`

We take a group from the database of rational matrix groups and compute its conjugacy classes. The group has degree 12 and is written over the integers.

```magma
> DB := RationalMatrixGroupDatabase();
> G := Group(DB, 12, 3);
> FactoredOrder(G);
[ <2, 17>, <3, 8>, <5, 2> ]
> CompositionFactors(G);
    G
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  C(2, 3)                = S(4, 3)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  C(2, 3)                = S(4, 3)
    *
    |  Cyclic(2)
    1

```

The conjugacy classes of `G` are computed as follows:

```magma
> time cl := Classes(G);
Time: 18.580
> #cl;
1325

```

The group has 1325 conjugacy classes of elements.

## Conjugacy in Classical Groups

According to Kleidman and Liebeck [[Kleidman and Liebeck, 1990](../../references.md#cite-kl90)] a group $G$ is a finite classical group if $\Omega\subseteq G\subseteq A$ or $\overline{\Omega}\subseteq G\subseteq \overline{A}$, where $\Omega$ and $A$ are given by the following table and where the symbols $\overline{\Omega}$ and $\overline{A}$ denote the groups $\Omega$ and $A$ modulo scalars.

```
   type        Omega        Delta     A
   ----------------------------------------------
   linear      SL(n,q)      GL(n,q)   GammaL*(n,q)
   symplectic  Sp(n,q)      CSp(n,q)  GammaSp(n,q)
   unitary     SU(n,q)      CU(n,q)   GamaU(n,q)
   orthogonal  Omega^e(n,q) CO^e(n,q) GammaO^e(n,q)
   ------------------------------------------------

```

If $V$ is a vector space of dimension $n$ over the field ${\bf F}_{q}$, then ${\operatorname{\Gamma L}}^*(n,q)$ is the set of all semilinear bijections from $V$ to $V$ together with all semilinear bijections from $V$ to $V^*$. There is a well-defined multiplication (see [[Taylor, 1992](../../references.md#cite-taylor-1992)]) which makes this set a group; the group ${\operatorname{\Gamma L}}(n,q)$ of all semilinear transformations of $V$ is a subgroup of index $2$. The other groups in column $A$ are the subgroups of ${\operatorname{\Gamma L}}(n,q^d)$ which preserve an alternating, hermitian or quadratic form up to a scalar multiple, where $d$ is $2$ in the case of unitary groups and $1$ otherwise.

The groups in the last three rows of column $\Delta$ are the so-called *conformal* groups; they are the groups $A\cap{\operatorname{GL}}(n,q)$ which preserve an alternating, hermitian or quadratic form up to a scalar multiple.

Important examples of classical groups, which in general are in neither column $\Omega$ nor column $\Delta$, are the general orthogonal groups ${\operatorname{GO}}^\varepsilon(n,q)$, which preserve a quadratic form. In Magma these are the groups `GO(n,q), GOPlus(n,q)` or `GOMinus(n,q)` where $\varepsilon$ is respectively $0$, $+$ or $-$.

As described in the documentation for the [`ConjugacyClasses`](#function-conjugacyclasses) intrinsic, Magma constructs the classes by computing a complete collection of invariants and then determining a representative matrix for each invariant or by using the algorithms described in [[Franceschi, 2020](../../references.md#cite-defranceschi-2020)].

The intention is to implement this for all groups $G$ such that $\Omega\subseteq G\subseteq \Delta$. Currently this implementation is invoked automatically when constructing the conjugacy classes for $G$ such that ${\operatorname{SL}}(n,q)\subseteq G\subseteq {\operatorname{GL}}(n,q)$, the symplectic groups $G = {\operatorname{Sp}}(2n,q)$, the unitary groups ${\operatorname{SU}}(n,q)\subseteq G\subseteq {\operatorname{GU}}(n,q)$, the conformal unitary groups ${\operatorname{CU}}(n,q)$ and the orthogonal groups $\Omega^\varepsilon(n,q)$, ${\operatorname{SO}}^\varepsilon(n,q)$ and ${\operatorname{GO}}^\varepsilon(n,q)$ where $\varepsilon$ is $0$, $+$ or $-$. In addition, when $q$ is odd, it is invoked for the conformal groups symplectic groups ${\operatorname{CSp}}(2n,q)$ and the conformal orthogonal groups ${\operatorname{CO}}^\varepsilon(n,q)$

The implementation is based on Milnor [[Milnor, 1969](../../references.md#cite-milnor-1969)] combined with the fundamental work of Wall [[Wall, 1963](../../references.md#cite-wall-1963)] as interpreted in Gonshaw, Liebeck and O’Brien [[Gonshaw *et al.*, 2017](../../references.md#cite-gonshaw-etal-2017)] and the theses of Fulman [[Fulman, 1997](../../references.md#cite-fulman-phd)], Britnell [[Britnell, 2003](../../references.md#cite-britnell-dphil)] and De Franceschi [[Franceschi, 2018](../../references.md#cite-defranceschi-2018), [Franceschi, 2020](../../references.md#cite-defranceschi-2020)].

**Class invariants.** The conjugacy classes in the group ${\operatorname{GL}}(n,q)$ are parametrised by sequences of pairs $\langle f,\mu(f)\rangle$ where $f$ is an irreducible polynomial and $\mu(f)$ is a partition such that

$$
\sum_f\deg(f)|\mu(f)| = n.
$$

In the following description a partition of an integer $n$ will be represented either by a sequence $[\lambda_1,\lambda_2,\dots,\lambda_r]$ such that $\lambda_1\ge\lambda_2\ge\cdots\ge\lambda_r$ and $n= \sum_{i=1}^r\lambda_i$ or by the sequence of multiplicities $[\langle 1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle]$, omitting the terms with $m_i = 0$, where $n = \sum_{i=1}^n im_i$.

For the conjugacy classes of the classical groups there are restrictions on the polynomials and partitions that can occur.

If $f(t)\in k[t]$ is a polynomial of degree $d$ (over a field $k$) such that $f(0)\ne 0$, the *dual* of $f(t)$ is the polynomial $f^*(t) = f(0)^{-1}t^df(t^{-1})$.

A polynomial $f(t)$ is $*$-*symmetric* if $f^*(t) = f(t)$; it is $*$-*irreducible* if it has no proper $*$-symmetric factors.

### `DualPolynomial(f): RngUPolElt -> RngUPolElt`

The dual of the polynomial $f$.

### `StarIrreduciblePolynomials(F, d): FldFin, RngIntElt -> SeqEnum`

The sequence of all $*$-irreducible polynomials of degree $d$ with coefficients in $F$.

**Symplectic groups.** If $g\in{\operatorname{Sp}}(2n,q)$, then $g$ preserves a non-degenerate alternating form and from this it follows that the minimal polynomial of $g$ is $*$-symmetric. A symplectic *signed partition* of an integer $n$ is a sequence $[\langle 1,m_1\rangle, \langle\pm2,m_2\rangle,\dots, \langle n,m_n\rangle]$, such that the unsigned sequence $[\langle 1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle]$ is a partition of $n$, where $m_i$ is even for all odd $i$. Only the terms $\langle i,m_i\rangle$ where $i$ is even are signed.

The conjugacy classes of ${\operatorname{Sp}}(2n,q)$ are in one-to-one correspondence with sequences of pairs $\langle f,\mu(f)\rangle$, where $f$ is a $*$-irreducible polynomial and $\mu(f)$ is a partition if $\deg (f) > 1$ and a symplectic signed partition if $\deg(f) = 1$. (Note that $t -1$ and $t + 1$ are the only $*$-irreducible polynomials of odd degree.) When $q$ is a power of 2, more elaborate labels are needed to distinguish the conjugacy classes.

After invoking the command `cc := Classes(G);` the conjugacy classes for of the group $G$ will be returned as the value of `cc` and assigned to `G`Classes`. In addition, the labels for the conjugacy classes will be assigned either to `G`Labels_S` or `G`Labels_A` (or both). These labels are used internally.

**Conformal symplectic groups.** If $g$ belongs to the conformal symplectic group $C$ over the field $F$ there is a non-zero element $\phi\in F$ such that $gJg^{\mathrm{tr}} = \phi J$, where $J$ is the matrix of the alternating form preserved by $C$. In this case the minimal polynomial of $g$ is $\phi$-symmetric in the sense of the following definition.

Given $\phi\in F^\times$ and a polynomial $f(t)$ of degree $d$ such that $f(0)\ne 0$, the $\phi$-*dual* of $f(t)$ is

$$
f^{[\phi]}(t) = f(0)^{-1}t^d f(\phi t^{-1}).
$$

The polynomial $f(t)$ is $\phi$-*symmetric* if $f^{[\phi]}(t) = f(t)$. Thus $f(t)$ is $\phi$-symmetric if and only if $t^d f(\phi t^{-1}) = f(0)f(t)$. For example $t^2 - \phi$ and $t^2 + \phi$ are $\phi$-symmetric and if $\phi = \lambda^2$, then $t - \lambda$ and $t + \lambda$ are $\phi$-symmetric.

A polynomial $f(t)$ is $\phi$-*irreducible* if it is $\phi$-symmetric and has no proper $\phi$-symmetric factors.

### `PhiDual(f, phi): RngUPolElt -> RngUPolElt`

The $\phi$-dual of the polynomial $f$.

### `PhiIrreduciblePolynomials(F, d): FldFin, RngIntElt -> SeqEnum[Tup]`

The sequence of pairs $\langle\phi,\ \hbox{\tt pols}\rangle$ where `pols` is the sequence of all monic polynomials of degree $d$ over the field $F$ with no proper $\phi$-symmetric factor and $\phi$ runs through the non-zero elements of $F$.

Each conjugacy class of ${\operatorname{CSp}}(2n,q)$ will be represented by a pair $\langle \phi, \Xi\rangle$, where $\phi\in F^\times$ and $\Xi$ is an indexed set of pairs $\langle f,\mu\rangle$, where $f$ is a $\phi$-irreducible polynomial and $\mu$ is either a partition or, in the case that $f$ divides $t^2 - \phi$, a symplectic signed partition. That is, a conjugacy class invariant has the form $\langle \phi, \{@~ \langle f_1,\mu_1\rangle, \langle f_2,\mu_2\rangle,\ \cdots\ @\}\rangle$.

**Extended symplectic groups.** A group $G$ is an *extended symplectic group* if ${\operatorname{Sp}}(n,q)\subseteq G \subseteq {\operatorname{CSp}}(n,q)$.

### `ExtendedSymplecticGroup(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

### `ExtendedSp(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

The subgroup of ${\operatorname{CSp}}(n,q)$ that contains ${\operatorname{Sp}}(n,q)$ as a subgroup of index $m$.

### `IndexOfSp(G): GrpMat -> RngIntElt`

The index of the symplectic group in $G$. This function fails with a runtime exception if $G$ is not an extended symplectic group.

**Unitary groups.** If $f(t)\in k[t]$ is a polynomial of degree $d$ (over a field $k$ with an automorphism $x \mapsto \overline x$ where $x\ne\overline{x}$ and $\overline{\overline{x}} = x$) such that $f(0)\ne 0$, the *twisted dual* of $f(t)$ is the polynomial $f^\sim(t) = \overline{f(0)}^{-1}t^d \overline{f}(t^{-1})$.

A polynomial $f(t)$ is *tilde-symmetric* if $f^\sim(t) = f(t)$; it is *tilde-irreducible* if it has no proper tilde-symmetric factors. If $g\in {\operatorname{GU}}(n,q)$, then $g$ preserves a non-degenerate hermitian form and from this it follows that the minimal polynomial of $g$ is tilde-symmetric with respect to the automorphism $x \mapsto x^q$ of ${\bf F}_{q^2}$.

### `TildeDualPolynomial(f): RngUPolElt -> RngUPolElt`

The twisted dual of the polynomial $f$.

### `TildeIrreduciblePolynomials(q, d): RngIntElt, RngIntElt -> SeqEnum`

The sequence of all tilde-irreducible polynomials of degree $d$ with coefficients in $GF(q^2)$.

The conjugacy classes of ${\operatorname{GU}}(n,q)$ are in one-to-one correspondence with sequences of pairs $\langle f,\mu(f)\rangle$, where $f$ is a tilde-irreducible polynomial and $\mu(f)$ is a partition, written as a sequence of multiplicities $\langle i, m_i \rangle$.

**Extended special unitary groups.** A group $G$ is an *extended special unitary group* of index $m$ if ${\operatorname{SU}}(n,q)\subseteq G \subseteq {\operatorname{GU}}(n,q)$ and $m = |G : {\operatorname{SU}}(n,q)|$.

### `ExtendedSpecialUnitaryGroup(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

### `ExtendedSU(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

The subgroup of ${\operatorname{GU}}(n,q)$ that contains ${\operatorname{SU}}(n,q)$ as a subgroup of index $m$.

### `IndexOfSU(G): GrpMat -> RngIntElt`

The index of the special unitary group in $G$. This function fails with a runtime exception if $G$ is not an extended special unitary group.

**Orthogonal groups.** An orthogonal *signed partition* of an integer $n$ is a sequence

$$
[\langle\pm1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle],
$$

such that the unsigned sequence $[\langle 1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle]$ is a partition of $n$ (in multiplicity format), where $m_i$ is even for all even $i$. Only the terms $\langle i,m_i\rangle$ where $i$ is odd are signed.

The conjugacy classes of ${\operatorname{GO}}^\varepsilon(n,q)$ are in one-to-one correspondence with sequences of pairs $\langle f,\mu(f)\rangle$, where $f$ is a $*$-irreducible polynomial and $\mu(f)$ is a partition if $\deg (f) > 1$ and an orthogonal signed partition if $\deg(f) = 1$. (Note that $t -1$ and $t + 1$ are the only $*$-irreducible polynomials of odd degree.) When $q$ is a power of 2, more elaborate labels are needed to distinguish the conjugacy classes.

**Standard and natural classical groups.**

Here we describe intrinsics to list conjugacy classes, determine centralisers, and decide conjugacy in the classical groups. The classes are listed using algorithms developed and implemented by De Franceschi [[Franceschi, 2018](../../references.md#cite-defranceschi-2018), [Franceschi, 2020](../../references.md#cite-defranceschi-2020)], Gonshaw, Liebeck and O’Brien [[Gonshaw *et al.*, 2017](../../references.md#cite-gonshaw-etal-2017)], and Taylor. The algorithms to construct centralisers and decide conjugacy were developed and implemented by De Franceschi [[Franceschi, 2018](../../references.md#cite-defranceschi-2018), [Franceschi, 2020](../../references.md#cite-defranceschi-2020)], and De Franceschi, O’Brien and Liebeck [[Franceschi *et al.*, 2025](../../references.md#cite-dfol-classes)]. O’Brien and Taylor prepared the final versions of these functions for inclusion in Magma.

The functions listed below with arguments (`type`, $d$, $q$) refer to the ‘standard’ classical groups: the groups returned by Magma functions such as `GU(d,q)` and so on. The accepted values for the argument (or parameter) `type` are the strings `"SL", "GL", "Sp", "SU", "GU", "Omega+", "Omega-", "Omega", "SO+", "SO-", "SO", "GO+", "GO-",` and `"GO"`.

The conjugates of these groups within the ambient general linear group are the ‘natural copy’ classical groups. Those functions which accept as argument a group $G$ can be applied to all such `conjugates` of the standard copy of $G$. The type of a standard or natural copy of $G$ is returned by `ClassicalGroupType`.

### `ClassicalConjugacyClasses(G): GrpMat -> SeqEnum, SetIndx`

### `ClassicalClasses(G): GrpMat -> SeqEnum, SetIndx`

The sequence of conjugacy classes and the corresponding sequence of labels for the natural classical group $G$.

### `ClassicalConjugacyClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, SetIndx`

### `ClassicalClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, SetIndx`

The conjugacy classes and their labels for the standard classical group of the supplied type, rank $d$ and field size $q$.

### `ClassicalCentralizer(G, g): GrpMat, GrpMatElt -> GrpMat`

The centralizer of $g$ in the natural classical group $G$.

### `ClassicalCentraliserOrder(G, g): GrpMat, GrpMatElt -> RngIntEltFact`

The factored order of the centralizer of $g$ in the natural classical group $G$.

### `ClassicalClassSize(G, g): GrpMat, GrpMatElt -> RngIntElt`

The size of the conjugacy class of $g$ in the natural classical group $G$.

### `ClassicalIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

If $g$ and $h$ are conjugate in the natural classical group $G$, return `true` and a conjugating element, otherwise return `false`.

### `Example: Class Calculations I (ex-99ff8c)`

```magma
> G := OmegaPlus (16, 4);

> // some natural copy of the group
> G := RandomConjugate (G);

> g := Random (G);

> z := ClassicalCentraliserOrder (G, g);

> C := ClassicalCentraliser (G, g);

> FactoredOrder (C) eq z;

true

> g := Random (G);

> m := ClassicalClassSize (G, g);

> C := ClassicalCentraliser (G, g);
> #G div #C eq m;
true

> x := Random (G);
> flag, c := ClassicalIsConjugate (G, g, g^x);
> g^c eq g^x;
true

```

### `ClassicalClassMap(G): GrpMat -> Map`

### `ClassicalClassMap(G, C, L): GrpMat, SeqEnum, SetIndx -> Map`

```magma
type: MonStgElt                    Default: 
```

The class map for the natural classical group $G$. The input parameters $C$ and $L$ are the outputs of `ClassicalClasses`: $C$ is the sequence of classes and $L$ is the list of corresponding labels. The optional parameter `type` is the type of the classical group.

### `ClassesForFixedSemisimple(G, x): GrpMat, GrpMatElt -> SeqEnum, SetIndx`

Given a semisimple element $x$ in a natural classical group $G$ return representatives and labels of the conjugacy classes in $G$ with semisimple part $x$.

### `IsometryGroupClassLabel(type, g): MonStgElt, GrpMatElt -> SetMulti`

Return a label for the conjugacy class of the element $g$ of the standard isometry group $G$ determined by `type`. The labels of the elements of $G$ agree if and only if the elements are conjugate in $G$. The allowed types are `"GU"`, `"Sp"`, `"GO+"`, `"GO-"` and `"GO"`.

### `Example: Class Calculations (ex-af187c)`

```magma
> G := SOPlus (6, 9);

> g := G.1^G.2;

> Cg := ClassicalCentraliser (G, g);

> #Cg;
728

> C := ClassicalClasses (G);
> phi := ClassicalClassMap (G);

> index := phi (g);
> index;
123

> assert #G div C[index][2] eq #Cg;

> g := C[11][3]^G.1;
> h := C[12][3]^G.1;
> label_g := IsometryGroupClassLabel ("GO+", g);
> label_h := IsometryGroupClassLabel ("GO+", g);

> // are these elements conjugate in GO+?
> label_g eq label_h;
true

> // are these elements conjugate in G?
> ClassicalIsConjugate (G, g, h);

false
>

```

### `Example: Class Calculations III (ex-745ee8)`

```magma
> C, L := ClassicalClasses ("GO", 7, 9);
> L[4];
{*
    <0, $.1 + 1, {* <1, 1>^^5, <1, w> *}>,
    <0, $.1 + 2, {* <1, 1> *}>
*}
> G := GO(7, 9);
> phi := ClassicalClassMap (G, C, L);
> phi;
> X := {@ G.i^a * G.j^b: a in [1..Order (G.i)], b in [1..Order (G.j)],
>     i, j in [1..Ngens (G)] @};
> x := X[46];
> phi (x);
682

```

### `Example: Invlayer (ex-fd370f)`

Let $G = {\operatorname{Sp}}(d,q)$. For $g\in G$ let $\iota(g)$ be the minimal number $k$ such that $g$ is a product of $k$ involutions. If $d > 2$, $\iota(g)$ is well-defined for all $g\in G$ and depends only on the conjugacy class of $g$. In this example we define a function `iseq` which returns a sequence `reps`, where `reps[k]` is the set of conjugacy class representatives of elements $g$ such that $\iota(g) = k -1$. (If $g$ is the identity element, then $\iota(g) = 0$.)

```magma
> iseq := function(d,q)
>   G := Sp(d,q);
>   cc := ConjugacyClasses(G);
>   reps := [{ One(G) }];
>   labels := [{@ IsometryGroupClassLabel("Sp",One(G)) @}];
>   R := {c[3] : c in cc | c[1] eq 2};
>   T := &join[ Class(G,x) : x in R ];
>   L := {@ IsometryGroupClassLabel("Sp",t) : t in R @};
>
>   k := 1;
>   total := 1 + #R;
>   print "Layer", k, ":", #R;;
>
>   repeat
>     Append(~reps, R);
>     Append(~labels, L);
>     if total eq #cc then break; end if;
>     R := { };
>     L := {@  @};
>     k +:= 1;
>     for g in reps[k] do
>       for t in T do
>         h := g*t;
>         mu := IsometryGroupClassLabel("Sp",h);
>         if mu notin labels[k-1] and mu notin labels[k] and mu notin L then
>           Include(~R,h);
>           Include(~L, mu);
>           if total + #R eq #cc then break g; end if;
>         end if;
>       end for;
>     end for;
>     total +:= #R;
>     print "Layer", k, ":", #R;;
>   until IsEmpty(R);
>   return reps;
> end function;

```

The set `T` is the set of involutions. Given an element $g$ such that $\iota(g) = k$ and an involution $t\in T$, the function `IsometryGroupClassLabel` is used to check whether $g*t$ is conjugate to an element already in the sequence of conjugacy class representatives. This is considerably faster than using `ClassicalIsConjugate` because it avoids computing the conjugating element. (Thanks to Oliver Villa for suggesting this example.)

```magma
> reps := iseq(4,3);
Layer 1 : 2
Layer 2 : 3
Layer 3 : 7
Layer 4 : 15
Layer 5 : 6

```

### `UnipotentClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, SeqEnum`

### `UnipotentClasses(type, d, F): MonStgElt, RngIntElt, FldFin -> SeqEnum, SeqEnum`

The conjugacy classes of the unipotent elements of the standard classical group of the supplied type, rank $d$ and field $F$, or field size $q$.

### `SemisimpleClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum`

### `SemisimpleClasses(type, d, F): MonStgElt, RngIntElt, FldFin -> SeqEnum`

The conjugacy classes of the semisimple elements of the standard classical group of the supplied type which preserves a form, rank $d$ and field $F$, or field size $q$.

### `IsometryGroupNumberOfClasses(type, n): MonStgElt, RngIntElt -> RngUPolElt`

Return the number of conjugacy classes of the finite isometry group of given `type` and degree $n$ as a polynomial in the field size $q$. The allowed type is one of `"GL"`, `"GU"`, `"SpOdd"`, `"SpEven"`, `"GO+Even"`, `"GO+Odd"` `"GO-Even"`, `"GO-Odd"` and `"GO"`. Here `"Even"` and `"Odd"` indicate the characteristic of ${\bf F}_{q}$: the relevant polynomial depends on the characteristic.

### `Example: Class Calculations IV (ex-c14a80)`

```magma
> H := SU(12, 9);
> // set up just unipotent classes
> U := UnipotentClasses ("SU", 12, 9);
> #U;
88
> C := ClassicalCentraliser (H, U[4][3]);
> FactoredOrder (C);
[ <2, 2>, <3, 28>, <5, 1> ]
>
> K := Sp (6, 8);
> // set up just semisimple classes
> S := SemisimpleClasses ("Sp", 6, 8);
> // for each semisimple class rep, construct all classes for that rep
> G := Sp(6, 8);
> T := [ClassesForFixedSemisimple (G, S[i][3]): i in [1..#S]];
> // Total number of classes of K
> &+[#x: x in T];
684
>
> // polynomial for number of classes in isometry group of this rank
> f := IsometryGroupNumberOfClasses ("SpEven", 6);
> f;
q^3 + 2*q^2 + 5*q + 4
> Evaluate (f, 8);
684
\endex

```

### `ProjectiveClassicalClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, GrpPerm, HomGrp, SeqEnum`

```magma
UseLMGHom   : BoolElt                    Default: false
MatricesOnly: BoolElt                    Default: false
```

The conjugacy classes for the standard projective classical group of the given type of dimension $d$ over the field of $q$ elements. The second return value is the projective group $P$, the third return value is the homomorphism from the classical matrix group $G$ to $P$ and fourth return value is the sequence of preimages of the class representatives of $P$ in $G$.

The accepted values for the argument `type` are the strings `"SL", "GL", "Sp", "SU", "GU", "Omega+", "Omega-", "Omega", "SO+", "SO-", "SO", "GO+", "GO-"` and `"GO"`, which describe the corresponding classical matrix group.

If the parameter `UseLMGHom` is `true`, the code will use `LMGHomomorphism` as the homomorphism from the matrix group to the projective group.

If the parameter `MatricesOnly` is `true`, matrices in the classical matrix group which represent the conjugacy classes in the projective group will be returned as the first (and only) return value.

### `ProjectiveClassicalCentraliser(G, g): GrpMat, GrpMatElt -> GrpMat`

Return preimage in the standard classical group $G$ of the centraliser of image of $g$ in the central quotient of $G$. Note that $G$ must be the standard classical group with type listed as valid argument for `ProjectiveClassicalClasses`.

### `ProjectiveClassicalIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

If the images of $g$ and $h$ are conjugate in the central quotient of the classical group $G$, then return `true` and preimage in $G$ of a conjugating element, else return `false`. Note that $G$ must be the standard classical group with type listed as valid argument for `ProjectiveClassicalClasses`.

### `Example: Projective Classes (ex-fbd04d)`

Using `ProjectiveClassicalClasses` to compute conjugacy classes is generally faster than using the generic function `ConjugacyClasses`.

```magma
> time cc, P, f, mm := ProjectiveClassicalClasses("SL",6,3);
Time: 0.150
> H := sub<Generic(P) | P>;
> time hh := Classes(H);
Time: 3.510
> P eq PSL(6,3);
true

```

### `Example: Proj With Matrices (ex-b45e6a)`

The preimages of the conjugacy classes of the standard projective classical group will be returned as a sequence of triples $\langle\, n, c, M\,\rangle$ where $n$ is the order of the matrix $M$ and $c$ is the number of conjugates of $M$.

```magma
> cc, P, f, mm := ProjectiveClassicalClasses("Sp",4,3);
> mm[4];
  <
     3,

     40,

     [1 0 0 0]
     [0 1 1 0]
     [0 0 1 0]
     [0 0 0 1]
  >
> cc[4][3] eq f(mm[4][3]);
true

```

### `SpinConjugacyClasses(G): GrpMat -> SeqEnum, SeqEnum`

### `SpinClasses(G): GrpMat -> SeqEnum, SeqEnum`

The sequence of conjugacy classes and their corresponding centralizers in the spin group $G$ returned by one of the intrinsics `Spin`($d,q$), `SpinPlus`($d,q$), or `SpinPlus`($d,q$), with $q$ odd. These are calculated by calling `ClassicalClasses` on the central quotient group $G/Z$ with $|Z|=2$ and $G = \Omega^{\epsilon}(d,q)$, and then lifting the class representatives through the subgroup $Z$.

### `SpinCentralizer(G, g): GrpMat, GrpMatElt -> GrpMat`

The centralizer of $g$ in the spin group $G$.

### `SpinIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

If $g$ and $h$ are conjugate in the spin group $G$ then return `true` and a conjugating element, otherwise return `false`.

### `SpinClassMap(G): GrpMat -> Map`

The class map for the spin group $G$.
