FLINT3.7.0-dev

nmod_mpoly_sqrt, nmod_mpoly_sqrt_heap, nmod_mpoly_is_square

Synopsis#include <flint/nmod_mpoly.h>
int nmod_mpoly_sqrt(nmod_mpoly_t Q, const nmod_mpoly_t A, const nmod_mpoly_ctx_t ctx)source
int nmod_mpoly_sqrt_heap(nmod_mpoly_t Q, const nmod_mpoly_t A, const nmod_mpoly_ctx_t ctx)source
int nmod_mpoly_is_square(const nmod_mpoly_t A, const nmod_mpoly_ctx_t ctx)source

If A = Q^2 for some Q, set Q to such a square root and return 1; otherwise return 0 (and set Q to zero). nmod_mpoly_is_square only returns whether A is a square. The modulus must be prime. For odd p the root is computed term by term with a heap, as for division; for p = 2, A is a square exactly when all its exponents are even, and the root is obtained by halving them. Even moduli other than 2 throw FLINT_IMPINV.

Guides#

Cite this page

The FLINT team, “nmod_mpoly_sqrt, nmod_mpoly_sqrt_heap, nmod_mpoly_is_square (nmod_mpoly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_mpoly/nmod_mpoly_sqrt.html (generated 2026-10-20).