Skip to content

Commit

Permalink
Merge pull request #6294 from LMFDB/main
Browse files Browse the repository at this point in the history
main -> dev
  • Loading branch information
roed314 authored Dec 9, 2024
2 parents b490f87 + fef99a9 commit 0ce1c0a
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 36 deletions.
2 changes: 1 addition & 1 deletion lmfdb/abvar/fq/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def url_for_label(label):
validate_label(label)
except ValueError as err:
flash_error("%s is not a valid label: %s.", label, str(err))
return redirect(url_for(".abelian_varieties"))
return url_for(".abelian_varieties")
g, q, iso = split_label(label)
return url_for(".abelian_varieties_by_gqi", g=g, q=q, iso=iso)

Expand Down
6 changes: 3 additions & 3 deletions lmfdb/bianchi_modular_forms/templates/bmf-newform.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ <h2> {{ KNOWL('mf.bianchi.newform', 'Form') }} </h2>
<tr><td> {{ KNOWL('mf.bianchi.spaces', title='Newspace')}}:</td><td><a href={{data.newspace_url}}>{{data.newspace_label}}</a> (dimension {{ data.newspace_dimension }}) </td></tr>
<tr><td> {{ KNOWL('mf.bianchi.sign',title="Sign of functional equation") }}:</td><td> {{data.sign}} </tr>
<tr><td> {{ KNOWL('mf.bianchi.anr',title="Analytic rank")}}:</td><td> {{data.anrank}}</td> </tr>
{% if data.Lratio %}
<tr><td> {{ KNOWL('mf.bianchi.anr',title="L-ratio")}}:</td><td> {{data.Lratio}} </td></tr>
{% endif %}
{# See issue #6288
<tr><td> {{ KNOWL('mf.bianchi.L-ratio',title="L-ratio")}}:</td><td> {{data.Lratio}} </td></tr>
#}
</table>
</p>

Expand Down
113 changes: 103 additions & 10 deletions lmfdb/ecnf/WebEllipticCurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from flask import url_for
from urllib.parse import quote
from markupsafe import Markup, escape
from sage.all import (Infinity, PolynomialRing, QQ, RDF, ZZ, KodairaSymbol,
from sage.all import (Infinity, PolynomialRing, QQ, RDF, ZZ, RR, KodairaSymbol,
implicit_plot, plot, prod, rainbow, sqrt, text, var)
from lmfdb import db
from lmfdb.utils import (encode_plot, names_and_urls, web_latex, display_knowl,
Expand Down Expand Up @@ -359,6 +359,9 @@ def make_E(self):
self.cond_norm = web_latex(self.conductor_norm)

Dnorm = self.normdisc
self.model_disc = self.disc.replace('w', Kgen).replace("*","").replace("(","").replace(")","")
if Kgen == 'phi':
self.model_disc = self.model_disc.replace(Kgen, r"\phi")
self.disc = pretty_ideal(Kgen, self.disc)

local_data = self.local_data
Expand Down Expand Up @@ -491,7 +494,8 @@ def make_E(self):
self.mw_struct = "unknown"

# Torsion
self.ntors = web_latex(self.torsion_order)
BSDntors = self.torsion_order
self.ntors = web_latex(BSDntors)
self.tr = len(self.torsion_structure)
if self.tr == 0:
self.tor_struct_pretty = "$0$"
Expand Down Expand Up @@ -560,18 +564,28 @@ def make_E(self):
self.bsd_status = "missing_gens"

# Regulator only in conditional/unconditional cases, or when we know the rank:
BSDReg = None
if self.bsd_status in ["conditional", "unconditional"]:
if self.ar == 0:
self.reg = web_latex(1) # otherwise we only get 1.00000...
BSDReg = 1
self.reg = self.NTreg = web_latex(BSDReg) # otherwise we only get 1.00000...
else:
try:
self.reg = web_latex(self.reg)
R = self.reg
BSDReg = R * K.degree()**self.rank
self.reg = web_latex(R)
self.NTreg = web_latex(BSDReg)
except AttributeError:
self.reg = "not available"
self.NTreg = "not available"
elif self.rk != "not available":
self.reg = web_latex(self.reg) if self.rank else web_latex(1)
R = self.reg
BSDReg = R * K.degree()**self.rank
self.reg = web_latex(R) if self.rank else web_latex(1)
self.NTreg = web_latex(BSDReg) if self.rank else web_latex(1)
else:
self.reg = "not available"
self.NTreg = "not available"

# Generators
try:
Expand All @@ -582,17 +596,31 @@ def make_E(self):
self.gens = []
self.gens_and_heights = []

# Global period
# Global period -- see issue #5409 for why we multiply by
# 2**nc in most cases. However, data computed after
# 2024-07-09 (including all data for imaginary quadratic
# fields of absolute discriminant > 600 as well as some larger
# conductors for other IQFs) already has the extra factor of
# 2. As a fail-safe until we fix the data in all cases, we
# will test (using the BSD formula) whether to remove the
# factor of 2 added here.
BSDomega = None
try:
self.omega = web_latex(self.omega)
BSDomega = self.omega
nc = self.signature[1] # number of complex places
if nc:
BSDomega *= 2**nc
self.omega = web_latex(BSDomega)
except AttributeError:
self.omega = "not available"

# L-value
BSDLvalue = None
try:
r = int(self.analytic_rank)
# lhs = "L(E,1) = " if r==0 else "L'(E,1) = " if r==1 else "L^{{({})}}(E,1)/{}! = ".format(r,r)
self.Lvalue = web_latex(self.Lvalue)
BSDLvalue = self.Lvalue
self.Lvalue = web_latex(BSDLvalue)
except (TypeError, AttributeError):
self.Lvalue = "not available"

Expand All @@ -604,14 +632,79 @@ def make_E(self):
self.tamagawa_factors = r'\cdot'.join(cp_fac)
else:
self.tamagawa_factors = None
self.tamagawa_product = web_latex(prod(tamagawa_numbers,1))
BSDprodcp = prod(tamagawa_numbers,1)
self.tamagawa_product = web_latex(BSDprodcp)

# Analytic Sha
BSDsha = None
try:
self.sha = web_latex(self.sha) + " (rounded)"
BSDsha = self.sha
self.sha = web_latex(BSDsha) + " (rounded)"
except AttributeError:
self.sha = "not available"

# Check analytic Sha value compatible with formula in the knowl (see issue #5409)

BSDrootdisc = RR(K.discriminant().abs()).sqrt()
BSDok = True
if BSDLvalue and BSDsha and BSDReg and (self.rank is not None):
BSDsha_numerator = BSDrootdisc * BSDntors**2
BSDsha_denominator = BSDReg * BSDomega * BSDprodcp
BSDsha_from_formula = BSDLvalue * BSDsha_numerator / BSDsha_denominator
BSDsha_from_formula_rounded = BSDsha_from_formula.round()
BSDok = (BSDsha_from_formula_rounded == BSDsha) and ((BSDsha_from_formula_rounded -BSDsha_from_formula).abs() < 0.001)
#print(f"{BSDsha_from_formula=}")
#print(f"{BSDsha_from_formula_rounded=}")
#print(f"{BSDsha=}")
#print(f"{BSDok=}")
if not BSDok:
# this means that we doubled BSDomega when we should
# not have, so BSDsha_denominator is doubled and
# BSDsha_from formula is halved
print(f"BSD normalization: adjusting Omega for {self.label}: stored Sha = {BSDsha} but formula gives {BSDsha_from_formula}")
BSDok = ((BSDsha/BSDsha_from_formula)-2).abs() < 0.01
if not BSDok:
print(f"BSD normalization issue with {self.label}: stored Sha = {BSDsha} but formula gives {BSDsha_from_formula}")
BSDomega /= 2
BSDsha_denominator /= 2
BSDsha_from_formula *= 2
BSDsha_from_formula_rounded = BSDsha_from_formula.round()
BSDLvalue_from_formula = BSDsha * BSDsha_denominator / BSDsha_numerator
self.BSDsha = web_latex(BSDsha_from_formula)
self.BSDLvalue = web_latex(BSDLvalue_from_formula)

# The BSD formula for display

dot = '\\cdot'
approx = '\\approx'
eq_query = '\\overset{?}{=}'
frac = '\\frac'
Sha = '\\# &#1064;(E/K)'
Om = '\\Omega(E/K)'
Reg = '\\mathrm{Reg}_{\\mathrm{NT}}(E/K)'
prodcp = '\\prod_{\\mathfrak{p}} c_{\\mathfrak{p}}'
tors2 = '\\#E(K)_{\\mathrm{tor}}^2'
rootD = '\\left|d_K\\right|^{1/2}'

lder_name = rf"L^{{({r})}}(E/K,1)/{r}!" if r>=2 else "L'(E/K,1)" if r else "L(E/K,1)"
lhs_num = rf'{Sha} {dot} {Om} {dot} {Reg} {dot} {prodcp}'
lhs_den = rf'{tors2} {dot} {rootD}'
lhs = rf'{frac}{{ {lhs_num} }} {{ {lhs_den} }}'
rhs_num = rf'{BSDsha} {dot} {BSDomega:0.6f} {dot} {BSDReg} {dot} {BSDprodcp}'
if r:
rhs_num = rf'{BSDsha} {dot} {BSDomega:0.6f} {dot} {BSDReg:0.6f} {dot} {BSDprodcp}'
rhs_den = rf'{{{BSDntors}^2 {dot} {BSDrootdisc:0.6f}}}'
rhs = rf'{frac}{{ {rhs_num} }} {{ {rhs_den} }}'
self.bsd_formula = rf'{BSDLvalue:0.9f} {approx} {lder_name} {eq_query} {lhs} {approx} {rhs} {approx} {BSDLvalue_from_formula:0.9f}'

else:
self.BSDsha = "not available"
self.BSDLvalue = "not available"
self.bsd_formula = None

if not BSDok: # don't display the formula if it is not correct
self.bsd_formula = None

# Local data

# The Kodaira symbol is stored as an int in pari encoding. The
Expand Down
Loading

0 comments on commit 0ce1c0a

Please sign in to comment.