Index of code constructions

The codes object may be used to access the codes that Sage can build.

BinaryGolayCode() This method is now deprecated. Please use sage.coding.golay_code.GolayCode instead.
CyclicCodeFromCheckPolynomial() If h is a polynomial over GF(q) which divides \(x^n-1\) then this constructs the code “generated by \(g = (x^n-1)/h\)” (ie, the code associated with the principle ideal \(gR\) in the ring \(R = GF(q)[x]/(x^n-1)\) 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).
CyclicCodeFromGeneratingPolynomial() If g is a polynomial over GF(q) which divides \(x^n-1\) then this constructs the code “generated by g” (ie, the code associated with the principle ideal \(gR\) in the ring \(R = GF(q)[x]/(x^n-1)\) in the usual way).
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() This method is now deprecated. Please use sage.coding.golay_code.GolayCode instead.
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 [HP2003], Section 6.6.3-6.6.4.)
ExtendedTernaryGolayCode() This method is now deprecated. Please use sage.coding.golay_code.GolayCode instead.
QuadraticResidueCode() A quadratic residue code (or QR code) is a cyclic code whose generator polynomial is the product of the polynomials \(x-\alpha^i\) (\(\alpha\) is a primitive \(n^{th}\) root of unity; \(i\) ranges over the set of quadratic residues modulo \(n\)).
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 \(n > 2\) is prime then (Theorem 6.6.2 in [HP2003]) a QR code exists over \(GF(q)\) iff q is a quadratic residue mod \(n\).
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 [HP2003]) 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).
RandomLinearCode() Deprecated alias of random_linear_code().
RandomLinearCodeGuava() The method used is to first construct a \(k \times n\) matrix of the block form \((I,A)\), where \(I\) is a \(k \times k\) identity matrix and \(A\) is a \(k \times (n-k)\) matrix constructed using random elements of \(F\). Then the columns are permuted using a randomly selected element of the symmetric group \(S_n\).
ReedMullerCode() Returns a Reed-Muller code.
ReedSolomonCode() NO DOCSTRING
TernaryGolayCode() This method is now deprecated. Please use sage.coding.golay_code.GolayCode instead.
ToricCode() Let \(P\) denote a list of lattice points in \(\ZZ^d\) and let \(T\) denote the set of all points in \((F^x)^d\) (ordered in some fixed way). Put \(n=|T|\) and let \(k\) denote the dimension of the vector space of functions \(V = \mathrm{Span}\{x^e \ |\ e \in P\}\). The associated toric code \(C\) is the evaluation code which is the image of the evaluation map
WalshCode() Returns the binary Walsh code of length \(2^m\). The matrix of codewords correspond to a Hadamard matrix. This is a (constant rate) binary linear \([2^m,m,2^{m-1}]\) code.
from_parity_check_matrix() Return the linear code that has H as a parity check matrix.
random_linear_code() Generate a random linear code of length length, dimension dimension and over the field F.

Note

To import these names into the global namespace, use:

sage: from sage.coding.codes_catalog import *