Frobenius map, norm and trace
#include <flint/fq.h>Sets rop to . Any is allowed, including negative values; it is reduced modulo . The power is computed by binary exponentiation, at the cost of about squarings for the reduced .
Set rop to the norm of op, respectively of the nonzero element (op, len) with , as an integer in . The norm of an element with representative is computed as the resultant , or as for an element of .
Set rop to the trace of op, respectively of the nonzero element (op, len) with , as an integer in . The traces of the basis elements are computed from the coefficients of by Newton's identities, and the trace of is .
The Galois group of , , is cyclic of order and generated by the Frobenius automorphism . fq_frobenius applies its powers, and fq_norm and fq_trace compute the product and the sum of the conjugates , which are elements of the prime field, returned as integers in . 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.
Example#
The program works in , defined by the Conway polynomial , and compares the norm and the trace of with the product and the sum of its conjugates. Here and, since the power sum is minus the coefficient of , . It also checks that is the identity and that , which fq_frobenius accepts as the exponent , is the -th root.
#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;
}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 by binary exponentiation, about squarings; for repeated applications of the same power to many elements, the matrix of (an -linear map, see fq_embed_composition_matrix applied to ) can be cheaper. The trace costs operations in for a defining polynomial with nonzero terms, and the norm one resultant of two polynomials of degree at most .
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).
@misc{flint-doc-fq-frobenius,
author = {{The FLINT team}},
title = {{Frobenius map, norm and trace (fq.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fq/frobenius.html},
note = {Generated 2026-11-02}
}