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) \(Z = \{a^{b},a^{b+1}, ..., a^{b+delta-2}\}\), where a is a primitive \(n^{th}\) root of unity in the splitting field \(GF(q^m)\), b is an integer \(0\leq b\leq n-delta+1\) and m is the multiplicative order of q modulo n. (The integers \(b,...,b+delta-2\) typically lie in the range \(1,...,n-1\).) The integer \(delta \geq 1\) 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 \(Z\) 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 \(g(x)=1+x^2+x^4+x^5+x^6+x^{10}+x^{11}\). Extending it yields the extended Golay code (see ExtendedBinaryGolayCode).
CyclicCode() 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).
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).
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.
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 [HP]) 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 [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 \(G=(Q,N)\). Here \(Q\) is a \(p \times p\) circulant matrix whose top row is \((0,x_1,...,x_{p-1})\), where \(x_i=1\) if and only if \(i\) is a quadratic residue \(\mod p\), and \(N\) is a \(p \times p\) circulant matrix whose top row is \((0,y_1,...,y_{p-1})\), where \(x_i+y_i=1\) for all \(i\).
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() 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 \(g(x)=2+x^2+2x^3+x^4+x^5\).
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 *