Skip to content

Commit

Permalink
modifying display of q-expansions to always have 100 coefficients, co…
Browse files Browse the repository at this point in the history
…mpressed as normal, also in space pages, removing the script show_qexp
  • Loading branch information
assaferan committed Nov 20, 2024
1 parent d56cfaf commit 343e087
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,9 @@ <h2 id="qexp-anchor"> {{ KNOWL('cmf.space_trace_form', title='Trace form') }} </
<form>
<table class="qexp-table">
<tr>
<td class="qexp-output smalloutput">{{ space.trace_expansion(prec_max=10) | safe }}</td>
<td class="qexp-output mediumoutput nodisplay">{{ space.trace_expansion(prec_max=100) | safe }}</td>
<td class="qexp-output mediumoutput">{{ space.trace_expansion(prec_max=100) | safe }}</td>
</tr>
</table>
<p>
<div class="toggle">Display
<span class='smalloutput'><a onclick="show_qexp('mediumoutput'); return false;" href='#'>100 coefficients</a></span>
<span class='mediumoutput nodisplay'><a onclick="return show_qexp('smalloutput');" href='#qexp-anchor'>10 coefficients</a></span>
</div>
</p>
</form>
</div>
{% endif %}
Expand Down
22 changes: 1 addition & 21 deletions lmfdb/classical_modular_forms/templates/cmf_newform_common.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,6 @@ <h2> Embedding invariants </h2>
</table>
{% endif %}

<script>
function show_qexp(qstyle) {
$('.smalloutput').hide();
$('.mediumoutput').hide();
$('.'+qstyle).show();
var elementBottom = $('#qexp-anchor').offset().top + $('#qexp-anchor').outerHeight();
var viewportTop = $(window).scrollTop();
return elementBottom < viewportTop;
}
</script>
{% if newform.has_exact_qexp or (newform.embedding_label and newform.has_complex_qexp) %}

<h2 id="qexp-anchor"> {{ KNOWL('cmf.q-expansion',title='$q$-expansion')}}</h2>
Expand Down Expand Up @@ -242,19 +232,9 @@ <h2> {{ KNOWL('cmf.q-expansion',title='$q$-expansion')}}</h2>

<form id="qexp">
<table><tr><td>
<div class="smalloutput">
<span>\(\operatorname{Tr}(f)(q) = \) {{ newform.trace_expansion(prec_max=10) | safe }}</span>
</div>
<div class="mediumoutput nodisplay">
<div class="mediumoutput">
<span>\(\operatorname{Tr}(f)(q) = \) {{ newform.trace_expansion(prec_max=100) | safe }}</span>
</div></td></tr></table>

<p style="padding-left: 1ch;">
<div class="toggle">Display
<span class='smalloutput'><a onclick="show_qexp('mediumoutput'); return false" href='#'>100 coefficients</a></span>
<span class='mediumoutput nodisplay'><a onclick="show_qexp('smalloutput'); return false" href='#'>10 coefficients</a></span>
</div>
</p>
</form>
{% endif %}

Expand Down
19 changes: 1 addition & 18 deletions lmfdb/classical_modular_forms/templates/cmf_space.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,14 @@ <h2> Dimensions </h2>

{% if space.dim > 0 %}
{% if space.has_trace_form %}
<script>
function show_qexp(qstyle) {
$('.smalloutput').hide();
$('.mediumoutput').hide();
$('.'+qstyle).show();
var elementBottom = $('#qexp-anchor').offset().top + $('#qexp-anchor').outerHeight();
var viewportTop = $(window).scrollTop();
return elementBottom < viewportTop;
}
</script>
<h2 id="qexp-anchor"> {{ KNOWL('cmf.space_trace_form', title='Trace form') }} </h2>
<div id="qexp">
<form>
<table class="qexp-table">
<tr>
<td class="qexp-output smalloutput">{{ space.trace_expansion(prec_max=10) | safe }}</td>
<td class="qexp-output mediumoutput nodisplay">{{ space.trace_expansion(prec_max=100) | safe }}</td>
<td class="qexp-output mediumoutput">{{ space.trace_expansion(prec_max=100) | safe }}</td>
</tr>
</table>
<p>
<div class="toggle">Display
<span class='smalloutput'><a onclick="show_qexp('mediumoutput'); return false;" href='#'>100 coefficients</a></span>
<span class='mediumoutput nodisplay'><a onclick="return show_qexp('smalloutput');" href='#qexp-anchor'>10 coefficients</a></span>
</div>
</p>
</form>
</div>
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions lmfdb/classical_modular_forms/web_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from lmfdb.number_fields.web_number_field import nf_display_knowl, cyclolookup, rcyclolookup
from lmfdb.characters.TinyConrey import ConreyCharacter
from lmfdb.utils import (
display_knowl, web_latex, coeff_to_power_series,
display_knowl, web_latex, coeff_to_power_series, raw_typeset_qexp,
web_latex_factored_integer, prop_int_pretty)
from flask import url_for
import re
Expand Down Expand Up @@ -156,7 +156,8 @@ def convert_spacelabel_from_conrey(spacelabel_conrey):

def trace_expansion_generic(space, prec_max=10):
prec = min(len(space.traces)+1, prec_max)
return web_latex(coeff_to_power_series([0] + space.traces[:prec-1],prec=prec),enclose=True)
return raw_typeset_qexp([0] + space.traces[:prec-1])
# return web_latex(coeff_to_power_series([0] + space.traces[:prec-1],prec=prec),enclose=True)


class DimGrid():
Expand Down

0 comments on commit 343e087

Please sign in to comment.