np.square

np.square(x)

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([ 0, 12,  2, 17, 22, 24, 19, 16, 15, 22], order=31)

In [3]: np.square(x)
Out[3]: GF([ 0, 20,  4, 10, 19, 18, 20,  8,  8, 19], order=31)

In [4]: x ** 2
Out[4]: GF([ 0, 20,  4, 10, 19, 18, 20,  8,  8, 19], order=31)

In [5]: x * x
Out[5]: GF([ 0, 20,  4, 10, 19, 18, 20,  8,  8, 19], order=31)