---
title: "Automorphism Groups"
canonical: "https://docs.magma-maths.org/v2.30-1/CodingTheory/LinearCodesOverZ4/aut_group.html"
source: "https://docs.magma-maths.org/v2.30-1/CodingTheory/LinearCodesOverZ4/aut_group.md"
part: "Coding Theory"
chapter: "Linear Codes over the Integer Residue Ring ${\\mathbb{Z}}_4$"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Coding Theory", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/index-coding-theory.md"}
  - {"title": "Linear Codes over the Integer Residue Ring ${\\mathbb{Z}}_4$", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/LinearCodesOverZ4/index-linear-codes-over-z4.md"}
prev: {"title": "Decoding", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/LinearCodesOverZ4/decoding.md"}
next: {"title": "Bibliography", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/LinearCodesOverZ4/bibliography.md"}
intrinsics:
  - {"name": "PermutationGroupHadamardCodeZ4", "signature": "PermutationGroupHadamardCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx"}
  - {"name": "PAutHadamardCodeZ4", "signature": "PAutHadamardCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx"}
  - {"name": "PermutationGroupHadamardCodeZ4Order", "signature": "PermutationGroupHadamardCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "PAutHadamardCodeZ4Order", "signature": "PAutHadamardCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "PermutationGroupExtendedPerfectCodeZ4", "signature": "PermutationGroupExtendedPerfectCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx"}
  - {"name": "PAutExtendedPerfectCodeZ4", "signature": "PAutExtendedPerfectCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx"}
  - {"name": "PermutationGroupExtendedPerfectCodeZ4Order", "signature": "PermutationGroupExtendedPerfectCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "PAutExtendedPerfectCodeZ4Order", "signature": "PAutExtendedPerfectCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "PermutationGroup", "signature": "PermutationGroup(C): CodeLinRng -> GrpPerm"}
  - {"name": "PermutationGroupGrayMapImage", "signature": "PermutationGroupGrayMapImage(C): CodeLinRng -> GrpPerm"}
examples:
  - "ex-61ad8c"
  - "ex-326517"
---

<a id="aut-group"></a>
<a id="sec-aut"></a>
# Automorphism Groups

<a id="function-permutationgrouphadamardcodez4-rngintelt-rngintelt"></a>
## `PermutationGroupHadamardCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx`

<a id="function-pauthadamardcodez4-rngintelt-rngintelt"></a>
## `PAutHadamardCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx`

Given an integer $m\geq 1$ and an integer $\delta$ such that $1\leq \delta \leq \lfloor (m+1)/2 \rfloor$, this function returns the permutation group $G$ of a Hadamard code over ${\mathbb{Z}}_4$ of length $2^{m-1}$ and type $2^\gamma 4^\delta$, where $\gamma=m+1-2\delta$. The group $G$ contains all permutations of the coordinates which preserve the code. Thus only permutation of coordinates is allowed, and the degree of $G$ is always $2^{m-1}$. Moreover, the generator matrix with $\gamma+\delta$ rows used to generate the code is returned. This matrix is constructed in a recursive way using the `Plotkin` and `BQPlotkin` constructions defined in Section [New Codes from Old](https://docs.magma-maths.org/v2.30-1/CodingTheory/LinearCodesOverZ4/constructions.md#sec-plotkin).

<a id="function-permutationgrouphadamardcodez4order-rngintelt-rngintelt"></a>
## `PermutationGroupHadamardCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt`

<a id="function-pauthadamardcodez4order-rngintelt-rngintelt"></a>
## `PAutHadamardCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt`

Given an integer $m\geq 1$ and an integer $\delta$ such that $1\leq \delta \leq \lfloor (m+1)/2 \rfloor$, return the order of the permutation group $G$ of a Hadamard code over ${\mathbb{Z}}_4$ of length $2^{m-1}$ and type $2^\gamma 4^\delta$, where $\gamma=m+1-2\delta$. The group $G$ contains all permutations of the coordinates which preserve the code.

<a id="function-permutationgroupextendedperfectcodez4-rngintelt-rngintelt"></a>
## `PermutationGroupExtendedPerfectCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx`

<a id="function-pautextendedperfectcodez4-rngintelt-rngintelt"></a>
## `PAutExtendedPerfectCodeZ4(δ, m): RngIntElt, RngIntElt -> GrpPerm, Mtrx`

Given an integer $m\geq 2$ and an integer $\delta$ such that $1\leq \delta \leq \lfloor (m+1)/2 \rfloor$, return the permutation group $G$ of an extended perfect code over ${\mathbb{Z}}_4$ of length $2^{m-1}$, such that its dual code is of type $2^\gamma 4^\delta$, where $\gamma=m+1-2\delta$. The group $G$ contains all permutations of the coordinates which preserve the code. Thus only permutation of coordinates is allowed, and the degree of $G$ is always $2^{m-1}$. Moreover, the generator matrix with $\gamma+\delta$ rows used to generate the code is returned. This matrix is constructed in a recursive way using the Plotkin and BQPlotkin constructions defined in Section [New Codes from Old](https://docs.magma-maths.org/v2.30-1/CodingTheory/LinearCodesOverZ4/constructions.md#sec-plotkin).

<a id="function-permutationgroupextendedperfectcodez4order-rngintelt-rngintelt"></a>
## `PermutationGroupExtendedPerfectCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt`

<a id="function-pautextendedperfectcodez4order-rngintelt-rngintelt"></a>
## `PAutExtendedPerfectCodeZ4Order(δ, m): RngIntElt, RngIntElt -> RngIntElt`

Given an integer $m\geq 2$ and an integer $\delta$ such that $1\leq \delta \leq \lfloor (m+1)/2 \rfloor$, return the order of the permutation group $G$ of an extended perfect code over ${\mathbb{Z}}_4$ of length $2^{m-1}$, such that its dual code is of type $2^\gamma 4^\delta$, where $\gamma=m+1-2\delta$. The group $G$ contains all permutations of the coordinates which preserve the code.

<a id="example-ex-61ad8c"></a>
## `Example: Permutation Automorphisms of a Hadamard Code (ex-61ad8c)`

```magma
> C := HadamardCodeZ4(2,4);
> PAut := PAutHadamardCodeZ4(2,4);
> PAut;
Permutation group PAut acting on a set of cardinality 8
    (1, 2)(3, 4)(5, 6)(7, 8)
    (2, 4)(6, 8)
    (5, 7)(6, 8)
    (1, 5)(3, 7)
> {p : p in Sym(8) | C^p eq C} eq Set(PAut);
true
> #PAut eq PAutHadamardCodeZ4Order(2,4);
true
> d := 2; m := 4; g := m+1-2*d;
> PAutHadamardCodeZ4Order(d, m) eq
>  #GL(d-1,Integers(4))*#GL(g,Integers(2))*2^g*4^((g+1)*(d-1));
true
> d := 4; m := 8; g := m+1-2*d;
> PAutHadamardCodeZ4Order(d, m) eq
>   #GL(d-1,Integers(4))*#GL(g,Integers(2))*2^g*4^((g+1)*(d-1));
true
> PAutHadamardCodeZ4(2,4) eq PAutExtendedPerfectCodeZ4(2,4);
true
```

<a id="function-permutationgroup-codelinrng"></a>
## `PermutationGroup(C): CodeLinRng -> GrpPerm`

The permutation group $G$ of the linear code $C$ of length $n$ over the ring $R$, where $G$ is the group of all permutation-action permutations which preserve the code. Thus only permutation of coordinates is allowed, and the degree of $G$ is always $n$.

<a id="function-permutationgroupgraymapimage-codelinrng"></a>
## `PermutationGroupGrayMapImage(C): CodeLinRng -> GrpPerm`

Given a code $C$ over ${\mathbb{Z}}_4$ of length $n$, return the permutation group $G_{bin}$ of $C_{bin}=\Phi(C)$, where $G_{bin}$ is the group of all permutation-action permutations which preserve the binary code $C_{bin}$ of length $2n$ and $\Phi$ is the Gray map. Thus only permutation of coordinates is allowed, and the degree of $G_{bin}$ is always $2n$.

<a id="example-ex-326517"></a>
## `Example: Permutation Group of a Code over Z4 (ex-326517)`

```magma
> C := HadamardCodeZ4(2,4);
> PAutC := PermutationGroup(C);
> PAutC eq PAutHadamardCodeZ4(2,4);
true
> #PAutC eq PAutHadamardCodeZ4Order(2,4);
true
> {p : p in Sym(8) | C^p eq C} eq Set(PAutC);
true

> Cbin := GrayMapImage(C);
> PAutCbin := PermutationGroupGrayMapImage(C);
> {p : p in PAutCbin | Set(Cbin)^p eq Set(Cbin)} eq Set(PAutCbin);
true
```
