From 02539f1ad0360216e621e041e23f3a65132c82ba Mon Sep 17 00:00:00 2001 From: OpenAI Codex Date: Sun, 22 Nov 2026 22:22:24 -0500 Subject: [PATCH] Document modular polynomial roots over prime fields --- src/flint/types/fmpz_mod_poly.pyx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/flint/types/fmpz_mod_poly.pyx b/src/flint/types/fmpz_mod_poly.pyx index 38cbb8c1..70b80e48 100644 --- a/src/flint/types/fmpz_mod_poly.pyx +++ b/src/flint/types/fmpz_mod_poly.pyx @@ -1903,8 +1903,8 @@ cdef class fmpz_mod_poly(flint_poly): def roots(self, multiplicities=True): r""" - Return the roots of the polynomial in :math:`(\mathbb{Z}/N\mathbb{Z})^*` - Requires that the modulus `N` is prime. + Return the roots of a nonzero polynomial in the finite field + :math:`\mathbb{Z}/N\mathbb{Z}`, where the modulus `N` must be prime. >>> R = fmpz_mod_poly_ctx(163) >>> x = R.gen() @@ -1913,6 +1913,8 @@ cdef class fmpz_mod_poly(flint_poly): [(fmpz_mod(1, 163), 1), (fmpz_mod(2, 163), 3), (fmpz_mod(3, 163), 5)] >>> f.roots(multiplicities=False) [fmpz_mod(1, 163), fmpz_mod(2, 163), fmpz_mod(3, 163)] + >>> (x**2).roots() + [(fmpz_mod(0, 163), 2)] """ cdef fmpz_mod_poly_factor_t fac cdef int i, with_multiplicity