From 7b3c1886b7dbd481f7248c2271233c73ca483c01 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Mon, 7 Aug 2017 13:15:19 +0100 Subject: [PATCH] #8829 fix docstring typos --- .../elliptic_curves/ell_number_field.py | 12 +++++----- .../schemes/elliptic_curves/saturation.py | 22 ++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py index 7e4c70e1f97..e183d6c6d0d 100644 --- a/src/sage/schemes/elliptic_curves/ell_number_field.py +++ b/src/sage/schemes/elliptic_curves/ell_number_field.py @@ -3545,7 +3545,8 @@ def has_rational_cm(self, field=None): def saturation(self, points, verbose=False, max_prime=0, one_prime=0, odd_primes_only=False, lower_ht_bound=None, reg=None, debug=False): - r""" Given a list of rational points on `E` over `K`, compute the + r""" + Given a list of rational points on `E` over `K`, compute the saturation in `E(K)` of the subgroup they generate. INPUT: @@ -3657,11 +3658,11 @@ def saturation(self, points, verbose=False, ALGORITHM: - For rank 1 subgroups, simply do trial divison up to the maximal + For rank 1 subgroups, simply do trial division up to the maximal prime divisor. For higher rank subgroups, perform trial divison on all linear combinations for small primes, and look for projections `E(K) \rightarrow \oplus E(k) \otimes \mathbf{F}_p` which - are either full rank or provide `p`-divisble linear combinations, + are either full rank or provide `p`-divisible linear combinations, where the `k` here are residue fields of `K`. TESTS:: @@ -3752,7 +3753,8 @@ def saturation(self, points, verbose=False, def gens_quadratic(self, **kwds): - """Return generators for the Mordell-Weil group modulo torsion, for a + """ + Return generators for the Mordell-Weil group modulo torsion, for a curve which is a base change from `\QQ` to a quadratic field. EXAMPLES:: @@ -3787,7 +3789,7 @@ def gens_quadratic(self, **kwds): raise ValueError("gens_quadratic() requires the base field to be quadratic") EE = self.descend_to(QQ) - if len(EE)==0: + if not EE: raise ValueError("gens_quadratic() requires the elliptic curve to be a base change from Q") # In all cases there are exactly two distinct curves /Q whose diff --git a/src/sage/schemes/elliptic_curves/saturation.py b/src/sage/schemes/elliptic_curves/saturation.py index 5829624efc3..2e4e628a70d 100644 --- a/src/sage/schemes/elliptic_curves/saturation.py +++ b/src/sage/schemes/elliptic_curves/saturation.py @@ -11,7 +11,7 @@ finitely-generated Abelian group. The process of `p`-saturating a given set of points is implemented -here. The naive algirithm simply checks all `(p^r-1)/(p-1)` +here. The naive algorithm simply checks all `(p^r-1)/(p-1)` projective combinations of the points, testing each to see if it can be divided by `p`. If this occurs then we replace one of the points and continue. The function :meth:`p_saturation` does one step of @@ -54,20 +54,21 @@ from sage.rings.all import ZZ def p_saturation(Plist, p, sieve=True, lin_combs = dict(), verbose=False): - r""" Checks whether the list of points is `p`-saturated. + r""" + Checks whether the list of points is `p`-saturated. INPUT: - - ``Plist`` (list) - a list of independent points on one elliptic curve + - ``Plist`` (list) - a list of independent points on one elliptic curve. - - ``p`` (integer) - a prime number + - ``p`` (integer) - a prime number. - ``sieve`` (boolean) - if True, use a sieve (when there are at least 2 points); otherwise test all combinations. - ``lin_combs`` (dict) - a dict, possibly empty, with keys coefficient tuples and values the corresponding linear - combinations of the points in ``Plist`` + combinations of the points in ``Plist``. .. note:: @@ -101,7 +102,7 @@ def p_saturation(Plist, p, sieve=True, lin_combs = dict(), verbose=False): sage: p_saturation([P,Q,R],3) (True, {}) - Here we see an example where 19-aturation is proved, with the + Here we see an example where 19-saturation is proved, with the verbose flag set to True so that we can see what is going on:: sage: p_saturation([P,Q,R],19, verbose=True) @@ -352,17 +353,18 @@ def a(pt,g): def full_p_saturation(Plist, p, lin_combs = dict(), verbose=False): - r""" Full `p`-saturation of ``Plist``. + r""" + Full `p`-saturation of ``Plist``. INPUT: - - ``Plist`` (list) - a list of independent points on one elliptic curve + - ``Plist`` (list) - a list of independent points on one elliptic curve. - - ``p`` (integer) - a prime number + - ``p`` (integer) - a prime number. - ``lin_combs`` (dict, default null) - a dict, possibly empty, with keys coefficient tuples and values the corresponding linear - combinations of the points in ``Plist`` + combinations of the points in ``Plist``. OUTPUT: