This returns a solution of the equation $x^2\equiv n\pmod p$, provided that n is a quadratic residue modulo p. If it is not, then an error is raised.
|
|
|
Every quadratic residue modulo an odd prime has two square roots. The second square root may be obtained by subtracting the first from p.
|
This method may also be used for finding square roots in finite prime fields.
|
|
Shanks, Daniel. "Five number-theoretic algorithms." Proceedings of the Second Manitoba Conference on Numerical Mathematics (Winnipeg), 1973.
The source of this document is in Macaulay2Doc/operators.m2:149:0.