galois.FieldArray.field_trace()

Computes the field trace $$\mathrm{Tr}_{L / K}(x)$$ of the elements of $$x$$.

Returns:

The field trace of $$x$$ in the prime subfield $$\mathrm{GF}(p)$$.

The self array $$x$$ is over the extension field $$L = \mathrm{GF}(p^m)$$. The field trace of $$x$$ is over the subfield $$K = \mathrm{GF}(p)$$. In other words, $$\mathrm{Tr}_{L / K}(x) : L \rightarrow K$$.

For finite fields, since $$L$$ is a Galois extension of $$K$$, the field trace of $$x$$ is defined as a sum of the Galois conjugates of $$x$$.

$\mathrm{Tr}_{L / K}(x) = \sum_{i=0}^{m-1} x^{p^i}$

Examples

Compute the field trace of the elements of $$\mathrm{GF}(3^2)$$.

In : GF = galois.GF(3**2)

In : x = GF.elements; x
Out: GF([0, 1, 2, 3, 4, 5, 6, 7, 8], order=3^2)

In : y = x.field_trace(); y
Out: GF([0, 2, 1, 1, 0, 2, 2, 1, 0], order=3)

In : GF = galois.GF(3**2, repr="poly")

In : x = GF.elements; x
Out:
GF([     0,      1,      2,      α,  α + 1,  α + 2,     2α, 2α + 1,
2α + 2], order=3^2)

In : y = x.field_trace(); y
Out: GF([0, 2, 1, 1, 0, 2, 2, 1, 0], order=3)

In : GF = galois.GF(3**2, repr="power")

In : x = GF.elements; x
Out: GF([  0,   1, α^4,   α, α^2, α^7, α^5, α^3, α^6], order=3^2)

In : y = x.field_trace(); y
Out: GF([0, 2, 1, 1, 0, 2, 2, 1, 0], order=3)