Ticket #11130: 11130_reviewer32.patch

File 11130_reviewer32.patch, 33.6 KB (added by jdemeyer, 8 years ago)
  • sage/rings/number_field/number_field_ideal.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1306309961 -7200
    # Node ID 7699ace8be6dfb76e3d88164b4d581b90bb314f1
    # Parent  35cda75bc998e963b5a76e791a50a50326a8b113
    Fix additional 32-bit doctest failures
    
    diff --git a/sage/rings/number_field/number_field_ideal.py b/sage/rings/number_field/number_field_ideal.py
    a b  
    10831083            [1]
    10841084            sage: I._S_ideal_class_log([])
    10851085            [3]
     1086
     1087        TESTS::
     1088
    10861089            sage: K.<a> = QuadraticField(-974)
    10871090            sage: S = K.primes_above(2)
    1088             sage: [P._S_ideal_class_log(S) for P in K.primes_above(11)]
    1089             [[5, 2], [1, 1]]
     1091            sage: G = K.S_class_group(S)
     1092            sage: I0 = G.0.ideal(); I1 = G.1.ideal()
     1093            sage: for p in prime_range(100):
     1094            ...       for P in K.primes_above(p):
     1095            ...           v = P._S_ideal_class_log(S)
     1096            ...           assert(G(P) == G(I0^v[0] * I1^v[1]))
    10901097        """
    10911098        from sage.modules.free_module_element import vector
    10921099        from sage.rings.finite_rings.integer_mod_ring import Zmod
     
    11051112        """
    11061113        Return True iff self is the zero ideal
    11071114
     1115        Note that `(0)` is a ``NumberFieldIdeal``, not a
     1116        ``NumberFieldFractionalIdeal``.
     1117
    11081118        EXAMPLES::
    11091119
    11101120            sage: K.<a> = NumberField(x^2 + 2); K
     
    11151125            True
    11161126            sage: I
    11171127            Ideal (0) of Number Field in a with defining polynomial x^2 + 2
    1118 
    1119             (0 is a NumberFieldIdeal, not a NumberFieldFractionIdeal)
    11201128        """
    11211129        return self == self.number_field().ideal(0)
    11221130
  • sage/schemes/elliptic_curves/ell_number_field.py

    diff --git a/sage/schemes/elliptic_curves/ell_number_field.py b/sage/schemes/elliptic_curves/ell_number_field.py
    a b  
    22r"""
    33Elliptic curves over number fields
    44
    5 An elliptic curve `E` over a number field `K` can be given 
     5An elliptic curve `E` over a number field `K` can be given
    66by a Weierstrass equation whose coefficients lie in `K` or by
    77using ``base_extend`` on an elliptic curve defined over a subfield.
    88
    99One major difference to elliptic curves over `\QQ` is that there
    1010might not exist a global minimal equation over `K`, when `K` does
    1111not have class number one.
    12 Another difference is the lack of understanding of modularity for 
     12Another difference is the lack of understanding of modularity for
    1313general elliptic curves over general number fields.
    1414
    1515Currently Sage can obtain local information about `E/K_v` for finite places
     
    6767
    6868REFERENCE:
    6969   
    70 - [Sil] Silverman, Joseph H. The arithmetic of elliptic curves. Second edition. Graduate Texts in   
     70- [Sil] Silverman, Joseph H. The arithmetic of elliptic curves. Second edition. Graduate Texts in
    7171  Mathematics, 106. Springer, 2009.
    7272
    73 - [Sil2] Silverman, Joseph H. Advanced topics in the arithmetic of elliptic curves. Graduate Texts in 
    74   Mathematics, 151. Springer, 1994. 
     73- [Sil2] Silverman, Joseph H. Advanced topics in the arithmetic of elliptic curves. Graduate Texts in
     74  Mathematics, 151. Springer, 1994.
    7575"""
    7676
    7777#*****************************************************************************
     
    163163        self._point_class = ell_point.EllipticCurvePoint_number_field
    164164
    165165    def simon_two_descent(self, verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
    166         r""" 
     166        r"""
    167167        Computes lower and upper bounds on the rank of the Mordell-Weil group,
    168168        and a list of independent points. Used internally by the :meth:`~rank`,
    169169        :meth:`~rank_bounds` and :meth:`~gens` methods.
     
    297297       
    298298        - points - either a list of points, which must be on this
    299299          curve, or (default) None, in which case self.gens() will be
    300           used. 
     300          used.
    301301
    302302        - precision - number of bits of precision of result
    303303          (default: None, for default RealField precision)
     
    362362        for j in range(r):
    363363            mat[j,j] = points[j].height(precision=precision)
    364364        for j in range(r):
    365             for k in range(j+1,r):             
     365            for k in range(j+1,r):
    366366                mat[j,k]=((points[j]+points[k]).height(precision=precision) - mat[j,j] - mat[k,k])/2
    367367                mat[k,j]=mat[j,k]
    368368        return mat
     
    380380       
    381381        EXAMPLES::
    382382       
    383             sage: E = EllipticCurve('37a1')                 
     383            sage: E = EllipticCurve('37a1')
    384384            sage: P = E(0,0)
    385385            sage: Q = E(1,0)
    386386            sage: E.regulator_of_points([P,Q])
     
    392392       
    393393            sage: E = EllipticCurve('5077a1')
    394394            sage: points = [E.lift_x(x) for x in [-2,-7/4,1]]
    395             sage: E.regulator_of_points(points)             
     395            sage: E.regulator_of_points(points)
    396396            0.417143558758384
    397397            sage: E.regulator_of_points(points,precision=100)
    398398            0.41714355875838396981711954462
    399399       
    400400        ::
    401401       
    402             sage: E = EllipticCurve('389a')                   
    403             sage: E.regulator_of_points()             
     402            sage: E = EllipticCurve('389a')
     403            sage: E.regulator_of_points()
    404404            1.00000000000000
    405             sage: points = [P,Q] = [E(-1,1),E(0,-1)]         
    406             sage: E.regulator_of_points(points)               
     405            sage: points = [P,Q] = [E(-1,1),E(0,-1)]
     406            sage: E.regulator_of_points(points)
    407407            0.152460177943144
    408408            sage: E.regulator_of_points(points, precision=100)
    409409            0.15246017794314375162432475705
    410             sage: E.regulator_of_points(points, precision=200) 
     410            sage: E.regulator_of_points(points, precision=200)
    411411            0.15246017794314375162432475704945582324372707748663081784028
    412412            sage: E.regulator_of_points(points, precision=300)
    413413            0.152460177943143751624324757049455823243727077486630817840280980046053225683562463604114816
     
    495495        return forall(self.ainvs(), lambda x : x.valuation(P) >= 0)[0]
    496496
    497497    def local_integral_model(self,*P):
    498         r""" 
     498        r"""
    499499        Return a model of self which is integral at the prime ideal
    500500        `P`.
    501501
     
    584584    integral_model = global_integral_model
    585585
    586586    def _reduce_model(self):
    587         r""" 
     587        r"""
    588588
    589589        Transforms the elliptic curve to a model in which `a_1`,
    590590        `a_2`, `a_3` are reduced modulo 2, 3, 2 respectively.
     
    688688            Minimal discriminant valuation: 1
    689689            Conductor exponent: 1
    690690            Kodaira Symbol: I1
    691             Tamagawa Number: 1, 
     691            Tamagawa Number: 1,
    692692            Local data at Fractional ideal (-3*i - 2):
    693693            Reduction type: bad split multiplicative
    694694            Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1
     
    729729        from sage.schemes.elliptic_curves.ell_local_data import check_prime
    730730        P = check_prime(self.base_field(),P)
    731731
    732         return self._get_local_data(P,proof,algorithm)       
     732        return self._get_local_data(P,proof,algorithm)
    733733
    734734    def _get_local_data(self, P, proof, algorithm="pari"):
    735735        r"""
     
    782782            self._local_data = {}
    783783        except KeyError:
    784784            pass
    785         from sage.schemes.elliptic_curves.ell_local_data import EllipticCurveLocalData   
     785        from sage.schemes.elliptic_curves.ell_local_data import EllipticCurveLocalData
    786786        self._local_data[P, proof, algorithm] = EllipticCurveLocalData(self, P, proof, algorithm)
    787         return self._local_data[P, proof, algorithm]       
     787        return self._local_data[P, proof, algorithm]
    788788
    789789    def local_minimal_model(self, P, proof = None, algorithm="pari"):
    790790        r"""
     
    862862            sage: K.<a>=NumberField(x^3-2)
    863863            sage: P17a, P17b = [P for P,e in K.factor(17)]
    864864            sage: E = EllipticCurve([0,0,0,0,2*a+1])
    865             sage: [(p,E.has_good_reduction(p)) for p in [P17a,P17b]]           
     865            sage: [(p,E.has_good_reduction(p)) for p in [P17a,P17b]]
    866866            [(Fractional ideal (4*a^2 - 2*a + 1), True),
    867867            (Fractional ideal (2*a + 1), False)]
    868         """   
     868        """
    869869        return self.local_data(P).has_good_reduction()
    870870       
    871871    def has_bad_reduction(self, P):
     
    896896            sage: K.<a>=NumberField(x^3-2)
    897897            sage: P17a, P17b = [P for P,e in K.factor(17)]
    898898            sage: E = EllipticCurve([0,0,0,0,2*a+1])
    899             sage: [(p,E.has_bad_reduction(p)) for p in [P17a,P17b]]           
     899            sage: [(p,E.has_bad_reduction(p)) for p in [P17a,P17b]]
    900900            [(Fractional ideal (4*a^2 - 2*a + 1), False),
    901901            (Fractional ideal (2*a + 1), True)]
    902902        """
     
    930930            sage: K.<a>=NumberField(x^3-2)
    931931            sage: P17a, P17b = [P for P,e in K.factor(17)]
    932932            sage: E = EllipticCurve([0,0,0,0,2*a+1])
    933             sage: [(p,E.has_multiplicative_reduction(p)) for p in [P17a,P17b]]           
     933            sage: [(p,E.has_multiplicative_reduction(p)) for p in [P17a,P17b]]
    934934            [(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
    935935        """
    936936        return self.local_data(P).has_multiplicative_reduction()
     
    958958            sage: K.<a>=NumberField(x^3-2)
    959959            sage: P17a, P17b = [P for P,e in K.factor(17)]
    960960            sage: E = EllipticCurve([0,0,0,0,2*a+1])
    961             sage: [(p,E.has_split_multiplicative_reduction(p)) for p in [P17a,P17b]]           
     961            sage: [(p,E.has_split_multiplicative_reduction(p)) for p in [P17a,P17b]]
    962962            [(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
    963963        """
    964964        return self.local_data(P).has_split_multiplicative_reduction()
     
    986986            sage: K.<a>=NumberField(x^3-2)
    987987            sage: P17a, P17b = [P for P,e in K.factor(17)]
    988988            sage: E = EllipticCurve([0,0,0,0,2*a+1])
    989             sage: [(p,E.has_nonsplit_multiplicative_reduction(p)) for p in [P17a,P17b]]           
     989            sage: [(p,E.has_nonsplit_multiplicative_reduction(p)) for p in [P17a,P17b]]
    990990            [(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
    991991        """
    992992        return self.local_data(P).has_nonsplit_multiplicative_reduction()
     
    10131013            sage: K.<a>=NumberField(x^3-2)
    10141014            sage: P17a, P17b = [P for P,e in K.factor(17)]
    10151015            sage: E = EllipticCurve([0,0,0,0,2*a+1])
    1016             sage: [(p,E.has_additive_reduction(p)) for p in [P17a,P17b]]           
     1016            sage: [(p,E.has_additive_reduction(p)) for p in [P17a,P17b]]
    10171017            [(Fractional ideal (4*a^2 - 2*a + 1), False),
    10181018            (Fractional ideal (2*a + 1), True)]
    10191019        """
     
    11111111    def tamagawa_product_bsd(self):
    11121112        r"""
    11131113        Given an elliptic curve `E` over a number field `K`, this function returns the
    1114         integer `C(E/K)` that appears in the Birch and Swinnerton-Dyer conjecture accounting 
     1114        integer `C(E/K)` that appears in the Birch and Swinnerton-Dyer conjecture accounting
    11151115        for the local information at finite places. If the model is a global minimal model then `C(E/K)` is
    1116         simply the product of the Tamagawa numbers `c_v` where `v` runs over all prime ideals of `K`. Otherwise, if the model has to be changed at a place `v` a correction factor appears. 
     1116        simply the product of the Tamagawa numbers `c_v` where `v` runs over all prime ideals of `K`. Otherwise, if the model has to be changed at a place `v` a correction factor appears.
    11171117        The definition is such that `C(E/K)` times the periods at the infinite places is invariant
    11181118        under change of the Weierstrass model. See [Ta2] and [Do] for details.
    11191119       
     
    11621162       
    11631163        """
    11641164        da = self.local_data()
    1165         pr = 1 
     1165        pr = 1
    11661166        for dav in da:
    11671167            pp = dav.prime()
    11681168            cv = dav.tamagawa_number()
     
    12031203            sage: K.<a>=NumberField(x^2-5)
    12041204            sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
    12051205            sage: bad_primes = E.discriminant().support(); bad_primes
    1206             [Fractional ideal  (a), Fractional ideal (7/2*a - 81/2), Fractional ideal (-a - 52), Fractional ideal (2)]  # 32-bit
    1207             [Fractional ideal (-a), Fractional ideal (7/2*a - 81/2), Fractional ideal (-a - 52), Fractional ideal (2)]  # 64-bit
     1206            [Fractional ideal (-a), Fractional ideal (7/2*a - 81/2), Fractional ideal (-a - 52), Fractional ideal (2)]
    12081207            sage: [E.kodaira_symbol(P) for P in bad_primes]
    12091208            [I0, I1, I1, II]
    12101209            sage: K.<a> = QuadraticField(-11)
     
    13481347           sage: v = K.fractional_ideal(2*i+3)
    13491348           sage: EK.reduction(v)
    13501349           Elliptic Curve defined by y^2  = x^3 + 5*x + 8 over Residue field of Fractional ideal (2*i + 3)
    1351            sage: EK.reduction(K.ideal(1+i))     
     1350           sage: EK.reduction(K.ideal(1+i))
    13521351           Traceback (most recent call last):
    1353            ... 
     1352           ...
    13541353           ValueError: The curve must have good reduction at the place.
    1355            sage: EK.reduction(K.ideal(2)) 
     1354           sage: EK.reduction(K.ideal(2))
    13561355           Traceback (most recent call last):
    1357            ... 
     1356           ...
    13581357           ValueError: The ideal must be prime.
    13591358           sage: K=QQ.extension(x^2+x+1,"a")
    1360            sage: E=EllipticCurve([1024*K.0,1024*K.0]) 
     1359           sage: E=EllipticCurve([1024*K.0,1024*K.0])
    13611360           sage: E.reduction(2*K)
    13621361           Elliptic Curve defined by y^2 + (abar+1)*y = x^3 over Residue field in abar of Fractional ideal (2)
    13631362       """
     
    13751374           if local_data.has_good_reduction():
    13761375               Fv = OK.residue_field(place)
    13771376               return local_data.minimal_model().change_ring(Fv)
    1378            raise ValueError, "The curve must have good reduction at the place." 
     1377           raise ValueError, "The curve must have good reduction at the place."
    13791378       Fv = OK.residue_field(place)
    13801379       return self.change_ring(Fv)
    13811380   
     
    14021401       
    14031402        EXAMPLES::
    14041403
    1405             sage: CDB=CremonaDatabase() 
     1404            sage: CDB=CremonaDatabase()
    14061405            sage: [E._torsion_bound() for E in CDB.iter([14])]
    14071406            [6, 6, 6, 6, 6, 6]
    1408             sage: [E.torsion_order() for E in CDB.iter([14])] 
    1409             [6, 6, 2, 6, 2, 6]   
     1407            sage: [E.torsion_order() for E in CDB.iter([14])]
     1408            [6, 6, 2, 6, 2, 6]
    14101409        """
    1411         E = self           
     1410        E = self
    14121411        bound = 0
    14131412        k = 0
    14141413        K = E.base_field()
     
    15511550            sage: K.<t> = NumberField(x^4 + x^3 + 11*x^2 + 41*x + 101)
    15521551            sage: EK = E.base_extend(K)
    15531552            sage: EK.torsion_points()
    1554             [(5 : 5 : 1), 
    1555             (5 : -6 : 1), 
    1556             (16 : -61 : 1), 
    1557             (-3/55*t^3 - 7/55*t^2 - 2/55*t - 133/55 : 6/55*t^3 + 3/55*t^2 + 25/11*t + 156/55 : 1), 
    1558             (-9/121*t^3 - 21/121*t^2 - 127/121*t - 377/121 : -7/121*t^3 + 24/121*t^2 + 197/121*t + 16/121 : 1), 
    1559             (5/121*t^3 - 14/121*t^2 - 158/121*t - 453/121 : -49/121*t^3 - 129/121*t^2 - 315/121*t - 207/121 : 1), 
    1560             (10/121*t^3 + 49/121*t^2 + 168/121*t + 73/121 : 32/121*t^3 + 60/121*t^2 - 261/121*t - 807/121 : 1), 
    1561             (1/11*t^3 - 5/11*t^2 + 19/11*t - 40/11 : -6/11*t^3 - 3/11*t^2 - 26/11*t - 321/11 : 1), 
    1562             (14/121*t^3 - 15/121*t^2 + 90/121*t + 232/121 : 16/121*t^3 - 69/121*t^2 + 293/121*t - 46/121 : 1), 
    1563             (3/55*t^3 + 7/55*t^2 + 2/55*t + 78/55 : 7/55*t^3 - 24/55*t^2 + 9/11*t + 17/55 : 1), 
    1564             (-5/121*t^3 + 36/121*t^2 - 84/121*t + 24/121 : 34/121*t^3 - 27/121*t^2 + 305/121*t + 708/121 : 1), 
    1565             (-26/121*t^3 + 20/121*t^2 - 219/121*t - 995/121 : 15/121*t^3 + 156/121*t^2 - 232/121*t + 2766/121 : 1), 
    1566             (1/11*t^3 - 5/11*t^2 + 19/11*t - 40/11 : 6/11*t^3 + 3/11*t^2 + 26/11*t + 310/11 : 1), 
    1567             (-26/121*t^3 + 20/121*t^2 - 219/121*t - 995/121 : -15/121*t^3 - 156/121*t^2 + 232/121*t - 2887/121 : 1), 
    1568             (-5/121*t^3 + 36/121*t^2 - 84/121*t + 24/121 : -34/121*t^3 + 27/121*t^2 - 305/121*t - 829/121 : 1), 
    1569             (3/55*t^3 + 7/55*t^2 + 2/55*t + 78/55 : -7/55*t^3 + 24/55*t^2 - 9/11*t - 72/55 : 1), 
    1570             (14/121*t^3 - 15/121*t^2 + 90/121*t + 232/121 : -16/121*t^3 + 69/121*t^2 - 293/121*t - 75/121 : 1), 
    1571             (t : -1/11*t^3 - 6/11*t^2 - 19/11*t - 59/11 : 1), 
    1572             (10/121*t^3 + 49/121*t^2 + 168/121*t + 73/121 : -32/121*t^3 - 60/121*t^2 + 261/121*t + 686/121 : 1), 
    1573             (5/121*t^3 - 14/121*t^2 - 158/121*t - 453/121 : 49/121*t^3 + 129/121*t^2 + 315/121*t + 86/121 : 1), 
    1574             (-9/121*t^3 - 21/121*t^2 - 127/121*t - 377/121 : 7/121*t^3 - 24/121*t^2 - 197/121*t - 137/121 : 1), 
    1575             (-3/55*t^3 - 7/55*t^2 - 2/55*t - 133/55 : -6/55*t^3 - 3/55*t^2 - 25/11*t - 211/55 : 1), 
    1576             (0 : 1 : 0), 
    1577             (16 : 60 : 1), 
     1553            [(5 : 5 : 1),
     1554            (5 : -6 : 1),
     1555            (16 : -61 : 1),
     1556            (-3/55*t^3 - 7/55*t^2 - 2/55*t - 133/55 : 6/55*t^3 + 3/55*t^2 + 25/11*t + 156/55 : 1),
     1557            (-9/121*t^3 - 21/121*t^2 - 127/121*t - 377/121 : -7/121*t^3 + 24/121*t^2 + 197/121*t + 16/121 : 1),
     1558            (5/121*t^3 - 14/121*t^2 - 158/121*t - 453/121 : -49/121*t^3 - 129/121*t^2 - 315/121*t - 207/121 : 1),
     1559            (10/121*t^3 + 49/121*t^2 + 168/121*t + 73/121 : 32/121*t^3 + 60/121*t^2 - 261/121*t - 807/121 : 1),
     1560            (1/11*t^3 - 5/11*t^2 + 19/11*t - 40/11 : -6/11*t^3 - 3/11*t^2 - 26/11*t - 321/11 : 1),
     1561            (14/121*t^3 - 15/121*t^2 + 90/121*t + 232/121 : 16/121*t^3 - 69/121*t^2 + 293/121*t - 46/121 : 1),
     1562            (3/55*t^3 + 7/55*t^2 + 2/55*t + 78/55 : 7/55*t^3 - 24/55*t^2 + 9/11*t + 17/55 : 1),
     1563            (-5/121*t^3 + 36/121*t^2 - 84/121*t + 24/121 : 34/121*t^3 - 27/121*t^2 + 305/121*t + 708/121 : 1),
     1564            (-26/121*t^3 + 20/121*t^2 - 219/121*t - 995/121 : 15/121*t^3 + 156/121*t^2 - 232/121*t + 2766/121 : 1),
     1565            (1/11*t^3 - 5/11*t^2 + 19/11*t - 40/11 : 6/11*t^3 + 3/11*t^2 + 26/11*t + 310/11 : 1),
     1566            (-26/121*t^3 + 20/121*t^2 - 219/121*t - 995/121 : -15/121*t^3 - 156/121*t^2 + 232/121*t - 2887/121 : 1),
     1567            (-5/121*t^3 + 36/121*t^2 - 84/121*t + 24/121 : -34/121*t^3 + 27/121*t^2 - 305/121*t - 829/121 : 1),
     1568            (3/55*t^3 + 7/55*t^2 + 2/55*t + 78/55 : -7/55*t^3 + 24/55*t^2 - 9/11*t - 72/55 : 1),
     1569            (14/121*t^3 - 15/121*t^2 + 90/121*t + 232/121 : -16/121*t^3 + 69/121*t^2 - 293/121*t - 75/121 : 1),
     1570            (t : -1/11*t^3 - 6/11*t^2 - 19/11*t - 59/11 : 1),
     1571            (10/121*t^3 + 49/121*t^2 + 168/121*t + 73/121 : -32/121*t^3 - 60/121*t^2 + 261/121*t + 686/121 : 1),
     1572            (5/121*t^3 - 14/121*t^2 - 158/121*t - 453/121 : 49/121*t^3 + 129/121*t^2 + 315/121*t + 86/121 : 1),
     1573            (-9/121*t^3 - 21/121*t^2 - 127/121*t - 377/121 : 7/121*t^3 - 24/121*t^2 - 197/121*t - 137/121 : 1),
     1574            (-3/55*t^3 - 7/55*t^2 - 2/55*t - 133/55 : -6/55*t^3 - 3/55*t^2 - 25/11*t - 211/55 : 1),
     1575            (0 : 1 : 0),
     1576            (16 : 60 : 1),
    15781577            (t : 1/11*t^3 + 6/11*t^2 + 19/11*t + 48/11 : 1)]
    15791578
    15801579        ::
     
    15831582            sage: K.<t> = NumberField(x^2 + 2*x + 10)
    15841583            sage: EK = E.base_extend(K)
    15851584            sage: EK.torsion_points()
    1586             [(3 : -2 : 1), 
    1587             (8 : -27 : 1), 
    1588             (1/2 : 5/4*t + 1/2 : 1), 
    1589             (-t - 2 : 2*t + 8 : 1), 
    1590             (-7 : -5*t - 2 : 1), 
    1591             (-1 : 0 : 1), 
    1592             (-2 : 3 : 1), 
    1593             (-13/4 : 9/8 : 1), 
    1594             (-2 : -2 : 1), 
    1595             (t : -2*t + 4 : 1), 
    1596             (-7 : 5*t + 8 : 1), 
    1597             (-t - 2 : -t - 7 : 1), 
    1598             (1/2 : -5/4*t - 2 : 1), 
    1599             (0 : 1 : 0), 
    1600             (8 : 18 : 1), 
     1585            [(3 : -2 : 1),
     1586            (8 : -27 : 1),
     1587            (1/2 : 5/4*t + 1/2 : 1),
     1588            (-t - 2 : 2*t + 8 : 1),
     1589            (-7 : -5*t - 2 : 1),
     1590            (-1 : 0 : 1),
     1591            (-2 : 3 : 1),
     1592            (-13/4 : 9/8 : 1),
     1593            (-2 : -2 : 1),
     1594            (t : -2*t + 4 : 1),
     1595            (-7 : 5*t + 8 : 1),
     1596            (-t - 2 : -t - 7 : 1),
     1597            (1/2 : -5/4*t - 2 : 1),
     1598            (0 : 1 : 0),
     1599            (8 : 18 : 1),
    16011600            (t : t - 5 : 1)]
    16021601       
    16031602        ::
    16041603   
    16051604            sage: K.<i> = QuadraticField(-1)
    1606             sage: EK = EllipticCurve(K,[0,0,0,0,-1])           
    1607             sage: EK.torsion_points ()             
     1605            sage: EK = EllipticCurve(K,[0,0,0,0,-1])
     1606            sage: EK.torsion_points ()
    16081607            [(0 : -i : 1), (1 : 0 : 1), (0 : i : 1), (-2 : 3*i : 1), (0 : 1 : 0), (-2 : -3*i : 1)]
    16091608         """
    16101609        T = self.torsion_subgroup() # make sure it is cached
     
    16151614        Returns the lower and upper bounds using :meth:`~simon_two_descent`.
    16161615        The results of :meth:`~simon_two_descent` are cached.
    16171616
    1618         .. NOTE:: 
     1617        .. NOTE::
    16191618
    16201619            The optional parameters control the Simon two descent algorithm;
    16211620            see the documentation of :meth:`~simon_two_descent` for more
    16221621            details.
    16231622
    1624         INPUT: 
     1623        INPUT:
    16251624
    16261625        - ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
    16271626
     
    16601659        bounds on the rank::
    16611660
    16621661            sage: Qrt5.<rt5>=NumberField(x^2-5)
    1663             sage: E=EllipticCurve([0,5-rt5,0,rt5,0]) 
     1662            sage: E=EllipticCurve([0,5-rt5,0,rt5,0])
    16641663            sage: E.rank_bounds()
    16651664            (1, 2)
    16661665
     
    16781677        r"""
    16791678        Return the rank of this elliptic curve, if it can be determined.
    16801679
    1681         .. NOTE:: 
     1680        .. NOTE::
    16821681
    16831682            The optional parameters control the Simon two descent algorithm;
    16841683            see the documentation of :meth:`~simon_two_descent` for more
    16851684            details.
    16861685
    1687         INPUT: 
     1686        INPUT:
    16881687
    16891688        - ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
    16901689
     
    17041703
    17051704        If the upper and lower bounds given by Simon two-descent are
    17061705        the same, then the rank has been uniquely identified and we
    1707         return this. Otherwise, we raise a ValueError with an error 
    1708         message specifying the upper and lower bounds. 
     1706        return this. Otherwise, we raise a ValueError with an error
     1707        message specifying the upper and lower bounds.
    17091708       
    17101709        .. NOTE::
    17111710
     
    17251724        algorithm do not uniquely determine the rank::
    17261725
    17271726            sage: Qrt5.<rt5>=NumberField(x^2-5)
    1728             sage: E=EllipticCurve([0,5-rt5,0,rt5,0]) 
     1727            sage: E=EllipticCurve([0,5-rt5,0,rt5,0])
    17291728            sage: E.rank()
    17301729            Traceback (most recent call last):
    1731             ... 
     1730            ...
    17321731            ValueError: There is insufficient data to determine the rank -
    17331732            2-descent gave lower bound 1 and upper bound 2
    17341733
     
    17421741        lower,upper = self.rank_bounds(verbose=verbose,lim1=lim1,lim3=lim3,limtriv=limtriv,maxprob=maxprob,limbigprime=limbigprime)
    17431742        if lower == upper:
    17441743            return lower
    1745         else: 
     1744        else:
    17461745            raise ValueError, 'There is insufficient data to determine the rank - 2-descent gave lower bound %s and upper bound %s' % (lower, upper)
    17471746
    17481747    def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
     
    17501749        Returns some generators of this elliptic curve. Check :meth:`~rank` or
    17511750        :meth:`~rank_bounds` to verify the number of generators.
    17521751
    1753         .. NOTE:: 
     1752        .. NOTE::
    17541753
    17551754            The optional parameters control the Simon two descent algorithm;
    17561755            see the documentation of :meth:`~simon_two_descent` for more
    17571756            details.
    17581757
    1759         INPUT: 
     1758        INPUT:
    17601759
    17611760        - ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
    17621761
     
    17951794        uniquely determine the rank::
    17961795
    17971796            sage: Qrt5.<rt5>=NumberField(x^2-5)
    1798             sage: E=EllipticCurve([0,5-rt5,0,rt5,0]) 
     1797            sage: E=EllipticCurve([0,5-rt5,0,rt5,0])
    17991798            sage: E.gens()
    18001799            [(3/2*rt5 + 5/2 : -9/2*rt5 - 15/2 : 1), (-1/2*rt5 + 3/2 : 3/2*rt5 - 9/2 : 1), (0 : 0 : 1)]
    18011800
     
    18171816
    18181817        - ``embedding`` - an embedding of the base number field into `\RR` or `\CC`.
    18191818
    1820         .. note:: 
     1819        .. note::
    18211820
    18221821           The precision of the embedding is ignored: we only use the
    18231822           given embedding to determine which embedding into ``QQbar``
     
    18301829        First define a field with two real embeddings::
    18311830
    18321831            sage: K.<a> = NumberField(x^3-2)
    1833             sage: E=EllipticCurve([0,0,0,a,2])                           
     1832            sage: E=EllipticCurve([0,0,0,a,2])
    18341833            sage: embs=K.embeddings(CC); len(embs)
    18351834            3
    18361835
     
    19021901            sage: E1 = EllipticCurve(F, [7,8])
    19031902            sage: E2 = EllipticCurve(F, [0,5,0,1,0])
    19041903            sage: E3 = EllipticCurve(F, [0,-10,0,21,0])
    1905             sage: E1.is_isogenous(E2)   
     1904            sage: E1.is_isogenous(E2)
    19061905            False
    1907             sage: E1.is_isogenous(E1) 
     1906            sage: E1.is_isogenous(E1)
    19081907            True
    19091908            sage: E2.is_isogenous(E2)
    19101909            True
    1911             sage: E2.is_isogenous(E1) 
     1910            sage: E2.is_isogenous(E1)
    19121911            False
    1913             sage: E2.is_isogenous(E3) 
     1912            sage: E2.is_isogenous(E3)
    19141913            True
    19151914
    1916         ::   
     1915        ::
    19171916
    19181917            sage: x = polygen(QQ, 'x')
    19191918            sage: F = NumberField(x^2 -2, 's'); F
     
    19621961           True
    19631962           sage: E3.is_isogenous(E2)
    19641963           True
    1965            sage: E1.isogeny_degree(E2)           
     1964           sage: E1.isogeny_degree(E2)
    19661965           9
    19671966
    19681967        """
     
    20412040            sage: x = QQ['x'].0
    20422041            sage: F = NumberField(x^2 -2, 's'); F
    20432042            Number Field in s with defining polynomial x^2 - 2
    2044             sage: E = EllipticCurve('14a1')                   
     2043            sage: E = EllipticCurve('14a1')
    20452044            sage: EE = EllipticCurve('14a2')
    20462045            sage: E1 = E.change_ring(F)
    20472046            sage: E2 = EE.change_ring(F)
    20482047            sage: E1.isogeny_degree(E2)
    20492048            2
    2050             sage: E2.isogeny_degree(E2)     
     2049            sage: E2.isogeny_degree(E2)
    20512050            1
    2052             sage: E5 = EllipticCurve('14a5').change_ring(F)   
     2051            sage: E5 = EllipticCurve('14a5').change_ring(F)
    20532052            sage: E1.isogeny_degree(E5)
    20542053            6
    20552054        """
  • sage/schemes/elliptic_curves/ell_rational_field.py

    diff --git a/sage/schemes/elliptic_curves/ell_rational_field.py b/sage/schemes/elliptic_curves/ell_rational_field.py
    a b  
    14621462       
    14631463        ::
    14641464       
    1465             sage: E = EllipticCurve([1, -1, 0, -751055859, -7922219731979])     # long time (0.6 seconds)
    1466             sage: set_random_seed(0)        # long time
    1467             sage: E.simon_two_descent ()    # long time
     1465            sage: E = EllipticCurve([1, -1, 0, -751055859, -7922219731979])
     1466            sage: set_random_seed(0)
     1467            sage: E.simon_two_descent()
    14681468            (1, 1, [])           
    14691469       
    14701470        The rest of these entries were taken from Tom Womack's page
     
    14941494            (8, 8)
    14951495
    14961496        Example from trac 10832::
     1497
    14971498            sage: E = EllipticCurve([1,0,0,-6664,86543])
    14981499            sage: E.simon_two_descent()
    14991500            (2, 3, [(173 : 1943 : 1), (-73 : -394 : 1), (323/4 : 1891/8 : 1)])
     
    16221623            2
    16231624            sage: EllipticCurve('5077a').rank()
    16241625            3
    1625             sage: EllipticCurve([1, -1, 0, -79, 289]).rank()   # long time.  This will use the default proof behavior of True.
     1626            sage: EllipticCurve([1, -1, 0, -79, 289]).rank()   # This will use the default proof behavior of True
    16261627            4
    1627             sage: EllipticCurve([0, 0, 1, -79, 342]).rank(proof=False)  # long time -- but under a minute
     1628            sage: EllipticCurve([0, 0, 1, -79, 342]).rank(proof=False)
    16281629            5
    1629             sage: EllipticCurve([0, 0, 1, -79, 342]).simon_two_descent()[0]  # much faster -- almost instant.
     1630            sage: EllipticCurve([0, 0, 1, -79, 342]).simon_two_descent()[0]
    16301631            5
    16311632       
    16321633        Examples with denominators in defining equations::
    16331634       
    1634             sage: E = EllipticCurve( [0, 0, 0, 0, -675/4])
     1635            sage: E = EllipticCurve([0, 0, 0, 0, -675/4])
    16351636            sage: E.rank()
    16361637            0
    1637             sage: E = EllipticCurve( [0, 0, 1/2, 0, -1/5])
     1638            sage: E = EllipticCurve([0, 0, 1/2, 0, -1/5])
    16381639            sage: E.rank()
    16391640            1
    16401641            sage: E.minimal_model().rank()
     
    20142015        EXAMPLES::
    20152016       
    20162017            sage: E = EllipticCurve([0, 0, 1, -1, 0])
    2017             sage: E.regulator()              # long time (1 second)
     2018            sage: E.regulator()
    20182019            0.0511114082399688
    20192020            sage: EllipticCurve('11a').regulator()
    20202021            1.00000000000000
     
    20242025            0.152460177943144
    20252026            sage: EllipticCurve('5077a').regulator()
    20262027            0.41714355875838...
    2027             sage: EllipticCurve([1, -1, 0, -79, 289]).regulator()  # long time (seconds)
     2028            sage: EllipticCurve([1, -1, 0, -79, 289]).regulator()
    20282029            1.50434488827528
    2029             sage: EllipticCurve([0, 0, 1, -79, 342]).regulator(proof=False)  # long time (seconds)
     2030            sage: EllipticCurve([0, 0, 1, -79, 342]).regulator(proof=False)  # long time (6s on sage.math, 2011)
    20302031            14.790527570131...
    20312032        """
    20322033        if precision is None:
     
    21012102           regulator of saturated points.
    21022103       
    21032104       
    2104         IMPLEMENTATION: Uses Cremona's mwrank package. With max_prime=0,
    2105         we call mwrank with successively larger prime bounds until the full
     2105        ALGORITHM: Uses Cremona's ``mwrank`` package. With ``max_prime=0``,
     2106        we call ``mwrank`` with successively larger prime bounds until the full
    21062107        saturation is provably found. The results of saturation at the
    21072108        previous primes is stored in each case, so this should be
    21082109        reasonably fast.
     
    21182119
    21192120        TESTS:
    21202121
    2121         See #10590.   This example would loop for ever at default precision::
     2122        See #10590.  This example would loop for ever at default precision::
    21222123
    21232124            sage: E = EllipticCurve([1, 0, 1, -977842, -372252745])
    21242125            sage: P = E([-192128125858676194585718821667542660822323528626273/336995568430319276695106602174283479617040716649, 70208213492933395764907328787228427430477177498927549075405076353624188436/195630373799784831667835900062564586429333568841391304129067339731164107, 1])
     
    21292130            sage: E.saturation([2*P]) ## needs higher precision
    21302131            ...
    21312132            ([(1755450733726721618440965414535034458701302721700399/970334851896750960577261378321772998240802013604 : -59636173615502879504846810677646864329901430096139563516090202443694810309127/955833935771565601591243078845907133814963790187832340692216425242529192 : 1)], 2, 113.302910926080)
    2132    
    2133 
    2134         See #10840.  This cause eclib to crash since the curve is
     2133
     2134        See #10840.  This causes eclib to crash since the curve is
    21352135        non-minimal at 2::
    21362136
    21372137            sage: E = EllipticCurve([0,0,0,-13711473216,0])
     
    21412141            sage: S = E([-113288,-9969344])
    21422142            sage: E.saturation([P,Q,R,S])
    21432143            ([(-19992 : 16313472 : 1), (-24108 : -17791704 : 1), (-97104 : -20391840 : 1), (-113288 : -9969344 : 1)], 1, 172.792031341679)
    2144            
    21452144
    21462145        """
    21472146        if not isinstance(points, list):
     
    32783277            sage: E = EllipticCurve('242a1')
    32793278            sage: E.modular_degree()
    32803279            16
    3281             sage: E.congruence_number()  # long time
     3280            sage: E.congruence_number()  # long time (4s on sage.math, 2011)
    32823281            176
    32833282       
    32843283                   
     
    57105709           
    57115710        Output checked with Magma (corrected in 3 cases)::
    57125711       
    5713             sage: [len(e.S_integral_points([2], both_signs=False)) for e in cremona_curves([11..100])] # long time
     5712            sage: [len(e.S_integral_points([2], both_signs=False)) for e in cremona_curves([11..100])] # long time (19s on sage.math, 2011)
    57145713            [2, 0, 2, 3, 3, 1, 3, 1, 3, 5, 3, 5, 4, 1, 1, 2, 2, 2, 3, 1, 2, 1, 0, 1, 3, 3, 1, 1, 5, 3, 4, 2, 1, 1, 5, 3, 2, 2, 1, 1, 1, 0, 1, 3, 0, 1, 0, 1, 1, 3, 7, 1, 3, 3, 3, 1, 1, 2, 3, 1, 2, 3, 1, 2, 1, 3, 3, 1, 1, 1, 0, 1, 3, 3, 1, 1, 7, 1, 0, 1, 1, 0, 1, 2, 0, 3, 1, 2, 1, 3, 1, 2, 2, 4, 5, 3, 2, 1, 1, 6, 1, 0, 1, 3, 1, 3, 3, 1, 1, 1, 1, 1, 3, 1, 5, 1, 2, 4, 1, 1, 1, 1, 1, 0, 1, 0, 2, 2, 0, 0, 1, 0, 1, 1, 6, 1, 0, 1, 1, 0, 4, 3, 1, 2, 1, 2, 3, 1, 1, 1, 1, 8, 3, 1, 2, 1, 2, 0, 8, 2, 0, 6, 2, 3, 1, 1, 1, 3, 1, 3, 2, 1, 3, 1, 2, 1, 6, 9, 3, 3, 1, 1, 2, 3, 1, 1, 5, 5, 1, 1, 0, 1, 1, 2, 3, 1, 1, 2, 3, 1, 3, 1, 1, 1, 1, 0, 0, 1, 3, 3, 1, 3, 1, 1, 2, 2, 0, 0, 6, 1, 0, 1, 1, 1, 1, 3, 1, 2, 6, 3, 1, 2, 2, 1, 1, 1, 1, 7, 5, 4, 3, 3, 1, 1, 1, 1, 1, 1, 8, 5, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 2, 3, 6, 1, 1, 7, 3, 3, 4, 5, 9, 6, 1, 0, 7, 1, 1, 3, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 7, 8, 2, 3, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1]
    57155714
    57165715        An example from [PZGH]::
    57175716       
    57185717            sage: E = EllipticCurve([0,0,0,-172,505])
    5719             sage: E.rank(), len(E.S_integral_points([3,5,7]))  # long time (~7s)
     5718            sage: E.rank(), len(E.S_integral_points([3,5,7]))  # long time (5s on sage.math, 2011)
    57205719            (4, 72)
    57215720
    57225721        This is curve "7690e1" which failed until \#4805 was fixed::