- property galois.GF2.primitive_elements : FieldArray
All primitive elements 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\).
See also
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)