Skip to content

Commit 63882f4

Browse files
committed
More tests
1 parent a169818 commit 63882f4

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

src/sage/schemes/elliptic_curves/period_lattice.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,56 @@ def elliptic_logarithm(self, P, prec=None, reduce=True):
17271727
1.17058357737548897849026170185581196033579563441850967539191867385734983296504066660506637438866628981886518901958717288150400849746892393771983141354 - 1.13513899565966043682474529757126359416758251309237866586896869548539516543734207347695898664875799307727928332953834601460994992792519799260968053875*I
17281728
sage: L.elliptic_logarithm(P, prec=1000)
17291729
1.17058357737548897849026170185581196033579563441850967539191867385734983296504066660506637438866628981886518901958717288150400849746892393771983141354014895386251320571643977497740116710952913769943240797618468987304985625823413440999754037939123032233879499904283600304184828809773650066658885672885 - 1.13513899565966043682474529757126359416758251309237866586896869548539516543734207347695898664875799307727928332953834601460994992792519799260968053875387282656993476491590607092182964878750169490985439873220720963653658829712494879003124071110818175013453207439440032582917366703476398880865439217473*I
1730+
1731+
Elliptic curve over ``QQbar``::
1732+
1733+
sage: E = EllipticCurve(QQbar, [sqrt(2), I])
1734+
sage: L = E.period_lattice()
1735+
sage: P = E.lift_x(3)
1736+
sage: L.elliptic_logarithm(P)
1737+
-1.97657221097437 - 1.05021415535949*I
1738+
sage: L.elliptic_exponential(_)
1739+
(3.00000000000000 + 9.20856947066460e-16*I : -5.59022723358798 - 0.0894418024719718*I : 1.00000000000000)
1740+
sage: L.elliptic_logarithm(P, prec=100)
1741+
-3.4730631218714889933426781799 + 0.44627675553762761312098773197*I
1742+
sage: L.elliptic_exponential(_)
1743+
(3.0000000000000000000000000000 - 1.4773628579202938936348512161e-30*I : -5.5902272335879800026836302686 - 0.089441802471969391005702381090*I : 1.0000000000000000000000000000)
1744+
1745+
Real approximate field, negative discriminant. Note that the output precision uses the precision of the base field::
1746+
1747+
sage: E = EllipticCurve(RealField(100), [1, 6])
1748+
sage: L = E.period_lattice()
1749+
sage: L.real_flag
1750+
-1
1751+
sage: P = E(3, 6)
1752+
sage: L.elliptic_logarithm(P)
1753+
2.4593388737550379526023682666
1754+
sage: L.elliptic_exponential(_)
1755+
(3.0000000000000000000000000000 : 5.9999999999999999999999999999 : 1.0000000000000000000000000000)
1756+
1757+
Real approximate field, positive discriminant::
1758+
1759+
sage: E = EllipticCurve(RealField(100), [-4, 3])
1760+
sage: L = E.period_lattice()
1761+
sage: L.real_flag
1762+
1
1763+
sage: P = E.lift_x(4)
1764+
sage: L.elliptic_logarithm(P)
1765+
0.51188849089267627141925354967
1766+
sage: L.elliptic_exponential(_)
1767+
(4.0000000000000000000000000000 : -7.1414284285428499979993998114 : 1.0000000000000000000000000000)
1768+
1769+
Complex approximate field::
1770+
1771+
sage: E = EllipticCurve(ComplexField(100), [I, 3*I+4])
1772+
sage: L = E.period_lattice()
1773+
sage: L.real_flag
1774+
0
1775+
sage: P = E.lift_x(4)
1776+
sage: L.elliptic_logarithm(P)
1777+
-1.1447032790074574712147458157 - 0.72429843602171875396186134806*I
1778+
sage: L.elliptic_exponential(_)
1779+
(4.0000000000000000000000000000 + 1.2025589033682610849950210280e-30*I : -8.2570982991257407680322611854 - 0.42387771989714340809597881586*I : 1.0000000000000000000000000000)
17301780
"""
17311781
if P.curve() is not self.E:
17321782
raise ValueError("Point is on the wrong curve")

0 commit comments

Comments
 (0)