# 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.

### `AdditiveCyclicCode(v): ModTupFldElt -> CodeAdd`

### `AdditiveCyclicCode(K, v): FldFin, ModTupFldElt -> CodeAdd`

### `AdditiveCyclicCode(Q): [ModTupFldElt] -> CodeAdd`

### `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.

### `AdditiveCyclicCode(n, f): RngIntElt, RngUPolElt -> CodeAdd`

### `AdditiveCyclicCode(K, n, f): FldFin, RngIntElt, RngUPolElt -> CodeAdd`

### `AdditiveCyclicCode(n, Q): RngIntElt, [RngUPolElt] -> CodeAdd`

### `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.

### `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.

### `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.

### `AdditiveQuasiCyclicCode(n, Q): RngIntElt, SeqEnum[RngUPolElt] -> CodeAdd`

### `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.

### `AdditiveQuasiCyclicCode(n, Q, h): RngIntElt, SeqEnum[RngUPolElt], RngIntElt -> CodeAdd`

### `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.

### `AdditiveQuasiCyclicCode(Q): SeqEnum[ModTupFldElt] -> CodeAdd`

### `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.

### `AdditiveQuasiCyclicCode(Q, h): SeqEnum[ModTupFldElt], RngIntElt -> CodeAdd`

### `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.
