np.square

np.square(x)[source]

Squares a Galois field array element-wise.

References

Examples

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

In [2]: x = GF.Random(10); x
Out[2]: GF([29,  5,  7, 18,  2,  9, 15, 27, 10,  4], order=31)

In [3]: np.square(x)
Out[3]: GF([ 4, 25, 18, 14,  4, 19,  8, 16,  7, 16], order=31)

In [4]: x ** 2
Out[4]: GF([ 4, 25, 18, 14,  4, 19,  8, 16,  7, 16], order=31)

In [5]: x * x
Out[5]: GF([ 4, 25, 18, 14,  4, 19,  8, 16,  7, 16], order=31)