Index of codesΒΆ
The codes object may be used to access the codes that Sage can build.
BCHCode() |
A ‘Bose-Chaudhuri-Hockenghem code’ (or BCH code for short) is the largest possible cyclic code of length n over field F=GF(q), whose generator polynomial has zeros (which contain the set) , where a is a primitive root of unity in the splitting field , b is an integer and m is the multiplicative order of q modulo n. (The integers typically lie in the range .) The integer is called the “designed distance”. The length n of the code and the size q of the base field must be relatively prime. The generator polynomial is equal to the least common multiple of the minimal polynomials of the elements of the set above. |
BinaryGolayCode() |
BinaryGolayCode() returns a binary Golay code. This is a perfect [23,12,7] code. It is also (equivalent to) a cyclic code, with generator polynomial . Extending it yields the extended Golay code (see ExtendedBinaryGolayCode). |
CyclicCode() |
If g is a polynomial over GF(q) which divides then this constructs the code “generated by g” (ie, the code associated with the principle ideal in the ring in the usual way). |
CyclicCodeFromCheckPolynomial() |
If h is a polynomial over GF(q) which divides then this constructs the code “generated by ” (ie, the code associated with the principle ideal in the ring in the usual way). The option “ignore” says to ignore the condition that the characteristic of the base field does not divide the length (the usual assumption in the theory of cyclic codes). |
DuadicCodeEvenPair() |
Constructs the “even pair” of duadic codes associated to the “splitting” (see the docstring for is_a_splitting for the definition) S1, S2 of n. |
DuadicCodeOddPair() |
Constructs the “odd pair” of duadic codes associated to the “splitting” S1, S2 of n. |
ExtendedBinaryGolayCode() |
ExtendedBinaryGolayCode() returns the extended binary Golay code. This is a perfect [24,12,8] code. This code is self-dual. |
ExtendedQuadraticResidueCode() |
The extended quadratic residue code (or XQR code) is obtained from a QR code by adding a check bit to the last coordinate. (These codes have very remarkable properties such as large automorphism groups and duality properties - see [HP], Section 6.6.3-6.6.4.) |
ExtendedTernaryGolayCode() |
ExtendedTernaryGolayCode returns a ternary Golay code. This is a self-dual perfect [12,6,6] code. |
LinearCodeFromCheckMatrix() |
A linear [n,k]-code C is uniquely determined by its generator matrix G and check matrix H. We have the following short exact sequence |
QuadraticResidueCode() |
A quadratic residue code (or QR code) is a cyclic code whose generator polynomial is the product of the polynomials ( is a primitive root of unity; ranges over the set of quadratic residues modulo ). |
QuadraticResidueCodeEvenPair() |
Quadratic residue codes of a given odd prime length and base ring either don’t exist at all or occur as 4-tuples - a pair of “odd-like” codes and a pair of “even-like” codes. If is prime then (Theorem 6.6.2 in [HP]) a QR code exists over iff q is a quadratic residue mod . |
QuadraticResidueCodeOddPair() |
Quadratic residue codes of a given odd prime length and base ring either don’t exist at all or occur as 4-tuples - a pair of “odd-like” codes and a pair of “even-like” codes. If n 2 is prime then (Theorem 6.6.2 in [HP]) a QR code exists over GF(q) iff q is a quadratic residue mod n. |
QuasiQuadraticResidueCode() |
A (binary) quasi-quadratic residue code (or QQR code), as defined by Proposition 2.2 in [BM], has a generator matrix in the block form . Here is a circulant matrix whose top row is , where if and only if is a quadratic residue , and is a circulant matrix whose top row is , where for all . |
RandomLinearCode() |
The method used is to first construct a matrix using Sage’s random_element method for the MatrixSpace class. The construction is probabilistic but should only fail extremely rarely. |
RandomLinearCodeGuava() |
The method used is to first construct a matrix of the block form , where is a identity matrix and is a matrix constructed using random elements of . Then the columns are permuted using a randomly selected element of the symmetric group . |
ReedMullerCode() |
Returns a Reed-Muller code. |
ReedSolomonCode() |
NO DOCSTRING |
TernaryGolayCode() |
TernaryGolayCode returns a ternary Golay code. This is a perfect [11,6,5] code. It is also equivalent to a cyclic code, with generator polynomial . |
ToricCode() |
Let denote a list of lattice points in and let denote the set of all points in (ordered in some fixed way). Put and let denote the dimension of the vector space of functions . The associated toric code is the evaluation code which is the image of the evaluation map |
TrivialCode() |
NO DOCSTRING |
WalshCode() |
Returns the binary Walsh code of length . The matrix of codewords correspond to a Hadamard matrix. This is a (constant rate) binary linear code. |
Note
To import these names into the global namespace, use:
sage: from sage.coding.codes_catalog import *

, where a is a primitive
root of unity in the splitting field
, b is an integer
and m is the multiplicative order of q modulo n. (The integers
typically lie in the range
.) The integer
is called the “designed distance”. The length n of the code and the size q of the base field must be relatively prime. The generator polynomial is equal to the least common multiple of the minimal polynomials of the elements of the set
above.
. Extending it yields the extended Golay code (see ExtendedBinaryGolayCode).
then this constructs the code “generated by g” (ie, the code associated with the principle ideal
in the ring
in the usual way).
” (ie, the code associated with the principle ideal
(
is a primitive
ranges over the set of quadratic residues modulo
).
is prime then (Theorem 6.6.2 in
iff q is a quadratic residue mod
. Here
is a
circulant matrix whose top row is
, where
if and only if
, and
is a
, where
for all
matrix using Sage’s random_element method for the MatrixSpace class. The construction is probabilistic but should only fail extremely rarely.
, where
is a
identity matrix and
is a
matrix constructed using random elements of
. Then the columns are permuted using a randomly selected element of the symmetric group
.
.
denote a list of lattice points in
and let
denote the set of all points in
(ordered in some fixed way). Put
and let
denote the dimension of the vector space of functions
. The associated toric code
is the evaluation code which is the image of the evaluation map
. The matrix of codewords correspond to a Hadamard matrix. This is a (constant rate) binary linear
code.