qadic_sqrt
#include <flint/qadic.h>int qadic_sqrt(qadic_t rop, const qadic_t op, const qadic_ctx_t ctx)sourceReturns whether op is a square in \mathbf{Q}_q, and if so sets rop to a square root, reduced. If the valuation of the root is at least the precision of rop, rop is set to zero and squareness is decided from the residue of the unit (modulo p, or modulo 8 for p = 2); if op has no digits of precision left, 1 is returned.
For odd p a square root in \mathbf{F}_q is found by an exponentiation or by Tonelli–Shanks and lifted by Newton iteration; for p = 2 an Artin–Schreier equation over \mathbf{F}_q is solved by linear algebra over \mathbf{F}_2 first (Square roots).
The FLINT team, “qadic_sqrt (qadic.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/qadic/qadic_sqrt.html (generated 2026-10-20).
@misc{flint-doc-qadic-qadic-sqrt,
author = {{The FLINT team}},
title = {{qadic\_sqrt (qadic.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/qadic/qadic_sqrt.html},
note = {Generated 2026-10-20}
}