Example #1
0
def hilbert_modular_form_search(info, query):
    parse_nf_string(info,query,'field_label',name="Field")
    parse_ints(info,query,'deg', name='Field degree')
    parse_ints(info,query,'disc',name="Field discriminant")
    parse_ints(info,query,'dimension')
    parse_ints(info,query,'level_norm', name="Level norm")
    parse_hmf_weight(info,query,'weight',qfield=('parallel_weight','weight'))
    if 'cm' in info:
        if info['cm'] == 'exclude':
            query['is_CM'] = 'no'
        elif info['cm'] == 'only':
            query['is_CM'] = 'yes'
    if 'bc' in info:
        if info['bc'] == 'exclude':
            query['is_base_change'] = 'no'
        elif info['bc'] == 'only':
            query['is_base_change'] = 'yes'
Example #2
0
def hilbert_modular_form_search(info, query):
    parse_nf_string(info, query, 'field_label', name="Field")
    parse_ints(info, query, 'deg', name='Field degree')
    parse_ints(info, query, 'disc', name="Field discriminant")
    parse_ints(info, query, 'dimension')
    parse_ints(info, query, 'level_norm', name="Level norm")
    parse_hmf_weight(info,
                     query,
                     'weight',
                     qfield=('parallel_weight', 'weight'))
    if 'cm' in info:
        if info['cm'] == 'exclude':
            query['is_CM'] = 'no'
        elif info['cm'] == 'only':
            query['is_CM'] = 'yes'
    if 'bc' in info:
        if info['bc'] == 'exclude':
            query['is_base_change'] = 'no'
        elif info['bc'] == 'only':
            query['is_base_change'] = 'yes'
Example #3
0
def hilbert_modular_form_search(**args):
    info = to_dict(args)  # what has been entered in the search boxes
    if 'label' in info and info['label']:
        lab=info['label'].strip()
        info['label']=lab
        try:
            split_full_label(lab)
            return hilbert_modular_form_by_label(lab)
        except ValueError:
            return redirect(url_for(".hilbert_modular_form_render_webpage"))

    query = {}
    try:
        parse_nf_string(info,query,'field_label',name="Field")
        parse_ints(info,query,'deg', name='Field degree')
        parse_ints(info,query,'disc',name="Field discriminant")
        parse_ints(info,query,'dimension')
        parse_ints(info,query,'level_norm', name="Level norm")
        parse_hmf_weight(info,query,'weight',qfield=('parallel_weight','weight'))
    except ValueError:
        return search_input_error()

    count = parse_count(info,100)
    start = parse_start(info)

    info['query'] = dict(query)
    C = getDBConnection()
    res = C.hmfs.forms.find(
        query).sort([('deg', pymongo.ASCENDING), ('disc', pymongo.ASCENDING), ('level_norm', pymongo.ASCENDING), ('level_label', pymongo.ASCENDING), ('label_nsuffix', pymongo.ASCENDING)]).skip(start).limit(count)
    nres = res.count()
    if(start >= nres):
        start -= (1 + (start - nres) / count) * count
    if(start < 0):
        start = 0

    info['number'] = nres
    info['start'] = start
    info['more'] = int(start + count < nres)
    if nres == 1:
        info['report'] = 'unique match'
    else:
        if nres == 0:
            info['report'] = 'no matches'
        else:
            if nres > count or start != 0:
                info['report'] = 'displaying matches %s-%s of %s' % (start + 1, min(nres, start + count), nres)
            else:
                info['report'] = 'displaying all %s matches' % nres

    res_clean = []
    for v in res:
        v_clean = {}
        v_clean['field_label'] = v['field_label']
        v_clean['short_label'] = v['short_label']
        v_clean['label'] = v['label']
        v_clean['level_ideal'] = teXify_pol(v['level_ideal'])
        v_clean['dimension'] = v['dimension']
        res_clean.append(v_clean)

    info['forms'] = res_clean

    t = 'Hilbert Modular Form search results'

    bread = [('Hilbert Modular Forms', url_for(".hilbert_modular_form_render_webpage")), (
        'Search results', ' ')]
    properties = []
    return render_template("hilbert_modular_form_search.html", info=info, title=t, credit=hmf_credit, properties=properties, bread=bread, learnmore=learnmore_list())
Example #4
0
def hilbert_modular_form_search(**args):
    info = to_dict(args)  # what has been entered in the search boxes
    if 'label' in info and info['label']:
        lab = info['label'].strip()
        info['label'] = lab
        try:
            split_full_label(lab)
            return hilbert_modular_form_by_label(lab)
        except ValueError:
            return redirect(url_for(".hilbert_modular_form_render_webpage"))

    query = {}
    try:
        parse_nf_string(info, query, 'field_label', name="Field")
        parse_ints(info, query, 'deg', name='Field degree')
        parse_ints(info, query, 'disc', name="Field discriminant")
        parse_ints(info, query, 'dimension')
        parse_ints(info, query, 'level_norm', name="Level norm")
        parse_hmf_weight(info,
                         query,
                         'weight',
                         qfield=('parallel_weight', 'weight'))
    except ValueError:
        return search_input_error()

    count = parse_count(info, 100)
    start = parse_start(info)

    info['query'] = dict(query)
    C = getDBConnection()
    res = C.hmfs.forms.find(query).sort([('deg', pymongo.ASCENDING),
                                         ('disc', pymongo.ASCENDING),
                                         ('level_norm', pymongo.ASCENDING),
                                         ('level_label', pymongo.ASCENDING),
                                         ('label_nsuffix', pymongo.ASCENDING)
                                         ]).skip(start).limit(count)
    nres = res.count()
    if (start >= nres):
        start -= (1 + (start - nres) / count) * count
    if (start < 0):
        start = 0

    info['number'] = nres
    info['start'] = start
    info['more'] = int(start + count < nres)
    if nres == 1:
        info['report'] = 'unique match'
    else:
        if nres == 0:
            info['report'] = 'no matches'
        else:
            if nres > count or start != 0:
                info['report'] = 'displaying matches %s-%s of %s' % (
                    start + 1, min(nres, start + count), nres)
            else:
                info['report'] = 'displaying all %s matches' % nres

    res_clean = []
    for v in res:
        v_clean = {}
        v_clean['field_label'] = v['field_label']
        v_clean['short_label'] = v['short_label']
        v_clean['label'] = v['label']
        v_clean['level_ideal'] = teXify_pol(v['level_ideal'])
        v_clean['dimension'] = v['dimension']
        res_clean.append(v_clean)

    info['forms'] = res_clean

    t = 'Hilbert Modular Form search results'

    bread = [('Hilbert Modular Forms',
              url_for(".hilbert_modular_form_render_webpage")),
             ('Search results', ' ')]
    properties = []
    return render_template("hilbert_modular_form_search.html",
                           info=info,
                           title=t,
                           credit=hmf_credit,
                           properties=properties,
                           bread=bread,
                           learnmore=learnmore_list())