galois.BCH.__str__() str

A formatted string with relevant properties of the BCH code.

Examples

Construct a binary primitive \(\textrm{BCH}(15, 7)\) code.

In [1]: bch = galois.BCH(15, 7)

In [2]: print(bch)
BCH Code:
  [n, k, d]: [15, 7, 5]
  field: GF(2)
  extension_field: GF(2^4)
  generator_poly: x^8 + x^7 + x^6 + x^4 + 1
  is_primitive: True
  is_narrow_sense: True
  is_systematic: True

Construct a primitive \(\textrm{BCH}(26, 14)\) code over \(\mathrm{GF}(3)\).

In [3]: bch = galois.BCH(26, 14, field=galois.GF(3))

In [4]: print(bch)
BCH Code:
  [n, k, d]: [26, 14, 7]
  field: GF(3)
  extension_field: GF(3^3)
  generator_poly: x^12 + x^11 + 2x^6 + x^3 + 2x^2 + 2x + 1
  is_primitive: True
  is_narrow_sense: True
  is_systematic: True

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

In [5]: bch = galois.BCH(13, 4, field=galois.GF(3))

In [6]: print(bch)
BCH Code:
  [n, k, d]: [13, 4, 7]
  field: GF(3)
  extension_field: GF(3^3)
  generator_poly: x^9 + x^8 + 2x^7 + x^5 + 2x^3 + 2x^2 + 2
  is_primitive: False
  is_narrow_sense: True
  is_systematic: True