property galois.ReedSolomon.is_narrow_sense : bool

Indicates if the Reed-Solomon code is narrow-sense, meaning the roots of the generator polynomial are consecutive powers of \(\alpha\) starting at 1, that is \(\alpha, \dots, \alpha^{d-1}\).

Examples

Construct a narrow-sense \(\textrm{RS}(15, 9)\) code over \(\mathrm{GF}(2^4)\) with first consecutive root \(\alpha\).

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

In [2]: rs.is_narrow_sense
Out[2]: True

In [3]: rs.c == 1
Out[3]: True

In [4]: rs.generator_poly
Out[4]: Poly(x^6 + 7x^5 + 9x^4 + 3x^3 + 12x^2 + 10x + 12, GF(2^4))

In [5]: rs.roots
Out[5]: GF([ 2,  4,  8,  3,  6, 12], order=2^4)

Construct a narrow-sense \(\textrm{RS}(15, 9)\) code over \(\mathrm{GF}(2^4)\) with first consecutive root \(\alpha^3\). Notice the design distance is the same, however the generator polynomial is different.

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

In [7]: rs.is_narrow_sense
Out[7]: False

In [8]: rs.c == 1
Out[8]: False

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

In [10]: rs.roots
Out[10]: GF([ 8,  3,  6, 12, 11,  5], order=2^4)