CoCalc Shared Fileswww / cgi-bin / mfd / mfe_eigenvalues.pyOpen in CoCalc with one click!
Author: William A. Stein
1
#!/usr/bin/python
2
3
# mfe_eigenvalues.py (part of the Modular Forms Explorer)
4
# (c) William Stein, November 2001, [email protected]
5
6
import cgi # cgi-bin
7
import Documents, HTML
8
9
import misc
10
import constants
11
import mfd # modular forms database
12
13
import os, string
14
15
big = 1700
16
17
18
print "Content-Type: text/html" # HTML is following
19
print # blank line, end of headers
20
21
form = cgi.FieldStorage()
22
23
if not form.has_key("code"):
24
print "<h1>Error</h1>"
25
print "The mfe_eigenvalues.py script was called from an invalid form."
26
print "This means William Stein ([email protected]) made a mistake somewhere, "
27
print "or our web client did something funny."
28
print "Please let him know how you caused this error message."
29
30
##################################
31
32
code = form["code"].value
33
f = mfd.ModSym_From_Code(code)
34
N = f.level
35
k = f.weight
36
eps = f.dirchar
37
38
doc = Documents.Document()
39
doc.append(HTML.TITLE('The Modular Forms Explorer: Hecke Eigenvalues of %s'%code))
40
doc.append(HTML.LINK(rel="stylesheet", type="text/css", \
41
HREF="/mfd/mfd.css", TITLE="was"))
42
43
body = HTML.BODY(klass="top")
44
45
doc.append(body)
46
body.append(HTML.CENTER(HTML.H1('The Modular Forms Explorer')))
47
body.append(HTML.CENTER(HTML.FORM(\
48
HTML.INPUT(type="submit", name="button", value="Go to N=%s, k=%s"%(N,k)),\
49
HTML.INPUT(type="hidden", name="level", value=str(N)), \
50
HTML.INPUT(type="hidden", name="weight", value=str(k)), \
51
HTML.INPUT(type="hidden", name="iso_class", value="0"), \
52
HTML.INPUT(type="hidden", name="character", value="%s:%s"%(eps,N)), \
53
action="%s/mfe_full_html.py"%constants.CGIROOT, method="POST")))
54
55
body.append(HTML.HR())
56
body.append(HTML.H2("Hecke Eigenvalues of <b>%s</b>"%code))
57
58
body.append("<ul>")
59
traces = f.traces()
60
if traces != constants.not_computed:
61
body.append("<li>The traces down to <b>Q</b> of the first few "\
62
"Fourier coefficients <i>a<sub>p</sub></i> of <b>%s</b>:<br>"%code)
63
s = "%s"%traces
64
s = string.replace(s,"'","")
65
s = "<table bgcolor=white cellpadding=10 cellspacing=1 border=1><tr><td> " + s + " </td></tr></table>"
66
body.append(s)
67
68
if f.is_elliptic_curve() and f.aplist_maxp() == constants.not_computed:
69
f.aplist_compute()
70
71
if False and f.aplist_maxp() != constants.not_computed:
72
body.append("<br><br><li>")
73
button = HTML.FORM(HTML.INPUT(type="submit", name="button", value="Display"),\
74
"&nbsp first &nbsp", HTML.INPUT(type="text", name="precision", value="8"), \
75
"&nbsp terms of the q-expansion of <b>%s</b> in terms of a power basis for the Fourier coefficient field."%code,\
76
HTML.INPUT(type="hidden", name="code", value=code), \
77
action="%s/mfe_qexpansion.py"%constants.CGIROOT, method="POST")
78
body.append(button)
79
80
body.append("<br><br><li>")
81
button = HTML.FORM(HTML.INPUT(type="submit", name="button", value="Display"),\
82
"&nbsp first &nbsp", HTML.INPUT(type="text", name="precision", value="8"), \
83
"&nbsp integral basis of q-expansions for the space spanned by the Galois conjugates of <b>%s</b>."%code,\
84
HTML.INPUT(type="hidden", name="code", value=code), \
85
action="%s/mfe_q_integral.py"%constants.CGIROOT, method="POST")
86
body.append(button)
87
88
if f.aplist_maxp() > 0:
89
body.append('<br><br><li> The Hecke eigenvalues <i>a<sub>p</sub></i> for p <= %s (<a href="/mfd/mfe/aplist_notation.html">notation</a>):'%f.aplist_maxp())
90
aplist = f.aplist()
91
if len(aplist) > big:
92
size = len(aplist)
93
aplist = aplist[:big] + " \n&nbsp... (truncated)>"
94
is_big = 1
95
else:
96
is_big = 0
97
aplist = string.replace(aplist, ' ', '')
98
aplist = string.replace(aplist, ',[', ',\n[')
99
aplist = string.replace(aplist, '[[', '\n[[')
100
aplist = string.replace(aplist, ']],', ']],\n')
101
aplist = string.replace(aplist, "<","< ")
102
aplist = string.replace(aplist, ">"," >")
103
t = "<table bgcolor=white cellpadding=10 cellspacing=1 border=1><tr><td><pre>" + aplist + "</pre></td></tr></table>"
104
if is_big:
105
body.append(HTML.BR(),HTML.BR())
106
button = HTML.FORM(HTML.INPUT(type="submit", name="button", \
107
value="Complete List"), "&nbsp&nbsp(%sk)"%(size/1000),\
108
HTML.INPUT(type="hidden", name="code", value=code), \
109
action="%s/mfe_aplist.py"%constants.CGIROOT, method="POST")
110
body.append(button)
111
112
body.append("\n"+t)
113
114
115
body.append("</ul>")
116
117
print doc
118
119
120
121