def statistics_by_signature(d, r): if d == 1: return redirect(url_for("ec.statistics")) info = {} ecnfstats = db_ecnfstats() sigs_by_deg = ecnfstats.find_one({'_id': 'signatures_by_degree'}, projection={'_id': False}) if not str(d) 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 info['sig'] = sig = '%s,%s' % (r, s) info['summary'] = ecnf_signature_summary(sig) fields_by_sig = ecnfstats.find_one({'_id': 'fields_by_signature'}, projection={'_id': False}) counts_by_field = ecnfstats.find_one({'_id': 'conductor_norm_by_field'}, projection={'_id': False}) def field_counts(f): ff = f.replace(".", ":") return [f, counts_by_field[ff]] sorted_fields = sorted(fields_by_sig[sig], key=sort_field) info['sig_stats'] = [field_counts(f) for f in sorted_fields] 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())
def statistics_by_signature(d, r): if d == 1: return redirect(url_for("ec.statistics")) info = {} ecnfstats = db.ec_nfcurves.stats sigs_by_deg = ecnfstats.get_oldstat('signatures_by_degree') if not str(d) 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 info['sig'] = sig = '%s,%s' % (r, s) info['summary'] = ecnf_signature_summary(sig) fields_by_sig = ecnfstats.get_oldstat('fields_by_signature') counts_by_field = ecnfstats.get_oldstat('conductor_norm_by_field') def field_counts(f): ff = f.replace(".", ":") return [f, counts_by_field[ff]] sorted_fields = sorted(fields_by_sig[sig], key=sort_field) info['sig_stats'] = [field_counts(f) for f in sorted_fields] 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())
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())
def statistics_by_signature(d,r): if d==1: return redirect(url_for("ec.statistics")) info = {} ecnfstats = db_ecnfstats() sigs_by_deg = ecnfstats.find_one({'_id':'signatures_by_degree'}, projection={'_id': False}) if not str(d) 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 info['sig'] = sig = '%s,%s' % (r,s) info['summary'] = ecnf_signature_summary(sig) fields_by_sig = ecnfstats.find_one({'_id':'fields_by_signature'}, projection={'_id': False}) counts_by_field = ecnfstats.find_one({'_id':'conductor_norm_by_field'}, projection={'_id': False}) def field_counts(f): ff = f.replace(".",":") return [f,counts_by_field[ff]] sorted_fields = sorted(fields_by_sig[sig], key=sort_field) info['sig_stats'] = [field_counts(f) for f in sorted_fields] 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())
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())
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() )