# Automorphisms

The following functions construct the standard automorphisms of a group of Lie type, as described in [[Carter, 1972](../../references.md#cite-carter-small)] (except for the graph automorphism of $G_2$). In many cases, including the finite groups, every automorphism is a product of these standard automorphisms.

## Basic Functionality

### `AutomorphismGroup(G): GrpLie -> GrpLieAuto`

Automorphism group of a group of Lie type $G$.

### `IdentityAutomorphism(G): GrpLie -> GrpLieAutoElt`

### `One(A): GrpLieAuto -> GrpLieAutoElt`

### `Id(A): GrpLieAuto -> GrpLieAutoElt`

The identity automorphism of the group of Lie type $G$.

### `Mapping(a): GrpLieAutoElt -> Map`

The map object associated with the automorphism $a$.

### `Automorphism(m): Map -> GrpLieAutoElt`

Given a map object $m$ from $G$ to $G$, which is an isomorphism, returns the associated automorphism as an automorphism of a group of Lie type.

### `h * g: GrpLieAutoElt, GrpLieAutoElt -> GrpLieAutoElt`

The composition of the group of Lie type automorphisms $h$ and $g$.

### `h ^ n: GrpLieAutoElt, RngIntElt -> GrpLieAutoElt`

The $n$th power of the group of Lie type automorphism $h$.

### `g ^ h: GrpLieAutoElt, GrpLieAutoElt -> GrpLieAutoElt`

The conjugate $h^{-1}gh$, where $g$ and $h$ are group of Lie type automorphisms $g$ and $h$

### `Domain(A): GrpLieAuto -> GrpLie`

### `Codomain(A): GrpLieAuto -> GrpLie`

### `Domain(h): GrpLieAutoElt -> GrpLie`

### `Codomain(h): GrpLieAutoElt -> GrpLie`

Domain or codomain of an automorphism of a group of Lie type or of the group of automorphisms.

## Constructing Special Automorphisms

### `InnerAutomorphism(G, x): GrpLie, GrpLieElt -> Map`

The inner automorphism taking $g\in G$ to $g^x$, where $x$ is an element of the group of Lie type $G$.

### `DiagonalAutomorphism(G, v): GrpLie, ModTupRngElt -> Map`

The diagonal automorphism of the semisimple group of Lie type $G$ given by the vector $v$. Let $n$ be the semisimple rank of $G$ and let $k$ be its base field. Then $v$ must be a vector in $k^n$ with every component nonzero. The function returns the automorphism given by the character $\chi$ defined by $\chi(\alpha_i)=v_i$, where $\alpha_i$ is the $i$th simple root. Since our groups are algebraic, a diagonal automorphism is just a special case of an inner automorphism.

### `GraphAutomorphism(G, p): GrpLie, GrpPermElt -> Map`

### `DiagramAutomorphism(G, p): GrpLie, GrpPermElt -> Map`

```magma
SimpleSigns: Any                    Default: 1
```

The graph automorphism of the group of Lie type $G$ given by the permutation $p$. The permutation must act on the indices of simple roots of $G$ or the indices of all roots of $G$. The graph automorphism of the group of type $G_2$ has not been implemented yet.

The optional parameter `SimpleSigns` can be used to specify the signs corresponding to each simple root. This should either be a sequence of integers $\pm1$, or a single integer $\pm1$.

### `FieldAutomorphism(G, sigma): GrpLie, Map -> Map`

The field automorphism of the group of Lie type $G$ induced by $\sigma$, an element of the automorphism group of the base field of $G$

### `RandomAutomorphism(G): GrpLie -> GrpLieAutoElt`

### `Random(A): GrpLieAuto -> GrpLieAutoElt`

A random element in $A$, the automorphism group of the group of Lie type $G$.

### `DualityAutomorphism(G): GrpLie -> GrpLieAutoElt`

The duality automorphism of $G$. This is an automorphism that takes every unipotent term $x_r(t)$ to $x_s(\pm t)$, where $s=$ `Negative(RootDatum(G),r))`.

### `FrobeniusMap(G, q): GrpLie, RngIntElt -> GrpLieAutoElt`

The Frobenius automorphism of the finite group of Lie type $G$ gotten by $q$th powers in the base field. The integer $q$ must be a power of the characteristic of the base field of $G$.

## Operations and Properties of Automorphisms

### `DecomposeAutomorphism(h): GrpLieAutoElt -> GrpLieAutoElt, GrpLieAutoElt, GrpLieAutoElt, Rec`

Given a group of Lie type automorphism $h$, this returns a field automorphism $f$, a graph automorphism $g$ and an inner automorphism $i$ such that $h=fgi$. This only works for groups defined over finite fields. The algorithm is due to Scott Murray and Sergei Haller.

### `IsAlgebraic(h): GrpLieAutoElt -> BoolElt`

Returns `true` if and only if the automorphism $h$ is algebraic.

### `Example: Automorphism (ex-6e4baf)`

Some automorphisms of $B_2(4)$

```magma
> G := GroupOfLieType("B2", GF(4));
> A := AutomorphismGroup(G);
> A!1 eq IdentityAutomorphism(G);
true
> g := GraphAutomorphism(G, Sym(2)!(1,2));
> g;
Automorphism of Group of Lie type B2 over Finite field of size 2^2
given by: Mapping from: Group of Lie type  to Group of Lie type
given by a rule
Decomposition:
  Mapping from: GF(2^2) to GF(2^2) given by a rule,
  (1, 2),
  1

```

The automorphism of $B_2(4)$ whose stabiliser is ${}^2\!B_2(4)$ is constructed by the following code.

```magma
> sigma := iso< GF(4) -> GF(4) | x :-> x^2, x :-> x^2 >;
> h := FieldAutomorphism(G, sigma) * g;
> h in A;
true
> f,g,i := DecomposeAutomorphism(h);
> assert f*g*i eq h;

```
