本文整理汇总了Python中lmfdb.WebNumberField.WebNumberField.zk方法的典型用法代码示例。如果您正苦于以下问题:Python WebNumberField.zk方法的具体用法?Python WebNumberField.zk怎么用?Python WebNumberField.zk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lmfdb.WebNumberField.WebNumberField
的用法示例。
在下文中一共展示了WebNumberField.zk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: render_field_webpage
# 需要导入模块: from lmfdb.WebNumberField import WebNumberField [as 别名]
# 或者: from lmfdb.WebNumberField.WebNumberField import zk [as 别名]
def render_field_webpage(args):
data = None
C = base.getDBConnection()
info = {}
bread = [('Global Number Fields', url_for(".number_field_render_webpage"))]
# This function should not be called unless label is set.
label = clean_input(args['label'])
nf = WebNumberField(label)
data = {}
if nf.is_null():
bread.append(('Search results', ' '))
info['err'] = 'There is no field with label %s in the database' % label
info['label'] = args['label_orig'] if 'label_orig' in args else args['label']
return search_input_error(info, bread)
info['wnf'] = nf
data['degree'] = nf.degree()
data['class_number'] = nf.class_number()
t = nf.galois_t()
n = nf.degree()
data['is_galois'] = nf.is_galois()
data['is_abelian'] = nf.is_abelian()
if nf.is_abelian():
conductor = nf.conductor()
data['conductor'] = conductor
dirichlet_chars = nf.dirichlet_group()
if len(dirichlet_chars)>0:
data['dirichlet_group'] = ['<a href = "%s">$\chi_{%s}(%s,·)$</a>' % (url_for('characters.render_Dirichletwebpage',modulus=data['conductor'], number=j), data['conductor'], j) for j in dirichlet_chars]
data['dirichlet_group'] = r'$\lbrace$' + ', '.join(data['dirichlet_group']) + r'$\rbrace$'
if data['conductor'].is_prime() or data['conductor'] == 1:
data['conductor'] = "\(%s\)" % str(data['conductor'])
else:
data['conductor'] = "\(%s=%s\)" % (str(data['conductor']), latex(data['conductor'].factor()))
data['galois_group'] = group_display_knowl(n, t, C)
data['cclasses'] = cclasses_display_knowl(n, t, C)
data['character_table'] = character_table_display_knowl(n, t, C)
data['class_group'] = nf.class_group()
data['class_group_invs'] = nf.class_group_invariants()
data['signature'] = nf.signature()
data['coefficients'] = nf.coeffs()
nf.make_code_snippets()
D = nf.disc()
ram_primes = D.prime_factors()
data['disc_factor'] = nf.disc_factored_latex()
if D.abs().is_prime() or D == 1:
data['discriminant'] = "\(%s\)" % str(D)
else:
data['discriminant'] = "\(%s=%s\)" % (str(D), data['disc_factor'])
npr = len(ram_primes)
ram_primes = str(ram_primes)[1:-1]
if ram_primes == '':
ram_primes = r'\textrm{None}'
data['frob_data'], data['seeram'] = frobs(nf)
data['phrase'] = group_phrase(n, t, C)
zk = nf.zk()
Ra = PolynomialRing(QQ, 'a')
zk = [latex(Ra(x)) for x in zk]
zk = ['$%s$' % x for x in zk]
zk = ', '.join(zk)
grh_label = '<small>(<a title="assuming GRH" knowl="nf.assuming_grh">assuming GRH</a>)</small>' if nf.used_grh() else ''
# Short version for properties
grh_lab = nf.short_grh_string()
if 'Not' in str(data['class_number']):
grh_lab=''
grh_label=''
pretty_label = field_pretty(label)
if label != pretty_label:
pretty_label = "%s: %s" % (label, pretty_label)
info.update(data)
if nf.degree() > 1:
gpK = nf.gpK()
rootof1coeff = gpK.nfrootsof1()[2]
rootofunity = Ra(str(pari("lift(%s)" % gpK.nfbasistoalg(rootof1coeff))).replace('x','a'))
else:
rootofunity = Ra('-1')
info.update({
'label': pretty_label,
'label_raw': label,
'polynomial': web_latex_split_on_pm(nf.poly()),
'ram_primes': ram_primes,
'integral_basis': zk,
'regulator': web_latex(nf.regulator()),
'unit_rank': nf.unit_rank(),
'root_of_unity': web_latex(rootofunity),
'fund_units': nf.units(),
'grh_label': grh_label
})
bread.append(('%s' % info['label_raw'], ' '))
info['downloads_visible'] = True
info['downloads'] = [('worksheet', '/')]
info['friends'] = []
if nf.can_class_number():
# hide ones that take a lond time to compute on the fly
# note that the first degree 4 number field missed the zero of the zeta function
if abs(D**n) < 50000000:
info['friends'].append(('L-function', "/L/NumberField/%s" % label))
#.........这里部分代码省略.........
示例2: render_field_webpage
# 需要导入模块: from lmfdb.WebNumberField import WebNumberField [as 别名]
# 或者: from lmfdb.WebNumberField.WebNumberField import zk [as 别名]
def render_field_webpage(args):
data = None
info = {}
bread = [('Global Number Fields', url_for(".number_field_render_webpage"))]
# This function should not be called unless label is set.
label = clean_input(args['label'])
nf = WebNumberField(label)
data = {}
if nf.is_null():
bread.append(('Search Results', ' '))
info['err'] = 'There is no field with label %s in the database' % label
info['label'] = args['label_orig'] if 'label_orig' in args else args['label']
return search_input_error(info, bread)
info['wnf'] = nf
data['degree'] = nf.degree()
data['class_number'] = nf.class_number_latex()
ram_primes = nf.ramified_primes()
t = nf.galois_t()
n = nf.degree()
data['is_galois'] = nf.is_galois()
data['is_abelian'] = nf.is_abelian()
if nf.is_abelian():
conductor = nf.conductor()
data['conductor'] = conductor
dirichlet_chars = nf.dirichlet_group()
if len(dirichlet_chars)>0:
data['dirichlet_group'] = ['<a href = "%s">$\chi_{%s}(%s,·)$</a>' % (url_for('characters.render_Dirichletwebpage',modulus=data['conductor'], number=j), data['conductor'], j) for j in dirichlet_chars]
data['dirichlet_group'] = r'$\lbrace$' + ', '.join(data['dirichlet_group']) + r'$\rbrace$'
if data['conductor'].is_prime() or data['conductor'] == 1:
data['conductor'] = "\(%s\)" % str(data['conductor'])
else:
factored_conductor = factor_base_factor(data['conductor'], ram_primes)
factored_conductor = factor_base_factorization_latex(factored_conductor)
data['conductor'] = "\(%s=%s\)" % (str(data['conductor']), factored_conductor)
data['galois_group'] = group_display_knowl(n, t)
data['cclasses'] = cclasses_display_knowl(n, t)
data['character_table'] = character_table_display_knowl(n, t)
data['class_group'] = nf.class_group()
data['class_group_invs'] = nf.class_group_invariants()
data['signature'] = nf.signature()
data['coefficients'] = nf.coeffs()
nf.make_code_snippets()
D = nf.disc()
data['disc_factor'] = nf.disc_factored_latex()
if D.abs().is_prime() or D == 1:
data['discriminant'] = "\(%s\)" % str(D)
else:
data['discriminant'] = "\(%s=%s\)" % (str(D), data['disc_factor'])
data['frob_data'], data['seeram'] = frobs(nf)
# Bad prime information
npr = len(ram_primes)
ramified_algebras_data = nf.ramified_algebras_data()
if isinstance(ramified_algebras_data,str):
loc_alg = ''
else:
# [label, latex, e, f, c, gal]
loc_alg = ''
for j in range(npr):
if ramified_algebras_data[j] is None:
loc_alg += '<tr><td>%s<td colspan="7">Data not computed'%str(ram_primes[j])
else:
mydat = ramified_algebras_data[j]
p = ram_primes[j]
loc_alg += '<tr><td rowspan="%d">$%s$</td>'%(len(mydat),str(p))
mm = mydat[0]
myurl = url_for('local_fields.by_label', label=mm[0])
lab = mm[0]
if mm[3]*mm[2]==1:
lab = r'$\Q_{%s}$'%str(p)
loc_alg += '<td><a href="%s">%s</a><td>$%s$<td>$%d$<td>$%d$<td>$%d$<td>%s<td>$%s$'%(myurl,lab,mm[1],mm[2],mm[3],mm[4],mm[5],show_slope_content(mm[8],mm[6],mm[7]))
for mm in mydat[1:]:
lab = mm[0]
if mm[3]*mm[2]==1:
lab = r'$\Q_{%s}$'%str(p)
loc_alg += '<tr><td><a href="%s">%s</a><td>$%s$<td>$%d$<td>$%d$<td>$%d$<td>%s<td>$%s$'%(myurl,lab,mm[1],mm[2],mm[3],mm[4],mm[5],show_slope_content(mm[8],mm[6],mm[7]))
loc_alg += '</tbody></table>'
ram_primes = str(ram_primes)[1:-1]
if ram_primes == '':
ram_primes = r'\textrm{None}'
data['phrase'] = group_phrase(n, t)
zk = nf.zk()
Ra = PolynomialRing(QQ, 'a')
zk = [latex(Ra(x)) for x in zk]
zk = ['$%s$' % x for x in zk]
zk = ', '.join(zk)
grh_label = '<small>(<a title="assuming GRH" knowl="nf.assuming_grh">assuming GRH</a>)</small>' if nf.used_grh() else ''
# Short version for properties
grh_lab = nf.short_grh_string()
if 'Not' in str(data['class_number']):
grh_lab=''
grh_label=''
pretty_label = field_pretty(label)
if label != pretty_label:
pretty_label = "%s: %s" % (label, pretty_label)
info.update(data)
if nf.degree() > 1:
#.........这里部分代码省略.........