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 Qq\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 pp, or modulo 8 for p=2p = 2); if op has no digits of precision left, 1 is returned.

For odd pp a square root in Fq\mathbf{F}_q is found by an exponentiation or by Tonelli–Shanks and lifted by Newton iteration; for p=2p = 2 an Artin–Schreier equation over Fq\mathbf{F}_q is solved by linear algebra over F2\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-11-02).