# Revision history [back]

### Understanding sqrt of sage

I'm reading the following piece of code:

[J(C(x, min(f(x).sqrt(0,1)))) for x in (11,22,33)]


where $J$ is the jacobian of my hyper elliptic curve $C$.

I don't undestad what the sqrt function with those two arguments does. Reading from the docs it seems that I'm enabling the all flag:

all - Whether to return a list of all square roots or just a square root (default: False)

Can you explain what is mathematically doing that sqrt?

### Understanding sqrt of sage

I'm reading the following piece of code:

p = 10000000000000001119

R.<x> = GF(p)[]; y=x
f = y + prod(map(eval, 'yyyyyyy'))
C = HyperellipticCurve(f, 0)
J = C.jacobian()

[J(C(x, min(f(x).sqrt(0,1)))) for x in (11,22,33)]


where $J$ is the jacobian of my hyper elliptic curve $C$.

I don't undestad what the sqrt function with those two arguments does. Reading from the docs it seems that I'm enabling the all flag:

all - Whether to return a list of all square roots or just a square root (default: False)

Can you explain what is mathematically doing that sqrt?

### Understanding sqrt of sage

I'm reading the following piece of code:

p = 10000000000000001119

R.<x> = GF(p)[]; y=x
f = y + prod(map(eval, 'yyyyyyy'))
C = HyperellipticCurve(f, 0)
J = C.jacobian()

[J(C(x, test=[J(C(x, min(f(x).sqrt(0,1)))) for x in (11,22,33)]


where $J$ is the jacobian of my hyper elliptic curve $C$.

I don't undestad what the sqrt function with those two arguments does. Reading from the docs it seems that I'm enabling the all flag:

all - Whether to return a list of all square roots or just a square root (default: False)

Can you explain what is mathematically doing that sqrt?