Skip to content

Commit 9cd3bb6

Browse files
committed
Fix omega() method
1 parent 08bc2f9 commit 9cd3bb6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

cypari2/gen.pyx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3403,7 +3403,7 @@ cdef class Gen(Gen_base):
34033403
sig_on()
34043404
return new_gen(elltors(self.g))
34053405

3406-
def omega(self, unsigned long precision=0):
3406+
def omega(self):
34073407
"""
34083408
Return the basis for the period lattice of this elliptic curve.
34093409
@@ -3415,9 +3415,21 @@ cdef class Gen(Gen_base):
34153415
>>> e = pari([0, -1, 1, -10, -20]).ellinit()
34163416
>>> e.omega()
34173417
[1.26920930427955, 0.634604652139777 - 1.45881661693850*I]
3418+
3419+
The precision is determined by the ``ellinit`` call::
3420+
3421+
>>> e = pari([0, -1, 1, -10, -20]).ellinit(precision=256)
3422+
>>> e.omega().bitprecision()
3423+
256
3424+
3425+
This also works over quadratic imaginary number fields::
3426+
3427+
>>> e = pari.ellinit([0, -1, 1, -10, -20], "nfinit(y^2 - 2)")
3428+
>>> if pari.version() >= (2, 10, 1):
3429+
... w = e.omega()
34183430
"""
34193431
sig_on()
3420-
return new_gen(ellR_omega(self.g, prec_bits_to_words(precision)))
3432+
return new_gen(member_omega(self.g))
34213433

34223434
def disc(self):
34233435
"""

0 commit comments

Comments
 (0)