CoCalc Public Fileswww / cgi-bin / mfd / charpoly.pyOpen with one click!
Author: William A. Stein
Compute Environment: Ubuntu 18.04 (Deprecated)
1
#!/usr/bin/python
2
3
# charpoly.py
4
# William Stein, 2000
5
6
import cgi
7
import mfd, constants
8
import Documents, HTML
9
10
print "Content-Type: text/html" # HTML is following
11
print # blank line, end of headers
12
form = cgi.FieldStorage()
13
14
if not form.has_key("n"):
15
n = 2
16
else:
17
n = int(form["n"].value)
18
19
M = mfd.ModSymForm(form)
20
f = M.charpoly(n)
21
22
doc = Documents.Document()
23
24
doc.append(HTML.TITLE("Characteristic polynomial: level=%s, weight=%s, n=%s"%\
25
(M.level, M.weight, n)))
26
doc.append(HTML.LINK(rel="stylesheet", type="text/css", \
27
HREF="http://%s/mfd/mfd.css"%constants.hostname, TITLE="was"))
28
doc.append(HTML.BODY(klass="top"))
29
30
31
doc.append("The characteristic polynomial of T<sub>%s</sub>"%n)
32
if f == constants.not_computed:
33
34
35
doc.append(" is not in the database. Moreover, I suspect that it will take "+\
36
"more than a few seconds to compute.")
37
doc.append("Thus if you <b>really really</b> need it, please send email to ")
38
doc.append(HTML.A("[email protected]",href="mailto:[email protected]"),".")
39
else:
40
doc.append(":<br><br>", f)
41
42
print doc
43
44