_fmpz_mod_poly_sqrt, fmpz_mod_poly_sqrt
#include <flint/fmpz_mod_poly.h>int _fmpz_mod_poly_sqrt(fmpz * s, const fmpz * p, slong len, const fmpz_mod_ctx_t ctx)sourceint fmpz_mod_poly_sqrt(fmpz_mod_poly_t b, const fmpz_mod_poly_t a, const fmpz_mod_ctx_t ctx)sourceIf the polynomial is a perfect square, set the output to a square root and return 1; otherwise return 0 (and set b to zero). The modulus must be prime. The underscore version writes \mathit{len}/2 + 1 coefficients.
After removing an even power of x, the constant coefficient must be a square c^2 in \mathbb{F}_p; the square root is c times the power series square root of a/a_0, computed to half the length, and the result is verified by squaring. For p = 2, a is a square if and only if it is a polynomial in x^2.
The FLINT team, “_fmpz_mod_poly_sqrt, fmpz_mod_poly_sqrt (fmpz_mod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mod_poly/_fmpz_mod_poly_sqrt.html (generated 2026-10-20).
@misc{flint-doc-fmpz-mod-poly-fmpz-mod-poly-sqrt,
author = {{The FLINT team}},
title = {{\_fmpz\_mod\_poly\_sqrt, fmpz\_mod\_poly\_sqrt (fmpz\_mod\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz_mod_poly/_fmpz_mod_poly_sqrt.html},
note = {Generated 2026-10-20}
}