NumberTheory
ImaginaryUnit
modular square root of -1
Calling Sequence
Parameters
Description
Examples
Compatibility
ImaginaryUnit(n)
n
-
positive integer
The ImaginaryUnit function returns a square root of −1 modulo n, if possible. If not possible, an error message is displayed.
If there is more than one imaginary unit, only one of them is returned.
with⁡NumberTheory:
There exists an imaginary unit modulo 5.
ImaginaryUnit⁡5
3
32mod5
4
Since there does not exist an imaginary unit modulo 6, an error message is displayed.
ImaginaryUnit⁡6
Error, (in NumberTheory:-ImaginaryUnit) -1 does not have a square root modulo 6
seq⁡i2mod6,i=0..5
0,1,4,3,4,1
The NumberTheory[ImaginaryUnit] command was introduced in Maple 2016.
For more information on Maple 2016 changes, see Updates in Maple 2016.
See Also
NumberTheory[ModularRoot]
NumberTheory[ModularSquareRoot]
Download Help Document