- class property galois.FieldArray.primitive_elements : FieldArray
All primitive elements \(\alpha\) of the Galois field \(\mathrm{GF}(p^m)\).
Notes¶
A primitive element is a multiplicative generator of the field, such that \(\mathrm{GF}(p^m) = \{0, 1, \alpha, \alpha^2, \dots, \alpha^{p^m - 2}\}\). A primitive element is a root of the primitive polynomial \(f(x)\), such that \(f(\alpha) = 0\) over \(\mathrm{GF}(p^m)\).
Examples¶
All primitive elements of the prime field \(\mathrm{GF}(31)\) in increasing order.
In [1]: GF = galois.GF(31) In [2]: GF.primitive_elements Out[2]: GF([ 3, 11, 12, 13, 17, 21, 22, 24], order=31)
In [3]: GF = galois.GF(31, repr="power") In [4]: GF.primitive_elements Out[4]: GF([ α, α^23, α^19, α^11, α^7, α^29, α^17, α^13], order=31)
All primitive elements of the extension field \(\mathrm{GF}(5^2)\) in lexicographical order.
In [5]: GF = galois.GF(5**2) In [6]: GF.primitive_elements Out[6]: GF([ 5, 9, 10, 13, 15, 17, 20, 21], order=5^2)
In [7]: GF = galois.GF(5**2, repr="poly") In [8]: GF.primitive_elements Out[8]: GF([ α, α + 4, 2α, 2α + 3, 3α, 3α + 2, 4α, 4α + 1], order=5^2)
In [9]: GF = galois.GF(5**2, repr="power") In [10]: GF.primitive_elements Out[10]: GF([ α, α^17, α^7, α^23, α^19, α^11, α^13, α^5], order=5^2)