galois.bch_valid_codes(n: int, t_min: int = 1) list[tuple[int, int, int]]

Returns a list of \((n, k, t)\) tuples of valid primitive binary BCH codes.

A BCH code with parameters \((n, k, t)\) is represented as a \([n, k, d]_2\) linear block code with \(d = 2t + 1\).

Parameters
n: int

The codeword size \(n\), must be \(n = 2^m - 1\).

t_min: int = 1

The minimum error-correcting capability. The default is 1.

Returns

A list of \((n, k, t)\) tuples of valid primitive BCH codes.

See also

BCH

References

Examples

In [1]: galois.bch_valid_codes(31)
Out[1]: [(31, 26, 1), (31, 21, 2), (31, 16, 3), (31, 11, 5), (31, 6, 7), (31, 1, 15)]

In [2]: galois.bch_valid_codes(31, t_min=3)
Out[2]: [(31, 16, 3), (31, 11, 5), (31, 6, 7), (31, 1, 15)]