property galois.GF2.primitive_element : FieldArray

A primitive element of the finite field \(\mathrm{GF}(p^m)\).

Notes

A primitive element \(\alpha\) is a generator of the multiplicative group \(\mathrm{GF}(p^m)^\times\), which has order \(p^m - 1\). Equivalently, every nonzero field element can be written as \(\alpha^k\) for some integer \(k\).

Examples

The smallest primitive element of the prime field \(\mathrm{GF}(31)\).

In [1]: GF = galois.GF(31)

In [2]: GF.primitive_element
Out[2]: GF(3, order=31)
In [3]: GF = galois.GF(31, repr="power")

In [4]: GF.primitive_element
Out[4]: GF(α, order=31)

The smallest primitive element of the extension field \(\mathrm{GF}(5^2)\).

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

In [6]: GF.primitive_element
Out[6]: GF(5, order=5^2)
In [7]: GF = galois.GF(5**2, repr="poly")

In [8]: GF.primitive_element
Out[8]: GF(α, order=5^2)
In [9]: GF = galois.GF(5**2, repr="power")

In [10]: GF.primitive_element
Out[10]: GF(α, order=5^2)