# Conjugacy

The functions described in this section require the existence of a nilpotent covering group. They are based on algorithms published in [[Lo, 1998](../../references.md#cite-lo-nilpotent)].

## `IsConjugate(G, g, h): GrpGPC, GrpGPCElt, GrpGPCElt -> BoolElt, GrpGPCElt`

Given elements $g$ and $h$ and a group $G$, which are contained in some nilpotent common group, return the value `true` if there exists $c\in G$ such that $g^c = h$. If so, the function returns such a conjugating element as second value.

## `IsConjugate(G, H, K): GrpGPC, GrpGPC, GrpGPC -> BoolElt, GrpGPCElt`

Given groups $G$, $H$ and $K$ with a nilpotent common covering group, return the value `true` if there exists $c\in G$ such that $H^c = K$. If so, the function returns such a conjugating element as second value.

## `Example: Conjugacy (ex-f79f1e)`

We again consider the nilpotent group $G := D_{16}\wr 2$.

```magma
> F<t, a,b, c,d> := FreeGroup(5);
> G<t, a,b, c,d> := quo<GrpGPC: F | a^2, b^16, b^a=b^15,
>                                   c^2, d^16, d^c=d^15,
>                      t^2, a^t=c, b^t=d, c^t=a, d^t=b>;
> IsNilpotent(G);
true

```

Since $G$ is nilpotent, a test for conjugacy in $G$ is available.

We define the following subgroups of $G$: $D1$ generated by $a$ and $b$, $D2$ generated by $c$ and $d$ and $D3$ generated by $ac$ and $bd$.

```magma
> D1 := sub<G|a,b>;
> D2 := sub<G|c,d>;
> D3<u,v> := sub<G|a*c, b*d>;
>

```

$D1$ and $D2$ are, of course, conjugate in $G$; $t$ is a conjugating element.

```magma
> IsConjugate(G, D1, D2);
true t

```

The elements $b$ and $d^{-1}$ are conjugate in $G$; we compute a conjugating element.

```magma
> IsConjugate(G, b, d^-1);
true t * a * c

```

However, neither the subgroups $D1$ and $D2$ nor the elements $b$ and $d^{-1}$, are conjugate in the subgroup $D3$.

```magma
> IsConjugate(D3, D1, D2);
false
> IsConjugate(D3, b, d^-1);
false

```
