Skip to content

Commit

Permalink
Merge pull request #6285 from fchapoton/fixes_for_E221
Browse files Browse the repository at this point in the history
some fixes for E221
  • Loading branch information
edgarcosta authored Dec 3, 2024
2 parents 55bf75b + 0f46df1 commit d014fdf
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 42 deletions.
10 changes: 5 additions & 5 deletions lmfdb/bianchi_modular_forms/bianchi_modular_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def download_bmf_magma(**args):
except ValueError:
return "Bianchi newform not found"

hecke_pol = f.hecke_poly_obj
hecke_pol = f.hecke_poly_obj
hecke_eigs = f.hecke_eigs

F = WebNumberField(f.field_label)
Expand Down Expand Up @@ -452,7 +452,7 @@ def download_bmf_magma(**args):
outstr += 'for i in [1..#heckeEigenvaluesList] do\n heckeEigenvalues[primes[i]] := heckeEigenvaluesList[i];\nend for;\n'

if f.have_AL:
AL_eigs = f.AL_table_data
AL_eigs = f.AL_table_data
outstr += '\nALEigenvalues := AssociativeArray();\n'
for s in AL_eigs:
outstr += 'ALEigenvalues[ideal<ZF | {}>] := {};\n'.format(set(s[0]), s[1])
Expand Down Expand Up @@ -540,7 +540,7 @@ def download_bmf_sage(**args):
except ValueError:
return "Bianchi newform not found"

hecke_pol = f.hecke_poly_obj
hecke_pol = f.hecke_poly_obj
hecke_eigs = f.hecke_eigs

F = WebNumberField(f.field_label)
Expand Down Expand Up @@ -580,10 +580,10 @@ def download_bmf_sage(**args):
outstr += 'for i in range(len(hecke_eigenvalues_array)):\n hecke_eigenvalues[primes[i]] = hecke_eigenvalues_array[i]\n\n'

if f.have_AL:
AL_eigs = f.AL_table_data
AL_eigs = f.AL_table_data
outstr += 'AL_eigenvalues = {}\n'
for s in AL_eigs:
outstr += 'AL_eigenvalues[ZF.ideal(%s)] = %s\n' % (s[0],s[1])
outstr += 'AL_eigenvalues[ZF.ideal(%s)] = %s\n' % (s[0], s[1])
else:
outstr += 'AL_eigenvalues ="not known"\n'

Expand Down
4 changes: 2 additions & 2 deletions lmfdb/characters/web_character.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def to_dict(self):
d = {}
logger.info('[DC] start collecting data for %s' % self.__class__.__name__)
for k in self._keys:
d[k] = getattr(self,k,None)
d[k] = getattr(self, k, None)
if d[k] is None:
logger.debug('[DC warning] ### key[%s] is None' % k)
logger.info('[DC] collected for %s' % self.__class__.__name__)
Expand All @@ -121,7 +121,7 @@ def texlogvalue(x, tag=False):
if not isinstance(x, Rational):
return '1'
d = int(x.denom())
n = int(x.numer()) % d
n = int(x.numer()) % d
if d == 1:
s = '1'
elif n == 1 and d == 2:
Expand Down
3 changes: 2 additions & 1 deletion lmfdb/classical_modular_forms/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,13 @@ def newform_parse(info, query):
parse_noop(info, query, 'projective_image', func=str.upper)
parse_ints(info, query, 'artin_degree', name="Artin degree")


def newspace_parse(info, query):
for key, display in newform_only_fields.items():
if key in info:
msg = "%s not valid when searching for spaces"
flash_error(msg, display)
raise ValueError(msg % display)
raise ValueError(msg % display)
if 'dim' not in info and 'hst' not in info:
# When coming from browse page, add dim condition to only show non-empty spaces
info['dim'] = '1-'
Expand Down
6 changes: 3 additions & 3 deletions lmfdb/ecnf/WebEllipticCurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def make_E(self):
self.fact_disc = self.disc
self.fact_disc_norm = str(Dnorm)
else:
self.fact_disc = latex_factorization(badprimes, disc_ords)
self.fact_disc = latex_factorization(badprimes, disc_ords)
self.fact_disc_norm = latex_factorization(badnorms, disc_ords, sign=signDnorm)

if self.is_minimal:
Expand All @@ -411,10 +411,10 @@ def make_E(self):

self.mindisc_norm = web_latex(Dmin_norm)
if Dmin_norm in [1,-1]: # since the factorization of (1) displays as "1"
self.fact_mindisc = self.mindisc
self.fact_mindisc = self.mindisc
self.fact_mindisc_norm = self.mindisc_norm
else:
self.fact_mindisc = latex_factorization(badprimes, mindisc_ords)
self.fact_mindisc = latex_factorization(badprimes, mindisc_ords)
self.fact_mindisc_norm = latex_factorization(badnorms, mindisc_ords, sign=signDnorm)

j = self.field.parse_NFelt(self.jinv)
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/elliptic_curves/isog_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def make_class(self):
# changing one line in this file (defining OPTIMALITY_BOUND)
# without changing the data.

self.cremona_bound = CREMONA_BOUND
self.cremona_bound = CREMONA_BOUND
self.optimality_bound = OPTIMALITY_BOUND
self.optimality_known = (self.conductor < OPTIMALITY_BOUND) or ((self.conductor < CREMONA_BOUND) and ((self.optimality == 1) or (self.Ciso == '990h')))
self.optimal_label = self.Clabel if self.label_type == 'Cremona' else self.lmfdb_label
Expand Down
14 changes: 7 additions & 7 deletions lmfdb/elliptic_curves/web_ec.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
CP_URL_PREFIX = "https://mathstats.uncg.edu/sites/pauli/congruence/" # Needs tto be changed whenever Cummins and Pauli move their data

OPTIMALITY_BOUND = 400000 # optimality of curve no. 1 in class (except class 990h) only proved in all cases for conductor less than this
CREMONA_BOUND = 500000 # above this bound we have nor Cremona labels (no Clabel, Ciso, Cnumber), no Manin constant or optimality info.
CREMONA_BOUND = 500000 # above this bound we have nor Cremona labels (no Clabel, Ciso, Cnumber), no Manin constant or optimality info.

cremona_label_regex = re.compile(r'(\d+)([a-z]+)(\d*)')
lmfdb_label_regex = re.compile(r'(\d+)\.([a-z]+)(\d*)')
Expand Down Expand Up @@ -438,7 +438,7 @@ def red(p):
# Isogeny degrees:

cond, iso, num = split_lmfdb_label(lmfdb_label)
self.class_deg = classdata['class_deg']
self.class_deg = classdata['class_deg']
self.one_deg = ZZ(self.class_deg).is_prime()
isodegs = [str(d) for d in self.isogeny_degrees if d > 1]
if len(isodegs) < 3:
Expand Down Expand Up @@ -625,16 +625,16 @@ def make_mwbsd(self):

try:
mwbsd['rank'] = self.rank
mwbsd['reg'] = self.regulator
mwbsd['sha'] = self.sha
mwbsd['reg'] = self.regulator
mwbsd['sha'] = self.sha
mwbsd['sha2'] = latex_sha(self.sha)
mwbsd['sha_is_exact'] = self.rank == 0 # see Issue #5872
for num in ['reg', 'special_value', 'real_period', 'area']:
mwbsd[num] = RR(mwbsd[num])
mwbsd[num] = RR(mwbsd[num])
except AttributeError:
mwbsd['rank'] = '?'
mwbsd['reg'] = '?'
mwbsd['sha'] = '?'
mwbsd['reg'] = '?'
mwbsd['sha'] = '?'
mwbsd['sha2'] = '?'
mwbsd['regsha'] = ( mwbsd['special_value'] * self.torsion**2 ) / ( mwbsd['tamagawa_product'] * mwbsd['real_period'] )
if r <= 1:
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/groups/abstract/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_small_gps(sample_gp):
if sample_gp['number_subgroup_classes']:
SubLat = libgap.LatticeSubgroups(G)
Cons = libgap.ConjugacyClassesSubgroups(SubLat)
print ("Number of subgroup classes match: " + str(libgap.Size(Cons) == sample_gp['number_subgroup_classes']))
print("Number of subgroup classes match: " + str(libgap.Size(Cons) == sample_gp['number_subgroup_classes']))
if sample_gp['number_normal_subgroups']:
NormLat = libgap.NormalSubgroups(G)
print("Number of normal subgroups match: " + str(libgap.Size(NormLat) == sample_gp['number_normal_subgroups']))
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/groups/abstract/web_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,7 @@ def print_elt(vec):
if j == u:
if e == 1:
if first_pass:
s = var_name(i) + s
s = var_name(i) + s
first_pass = False
else:
s = var_name(i) + '*' + s
Expand Down
3 changes: 2 additions & 1 deletion lmfdb/groups/glnQ/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def group_search(info, query):
parse_ints(info, query, 'order', 'order')
parse_ints(info, query, 'dim', 'dim')


#Writes individual pages
def render_glnQ_group(args):
info = {}
Expand All @@ -141,7 +142,7 @@ def render_glnQ_group(args):
info['groupname'] = '${}$'.format(group_names_pretty(info['group']))
info['groupknowl'] = abstract_group_display_knowl(info['group'], info['groupname'])

title = r'$\GL('+str(info['dim'])+r',\Q)$ subgroup ' + label
title = r'$\GL('+str(info['dim']) + r',\Q)$ subgroup ' + label

prop = [('Label', '%s' % label),
('Order', r'\(%s\)' % info['order']),
Expand Down
14 changes: 7 additions & 7 deletions lmfdb/hilbert_modular_forms/hilbert_modular_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ def download_hmf_magma(**args):
F = WebNumberField(f['field_label'])
F_hmf = get_hmf_field(f['field_label'])

hecke_pol = f['hecke_polynomial']
hecke_pol = f['hecke_polynomial']
hecke_eigs = [str(eig) for eig in f['hecke_eigenvalues']]
AL_eigs = f['AL_eigenvalues']
AL_eigs = f['AL_eigenvalues']

outstr = '/*\n This code can be loaded, or copied and pasted, into Magma.\n'
outstr += ' It will load the data associated to the HMF, including\n'
Expand Down Expand Up @@ -326,9 +326,9 @@ def download_hmf_sage(**args):
if f is None:
return "No such form"

hecke_pol = f['hecke_polynomial']
hecke_pol = f['hecke_polynomial']
hecke_eigs = [str(eig) for eig in f['hecke_eigenvalues']]
AL_eigs = f['AL_eigenvalues']
AL_eigs = f['AL_eigenvalues']

F = WebNumberField(f['field_label'])
F_hmf = get_hmf_field(f['field_label'])
Expand Down Expand Up @@ -446,10 +446,10 @@ def render_hmf_webpage(**args):
numeigs = 20
info['numeigs'] = numeigs

hecke_pol = data['hecke_polynomial']
eigs = [str(eig) for eig in data['hecke_eigenvalues']]
hecke_pol = data['hecke_polynomial']
eigs = [str(eig) for eig in data['hecke_eigenvalues']]
eigs = eigs[:min(len(eigs), numeigs)]
AL_eigs = data['AL_eigenvalues']
AL_eigs = data['AL_eigenvalues']

primes = hmf_field['primes']
n = min(len(eigs), len(primes))
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/hilbert_modular_forms/hmf_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def degree_summary(self, d):
def counts(self):
counts = {}

counts['nforms'] = self.nforms
counts['nforms_c'] = comma(self.nforms)
counts['nforms'] = self.nforms
counts['nforms_c'] = comma(self.nforms)

attrs = ["degree", "discriminant", "label"]
fields = list(db.hmf_fields.search({}, attrs, sort=attrs))
Expand Down
9 changes: 5 additions & 4 deletions lmfdb/lfunctions/Lfunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def convert_coefficient(an, base_power_int):
res = -I, -I
else:
# an = e^(2 pi i an_power_int / this_base_power_int)
arithmetic = r" $e\left(\frac{" + str(an_power_int) + "}{" + str(this_base_power_int) + r"}\right)$"
arithmetic = r" $e\left(\frac{" + str(an_power_int) + "}{" + str(this_base_power_int) + r"}\right)$"
#exp(2*pi*I*QQ(an_power_int)/ZZ(this_base_power_int)).n()
analytic = (2*CBF(an_power_int)/this_base_power_int).exppii()
# round half integers
Expand Down Expand Up @@ -497,7 +497,7 @@ def bread(self):
_, conductor, character, cr, imag, index = self.label.split('-')
spectral_label = cr + '-' + imag
degree = self.degree
conductor = conductor.replace('e', '^')
conductor = conductor.replace('e', '^')
bread = [('L-functions', url_for('.index'))]
if self.rational:
bread.append(('Rational', url_for('.rational')))
Expand Down Expand Up @@ -596,10 +596,11 @@ def download_url(self):

def download_euler_factors(self):
filename = self.label
data = {}
data = {}
data['bad_lfactors'] = self.bad_lfactors
ps = primes_first_n(len(self.localfactors))
data['first_lfactors'] = [ [ps[i], l] for i, l in enumerate(self.localfactors)]
data['first_lfactors'] = [[ps[i], l]
for i, l in enumerate(self.localfactors)]
return Downloader()._wrap(Json.dumps(data),
filename + '.euler_factors',
lang='text',
Expand Down
5 changes: 3 additions & 2 deletions lmfdb/modlmf/modlmf_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def modlmf_summary():
def ctx_modlmf_summary():
return {'modlmf_summary': modlmf_summary}


class modlmf_stats():
"""
Class for creating and displaying statistics for integral modlmfs
Expand All @@ -34,8 +35,8 @@ def counts(self):
logger.debug("Computing modlmf counts...")
counts = {}
nmodlmf = db.modlmf_forms.count()
counts['nmodlmf'] = nmodlmf
counts['nmodlmf_c'] = comma(nmodlmf)
counts['nmodlmf'] = nmodlmf
counts['nmodlmf_c'] = comma(nmodlmf)
max_level = db.modlmf_forms.max('level')
counts['max_level'] = max_level
counts['max_level_c'] = comma(max_level)
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/utils/names_and_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def name_and_object_from_url(url, check_existence=False):

elif url_split[0] == "ModularForm":
if url_split[1] == 'GL2':
if url_split[2] == 'Q' and url_split[3] == 'holomorphic':
if url_split[2] == 'Q' and url_split[3] == 'holomorphic':
if len(url_split) == 10:
# ModularForm/GL2/Q/holomorphic/24/2/f/a/11/2
newform_label = ".".join(url_split[-6:-2])
Expand Down
4 changes: 3 additions & 1 deletion lmfdb/utils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,10 @@ def str_to_CBF(s):
if a:
res += CBF(a)
if b:
res += sign * CBF(b) * CBF.gens()[0]
res += sign * CBF(b) * CBF.gens()[0]
return res


# Conversion from numbers to letters and back
def letters2num(s):
r"""
Expand All @@ -386,6 +387,7 @@ def letters2num(s):
ssum = ssum*26+letters[j]
return ssum


def num2letters(n):
r"""
Convert a number into a string of letters
Expand Down
7 changes: 4 additions & 3 deletions lmfdb/utils/web_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,16 +790,17 @@ def sparse_cyclotomic_to_latex(n, dat):
# Now the coefficient

if p[0] == 1:
ans += '+' + zpart
ans += '+' + zpart
elif p[0] == -1:
ans += '-' + zpart
ans += '-' + zpart
else:
ans += '{:+d}'.format(p[0]) + zpart
ans += '{:+d}'.format(p[0]) + zpart
ans = ans.lstrip("+")
if ans == '':
return '0'
return ans


def sparse_cyclotomic_to_mathml(n, dat):
r"""
Take an element of Q(zeta_n) given in the form [[c1,e1],[c2,e2],...]
Expand Down

0 comments on commit d014fdf

Please sign in to comment.