FLINT3.7.0-dev

fq_embed_matrices

Synopsis#include <flint/fq_embed.h>
void fq_embed_matrices(fmpz_mod_mat_t embed, fmpz_mod_mat_t project, const fq_t gen_sub, const fq_ctx_t sub_ctx, const fq_t gen_sup, const fq_ctx_t sup_ctx, const fmpz_mod_poly_t gen_minpoly)source

Given the output of fq_embed_gens for fields k = sub_ctx and K = sup_ctx of degrees m \mid n, computes the n \times m matrix embed of the embedding \varphi: k \to K that maps gen_sub to gen_sup, and an m \times n matrix project of a k-linear projection \pi: K \to k with \pi \circ \varphi = \mathrm{id}, so that \mathit{project} \cdot \mathit{embed} is the m \times m identity. The matrices act on column vectors of coordinates in the monomial bases.

The projection is \pi(y) = \varphi^{-1}(\operatorname{Tr}_{K/\varphi(k)}(\theta y)) for an element \theta with \operatorname{Tr}_{K/\varphi(k)}(\theta) = 1: \theta = 1/(n/m) if p \nmid n/m, and otherwise \theta = x^i / \operatorname{Tr}(x^i) for a suitable power of the generator. The trace is computed with fq_embed_trace_matrix.

Cite this page

The FLINT team, “fq_embed_matrices (fq_embed.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fq_embed/fq_embed_matrices.html (generated 2026-10-20).