# Ticket #3674: sage-trac3674b.patch

File sage-trac3674b.patch, 2.2 KB (added by cremona, 10 years ago)
• ## sage/schemes/elliptic_curves/ell_rational_field.py

```# HG changeset patch
# User John Cremona <john.cremona@gmail.com>
# Date 1216647631 -3600
# Node ID 88bca48f0c597a44b42e80d32a9fd0cbcd1f1278
# Parent  60d3d284fd133619eed07a5c5c078549812ef8a1
trac#3674: added antilogarithm() function as inverse to elliptic_logarithm()

diff -r 60d3d284fd13 -r 88bca48f0c59 sage/schemes/elliptic_curves/ell_rational_field.py```
 a class EllipticCurve_rational_field(Ellip else: h_gs = max(1, log_g2) return max(R(1),h_j, h_gs) def antilogarithm(self, z, prec=53): """The rational point (if any) associated to this complex number (inverse of elliptic logarithm) INPUT: z -- a complex number representing an element of CC/L where L is the period lattice of the elliptic curve OUTPUT: The rational point which is the image of z under the Weierstrass parametrization, if it exists and can be determined from z with default precision ALGORITHM: This uses the function ellztopoint from the pari library WARNING: At present (3.0.4) it is not possible to pass the precision parameter to ellztopoint! EXAMPLES: sage: E=EllipticCurve('5077a1') sage: Pi=E.gens() sage: Pi [(-2 : 3 : 1), (-7/4 : 25/8 : 1), (1 : -1 : 1)] sage: zi=[P.elliptic_logarithm(100) for P in Pi] sage: Qi = [E.antilogarithm(z) for z in zi] sage: Pi == Qi True """ E_pari = self.pari_curve(prec) CC = ComplexField(prec) try: coords = E_pari.ellztopoint(z) if len(coords) == 1: return self(0) return self([CC(xy).real().simplest_rational() for xy in coords]) except: raise ValueError, "No rational point computable from z" def integral_points(self, mw_base='auto', both_signs=False): """