FLINT3.7.0-dev

gr_ctx_init_gr_poly_quotient

Synopsis#include <flint/gr.h>
void gr_ctx_init_gr_poly_quotient(gr_ctx_t ctx, gr_ctx_t base, const gr_poly_t modulus)source

Initialises ctx to the quotient ring F[x]/(m)F[x] / (m) of the polynomial ring over the commutative ring FF = base by the monic polynomial mm = modulus. Elements have type gr_poly_struct and are kept reduced modulo mm. Throws an exception if mm is zero or not monic. The context stores precomputed data for reduction modulo mm, 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 FF is a field and mm is irreducible, the quotient ring is a field, but this is not assumed: gr_ctx_is_field returns T_UNKNOWN unless the user declares mm irreducible with gr_ctx_set_is_field (it then returns T_TRUE if FF is known to be a field).

The ring can also pretend to be a field (gr_ctx_set_is_pretend_field) when mm is only conjecturally irreducible, provided that FF 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 mm 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).

Cite this page

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-11-02).