From d8bb388cce106a572fd5a85df77274587c70dd87 Mon Sep 17 00:00:00 2001 From: AndrewVSutherland Date: Mon, 14 Oct 2024 01:12:14 +0000 Subject: [PATCH 1/2] autopep8 action fixes --- lmfdb/local_fields/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmfdb/local_fields/main.py b/lmfdb/local_fields/main.py index 09184ca95b..36a6ee4fde 100644 --- a/lmfdb/local_fields/main.py +++ b/lmfdb/local_fields/main.py @@ -395,7 +395,7 @@ def render_field_webpage(args): abelian = ' and abelian' if the_gal.is_abelian() else '' galphrase = 'This field is'+isgal+abelian+r' over $\Q_{%d}.$' % p if the_gal.order() == gn: - autstring = r'\Gal' + autstring = r'\Gal' prop2 = [ ('Label', label), ('Base', r'\(%s\)' % Qp), From 0bba89198dc84d0b7ece9c9c26c9e6480024375f Mon Sep 17 00:00:00 2001 From: Edgar Costa Date: Tue, 15 Oct 2024 12:09:56 -0400 Subject: [PATCH 2/2] fix Z-plot sign so that Z(t) > 0 for t -> 0^+ --- lmfdb/lfunctions/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lmfdb/lfunctions/main.py b/lmfdb/lfunctions/main.py index 370d87b35d..ff645da0c6 100644 --- a/lmfdb/lfunctions/main.py +++ b/lmfdb/lfunctions/main.py @@ -1634,11 +1634,20 @@ def getLfunctionPlot(request, *args): else: return render_lfunction_exception(err) + # Figure out plotrange plotrange = 30 if hasattr(pythonL, 'plotpoints'): F = p2sage(pythonL.plotpoints) # F[0][0] is the lowest t-coordinated that we have a value for L # F[-1][0] is the highest t-coordinated that we have a value for L + + # fix Z-plot sign so that Z(t) > 0 for t -> 0^+ + for t, x in F: + if t > 0: + if x < 0: + F = [(t, -x) for t, x in F] + break + plotrange = min(plotrange, -F[0][0], F[-1][0]) # aim to display at most 25 axis crossings # if the L-function is nonprimitive @@ -1653,8 +1662,17 @@ def getLfunctionPlot(request, *args): zero_range = zeros[-1]*25/len(zeros) zero_range *= 1.2 plotrange = min(plotrange, zero_range) + + for t, x in F: + if t > 0: + if t < zeros[0]: + assert x > 0 + else: + break + else: # obsolete, because lfunc_data comes from DB? + assert False # double checking my claim L = pythonL.sageLfunction if not hasattr(L, "hardy_z_function"): return None @@ -1663,6 +1681,8 @@ def getLfunctionPlot(request, *args): plotrange = 12 F = [(i, L.hardy_z_function(i).real()) for i in srange(-1*plotrange, plotrange, plotStep)] + + interpolation = spline(F) F_interp = [(i, interpolation(i)) for i in srange(-1*plotrange, plotrange, 0.05)] p = line(F_interp)