fq_default_ctx_init, fq_default_ctx_init_type
#include <flint/fq_default.h>void fq_default_ctx_init(fq_default_ctx_t ctx, const fmpz_t p, slong d, const char * var)sourcevoid fq_default_ctx_init_type(fq_default_ctx_t ctx, const fmpz_t p, slong d, const char * var, int type)sourceInitialise ctx as a context for , for a prime and , with the name var for the generator (used for printing). The defining polynomial is a Conway polynomial if 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 nor the compatibility of type with and is checked. FQ_DEFAULT_NMOD and FQ_DEFAULT_FMPZ_MOD create the prime field whatever is; FQ_DEFAULT_FQ_ZECH, FQ_DEFAULT_FQ_NMOD and FQ_DEFAULT_NMOD need , and FQ_DEFAULT_FQ_ZECH also needs and builds tables of 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 , so its generator fq_default_gen is 0.
Guides#
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).
@misc{flint-doc-fq-default-fq-default-ctx-init,
author = {{The FLINT team}},
title = {{fq\_default\_ctx\_init, fq\_default\_ctx\_init\_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.html},
note = {Generated 2026-11-02}
}