def render_isogeny_class(iso_class): info = {} credit = 'John Cremona' label = iso_class C = base.getDBConnection() data = C.ellcurves.isogeny.find_one({'label': label}) if data is None: return "No such isogeny class" ainvs = [int(a) for a in data['ainvs_for_optimal_curve']] E = EllipticCurve(ainvs) info = {'label': label} info['optimal_ainvs'] = ainvs if 'imag' in data: info['imag'] = data['imag'] if 'real' in data: info['real'] = data['real'] info['rank'] = data['rank'] info['isogeny_matrix'] = latex(matrix(eval(data['isogeny_matrix']))) info['modular_degree'] = data['degree'] #info['f'] = ajax_more(E.q_eigenform, 10, 20, 50, 100, 250) info['f'] = web_latex(E.q_eigenform(10)) G = E.isogeny_graph() n = G.num_verts() G.relabel(range(1, n + 1)) # proper cremona labels... info['graph_img'] = image_src(G.plot(edge_labels=True)) curves = data['label_of_curves_in_the_class'] info['curves'] = list(curves) info['download_qexp_url'] = url_for('download_qexp', limit=100, ainvs=','.join([str(a) for a in ainvs])) info['download_all_url'] = url_for('download_all', label=str(label)) friends = [('Elliptic Curve %s' % l, "/EllipticCurve/Q/%s" % l) for l in data['label_of_curves_in_the_class']] friends.append(('Quadratic Twist', "/quadratic_twists/%s" % (label))) friends.append(('Modular Form', url_for("emf.render_classical_modular_form_from_label", label="%s" % (label)))) info['friends'] = friends t = "Elliptic Curve Isogeny Class %s" % info['label'] bread = [('Elliptic Curves ', url_for("rational_elliptic_curves")), ('isogeny class %s' % info['label'], ' ')] return render_template("elliptic_curve/iso_class.html", info=info, bread=bread, credit=credit, title=t)
def plot_iso_graph(label): C = lmfdb.base.getDBConnection() data = C.elliptic_curves.curves.find_one({'lmfdb_iso': label}) if data is None: return elliptic_curve_jump_error(label, {}) ainvs = [int(a) for a in data['ainvs']] E = EllipticCurve(ainvs) G = E.isogeny_graph() n = G.num_verts() P = G.plot(edge_labels=True, layout='spring') _, filename = tempfile.mkstemp('.png') P.save(filename) data = open(filename).read() os.unlink(filename) response = make_response(data) response.headers['Content-type'] = 'image/png' return response
def plot_iso_graph(label): C = lmfdb.base.getDBConnection() data = C.elliptic_curves.curves.find_one({'lmfdb_iso': label}) if data is None: return elliptic_curve_jump_error(label, {}) ainvs = [int(a) for a in data['ainvs']] E = EllipticCurve(ainvs) G = E.isogeny_graph() n = G.num_verts() P = G.plot(edge_labels=True, layout='spring') _, filename = tempfile.mkstemp('.png') P.save(filename) data = open(filename).read() os.unlink(filename) response = make_response(data) response.headers['Content-type'] = 'image/png' return response
def plot_iso_graph(label): C = lmfdb.base.getDBConnection() data = C.elliptic_curves.curves.find_one({"lmfdb_iso": label}) if data is None: return elliptic_curve_jump_error(label, {}) ainvs = [int(a) for a in data["ainvs"]] E = EllipticCurve(ainvs) G = E.isogeny_graph() n = G.num_verts() G.relabel(range(1, n + 1)) # proper lmfdb labels... P = G.plot(edge_labels=True, layout="spring") _, filename = tempfile.mkstemp(".png") P.save(filename) data = open(filename).read() os.unlink(filename) response = make_response(data) response.headers["Content-type"] = "image/png" return response
def render_isogeny_class(iso_class): info = {} credit = 'John Cremona' label=iso_class C = base.getDBConnection() data = C.ellcurves.isogeny.find_one({'label': label}) if data is None: return "No such isogeny class" ainvs = [int(a) for a in data['ainvs_for_optimal_curve']] E = EllipticCurve(ainvs) info = {'label': label} info['optimal_ainvs'] = ainvs if 'imag' in data: info['imag']=data['imag'] if 'real' in data: info['real']=data['real'] info['rank'] = data['rank'] info['isogeny_matrix']=latex(matrix(eval(data['isogeny_matrix']))) info['modular_degree']=data['degree'] #info['f'] = ajax_more(E.q_eigenform, 10, 20, 50, 100, 250) info['f'] = web_latex(E.q_eigenform(10)) G = E.isogeny_graph(); n = G.num_verts() G.relabel(range(1,n+1)) # proper cremona labels... info['graph_img'] = image_src(G.plot(edge_labels=True)) curves = data['label_of_curves_in_the_class'] info['curves'] = list(curves) info['download_qexp_url'] = url_for('download_qexp', limit=100, ainvs=','.join([str(a) for a in ainvs])) info['download_all_url'] = url_for('download_all', label=str(label)) friends=[('Elliptic Curve %s' % l , "/EllipticCurve/Q/%s" % l) for l in data['label_of_curves_in_the_class']] friends.append(('Quadratic Twist', "/quadratic_twists/%s" % (label))) friends.append(('Modular Form', url_for("emf.render_classical_modular_form_from_label",label="%s" %(label)))) info['friends'] = friends t= "Elliptic Curve Isogeny Class %s" % info['label'] bread = [('Elliptic Curves ', url_for("rational_elliptic_curves")),('isogeny class %s' %info['label'],' ')] return render_template("elliptic_curve/iso_class.html", info = info,bread=bread, credit=credit,title = t)