galois.FieldArray.minimal_poly() Poly

Computes the minimal polynomial of a finite field element \(a\).

Important

This function may only be invoked on a single finite field element (scalar 0-D array).

Returns

For scalar inputs, the minimal polynomial \(m_a(x)\) of \(a\) over \(\mathrm{GF}(p)\).

Notes

An element \(a\) of \(\mathrm{GF}(p^m)\) has minimal polynomial \(m_a(x)\) over \(\mathrm{GF}(p)\). The minimal polynomial when evaluated in \(\mathrm{GF}(p^m)\) annihilates \(a\), that is \(m_a(a) = 0\). The minimal polynomial always divides the characteristic polynomial. In prime fields \(\mathrm{GF}(p)\), the minimal polynomial of \(a\) is simply \(m_a(x) = x - a\).

References

Examples

The minimal polynomial of the element \(a\).

In [1]: GF = galois.GF(3**5)

In [2]: a = GF.Random(); a
Out[2]: GF(101, order=3^5)

In [3]: poly = a.minimal_poly(); poly
Out[3]: Poly(x^5 + x^4 + x^3 + x + 1, GF(3))

# The minimal polynomial annihilates a
In [4]: poly(a, field=GF)
Out[4]: GF(0, order=3^5)

# The minimal polynomial always divides the characteristic polynomial
In [5]: divmod(a.characteristic_poly(), poly)
Out[5]: (Poly(1, GF(3)), Poly(0, GF(3)))

Last update: Jul 28, 2022