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())
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())
def statistics_by_degree(d): 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 fields_by_sig = ecnfstats.find_one({'_id': 'fields_by_signature'}, projection={'_id': False}) counts_by_sig = ecnfstats.find_one({'_id': 'conductor_norm_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]] def sig_counts(sig): sorted_fields = sorted(fields_by_sig[sig], key=sort_field) return [ sig, counts_by_sig[sig], [field_counts(f) for f in sorted_fields] ] info['summary'] = ecnf_degree_summary(d) info['sig_stats'] = [sig_counts(sig) for sig in sigs_by_deg[str(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())
def statistics_by_degree(d): 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 fields_by_sig = ecnfstats.find_one({'_id':'fields_by_signature'}, projection={'_id': False}) counts_by_sig = ecnfstats.find_one({'_id':'conductor_norm_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]] def sig_counts(sig): sorted_fields = sorted(fields_by_sig[sig], key=sort_field) return [sig, counts_by_sig[sig], [field_counts(f) for f in sorted_fields]] info['summary'] = ecnf_degree_summary(d) info['sig_stats'] = [sig_counts(sig) for sig in sigs_by_deg[str(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())