当前位置: 首页>>代码示例>>Python>>正文


Python WebNumberField.factor_perm_repn方法代码示例

本文整理汇总了Python中lmfdb.WebNumberField.factor_perm_repn方法的典型用法代码示例。如果您正苦于以下问题:Python WebNumberField.factor_perm_repn方法的具体用法?Python WebNumberField.factor_perm_repn怎么用?Python WebNumberField.factor_perm_repn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lmfdb.WebNumberField的用法示例。


在下文中一共展示了WebNumberField.factor_perm_repn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: render_field_webpage

# 需要导入模块: from lmfdb import WebNumberField [as 别名]
# 或者: from lmfdb.WebNumberField import factor_perm_repn [as 别名]

#.........这里部分代码省略.........
    data['signature'] = nf.signature()
    data['coefficients'] = nf.coeffs()
    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.K())
    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)
    info.update({
        'label': pretty_label,
        'label_raw': label,
        'polynomial': web_latex_split_on_pm(nf.K().defining_polynomial()),
        'ram_primes': ram_primes,
        'integral_basis': zk,
        'regulator': web_latex(nf.regulator()),
        'unit_rank': nf.unit_rank(),
        'root_of_unity': web_latex(nf.K().primitive_root_of_unity()),
        '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))
    info['friends'].append(('Galois group', "/GaloisGroup/%dT%d" % (n, t)))
    if 'dirichlet_group' in info:
        info['friends'].append(('Dirichlet group', url_for("characters.dirichlet_group_table",
                                                           modulus=int(conductor),
                                                           char_number_list=','.join(
                                                               [str(a) for a in dirichlet_chars]),
                                                           poly=info['polynomial'])))
    info['learnmore'] = [('Global number field labels', url_for(
        ".render_labels_page")), 
        (Completename, url_for(".render_discriminants_page")),
        ('How data was computed', url_for(".how_computed_page"))]
    if info['signature'] == [0,1]:
        info['learnmore'].append(('Quadratic imaginary class groups', url_for(".render_class_group_data")))
    # With Galois group labels, probably not needed here
    # info['learnmore'] = [('Global number field labels',
    # url_for(".render_labels_page")), ('Galois group
    # labels',url_for(".render_groups_page")),
    # (Completename,url_for(".render_discriminants_page"))]
    title = "Global Number Field %s" % info['label']

    if npr == 1:
        primes = 'prime'
    else:
        primes = 'primes'

    properties2 = [('Degree:', '%s' % data['degree']),
                   ('Signature:', '$%s$' % data['signature']),
                   ('Discriminant:', '$%s$' % data['disc_factor']),
                   ('Ramified ' + primes + ':', '$%s$' % ram_primes),
                   ('Class number:', '%s %s' % (data['class_number'], grh_lab)),
                   ('Class group:', '%s %s' % (data['class_group_invs'], grh_lab)),
                   ('Galois Group:', group_display_short(data['degree'], t, C))
                   ]
    from lmfdb.math_classes import NumberFieldGaloisGroup
    try:
        info["tim_number_field"] = NumberFieldGaloisGroup(nf._data['coeffs'])
        v = nf.factor_perm_repn(info["tim_number_field"])
        def dopow(m):
            if m==0: return ''
            if m==1: return '*'
            return '*<sup>%d</sup>'% m

        info["mydecomp"] = [dopow(x) for x in v]
    except AttributeError:
        pass
#    del info['_id']
    return render_template("number_field.html", properties2=properties2, credit=NF_credit, title=title, bread=bread, friends=info.pop('friends'), learnmore=info.pop('learnmore'), info=info)
开发者ID:StockpotCreative,项目名称:lmfdb,代码行数:104,代码来源:number_field.py

示例2: render_field_webpage

# 需要导入模块: from lmfdb import WebNumberField [as 别名]
# 或者: from lmfdb.WebNumberField import factor_perm_repn [as 别名]

#.........这里部分代码省略.........
    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)
    info.update(
        {
            "label": pretty_label,
            "label_raw": label,
            "polynomial": web_latex_split_on_pm(nf.K().defining_polynomial()),
            "ram_primes": ram_primes,
            "integral_basis": zk,
            "regulator": web_latex(nf.regulator()),
            "unit_rank": nf.unit_rank(),
            "root_of_unity": web_latex(nf.K().primitive_root_of_unity()),
            "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))
    info["friends"].append(("Galois group", "/GaloisGroup/%dT%d" % (n, t)))
    if "dirichlet_group" in info:
        info["friends"].append(
            (
                "Dirichlet group",
                url_for(
                    "characters.dirichlet_group_table",
                    modulus=int(conductor),
                    char_number_list=",".join([str(a) for a in dirichlet_chars]),
                    poly=info["polynomial"],
                ),
            )
        )
    info["learnmore"] = [
        ("Global number field labels", url_for(".render_labels_page")),
        (Completename, url_for(".render_discriminants_page")),
        ("How data was computed", url_for(".how_computed_page")),
    ]
    if info["signature"] == [0, 1]:
        info["learnmore"].append(("Quadratic imaginary class groups", url_for(".render_class_group_data")))
    # With Galois group labels, probably not needed here
    # info['learnmore'] = [('Global number field labels',
    # url_for(".render_labels_page")), ('Galois group
    # labels',url_for(".render_groups_page")),
    # (Completename,url_for(".render_discriminants_page"))]
    title = "Global Number Field %s" % info["label"]

    if npr == 1:
        primes = "prime"
    else:
        primes = "primes"

    properties2 = [
        ("Degree:", "%s" % data["degree"]),
        ("Signature:", "$%s$" % data["signature"]),
        ("Discriminant:", "$%s$" % data["disc_factor"]),
        ("Ramified " + primes + ":", "$%s$" % ram_primes),
        ("Class number:", "%s %s" % (data["class_number"], grh_lab)),
        ("Class group:", "%s %s" % (data["class_group_invs"], grh_lab)),
        ("Galois Group:", group_display_short(data["degree"], t, C)),
    ]
    from lmfdb.math_classes import NumberFieldGaloisGroup

    try:
        info["tim_number_field"] = NumberFieldGaloisGroup(nf._data["coeffs"])
        v = nf.factor_perm_repn(info["tim_number_field"])

        def dopow(m):
            if m == 0:
                return ""
            if m == 1:
                return "*"
            return "*<sup>%d</sup>" % m

        info["mydecomp"] = [dopow(x) for x in v]
    except AttributeError:
        pass
    #    del info['_id']
    return render_template(
        "number_field.html",
        properties2=properties2,
        credit=NF_credit,
        title=title,
        bread=bread,
        friends=info.pop("friends"),
        learnmore=info.pop("learnmore"),
        info=info,
    )
开发者ID:alinabucur,项目名称:lmfdb,代码行数:104,代码来源:number_field.py


注:本文中的lmfdb.WebNumberField.factor_perm_repn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。