FLINT3.7.0-dev
Module · 11 functions

fq_zech_embed.h

#include <flint/fq_zech_embed.h>

This module computes embeddings Fpm→Fpn\mathbb{F}_{p^m} \to \mathbb{F}_{p^n}, m∣nm \mid n, between fields in the representation of fq_zech.h (elements stored as discrete logarithms with respect to a primitive element, q<2FLINT_BITSq < 2^{\mathtt{FLINT\_BITS}}), as matrices over Fp\mathbb{F}_p (nmod_mat_t), and the change-of-basis matrices they rest on. It is generated from the same template as fq_embed.h and has the same functions, with fq_zech in place of fq and nmod_poly and nmod_mat in place of fmpz_mod_poly and fmpz_mod_mat; each function links to the fq_embed version, which has the details.

The matrix functions of this module convert the elements to the fq_nmod representation of the underlying context and call the fq_nmod_embed functions.

AlgorithmEmbeddings of finite fieldsTo embed Fpm\mathbb{F}_{p^m} into Fpn\mathbb{F}_{p^n} given by unrelated defining polynomials, FLINT finds a root of the smaller field's polynomial in the larger field and expresses the embedding, and a left inverse built from the trace and the dual basis, as matrices over Fp\mathbb{F}_p.

Embeddings#

void fq_zech_embed_gens(fq_zech_t gen_sub, fq_zech_t gen_sup, nmod_poly_t minpoly, const fq_zech_ctx_t sub_ctx, const fq_zech_ctx_t sup_ctx)

Given contexts for fields kk = sub_ctx of degree mm and KK = sup_ctx of degree nn with m∣nm \mid n, computes a generator gen_sub of kk over Fp\mathbb{F}_p, its minimal polynomial minpoly, and a root gen_sup of minpoly in KK. These data define the embedding k→Kk \to K that maps gen_sub to gen_sup.

More
void _fq_zech_embed_gens_naive(fq_zech_t gen_sub, fq_zech_t gen_sup, nmod_poly_t minpoly, const fq_zech_ctx_t sub_ctx, const fq_zech_ctx_t sup_ctx)

Computes the data of fq_zech_embed_gens as follows: gen_sub is the generator xx of sub_ctx, minpoly is the defining polynomial of sub_ctx, and gen_sup is a root of it in sup_ctx, found with fq_zech_poly_factor_split_single, that is, by root finding for a polynomial of degree mm over KK. Requires m>1m > 1 to divide nn.

More
void fq_zech_embed_matrices(nmod_mat_t embed, nmod_mat_t project, const fq_zech_t gen_sub, const fq_zech_ctx_t sub_ctx, const fq_zech_t gen_sup, const fq_zech_ctx_t sup_ctx, const nmod_poly_t gen_minpoly)

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

More
void fq_zech_embed_trace_matrix(nmod_mat_t res, const nmod_mat_t basis, const fq_zech_ctx_t sub_ctx, const fq_zech_ctx_t sup_ctx)

Given contexts for kk = sub_ctx and KK = sup_ctx of degrees m∣nm \mid n and the n×mn \times m matrix basis of an embedding φ:k→K\varphi: k \to K, sets res to the m×nm \times n matrix of the map y↦φ−1(Tr⁡K/φ(k)(y))y \mapsto \varphi^{-1}(\operatorname{Tr}_{K/\varphi(k)}(y)). It is computed as Dk⋅basisT⋅MKD_k \cdot \mathit{basis}^T \cdot M_K, with DkD_k = fq_zech_embed_dual_to_mono_matrix for kk and MKM_K = fq_zech_embed_mono_to_dual_matrix for KK. For m=nm = n the result is the inverse of basis.

More

Matrices of elements#

Set matrix to the composition matrix of the element aa = gen of a field of degree dd: the d×dd \times d matrix whose columns are the coordinates of a0,a1,…,ad−1a^0, a^1, \ldots, a^{d-1}, which maps the coordinates of a polynomial gg of degree less than dd to those of g(a)g(a). The _sub version computes only the first trunc ≤d\le d columns, into a d×truncd \times \mathit{trunc} matrix.

More
void fq_zech_embed_mul_matrix(nmod_mat_t matrix, const fq_zech_t gen, const fq_zech_ctx_t ctx)

Sets the d×dd \times d matrix matrix to the matrix of multiplication by aa = gen, whose columns are the coordinates of a,ax,…,axd−1a, ax, \ldots, ax^{d-1}. The defining polynomial need not be monic.

More

Sets the d×dd \times d matrix res to the change of basis from the monomial basis 1,x,…,xd−11, x, \ldots, x^{d-1} to its dual basis with respect to the trace form (u,v)↦Tr⁡(uv)(u, v) \mapsto \operatorname{Tr}(uv): the Hankel matrix with entries Tr⁡(xi+j)\operatorname{Tr}(x^{i+j}), computed from the power series expansion of rev⁡(f′)/rev⁡(f)\operatorname{rev}(f')/\operatorname{rev}(f) (Newton's identities). Mapping a coordinate vector of yy by this matrix gives the traces Tr⁡(yxi)\operatorname{Tr}(y x^i).

More

Sets the d×dd \times d matrix res to the inverse of fq_zech_embed_mono_to_dual_matrix. By Euler's formula the dual basis of 1,x,…,xd−11, x, \ldots, x^{d-1} is b0/f′(x),…,bd−1/f′(x)b_0 / f'(x), \ldots, b_{d-1} / f'(x), where f(X)/(X−x)=∑bjXjf(X)/(X - x) = \sum b_j X^j, so the matrix is the product of the multiplication matrix of 1/f′(x)1/f'(x) and the Hankel matrix of the coefficients of ff.

More

Sets res to the inverse of the reversal of the defining polynomial, as a power series modulo xtruncx^{\mathit{trunc}}.

More
void fq_zech_modulus_derivative_inv(fq_zech_t m_prime, fq_zech_t m_prime_inv, const fq_zech_ctx_t ctx)

Sets m_prime to f′(x)f'(x), the derivative of the defining polynomial evaluated at the generator, and m_prime_inv to its inverse. f′(x)≠0f'(x) \ne 0 because ff is irreducible, hence separable.

More

Example#

Cite this page

The FLINT team, “fq_zech_embed.h (module overview),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fq_zech_embed/index.html (generated 2026-11-02).