# 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
|
b
|
|
| 4749 | 4749 | being faster than the other two) |
| 4750 | 4750 | precision (optional) -- the precision of the result, in bits. |
| 4751 | 4751 | |
| 4752 | | Note that the precision argument is ignored when flag=1 or 2. |
| 4753 | | If you want higher precision while using one of these flags, |
| 4754 | | you should first call ellinit with the desired precision. |
| | 4752 | Note that in order to achieve the desired precision, the |
| | 4753 | elliptic curve must have been created using ellinit with the |
| | 4754 | desired precision. |
| 4755 | 4755 | |
| 4756 | 4756 | EXAMPLES: |
| 4757 | 4757 | sage: e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0] |
diff -r 038b84f34083 -r a5f519f29615 sage/schemes/elliptic_curves/ell_point.py
|
a
|
b
|
|
| 1415 | 1415 | sage: _.parent() |
| 1416 | 1416 | Real Field with 100 bits of precision |
| 1417 | 1417 | |
| | 1418 | An example to show that the bug at \#5252 is fixed: |
| | 1419 | sage: E = EllipticCurve([1, -1, 1, -2063758701246626370773726978, 32838647793306133075103747085833809114881]) |
| | 1420 | sage: P = E([-30987785091199, 258909576181697016447]) |
| | 1421 | sage: P.height() |
| | 1422 | 25.8603170675462 |
| | 1423 | sage: P.height(precision=100) |
| | 1424 | 25.860317067546190743868840741 |
| | 1425 | sage: P.height(precision=250) |
| | 1426 | 25.860317067546190743868840740735110323098872903844416215577171041783572513 |
| | 1427 | sage: P.height(precision=500) |
| | 1428 | 25.8603170675461907438688407407351103230988729038444162155771710417835725129551130570889813281792157278507639909972112856019190236125362914195452321720 |
| | 1429 | |
| | 1430 | |
| 1418 | 1431 | Unfortunately, canonical height isn't implemented in general. |
| 1419 | 1432 | sage: E = EllipticCurve('5077a1').change_ring(QuadraticField(-3,'a')) |
| 1420 | 1433 | sage: P = E([-2,3,1]) |
| … |
… |
|
| 1430 | 1443 | precision = rings.RealField().precision() |
| 1431 | 1444 | |
| 1432 | 1445 | try: |
| 1433 | | h = self.curve().pari_curve(prec=precision).ellheight([self[0], self[1]]) |
| | 1446 | h = self.curve().pari_curve(prec=precision).ellheight([self[0], self[1]],precision=precision) |
| 1434 | 1447 | return rings.RealField(precision)(h) |
| 1435 | 1448 | except: |
| 1436 | 1449 | raise NotImplementedError, "canonical height not yet implemented over general number fields." |
diff -r 038b84f34083 -r a5f519f29615 sage/schemes/elliptic_curves/ell_rational_field.py
|
a
|
b
|
|
| 1715 | 1715 | sage: E.regulator_of_points(points, precision=100) |
| 1716 | 1716 | 0.15246017794314375162432475705 |
| 1717 | 1717 | sage: E.regulator_of_points(points, precision=200) |
| 1718 | | 0.15246017794314375162432475704945679973023692439535675825460 |
| | 1718 | 0.15246017794314375162432475704945582324372707748663081784028 |
| 1719 | 1719 | sage: E.regulator_of_points(points, precision=300) |
| 1720 | | 0.152460177943143751624324757049456799730236924395356758254603766562928311926162510557428969 |
| | 1720 | 0.152460177943143751624324757049455823243727077486630817840280980046053225683562463604114816 |
| 1721 | 1721 | """ |
| 1722 | 1722 | if points is None: |
| 1723 | 1723 | points = [] |