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 b  
    47494749                      being faster than the other two) 
    47504750            precision (optional) -- the precision of the result, in bits. 
    47514751 
    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. 
    47554755 
    47564756        EXAMPLES: 
    47574757            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 b  
    14151415            sage: _.parent()  
    14161416            Real Field with 100 bits of precision 
    14171417 
     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 
    14181431        Unfortunately, canonical height isn't implemented in general. 
    14191432            sage: E = EllipticCurve('5077a1').change_ring(QuadraticField(-3,'a')) 
    14201433            sage: P = E([-2,3,1]) 
     
    14301443            precision = rings.RealField().precision()  
    14311444 
    14321445        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) 
    14341447            return rings.RealField(precision)(h)  
    14351448        except: 
    14361449            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 b  
    17151715            sage: E.regulator_of_points(points, precision=100) 
    17161716            0.15246017794314375162432475705 
    17171717            sage: E.regulator_of_points(points, precision=200)  
    1718             0.15246017794314375162432475704945679973023692439535675825460 
     1718            0.15246017794314375162432475704945582324372707748663081784028 
    17191719            sage: E.regulator_of_points(points, precision=300) 
    1720             0.152460177943143751624324757049456799730236924395356758254603766562928311926162510557428969 
     1720            0.152460177943143751624324757049455823243727077486630817840280980046053225683562463604114816 
    17211721        """ 
    17221722        if points is None: 
    17231723            points = []