Ejemplo n.º 1
0
Archivo: main.py Proyecto: koffie/lmfdb
def abelian_variety_search(info, query):
    parse_ints(info,query,'q',name='base field')
    parse_ints(info,query,'g',name='dimension')
    parse_bool(info,query,'simple',qfield='is_simp')
    parse_bool(info,query,'primitive',qfield='is_prim')
    parse_bool_unknown(info, query, 'jacobian', qfield='is_jac')
    parse_bool_unknown(info, query, 'polarizable', qfield='is_pp')
    parse_ints(info,query,'p_rank')
    parse_ints(info,query,'ang_rank')
    parse_newton_polygon(info,query,'newton_polygon',qfield='slps')
    parse_string_start(info,query,'initial_coefficients',qfield='poly_str',initial_segment=["1"])
    parse_string_start(info,query,'abvar_point_count',qfield='A_cnts_str')
    parse_string_start(info,query,'curve_point_count',qfield='C_cnts_str',first_field='pt_cnt')
    if info.get('simple_quantifier') == 'contained':
        parse_subset(info,query,'simple_factors',qfield='simple_distinct',mode='subsets')
    elif info.get('simple_quantifier') == 'exactly':
        parse_subset(info,query,'simple_factors',qfield='simple_distinct',mode='exact')
    elif info.get('simple_quantifier') == 'include':
        parse_submultiset(info,query,'simple_factors',mode='append')
    for n in range(1,6):
        parse_ints(info,query,'dim%s_factors'%n)
    for n in range(1,4):
        parse_ints(info,query,'dim%s_distinct'%n)
    parse_nf_string(info,query,'number_field',qfield='nf')
    parse_galgrp(info,query,qfield=('galois_n','galois_t'))
Ejemplo n.º 2
0
def abelian_variety_search(info, query):
    parse_ints(info,query,'q',name='base field')
    parse_ints(info,query,'g',name='dimension')
    if 'simple' in info:
        if info['simple'] == 'yes':
            query['is_simp'] = True
        elif info['simple'] == 'no':
            query['is_simp'] = False
    if 'primitive' in info:
        if info['primitive'] == 'yes':
            query['is_prim'] = True
        elif info['primitive'] == 'no':
            query['is_prim'] = False
    if 'jacobian' in info:
        jac = info['jacobian']
        if jac == 'yes':
            query['is_jac'] = 1
        elif jac == 'not_no':
            query['is_jac'] = {'$gt' : -1}
        elif jac == 'not_yes':
            query['is_jac'] = {'$lt' : 1}
        elif jac == 'no':
            query['is_jac'] = -1
    if 'polarizable' in info:
        pol = info['polarizable']
        if pol == 'yes':
            query['is_pp'] = 1
        elif pol == 'not_no':
            query['is_pp'] = {'$gt' : -1}
        elif pol == 'not_yes':
            query['is_pp'] = {'$lt' : 1}
        elif pol == 'no':
            query['is_pp'] = -1
    parse_ints(info,query,'p_rank')
    parse_ints(info,query,'ang_rank')
    parse_newton_polygon(info,query,'newton_polygon',qfield='slps')
    parse_string_start(info,query,'initial_coefficients',qfield='poly_str',initial_segment=["1"])
    parse_string_start(info,query,'abvar_point_count',qfield='A_cnts_str')
    parse_string_start(info,query,'curve_point_count',qfield='C_cnts_str',first_field='pt_cnt')
    if info.get('simple_quantifier') == 'contained':
        parse_subset(info,query,'simple_factors',qfield='simple_distinct',mode='subsets')
    elif info.get('simple_quantifier') == 'exactly':
        parse_subset(info,query,'simple_factors',qfield='simple_distinct',mode='exact')
    elif info.get('simple_quantifier') == 'include':
        parse_submultiset(info,query,'simple_factors',mode='append')
    for n in range(1,6):
        parse_ints(info,query,'dim%s_factors'%n)
    for n in range(1,4):
        parse_ints(info,query,'dim%s_distinct'%n)
    parse_nf_string(info,query,'number_field',qfield='nf')
    parse_galgrp(info,query,qfield=('galois_n','galois_t'))
Ejemplo n.º 3
0
Archivo: main.py Proyecto: koffie/lmfdb
def abelian_variety_search(info, query):
    parse_ints(info, query, 'q', name='base field')
    parse_ints(info, query, 'g', name='dimension')
    parse_bool(info, query, 'simple', qfield='is_simp')
    parse_bool(info, query, 'primitive', qfield='is_prim')
    parse_bool_unknown(info, query, 'jacobian', qfield='is_jac')
    parse_bool_unknown(info, query, 'polarizable', qfield='is_pp')
    parse_ints(info, query, 'p_rank')
    parse_ints(info, query, 'ang_rank')
    parse_newton_polygon(info, query, 'newton_polygon', qfield='slps')
    parse_string_start(info,
                       query,
                       'initial_coefficients',
                       qfield='poly_str',
                       initial_segment=["1"])
    parse_string_start(info, query, 'abvar_point_count', qfield='A_cnts_str')
    parse_string_start(info,
                       query,
                       'curve_point_count',
                       qfield='C_cnts_str',
                       first_field='pt_cnt')
    if info.get('simple_quantifier') == 'contained':
        parse_subset(info,
                     query,
                     'simple_factors',
                     qfield='simple_distinct',
                     mode='subsets')
    elif info.get('simple_quantifier') == 'exactly':
        parse_subset(info,
                     query,
                     'simple_factors',
                     qfield='simple_distinct',
                     mode='exact')
    elif info.get('simple_quantifier') == 'include':
        parse_submultiset(info, query, 'simple_factors', mode='append')
    for n in range(1, 6):
        parse_ints(info, query, 'dim%s_factors' % n)
    for n in range(1, 4):
        parse_ints(info, query, 'dim%s_distinct' % n)
    parse_nf_string(info, query, 'number_field', qfield='nf')
    parse_galgrp(info, query, qfield=('galois_n', 'galois_t'))
Ejemplo n.º 4
0
Archivo: main.py Proyecto: 370417/lmfdb
def abelian_variety_search(**args):
    info = to_dict(args)

    if 'download' in info and info['download'] != 0:
        return download_search(info)

    bread = args.get('bread', get_bread(('Search Results', ' ')))
    if 'jump' in info:
        return by_label(info.get('label',''))
    query = {}

    try:
        parse_ints(info,query,'q',name='base field')
        parse_ints(info,query,'g',name='dimension')
        if 'simple' in info:
            if info['simple'] == 'yes':
                query['is_simp'] = True
            elif info['simple'] == 'no':
                query['is_simp'] = False
        if 'primitive' in info:
            if info['primitive'] == 'yes':
                query['is_prim'] = True
            elif info['primitive'] == 'no':
                query['is_prim'] = False
        if 'jacobian' in info:
            jac = info['jacobian']
            if jac == 'yes':
                query['is_jac'] = 1
            elif jac == 'not_no':
                query['is_jac'] = {'$gt' : -1}
            elif jac == 'not_yes':
                query['is_jac'] = {'$lt' : 1}
            elif jac == 'no':
                query['is_jac'] = -1
        if 'polarizable' in info:
            pol = info['polarizable']
            if pol == 'yes':
                query['is_pp'] = 1
            elif pol == 'not_no':
                query['is_pp'] = {'$gt' : -1}
            elif pol == 'not_yes':
                query['is_pp'] = {'$lt' : 1}
            elif pol == 'no':
                query['is_pp'] = -1
        parse_ints(info,query,'p_rank')
        parse_ints(info,query,'ang_rank')
        parse_newton_polygon(info,query,'newton_polygon',qfield='slps') # TODO
        parse_string_start(info,query,'initial_coefficients',qfield='poly',initial_segment=["1"])
        parse_string_start(info,query,'abvar_point_count',qfield='A_cnts')
        parse_string_start(info,query,'curve_point_count',qfield='C_cnts',first_field='pt_cnt')
        parse_abvar_decomp(info,query,'decomposition',qfield='decomp',av_stats=AbvarFqStats())
        parse_nf_string(info,query,'number_field',qfield='nf')
        parse_galgrp(info,query,qfield='gal')
    except ValueError:
        return search_input_error(info, bread)

    info['query'] = query
    count = parse_count(info, 50)
    start = parse_start(info)

    cursor = db().find(query)
    nres = cursor.count()
    if start >= nres:
        start -= (1 + (start - nres) / count) * count
    if start < 0:
        start = 0


    res = cursor.sort([('sort', ASCENDING)]).skip(start).limit(count)
    res = list(res)
    info['abvars'] = [AbvarFq_isoclass(x) for x in res]
    info['number'] = nres
    info['start'] = start
    info['count'] = count
    info['more'] = int(start + count < nres)
    if nres == 1:
        info['report'] = 'unique match'
    elif nres == 0:
        info['report'] = 'no matches'
    elif 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
    t = 'Abelian Variety search results'
    return render_template("abvarfq-search-results.html", info=info, credit=abvarfq_credit, bread=bread, title=t)
Ejemplo n.º 5
0
def abelian_variety_search(info, query):
    parse_ints(info, query, 'q', name='base field')
    parse_ints(info, query, 'g', name='dimension')
    if 'simple' in info:
        if info['simple'] == 'yes':
            query['is_simp'] = True
        elif info['simple'] == 'no':
            query['is_simp'] = False
    if 'primitive' in info:
        if info['primitive'] == 'yes':
            query['is_prim'] = True
        elif info['primitive'] == 'no':
            query['is_prim'] = False
    if 'jacobian' in info:
        jac = info['jacobian']
        if jac == 'yes':
            query['is_jac'] = 1
        elif jac == 'not_no':
            query['is_jac'] = {'$gt': -1}
        elif jac == 'not_yes':
            query['is_jac'] = {'$lt': 1}
        elif jac == 'no':
            query['is_jac'] = -1
    if 'polarizable' in info:
        pol = info['polarizable']
        if pol == 'yes':
            query['is_pp'] = 1
        elif pol == 'not_no':
            query['is_pp'] = {'$gt': -1}
        elif pol == 'not_yes':
            query['is_pp'] = {'$lt': 1}
        elif pol == 'no':
            query['is_pp'] = -1
    parse_ints(info, query, 'p_rank')
    parse_ints(info, query, 'ang_rank')
    parse_newton_polygon(info, query, 'newton_polygon', qfield='slps')
    parse_string_start(info,
                       query,
                       'initial_coefficients',
                       qfield='poly_str',
                       initial_segment=["1"])
    parse_string_start(info, query, 'abvar_point_count', qfield='A_cnts_str')
    parse_string_start(info,
                       query,
                       'curve_point_count',
                       qfield='C_cnts_str',
                       first_field='pt_cnt')
    if info.get('simple_quantifier') == 'contained':
        parse_subset(info,
                     query,
                     'simple_factors',
                     qfield='simple_distinct',
                     mode='subsets')
    elif info.get('simple_quantifier') == 'exactly':
        parse_subset(info,
                     query,
                     'simple_factors',
                     qfield='simple_distinct',
                     mode='exact')
    elif info.get('simple_quantifier') == 'include':
        parse_submultiset(info, query, 'simple_factors', mode='append')
    for n in range(1, 6):
        parse_ints(info, query, 'dim%s_factors' % n)
    for n in range(1, 4):
        parse_ints(info, query, 'dim%s_distinct' % n)
    parse_nf_string(info, query, 'number_field', qfield='nf')
    parse_galgrp(info, query, qfield=('galois_n', 'galois_t'))
Ejemplo n.º 6
0
def abelian_variety_search(**args):
    info = to_dict(args)

    if 'download' in info and info['download'] != 0:
        return download_search(info)

    bread = args.get('bread', get_bread(('Search Results', ' ')))
    if 'jump' in info:
        return by_label(info.get('label',''))
    query = {}

    try:
        parse_ints(info,query,'q',name='base field')
        parse_ints(info,query,'g',name='dimension')
        if 'simple' in info:
            if info['simple'] == 'yes':
                query['is_simp'] = True
            elif info['simple'] == 'no':
                query['is_simp'] = False
        if 'primitive' in info:
            if info['primitive'] == 'yes':
                query['is_prim'] = True
            elif info['primitive'] == 'no':
                query['is_prim'] = False
        if 'jacobian' in info:
            jac = info['jacobian']
            if jac == 'yes':
                query['is_jac'] = 1
            elif jac == 'not_no':
                query['is_jac'] = {'$gt' : -1}
            elif jac == 'not_yes':
                query['is_jac'] = {'$lt' : 1}
            elif jac == 'no':
                query['is_jac'] = -1
        if 'polarizable' in info:
            pol = info['polarizable']
            if pol == 'yes':
                query['is_pp'] = 1
            elif pol == 'not_no':
                query['is_pp'] = {'$gt' : -1}
            elif pol == 'not_yes':
                query['is_pp'] = {'$lt' : 1}
            elif pol == 'no':
                query['is_pp'] = -1
        parse_ints(info,query,'p_rank')
        parse_ints(info,query,'ang_rank')
        parse_newton_polygon(info,query,'newton_polygon',qfield='slps') # TODO
        parse_string_start(info,query,'initial_coefficients',qfield='poly',initial_segment=["1"])
        parse_string_start(info,query,'abvar_point_count',qfield='A_cnts')
        parse_string_start(info,query,'curve_point_count',qfield='C_cnts',first_field='pt_cnt')
        parse_abvar_decomp(info,query,'decomposition',qfield='decomp',av_stats=AbvarFqStats())
        parse_nf_string(info,query,'number_field',qfield='nf')
        parse_galgrp(info,query,qfield='gal')
    except ValueError:
        return search_input_error(info, bread)

    info['query'] = query
    count = parse_count(info, 50)
    start = parse_start(info)

    cursor = db().find(query)
    nres = cursor.count()
    if start >= nres:
        start -= (1 + (start - nres) / count) * count
    if start < 0:
        start = 0


    res = cursor.sort([('sort', ASCENDING)]).skip(start).limit(count)
    res = list(res)
    info['abvars'] = [AbvarFq_isoclass(x) for x in res]
    info['number'] = nres
    info['start'] = start
    info['count'] = count
    info['more'] = int(start + count < nres)
    if nres == 1:
        info['report'] = 'unique match'
    elif nres == 0:
        info['report'] = 'no matches'
    elif 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
    t = 'Abelian Variety search results'
    return render_template("abvarfq-search-results.html", info=info, credit=abvarfq_credit, bread=bread, title=t)