- galois.FieldArray.additive_order() integer | ndarray
Computes the additive order of each element in
.- Returns¶
An integer array of the additive order of each element in
. The return value is a single integer if the input array is a scalar.
Notes¶
The additive order
of in is the smallest integer such that . With the exception of 0, the additive order of every element is the finite field’s characteristic.Examples¶
Compute the additive order of each element of
.In [1]: GF = galois.GF(3**2, display="poly") In [2]: x = GF.elements; x Out[2]: GF([ 0, 1, 2, α, α + 1, α + 2, 2α, 2α + 1, 2α + 2], order=3^2) In [3]: order = x.additive_order(); order Out[3]: array([1, 3, 3, 3, 3, 3, 3, 3, 3]) In [4]: x * order Out[4]: GF([0, 0, 0, 0, 0, 0, 0, 0, 0], order=3^2)