Example #1
0
def browse():
    info = {
        'counts': get_stats().counts(),
        'stats': get_stats().stats(),
    }
    credit = 'John Cremona'
    t = 'Elliptic curves over number fields'
    bread = [('Elliptic Curves', url_for("ecnf.index")),
             ('browse', ' ')]
    return render_template("stats.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list())
Example #2
0
def browse():
    info = {
        'counts': get_stats().counts(),
        'stats': get_stats().stats(),
    }
    credit = 'John Cremona'
    t = 'Elliptic curves over number fields'
    bread = [('Elliptic Curves', url_for("ecnf.index")),
             ('browse', ' ')]
    return render_template("stats.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list())
Example #3
0
def statistics_by_signature(d, r):
    info = {
        'counts': get_stats().counts(),
        'stats': get_stats().stats(),
        'degree': d,
    }
    if isinstance(r, basestring):
        info['sig_code'] = r
        info['r'] = r = int(r[1:-1].split(",")[0])
    else:
        info['r'] = r
        info['sig_code'] = '%s.%s' % (d, r),
    info['sig'] = '(%s,%s)' % (r, (d - r) / 2)
    info['sig_stats'] = ecnf_signature_summary(info['sig'])

    if not d in info['counts']['degrees']:
        if d == 1:
            return redirect(url_for("ec.statistics"))
        if d < 0:
            info['error'] = "Negative degree!"
        else:
            info[
                'error'] = "The database does not contain any elliptic curves defined over fields of degree %s" % d
    if not r in range(d % 2, d + 1, 2):
        info['error'] = "Invalid signature %s" % info['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())
Example #4
0
def statistics_by_degree(d):
    stats = get_stats()
    info = {
        'counts': stats.counts(),
        'stats': stats.stats(),
        'dstats': stats.dstats()[d],
        'degree': d
    }
    if not d in info['counts']['degrees']:
        if d==1:
            return redirect(url_for("ec.statistics"))
        if d<0:
            info['error'] = "Negative degree!"
        else:
            info['error'] = "The database does not contain any elliptic curves defined over fields of degree %s" % d
    info['degree_stats'] = ecnf_degree_summary(d)
    sigs = ["(%s,%s)" % (r,(d-r)/2) for r in range(d%2,d+1,2)]
    info['sig_stats'] = dict([(s,get_signature_stats(s)) for s in sigs])
    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 %s' % d

    bread = [('Elliptic Curves', url_for("ecnf.index")),
              ('degree %s' % d,' ')]
    return render_template("by_degree.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list())
Example #5
0
def statistics_by_degree(d):
    stats = get_stats()
    info = {
        'counts': stats.counts(),
        'stats': stats.stats(),
        'dstats': stats.dstats()[d],
        'degree': d
    }
    if not d in info['counts']['degrees']:
        if d==1:
            return redirect(url_for("ec.statistics"))
        if d<0:
            info['error'] = "Negative degree!"
        else:
            info['error'] = "The database does not contain any elliptic curves defined over fields of degree %s" % d
    info['degree_stats'] = ecnf_degree_summary(d)
    sigs = ["(%s,%s)" % (r,(d-r)/2) for r in range(d%2,d+1,2)]
    info['sig_stats'] = dict([(s,get_signature_stats(s)) for s in sigs])
    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 %s' % d

    bread = [('Elliptic Curves', url_for("ecnf.index")),
              ('degree %s' % d,' ')]
    return render_template("by_degree.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list())
Example #6
0
def statistics_by_signature(d,r):
    info = {
        'counts': get_stats().counts(),
        'stats': get_stats().stats(),
        'degree': d,
    }
    if isinstance(r,basestring):
        info['sig_code'] = r
        info['r'] = r = int(r[1:-1].split(",")[0])
    else:
        info['r'] = r
        info['sig_code'] = '%s.%s' % (d,r),
    info['sig'] = '(%s,%s)' % (r,(d-r)/2)
    info['sig_stats'] = ecnf_signature_summary(info['sig'])

    if not d in info['counts']['degrees']:
        if d==1:
            return redirect(url_for("ec.statistics"))
        if d<0:
            info['error'] = "Negative degree!"
        else:
            info['error'] = "The database does not contain any elliptic curves defined over fields of degree %s" % d
    if not r in range(d%2,d+1,2):
        info['error'] = "Invalid signature %s" % info['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("by_signature.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list())
Example #7
0
def statistics_by_signature(d, r):
    info = {"counts": get_stats().counts(), "stats": get_stats().stats(), "degree": d}
    if isinstance(r, basestring):
        info["sig_code"] = r
        info["r"] = r = int(r[1:-1].split(",")[0])
    else:
        info["r"] = r
        info["sig_code"] = ("%s.%s" % (d, r),)
    info["sig"] = "(%s,%s)" % (r, (d - r) / 2)
    info["sig_stats"] = ecnf_signature_summary(info["sig"])

    if not d in info["counts"]["degrees"]:
        if d == 1:
            return redirect(url_for("ec.statistics"))
        if d < 0:
            info["error"] = "Negative degree!"
        else:
            info["error"] = "The database does not contain any elliptic curves defined over fields of degree %s" % d
    if not r in range(d % 2, d + 1, 2):
        info["error"] = "Invalid signature %s" % info["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(
        "by_signature.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list()
    )
Example #8
0
def index():
#    if 'jump' in request.args:
#        return show_ecnf1(request.args['label'])
    if len(request.args) > 0:
        return elliptic_curve_search(data=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:

    counts = get_stats().counts()
    data['fields'] = []
    # Rationals
    data['fields'].append(['the rational field', (('1.1.1.1', [url_for('ec.rational_elliptic_curves'), '$\Q$']),)])
    # Real quadratics (only a sample)
    rqfs = ['2.2.%s.1' % str(d) for d in [5, 89, 229, 497]]
    nquadratics = counts['nfields_by_degree'][2]
    niqfs = 5
    nrqfs = nquadratics - niqfs
    data['fields'].append(['%s real quadratic fields, including' % nrqfs, ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)]) for nf in rqfs)])
    # Imaginary quadratics
    iqfs = ['2.0.%s.1' % str(d) for d in [4, 8, 3, 7, 11]]
    data['fields'].append(['%s imaginary quadratic fields' % niqfs, ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)]) for nf in iqfs)])
    # Cubics
    cubics = ['3.1.23.1'] + ['3.3.%s.1' % str(d) for d in [49,148,1957]]
    ncubics = counts['nfields_by_degree'][3]
    data['fields'].append(['%s cubic fields, including' % ncubics, ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)]) for nf in cubics)])
    # Quartics
    quartics = ['4.4.%s.1' % str(d) for d in [725,2777,9909,19821]]
    nquartics = counts['nfields_by_degree'][4]
    data['fields'].append(['%s totally real quartic fields, including' % nquartics,
                           ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)]) for nf in quartics)])
    # Quintics
    quintics = ['5.5.%s.1' % str(d) for d in [14641]]
    nquintics = counts['nfields_by_degree'][5]
    data['fields'].append(['%s totally real quintic field' % nquintics, ((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)]) for nf in quintics)])

    data['degrees'] = counts['degrees']

# 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_remove('Completeness'))
Example #9
0
def index():
    #    if 'jump' in request.args:
    #        return show_ecnf1(request.args['label'])
    if len(request.args) > 0:
        return elliptic_curve_search(to_dict(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:

    counts = get_stats().counts()
    data['fields'] = []
    # Rationals
    data['fields'].append([
        'the rational field',
        (('1.1.1.1', [url_for('ec.rational_elliptic_curves'), '$\Q$']), )
    ])
    # Real quadratics (only a sample)
    rqfs = ['2.2.%s.1' % str(d) for d in [5, 89, 229, 497]]
    nquadratics = counts['nfields_by_degree'].get(2, 0)
    niqfs = 5
    nrqfs = nquadratics - niqfs
    data['fields'].append([
        '%s real quadratic fields, including' % nrqfs,
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in rqfs)
    ])
    # Imaginary quadratics
    iqfs = ['2.0.%s.1' % str(d) for d in [4, 8, 3, 7, 11]]
    data['fields'].append([
        '%s imaginary quadratic fields' % niqfs,
        ((nf, [url_for('.show_ecnf1', nf=nf),
               field_pretty(nf)]) for nf in iqfs)
    ])
    # Cubics
    cubics = ['3.1.23.1'] + ['3.3.%s.1' % str(d) for d in [49, 148, 1957]]
    if 3 in counts['nfields_by_degree']:
        ncubics = counts['nfields_by_degree'][3]
        data['fields'].append([
            '%s cubic fields, including' % ncubics,
            ((nf, [url_for('.show_ecnf1', nf=nf),
                   field_pretty(nf)]) for nf in cubics)
        ])
    # Quartics
    quartics = ['4.4.%s.1' % str(d) for d in [725, 2777, 9909, 19821]]
    if 4 in counts['nfields_by_degree']:
        nquartics = counts['nfields_by_degree'][4]
        data['fields'].append([
            '%s totally real quartic fields, including' % nquartics,
            ((nf, [url_for('.show_ecnf1', nf=nf),
                   field_pretty(nf)]) for nf in quartics)
        ])
    # Quintics
    quintics = [
        '5.5.%s.1' % str(d) for d in [14641, 24217, 36497, 38569, 65657]
    ]
    if 5 in counts['nfields_by_degree']:
        nquintics = counts['nfields_by_degree'][5]
        data['fields'].append([
            '%s totally real quintic fields, including' % nquintics,
            ((nf, [url_for('.show_ecnf1', nf=nf),
                   field_pretty(nf)]) for nf in quintics)
        ])
    # Sextics
    sextics = [
        '6.6.%s.1' % str(d) for d in [300125, 371293, 434581, 453789, 485125]
    ]
    if 6 in counts['nfields_by_degree']:
        nsextics = counts['nfields_by_degree'][6]
        data['fields'].append([
            '%s totally real sextic fields, including' % nsextics,
            ((nf, [url_for('.show_ecnf1', nf=nf),
                   field_pretty(nf)]) for nf in sextics)
        ])

    data['degrees'] = sorted(counts['degrees'])

    # 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_remove('Completeness'))
Example #10
0
def browse():
    info = {"counts": get_stats().counts(), "stats": get_stats().stats()}
    credit = "John Cremona"
    t = "Elliptic curves over number fields"
    bread = [("Elliptic Curves", url_for("ecnf.index")), ("browse", " ")]
    return render_template("stats.html", info=info, credit=credit, title=t, bread=bread, learnmore=learnmore_list())
Example #11
0
def random_curve():
    from sage.misc.prandom import randint
    n = get_stats().counts()['ncurves']
    n = randint(0,n-1)
    E = db_ecnf().find()[n]
    return redirect(url_for(".show_ecnf", nf=E['field_label'], conductor_label=E['conductor_label'], class_label=E['iso_label'], number=E['number']), 301)