- property galois.BCH.is_primitive : bool
Indicates if the BCH code is primitive, meaning \(n = q^m - 1\).
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.is_primitive Out[2]: True In [3]: bch.n == bch.extension_field.order - 1 Out[3]: True
Construct a non-primitive \(\textrm{BCH}(13, 7)\) code over \(\mathrm{GF}(3)\).
In [4]: bch = galois.BCH(13, 7, field=galois.GF(3)); bch Out[4]: <BCH Code: [13, 7, 4] over GF(3)> In [5]: bch.is_primitive Out[5]: False In [6]: bch.n == bch.extension_field.order - 1 Out[6]: False