示例#1
0
def artin_postprocess(res, info, query):
    gp_labels = list(
        set([rec["GaloisLabel"]
             for rec in res] + [rec["Container"].upper() for rec in res] +
            ["T".join(str(c) for c in rec["Proj_nTj"]) for rec in res]))
    cache = knowl_cache(gp_labels)
    return [ArtinRepresentation(data=x, knowl_cache=cache) for x in res]
示例#2
0
def render_artin_representation_webpage(label):
    if re.compile(r'^\d+$').match(label):
        return artin_representation_search(**{
            'dimension': label,
            'search_array': ArtinSearchArray()
        })

    # label=dim.cond.nTt.indexcj, c is literal, j is index in conj class
    # Should we have a big try around this to catch bad labels?
    clean_label = clean_input(label)
    if clean_label != label:
        return redirect(
            url_for('.render_artin_representation_webpage', label=clean_label),
            301)
    # We could have a single representation or a Galois orbit
    case = parse_any(label)
    if case[0] == 'malformed':
        try:
            raise ValueError
        except:
            flash_error(
                "%s is not in a valid form for the label for an Artin representation or a Galois orbit of Artin representations",
                label)
            return redirect(url_for(".index"))
    # Do this twice to customize error messages
    newlabel = case[1]
    case = case[0]
    if case == 'rep':
        try:
            the_rep = ArtinRepresentation(newlabel)
        except:
            newlabel = parse_artin_label(label)
            flash_error("Artin representation %s is not in database", label)
            return redirect(url_for(".index"))
    else:  # it is an orbit
        try:
            the_rep = ArtinRepresentation(newlabel + '.a')
        except:
            newlabel = parse_artin_orbit_label(newlabel)
            flash_error(
                "Galois orbit of Artin representations %s is not in database",
                label)
            return redirect(url_for(".index"))
        # in this case we want all characters
        num_conj = the_rep.galois_conjugacy_size()
        allchars = [
            ArtinRepresentation(newlabel + '.' +
                                num2letters(j)).character_formatted()
            for j in range(1, num_conj + 1)
        ]

    label = newlabel
    bread = get_bread([(label, ' ')])

    #artin_logger.info("Found %s" % (the_rep._data))

    if case == 'rep':
        title = "Artin representation %s" % label
    else:
        title = "Galois orbit of Artin representations %s" % label
    the_nf = the_rep.number_field_galois_group()
    if the_rep.sign() == 0:
        processed_root_number = "not computed"
    else:
        processed_root_number = str(the_rep.sign())
    properties = [("Label", label), ("Dimension", str(the_rep.dimension())),
                  ("Group", the_rep.group()),
                  ("Conductor", "$" + the_rep.factored_conductor_latex() + "$")
                  ]
    if case == 'rep':
        properties.append(("Root number", processed_root_number))
    properties.append(("Frobenius-Schur indicator", str(the_rep.indicator())))

    friends = []
    wnf = None
    nf_url = the_nf.url_for()
    if nf_url:
        friends.append(("Artin field", nf_url))
        wnf = the_nf.wnf()
    proj_nf = WebNumberField.from_coeffs(the_rep._data['Proj_Polynomial'])
    if proj_nf:
        friends.append(
            ("Projective Artin field",
             str(url_for("number_fields.by_label",
                         label=proj_nf.get_label()))))
    if case == 'rep':
        cc = the_rep.central_character()
        if cc is not None:
            if the_rep.dimension() == 1:
                if cc.order == 2:
                    cc_name = cc.symbol
                else:
                    cc_name = cc.texname
                friends.append(("Dirichlet character " + cc_name,
                                url_for("characters.render_Dirichletwebpage",
                                        modulus=cc.modulus,
                                        number=cc.number)))
            else:
                detrep = the_rep.central_character_as_artin_rep()
                friends.append(("Determinant representation " + detrep.label(),
                                detrep.url_for()))
        add_lfunction_friends(friends, label)

        # once the L-functions are in the database, the link can always be shown
        #if the_rep.dimension() <= 6:
        if the_rep.dimension() == 1:
            # Zeta is loaded differently
            if cc.modulus == 1 and cc.number == 1:
                friends.append(
                    ("L-function",
                     url_for("l_functions.l_function_dirichlet_page",
                             modulus=cc.modulus,
                             number=cc.number)))
            else:
                # looking for Lhash dirichlet_L_modulus.number
                mylhash = 'dirichlet_L_%d.%d' % (cc.modulus, cc.number)
                lres = db.lfunc_instances.lucky({'Lhash': mylhash})
                if lres is not None:
                    friends.append(
                        ("L-function",
                         url_for("l_functions.l_function_dirichlet_page",
                                 modulus=cc.modulus,
                                 number=cc.number)))

        # Dimension > 1
        elif int(the_rep.conductor())**the_rep.dimension() <= 729000000000000:
            friends.append(("L-function",
                            url_for("l_functions.l_function_artin_page",
                                    label=the_rep.label())))
        orblabel = re.sub(r'\.[a-z]+$', '', label)
        friends.append(("Galois orbit " + orblabel,
                        url_for(".render_artin_representation_webpage",
                                label=orblabel)))
    else:
        add_lfunction_friends(friends, label)
        friends.append(("L-function",
                        url_for("l_functions.l_function_artin_page",
                                label=the_rep.label())))
        for j in range(1, 1 + the_rep.galois_conjugacy_size()):
            newlabel = label + '.' + num2letters(j)
            friends.append(("Artin representation " + newlabel,
                            url_for(".render_artin_representation_webpage",
                                    label=newlabel)))

    info = {}  # for testing

    if case == 'rep':
        return render_template("artin-representation-show.html",
                               credit=tim_credit,
                               support=support_credit,
                               title=title,
                               bread=bread,
                               friends=friends,
                               object=the_rep,
                               cycle_string=cycle_string,
                               wnf=wnf,
                               properties=properties,
                               info=info,
                               learnmore=learnmore_list())
    # else we have an orbit
    return render_template("artin-representation-galois-orbit.html",
                           credit=tim_credit,
                           support=support_credit,
                           title=title,
                           bread=bread,
                           allchars=allchars,
                           friends=friends,
                           object=the_rep,
                           cycle_string=cycle_string,
                           wnf=wnf,
                           properties=properties,
                           info=info,
                           learnmore=learnmore_list())
示例#3
0
            j += 1
    return rts


# select the ones we want
#artargs = {'Dim': {'$gte': 2, '$lte': 9}}
#allarts=rep.find(artargs)

#arep = rep.find_one({'Dim': {'$gte': 2}})
#ar = ArtinRepresentation(str(arep['Baselabel'])+'c1')
#ar = ArtinRepresentation('2.2e3_3e2.6t5.1c1')

baselabel = label.split('c')
a = rep.find_one({'Baselabel': baselabel[0]})

ar = ArtinRepresentation(label)

outfile = open(label, 'w')

cf = a['CharacterField']
cfz = ZZ(cf)
nf = ar.nf()
nfcc = nf.conjugacy_classes()
nfcc = [int(z.order()) for z in nfcc]
nfcc = lcm(nfcc)
if not cfz.divides(nfcc):
    print("Failure " + str(cfz) + " divides " + str(nfcc) + " from " + label)
    sys.exit()
R, x = QQ['x'].objgen()
pol1 = R.cyclotomic_polynomial(nfcc)
K, z = NumberField(R.cyclotomic_polynomial(nfcc), 'z').objgen()
示例#4
0
文件: main.py 项目: jvoight/lmfdb
def render_artin_representation_webpage(label):
    if re.compile(r'^\d+$').match(label):
        return artin_representation_search(**{'dimension': label})

    bread = get_bread([(label, ' ')])

    # label=dim.cond.nTt.indexcj, c is literal, j is index in conj class
    # Should we have a big try around this to catch bad labels?
    clean_label = clean_input(label)
    if clean_label != label:
        return redirect(url_for('.render_artin_representation_webpage', label=clean_label), 301)
    try:
        the_rep = ArtinRepresentation(label)
    except:
        flash(Markup("Error: <span style='color:black'>%s</span> is not the label of an Artin representation in the database." % (label)), "error")
        return search_input_error({'err':''}, bread)

    extra_data = {} # for testing?
    extra_data['galois_knowl'] = group_display_knowl(5,3) # for testing?
    #artin_logger.info("Found %s" % (the_rep._data))


    title = "Artin Representation %s" % label
    the_nf = the_rep.number_field_galois_group()
    if the_rep.sign() == 0:
        processed_root_number = "not computed"
    else:
        processed_root_number = str(the_rep.sign())
    properties = [("Label", label),
                  ("Dimension", str(the_rep.dimension())),
                  ("Group", the_rep.group()),
                  ("Conductor", "$" + the_rep.factored_conductor_latex() + "$"),
                  #("Bad primes", str(the_rep.bad_primes())),
                  ("Root number", processed_root_number),
                  ("Frobenius-Schur indicator", str(the_rep.indicator()))
                  ]

    friends = []
    nf_url = the_nf.url_for()
    if nf_url:
        friends.append(("Artin Field", nf_url))
    cc = the_rep.central_character()
    if cc is not None:
        if the_rep.dimension()==1:
            if cc.order == 2:
                cc_name = cc.symbol
            else:
                cc_name = cc.texname
            friends.append(("Dirichlet character "+cc_name, url_for("characters.render_Dirichletwebpage", modulus=cc.modulus, number=cc.number)))
        else:
            detrep = the_rep.central_character_as_artin_rep()
            friends.append(("Determinant representation "+detrep.label(), detrep.url_for()))
    add_lfunction_friends(friends,label)

    # once the L-functions are in the database, the link can always be shown
    #if the_rep.dimension() <= 6:
    if the_rep.dimension() == 1:
        # Zeta is loaded differently
        if cc.modulus == 1 and cc.number == 1:
            friends.append(("L-function", url_for("l_functions.l_function_dirichlet_page", modulus=cc.modulus, number=cc.number)))
        else:
            # looking for Lhash dirichlet_L_modulus.number
            mylhash = 'dirichlet_L_%d.%d'%(cc.modulus,cc.number)
            lres = db.lfunc_instances.lucky({'Lhash': mylhash})
            if lres is not None:
                friends.append(("L-function", url_for("l_functions.l_function_dirichlet_page", modulus=cc.modulus, number=cc.number)))

    # Dimension > 1
    elif int(the_rep.conductor())**the_rep.dimension() <= 729000000000000:
        friends.append(("L-function", url_for("l_functions.l_function_artin_page",
                                          label=the_rep.label())))
    info={}

    return render_template("artin-representation-show.html", credit=tim_credit, support=support_credit, title=title, bread=bread, friends=friends, object=the_rep, properties2=properties, extra_data=extra_data, info=info, learnmore=learnmore_list())
# Adds a field called field_len to objects in the_collection. It is based on the field called field
# It encodes the len of the string used
# This is kind of a hack for mongodb, see lmfdb.utils.len_val_fn for explanation

import sys
LMFDB_FOLDER = "../../../"
sys.path.append(LMFDB_FOLDER)
from lmfdb.artin_representations.math_classes import ArtinRepresentation
the_collection = ArtinRepresentation.collection()
print "Got", the_collection

field = "Conductor"

from lmfdb.utils import len_val_fn

new_field = field + "_plus"

print "Updating"
for x in the_collection.find():
    val = x[field]
    x[new_field] = len_val_fn(val)
    the_collection.save(x)
示例#6
0
文件: main.py 项目: Ronit12/lmfdb
def render_artin_representation_webpage(label):
    if re.compile(r'^\d+$').match(label):
        return artin_representation_search(**{'dimension': label})

    bread = get_bread([(label, ' ')])

    # label=dim.cond.nTt.indexcj, c is literal, j is index in conj class
    # Should we have a big try around this to catch bad labels?
    clean_label = clean_input(label)
    if clean_label != label:
        return redirect(
            url_for('.render_artin_representation_webpage', label=clean_label),
            301)
    try:
        the_rep = ArtinRepresentation(label)
    except:
        try:
            newlabel = parse_artin_label(label)
            flash_error("Artin representation %s is not in database", newlabel)
            return redirect(url_for(".index"))
        except ValueError:
            flash_error(
                "%s is not in a valid form for an Artin representation label",
                label)
            return redirect(url_for(".index"))

    extra_data = {}  # for testing?
    extra_data['galois_knowl'] = group_display_knowl(5, 3)  # for testing?
    #artin_logger.info("Found %s" % (the_rep._data))

    title = "Artin Representation %s" % label
    the_nf = the_rep.number_field_galois_group()
    if the_rep.sign() == 0:
        processed_root_number = "not computed"
    else:
        processed_root_number = str(the_rep.sign())
    properties = [
        ("Label", label),
        ("Dimension", str(the_rep.dimension())),
        ("Group", the_rep.group()),
        ("Conductor", "$" + the_rep.factored_conductor_latex() + "$"),
        #("Bad primes", str(the_rep.bad_primes())),
        ("Root number", processed_root_number),
        ("Frobenius-Schur indicator", str(the_rep.indicator()))
    ]

    friends = []
    nf_url = the_nf.url_for()
    if nf_url:
        friends.append(("Artin Field", nf_url))
    cc = the_rep.central_character()
    if cc is not None:
        if the_rep.dimension() == 1:
            if cc.order == 2:
                cc_name = cc.symbol
            else:
                cc_name = cc.texname
            friends.append(("Dirichlet character " + cc_name,
                            url_for("characters.render_Dirichletwebpage",
                                    modulus=cc.modulus,
                                    number=cc.number)))
        else:
            detrep = the_rep.central_character_as_artin_rep()
            friends.append(("Determinant representation " + detrep.label(),
                            detrep.url_for()))
    add_lfunction_friends(friends, label)

    # once the L-functions are in the database, the link can always be shown
    #if the_rep.dimension() <= 6:
    if the_rep.dimension() == 1:
        # Zeta is loaded differently
        if cc.modulus == 1 and cc.number == 1:
            friends.append(("L-function",
                            url_for("l_functions.l_function_dirichlet_page",
                                    modulus=cc.modulus,
                                    number=cc.number)))
        else:
            # looking for Lhash dirichlet_L_modulus.number
            mylhash = 'dirichlet_L_%d.%d' % (cc.modulus, cc.number)
            lres = db.lfunc_instances.lucky({'Lhash': mylhash})
            if lres is not None:
                friends.append(
                    ("L-function",
                     url_for("l_functions.l_function_dirichlet_page",
                             modulus=cc.modulus,
                             number=cc.number)))

    # Dimension > 1
    elif int(the_rep.conductor())**the_rep.dimension() <= 729000000000000:
        friends.append(("L-function",
                        url_for("l_functions.l_function_artin_page",
                                label=the_rep.label())))
    info = {}

    return render_template("artin-representation-show.html",
                           credit=tim_credit,
                           support=support_credit,
                           title=title,
                           bread=bread,
                           friends=friends,
                           object=the_rep,
                           properties2=properties,
                           extra_data=extra_data,
                           info=info,
                           learnmore=learnmore_list())
示例#7
0
文件: main.py 项目: assaferan/lmfdb
])

artin_columns.above_table = "<div>Galois conjugate representations are grouped into single lines.</div>"
artin_columns.dummy_download = True


@search_wrap(table=db.artin_reps,
             title='Artin representation search results',
             err_title='Artin representation search error',
             per_page=50,
             columns=artin_columns,
             learnmore=learnmore_list,
             url_for_label=url_for_label,
             shortcuts={'jump': artin_representation_jump},
             postprocess=lambda res, info, query:
             [ArtinRepresentation(data=x) for x in res],
             bread=lambda: [('Artin representations', url_for(".index")),
                            ('Search results', ' ')])
def artin_representation_search(info, query):
    query['Hide'] = 0
    info['sign_code'] = 0
    parse_primes(info,
                 query,
                 "unramified",
                 name="Unramified primes",
                 qfield="BadPrimes",
                 mode="exclude")
    parse_primes(info,
                 query,
                 "ramified",
                 name="Ramified primes",
示例#8
0
from lmfdb.artin_representations.math_classes import ArtinRepresentation
from lmfdb.website import dbport

import base
base._init(dbport, "")

# x is raw
# a is of type ArtinRepresentation

# all the artin reps that come out of this are safe to appear on the website
# their L functions need to be fixed however

# if you want to do complex queries, and sort using pymongo's interface:
for x in ArtinRepresentation.collection().find():
    a = ArtinRepresentation(data=x)
    print a
    try:
        print a.Lfunction()
    except NotImplementedError or SyntaxError:
        print "Need CYC types and sign"

# if you want to list them all, using a wrapper to directly convert to ArtinRepresentation
for a in ArtinRepresentation.find():
    print a
    try:
        print a.Lfunction()
    except NotImplementedError or SyntaxError:
        print "Need CYC types"
示例#9
0
    return rts


# select the ones we want
#artargs = {'Dim': {'$gte': 2, '$lte': 9}}
#allarts=rep.find(artargs)

#arep = rep.find_one({'Dim': {'$gte': 2}})
#ar = ArtinRepresentation(str(arep['Baselabel'])+'c1')
#ar = ArtinRepresentation('2.2e3_3e2.6t5.1c1')

baselabel=label.split('c')
a = rep.find_one({'Baselabel': baselabel[0]})


ar=ArtinRepresentation(label)

outfile=open(label, 'w')

cf=a['CharacterField']
cfz = ZZ(cf)
nf = ar.nf()
nfcc = nf.conjugacy_classes()
nfcc = [int(z.order()) for z in nfcc]
nfcc = lcm(nfcc)
if not cfz.divides(nfcc):
    print "Failure "+str(cfz)+" divides "+str(nfcc)+" from "+label
    sys.exit()
R,x = QQ['x'].objgen()
pol1 = R.cyclotomic_polynomial(nfcc)
K,z=NumberField(R.cyclotomic_polynomial(nfcc),'z').objgen()