galois.FieldArray.additive_order() integer | ndarray

Computes the additive order of each element in x.

Returns

An integer array of the additive order of each element in x. The return value is a single integer if the input array x is a scalar.

Notes

The additive order a of x in GF(pm) is the smallest integer a such that xa=0. 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 GF(32).

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)