Skip to content

Commit

Permalink
Merge pull request #6066 from AndrewVSutherland/main
Browse files Browse the repository at this point in the history
remove dependencies on mf_hecke_newspace_traces
  • Loading branch information
AndrewVSutherland authored May 24, 2024
2 parents 41ac367 + b2713c3 commit 4955768
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 114 deletions.
36 changes: 8 additions & 28 deletions lmfdb/classical_modular_forms/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ def index():
return dimension_space_search(info)
elif search_type == 'Traces':
return trace_search(info)
elif search_type == 'SpaceTraces':
return space_trace_search(info)
else:
flash_error("Invalid search type; if you did not enter it in the URL please report")
info["stats"] = CMF_stats()
Expand Down Expand Up @@ -486,9 +484,9 @@ def mf_data(label):
ocode = db.mf_newspaces.lookup(label, "hecke_orbit_code")
if ocode is None:
return abort(404, f"{label} not in database")
tables = ["mf_newspaces", "mf_subspaces", "mf_newspace_portraits", "mf_hecke_newspace_traces"]
labels = [label, label, label, ocode]
label_cols = ["label", "label", "label", "hecke_orbit_code"]
tables = ["mf_newspaces", "mf_newspace_portraits"]
labels = [label, label]
label_cols = ["label", "label"]
title = f"Newspace data - {label}"
elif len(slabel) == 2:
tables = ["mf_gamma1", "mf_gamma1_portraits"]
Expand Down Expand Up @@ -891,15 +889,15 @@ def newform_search(info, query):
newform_parse(info, query)
set_info_funcs(info)

def trace_postprocess(res, info, query, spaces=False):
def trace_postprocess(res, info, query):
if res:
if info.get('view_modp') == 'reductions':
q = int(info['an_modulo'])
else:
q = None
hecke_codes = [mf['hecke_orbit_code'] for mf in res]
trace_dict = defaultdict(dict)
table = db.mf_hecke_newspace_traces if spaces else db.mf_hecke_traces
table = db.mf_hecke_traces
for rec in table.search({'n':{'$in': info['Tr_n']}, 'hecke_orbit_code':{'$in':hecke_codes}}, projection=['hecke_orbit_code', 'n', 'trace_an'], sort=[]):
if q:
trace_dict[rec['hecke_orbit_code']][rec['n']] = (rec['trace_an'] % q)
Expand Down Expand Up @@ -962,22 +960,6 @@ def trace_search(info, query):
process_an_constraints(info, query)
set_info_funcs(info)

@search_wrap(template="cmf_space_trace_search_results.html",
table=db.mf_newspaces,
title='Newspace search results',
err_title='Newspace search input error',
shortcuts={'jump':jump_box,
'download':CMF_download().download_multiple_space_traces},
projection=['label', 'dim', 'hecke_orbit_code', 'weight'],
postprocess=space_trace_postprocess,
bread=get_search_bread,
learnmore=learnmore_list)
def space_trace_search(info, query):
set_Trn(info, query)
newspace_parse(info, query)
process_an_constraints(info, query)
set_info_funcs(info)

def set_rows_cols(info, query):
"""
Sets weight_list and level_list, which are the row and column headers
Expand Down Expand Up @@ -1454,8 +1436,7 @@ class CMFSearchArray(SearchArray):
_sort_forms = [(name, disp, sord + ['hecke_orbit']) for (name, disp, sord) in _sort]
sorts = {'': _sort_forms,
'Traces': _sort_forms,
'Spaces': _sort_spaces,
'SpaceTraces': _sort_spaces}
'Spaces': _sort_spaces}
jump_example="3.6.a.a"
jump_egspan="e.g. 3.6.a.a, 55.3.d or 20.5"
jump_knowl="cmf.search_input"
Expand Down Expand Up @@ -1746,7 +1727,7 @@ def main_array(self, info):
if info is None:
return self.browse_array
search_type = info.get('search_type', info.get('hst', ''))
if search_type in ['Spaces', 'SpaceTraces']:
if search_type == 'Spaces':
return self.space_array
elif search_type == 'SpaceDimensions':
return self.sd_array
Expand All @@ -1761,7 +1742,6 @@ def search_types(self, info):
('Random', 'Random form')]
spaces = [('Spaces', 'List of spaces'),
('SpaceDimensions', 'Dimension table'),
('SpaceTraces', 'Traces table'),
('RandomSpace', 'Random')]
if info is None:
return basic
Expand All @@ -1788,7 +1768,7 @@ def html(self, info=None):
# We need to override html to add the trace inputs
layout = [self.hidden_inputs(info), self.main_table(info), self.buttons(info)]
st = self._st(info)
if st in ["Traces", "SpaceTraces"]:
if st in ["Traces"]:
trace_table = self._print_table(self.traces_array, info, layout_type="box")
layout.append(trace_table)
return "\n".join(layout)
4 changes: 1 addition & 3 deletions lmfdb/classical_modular_forms/test_cmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,7 @@ def test_underlying_data(self):

data = self.tc.get('/ModularForm/GL2/Q/holomorphic/data/13.2.e').get_data(as_text=True)
assert ('mf_newspaces' in data and 'num_forms' in data
and 'mf_subspaces' in data and 'sub_mult' in data
and 'mf_newspace_portraits' in data and "data:image/png;base64" in data
and 'mf_hecke_newspace_traces' in data and 'trace_an' in data)
and 'mf_newspace_portraits' in data and "data:image/png;base64" in data)

data = self.tc.get('/ModularForm/GL2/Q/holomorphic/data/13.2.e.a').get_data(as_text=True)
assert ('mf_newforms' in data and 'field_disc_factorization' in data and
Expand Down
5 changes: 0 additions & 5 deletions lmfdb/classical_modular_forms/test_cmf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ def test_download_search(self):
for elt in ["20.5.b", "20.5.d", "20.5.f"]:
assert elt in page.get_data(as_text=True)

page = self.tc.get('/ModularForm/GL2/Q/holomorphic/?Submit=sage&download=1&query=%7B%27dim%27%3A+%7B%27%24gte%27%3A+2000%7D%2C+%27num_forms%27%3A+%7B%27%24exists%27%3A+True%7D%7D&search_type=SpaceTraces', follow_redirects=True)
assert 'Error: We limit downloads of traces to' in page.get_data(as_text=True)
page = self.tc.get('/ModularForm/GL2/Q/holomorphic/?Submit=sage&download=1&query=%7B%27dim%27%3A+%7B%27%24gte%27%3A+30000%2C%27%24lte%27%3A30600%7D%2C%27num_forms%27%3A+%7B%27%24exists%27%3A+True%7D%7D&search_type=SpaceTraces', follow_redirects=True)
assert '863.2.c' in page.get_data(as_text=True)

def test_random(self):
r"""
Test that we don't hit any error on a random newform
Expand Down
8 changes: 0 additions & 8 deletions lmfdb/verify/mf/mf_hecke_newspace_traces.py

This file was deleted.

29 changes: 1 addition & 28 deletions lmfdb/verify/mf/mf_newspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from lmfdb.lmfdb_database import db, SQL
from .mf import MfChecker, check_analytic_conductor
from ..verification import overall, overall_long, fast, slow, accumulate_failures
from ..verification import overall, fast, slow, accumulate_failures


@cached_function
Expand Down Expand Up @@ -234,33 +234,6 @@ def check_hecke_orbit_dims_sorted(self):
# TIME about 2s
return self.check_sorted('hecke_orbit_dims')

### mf_hecke_newspace_traces ###
@overall_long
def check_traces_count(self):
"""
there should be exactly 1000 records in mf_hecke_traces for each record in mf_newspaces with traces set
"""
# TIME about 800s
return self.check_crosstable_count('mf_hecke_newspace_traces', 1000, 'hecke_orbit_code', constraint={'traces':{'$exists':True}})

@overall_long
def check_traces_match(self):
"""
check that traces[n] matches trace_an in mf_hecke_newspace_traces
"""
# TIME about 1000s
return self.check_crosstable_aggregate('mf_hecke_newspace_traces', 'traces', 'hecke_orbit_code', 'trace_an', sort=['n'], truncate=1000, constraint={'traces':{'$exists':True}})

### mf_subspaces ###
@overall
def check_oldspace_decomposition_totaldim(self):
"""
check that summing sub_dim * sub_mult over rows with a given label gives dim of S_k^old(N,chi)
"""
# TIME about 20s
# from mf_subspaces
return self.check_crosstable_dotprod('mf_subspaces', 'cusp_dim', 'label', ['sub_mult', 'sub_dim'])

### mf_newspace_portraits ###
@overall
def check_portraits_count(self):
Expand Down
41 changes: 0 additions & 41 deletions lmfdb/verify/mf/mf_subspaces.py

This file was deleted.

1 change: 0 additions & 1 deletion lmfdb/verify/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ def check_crosstable_dotprod(self, other_table, col1, join1, col2, join2=None, c
"""
Check that col1 is the sum of the product of the values in the columns of col2 over rows of other_table with self.table.join1 = other_table.join2.
There are some peculiarities of this method, resulting from its application to mf_subspaces.
col1 is allowed to be a pair, in which case the difference col1[0] - col1[1] will be compared.
col2 does not take value col1 as a default, since they are playing different roles.
Expand Down

0 comments on commit 4955768

Please sign in to comment.