Skip to content

Commit 96e17b9

Browse files
committed
ECNF: BSD formula tweaks, no display or error when not all data available
1 parent 75f8cbc commit 96e17b9

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

lmfdb/ecnf/WebEllipticCurve.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -639,38 +639,43 @@ def make_E(self):
639639
# Check analytic Sha value compatible with formula in the knowl (see issue #5409)
640640

641641
BSDrootdisc = RR(K.discriminant().abs()).sqrt()
642-
if BSDLvalue and BSDsha and BSDReg and BSDsha:
642+
if BSDLvalue and BSDsha and BSDReg and (self.rank is not None):
643643
BSDsha_numerator = BSDrootdisc * BSDntors**2
644644
BSDsha_denominator = BSDReg * BSDomega * BSDprodcp
645645
BSDsha_from_formula = BSDLvalue * BSDsha_numerator / BSDsha_denominator
646646
BSDLvalue_from_formula = BSDsha * BSDsha_denominator / BSDsha_numerator
647647
self.BSDsha = web_latex(BSDsha_from_formula)
648648
self.BSDLvalue = web_latex(BSDLvalue_from_formula)
649+
650+
# The BSD formula for display
651+
652+
dot = '\\cdot'
653+
approx = '\\approx'
654+
frac = '\\frac'
655+
Sha = '\\# Ш(E/K)'
656+
Om = '\\Omega(E/K)'
657+
Reg = '\\mathrm{Reg}_{\\mathrm{NT}}(E/K)'
658+
prodcp = '\\prod_{\\mathfrak{p}} c_{\\mathfrak{p}}'
659+
tors2 = '\\#E(K)_{\\mathrm{tor}}^2'
660+
rootD = '\\left|d_K\\right|^{1/2}'
661+
662+
lder_name = rf"L^{{({r})}}(E/K,1)/{r}!" if r>=2 else "L'(E/K,1)" if r else "L(E/K,1)"
663+
lhs_num = rf'{Sha} {dot} {Om} {dot} {Reg} {dot} {prodcp}'
664+
lhs_den = rf'{tors2} {dot} {rootD}'
665+
lhs = rf'{frac}{{ {lhs_num} }} {{ {lhs_den} }}'
666+
rhs_num = rf'{BSDsha} {dot} {BSDomega:0.6f} {dot} {BSDReg} {dot} {BSDprodcp}'
667+
if r:
668+
rhs_num = rf'{BSDsha} {dot} {BSDomega:0.6f} {dot} {BSDReg:0.6f} {dot} {BSDprodcp}'
669+
rhs_den = rf'{{{BSDntors}^2 {dot} {BSDrootdisc:0.6f}}}'
670+
rhs = rf'{frac}{{ {rhs_num} }} {{ {rhs_den} }}'
671+
self.bsd_formula = rf'{BSDLvalue:0.9f} {approx} {lder_name} = {lhs} {approx} {rhs} {approx} {BSDLvalue_from_formula:0.9f}'
672+
649673
else:
650674
self.BSDsha = "not available"
651675
self.BSDLvalue = "not available"
676+
self.bsd_formula = None
652677

653-
# The BSD formula for display
654-
655-
dot = '\\cdot'
656-
approx = '\\approx'
657-
frac = '\\frac'
658-
Sha = '\\# Ш(E/K)'
659-
Om = '\\Omega(E/K)'
660-
Reg = '\\mathrm{Reg}_{\\mathrm{NT}}(E/K)'
661-
prodcp = '\\prod_{\\mathfrak{p}} c_{\\mathfrak{p}}'
662-
tors2 = '\\#E(K)_{\\mathrm{tor}}^2'
663-
rootD = '\\left|D_K\\right|'
664-
665-
lder_name = rf"L^{({r})}(E,1)/{r}!" if r>=2 else "L'(E,1)" if r else "L(E,1)"
666-
lhs_num = rf'{Sha} {dot} {Om} {dot} {Reg} {dot} {prodcp}'
667-
lhs_den = rf'{tors2} {dot} {rootD}'
668-
lhs = rf'{frac}{{ {lhs_num} }} {{ {lhs_den} }}'
669-
rhs_num = rf'{BSDsha} {dot} {BSDomega:0.6f} {dot} {BSDReg:0.6f} {dot} {BSDprodcp}'
670-
rhs_den = rf'{{{BSDntors}^2 {dot} {BSDrootdisc:0.6f}}}'
671-
rhs = rf'{frac}{{ {rhs_num} }} {{ {rhs_den} }}'
672-
self.bsd_formula = rf'{BSDLvalue:0.9f} {approx} {lder_name} = {lhs} {approx} {rhs} {approx} {BSDLvalue_from_formula:0.9f}'
673-
678+
print(f"BSD: {self.bsd_formula}")
674679
# Local data
675680

676681
# The Kodaira symbol is stored as an int in pari encoding. The

lmfdb/ecnf/templates/ecnf-curve.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ <h2> {{ KNOWL('ec.bsdconjecture', title='BSD invariants') }}</h2>
274274
<tr>
275275
<td align='left'>{{ KNOWL('ec.rank', title="Mordell-Weil rank")}}:</td>
276276
{% if ec.rk == "not available" %}
277-
<td>$r$?</td>
277+
<td>$r?$</td>
278278
<td>&nbsp;</td>
279279
{% if ec.rank_bounds != "not available" %}
280280
<td>\({{ ec.rk_lb }} \le r \le {{ec.rk_ub}}\)</td>
@@ -395,6 +395,8 @@ <h2> {{ KNOWL('ec.bsdconjecture', title='BSD invariants') }}</h2>
395395
{% endif %}
396396
</div>
397397

398+
{% if ec.bsd_formula %}
399+
398400
<h2> {{ KNOWL('ec.bsdconjecture', title='BSD formula') }}</h2>
399401
<div>
400402
<p style="margin:10px 280px;">
@@ -405,6 +407,8 @@ <h2> {{ KNOWL('ec.bsdconjecture', title='BSD formula') }}</h2>
405407
</center>
406408
</div>
407409

410+
{% endif %}
411+
408412
<h2>{{KNOWL('ec.local_data', title='Local data')}} at {{KNOWL('ec.bad_reduction', title='primes of bad reduction')}} </h2>
409413
<div>
410414
{{ place_code('localdata') }}

0 commit comments

Comments
 (0)