# Automorphism Groups

The automorphism group of a finite matrix group may be computed in Magma, subject to the same restrictions on the group as when computing maximal subgroups. (That is, all of the non-abelian composition factors of the group must appear in a certain database.) The methods used are those described in Cannon and Holt [[Cannon and Holt, 2003](../../references.md#cite-autos-permg)]. The existence of an isomorphism between a given matrix group and any other type of finite group (`GrpPerm` or `GrpPC`) may also be determined using similar methods.

## `AutomorphismGroup(G: parameters): GrpMat -> GrpAuto`

```magma
SmallOuterAutGroup: RngIntElt                    Default: 20000
Print             : RngIntElt                    Default: 0
PrintSearchCount  : RngIntElt                    Default: 1000
```

Given a finite matrix group $G$, construct the full automorphism group $F$ of $G$. The function returns the full automorphism group of $G$ as a group of mappings (i.e., as a group of type `GrpAuto`). The automorphism group $F$ is also computed as a finitely presented group and can be accessed via the function `FPGroup(F)`. A function `PermutationRepresentation` is provided that when applied to $F$, attempts to construct a faithful permutation representation of reasonable degree. The algorithm described in Cannon and Holt [[Cannon and Holt, 2003](../../references.md#cite-autos-permg)] is used.

`SmallOuterAutGroup := t`: Specify the strategy for the backtrack search when testing an automorphism for lifting to the next layer. If the outer automorphism group $O$ at the previous level has order at most $t$, then the regular representation of $O$ is used, otherwise the program tries to find a smaller degree permutation representation of $O$.

The level of verbose printing. The possible values are 0, 1, 2 or 3.

`PrintSearchCount := s`: If `Print := 3`, then a message is printed at each $s$-th iteration during the backtrack search for lifting automorphisms.

Further information about the construction of the automorphism group and a description of machinery for computing with group automorphisms may be found in Chapter [Automorphism Groups](../AutomorphismGroups/index-automorphism-groups.md#chapgrpauto).

## `Example: Automorphisms (ex-dc7caf)`

We construct a $3$-dimensional matrix group over $GF(4)$ and determine the order of its automorphism group.

```magma
> k<w> := GF(4);
> G := MatrixGroup< 3, k |
> [w^2, 0, 0, 0, w^2, 0, 0, 0, w^2],
> [w^2, 0, w^2, 0, w^2, w^2, 0, 0, w^2],
> [1, 0, 0, 1, 0, w, w^2, w^2, 0],
> [w, 0, 0, w^2, 1, w^2, w, w, 0],
> [w, 0, 0, 0, w, 0, 0, 0, w] >;
> G;
MatrixGroup(3, GF(2^2))
Generators:
    [w^2   0   0]
    [  0 w^2   0]
    [  0   0 w^2]

    [w^2   0 w^2]
    [  0 w^2 w^2]
    [  0   0 w^2]

    [  1   0   0]
    [  1   0   w]
    [w^2 w^2   0]

    [  w   0   0]
    [w^2   1 w^2]
    [  w   w   0]

    [  w   0   0]
    [  0   w   0]
    [  0   0   w]
> #G;
576
> A := AutomorphismGroup(G);
> #A;
3456
> OuterOrder(A);
72
> F := FPGroup(A);
> P := DegreeReduction(CosetImage(F, sub<F|>));
> P;
Permutation group P acting on a set of cardinality 48

```

Thus, we see that $G$ has an automorphism group of order 3456 and the quotient group of $A$ consisting of outer automorphisms, has order 72. The automorphism group may be realised as a permutation group of degree 48.

## `IsIsomorphic(G, H: parameters): GrpMat, GrpMat -> BoolElt, Hom(Grp)`

## `IsIsomorphic(G, H: parameters): GrpMat, GrpPerm -> BoolElt, Hom(Grp)`

## `IsIsomorphic(G, H: parameters): GrpPerm, GrpMat -> BoolElt, Hom(Grp)`

```magma
SmallOuterAutGroup: RngIntElt                    Default: 20000
Print             : RngIntElt                    Default: 0
PrintSearchCount  : RngIntElt                    Default: 1000
```

Test whether or not the two finite groups $G$ and $H$ are isomorphic as abstract groups. If so, both the result `true` and an isomorphism from $G$ to $H$ is returned. If not, the result `false` is returned. The algorithm described in Cannon and Holt [[Cannon and Holt, 2003](../../references.md#cite-autos-permg)] is used.

`SmallOuterAutGroup := t`: Specify the strategy for the backtrack search when testing an automorphism for lifting to the next layer. If the outer automorphism group $O$ at the previous level has order at most $t$, then the regular representation of $O$ is used, otherwise the program tries to find a smaller degree permutation representation of $O$.

The level of verbose printing. The possible values are 0, 1, 2 or 3.

`PrintSearchCount := s`: If `Print := 3`, then a message is printed at each $s$-th iteration during the backtrack search for lifting automorphisms.

## `Example: Isomorphism (ex-ea03aa)`

We construct a $3$-dimensional point group of order $8$ and test it for isomorphism with the dihedral group of order 8 given as a permutation group.

```magma
> n := 4;
> N := 4*n;
> K<z> := CyclotomicField(N);
> zz := z^4;
> i := z^n;
> cos := (zz+ComplexConjugate(zz))/2;
> sin := (zz-ComplexConjugate(zz))/(2*i);
> gl := GeneralLinearGroup(3, K);
> G := sub< gl | [ cos, sin, 0,
>                 -sin, cos, 0,
>                    0,   0, 1 ],
>
>                [  -1,   0, 0,
>                    0,   1, 0,
>                    0,   0, 1 ] >;
>
>  #G;
8
> D8 := DihedralGroup(4);
> D8;
Permutation group G acting on a set of cardinality 4
Order = 8 = 2^3
    (1, 2, 3, 4)
    (1, 4)(2, 3)
> #D8;
8
> bool, iso := IsIsomorphic(G, D8);
> bool;
true
> iso;
Homomorphism of MatrixGroup(3, K) of order 2^3 into
GrpPerm: D8, Degree 4, Order 2^3 induced by
    [ 0  1  0]
    [-1  0  0]
    [ 0  0  1] |--> (1, 2, 3, 4)

    [-1  0  0]
    [ 0  1  0]
    [ 0  0  1] |--> (1, 3)

```
