From 7fef71044f11f086fb5ea2c59fb1d89578a47ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 28 Nov 2018 15:24:58 +0100 Subject: [PATCH] fixing some details in elliptic curves over Q --- .../elliptic_curves/ell_rational_field.py | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index bd183dd15d4..1d9d7c592c8 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -47,7 +47,7 @@ # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ +# https://www.gnu.org/licenses/ ############################################################################## from __future__ import print_function, division, absolute_import from six import integer_types, iteritems @@ -1532,7 +1532,7 @@ def analytic_rank(self, algorithm="pari", leading_coefficient=False): S = set([self.analytic_rank('pari'), self.analytic_rank('rubinstein'), self.analytic_rank('sympow')]) if len(S) != 1: - raise RuntimeError("Bug in analytic_rank; algorithms don't agree! (E=%s)"%self) + raise RuntimeError("Bug in analytic_rank; algorithms don't agree! (E=%s)" % self) return list(S)[0] else: raise ValueError("algorithm %s not defined"%algorithm) @@ -2087,7 +2087,7 @@ def rank(self, use_database=True, verbose=False, if self.root_number() == 1: L, err = self.lseries().at1(prec) if abs(L) > err + R(0.0001): # definitely doesn't vanish - misc.verbose("rank 0 because L(E,1)=%s"%L) + misc.verbose("rank 0 because L(E,1)=%s" % L) rank = Integer(0) self.__rank = (rank, proof) return rank @@ -2977,13 +2977,13 @@ def is_p_minimal(self, p): """ Tests if curve is p-minimal at a given prime p. - INPUT: p - a prime - - OUTPUT: True - if curve is p-minimal + INPUT: p -- a prime + OUTPUT: - - ``False`` - if curve isn't p-minimal + - ``True`` -- if curve is p-minimal + - ``False`` -- if curve is not p-minimal EXAMPLES:: @@ -4059,11 +4059,13 @@ def torsion_subgroup(self): [(0 : 1 : 0), (147 : 12960 : 1), (2307 : 97200 : 1), (-933 : 29160 : 1), (1011 : 0 : 1), (-933 : -29160 : 1), (2307 : -97200 : 1), (147 : -12960 : 1), (282 : 0 : 1), (8787 : 816480 : 1), (-285 : 27216 : 1), (1227 : 22680 : 1), (-1293 : 0 : 1), (1227 : -22680 : 1), (-285 : -27216 : 1), (8787 : -816480 : 1)] """ try: - return self.__torsion_subgroup + G = self.__torsion_subgroup except AttributeError: - self.__torsion_subgroup = ell_torsion.EllipticCurveTorsionSubgroup(self) - self.__torsion_order = self.__torsion_subgroup.order() - return self.__torsion_subgroup + G = ell_torsion.EllipticCurveTorsionSubgroup(self) + self.__torsion_subgroup = G + + self.__torsion_order = G.order() + return self.__torsion_subgroup def torsion_points(self): """ @@ -4522,7 +4524,7 @@ class are reordered to be isomorphic with the specified This curve had numerous `2`-isogenies:: - sage: e=EllipticCurve([1,0,0,-39,90]) + sage: e = EllipticCurve([1,0,0,-39,90]) sage: isocls = e.isogeny_class(); isocls.matrix() [1 2 4 4 8 8] [2 1 2 2 4 4] @@ -5815,7 +5817,7 @@ def integral_points(self, mw_base='auto', both_signs=False, verbose=False): if not self.is_integral(): raise ValueError("integral_points() can only be called on an integral model") - if mw_base=='auto': + if mw_base == 'auto': try: mw_base = self.gens() except RuntimeError: @@ -6135,8 +6137,10 @@ def S_integral_points(self, S, mw_base='auto', both_signs=False, verbose=False, A curve of rank 3 with no torsion points:: sage: E = EllipticCurve([0,0,1,-7,6]) - sage: P1=E.point((2,0)); P2=E.point((-1,3)); P3=E.point((4,6)) - sage: a=E.S_integral_points(S=[2,3], mw_base=[P1,P2,P3], verbose=True);a + sage: P1 = E.point((2,0)) + sage: P2 = E.point((-1,3)) + sage: P3 = E.point((4,6)) + sage: a = E.S_integral_points(S=[2,3], mw_base=[P1,P2,P3], verbose=True);a max_S: 3 len_S: 3 len_tors: 1 lambda 0.485997517468... k1,k2,k3,k4 7.65200453902598e234 1.31952866480763 3.54035317966420e9 2.42767548272846e17 @@ -6248,7 +6252,7 @@ def S_integral_points(self, S, mw_base='auto', both_signs=False, verbose=False, except AttributeError:#catches: .sort(), .is_prime() raise AttributeError('S must be a list of primes') - if mw_base=='auto': + if mw_base == 'auto': if verbose: print("Starting computation of MW basis") try: