np.copy

np.copy(a)[source]

Returns a copy of a given Galois field array.

See: https://numpy.org/doc/stable/reference/generated/numpy.copy.html

Examples

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

In [2]: a = GF.Random(5, low=1); a
Out[2]: GF([1, 6, 5, 4, 2], order=2^3)

In [3]: b = np.copy(a); b
Out[3]: GF([1, 6, 5, 4, 2], order=2^3)

In [4]: a[0] = 0; a
Out[4]: GF([0, 6, 5, 4, 2], order=2^3)

# b is unmodified
In [5]: b
Out[5]: GF([1, 6, 5, 4, 2], order=2^3)