class property galois.FieldArray.units : FieldArray

All of the finite field’s units \(\{1, \dots, p^m-1\}\). 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)

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

In [3]: GF = galois.GF(5**2, display="poly")

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

Last update: Jul 28, 2022