Skip to content

AdicSqrt ​

A square root of a AdicNumeral in Qp\mathbb{Q}_p, found by Hensel lifting — defined only for prime bases, and only when one exists.

AdicSqrt(x, prec?)the root, to prec digits (default 20)
Typed signatures
TypePackageApplies
(value, integer?) -> valuenumeralsalways

Domain: Numeral systems

Details
  • Needs an even valuation, and (for odd pp) a unit part that is a quadratic residue mod pp; for p=2p=2 the unit part must be 1 mod 81 \bmod 8

Examples

Basic #

2∈Z7\sqrt{2} \in \mathbb{Z}_7, to 6 digits (2 is a quadratic residue mod 7)

live ↗
InAdicSqrt(AdicNumeral(7,2),6)\mathrm{AdicSqrt}(\mathrm{AdicNumeral}(7, 2), 6)OutAdicNumeral(7,38 181,6)\mathrm{AdicNumeral}(7, 38\,181, 6)
Scope #

−7≡1(mod8)-7 \equiv 1 \pmod 8, so it has a square root in Z2\mathbb{Z}_2

live ↗
InAdicSqrt(AdicNumeral(2,−7),10)\mathrm{AdicSqrt}(\mathrm{AdicNumeral}(2, -7), 10)OutAdicNumeral(2,181,10)\mathrm{AdicNumeral}(2, 181, 10)

The digits of 2\sqrt{2}, as AdicExpansion writes them

live ↗
InAdicExpansion(AdicSqrt(AdicNumeral(7,2),6))\mathrm{AdicExpansion}(\mathrm{AdicSqrt}(\mathrm{AdicNumeral}(7, 2), 6))Out…216213 + O(7^6)\text{…216213 + O(7\textasciicircum{}6)}
About
Examples3

See also: AdicNumeral, HenselLift