本文整理汇总了Python中lmfdb.WebNumberField.poly方法的典型用法代码示例。如果您正苦于以下问题:Python WebNumberField.poly方法的具体用法?Python WebNumberField.poly怎么用?Python WebNumberField.poly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lmfdb.WebNumberField
的用法示例。
在下文中一共展示了WebNumberField.poly方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: render_hmf_webpage
# 需要导入模块: from lmfdb import WebNumberField [as 别名]
# 或者: from lmfdb.WebNumberField import poly [as 别名]
def render_hmf_webpage(**args):
C = getDBConnection()
data = None
if "label" in args:
label = str(args["label"])
data = C.hmfs.forms.find_one({"label": label})
if data is None:
return "No such field"
info = {}
try:
info["count"] = args["count"]
except KeyError:
info["count"] = 10
try:
numeigs = request.args["numeigs"]
numeigs = int(numeigs)
except:
numeigs = 20
hmf_field = C.hmfs.fields.find_one({"label": data["field_label"]})
nf = WebNumberField(data["field_label"])
info["base_galois_group"] = nf.galois_string()
info["field_degree"] = nf.degree()
info["field_disc"] = str(nf.disc())
info["field_poly"] = teXify_pol(str(nf.poly()))
info.update(data)
info["downloads"] = [
(
"Download to Magma",
url_for(
".render_hmf_webpage_download",
field_label=info["field_label"],
label=info["label"],
download_type="magma",
),
),
(
"Download to Sage",
url_for(
".render_hmf_webpage_download",
field_label=info["field_label"],
label=info["label"],
download_type="sage",
),
),
]
info["friends"] = []
info["friends"] = [
(
"L-function",
url_for(
"l_functions.l_function_hmf_page",
field=info["field_label"],
label=info["label"],
character="0",
number="0",
),
)
]
# info['learnmore'] = [('Number Field labels',
# url_for("render_labels_page")), ('Galois group
# labels',url_for("render_groups_page")), ('Discriminant
# ranges',url_for("render_discriminants_page"))]
bread = [("Hilbert Modular Forms", url_for(".hilbert_modular_form_render_webpage")), ("%s" % data["label"], " ")]
t = "Hilbert Cusp Form %s" % info["label"]
credit = 'Lassina Dembele, Steve Donnelly and <A HREF="http://www.cems.uvm.edu/~voight/">John Voight</A>'
forms_space = C.hmfs.forms.find({"field_label": data["field_label"], "level_ideal": data["level_ideal"]})
dim_space = 0
for v in forms_space:
dim_space += v["dimension"]
info["newspace_dimension"] = dim_space
w = polygen(QQ, "w")
e = polygen(QQ, "e")
eigs = data["hecke_eigenvalues"]
eigs = eigs[: min(len(eigs), numeigs)]
primes = hmf_field["primes"]
n = min(len(eigs), len(primes))
info["eigs"] = [
{
"eigenvalue": teXify_pol(eigs[i]),
"prime_ideal": teXify_pol(primes[i]),
"prime_norm": primes[i][1 : primes[i].index(",")],
}
for i in range(n)
]
try:
display_eigs = request.args["display_eigs"]
if display_eigs in ["True", "true", "1", "yes"]:
display_eigs = True
#.........这里部分代码省略.........
示例2: render_hmf_webpage
# 需要导入模块: from lmfdb import WebNumberField [as 别名]
# 或者: from lmfdb.WebNumberField import poly [as 别名]
def render_hmf_webpage(**args):
C = getDBConnection()
if 'data' in args:
data = args['data']
label = data['label']
else:
label = str(args['label'])
data = C.hmfs.forms.find_one({'label': label})
if data is None:
return "No such form"
info = {}
try:
info['count'] = args['count']
except KeyError:
info['count'] = 10
try:
numeigs = request.args['numeigs']
numeigs = int(numeigs)
except:
numeigs = 20
hmf_field = C.hmfs.fields.find_one({'label': data['field_label']})
gen_name = findvar(hmf_field['ideals'])
nf = WebNumberField(data['field_label'], gen_name=gen_name)
info['field'] = nf
info['base_galois_group'] = nf.galois_string()
info['field_degree'] = nf.degree()
info['field_disc'] = str(nf.disc())
info['field_poly'] = teXify_pol(str(nf.poly()))
info.update(data)
info['downloads'] = [
('Download to Magma', url_for(".render_hmf_webpage_download", field_label=info['field_label'], label=info['label'], download_type='magma')),
('Download to Sage', url_for(".render_hmf_webpage_download", field_label=info['field_label'], label=info['label'], download_type='sage'))
]
if hmf_field['narrow_class_no'] == 1:
info['friends'] = [('L-function',
url_for("l_functions.l_function_hmf_page", field=info['field_label'], label=info['label'], character='0', number='0'))]
else:
info['friends'] = [('L-function not available', "")]
if data['dimension'] == 1: # Try to attach associated elliptic curve
lab = split_class_label(info['label'])
ec_from_hmf = db_ecnf().find_one({"label": label + '1'})
if ec_from_hmf == None:
info['friends'] += [('Elliptic curve not available', "")]
else:
info['friends'] += [('Isogeny class ' + info['label'], url_for("ecnf.show_ecnf_isoclass", nf=lab[0], conductor_label=lab[1], class_label=lab[2]))]
bread = [('Hilbert Modular Forms', url_for(".hilbert_modular_form_render_webpage")), ('%s' % data[
'label'], ' ')]
t = "Hilbert Cusp Form %s" % info['label']
forms_space = C.hmfs.forms.find(
{'field_label': data['field_label'], 'level_ideal': data['level_ideal']})
dim_space = 0
for v in forms_space:
dim_space += v['dimension']
info['newspace_dimension'] = dim_space
w = polygen(QQ, 'w')
e = polygen(QQ, 'e')
eigs = data['hecke_eigenvalues']
eigs = eigs[:min(len(eigs), numeigs)]
primes = hmf_field['primes']
n = min(len(eigs), len(primes))
info['eigs'] = [{'eigenvalue': teXify_pol(eigs[i]),
'prime_ideal': teXify_pol(primes[i]),
'prime_norm': primes[i][1:primes[i].index(',')]} for i in range(n)]
try:
display_eigs = request.args['display_eigs']
if display_eigs in ['True', 'true', '1', 'yes']:
display_eigs = True
else:
display_eigs = False
except KeyError:
display_eigs = False
if 'numeigs' in request.args:
display_eigs = True
info['hecke_polynomial'] = teXify_pol(info['hecke_polynomial'])
if 'AL_eigenvalues_fixed' in data:
if data['AL_eigenvalues_fixed'] == 'done':
info['AL_eigs'] = [{'eigenvalue': teXify_pol(al[1]),
'prime_ideal': teXify_pol(al[0]),
'prime_norm': al[0][1:al[0].index(',')]} for al in data['AL_eigenvalues']]
else:
info['AL_eigs'] = [{'eigenvalue': '?', 'prime_ideal': '?'}]
else:
info['AL_eigs'] = [{'eigenvalue': '?', 'prime_ideal': '?'}]
info['AL_eigs_count'] = len(info['AL_eigs']) != 0
max_eig_len = max([len(eig['eigenvalue']) for eig in info['eigs']])
#.........这里部分代码省略.........
示例3: render_hmf_webpage
# 需要导入模块: from lmfdb import WebNumberField [as 别名]
# 或者: from lmfdb.WebNumberField import poly [as 别名]
def render_hmf_webpage(**args):
C = getDBConnection()
data = None
if 'label' in args:
label = str(args['label'])
data = C.hmfs.forms.find_one({'label': label})
if data is None:
return "No such field"
info = {}
try:
info['count'] = args['count']
except KeyError:
info['count'] = 10
try:
numeigs = request.args['numeigs']
numeigs = int(numeigs)
except:
numeigs = 20
hmf_field = C.hmfs.fields.find_one({'label': data['field_label']})
nf = WebNumberField(data['field_label'])
info['base_galois_group'] = nf.galois_string()
info['field_degree'] = nf.degree()
info['field_disc'] = str(nf.disc())
info['field_poly'] = teXify_pol(str(nf.poly()))
info.update(data)
info['downloads'] = [
('Download to Magma', url_for(".render_hmf_webpage_download", field_label=info['field_label'], label=info['label'], download_type='magma')),
('Download to Sage', url_for(".render_hmf_webpage_download", field_label=info['field_label'], label=info['label'], download_type='sage'))
]
info['friends'] = []
info['friends'] = [('L-function',
url_for("l_functions.l_function_hmf_page", field=info['field_label'], label=info['label'], character='0', number='0'))]
# info['learnmore'] = [('Number Field labels',
# url_for("render_labels_page")), ('Galois group
# labels',url_for("render_groups_page")), ('Discriminant
# ranges',url_for("render_discriminants_page"))]
bread = [('Hilbert Modular Forms', url_for(".hilbert_modular_form_render_webpage")), ('%s' % data[
'label'], ' ')]
t = "Hilbert Cusp Form %s" % info['label']
credit = 'Lassina Dembele, Steve Donnelly and <A HREF="http://www.cems.uvm.edu/~voight/">John Voight</A>'
forms_space = C.hmfs.forms.find(
{'field_label': data['field_label'], 'level_ideal': data['level_ideal']})
dim_space = 0
for v in forms_space:
dim_space += v['dimension']
info['newspace_dimension'] = dim_space
w = polygen(QQ, 'w')
e = polygen(QQ, 'e')
eigs = data['hecke_eigenvalues']
eigs = eigs[:min(len(eigs), numeigs)]
primes = hmf_field['primes']
n = min(len(eigs), len(primes))
info['eigs'] = [{'eigenvalue': teXify_pol(eigs[i]),
'prime_ideal': teXify_pol(primes[i]),
'prime_norm': primes[i][1:primes[i].index(',')]} for i in range(n)]
try:
display_eigs = request.args['display_eigs']
if display_eigs in ['True', 'true', '1', 'yes']:
display_eigs = True
else:
display_eigs = False
except KeyError:
display_eigs = False
if 'numeigs' in request.args:
display_eigs = True
info['hecke_polynomial'] = teXify_pol(info['hecke_polynomial'])
if 'AL_eigenvalues_fixed' in data:
if data['AL_eigenvalues_fixed'] == 'done':
info['AL_eigs'] = [{'eigenvalue': teXify_pol(al[1]),
'prime_ideal': teXify_pol(al[0]),
'prime_norm': al[0][1:al[0].index(',')]} for al in data['AL_eigenvalues']]
else:
info['AL_eigs'] = [{'eigenvalue': '?', 'prime_ideal': '?'}]
else:
info['AL_eigs'] = [{'eigenvalue': '?', 'prime_ideal': '?'}]
info['AL_eigs_count'] = len(info['AL_eigs']) != 0
if not display_eigs:
for eig in info['eigs']:
if len(eig['eigenvalue']) > 300:
eig['eigenvalue'] = '...'
for eig in info['AL_eigs']:
if len(eig['eigenvalue']) > 300:
eig['eigenvalue'] = '...'
#.........这里部分代码省略.........