Esempio n. 1
0
def FIELD(label):
    nf = WebNumberField(label, gen_name=special_names.get(label, 'a'))
    nf.parse_NFelt = lambda s: nf.K()([QQ(c.encode()) for c in s.split(",")])
    nf.latex_poly = web_latex(nf.poly())
    return nf
Esempio n. 2
0
def render_bmf_space_webpage(field_label, level_label):
    info = {}
    t = "Bianchi modular forms of level %s over %s" % (level_label,
                                                       field_label)
    credit = bianchi_credit
    bread = [('Bianchi modular forms', url_for(".index")),
             (field_pretty(field_label),
              url_for(".render_bmf_field_dim_table_gl2",
                      field_label=field_label)), (level_label, '')]
    friends = []
    properties2 = []

    if not field_label_regex.match(field_label):
        info[
            'err'] = "%s is not a valid label for an imaginary quadratic field" % field_label
    else:
        pretty_field_label = field_pretty(field_label)
        if not db_dims().find({'field_label': field_label}):
            info[
                'err'] = "no dimension information exists in the database for field %s" % pretty_field_label
        else:
            t = "Bianchi Modular Forms of level %s over %s" % (
                level_label, pretty_field_label)
            data = db_dims().find({
                'field_label': field_label,
                'level_label': level_label
            })
            nres = data.count()
            if nres == 0:
                info[
                    'err'] = "no dimension information exists in the database for level %s and field %s" % (
                        level_label, pretty_field_label)
            else:
                data = data.next()
                info['label'] = data['label']
                nf = WebNumberField(field_label)
                info['base_galois_group'] = nf.galois_string()
                info['field_label'] = field_label
                info['pretty_field_label'] = pretty_field_label
                info['level_label'] = level_label
                info['level_norm'] = data['level_norm']
                info['field_degree'] = nf.degree()
                info['field_classno'] = nf.class_number()
                info['field_disc'] = str(nf.disc())
                info['field_poly'] = teXify_pol(str(nf.poly()))
                info['field_knowl'] = nf_display_knowl(field_label,
                                                       getDBConnection(),
                                                       pretty_field_label)
                w = 'i' if nf.disc() == -4 else 'a'
                L = nf.K().change_names(w)
                alpha = L.gen()
                info['field_gen'] = latex(alpha)
                I = ideal_from_label(L, level_label)
                info['level_gen'] = latex(I.gens_reduced()[0])
                info['level_fact'] = latex(I.factor())
                dim_data = data['gl2_dims']
                weights = dim_data.keys()
                weights.sort(key=lambda w: int(w))
                for w in weights:
                    dim_data[w]['dim'] = dim_data[w]['cuspidal_dim']
                info['dim_data'] = dim_data
                info['weights'] = weights
                info['nweights'] = len(weights)

                newdim = data['gl2_dims']['2']['new_dim']
                newforms = db_forms().find({
                    'field_label': field_label,
                    'level_label': level_label
                }).sort('label_suffix', ASCENDING)
                info['nfdata'] = [{
                    'label':
                    f['short_label'],
                    'url':
                    url_for(".render_bmf_webpage",
                            field_label=f['field_label'],
                            level_label=f['level_label'],
                            label_suffix=f['label_suffix']),
                    'wt':
                    f['weight'],
                    'dim':
                    f['dimension'],
                    'sfe':
                    "+1" if f['sfe'] == 1 else "-1",
                    'bc':
                    bc_info(f['bc']),
                    'cm':
                    cm_info(f['CM']),
                } for f in newforms]
                info['nnewforms'] = len(info['nfdata'])
                properties2 = [('Base field', pretty_field_label),
                               ('Level', info['level_label']),
                               ('Norm', str(info['level_norm'])),
                               ('New dimension', str(newdim))]
                friends = [('Newform {}'.format(f['label']), f['url'])
                           for f in info['nfdata']]

    return render_template("bmf-space.html",
                           info=info,
                           credit=credit,
                           title=t,
                           bread=bread,
                           properties2=properties2,
                           friends=friends)
Esempio n. 3
0
def FIELD(label):
    nf = WebNumberField(label, gen_name=special_names.get(label, 'a'))
    nf.parse_NFelt = lambda s: nf.K()([QQ(str(c)) for c in s])
    return nf