---
title: "Families of Linear Codes"
canonical: "https://docs.magma-maths.org/v2.30-1/CodingTheory/AdditiveCodes/families.html"
source: "https://docs.magma-maths.org/v2.30-1/CodingTheory/AdditiveCodes/families.md"
part: "Coding Theory"
chapter: "Additive Codes"
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": "Additive Codes", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/AdditiveCodes/index-additive-codes.md"}
prev: {"title": "The Weight Distribution", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/AdditiveCodes/structural.md"}
next: {"title": "New Codes from Old", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/AdditiveCodes/operation.md"}
intrinsics:
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(v): ModTupFldElt -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(K, v): FldFin, ModTupFldElt -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(Q): [ModTupFldElt] -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(K, Q): FldFin, [ModTupFldElt] -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(n, f): RngIntElt, RngUPolElt -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(K, n, f): FldFin, RngIntElt, RngUPolElt -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(n, Q): RngIntElt, [RngUPolElt] -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(K, n, Q): FldFin, RngIntElt, [RngUPolElt] -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(v4, v2): ModTupFldElt, ModTupFldElt -> CodeAdd"}
  - {"name": "AdditiveCyclicCode", "signature": "AdditiveCyclicCode(n, f4, f2): RngIntElt, RngUPolElt, RngUPolElt -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(n, Q): RngIntElt, SeqEnum[RngUPolElt] -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(K, n, Q): FldFin, RngIntElt, SeqEnum[RngUPolElt] -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(n, Q, h): RngIntElt, SeqEnum[RngUPolElt], RngIntElt -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(K, n, Q, h): FldFin, RngIntElt, SeqEnum[RngUPolElt], RngIntElt -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(Q): SeqEnum[ModTupFldElt] -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(K, Q): FldFin, SeqEnum[ModTupFldElt] -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(Q, h): SeqEnum[ModTupFldElt], RngIntElt -> CodeAdd"}
  - {"name": "AdditiveQuasiCyclicCode", "signature": "AdditiveQuasiCyclicCode(K, Q, h): FldFin, SeqEnum[ModTupFldElt], RngIntElt -> CodeAdd"}
---

# Families of Linear Codes

## Cyclic Codes

While cyclic linear codes are always generated by a single generating polynomial (vector), this is not the case for additive codes. Cyclic additive codes may be created in Magma using either a single generator, or a sequence of generators.

In the important case of $GF(2)$-additive vectors over $GF4$, all cyclic codes can be described in terms of two generators with one generator taken over $GF(4)$ and the other over $GF(2)$. A special function is provided for this construction.

<a id="function-additivecycliccode-modtupfldelt"></a>
### `AdditiveCyclicCode(v): ModTupFldElt -> CodeAdd`

<a id="function-additivecycliccode-fldfin-modtupfldelt"></a>
### `AdditiveCyclicCode(K, v): FldFin, ModTupFldElt -> CodeAdd`

<a id="function-additivecycliccode-modtupfldelt-2"></a>
### `AdditiveCyclicCode(Q): [ModTupFldElt] -> CodeAdd`

<a id="function-additivecycliccode-fldfin-modtupfldelt-2"></a>
### `AdditiveCyclicCode(K, Q): FldFin, [ModTupFldElt] -> CodeAdd`

Given either a single vector $v$ or sequence of vectors $Q$ over some finite field $F$, return the $K$-additive code over $F$ generated by all shifts of the inputs. The field $K$ must be a subfield of $F$ and if it is the prime subfield of $F$, it may be omitted.

<a id="function-additivecycliccode-rngintelt-rngupolelt"></a>
### `AdditiveCyclicCode(n, f): RngIntElt, RngUPolElt -> CodeAdd`

<a id="function-additivecycliccode-fldfin-rngintelt-rngupolelt"></a>
### `AdditiveCyclicCode(K, n, f): FldFin, RngIntElt, RngUPolElt -> CodeAdd`

<a id="function-additivecycliccode-rngintelt-rngupolelt-2"></a>
### `AdditiveCyclicCode(n, Q): RngIntElt, [RngUPolElt] -> CodeAdd`

<a id="function-additivecycliccode-fldfin-rngintelt-rngupolelt-2"></a>
### `AdditiveCyclicCode(K, n, Q): FldFin, RngIntElt, [RngUPolElt] -> CodeAdd`

Given either a single polynomial $f$ or sequence $Q$ of polynomials over some finite field $F$, return the $K$-additive code of length $n$ over $F$ generated by all shifts of the inputs. The field $K$ must be a subfield of $F$, and if it is the prime subfield of $F$, it may be omitted.

<a id="function-additivecycliccode-modtupfldelt-modtupfldelt"></a>
### `AdditiveCyclicCode(v4, v2): ModTupFldElt, ModTupFldElt -> CodeAdd`

Given two vectors of equal length $n$, where $v_4$ is over $GF(4)$ and $v_2$ is over $GF(2)$, return the $F_2$–additive code generated by all of their cyclic shifts. Note that for the case of $GF(2)$-additive codes over $GF(4)$, two generators suffice to generate any such code.

<a id="function-additivecycliccode-rngintelt-rngupolelt-rngupolelt"></a>
### `AdditiveCyclicCode(n, f4, f2): RngIntElt, RngUPolElt, RngUPolElt -> CodeAdd`

Given two polynomials $f_4$ and $f_2$, where $f_4$ is over $GF(4)$ and $f_2$ is over $GF(2)$, return the $F_2$–additive code of length $n$ generated by all of their cyclic shifts. The degree of the polynomials $f_4$ and $f_2$ must not exceed $n-1$. Note that for the case of $GF(2)$-additive codes over $GF(4)$, two generators suffice to generate any such code.

## Quasicyclic Codes

Quasicyclic codes are a generalisation of cyclic codes. In Magma quasicyclic codes consist of horizontally joined cyclic blocks.

<a id="function-additivequasicycliccode-rngintelt-seqenum-rngupolelt"></a>
### `AdditiveQuasiCyclicCode(n, Q): RngIntElt, SeqEnum[RngUPolElt] -> CodeAdd`

<a id="function-additivequasicycliccode-fldfin-rngintelt-seqenum-rngupolelt"></a>
### `AdditiveQuasiCyclicCode(K, n, Q): FldFin, RngIntElt, SeqEnum[RngUPolElt] -> CodeAdd`

Given an integer $n$, and a sequence $Q$ of polynomials over some finite field $F$, return the $K$–additive quasicyclic code, whose cyclic blocks are generated by the polynomials in $Q$. The field $K$ must be a subfield of $F$, and if it is the prime subfield of $F$, it may be omitted.

<a id="function-additivequasicycliccode-rngintelt-seqenum-rngupolelt-rngintelt"></a>
### `AdditiveQuasiCyclicCode(n, Q, h): RngIntElt, SeqEnum[RngUPolElt], RngIntElt -> CodeAdd`

<a id="function-additivequasicycliccode-fldfin-rngintelt-seqenum-rngupolelt-rngintelt"></a>
### `AdditiveQuasiCyclicCode(K, n, Q, h): FldFin, RngIntElt, SeqEnum[RngUPolElt], RngIntElt -> CodeAdd`

Given an integer $n$, and a sequence $Q$ of polynomials over some finite field $F$, and an integer $h$, then return the $K$–additive quasicyclic code, whose cyclic blocks are generated by the polynomials in $Q$ and stacked $2$-dimensionally of height $h$. The field $K$ must be a subfield of $F$, and if it is the prime subfield of $F$, it may be omitted.

<a id="function-additivequasicycliccode-seqenum-modtupfldelt"></a>
### `AdditiveQuasiCyclicCode(Q): SeqEnum[ModTupFldElt] -> CodeAdd`

<a id="function-additivequasicycliccode-fldfin-seqenum-modtupfldelt"></a>
### `AdditiveQuasiCyclicCode(K, Q): FldFin, SeqEnum[ModTupFldElt] -> CodeAdd`

Given a sequence $Q$ of vectors over some finite field $F$, then return the $K$–additive quasicyclic code, whose cyclic blocks are generated by the vectors in $Q$. The field $K$ must be a subfield of $F$, and if it is the prime subfield of $F$, it may be omitted.

<a id="function-additivequasicycliccode-seqenum-modtupfldelt-rngintelt"></a>
### `AdditiveQuasiCyclicCode(Q, h): SeqEnum[ModTupFldElt], RngIntElt -> CodeAdd`

<a id="function-additivequasicycliccode-fldfin-seqenum-modtupfldelt-rngintelt"></a>
### `AdditiveQuasiCyclicCode(K, Q, h): FldFin, SeqEnum[ModTupFldElt], RngIntElt -> CodeAdd`

Given a sequence $Q$ of vectors over some finite field $F$, and an integer $h$, then return the $K$–additive quasicyclic code, whose cyclic blocks are generated by the vectors in $Q$ and stacked $2$-dimensionally of height $h$. The field $K$ must be a subfield of $F$, and if it is the prime subfield of $F$, it may be omitted.
