np.log¶
- np.log(x)¶
Computes the logarithm (base
GF.primitive_element
) of a Galois field array element-wise.Calling
np.log()
implicitly uses basegalois.FieldClass.primitive_element
. Seegalois.FieldArray.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([15, 11, 3, 18, 5, 25, 21, 15, 26, 20], order=31) In [4]: y = np.log(x); y Out[4]: array([21, 23, 1, 26, 20, 10, 29, 21, 5, 8]) In [5]: alpha ** y Out[5]: GF([15, 11, 3, 18, 5, 25, 21, 15, 26, 20], order=31)