np.negative

np.negative(x)

Returns the element-wise additive inverse of a Galois field array.

References

Examples

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

In [2]: x = GF.Random(10); x
Out[2]: GF([29, 26,  4,  0,  0,  4, 19, 15, 26, 13], order=31)

In [3]: y = np.negative(x); y
Out[3]: GF([ 2,  5, 27,  0,  0, 27, 12, 16,  5, 18], order=31)

In [4]: x + y
Out[4]: GF([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], order=31)
In [5]: -x
Out[5]: GF([ 2,  5, 27,  0,  0, 27, 12, 16,  5, 18], order=31)

In [6]: -1*x
Out[6]: GF([ 2,  5, 27,  0,  0, 27, 12, 16,  5, 18], order=31)