Beispiel #1
0
def browse():
    data = ECNF_stats().sigs_by_deg
    # We could use the dict directly but then could not control the order
    # of the keys (degrees), so we use a list
    info = [[d,['%s,%s'%sig for sig in data[d]]] for d in sorted(data.keys())]
    t = 'Elliptic curves over number fields'
    bread = [('Elliptic curves', url_for("ecnf.index")),
             ('Browse', ' ')]
    return render_template("ecnf-stats.html", info=info, title=t, bread=bread, learnmore=learnmore_list())
Beispiel #2
0
def browse():
    data = ECNF_stats().sigs_by_deg
    # We could use the dict directly but then could not control the order
    # of the keys (degrees), so we use a list
    info = [[d,['%s,%s'%sig for sig in data[d]]] for d in sorted(data.keys())]
    credit = 'John Cremona'
    t = 'Elliptic Curves over Number Fields'
    bread = [('Elliptic Curves', url_for("ecnf.index")),
             ('Browse', ' ')]
    return render_template("ecnf-stats.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list())
Beispiel #3
0
def statistics_by_signature(d, r):
    if d == 1:
        return redirect(url_for("ec.statistics"))

    info = {}

    sigs_by_deg = ECNF_stats().sigs_by_deg
    if d not in sigs_by_deg:
        info[
            'error'] = "The database does not contain any elliptic curves defined over fields of degree %s" % d
    else:
        info['degree'] = d

    if not r in range(d % 2, d + 1, 2):
        info['error'] = "Invalid signature %s" % info['sig']
    s = (d - r) // 2
    sig = (r, s)
    info['sig'] = '%s,%s' % sig
    info['summary'] = ECNF_stats().signature_summary(sig)

    fields_by_sig = ECNF_stats().fields_by_sig
    counts_by_field = ECNF_stats().field_normstats

    def field_counts(f):
        return [f, counts_by_field[f]]

    info['sig_stats'] = [field_counts(f) for f in fields_by_sig[sig]]
    credit = 'John Cremona'
    if info['sig'] == '2,0':
        t = 'Elliptic Curves over Real Quadratic Number Fields'
    elif info['sig'] == '0,1':
        t = 'Elliptic Curves over Imaginary Quadratic Number Fields'
    elif info['sig'] == '3,0':
        t = 'Elliptic Curves over Totally Real Cubic Number fields'
    elif info['sig'] == '1,1':
        t = 'Elliptic Curves over Mixed Cubic Number Fields'
    elif info['sig'] == '4,0':
        t = 'Elliptic Curves over Totally Real Quartic Number Fields'
    elif info['sig'] == '5,0':
        t = 'Elliptic Curves over Totally Real Quintic Number Fields'
    elif info['sig'] == '6,0':
        t = 'Elliptic Curves over Totally Real Sextic Number Fields'
    else:
        t = 'Elliptic Curves over Number Fields of Degree %s, Signature (%s)' % (
            d, info['sig'])
    bread = [('Elliptic Curves', url_for("ecnf.index")),
             ('Degree %s' % d, url_for("ecnf.statistics_by_degree", d=d)),
             ('Signature (%s)' % info['sig'], ' ')]
    return render_template("ecnf-by-signature.html",
                           info=info,
                           credit=credit,
                           title=t,
                           bread=bread,
                           learnmore=learnmore_list())
Beispiel #4
0
def statistics_by_degree(d):
    if d == 1:
        return redirect(url_for("ec.statistics"))
    info = {}

    sigs_by_deg = ECNF_stats().sigs_by_deg
    if d not in sigs_by_deg:
        info[
            'error'] = "The database does not contain any elliptic curves defined over fields of degree %s" % d
    else:
        info['degree'] = d

    fields_by_sig = ECNF_stats().fields_by_sig
    counts_by_sig = ECNF_stats().sig_normstats
    counts_by_field = ECNF_stats().field_normstats

    def field_counts(f):
        return [f, counts_by_field[f]]

    def sig_counts(sig):
        return [
            '%s,%s' % sig, counts_by_sig[sig],
            [field_counts(f) for f in fields_by_sig[sig]]
        ]

    info['summary'] = ECNF_stats().degree_summary(d)
    info['sig_stats'] = [sig_counts(sig) for sig in sigs_by_deg[d]]
    credit = 'John Cremona'
    if d == 2:
        t = 'Elliptic Curves over Quadratic Number Fields'
    elif d == 3:
        t = 'Elliptic Curves over Cubic Number Fields'
    elif d == 4:
        t = 'Elliptic Curves over Quartic Number Fields'
    elif d == 5:
        t = 'Elliptic Curves over Quintic Number Fields'
    elif d == 6:
        t = 'Elliptic Curves over Sextic Number Fields'
    else:
        t = 'Elliptic Curves over Number Fields of Degree {}'.format(d)

    bread = [('Elliptic Curves', url_for("ecnf.index")),
             ('Degree %s' % d, ' ')]
    return render_template("ecnf-by-degree.html",
                           info=info,
                           credit=credit,
                           title=t,
                           bread=bread,
                           learnmore=learnmore_list())
Beispiel #5
0
def tor_struct_search_nf(prefill="any"):
    def fix(t):
        return t + ' selected = "yes"' if prefill == t else t

    def cyc(n):
        return [fix("[" + str(n) + "]"), "C{}".format(n)]

    def cyc2(m, n):
        return [fix("[{},{}]".format(m, n)), "C{}×C{}".format(m, n)]

    gps = [[fix(""), "any"], [fix("[]"), "trivial"]]

    tors = ECNF_stats().torsion_counts

    # The following was the set as of 24/4/2017:
    # assert tors == [[2], [2, 2], [2, 4], [2, 6], [2, 8], [2, 10], [2, 12], [2, 14], [2, 16], [2, 18], [3], [3, 3], [3, 6], [4], [4, 4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [25], [27], [37]]

    for t in tors:
        if len(t) == 1:
            gps.append(cyc(t[0]))
        elif len(t) == 2:
            gps.append(cyc2(*t))

    return "\n".join(
        ["<select name='torsion_structure'>"] +
        ["<option value={}>{}</option>".format(a, b)
         for a, b in gps] + ["</select>"])
Beispiel #6
0
def index():
    #    if 'jump' in request.args:
    #        return show_ecnf1(request.args['label'])
    info = to_dict(request.args, search_array=ECNFSearchArray(), stats=ECNF_stats())
    if request.args:
        return elliptic_curve_search(info)
    bread = get_bread()

    # the dict data will hold additional information to be displayed on
    # the main browse and search page


    # info['fields'] holds data for a sample of number fields of different
    # signatures for a general browse:

    info['fields'] = []
    # Rationals
    # info['fields'].append(['the rational field', (('1.1.1.1', [url_for('ec.rational_elliptic_curves'), '$\Q$']),)]) # Removed due to ambiguity

    # Real quadratics (sample)
    rqfs = ['2.2.{}.1'.format(d) for d in [8, 12, 5, 24, 28, 40, 44, 13, 56, 60]]
    info['fields'].append(['By <a href="{}">real quadratic field</a>'.format(url_for('.statistics_by_signature', d=2, r=2)),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in rqfs)])

    # Imaginary quadratics (sample)
    iqfs = ['2.0.{}.1'.format(d) for d in [4, 8, 3, 7, 11, 19, 43]]
    info['fields'].append(['By <a href="{}">imaginary quadratic field</a>'.format(url_for('.statistics_by_signature', d=2, r=0)),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in iqfs)])

    # Cubics (sample)
    cubics = ['3.1.23.1'] + ['3.3.{}.1'.format(d) for d in [49,81,148,169,229,257,316]]
    info['fields'].append(['By <a href="{}">cubic field</a>'.format(url_for('.statistics_by_degree', d=3)),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in cubics)])

    # Quartics (sample)
    quartics = ['4.4.{}.1'.format(d) for d in [725,1125,1600,1957,2000,2048,2225,2304]]
    info['fields'].append(['By <a href="{}">totally real quartic field</a>'.format(url_for('.statistics_by_degree', d=4)),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in quartics)])

    # Quintics (sample)
    quintics = ['5.5.{}.1'.format(d) for d in [14641, 24217, 36497, 38569, 65657, 70601, 81509]]
    info['fields'].append(['By <a href="{}">totally real quintic field</a>'.format(url_for('.statistics_by_degree', d=5)),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in quintics)])

    # Sextics (sample)
    sextics = ['6.6.{}.1'.format(d) for d in [300125, 371293, 434581, 453789, 485125, 592661, 703493]]
    info['fields'].append(['By <a href="{}">totally real sextic field</a>'.format(url_for('.statistics_by_degree', d=6)),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in sextics)])

    return render_template("ecnf-index.html",
                           title="Elliptic curves over number fields",
                           info=info,
                           bread=bread, learnmore=learnmore_list())
Beispiel #7
0
def statistics():
    title = "Elliptic curves: statistics"
    bread = get_bread("Statistics")
    return render_template("display_stats.html",
                           info=ECNF_stats(),
                           title=title,
                           bread=bread,
                           learnmore=learnmore_list())
Beispiel #8
0
    def __init__(self):
        field = TextBox(name="field",
                        label="Base field",
                        knowl="ag.base_field",
                        example="2.2.5.1",
                        example_span="2.2.5.1 or Qsqrt5")
        include_base_change = ExcludeOnlyBox(name="include_base_change",
                                             label="Base change curves",
                                             knowl="ec.base_change")
        include_Q_curves = ExcludeOnlyBox(name="include_Q_curves",
                                          label=r"\(\Q\)-curves",
                                          knowl="ec.q_curve")
        conductor_norm = TextBox(name="conductor_norm",
                                 label="Conductor norm",
                                 knowl="ec.conductor",
                                 example="31",
                                 example_span="31 or 1-100")
        one = SelectBox(name="one",
                        label="Curves per isogeny class",
                        knowl="ec.isogeny_class",
                        example="all, one",
                        options=[("", "all"), ("yes", "one")])
        include_cm = SelectBox(name="include_cm",
                               label="CM",
                               knowl="ec.complex_multiplication",
                               options=[('', ''), ('PCM', 'potential CM'),
                                        ('PCMnoCM', 'potential CM but no CM'),
                                        ('CM', 'CM'),
                                        ('noPCM', 'no potential CM')])
        cm_disc = TextBox(name="cm_disc",
                          label="CM discriminant",
                          example="-4",
                          example_span="-4 or -3,-8",
                          knowl="ec.complex_multiplication")
        jinv = TextBox(name="jinv",
                       label="j-invariant",
                       knowl="ec.j_invariant",
                       width=685,
                       short_width=160,
                       colspan=(1, 4, 1),
                       example_span_colspan=2,
                       example="105474/49 + a*34213/49",
                       example_span="")
        rank = TextBox(name="rank",
                       label="Rank*",
                       knowl="ec.rank",
                       example="2")
        torsion = TextBox(name="torsion",
                          label="Torsion order",
                          knowl="ec.torsion_order",
                          example="2")
        bf_deg = SelectBox(name="bf_deg",
                           label="Base field degree",
                           knowl="nf.degree",
                           options=[("", ""), ("2", "2"), ("3", "3"),
                                    ("4", "4"), ("5", "5"), ("6", "6")])

        tor_opts = (
            [("", ""), ("[]", "trivial")] +
            [disp_tor(tuple(t)) for t in ECNF_stats().torsion_counts if t])
        torsion_structure = SelectBox(name="torsion_structure",
                                      label="Torsion structure",
                                      knowl="ec.torsion_subgroup",
                                      options=tor_opts)
        sha = TextBox(name="sha",
                      label="Analytic order* of &#1064;",
                      knowl="ec.analytic_sha_order",
                      example="4")
        regulator = TextBox(name="regulator",
                            label="Regulator*",
                            knowl="ec.regulator",
                            example="8.4-9.1")
        bad_quant = SubsetBox(name="bad_quantifier")
        bad_primes = TextBoxWithSelect(name="conductor_norm_factors",
                                       label="Bad primes",
                                       knowl="ec.reduction_type",
                                       example="5,13",
                                       select_box=bad_quant)
        isodeg = TextBox(name="isodeg",
                         label="Cyclic isogeny degree",
                         knowl="ec.isogeny",
                         example="16")
        semistable = YesNoBox(name="semistable",
                              label="Semistable",
                              example="Yes",
                              knowl="ec.semistable")
        potential_good_reduction = YesNoBox(
            name="potential_good_reduction",
            label="Potential good reduction",
            example="Yes",
            knowl="ec.potential_good_reduction")
        class_size = TextBox(name="class_size",
                             label="Isogeny class size",
                             knowl="ec.isogeny",
                             example="4")
        class_deg = TextBox(name="class_deg",
                            label="Isogeny class degree",
                            knowl="ec.isogeny",
                            example="16")
        count = CountBox()

        self.browse_array = [[field, bf_deg],
                             [conductor_norm, include_base_change],
                             [rank, include_Q_curves],
                             [torsion, torsion_structure],
                             [cm_disc, include_cm], [sha, regulator],
                             [isodeg, one], [class_size, class_deg],
                             [semistable, potential_good_reduction], [jinv],
                             [count, bad_primes]]

        self.refine_array = [
            [field, conductor_norm, rank, torsion, cm_disc],
            [
                bf_deg, include_base_change, include_Q_curves,
                torsion_structure, include_cm
            ],
            [sha, isodeg, class_size, semistable, jinv],
            [regulator, one, class_deg, potential_good_reduction, bad_primes],
        ]
Beispiel #9
0
def elliptic_curve_search(info, query):
    parse_nf_string(info,
                    query,
                    'field',
                    name="base number field",
                    qfield='field_label')
    if query.get('field_label') == '1.1.1.1':
        return redirect(url_for("ec.rational_elliptic_curves", **request.args),
                        301)

    parse_ints(info, query, 'conductor_norm')
    parse_noop(info, query, 'conductor_label')
    parse_ints(info, query, 'rank')
    parse_ints(info,
               query,
               'torsion',
               name='Torsion order',
               qfield='torsion_order')
    parse_bracketed_posints(info, query, 'torsion_structure', maxlength=2)
    if 'torsion_structure' in query and 'torsion_order' not in query:
        t_o = 1
        for n in query['torsion_structure']:
            t_o *= int(n)
        query['torsion_order'] = t_o
    parse_element_of(info,
                     query,
                     'isodeg',
                     split_interval=1000,
                     contained_in=ECNF_stats().isogeny_degrees)
    parse_bool(info, query, 'semistable', 'semistable')
    parse_bool(info, query, 'potential_good_reduction',
               'potential_good_reduction')
    parse_ints(info, query, 'class_size', 'class_size')
    parse_ints(info, query, 'class_deg', 'class_deg')
    parse_ints(info, query, 'sha', 'analytic order of &#1064;')
    parse_floats(info, query, 'reg', 'regulator')
    parse_nf_jinv(info,
                  query,
                  'jinv',
                  'j-invariant',
                  field_label=query.get('field_label'))

    if info.get('one') == "yes":
        info['number'] = 1
        query['number'] = 1

    if 'include_base_change' in info:
        if info['include_base_change'] in [
                'exclude', 'off'
        ]:  # off for backward compat with urls
            query['base_change'] = []
        if info['include_base_change'] == 'only':
            query['base_change'] = {'$ne': []}
    else:
        info['include_base_change'] = "on"

    if 'include_Q_curves' in info:
        if info['include_Q_curves'] == 'exclude':
            query['q_curve'] = False
        elif info['include_Q_curves'] == 'only':
            query['q_curve'] = True

    parse_cm_list(info,
                  query,
                  field='cm_disc',
                  qfield='cm',
                  name="CM discriminant")

    if 'include_cm' in info:
        if info['include_cm'] == 'PCM':
            tmp = {'$ne': 0}
            if 'cm' in query:
                query['cm'] = {'$and': [tmp, query['cm']]}
            else:
                query['cm'] = tmp
        elif info['include_cm'] == 'PCMnoCM':
            tmp = {'$lt': 0}
            if 'cm' in query:
                query['cm'] = {'$and': [tmp, query['cm']]}
            else:
                query['cm'] = tmp
        elif info['include_cm'] == 'CM':
            tmp = {'$gt': 0}
            if 'cm' in query:
                query['cm'] = {'$and': [tmp, query['cm']]}
            else:
                query['cm'] = tmp
        elif info['include_cm'] == 'noPCM':
            tmp = 0
            if 'cm' in query:
                query['cm'] = {'$and': [tmp, query['cm']]}
            else:
                query['cm'] = tmp

    parse_primes(info,
                 query,
                 'conductor_norm_factors',
                 name='bad primes',
                 qfield='conductor_norm_factors',
                 mode=info.get('bad_quantifier'))
    info['field_pretty'] = field_pretty
    parse_ints(info,
               query,
               'bf_deg',
               name='Base field degree',
               qfield='degree')
Beispiel #10
0
    def __init__(self):
        field = TextBox(name="field",
                        label="Base field",
                        knowl="nf",
                        example="2.2.5.1",
                        example_span="2.2.5.1 or Qsqrt5")
        include_base_change = ExcludeOnlyBox(name="include_base_change",
                                             label="Base change curves",
                                             knowl="ec.base_change")
        include_Q_curves = ExcludeOnlyBox(name="include_Q_curves",
                                          label=r"\(\Q\)-curves",
                                          knowl="ec.q_curve")
        conductor_norm = TextBox(name="conductor_norm",
                                 label="Conductor norm",
                                 knowl="ec.conductor",
                                 example="31",
                                 example_span="31 or 1-100")
        one = SelectBox(name="one",
                        label="Curves per isogeny class",
                        knowl="ec.isogeny_class",
                        options=[("", ""), ("yes", "one")])
        include_cm = ExcludeOnlyBox(name="include_cm",
                                    label="CM",
                                    knowl="ec.complex_multiplication")
        cm_disc = TextBox(name="cm_disc",
                          label="CM discriminant",
                          example="-4",
                          example_span="-4 or -3,-8",
                          knowl="ec.complex_multiplication")
        jinv = TextBox(name="jinv",
                       label="j-invariant",
                       knowl="ec.j_invariant",
                       width=675,
                       short_width=160,
                       colspan=(1, 4, 1),
                       example_span_colspan=2,
                       example="105474/49 + a*34213/49",
                       example_span="")
        torsion = TextBox(name="torsion",
                          label="Torsion order",
                          knowl="ec.torsion_order",
                          example="2")

        def disp_tor(t):
            if len(t) == 1:
                return "[%s]" % t, "C%s" % t
            else:
                return "[%s,%s]" % t, "C%s&times;C%s" % t

        tor_opts = (
            [("", ""), ("[]", "trivial")] +
            [disp_tor(tuple(t)) for t in ECNF_stats().torsion_counts if t])
        torsion_structure = SelectBox(name="torsion_structure",
                                      label="Torsion structure",
                                      knowl="ec.torsion_subgroup",
                                      options=tor_opts)
        isodeg = TextBox(name="isodeg",
                         label="Cyclic isogeny degree",
                         knowl="ec.isogeny",
                         example="16")
        count = CountBox()

        self.browse_array = [[jinv], [field, include_base_change],
                             [conductor_norm, include_Q_curves],
                             [torsion, torsion_structure],
                             [cm_disc, include_cm], [isodeg, one], [count]]

        self.refine_array = [[
            field, conductor_norm, jinv, include_base_change, include_Q_curves
        ], [isodeg, torsion, torsion_structure, include_cm, cm_disc], [one]]
Beispiel #11
0
def index():
    #    if 'jump' in request.args:
    #        return show_ecnf1(request.args['label'])
    info = to_dict(request.args, search_array=ECNFSearchArray())
    if request.args:
        return elliptic_curve_search(info)
    bread = get_bread()

    # the dict data will hold additional information to be displayed on
    # the main browse and search page

    # info['fields'] holds data for a sample of number fields of different
    # signatures for a general browse:

    fields_by_deg = ECNF_stats().fields_by_deg
    fields_by_sig = ECNF_stats().fields_by_sig
    info['fields'] = []
    # Rationals
    # info['fields'].append(['the rational field', (('1.1.1.1', [url_for('ec.rational_elliptic_curves'), '$\Q$']),)]) # Removed due to ambiguity

    # Real quadratics (sample)
    rqfs = ['2.2.{}.1'.format(d) for d in [5, 89, 229, 497]]
    niqfs = len(fields_by_sig[0, 1])
    nrqfs = len(fields_by_sig[2, 0])
    info['fields'].append([
        '{} real quadratic fields, including'.format(nrqfs),
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in rqfs)
    ])

    # Imaginary quadratics (sample)
    iqfs = ['2.0.{}.1'.format(d) for d in [4, 8, 3, 7, 11]]
    info['fields'].append([
        '{} imaginary quadratic fields, including'.format(niqfs),
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in iqfs)
    ])

    # Cubics (sample)
    cubics = ['3.1.23.1'] + ['3.3.{}.1'.format(d) for d in [49, 148, 1957]]
    ncubics = len(fields_by_deg[3])
    info['fields'].append([
        '{} cubic fields, including'.format(ncubics),
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in cubics)
    ])

    # Quartics (sample)
    quartics = ['4.4.{}.1'.format(d) for d in [725, 2777, 9909, 19821]]
    nquartics = len(fields_by_deg[4])
    info['fields'].append([
        '{} totally real quartic fields, including'.format(nquartics),
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in quartics)
    ])

    # Quintics (sample)
    quintics = [
        '5.5.{}.1'.format(d) for d in [14641, 24217, 36497, 38569, 65657]
    ]
    nquintics = len(fields_by_deg[5])
    info['fields'].append([
        '{} totally real quintic fields, including'.format(nquintics),
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in quintics)
    ])

    # Sextics (sample)
    sextics = [
        '6.6.{}.1'.format(d) for d in [300125, 371293, 434581, 453789, 485125]
    ]
    nsextics = len(fields_by_deg[6])
    info['fields'].append([
        '{} totally real sextic fields, including'.format(nsextics),
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in sextics)
    ])

    info['degrees'] = sorted(
        [int(d) for d in fields_by_deg.keys() if d != '_id'])

    # info['highlights'] holds data (URL and descriptive text) for a
    # sample of elliptic curves with interesting features:

    info['highlights'] = []
    info['highlights'].append([
        'A curve with $C_3\\times C_3$ torsion',
        url_for('.show_ecnf',
                nf='2.0.3.1',
                class_label='a',
                conductor_label='2268.36.18',
                number=int(1))
    ])
    info['highlights'].append([
        'A curve with $C_4\\times C_4$ torsion',
        url_for('.show_ecnf',
                nf='2.0.4.1',
                class_label='b',
                conductor_label='5525.870.5',
                number=int(9))
    ])
    info['highlights'].append([
        'A curve with CM by $\\sqrt{-267}$',
        url_for('.show_ecnf',
                nf='2.2.89.1',
                class_label='a',
                conductor_label='81.1',
                number=int(1))
    ])
    info['highlights'].append([
        'An isogeny class with isogenies of degree $3$ and $89$ (and $267$)',
        url_for('.show_ecnf_isoclass',
                nf='2.2.89.1',
                class_label='a',
                conductor_label='81.1')
    ])
    info['highlights'].append([
        'A curve with everywhere good reduction, but no global minimal model',
        url_for('.show_ecnf',
                nf='2.2.229.1',
                class_label='a',
                conductor_label='1.1',
                number=int(1))
    ])

    return render_template("ecnf-index.html",
                           title="Elliptic Curves over Number Fields",
                           info=info,
                           bread=bread,
                           learnmore=learnmore_list())
Beispiel #12
0
def elliptic_curve_search(info, query):
    parse_nf_string(info,query,'field',name="base number field",qfield='field_label')
    if query.get('field_label') == '1.1.1.1':
        return redirect(url_for("ec.rational_elliptic_curves", **request.args), 301)

    parse_ints(info,query,'conductor_norm')
    parse_noop(info,query,'conductor_label')
    parse_ints(info,query,'rank')
    parse_ints(info,query,'torsion',name='Torsion order',qfield='torsion_order')
    parse_bracketed_posints(info,query,'torsion_structure',maxlength=2)
    if 'torsion_structure' in query and not 'torsion_order' in query:
        t_o = 1
        for n in query['torsion_structure']:
            t_o *= int(n)
        query['torsion_order'] = t_o
    parse_element_of(info,query,'isodeg',split_interval=1000,contained_in=ECNF_stats().isogeny_degrees)
    parse_bool(info,query,'semistable','semistable')
    parse_bool(info,query,'potential_good_reduction','potential_good_reduction')
    parse_ints(info,query,'class_size','class_size')
    parse_ints(info,query,'class_deg','class_deg')
    parse_ints(info,query,'sha','analytic order of &#1064;')
    parse_floats(info,query,'reg','regulator')

    if 'jinv' in info:
        if info.get('field','').strip() == '2.2.5.1':
            info['jinv'] = info['jinv'].replace('phi','a')
        if info.get('field','').strip() == '2.0.4.1':
            info['jinv'] = info['jinv'].replace('i','a')
        if not 'a' in info['jinv'] and not info.get('field'): # rational j-invariant allowed for any field
            parse_rational(info, query, 'jinv', name='j-invariant')
            if query.get('jinv'):
                query['jinv'] = {'$regex': '^' + query['jinv'] + '(,0)*$'} # nf elements like j,0,0,0
        else: # j-invariant is a number field element
            parse_nf_elt(info, query, 'jinv', name='j-invariant')
            if query.get('jinv'):
                query['jinv'] = ','.join(query['jinv'])

    if info.get('one') == "yes":
        info['number'] = 1
        query['number'] = 1

    if 'include_base_change' in info:
        if info['include_base_change'] in ['exclude', 'off']: # off for backward compat with urls
            query['base_change'] = []
        if info['include_base_change'] == 'only':
            query['base_change'] = {'$ne':[]}
    else:
        info['include_base_change'] = "on"

    if 'include_Q_curves' in info:
        if info['include_Q_curves'] == 'exclude':
            query['q_curve'] = False
        elif info['include_Q_curves'] == 'only':
            query['q_curve'] = True

    if 'include_cm' in info:
        if info['include_cm'] == 'PCM':
            query['cm'] = {'$ne' : 0}
        elif info['include_cm'] == 'PCMnoCM':
            query['cm'] = {'$lt' : 0}
        elif info['include_cm'] == 'CM':
            query['cm'] = {'$gt' : 0}
        elif info['include_cm'] == 'noPCM':
            query['cm'] = 0

    parse_ints(info,query,field='cm_disc',qfield='cm')
    parse_primes(info, query, 'conductor_norm_factors', name='bad primes',
             qfield='conductor_norm_factors',mode=info.get('bad_quantifier'))
    info['field_pretty'] = field_pretty
    info['web_ainvs'] = web_ainvs
    parse_ints(info,query,'bf_deg',name='Base field degree',qfield='degree')
Beispiel #13
0
def index():
    #    if 'jump' in request.args:
    #        return show_ecnf1(request.args['label'])
    if len(request.args) > 0:
        return elliptic_curve_search(request.args)
    bread = get_bread()

    # the dict data will hold additional information to be displayed on
    # the main browse and search page

    data = {}

    # data['fields'] holds data for a sample of number fields of different
    # signatures for a general browse:

    fields_by_deg = ECNF_stats().fields_by_deg
    fields_by_sig = ECNF_stats().fields_by_sig
    data['fields'] = []
    # Rationals
    data['fields'].append(['the rational field', (('1.1.1.1', [url_for('ec.rational_elliptic_curves'), '$\Q$']),)])

    # Real quadratics (sample)
    rqfs = ['2.2.{}.1'.format(d) for d in [5, 89, 229, 497]]
    niqfs = len(fields_by_sig[0,1])
    nrqfs = len(fields_by_sig[2,0])
    data['fields'].append(['{} real quadratic fields, including'.format(nrqfs),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in rqfs)])

    # Imaginary quadratics (sample)
    iqfs = ['2.0.{}.1'.format(d) for d in [4, 8, 3, 7, 11]]
    data['fields'].append(['{} imaginary quadratic fields, including'.format(niqfs),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in iqfs)])

    # Cubics (sample)
    cubics = ['3.1.23.1'] + ['3.3.{}.1'.format(d) for d in [49,148,1957]]
    ncubics = len(fields_by_deg[3])
    data['fields'].append(['{} cubic fields, including'.format(ncubics),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in cubics)])

    # Quartics (sample)
    quartics = ['4.4.{}.1'.format(d) for d in [725,2777,9909,19821]]
    nquartics = len(fields_by_deg[4])
    data['fields'].append(['{} totally real quartic fields, including'.format(nquartics),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in quartics)])

    # Quintics (sample)
    quintics = ['5.5.{}.1'.format(d) for d in [14641, 24217, 36497, 38569, 65657]]
    nquintics = len(fields_by_deg[5])
    data['fields'].append(['{} totally real quintic fields, including'.format(nquintics),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in quintics)])

    # Sextics (sample)
    sextics = ['6.6.{}.1'.format(d) for d in [300125, 371293, 434581, 453789, 485125]]
    nsextics = len(fields_by_deg[6])
    data['fields'].append(['{} totally real sextic fields, including'.format(nsextics),
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
                            for nf in sextics)])

    data['degrees'] = sorted([int(d) for d in fields_by_deg.keys() if d!='_id'])

# data['highlights'] holds data (URL and descriptive text) for a
# sample of elliptic curves with interesting features:

    data['highlights'] = []
    data['highlights'].append(
        ['A curve with $C_3\\times C_3$ torsion',
         url_for('.show_ecnf', nf='2.0.3.1', class_label='a', conductor_label='2268.36.18', number=int(1))]
    )
    data['highlights'].append(
        ['A curve with $C_4\\times C_4$ torsion',
         url_for('.show_ecnf', nf='2.0.4.1', class_label='b', conductor_label='5525.870.5', number=int(9))]
    )
    data['highlights'].append(
        ['A curve with CM by $\\sqrt{-267}$',
         url_for('.show_ecnf', nf='2.2.89.1', class_label='a', conductor_label='81.1', number=int(1))]
    )
    data['highlights'].append(
        ['An isogeny class with isogenies of degree $3$ and $89$ (and $267$)',
         url_for('.show_ecnf_isoclass', nf='2.2.89.1', class_label='a', conductor_label='81.1')]
    )
    data['highlights'].append(
        ['A curve with everywhere good reduction, but no global minimal model',
         url_for('.show_ecnf', nf='2.2.229.1', class_label='a', conductor_label='1.1', number=int(1))]
    )

    return render_template("ecnf-index.html",
                           title="Elliptic Curves over Number Fields",
                           data=data,
                           bread=bread, learnmore=learnmore_list())
Beispiel #14
0
    def __init__(self):
        field = TextBox(name="field",
                        label="Base field",
                        knowl="nf",
                        example="2.2.5.1",
                        example_span="2.2.5.1 or Qsqrt5")
        include_base_change = IncludeOnlyBox(name="include_base_change",
                                             label="Base change curves",
                                             knowl="ec.base_change",
                                             width=50,
                                             short_width=170)
        include_Q_curves = IncludeOnlyBox(name="include_Q_curves",
                                          label=r"\(\Q\)-curves",
                                          knowl="ec.q_curve",
                                          width=50,
                                          short_width=170)
        conductor_norm = TextBox(name="conductor_norm",
                                 label="Conductor norm",
                                 knowl="ec.conductor",
                                 example="31",
                                 example_span="31 or 1-100")
        include_isogenous = IncludeBox(name="include_isogenous",
                                       label=r"Isogenous curves",
                                       knowl="ec.isogeny",
                                       width=50,
                                       short_width=170)
        include_cm = IncludeOnlyBox(name="include_cm",
                                    label="CM curves",
                                    knowl="ec.complex_multiplication",
                                    width=50,
                                    short_width=170)
        jinv = TextBox(name="jinv",
                       label="j-invariant",
                       width=300,
                       short_width=160,
                       colspan=(1, 2, 1),
                       example_span_colspan=2,
                       example="105474/49 + a*34213/49",
                       example_span="105474/49 + a*34213/49 over 2.0.7.1")
        torsion = TextBox(name="torsion",
                          label="Torsion order",
                          knowl="ec.torsion_order",
                          example="2")

        def disp_tor(t):
            if len(t) == 1:
                return "[%s]" % t, "C%s" % t
            else:
                return "[%s,%s]" % t, "C%s&times;C%s" % t

        tor_opts = (
            [("", "any"), ("[]", "trivial")] +
            [disp_tor(tuple(t)) for t in ECNF_stats().torsion_counts if t])
        torsion_structure = SelectBox(name="torsion_structure",
                                      label="Torsion structure",
                                      knowl="ec.torsion_subgroup",
                                      options=tor_opts,
                                      width=50,
                                      short_width=170)
        isodeg = TextBox(name="isodeg",
                         label="Cyclic isogeny degree",
                         knowl="ec.isogeny",
                         example="16")
        count = TextBox(name="count", label="Results to display", example="50")

        self.browse_array = [[field, include_base_change, include_Q_curves],
                             [conductor_norm, include_isogenous, include_cm],
                             [jinv], [torsion, torsion_structure], [isodeg],
                             [count]]

        self.refine_array = [[
            field, conductor_norm, include_isogenous, include_base_change,
            include_Q_curves
        ], [jinv, isodeg, torsion, torsion_structure, include_cm]]
Beispiel #15
0
    def __init__(self):
        field = TextBox(name="field",
                        label="Base field",
                        knowl="ag.base_field",
                        example="2.2.5.1",
                        example_span="2.2.5.1 or Qsqrt5")
        include_base_change = ExcludeOnlyBox(name="include_base_change",
                                             label="Base change curves",
                                             knowl="ec.base_change")
        include_Q_curves = ExcludeOnlyBox(name="include_Q_curves",
                                          label=r"\(\Q\)-curves",
                                          knowl="ec.q_curve")
        conductor_norm = TextBox(name="conductor_norm",
                                 label="Conductor norm",
                                 knowl="ec.conductor",
                                 example="31",
                                 example_span="31 or 1-100")
        one = SelectBox(name="one",
                        label="Curves per isogeny class",
                        knowl="ec.isogeny_class",
                        options=[("", ""), ("yes", "one")])
        include_cm = SelectBox(name="include_cm",
                               label="CM",
                               knowl="ec.complex_multiplication",
                               options=[('', ''), ('PCM', 'potential CM'),
                                        ('PCMnoCM', 'potential CM but no CM'),
                                        ('CM', 'CM'),
                                        ('noPCM', 'no potential CM')])
        cm_disc = TextBox(name="cm_disc",
                          label="CM discriminant",
                          example="-4",
                          example_span="-4 or -3,-8",
                          knowl="ec.complex_multiplication")
        jinv = TextBox(name="jinv",
                       label="j-invariant",
                       knowl="ec.j_invariant",
                       width=675,
                       short_width=160,
                       colspan=(1, 4, 1),
                       example_span_colspan=2,
                       example="105474/49 + a*34213/49",
                       example_span="")
        rank = TextBox(name="rank",
                       label="Rank*",
                       knowl="ec.rank",
                       example="2")
        torsion = TextBox(name="torsion",
                          label="Torsion order",
                          knowl="ec.torsion_order",
                          example="2")
        bf_deg = SelectBox(name="bf_deg",
                           label="Base field degree",
                           knowl="nf.degree",
                           options=[("", ""), ("2", "2"), ("3", "3"),
                                    ("4", "4"), ("5", "5"), ("6", "6")])

        tor_opts = (
            [("", ""), ("[]", "trivial")] +
            [disp_tor(tuple(t)) for t in ECNF_stats().torsion_counts if t])
        torsion_structure = SelectBox(name="torsion_structure",
                                      label="Torsion structure",
                                      knowl="ec.torsion_subgroup",
                                      options=tor_opts)
        isodeg = TextBox(name="isodeg",
                         label="Cyclic isogeny degree",
                         knowl="ec.isogeny",
                         example="16")
        count = CountBox()

        self.browse_array = [[jinv], [field, bf_deg],
                             [conductor_norm, include_base_change],
                             [rank, include_Q_curves],
                             [torsion, torsion_structure],
                             [cm_disc, include_cm], [isodeg, one], [count]]

        self.refine_array = [[
            field, bf_deg, conductor_norm, jinv, include_base_change
        ], [include_Q_curves, isodeg, rank, torsion, torsion_structure],
                             [include_cm, cm_disc, one]]