property galois.ReedSolomon.is_primitive : bool

Indicates if the Reed-Solomon code is primitive, meaning \(n = q - 1\).

Examples

Construct a primitive \(\textrm{RS}(255, 223)\) code over \(\mathrm{GF}(2^8)\).

In [1]: rs = galois.ReedSolomon(255, 223); rs
Out[1]: <Reed-Solomon Code: [255, 223, 33] over GF(2^8)>

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

In [3]: rs.n == rs.field.order - 1
Out[3]: True

Construct a non-primitive \(\textrm{RS}(85, 65)\) code over \(\mathrm{GF}(2^8)\).

In [4]: rs = galois.ReedSolomon(85, 65, field=galois.GF(2**8)); rs
Out[4]: <Reed-Solomon Code: [85, 65, 21] over GF(2^8)>

In [5]: rs.is_primitive
Out[5]: False

In [6]: rs.n == rs.field.order - 1
Out[6]: False