Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
#31317: more intelligent default for nap
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCremona committed Feb 2, 2021
1 parent da09de4 commit 2ab86ef
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/sage/schemes/elliptic_curves/ell_rational_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,8 @@ def _modular_symbol_normalize(self, sign, normalize, implementation, nap):
if sign not in [1,-1]:
raise ValueError("The sign of a modular symbol must be 1 or -1")
sign = ZZ(sign)
if implementation == 'eclib' and nap == 0:
nap = min(100*self.conductor().isqrt(), 10000)
if normalize is None:
normalize = "L_ratio"
if normalize not in ["L_ratio", "period", "none"]:
Expand All @@ -1115,7 +1117,7 @@ def _modular_symbol_normalize(self, sign, normalize, implementation, nap):
return (sign, normalize, implementation, nap)

@cached_method(key = _modular_symbol_normalize)
def modular_symbol(self, sign=+1, normalize=None, implementation='eclib', nap=500):
def modular_symbol(self, sign=+1, normalize=None, implementation='eclib', nap=0):
r"""Return the modular symbol map associated to this elliptic curve
with given sign.
Expand All @@ -1142,10 +1144,11 @@ def modular_symbol(self, sign=+1, normalize=None, implementation='eclib', nap=50
uses Wuthrich's implementation of numerical modular
symbols.
- ``nap`` - (int, default 1000); ignored unless implementation
is 'eclib'. The number of ap of E to use in determining the
normalisation of the modular symbols. Using too small a
value can lead to incorrect normalisation.
- ``nap`` - (int, default 0); ignored unless implementation is
'eclib'. The number of ap of E to use in determining the
normalisation of the modular symbols. If 0 (the default),
then the value of 100*E.conductor().isqrt() is used. Using
too small a value can lead to incorrect normalisation.
DEFINITION:
Expand Down

0 comments on commit 2ab86ef

Please sign in to comment.