class property galois.FieldArray.non_squares : FieldArray

All non-squares in the Galois field.

Notes

An element \(x\) in \(\mathrm{GF}(p^m)\) is a non-square if there does not exist a \(y\) such that \(y^2 = x\) in the field.

See also

is_square

Examples

In fields with characteristic 2, no elements are non-squares.

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

In [2]: GF.non_squares
Out[2]: GF([], order=2^3)
In [3]: GF = galois.GF(2**3, repr="poly")

In [4]: GF.non_squares
Out[4]: GF([], order=2^3)
In [5]: GF = galois.GF(2**3, repr="power")

In [6]: GF.non_squares
Out[6]: GF([], order=2^3)

In fields with characteristic greater than 2, exactly half of the nonzero elements are non-squares.

In [7]: GF = galois.GF(11)

In [8]: GF.non_squares
Out[8]: GF([ 2,  6,  7,  8, 10], order=11)
In [9]: GF = galois.GF(11, repr="power")

In [10]: GF.non_squares
Out[10]: GF([  α, α^9, α^7, α^3, α^5], order=11)