# Conjugacy

## `Class(H, g): GrpPC, GrpPCElt -> { GrpPCElt}`

## `Conjugates(H, g): GrpPC, GrpPCElt -> { GrpPCElt}`

## `g ^ H: GrpPCElt, GrpPC -> { GrpPCElt}`

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

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

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

Construct a set of representatives for the conjugacy classes of $G$. The classes are returned as a sequence of tuples containing the order of the elements in the class, the class length and a representative element for the class. For non-$p$-groups, the classes are computed using the homomorphism principle down a series with elementary abelian factors and orbit-stabilizer in each quotient. See [[Mecky and Neubüser, 1989](../../references.md#cite-mecky-neubuser)] for details. For $p$-groups an algorithm based on linear algebra developed by Charles Leedham-Green is used.

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

The class map $M\colon G \rightarrow \{1, \ldots, n\}$ for the group $G$, where $n$ is the number of conjugacy classes of $G$.

## `ClassRepresentative(G, x): GrpPC, GrpPCElt -> GrpPCElt`

## `ClassRepresentative(G, i): GrpPC, RngIntElt -> GrpPCElt`

The designated representative for the conjugacy class of $G$ containing the element $x$ (relative to existing conjugacy classes) or the stored representative for conjugacy class $i$.

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

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

The centralizer in $G$ of the designated representative for conjugacy class $i$ of $G$.

## `IsConjugate(G, g, h): GrpPC, GrpPCElt, GrpPCElt -> BoolElt, GrpPCElt`

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 also returns a second value in the event that the elements are conjugate: an element $z$ which conjugates $g$ into $h$.

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

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

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

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

The power map $M\colon \{1 \ldots n\}\times {\mathbb{Z}}\rightarrow \{1 \ldots n\}$ associated with the conjugacy classes of $G$. The map $M$ describes where the elements of the conjugacy classes of $G$ move under powers. That is, $<c$, $n>$@$M$ returns the class number where class $c$ moves under the power $n$. The value of $c$ must be in the range [$1\ldots$`Nclasses(G)`].

## `Example: Class Map (ex-bdfb19)`

Let $G$ be a pc-representation of SL(2,3). We can compute the conjugacy classes of $G$. Notice that the conjugacy class object has a special printing routine, but you can still access individual entries.

```magma
> G := PCGroup(SpecialLinearGroup(2,GF(3)));
> G;
GrpPC : G of order 24 = 2^3 * 3
PC-Relations:
    G.1^3 = Id(G),
    G.2^2 = G.4,
    G.3^2 = G.4,
    G.4^2 = Id(G),
    G.2^G.1 = G.3 * G.4,
    G.3^G.1 = G.2 * G.3 * G.4,
    G.3^G.2 = G.3 * G.4
> Nclasses(G);
7
> cc := Classes(G);
> cc;
Conjugacy Classes of group G
----------------------------
[1]     Order 1       Length 1
        Rep Id(G)

[2]     Order 2       Length 1
        Rep G.4

[3]     Order 3       Length 4
        Rep G.1

[4]     Order 3       Length 4
        Rep G.1^2

[5]     Order 4       Length 6
        Rep G.2

[6]     Order 6       Length 4
        Rep G.1 * G.4

[7]     Order 6       Length 4
        Rep G.1^2 * G.4

> cc[3];
<3, 4, G.1>
> x := cc[3][3];
> Class(G,x);
{ G.1 * G.2 * G.3 * G.4, G.1 * G.2 * G.4, G.1, G.1 * G.3 }
7
>

```

We can use the `ClassMap` function to compute class multiplication constants (structure constants for the center of the group algebra). For example, we compute the decomposition of class 3 times class 5.

```magma
> cm := ClassMap(G);
> cm(G.1);
3
> i := 3; j := 5;
> t := [0: c in cc];
> for x in Class(G,cc[i][3]), y in Class(G,cc[j][3]) do
>   t[cm(x*y)] +:= 1;
> end for;
> t;
[ 0, 0, 12, 0, 0, 12, 0 ]

```

To get the actual structure constants, we need to divide each entry in `t` by the corresponding class size.

```magma
> [ t[i]/cc[i][2]: i in [1..#t] ];
[ 0, 0, 3, 0, 0, 3, 0 ]

```
