galois.conway_poly(characteristic, degree)

Returns the Conway polynomial \(C_{p,m}(x)\) over \(\mathrm{GF}(p)\) with degree \(m\).

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

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


The degree-\(m\) Conway polynomial \(C_{p,m}(x)\) over \(\mathrm{GF}(p)\).

Return type



LookupError – If the Conway polynomial \(C_{p,m}(x)\) is not found in Frank Luebeck’s database.


A Conway polynomial is a an irreducible and primitive polynomial over \(\mathrm{GF}(p)\) that provides a standard representation of \(\mathrm{GF}(p^m)\) as a splitting field of \(C_{p,m}(x)\). Conway polynomials provide compatability between fields and their subfields, and hence are the common way to represent extension fields.

The Conway polynomial \(C_{p,m}(x)\) is defined as the lexicographically-minimal monic primitive polynomial of degree \(m\) over \(\mathrm{GF}(p)\) that is compatible with all \(C_{p,n}(x)\) for \(n\) dividing \(m\).

This function uses Frank Luebeck’s Conway polynomial database for fast lookup, not construction.


Notice galois.primitive_poly() returns the lexicographically-minimal primitive polynomial, where galois.conway_poly() returns the lexicographically-minimal primitive polynomial that is consistent with smaller Conway polynomials, which is not necessarily the same.

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

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

In [4]: galois.conway_poly(7, 10)
Out[4]: Poly(x^10 + x^6 + x^5 + 4x^4 + x^3 + 2x^2 + 3x + 3, GF(7))