@@ -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
0 commit comments