fq_default_ctx_init_modulus, fq_default_ctx_init_modulus_type, fq_default_ctx_init_modulus_nmod, fq_default_ctx_init_modulus_nmod_type
#include <flint/fq_default.h>void fq_default_ctx_init_modulus(fq_default_ctx_t ctx, const fmpz_mod_poly_t modulus, fmpz_mod_ctx_t mod_ctx, const char * var)sourcevoid fq_default_ctx_init_modulus_type(fq_default_ctx_t ctx, const fmpz_mod_poly_t modulus, fmpz_mod_ctx_t mod_ctx, const char * var, int type)sourcevoid fq_default_ctx_init_modulus_nmod(fq_default_ctx_t ctx, const nmod_poly_t modulus, const char * var)sourcevoid fq_default_ctx_init_modulus_nmod_type(fq_default_ctx_t ctx, const nmod_poly_t modulus, const char * var, int type)sourceInitialise ctx as a context for \mathbb{F}_p[x]/(f), where f is modulus, an irreducible polynomial of degree d \ge 1 over \mathbb{F}_p, and p is the modulus of mod_ctx, respectively of the nmod_poly. The generator, printed as var, is the class of x. The representation is chosen as by fq_default_ctx_init, or given by type (0 for the automatic choice).
The polynomial need not be monic. Its irreducibility and the primality of p are not checked.
The Zech representation needs a primitive polynomial, one whose roots generate the multiplicative group. If the Zech representation is chosen or requested and f is not primitive, these functions fall back to FQ_DEFAULT_FQ_NMOD; the fmpz_mod_poly versions do the same when p does not fit in a word, which fq_nmod cannot handle, so a Zech representation must not be requested for such p. For d = 1 with the type FQ_DEFAULT_NMOD or FQ_DEFAULT_FMPZ_MOD, the field is \mathbb{F}_p and the generator is the root a = -c_0/c_1 of f = c_1 x + c_0.
Guides#
The FLINT team, “fq_default_ctx_init_modulus, fq_default_ctx_init_modulus_type, fq_default_ctx_init_modulus_nmod, fq_default_ctx_init_modulus_nmod_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_modulus.html (generated 2026-10-20).
@misc{flint-doc-fq-default-fq-default-ctx-init-modulus,
author = {{The FLINT team}},
title = {{fq\_default\_ctx\_init\_modulus, fq\_default\_ctx\_init\_modulus\_type, fq\_default\_ctx\_init\_modulus\_nmod, fq\_default\_ctx\_init\_modulus\_nmod\_type (fq\_default.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fq_default/fq_default_ctx_init_modulus.html},
note = {Generated 2026-10-20}
}