class property galois.FieldArray.units : FieldArray

All of the finite field’s units $$\{1, \dots, p^m-1\}$$.

Notes

A unit is an element with a multiplicative inverse.

Examples

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

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

In [2]: GF.units
Out[2]:
GF([ 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, repr="power")

In [4]: GF.units
Out[4]:
GF([   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 units of the extension field $$\mathrm{GF}(5^2)$$ in lexicographical order.

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

In [6]: GF.units
Out[6]:
GF([ 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, repr="poly")

In [8]: GF.units
Out[8]:
GF([     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, repr="power")

In [10]: GF.units
Out[10]:
GF([   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)