CoCalc Public Fileswww / cgi-bin / mfd / mfe_hecke_field.pyOpen with one click!
Author: William A. Stein
Compute Environment: Ubuntu 18.04 (Deprecated)
1
#!/usr/bin/python
2
3
# hecke_field.py
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
print "Content-Type: text/html" # HTML is following
16
print # blank line, end of headers
17
18
form = cgi.FieldStorage()
19
20
if not form.has_key("code"):
21
print "<h1>Error</h1>"
22
print "The mfe_hecke_field.py python script was called from an invalid form."
23
print "This means William Stein ([email protected]) made a mistake somewhere, "
24
print 'or a web client or server did something "funny".'
25
print "Please let him know how you caused this error message."
26
27
##################################
28
29
code = form["code"].value
30
f = mfd.ModSym_From_Code(code)
31
N = f.level
32
k = f.weight
33
eps = f.dirchar
34
35
doc = Documents.Document()
36
doc.append(HTML.TITLE('The Modular Forms Explorer: Hecke Eigenvalue Field of %s'%code))
37
doc.append(HTML.LINK(rel="stylesheet", type="text/css", \
38
HREF="/mfd/mfd.css", TITLE="was"))
39
40
body = HTML.BODY(klass="top")
41
doc.append(body)
42
43
body.append(HTML.CENTER(HTML.H1('The Modular Forms Explorer')))
44
body.append(HTML.CENTER(HTML.FORM(\
45
HTML.INPUT(type="submit", name="button", value="Go To N = %s, k = %s"%(N,k)),\
46
HTML.INPUT(type="hidden", name="level", value=str(N)), \
47
HTML.INPUT(type="hidden", name="weight", value=str(k)), \
48
HTML.INPUT(type="hidden", name="iso_class", value="0"), \
49
HTML.INPUT(type="hidden", name="character", value="%s:%s"%(eps,N)), \
50
action="/cgi-bin/mfd/mfe_full_html.py", method="POST")))
51
52
body.append(HTML.HR())
53
body.append("The field generated by the Fourier coefficients of <b>%s</b> is generated by a root of the following polynomial:<br><br>"%code)
54
field = f.hecke_field()
55
field = string.replace(field, "+", " + ")
56
field = string.replace(field, "-", " - ")
57
body.append(HTML.TT(field))
58
59
print doc
60
61
62
63