FLINT3.7.0-dev

qadic_sqrt

Synopsis#include <flint/qadic.h>
int qadic_sqrt(qadic_t rop, const qadic_t op, const qadic_ctx_t ctx)source

Returns 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).

Cite this page

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