FLINT3.7.0-dev

Frobenius map, norm and trace

Synopsis#include <flint/fq.h>
void fq_frobenius(fq_t rop, const fq_t op, slong e, const fq_ctx_t ctx)source

Sets rop to σe(op)=oppe\sigma^e(\mathit{op}) = \mathit{op}^{p^e}. Any ee is allowed, including negative values; it is reduced modulo dd. The power is computed by binary exponentiation, at the cost of about elog⁡2pe \log_2 p squarings for the reduced ee.

void fq_norm(fmpz_t rop, const fq_t op, const fq_ctx_t ctx)source
void _fq_norm(fmpz_t rop, const fmpz * op, slong len, const fq_ctx_t ctx)source

Set rop to the norm of op, respectively of the nonzero element (op, len) with 1≤len≤d1 \le \mathit{len} \le d, as an integer in [0,p)[0, p). The norm of an element with representative a(x)a(x) is computed as the resultant Res⁡(f,a)/lc⁡(f)deg⁡a\operatorname{Res}(f, a) / \operatorname{lc}(f)^{\deg a}, or as a0da_0^d for an element of Fp\mathbb{F}_p.

void fq_trace(fmpz_t rop, const fq_t op, const fq_ctx_t ctx)source
void _fq_trace(fmpz_t rop, const fmpz * op, slong len, const fq_ctx_t ctx)source

Set rop to the trace of op, respectively of the nonzero element (op, len) with 1≤len≤d1 \le \mathit{len} \le d, as an integer in [0,p)[0, p). The traces Tr⁡(xi)\operatorname{Tr}(x^i) of the basis elements are computed from the coefficients of ff by Newton's identities, and the trace of a=∑aixia = \sum a_i x^i is ∑aiTr⁡(xi)\sum a_i \operatorname{Tr}(x^i).

The Galois group of Fq/Fp\mathbb{F}_q/\mathbb{F}_p, q=pdq = p^d, is cyclic of order dd and generated by the Frobenius automorphism σ(a)=ap\sigma(a) = a^p. fq_frobenius applies its powers, and fq_norm and fq_trace compute the product and the sum of the dd conjugates σi(a)\sigma^i(a), which are elements of the prime field, returned as integers in [0,p)[0, p). The same functions exist for fq_nmod, fq_zech and fq_default; the algorithms, Newton's identities for the trace and a resultant for the norm, are described in Frobenius map, norm, trace and roots.

AlgorithmFrobenius map, norm, trace and rootsHow FLINT applies the Frobenius automorphism a↦apea \mapsto a^{p^e}, computes the trace from power sums given by Newton's identities and the norm as a resultant, and computes pp-th roots, square roots (Tonelli–Shanks) and multiplicative orders in Fpd\mathbb{F}_{p^d}.

Example#

The program works in F75\mathbb{F}_{7^5}, defined by the Conway polynomial f=X5+X+4f = X^5 + X + 4, and compares the norm and the trace of a=x+2a = x + 2 with the product and the sum of its conjugates. Here N(a)=(−1)5f(−2)=30≡2N(a) = (-1)^5 f(-2) = 30 \equiv 2 and, since the power sum Tr⁡(x)\operatorname{Tr}(x) is minus the coefficient of X4X^4, Tr⁡(a)=0+5⋅2≡3\operatorname{Tr}(a) = 0 + 5 \cdot 2 \equiv 3. It also checks that σ5\sigma^5 is the identity and that σ−1\sigma^{-1}, which fq_frobenius accepts as the exponent −1≡4(mod5)-1 \equiv 4 \pmod 5, is the pp-th root.

Examplefq_norm_trace.cchecked by make checkdoc
#include <flint/flint.h>
#include <flint/fmpz.h>
#include <flint/fq.h>

int main(void)
{
    fmpz_t p, n, t;
    fq_ctx_t ctx;
    fq_t a, c, prod, sum;
    slong i, d = 5;

    fmpz_init_set_ui(p, 7);
    fmpz_init(n);
    fmpz_init(t);
    fq_ctx_init(ctx, p, d, "x");                  /* GF(7^5) */
    fq_init(a, ctx);
    fq_init(c, ctx);
    fq_init(prod, ctx);
    fq_init(sum, ctx);

    fq_ctx_print(ctx);
    fq_gen(a, ctx);
    fq_set_ui(c, 2, ctx);
    fq_add(a, a, c, ctx);                         /* a = x + 2 */

    fq_one(prod, ctx);
    fq_zero(sum, ctx);
    for (i = 0; i < d; i++)
    {
        fq_frobenius(c, a, i, ctx);               /* c = a^(7^i) */
        fq_mul(prod, prod, c, ctx);
        fq_add(sum, sum, c, ctx);
    }

    fq_norm(n, a, ctx);
    fq_trace(t, a, ctx);
    flint_printf("norm  = %{fmpz}, product of conjugates = ", n);
    fq_print_pretty(prod, ctx);
    flint_printf("\ntrace = %{fmpz}, sum of conjugates = ", t);
    fq_print_pretty(sum, ctx);
    flint_printf("\n");

    fq_frobenius(c, a, d, ctx);
    flint_printf("sigma^5(a) == a: %d\n", fq_equal(c, a, ctx));
    fq_frobenius(c, a, -1, ctx);
    fq_pth_root(prod, a, ctx);
    flint_printf("sigma^-1(a) == pth_root(a): %d\n", fq_equal(c, prod, ctx));

    fq_clear(a, ctx);
    fq_clear(c, ctx);
    fq_clear(prod, ctx);
    fq_clear(sum, ctx);
    fq_ctx_clear(ctx);
    fmpz_clear(p);
    fmpz_clear(n);
    fmpz_clear(t);
    return 0;
}
Output
p = 7
d = 5
f(X) = X^5+X+4
norm  = 2, product of conjugates = 2
trace = 3, sum of conjugates = 3
sigma^5(a) == a: 1
sigma^-1(a) == pth_root(a): 1

Costs#

fq_frobenius computes apea^{p^e} by binary exponentiation, about elog⁡2pe \log_2 p squarings; for repeated applications of the same power to many elements, the matrix of σe\sigma^e (an Fp\mathbb{F}_p-linear map, see fq_embed_composition_matrix applied to xpex^{p^e}) can be cheaper. The trace costs O(dt)O(dt) operations in Fp\mathbb{F}_p for a defining polynomial with tt nonzero terms, and the norm one resultant of two polynomials of degree at most dd.

Cite this page

The FLINT team, “Frobenius map, norm and trace (fq.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fq/frobenius.html (generated 2026-11-02).