FLINT3.7.0-dev

fq_default_ctx_init, fq_default_ctx_init_type

Synopsis#include <flint/fq_default.h>
void fq_default_ctx_init(fq_default_ctx_t ctx, const fmpz_t p, slong d, const char * var)source
void fq_default_ctx_init_type(fq_default_ctx_t ctx, const fmpz_t p, slong d, const char * var, int type)source

Initialise ctx as a context for Fpd\mathbb{F}_{p^d}, for a prime pp and d≥1d \ge 1, with the name var for the generator (used for printing). The defining polynomial is a Conway polynomial if (p,d)(p, d) is in FLINT's table; otherwise it is chosen as in the underlying module. fq_default_ctx_init chooses the representation by the rules above; fq_default_ctx_init_type uses the given type, one of the five type codes, or 0 for the automatic choice.

Neither the primality of pp nor the compatibility of type with pp and dd is checked. FQ_DEFAULT_NMOD and FQ_DEFAULT_FMPZ_MOD create the prime field Fp\mathbb{F}_p whatever dd is; FQ_DEFAULT_FQ_ZECH, FQ_DEFAULT_FQ_NMOD and FQ_DEFAULT_NMOD need p<2FLINT_BITSp < 2^{\mathtt{FLINT\_BITS}}, and FQ_DEFAULT_FQ_ZECH also needs q=pd<2FLINT_BITSq = p^d < 2^{\mathtt{FLINT\_BITS}} and builds tables of 2q+p2q + p words.

If no Conway polynomial is available (see Defining polynomials), fq_zech uses a random primitive polynomial, fq_nmod a polynomial with the fewest possible nonzero terms (fq_nmod_ctx_init_ui) and fq a random sparse irreducible polynomial (fq_ctx_init). A prime field created by these functions has the defining polynomial xx, so its generator fq_default_gen is 0.

Guides#

Cite this page

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