galois.irreducible_polys

galois.irreducible_polys(characteristic, degree)

Returns all monic irreducible polynomials \(f(x)\) over \(\mathrm{GF}(p)\) with degree \(m\).

If \(f(x)\) is an irreducible polynomial over \(\mathrm{GF}(p)\) and \(a \in \mathrm{GF}(p) \backslash \{0\}\), then \(a \cdot f(x)\) is also irreducible.

In addition to other applications, \(f(x)\) produces the field extension \(\mathrm{GF}(p^m)\) of \(\mathrm{GF}(p)\).

Parameters
  • characteristic (int) – The prime characteristic \(p\) of the field \(\mathrm{GF}(p)\) that the polynomial is over.

  • degree (int) – The degree \(m\) of the desired irreducible polynomial.

Returns

All degree-\(m\) monic irreducible polynomials over \(\mathrm{GF}(p)\).

Return type

list

Examples

In [1]: galois.irreducible_polys(2, 5)
Out[1]: 
[Poly(x^5 + x^2 + 1, GF(2)),
 Poly(x^5 + x^3 + 1, GF(2)),
 Poly(x^5 + x^3 + x^2 + x + 1, GF(2)),
 Poly(x^5 + x^4 + x^2 + x + 1, GF(2)),
 Poly(x^5 + x^4 + x^3 + x + 1, GF(2)),
 Poly(x^5 + x^4 + x^3 + x^2 + 1, GF(2))]