np.log

np.log(x)[source]

Computes the logarithm (base GF.primitive_element) of a Galois field array element-wise.

Calling np.log() implicitly uses base galois.GFMeta.primitive_element. See galois.GFArray.log() for logarithm with arbitrary base.

References

Examples

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

In [2]: alpha = GF.primitive_element; alpha
Out[2]: GF(3, order=31)

In [3]: x = GF.Random(10, low=1); x
Out[3]: GF([ 4,  8, 25, 16, 19, 23, 20, 15, 10,  2], order=31)

In [4]: y = np.log(x); y
Out[4]: GF([18, 12, 10,  6,  4, 27,  8, 21, 14, 24], order=31)

In [5]: alpha ** y
Out[5]: GF([ 4,  8, 25, 16, 19, 23, 20, 15, 10,  2], order=31)