Imaginary Unit - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


NumberTheory

  

ImaginaryUnit

  

modular square root of -1

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

ImaginaryUnit(n)

Parameters

n

-

positive integer

Description

• 

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.

Examples

withNumberTheory:

There exists an imaginary unit modulo 5.

ImaginaryUnit5

3

(1)

32mod5

4

(2)

Since there does not exist an imaginary unit modulo 6, an error message is displayed.

ImaginaryUnit6

Error, (in NumberTheory:-ImaginaryUnit) -1 does not have a square root modulo 6

seqi2mod6,i=0..5

0,1,4,3,4,1

(3)

Compatibility

• 

The NumberTheory[ImaginaryUnit] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

NumberTheory

NumberTheory[ModularRoot]

NumberTheory[ModularSquareRoot]