gr_ctx_init_gr_poly_quotient
#include <flint/gr.h>Initialises ctx to the quotient ring F[x] / (m) of the polynomial ring over the commutative ring F = base by the monic polynomial m = modulus. Elements have type gr_poly_struct and are kept reduced modulo m. Throws an exception if m is zero or not monic. The context stores precomputed data for reduction modulo m, a gr_poly_preinv_t whose representation is chosen by the method GR_METHOD_POLY_PREINV_SET of the base ring, which is used for multiplication and for powers.
If F is a field and m is irreducible, the quotient ring is a field, but this is not assumed: gr_ctx_is_field returns T_UNKNOWN unless the user declares m irreducible with gr_ctx_set_is_field (it then returns T_TRUE if F is known to be a field).
The ring can also pretend to be a field (gr_ctx_set_is_pretend_field) when m is only conjecturally irreducible, provided that F is a field or pretends to be one. All operations remain correct as ring operations, and an inversion of a zero divisor fails with GR_UNABLE while recording a nontrivial monic factor of m in a table in the context. The first recorded factor can be retrieved as an element with gr_ctx_recover_zero_divisor, and the whole table with the functions below, from which a refined modulus can be obtained. A failure in a base ring that pretends to be a field propagates as GR_UNABLE as well, and the zero divisor is then recorded in the base ring. A modulus known to be reducible can also be used without the pretence, in which case the context represents a genuine (non-integral) quotient ring in which zero divisors are simply not invertible (GR_DOMAIN).
The FLINT team, “gr_ctx_init_gr_poly_quotient (gr.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_domains/gr_ctx_init_gr_poly_quotient.html (generated 2026-10-20).
@misc{flint-doc-gr-domains-gr-ctx-init-gr-poly-quotient,
author = {{The FLINT team}},
title = {{gr\_ctx\_init\_gr\_poly\_quotient (gr.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_domains/gr_ctx_init_gr_poly_quotient.html},
note = {Generated 2026-10-20}
}