From 82df9a5393c2b9fa7b623bff622bbc3cd245777d Mon Sep 17 00:00:00 2001 From: AndrewVSutherland Date: Sun, 26 Nov 2023 03:06:43 -0500 Subject: [PATCH 1/2] modcurve changes to handle missing decompositions --- lmfdb/modular_curves/templates/modcurve.html | 34 ++++++++++++++++---- lmfdb/modular_curves/web_curve.py | 11 +++++-- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/lmfdb/modular_curves/templates/modcurve.html b/lmfdb/modular_curves/templates/modcurve.html index 031f818af7..7c7c9fcd34 100644 --- a/lmfdb/modular_curves/templates/modcurve.html +++ b/lmfdb/modular_curves/templates/modcurve.html @@ -14,7 +14,7 @@

{{ KNOWL('modcurve.invariants', 'Invariants') }}

{{ KNOWL("modcurve.cusps", "Cusps") }}: {{ curve.cusps_display }}{{ KNOWL("modcurve.cusp_widths", "Cusp widths") }}{{ curve.cusp_widths_display }}{{ KNOWL("modcurve.cusp_orbits", "Cusp orbits") }}{{ curve.cusp_orbits_display }} {{ KNOWL("modcurve.elliptic_points", "Elliptic points") }}: ${{curve.nu2}}$ of order $2$ and ${{curve.nu3}}$ of order $3$ {% if curve.genus > 0 %} - {{ KNOWL('modcurve.rank', 'Analytic rank') }}: ${{ curve.rank }}$ + {{ KNOWL('modcurve.rank', 'Analytic rank') }}: {% if curve.rank is not none %} ${{ curve.rank }}$ {% else %} not computed {% endif %} {% endif %} {{ KNOWL("modcurve.gonality", "$\Q$-gonality")}}: ${{ curve.q_gonality if curve.q_gonality else "%s \\le \\gamma \\le %s"%(curve.q_gonality_bounds[0],curve.q_gonality_bounds[1]) }}$ {{ KNOWL("modcurve.gonality", "$\overline{\Q}$-gonality")}}: ${{ curve.qbar_gonality if curve.qbar_gonality else "%s \\le \\gamma \\le %s"%(curve.qbar_gonality_bounds[0],curve.qbar_gonality_bounds[1]) }}$ @@ -62,11 +62,25 @@

{{ KNOWL('modcurve.level_structure', 'Level structure') }}

{% endif %} -{% if curve.genus > 0 %} +{% if curve.genus > 0 and curve.dims is not none %}

{{ KNOWL('ag.jacobian', 'Jacobian') }}

+ + + + @@ -365,7 +381,7 @@

Cover information

- {% if curve.genus > 0 %} + {% if curve.dims %} {% endif %} @@ -379,11 +395,13 @@

Cover information

+ {% if curve.dims %} {% if genus > 0 %} {% elif curve.genus > 0 %} {% endif %} + {% endif %} {% endfor %} @@ -401,7 +419,7 @@

Cover information

- {% if curve.genus > 0 %} + {% if curve.dims %} {% endif %} @@ -415,11 +433,13 @@

Cover information

+ {% if curve.dims %} {% if genus > 0 %} {% elif curve.genus > 0 %} {% endif %} + {% endif %} {% endfor %} @@ -436,8 +456,8 @@

Cover information

+ {% if curve.dims %} - {% if curve.genus > 0 %} {% endif %} @@ -450,8 +470,8 @@

Cover information

+ {% if curve.dims %} - {% if curve.genus > 0 %} {% endif %} diff --git a/lmfdb/modular_curves/web_curve.py b/lmfdb/modular_curves/web_curve.py index d7a342b84f..9f92e8107a 100644 --- a/lmfdb/modular_curves/web_curve.py +++ b/lmfdb/modular_curves/web_curve.py @@ -133,7 +133,7 @@ def name_to_latex(name): return f"${name}$" def factored_conductor(conductor): - return "\\cdot".join(f"{p}{showexp(e, wrap=False)}" for (p, e) in conductor) if conductor else "1" + return "\\cdot".join(f"{p}{showexp(e, wrap=False)}" for (p, e) in conductor) if conductor else ("1" if conductor == [] else r"?") def remove_leading_coeff(jfac): if "(%s)" % jfac.unit() == (str(jfac).split("*")[0]).replace(' ',''): @@ -142,6 +142,8 @@ def remove_leading_coeff(jfac): return str(jfac) def formatted_dims(dims, mults): + if dims is None: + return "not computed" if not dims: return "" # Collapse newforms with the same dimension @@ -152,6 +154,8 @@ def formatted_dims(dims, mults): return "$" + r"\cdot".join(f"{d}{showexp(c, wrap=False)}" for (d, c) in zip(dims, mults)) + "$" def formatted_newforms(newforms, mults): + if newforms is None: + return "not computed" if not newforms: return "" return ", ".join(f'{label}{showexp(c)}' for (label, c) in zip(newforms, mults)) @@ -316,7 +320,7 @@ def properties(self): ] if self.image is not None: props.append((None, self.image)) - if hasattr(self,"rank"): + if hasattr(self,"rank") and self.rank is not None: props.append(("Analytic rank", str(self.rank))) props.extend([("Cusps", str(self.cusps)), (r"$\Q$-cusps", str(self.rational_cusps))]) @@ -637,7 +641,8 @@ def _curvedata(self, query, flip=False): C["index"] // self.index if flip else self.index // C["index"], # relative index C["psl2index"] // self.psl2index if flip else self.psl2index // C["psl2index"], # relative degree C["genus"], - "" if C["rank"] is None else C["rank"], + "?" if C["rank"] is None else C["rank"], + "not computed" if C["dims"] is None or self.dims is None else (formatted_dims(*difference(C["dims"], self.dims, C["mults"], self.mults)) if flip else formatted_dims(*difference(self.dims, C["dims"], From 727b01473b8f2afbc2450fbb750258dcc4549b1e Mon Sep 17 00:00:00 2001 From: roed314 Date: Sun, 26 Nov 2023 13:20:34 -0500 Subject: [PATCH 2/2] Update web_curve.py Deal with missing trace hash in friends list. --- lmfdb/modular_curves/web_curve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmfdb/modular_curves/web_curve.py b/lmfdb/modular_curves/web_curve.py index 9f92e8107a..d6696a969e 100644 --- a/lmfdb/modular_curves/web_curve.py +++ b/lmfdb/modular_curves/web_curve.py @@ -350,7 +350,7 @@ def friends(self): friends.append(("L-function", "/L" + url_for_mf_label(self.newforms[0]))) else: friends.append(("L-function not available","")) - if self.genus > 0: + if self.genus > 0 and self.trace_hash is not None: for r in self.table.search({'trace_hash':self.trace_hash},['label','name','newforms']): if r['newforms'] == self.newforms and r['label'] != self.label: friends.append(("Modular curve " + (r['name'] if r['name'] else r['label']),url_for("modcurve.by_label", label=r['label'])))
{{ KNOWL('ag.conductor', 'Conductor') }}: ${{ curve.factored_conductor }}$
+ {{ KNOWL('av.simple', 'Simple') }}: + + {% if curve.simple %} + yes + {% elif curve.simple is not none %} + no + {% else %} + not computed + {% endif %} +
{{ KNOWL('av.squarefree', 'Squarefree') }}: @@ -74,8 +88,10 @@

{{ KNOWL('ag.jacobian', 'Jacobian') }}

{% if curve.squarefree %} yes - {% else %} + {% elif curve.squarefree is not none %} no + {% else %} + not computed {% endif %}
{{ KNOWL('modcurve.modular_cover','Degree') }} {{ KNOWL('modcurve.genus','Genus') }} {{ KNOWL('modcurve.rank','Rank') }}{{ KNOWL('modcurve.modular_cover','Kernel decomposition') }}
${{ degree }}$ ${{ genus }}$ ${{ rank }}${{ kernel if kernel else "dimension zero" | safe }}full Jacobian
{{ KNOWL('modcurve.modular_cover','Degree') }} {{ KNOWL('modcurve.genus','Genus') }} {{ KNOWL('modcurve.rank','Rank') }}{{ KNOWL('modcurve.modular_cover','Kernel decomposition') }}
${{ degree }}$ ${{ genus }}$ ${{ rank }}${{ kernel if kernel else "dimension zero" | safe }}full Jacobian
{{ KNOWL('modcurve.relative_index', 'Index') }} {{ KNOWL('modcurve.modular_cover','Degree') }} {{ KNOWL('modcurve.genus','Genus') }}{{ KNOWL('modcurve.rank','Rank') }}{{ KNOWL('modcurve.modular_cover','Kernel decomposition') }}
${{ index }}$ ${{ degree }}$ ${{ genus }}$${{ rank }}${{ kernel if kernel else "dimension zero" | safe }}