class property galois.FieldArray.primitive_elements : FieldArray

All primitive elements \(\alpha\) of the Galois field \(\mathrm{GF}(p^m)\). 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}\}\).

Examples

All primitive elements of the prime field \(\mathrm{GF}(31)\) in increasing order.

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

In [2]: GF.elements
Out[2]: 
GF([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
    17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30], order=31)
In [3]: GF = galois.GF(31, display="power")

In [4]: GF.elements
Out[4]: 
GF([   0,    1, α^24,    α, α^18, α^20, α^25, α^28, α^12,  α^2, α^14,
    α^23, α^19, α^11, α^22, α^21,  α^6,  α^7, α^26,  α^4,  α^8, α^29,
    α^17, α^27, α^13, α^10,  α^5,  α^3, α^16,  α^9, α^15], order=31)

All primitive elements of the extension field \(\mathrm{GF}(5^2)\) in lexicographically-increasing order.

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

In [6]: GF.elements
Out[6]: 
GF([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
    17, 18, 19, 20, 21, 22, 23, 24], order=5^2)
In [7]: GF = galois.GF(5**2, display="poly")

In [8]: GF.elements
Out[8]: 
GF([     0,      1,      2,      3,      4,      α,  α + 1,  α + 2,
     α + 3,  α + 4,     2α, 2α + 1, 2α + 2, 2α + 3, 2α + 4,     3α,
    3α + 1, 3α + 2, 3α + 3, 3α + 4,     4α, 4α + 1, 4α + 2, 4α + 3,
    4α + 4], order=5^2)
In [9]: GF = galois.GF(5**2, display="power")

In [10]: GF.elements
Out[10]: 
GF([   0,    1,  α^6, α^18, α^12,    α, α^22, α^15,  α^2, α^17,  α^7,
     α^8,  α^4, α^23, α^21, α^19,  α^9, α^11, α^16, α^20, α^13,  α^5,
    α^14,  α^3, α^10], order=5^2)