property galois.BCH.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 binary primitive $$\textrm{BCH}(15, 7)$$ code.

In [1]: bch = galois.BCH(15, 7); bch
Out[1]: <BCH Code: [15, 7, 5] over GF(2)>

In [2]: bch.parity_check_poly
Out[2]: Poly(x^7 + x^6 + x^4 + 1, GF(2))

In [3]: bch.H
Out[3]:
GF([[1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1]], order=2)


Construct a non-primitive $$\textrm{BCH}(13, 4)$$ code over $$\mathrm{GF}(3)$$.

In [4]: bch = galois.BCH(13, 4, field=galois.GF(3)); bch
Out[4]: <BCH Code: [13, 4, 7] over GF(3)>

In [5]: bch.parity_check_poly
Out[5]: Poly(x^4 + 2x^3 + 2x^2 + 1, GF(3))

In [6]: bch.H
Out[6]:
GF([[1, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 2, 2, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 0, 2, 2, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 0, 2, 2, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 1]], order=3)