def rational_elliptic_curves(err_args=None): if err_args is None: if len(request.args) != 0: return elliptic_curve_search(**request.args) else: err_args = {} for field in ["conductor", "jinv", "torsion", "rank", "sha_an", "optimal", "torsion_structure", "msg"]: err_args[field] = "" err_args["count"] = "100" init_ecdb_count() conductor_list_endpoints = [1, 100, 1000, 10000, 100000, max_N + 1] conductor_list = [ "%s-%s" % (start, end - 1) for start, end in zip(conductor_list_endpoints[:-1], conductor_list_endpoints[1:]) ] info = { "rank_list": range(max_rank + 1), "torsion_list": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16], "conductor_list": conductor_list, "ncurves": comma(ncurves), "max_N": comma(max_N), "max_rank": max_rank, } credit = "John Cremona" t = "Elliptic curves/$\Q$" bread = [("Elliptic Curves", url_for("rational_elliptic_curves")), ("Elliptic curves/$\Q$", " ")] return render_template( "elliptic_curve/elliptic_curve_Q.html", info=info, credit=credit, title=t, bread=bread, **err_args )
def short_summary(self): return r'The database currently contains {nreps} Galois conjugacy classes of {repknowl}, for a total of {nfields} {nfknowl}. Here are some <a href="{url}">further statistics</a>.'.format( nreps=comma(self.nreps), repknowl=display_knowl("artin", "Artin representations"), nfields=comma(self.nfields), nfknowl=display_knowl("artin.number_field", "number fields"), url=url_for(".statistics"))
def init_hmf_count(self): if self._counts: return #print("initializing HMF counts") counts = {} formstats = db_forms_stats() nforms = formstats.find_one({'_id': 'deg'})['total'] counts['nforms'] = nforms counts['nforms_c'] = comma(nforms) degs = formstats.find_one({'_id': 'fields_summary'}) nfields = degs['total'] degrees = [x[0] for x in degs['counts']] degrees.sort() max_deg = max(degrees) counts['degrees'] = degrees = [str(d) for d in degrees] counts['nfields'] = nfields counts['nfields_c'] = comma(nfields) counts['maxdeg'] = max_deg counts['max_deg_c'] = comma(max_deg) fields = formstats.find_one({'_id': 'fields_by_degree'}) counts['fields_by_degree'] = dict([(d, fields[d]['fields']) for d in degrees]) counts['nfields_by_degree'] = dict([(d, fields[d]['nfields']) for d in degrees]) counts['max_disc_by_degree'] = dict([(d, fields[d]['maxdisc']) for d in degrees]) self._counts = counts
def init_ecnfdb_count(self): if self._counts: return logger.debug("Computing elliptic curve (nf) counts...") ecdb = self.ecdb counts = {} fields = ecdb.distinct('field_label') counts['fields'] = fields counts['nfields'] = len(fields) degrees = ecdb.distinct('degree') counts['degrees'] = degrees counts['maxdeg'] = max(degrees) counts['ncurves_by_degree'] = dict([(d, ecdb.find({ 'degree': d }).count()) for d in degrees]) counts['fields_by_degree'] = dict([(d, sorted(ecdb.find({ 'degree': d }).distinct('field_label'), key=sort_field)) for d in degrees]) counts['nfields_by_degree'] = dict([ (d, len(counts['fields_by_degree'][d])) for d in degrees ]) ncurves = ecdb.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = ecdb.find({'number': 1}).count() counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) self._counts = counts logger.debug("... finished computing elliptic curve (nf) counts.")
def rational_elliptic_curves(err_args=None): if err_args is None: if len(request.args) != 0: return elliptic_curve_search(**request.args) else: err_args = {} for field in ['conductor', 'jinv', 'torsion', 'rank', 'sha_an', 'optimal', 'torsion_structure', 'msg']: err_args[field] = '' err_args['count'] = '100' init_ecdb_count() conductor_list_endpoints = [1, 100, 1000, 10000, 100000, max_N + 1] conductor_list = ["%s-%s" % (start, end - 1) for start, end in zip(conductor_list_endpoints[:-1], conductor_list_endpoints[1:])] info = { 'rank_list': range(max_rank + 1), 'torsion_list': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16], 'conductor_list': conductor_list, 'ncurves': comma(ncurves), 'max_N': comma(max_N), 'max_rank': max_rank } credit = 'John Cremona' t = 'Elliptic curves/$\Q$' bread = [('Elliptic Curves', url_for("rational_elliptic_curves")), ('Elliptic curves/$\Q$', ' ')] return render_template("elliptic_curve/elliptic_curve_Q.html", info=info, credit=credit, title=t, bread=bread, **err_args)
def init_hmf_count(self): if self._counts: return #print("initializing HMF counts") counts = {} formstats = db_forms_stats() nforms = formstats.find_one({'_id':'deg'})['total'] counts['nforms'] = nforms counts['nforms_c'] = comma(nforms) degs = formstats.find_one({'_id':'fields_summary'}) nfields = degs['total'] degrees = [x[0] for x in degs['counts']] degrees.sort() max_deg = max(degrees) counts['degrees'] = degrees = [str(d) for d in degrees] counts['nfields'] = nfields counts['nfields_c'] = comma(nfields) counts['maxdeg'] = max_deg counts['max_deg_c'] = comma(max_deg) fields = formstats.find_one({'_id':'fields_by_degree'}) counts['fields_by_degree'] = dict([(d,fields[d]['fields']) for d in degrees]) counts['nfields_by_degree'] = dict([(d,fields[d]['nfields']) for d in degrees]) counts['max_disc_by_degree'] = dict([(d,fields[d]['maxdisc']) for d in degrees]) self._counts = counts
def counts(self): counts = {} counts['nforms'] = self.nforms counts['nforms_c'] = comma(self.nforms) attrs = ["degree", "discriminant", "label"] fields = list(db.hmf_fields.search({}, attrs, sort=attrs)) degrees = sorted(set(F["degree"] for F in fields)) by_deg = {d: [F for F in fields if F["degree"] == d] for d in degrees} counts["degrees"] = degrees counts["nfields"] = len(fields) counts["nfields_c"] = comma(len(fields)) counts["maxdeg"] = max(degrees) counts["max_deg_c"] = comma(max(degrees)) counts["fields_by_degree"] = { d: [F["label"] for F in by_deg[d]] for d in degrees } counts["nfields_by_degree"] = {d: len(by_deg[d]) for d in degrees} counts["max_disc_by_degree"] = { d: max(F["discriminant"] for F in by_deg[d]) for d in degrees } return counts
def init_hmf_count(self): if self._counts: return # print("Computing HMF counts...") forms = self.forms fields = self.fields counts = {} nforms = forms.count() counts["nforms"] = nforms counts["nforms_c"] = comma(nforms) ff = fields.distinct("label") counts["fields"] = ff counts["nfields"] = nfields = len(ff) counts["nfields_c"] = comma(nfields) counts["degrees"] = degrees = fields.distinct("degree") counts["maxdeg"] = max_deg = max(degrees) counts["max_deg_c"] = comma(max_deg) counts["fields_by_degree"] = dict( [(d, [F["label"] for F in fields.find({"degree": d}, ["label"]).hint("degree_1")]) for d in degrees] ) counts["discs_by_degree"] = dict( [ (d, [F["discriminant"] for F in fields.find({"degree": d}, ["discriminant"]).hint("degree_1")]) for d in degrees ] ) counts["max_disc_by_degree"] = dict([(d, max(counts["discs_by_degree"][d])) for d in degrees]) counts["nfields_by_degree"] = dict([(d, len(counts["fields_by_degree"][d])) for d in degrees]) self._counts = counts
def init_ecdb_count(self): if self._counts: return logger.debug("Computing elliptic curve counts...") ecdbstats = db.ec_curves.stats counts = {} rankstats = ecdbstats.get_oldstat('rank') ncurves = rankstats['total'] counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = ecdbstats.get_oldstat('class/rank')['total'] counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_N = ecdbstats.get_oldstat('conductor')['max'] # round up to nearest multiple of 1000 max_N = 1000*((max_N/1000)+1) # NB while we only have the Cremona database, the upper bound # will always be a multiple of 1000, but it looks funny to # show the maximum condictor as something like 399998; there # are no elliptic curves whose conductor is a multiple of # 1000. counts['max_N'] = max_N counts['max_N_c'] = comma(max_N) counts['max_rank'] = int(rankstats['max']) self._counts = counts logger.debug("... finished computing elliptic curve counts.")
def lattice_summary(): latstats = db_latstats() integral = '<a knowl="lattice.definition">integral lattices</a>' positivedef = '<a knowl="lattice.postive_definite">positive definite</a>' catalogue = '<a knowl="lattice.catalogue_of_lattices">Catalogue of Lattices</a>' cn = '<a knowl="lattice.class_number">class number</a>' dim = '<a knowl="lattice.dimension">dimension</a>' det = '<a knowl="lattice.determinant">determinant</a>' pri = '<a knowl="lattice.primitive">primitive</a>' cn_data = latstats.find_one('class_number') number = cn_data['total'] max_cn = cn_data['max'] dim_data = latstats.find_one('dim') max_dim = dim_data['max'] det_data = latstats.find_one('det') max_det = det_data['max'] return ''.join([ r'<p>The database currently contains {} '.format(comma(number)), positivedef, ' ', integral, '. It includes data from the ', catalogue, '.</p><p>The largest ', cn, ' is {}, '.format(comma(max_cn)), ' the largest ', dim, ' is {}, '.format(comma(max_dim)), 'and the largest ', det, ' is {}.</p> '.format(comma(max_det)), '<p>In the case of ', pri, ' ', integral, ' of ', cn, ' one the database is complete.</p>' ])
def init_hmf_count(self): if self._counts: return #print("Computing HMF counts...") forms = self.forms fields = self.fields counts = {} nforms = forms.count() counts['nforms'] = nforms counts['nforms_c'] = comma(nforms) ff = fields.distinct('label') counts['fields'] = ff counts['nfields'] = nfields = len(ff) counts['nfields_c'] = comma(nfields) counts['degrees'] = degrees = fields.distinct('degree') counts['maxdeg'] = max_deg = max(degrees) counts['max_deg_c'] = comma(max_deg) counts['fields_by_degree'] = dict([(d,[F['label'] for F in fields.find({'degree':d},['label']).hint('degree_1')]) for d in degrees]) counts['discs_by_degree'] = dict([(d,[F['discriminant'] for F in fields.find({'degree':d},['discriminant']).hint('degree_1')]) for d in degrees]) counts['max_disc_by_degree'] = dict([(d,max(counts['discs_by_degree'][d])) for d in degrees]) counts['nfields_by_degree'] = dict([(d,len(counts['fields_by_degree'][d])) for d in degrees]) self._counts = counts
def init_hmf_count(self): if self._counts: return print("Computing HMF counts...") forms = self.forms fields = self.fields counts = {} nforms = forms.count() counts['nforms'] = nforms counts['nforms_c'] = comma(nforms) ff = fields.distinct('label') counts['fields'] = ff counts['nfields'] = nfields = len(ff) counts['nfields_c'] = comma(nfields) counts['degrees'] = degrees = fields.distinct('degree') counts['maxdeg'] = max_deg = max(degrees) counts['max_deg_c'] = comma(max_deg) counts['fields_by_degree'] = dict([(d,[F['label'] for F in fields.find({'degree':d},['label']).hint('degree_1')]) for d in degrees]) counts['discs_by_degree'] = dict([(d,[F['discriminant'] for F in fields.find({'degree':d},['discriminant']).hint('degree_1')]) for d in degrees]) counts['max_disc_by_degree'] = dict([(d,max(counts['discs_by_degree'][d])) for d in degrees]) counts['nfields_by_degree'] = dict([(d,len(counts['fields_by_degree'][d])) for d in degrees]) self._counts = counts
def counts(self): counts = {} formstats = db.hmf_forms.stats nforms = formstats.get_oldstat('deg')['total'] counts['nforms'] = nforms counts['nforms_c'] = comma(nforms) degs = formstats.get_oldstat('fields_summary') nfields = degs['total'] degrees = [x[0] for x in degs['counts']] degrees.sort() max_deg = max(degrees) counts['degrees'] = degrees = [str(d) for d in degrees] counts['nfields'] = nfields counts['nfields_c'] = comma(nfields) counts['maxdeg'] = max_deg counts['max_deg_c'] = comma(max_deg) fields = formstats.get_oldstat('fields_by_degree') counts['fields_by_degree'] = dict([(d,fields[d]['fields']) for d in degrees]) counts['nfields_by_degree'] = dict([(d,fields[d]['nfields']) for d in degrees]) counts['max_disc_by_degree'] = dict([(d,fields[d]['maxdisc']) for d in degrees]) return counts
def summary(self): return "The database currently contains %s %s of %s up to %s, lying in %s %s. The tables below show counts of Galois orbits." % ( comma(self.nchars), display_knowl("character.dirichlet", "Dirichlet characters"), display_knowl("character.dirichlet.modulus", "modulus"), comma(self.maxmod), comma(self.norbits), display_knowl("character.dirichlet.galois_orbit", "Galois orbits"))
def init_ecdb_count(self): if self._counts: return logger.debug("Computing elliptic curve counts...") ecdbstats = db.ec_curves.stats counts = {} rankstats = ecdbstats.get_oldstat('rank') ncurves = rankstats['total'] counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = ecdbstats.get_oldstat('class/rank')['total'] counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_N = ecdbstats.get_oldstat('conductor')['max'] # round up to nearest multiple of 1000 max_N = 1000 * ((max_N / 1000) + 1) # NB while we only have the Cremona database, the upper bound # will always be a multiple of 1000, but it looks funny to # show the maximum condictor as something like 399998; there # are no elliptic curves whose conductor is a multiple of # 1000. counts['max_N'] = max_N counts['max_N_c'] = comma(max_N) counts['max_rank'] = int(rankstats['max']) self._counts = counts logger.debug("... finished computing elliptic curve counts.")
def counts(self): counts = {} formstats = db.hmf_forms.stats nforms = formstats.get_oldstat('deg')['total'] counts['nforms'] = nforms counts['nforms_c'] = comma(nforms) degs = formstats.get_oldstat('fields_summary') nfields = degs['total'] degrees = [x[0] for x in degs['counts']] degrees.sort() max_deg = max(degrees) counts['degrees'] = degrees = [str(d) for d in degrees] counts['nfields'] = nfields counts['nfields_c'] = comma(nfields) counts['maxdeg'] = max_deg counts['max_deg_c'] = comma(max_deg) fields = formstats.get_oldstat('fields_by_degree') counts['fields_by_degree'] = dict([(d, fields[d]['fields']) for d in degrees]) counts['nfields_by_degree'] = dict([(d, fields[d]['nfields']) for d in degrees]) counts['max_disc_by_degree'] = dict([(d, fields[d]['maxdisc']) for d in degrees]) return counts
def init_ecdb_count(self): if self._counts: return logger.debug("Computing elliptic curve counts...") ecdb = self.ecdb counts = {} ncurves = ecdb.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = ecdb.find({'number': 1}).count() counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_N = ecdb.find().sort('conductor', DESCENDING).limit(1)[0]['conductor'] # round up to nearest multiple of 1000 max_N = 1000*((max_N/1000)+1) # NB while we only have the Cremona database, the upper bound # will always be a multiple of 1000, but it looks funny to # show the maximum condictor as something like 399998; there # are no elliptic curves whose conductor is a multiple of # 1000. counts['max_N'] = max_N counts['max_N_c'] = comma(max_N) counts['max_rank'] = ecdb.find().sort('rank', DESCENDING).limit(1)[0]['rank'] self._counts = counts logger.debug("... finished computing elliptic curve counts.")
def init_ecdb_count(self): if self._counts: return logger.debug("Computing elliptic curve counts...") ecdb = self.ecdb counts = {} ncurves = ecdb.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = ecdb.find({'number': 1}).count() counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_N = ecdb.find().sort('conductor', DESCENDING).limit(1)[0]['conductor'] # round up to nearest multiple of 1000 max_N = 1000 * ((max_N / 1000) + 1) # NB while we only have the Cremona database, the upper bound # will always be a multiple of 1000, but it looks funny to # show the maximum condictor as something like 399998; there # are no elliptic curves whose conductor is a multiple of # 1000. counts['max_N'] = max_N counts['max_N_c'] = comma(max_N) counts['max_rank'] = ecdb.find().sort('rank', DESCENDING).limit(1)[0]['rank'] self._counts = counts logger.debug("... finished computing elliptic curve counts.")
def summary(self): return r"The database currently contains %s %s of weight 2 over %s imaginary quadratic fields. It also contains %s %s over %s imaginary quadratic fields (including all with class number one)." % ( comma(self.nforms), display_knowl( "mf.bianchi.bianchimodularforms", "Bianchi modular forms"), self.nformfields, comma(self.ndims), display_knowl("mf.bianchi.spaces", "spaces of cusp forms"), self.ndimfields)
def short_summary(self): return 'The database currently contains %s %s of %s up to %s, lying in %s %s. Among these, L-functions are available for characters of modulus up to 2,800 (and some of higher modulus). Here are some <a href="%s">further statistics</a>.' % ( comma(self.nchars), display_knowl("character.dirichlet", "Dirichlet characters"), display_knowl("character.dirichlet.modulus", "modulus"), comma(self.maxmod), comma(self.norbits), display_knowl("character.dirichlet.galois_orbit", "Galois orbits"), url_for(".statistics"))
def __init__(self): ngalmaps = comma(db.belyi_galmaps.stats.count()) npassports = comma(db.belyi_passports.stats.count()) max_deg = comma(db.belyi_passports.max('deg')) deg_knowl = display_knowl('belyi.degree', title = "degree") belyi_knowl = '<a title="Belyi maps (up to Galois conjugation) [belyi.galmap]" knowl="belyi.galmap" kwargs="">Belyi maps</a>' stats_url = url_for(".statistics") self.short_summary = 'The database currently contains %s %s of %s up to %s. Here are some <a href="%s">further statistics</a>.' % (ngalmaps, belyi_knowl, deg_knowl, max_deg, stats_url) self.summary = "The database currently contains %s Galois orbits of Belyi maps in %s passports, with %s at most %s." % (ngalmaps, npassports, deg_knowl, max_deg)
def __init__(self): ncurves = comma(db.g2c_curves.count()) nclasses = comma(db.lfunc_instances.count({'type':'G2Q'})) max_D = comma(db.g2c_curves.max('abs_disc')) g2c_knowl = display_knowl('g2c.g2curve', title='genus 2 curves') disc_knowl = display_knowl('g2c.abs_discriminant', title = "absolute discriminant") stats_url = url_for(".statistics") self.short_summary = 'The database currently contains %s %s over $\Q$ of %s up to %s. Here are some <a href="%s">further statistics</a>.' % (ncurves, g2c_knowl, disc_knowl, max_D, stats_url) self.summary = 'The database currently contains %s genus 2 curves in %s isogeny classes, with %s at most %s.' % (ncurves, nclasses, disc_knowl, max_D)
def summary(self): return ''.join([ r'The database currently contains {} '.format(comma(self.ncurves)), self.ec_knowls, r' in {} '.format(comma(self.nclasses)), self.iso_knowls, r', over {} '.format(len(self.field_counts)), self.nf_knowls, ' of ', self.deg_knowl, r' from 2 up to {}.'.format(self.maxdeg), ' Elliptic curves defined over $\mathbb{Q}$ are contained in a <a href="/EllipticCurve/Q/">separate database</a>.' ])
def summary(self): return ''.join([r'The database currently contains {} '.format(comma(self.ncurves)), self.ec_knowls, r' in {} '.format(comma(self.nclasses)), self.iso_knowls, r', over {} '.format(len(self.field_counts)), self.nf_knowls, ' (not including $\mathbb{Q}$) of ', self.deg_knowl, r' up to {}.'.format(self.maxdeg)])
def short_summary(self): return 'The database currently contains %s %s of %s up to %s, lying in %s %s. Among these, L-functions are available for characters of modulus up to 2,800 (and some of higher modulus). In addition, %s, Galois orbits and %s are available up to modulus $10^{20}$. Here are some <a href="%s">futher statistics</a>.' % ( comma(self.nchars), display_knowl("character.dirichlet", "Dirichlet characters"), display_knowl("character.dirichlet.modulus", "modulus"), comma(self.maxmod), comma(self.norbits), display_knowl("character.dirichlet.galois_orbit", "Galois orbits"), display_knowl("character.dirichlet.basic_properties", "basic properties"), display_knowl("character.dirichlet.value_field", "field of values"), url_for(".statistics"))
def __init__(self): ngalmaps = comma(db.belyi_galmaps.stats.count()) npassports = comma(db.belyi_passports.stats.count()) max_deg = comma(db.belyi_passports.max('deg')) deg_knowl = display_knowl('belyi.degree', title="degree") belyi_knowl = '<a title="Belyi maps (up to Galois conjugation) [belyi.galmap]" knowl="belyi.galmap" kwargs="">Belyi maps</a>' stats_url = url_for(".statistics") self.short_summary = 'The database currently contains %s %s of %s up to %s. Here are some <a href="%s">further statistics</a>.' % ( ngalmaps, belyi_knowl, deg_knowl, max_deg, stats_url) self.summary = "The database currently contains %s Galois orbits of Belyi maps in %s passports, with %s at most %s." % ( ngalmaps, npassports, deg_knowl, max_deg)
def summary(self): return r"The database currently contains {nreps} Galois conjugacy classes of {repknowl}, for a total of {nfields} {nfknowl} with {ngroups} {gpknowl}. The largest {dimknowl} is ${mdim}$ and the largest {condknowl} is ${mcond} \approx {amcond}$.".format( nreps=comma(self.nreps), repknowl=display_knowl("artin", "Artin representations"), nfields=comma(self.nfields), nfknowl=display_knowl("artin.number_field", "number fields"), ngroups=self.ngroups, gpknowl=display_knowl("artin.gg_quotient", "Galois groups"), dimknowl=display_knowl("artin.dimension", "dimension"), mdim=self.maxdim, condknowl=display_knowl("artin.conductor", "conductor"), mcond=self.maxcond, amcond=self.amaxcond)
def counts(self): counts = {} ngalmaps = db.belyi_galmaps.stats.count() counts['ngalmaps'] = ngalmaps counts['ngalmaps_c'] = comma(ngalmaps) npassports = db.belyi_passports.stats.count() counts['npassports'] = npassports counts['npassports_c'] = comma(npassports) max_deg = db.belyi_passports.max('deg') counts['max_deg'] = max_deg counts['max_deg_c'] = comma(max_deg) return counts
def init_g2c_count(self): if self._counts: return counts = {} ncurves = g2cdb().curves.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = g2cdb().isogeny_classes.count() counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_D = g2cdb().curves.find().sort('abs_disc', DESCENDING).limit(1)[0]['abs_disc'] counts['max_D'] = max_D counts['max_D_c'] = comma(max_D) self._counts = counts
def hecke_algebras_summary(): hecke_knowl = '<a knowl="hecke_algebra.definition">Hecke algebras</a>' level_knowl = '<a knowl="cmf.level">level</a>' weight_knowl = '<a knowl="cmf.weight">weight</a>' gamma0_knowl = r'<a knowl="group.sl2z.subgroup.gamma0n">$\Gamma_0$</a>' number = db.hecke_algebras.count() max_level = db.hecke_algebras.max('level') max_weight = db.hecke_algebras.max('weight') return ''.join([ r'The database currently contains {} '.format(comma(number)), hecke_knowl, '. The largest ', level_knowl, ' for ', gamma0_knowl, ' is {}, '.format(comma(max_level)), 'the largest ', weight_knowl, ' is {}.'.format(comma(max_weight)) ])
def __init__(self): nforms = comma(db.mf_newforms.count()) nspaces = comma(db.mf_newspaces.count()) ndim = comma(db.mf_hecke_cc.count()) weight_knowl = display_knowl('mf.elliptic.weight', title='weight') level_knowl = display_knowl('mf.elliptic.level', title='level') newform_knowl = display_knowl('mf.elliptic.newform', title='newforms') #stats_url = url_for(".statistics") self.short_summary = r'The database currently contains %s (Galois orbits of) %s of %s \(k\) and %s \(N\) satisfying \(Nk^2 \le %s\), corresponding to %s modular forms over the complex numbers.' % ( nforms, newform_knowl, weight_knowl, level_knowl, Nk2_bound(), ndim) self.summary = r"The database currently contains %s (Galois orbits of) %s and %s spaces of %s \(k\) and %s \(N\) satisfying \(Nk^2 \le %s\), corresponding to %s modular forms over the complex numbers." % ( nforms, newform_knowl, nspaces, weight_knowl, level_knowl, Nk2_bound(), ndim)
def counts(self): logger.debug("Computing modlmf counts...") counts = {} nmodlmf = db.modlmf_forms.count() counts['nmodlmf'] = nmodlmf counts['nmodlmf_c'] = comma(nmodlmf) max_level = db.modlmf_forms.max('level') counts['max_level'] = max_level counts['max_level_c'] = comma(max_level) max_weight = db.modlmf_forms.max('weight_grading') counts['max_weight'] = max_weight counts['max_weight_c'] = comma(max_weight) logger.debug("... finished computing modlmf counts.") return counts
def hecke_algebras_summary(): heckestats = db.hecke_algebras.stats hecke_knowl = '<a knowl="hecke_algebra.definition">Hecke algebras</a>' level_knowl = '<a knowl="cmf.level">level</a>' weight_knowl = '<a knowl="cmf.weight">weight</a>' gamma0_knowl = '<a knowl="group.sl2z.subgroup.gamma0n">$\Gamma_0$</a>' level_data = heckestats.get_oldstat('level') number = level_data['total'] max_level = level_data['max'] weight_data = heckestats.get_oldstat('weight') max_weight = weight_data['max'] return ''.join([r'The database currently contains {} '.format(comma(number)), hecke_knowl,'. The largest ', level_knowl, ' for ' , gamma0_knowl , ' is {}, '.format(comma(max_level)), 'the largest ', weight_knowl, ' is {}.'.format(comma(max_weight))])
def counts(self): counts = {} ncurves = db.g2c_curves.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = db.lfunc_instances.count({'type':'G2Q'}) counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_D = db.g2c_curves.max('abs_disc') counts['max_D'] = max_D counts['max_D_c'] = comma(max_D) return counts self.init_g2c_count() return self._counts
def counts(self): counts = {} ncurves = db.g2c_curves.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = db.lfunc_instances.count({'type': 'G2Q'}) counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_D = db.g2c_curves.max('abs_disc') counts['max_D'] = max_D counts['max_D_c'] = comma(max_D) return counts self.init_g2c_count() return self._counts
def __init__(self): self.ncurves = db.ec_curvedata.count() self.ncurves_c = comma(self.ncurves) self.nclasses = db.ec_classdata.count() self.nclasses_c = comma(self.nclasses) self.max_N_Cremona = 500000 self.max_N_Cremona_c = comma(500000) self.max_N = db.ec_curvedata.max('conductor') self.max_N_c = comma(self.max_N) self.max_rank = db.ec_curvedata.max('rank') self.max_rank_c = comma(self.max_rank) self.cond_knowl = display_knowl('ec.q.conductor', title="conductor") self.rank_knowl = display_knowl('ec.rank', title="rank") self.ec_knowl = display_knowl('ec.q', title='elliptic curves') self.cl_knowl = display_knowl('ec.isogeny', title="isogeny classes")
def init_g2c_count(self): if self._counts: return curves = g2c_db_curves() counts = {} ncurves = curves.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = g2c_db_isogeny_classes_count() counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_D = curves.find().sort('abs_disc', DESCENDING).limit(1)[0]['abs_disc'] counts['max_D'] = max_D counts['max_D_c'] = comma(max_D) self._counts = counts
def __init__(self): self.genus_max = db.hgcwa_passports.max('genus') self.dim_max = db.hgcwa_passports.max('dim') self.g0_max = db.hgcwa_passports.max('g0') self.refined_passports_knowl = display_knowl( 'curve.highergenus.aut.refinedpassport', title='refined passports') self.generating_vectors_knowl = display_knowl( 'curve.highergenus.aut.generatingvector', title='generating vectors') self.dimension_knowl = display_knowl('curve.highergenus.aut.dimension', title='dimension'), self.distinct_generating_vectors = comma(db.hgcwa_passports.count()) self.distinct_refined_passports = comma(compute_total_refined_pp()) self.by_genus_data = init_by_genus_data()
def init_belyi_count(self): if self._counts: return galmaps = belyi_db_galmaps() counts = {} ngalmaps = galmaps.count() counts['ngalmaps'] = ngalmaps counts['ngalmaps_c'] = comma(ngalmaps) passports = belyi_db_passports() npassports = passports.count() counts['npassports'] = npassports counts['npassports_c'] = comma(npassports) max_deg = passports.find().sort('deg', DESCENDING).limit(1)[0]['deg'] counts['max_deg'] = max_deg counts['max_deg_c'] = comma(max_deg) self._counts = counts
def fixed_prec(r, digs=3): n = RealField(200)(r)*(10**digs) n = str(n.round()) head = int(n[:-digs]) if head>=10**4: head = comma(head) return str(head)+'.'+n[-digs:]
def number_field_render_webpage(): args = request.args sig_list = sum([[[d - 2 * r2, r2] for r2 in range(1 + (d // 2))] for d in range(1, 7)], []) + sum( [[[d, 0]] for d in range(7, 11)], [] ) sig_list = sig_list[:10] if len(args) == 0: init_nf_count() discriminant_list_endpoints = [-10000, -1000, -100, 0, 100, 1000, 10000] discriminant_list = [ "%s..%s" % (start, end - 1) for start, end in zip(discriminant_list_endpoints[:-1], discriminant_list_endpoints[1:]) ] info = { "degree_list": range(1, max_deg + 1), "signature_list": sig_list, "class_number_list": range(1, 6) + ["6..10"], "count": "20", "nfields": comma(nfields), "maxdeg": max_deg, "discriminant_list": discriminant_list, } t = "Global Number Fields" bread = [("Global Number Fields", url_for(".number_field_render_webpage"))] info["learnmore"] = [ ("Global number field labels", url_for(".render_labels_page")), ("Galois group labels", url_for(".render_groups_page")), (Completename, url_for(".render_discriminants_page")), ] return render_template( "number_field_all.html", info=info, credit=NF_credit, title=t, bread=bread ) # , learnmore=info.pop('learnmore')) else: return number_field_search(**args)
def count_records_and_types(inv_db, coll_id, as_string=False): """ Count the number of record types in given collection. If as_string is true, return a formatted string pair rather than a pair of ints """ counts = (-1, -1) try: tbl = inv.ALL_STRUC.record_types[inv.STR_NAME] recs = list(inv_db[tbl].find({'coll_id': coll_id})) n_types = len(recs) n_rec = sum([rec['count'] for rec in recs]) counts = (n_rec, n_types) except Exception as e: inv.log_dest.error("Error getting counts "+str(e)) if as_string: counts = (comma(counts[0]), comma(counts[1])) return counts
def number_field_render_webpage(): args = request.args sig_list = sum([[[d - 2 * r2, r2] for r2 in range( 1 + (d // 2))] for d in range(1, 7)], []) + sum([[[d, 0]] for d in range(7, 11)], []) sig_list = sig_list[:10] if len(args) == 0: init_nf_count() discriminant_list_endpoints = [-10000, -1000, -100, 0, 100, 1000, 10000] discriminant_list = ["%s..%s" % (start, end - 1) for start, end in zip( discriminant_list_endpoints[:-1], discriminant_list_endpoints[1:])] info = { 'degree_list': range(1, max_deg + 1), 'signature_list': sig_list, 'class_number_list': range(1, 6) + ['6..10'], 'count': '20', 'nfields': comma(nfields), 'maxdeg': max_deg, 'discriminant_list': discriminant_list } t = 'Global Number Fields' bread = [('Global Number Fields', url_for(".number_field_render_webpage"))] info['learnmore'] = [(Completename, url_for(".render_discriminants_page")), ('How data was computed', url_for(".how_computed_page")), ('Global number field labels', url_for(".render_labels_page")), ('Galois group labels', url_for(".render_groups_page")), ('Quadratic imaginary class groups', url_for(".render_class_group_data"))] return render_template("number_field_all.html", info=info, credit=NF_credit, title=t, bread=bread, learnmore=info.pop('learnmore')) else: return number_field_search(**args)
def retrieve_db_listing(db_name=None): """Retrieve listing for all or given database. db_name -- If absent, get listing of all dbs, if present, get listing of tables in named db """ try: if db_name is None: #query = {} records = list(db.inv_dbs.search({}, ['name', 'nice_name'])) counts = defaultdict(int) for tablename in db.tablenames: dbname = tablename.split('_')[0] counts[dbname] += 1 records = [(rec['name'], rec['nice_name'], counts[rec['name']]) for rec in records] else: db_id = idc.get_db_id(db_name) records = list(db.inv_tables.search({'db_id': db_id}, ['_id', 'name', 'nice_name', 'status'])) records = [(rec['name'], rec['nice_name'], comma(db[rec['name']].count()), ih.code_to_status(rec['status']), check_locked(rec['_id'])) for rec in records] return sorted(records, key=lambda s: s[0].lower()) except Exception as e: inv.log_dest.error("Something went wrong retrieving db info "+str(e)) raise return None
def number_field_render_webpage(): info = to_dict(request.args, search_array=NFSearchArray()) sig_list = sum([[[d - 2 * r2, r2] for r2 in range(1 + (d // 2))] for d in range(1, 11)], []) + sum( [[[d, 0]] for d in range(11, 21)], []) sig_list = [str(s).replace(' ', '') for s in sig_list[:16]] if not request.args: init_nf_count() discriminant_list_endpoints = [ -10000, -1000, -100, 0, 100, 1000, 10000, 100000, 1000000 ] discriminant_list = [ "%s..%s" % (start, end - 1) for start, end in zip(discriminant_list_endpoints[:-1], discriminant_list_endpoints[1:]) ] info['degree_list'] = list(range(1, max_deg + 1)) info['signature_list'] = sig_list info['class_number_list'] = list(range(1, 25)) info['count'] = '50' info['nfields'] = comma(nfields) info['maxdeg'] = max_deg info['discriminant_list'] = discriminant_list t = 'Number fields' bread = bread_prefix() return render_template("nf-index.html", info=info, credit=NF_credit, title=t, bread=bread, learnmore=learnmore_list()) else: return number_field_search(info)
def fixed_prec(r, digs=3): n = RealField(200)(r) * (10**digs) n = str(n.round()) head = int(n[:-digs]) if head >= 10**4: head = comma(head) return str(head) + '.' + n[-digs:]
def init_modlmf_count(self): if self._counts: return logger.debug("Computing modlmf counts...") modlmf = self.modlmf counts = {} nmodlmf = modlmf.count() counts["nmodlmf"] = nmodlmf counts["nmodlmf_c"] = comma(nmodlmf) max_level = modlmf.find().sort("level", DESCENDING).limit(1)[0]["level"] counts["max_level"] = max_level counts["max_level_c"] = comma(max_level) max_weight = modlmf.find().sort("weight_grading", DESCENDING).limit(1)[0]["weight_grading"] counts["max_weight"] = max_weight counts["max_weight_c"] = comma(max_weight) self._counts = counts logger.debug("... finished computing modlmf counts.")
def statistics(): init_ecdb_count() init_ecdb_stats() info = { "ncurves": comma(ncurves), "nclasses": comma(nclasses), "max_N": comma(max_N), "max_rank": max_rank, "rank_counts": rank_counts, "tor_counts": tor_counts, "max_sha": max_sha, "sha_counts": sha_counts, } credit = "John Cremona" t = "Elliptic curves/$\Q$: statistics" bread = [("Elliptic Curves", url_for("rational_elliptic_curves")), ("Elliptic curves/$\Q$: statistics", " ")] return render_template("elliptic_curve/statistics.html", info=info, credit=credit, title=t, bread=bread)
def statistics(): init_ecdb_count() init_ecdb_stats() info = { 'ncurves': comma(ncurves), 'nclasses': comma(nclasses), 'max_N': comma(max_N), 'max_rank': max_rank, 'rank_counts': rank_counts, 'tor_counts': tor_counts, 'max_sha': max_sha, 'sha_counts': sha_counts } credit = 'John Cremona' t = 'Elliptic curves/$\Q$: statistics' bread = [('Elliptic Curves', url_for("rational_elliptic_curves")), ('Elliptic curves/$\Q$: statistics', ' ')] return render_template("statistics.html", info=info, credit=credit, title=t, bread=bread)
def init_modlmf_count(self): if self._counts: return logger.debug("Computing modlmf counts...") modlmf = self.modlmf counts = {} nmodlmf = modlmf.count() counts['nmodlmf'] = nmodlmf counts['nmodlmf_c'] = comma(nmodlmf) max_level = modlmf.find().sort('level', DESCENDING).limit(1)[0]['level'] counts['max_level'] = max_level counts['max_level_c'] = comma(max_level) max_weight = modlmf.find().sort('min_weight', DESCENDING).limit(1)[0]['min_weight'] counts['max_weight'] = max_weight counts['max_weight_c'] = comma(max_weight) self._counts = counts logger.debug("... finished computing modlmf counts.")
def counts(self): logger.debug("Computing rep_galois_modl counts...") counts = {} nrep_galois_modl = db.modlgal_reps.count() counts['nrep_galois_modl'] = nrep_galois_modl counts['nrep_galois_modl_c'] = comma(nrep_galois_modl) logger.debug("... finished computing rep_galois_modl counts.") return counts
def init_ecdb_count(self): if self._counts: return logger.debug("Computing elliptic curve counts...") ecdb = self.ecdb counts = {} ncurves = ecdb.count() counts['ncurves'] = ncurves counts['ncurves_c'] = comma(ncurves) nclasses = ecdb.find({'number': 1}).count() counts['nclasses'] = nclasses counts['nclasses_c'] = comma(nclasses) max_N = ecdb.find().sort('conductor', DESCENDING).limit(1)[0]['conductor'] counts['max_N'] = max_N counts['max_N_c'] = comma(max_N) counts['max_rank'] = ecdb.find().sort('rank', DESCENDING).limit(1)[0]['rank'] self._counts = counts logger.debug("... finished computing elliptic curve counts.")
def init_hmf_count(self): if self._counts: return logger.debug("Computing HMF counts...") forms = self.forms fields = self.fields counts = {} nforms = forms.count() counts['nforms'] = nforms counts['nforms_c'] = comma(nforms) nfields = fields.count() counts['nfields'] = nfields counts['nfields_c'] = comma(nfields) max_deg = fields.find().sort('degree', DESCENDING).limit(1)[0]['degree'] counts['max_deg'] = max_deg counts['max_deg_c'] = comma(max_deg) self._counts = counts logger.debug("... finished computing HMF counts.")
def init_lattice_count(self): if self._counts: return logger.debug("Computing Lattice counts...") lattice = self.lattice counts = {} nlattice = lattice.count() counts["nlattice"] = nlattice counts["nlattice_c"] = comma(nlattice) max_dim = lattice.find().sort("dim", DESCENDING).limit(1)[0]["dim"] counts["max_dim"] = max_dim counts["max_dim_c"] = comma(max_dim) max_det = lattice.find().sort("det", DESCENDING).limit(1)[0]["det"] counts["max_det"] = max_det max_class_number = lattice.find().sort("class_number", DESCENDING).limit(1)[0]["class_number"] counts["max_class_number"] = max_class_number self._counts = counts logger.debug("... finished computing Lattice counts.")
def init_lattice_count(self): if self._counts: return logger.debug("Computing Lattice counts...") lattice = self.lattice counts = {} nlattice = lattice.count() counts['nlattice'] = nlattice counts['nlattice_c'] = comma(nlattice) max_dim = lattice.find().sort('dim', DESCENDING).limit(1)[0]['dim'] counts['max_dim'] = max_dim counts['max_dim_c'] = comma(max_dim) max_det = lattice.find().sort('det', DESCENDING).limit(1)[0]['det'] counts['max_det'] = comma(max_det) max_class_number = lattice.find().sort('class_number', DESCENDING).limit(1)[0]['class_number'] counts['max_class_number'] = max_class_number self._counts = counts logger.debug("... finished computing Lattice counts.")
def counts(self): counts = {} counts['nclasses'] = ncurves = sum(sum(L) for L in self._counts.itervalues()) counts['nclasses_c'] = comma(ncurves) counts['gs'] = self.gs counts['qs'] = self.qs counts['qg_count'] = defaultdict(lambda: defaultdict(int)) for (g,q), cnt in self._counts.items(): counts['qg_count'][q][g] = cnt return counts