[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Families of Linear Codes

This section gives some standard constructions for Z_4-linear codes. Further constructions will be available in the future.

KerdockCode(m, h): RngIntElt, RngUPolElt -> Code
Given an integer m >= 2, and a primitive polynomial h in Z_4[x] of degree m, return the quaternary Kerdock Code K(m) of length 2^m - 1 defined by h. See [Wan97, Chap. 8] for more information.
KerdockCode(m): RngIntElt, RngUPolElt -> Code
Given an integer m >= 2, return the quaternary Kerdock Code K(m) of length 2^m - 1 defined by a default primitive polynomial h in Z_4[x] of degree m.
PreparataCode(m, h): RngIntElt, RngUPolElt -> Code
Given an integer m >= 2, and a primitive polynomial h in Z_4[x] of degree m, return the quaternary Preparata code P(m) of length 2^m - 1 defined by h. See [Wan97, Chap. 9] for more information.
PreparataCode(m): RngIntElt, RngUPolElt -> Code
Given an integer m >= 2, return the quaternary Preparata code P(m) of length 2^m - 1 defined by a default primitive polynomial h in Z_4[x] of degree m.

Example CodeRng_Kerdock (H98E11)

We compute some default Kerdock and Preparata codes.

> KerdockCode(3);
[8, 4, 4] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 3 1 2 1]
[0 1 0 0 2 1 1 3]
[0 0 1 0 1 1 3 2]
[0 0 0 1 3 2 3 3]
> KerdockCode(4);
[16, 5, 8] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 0 1 1 3 0 3 3 0 2 1 2 3]
[0 1 0 0 0 2 3 3 3 2 1 3 0 0 1 1]
[0 0 1 0 0 3 1 0 3 0 3 1 1 3 2 2]
[0 0 0 1 0 2 1 3 0 1 2 3 1 3 3 0]
[0 0 0 0 1 1 3 0 3 3 0 2 1 2 1 3]
> PreparataCode(3);
[8, 4, 4] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 3 1 2 1]
[0 1 0 0 2 1 1 3]
[0 0 1 0 1 1 3 2]
[0 0 0 1 3 2 3 3]
Using the function Z4CyclotomicFactors, we can use different primitive polynomials if we wish.

> P<x> := PolynomialRing(IntegerRing(4));
> L := Z4CyclotomicFactors(2^4 - 1);
> L;
[
    x + 3,
    x^2 + x + 1,
    x^4 + 2*x^2 + 3*x + 1,
    x^4 + 3*x^3 + 2*x^2 + 1,
    x^4 + x^3 + x^2 + x + 1
]
> KerdockCode(4, L[3]);
[16, 5, 8] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 0 1 1 3 0 3 3 0 2 1 2 3]
[0 1 0 0 0 2 3 3 3 2 1 3 0 0 1 1]
[0 0 1 0 0 3 1 0 3 0 3 1 1 3 2 2]
[0 0 0 1 0 2 1 3 0 1 2 3 1 3 3 0]
[0 0 0 0 1 1 3 0 3 3 0 2 1 2 1 3]
> KerdockCode(4, L[4]);
[16, 5, 8] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 0 1 2 1 2 0 3 3 0 3 1 3]
[0 1 0 0 0 3 3 1 3 2 1 0 3 1 2 0]
[0 0 1 0 0 2 3 1 1 3 0 3 0 1 3 2]
[0 0 0 1 0 1 0 0 3 1 2 3 3 3 2 1]
[0 0 0 0 1 2 1 2 0 3 3 0 3 1 1 3]
Note that the last polynomial of degree 4 is irreducible but not primitive.

> L[5];
x^4 + x^3 + x^2 + x + 1

> KerdockCode(4, L[5]); >> KerdockCode(4, L[5]); ^ Runtime error in 'KerdockCode': Polynomial is not primitive
 [Next][Prev] [Right] [Left] [Up] [Index] [Root]