# Ticket #5252: trac_5252.patch

File trac_5252.patch, 3.6 KB (added by cremona, 4 years ago)
• ## sage/libs/pari/gen.pyx

```# HG changeset patch
# User John Cremona <john.cremona@gmail.com>
# Date 1234718543 0
# Node ID a5f519f2961560b54ab251946fb55defb697bfb7
# Parent  038b84f34083060e79bdfa442493d1b56314b2a3
Fix for trac #5252

diff -r 038b84f34083 -r a5f519f29615 sage/libs/pari/gen.pyx```
 a being faster than the other two) precision (optional) -- the precision of the result, in bits. Note that the precision argument is ignored when flag=1 or 2. If you want higher precision while using one of these flags, you should first call ellinit with the desired precision. Note that in order to achieve the desired precision, the elliptic curve must have been created using ellinit with the desired precision. EXAMPLES: sage: e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0]
• ## sage/schemes/elliptic_curves/ell_point.py

`diff -r 038b84f34083 -r a5f519f29615 sage/schemes/elliptic_curves/ell_point.py`
 a sage: _.parent() Real Field with 100 bits of precision An example to show that the bug at \#5252 is fixed: sage: E = EllipticCurve([1, -1, 1, -2063758701246626370773726978, 32838647793306133075103747085833809114881]) sage: P = E([-30987785091199, 258909576181697016447]) sage: P.height() 25.8603170675462 sage: P.height(precision=100) 25.860317067546190743868840741 sage: P.height(precision=250) 25.860317067546190743868840740735110323098872903844416215577171041783572513 sage: P.height(precision=500) 25.8603170675461907438688407407351103230988729038444162155771710417835725129551130570889813281792157278507639909972112856019190236125362914195452321720 Unfortunately, canonical height isn't implemented in general. sage: E = EllipticCurve('5077a1').change_ring(QuadraticField(-3,'a')) sage: P = E([-2,3,1]) precision = rings.RealField().precision() try: h = self.curve().pari_curve(prec=precision).ellheight([self[0], self[1]]) h = self.curve().pari_curve(prec=precision).ellheight([self[0], self[1]],precision=precision) return rings.RealField(precision)(h) except: raise NotImplementedError, "canonical height not yet implemented over general number fields."
• ## sage/schemes/elliptic_curves/ell_rational_field.py

`diff -r 038b84f34083 -r a5f519f29615 sage/schemes/elliptic_curves/ell_rational_field.py`
 a sage: E.regulator_of_points(points, precision=100) 0.15246017794314375162432475705 sage: E.regulator_of_points(points, precision=200) 0.15246017794314375162432475704945679973023692439535675825460 0.15246017794314375162432475704945582324372707748663081784028 sage: E.regulator_of_points(points, precision=300) 0.152460177943143751624324757049456799730236924395356758254603766562928311926162510557428969 0.152460177943143751624324757049455823243727077486630817840280980046053225683562463604114816 """ if points is None: points = []