property galois.ReedSolomon.parity_check_poly : Poly

The parity-check polynomial \(h(x)\).

Notes

The parity-check polynomial is the generator polynomial of the dual code.

Examples

Construct a primitive \(\textrm{RS}(15, 9)\) code over \(\mathrm{GF}(2^4)\).

In [1]: rs = galois.ReedSolomon(15, 9); rs
Out[1]: <Reed-Solomon Code: [15, 9, 7] over GF(2^4)>

In [2]: rs.parity_check_poly
Out[2]: Poly(x^9 + 7x^8 + 15x^7 + 2x^6 + 5x^5 + 3x^4 + 3x^3 + 11x^2 + 15x + 10, GF(2^4))

In [3]: rs.H
Out[3]: 
GF([[ 9, 13, 15, 14,  7, 10,  5, 11, 12,  6,  3,  8,  4,  2,  1],
    [13, 14, 10, 11,  6,  8,  2,  9, 15,  7,  5, 12,  3,  4,  1],
    [15, 10, 12,  8,  1, 15, 10, 12,  8,  1, 15, 10, 12,  8,  1],
    [14, 11,  8,  9,  7, 12,  4, 13, 10,  6,  2, 15,  5,  3,  1],
    [ 7,  6,  1,  7,  6,  1,  7,  6,  1,  7,  6,  1,  7,  6,  1],
    [10,  8, 15, 12,  1, 10,  8, 15, 12,  1, 10,  8, 15, 12,  1]],
   order=2^4)

Construct a non-primitive \(\textrm{RS}(13, 9)\) code over \(\mathrm{GF}(3^3)\).

In [4]: rs = galois.ReedSolomon(13, 9, field=galois.GF(3**3)); rs
Out[4]: <Reed-Solomon Code: [13, 9, 5] over GF(3^3)>

In [5]: rs.parity_check_poly
Out[5]: Poly(x^9 + 18x^8 + 10x^7 + 20x^6 + 17x^5 + 11x^4 + 24x^3 + 22x^2 + 25x + 26, GF(3^3))

In [6]: rs.H
Out[6]: 
GF([[25,  8, 22, 16,  7,  6, 11, 12, 20, 13, 15,  9,  1],
    [ 8, 16,  6, 12, 13,  9, 25, 22,  7, 11, 20, 15,  1],
    [22,  6, 20,  9,  8,  7, 12, 15, 25, 16, 11, 13,  1],
    [16, 12,  9, 22, 11, 15,  8,  6, 13, 25,  7, 20,  1]], order=3^3)