Exemplo n.º 1
0
def genus2_curve_search(info, query):
    parse_ints(info, query, 'abs_disc', 'absolute discriminant')
    parse_bool(info, query, 'is_gl2_type', 'is of GL2-type')
    parse_bool(info, query, 'has_square_sha', 'has square Sha')
    parse_bool(info, query, 'locally_solvable', 'is locally solvable')
    parse_bool(info, query, 'is_simple_geom', 'is geometrically simple')
    parse_ints(info, query, 'cond', 'conductor')
    if info.get('analytic_sha') == "None":
        query['analytic_sha'] = None
    else:
        parse_ints(info, query, 'analytic_sha', 'analytic order of sha')
    parse_ints(info, query, 'num_rat_pts', 'rational points')
    parse_ints(info, query, 'num_rat_wpts', 'rational Weierstrass points')
    parse_bracketed_posints(info,
                            query,
                            'torsion',
                            'torsion structure',
                            maxlength=4,
                            check_divisibility="increasing")
    parse_ints(info, query, 'torsion_order', 'torsion order')
    if 'torsion' in query and not 'torsion_order' in query:
        t_o = 1
        for n in query['torsion']:
            t_o *= int(n)
        query['torsion_order'] = t_o
    if 'torsion' in query:
        query['torsion_subgroup'] = str(query['torsion']).replace(" ", "")
        query.pop('torsion')  # search using string key, not array of ints
    geom_inv_type = info.get('geometric_invariants_type', 'igusa_clebsch_inv')
    if geom_inv_type == 'igusa_clebsch_inv':
        invlength = 4
    elif geom_inv_type == 'igusa_inv':
        invlength = 5
    else:
        invlength = 3
    parse_bracketed_rats(info,
                         query,
                         'geometric_invariants',
                         qfield=geom_inv_type,
                         exactlength=invlength,
                         split=False,
                         keepbrackets=True)
    parse_ints(info, query, 'two_selmer_rank', '2-Selmer rank')
    parse_ints(info, query, 'analytic_rank', 'analytic rank')
    # G2 invariants and drop-list items don't require parsing -- they are all strings (supplied by us, not the user)
    if 'g20' in info and 'g21' in info and 'g22' in info:
        query['g2_inv'] = "['%s','%s','%s']" % (info['g20'], info['g21'],
                                                info['g22'])
    if 'class' in info:
        query['class'] = info['class']
    for fld in ('st_group', 'real_geom_end_alg', 'aut_grp_id',
                'geom_aut_grp_id', 'end_alg', 'geom_end_alg'):
        if info.get(fld): query[fld] = info[fld]
    parse_primes(info,
                 query,
                 'bad_primes',
                 name='bad primes',
                 qfield='bad_primes',
                 mode=info.get('bad_quantifier'))
    info["curve_url"] = lambda label: url_for_curve_label(label)
    info["class_url"] = lambda label: url_for_isogeny_class_label(label)
Exemplo n.º 2
0
def genus2_curve_search(info, query):
    parse_ints(info, query, "abs_disc", "absolute discriminant")
    parse_bool(info, query, "is_gl2_type", "is of GL2-type")
    parse_bool(info, query, "has_square_sha", "has square Sha")
    parse_bool(info, query, "locally_solvable", "is locally solvable")
    parse_bool(info, query, "is_simple_geom", "is geometrically simple")
    parse_ints(info, query, "cond", "conductor")
    if info.get("analytic_sha") == "None":
        query["analytic_sha"] = None
    else:
        parse_ints(info, query, "analytic_sha", "analytic order of sha")
    parse_ints(info, query, "num_rat_pts", "rational points")
    parse_ints(info, query, "num_rat_wpts", "rational Weierstrass points")
    parse_bracketed_posints(
        info,
        query,
        "torsion",
        "torsion structure",
        maxlength=4,
        check_divisibility="increasing",
    )
    parse_ints(info, query, "torsion_order", "torsion order")
    if "torsion" in query and "torsion_order" not in query:
        t_o = 1
        for n in query["torsion"]:
            t_o *= int(n)
        query["torsion_order"] = t_o
    if "torsion" in query:
        query["torsion_subgroup"] = str(query["torsion"]).replace(" ", "")
        query.pop("torsion")  # search using string key, not array of ints
    parse_bracketed_rats(
        info,
        query,
        "geometric_invariants",
        qfield="g2_inv",
        minlength=3,
        maxlength=5,
        listprocess=geom_inv_to_G2,
        split=False,
        keepbrackets=True,
    )

    parse_ints(info, query, "two_selmer_rank", "2-Selmer rank")
    parse_ints(info, query, "analytic_rank", "analytic rank")
    # G2 invariants and drop-list items don't require parsing -- they are all strings (supplied by us, not the user)
    if "g20" in info and "g21" in info and "g22" in info:
        query["g2_inv"] = "['%s','%s','%s']" % (info["g20"], info["g21"],
                                                info["g22"])
    if "class" in info:
        query["class"] = info["class"]
    # Support legacy aut_grp_id
    if info.get("aut_grp_id"):
        info["aut_grp_label"] = ".".join(
            info.pop("aut_grp_id")[1:-1].split(","))
    if info.get("geom_aut_grp_id"):
        info["geom_aut_grp_label"] = ".".join(
            info.pop("geom_aut_grp_id")[1:-1].split(","))
    for fld in (
            "st_group",
            "real_geom_end_alg",
            "aut_grp_label",
            "geom_aut_grp_label",
            "end_alg",
            "geom_end_alg",
    ):
        if info.get(fld):
            query[fld] = info[fld]
    parse_primes(
        info,
        query,
        "bad_primes",
        name="bad primes",
        qfield="bad_primes",
        mode=info.get("bad_quantifier"),
    )
    parse_sort(info, query)