Sharedwww / tables / hecke-tutorial / hecke.texOpen in CoCalc
Author: William A. Stein
1\documentclass{article}
2\include{macros}
3
5#1}\vspace{1ex}\par\noindent}
6
8#1}\vspace{1ex}\par\noindent}
9
10\begin{document}
11\begin{center}
12{\bf \Large \sc HECKE: Modular Forms Calculator}\vspace{1ex}\\
13by William Stein\\
14January 2, 2004
15\end{center}
16
17\head{What is \hecke{}?}\hecke{} is a {\sf C++} program that I wrote
18in 1999-2000 for computing with modular symbols and modular forms.  It
19implements algorithms of Cremona, Hijikata, Merel,
20Mestre-Oesterl\'{e}, Shimura, and others. It is free
21software, released under the GPL,
22and available for Linux and OS X here:
23\begin{verbatim}
24    http://modular.fas.harvard.edu/Tables/hecke-cpp.html
25\end{verbatim}
26(There is also a Windows port, but I'm not sure how to get a copy.)
27\hecke{} is {\em not} rock solid'', so you should be skeptical of
28the results it gives and aware that the interface is primitive.
29Nonetheless, \hecke{} is capable of many computations which aren't
30currently available in any other free package.
31
32\hecke{} grew out of work on my thesis
33which involves computing special values of $L$-functions, congruences,
34and verifying modularity of certain Galois representations.  In a
35sense, \hecke{} is also the program I wish had existed when I was
36taking my first modular forms course and wanted to see lots of
37concrete examples of modular forms.  Some of the tables computed
38using \hecke{} can be found at {\tt http://modular.fas.harvard.edu/\~{
39}was/Tables}.
40
41I stopped new development of \hecke{} in 2000 and implemented many of
42the same algorithms (and more) in {\sc Magma}, which is a closed
43source, non-free, but not for profit, computer algebra system
44developed at the University of Sydney.  (All of the code I wrote for
45{\sc Magma} is written in {\sc Magma} and can be viewed by anyone.)
46Fortunately, several volunteers (Alex Brown, Ami Fischman, and Justin
47Walker) have kept \hecke{} up-to-date, in the sense that it will
48compile on modern computers.
49
50\hecke{} is much different than the modular forms package I wrote in
51{\sc Magma}.  One major difference is that {\sc Magma} is a far more
52complicated system, and using it to do anything nontrivial requires
53some basic familiarity with how {\sc Magma} works, which takes some
54time to acquire.  In contrast, \hecke{} (especially the msymbols''
55mode, see below) does nothing besides computations with modular forms,
56and has menus, so you can immediately start computing Hecke operators
57and basis.  However, when using \hecke{} you'll probably often import
58the results of computations to another system, such as PARI, Maple, or
59Mathematica, and work with them further there.  Another key difference
60is that \hecke{} computations are persistent, in the sense that
61\hecke{} saves the result of {\em every} computation you do to your hard
62drive (in a folder called {\tt data}), so next time you do the
63computation it is loaded from disk.  In contrast, the {\sc Magma}
64modular forms package as no built-in functionality for saving
65computations to disk (as of Jan. 2004).
66
67\newpage\head{What does \hecke{} do?}\hecke{} is an interactive calculator.
68\begin{itemize}
69\item {\bf Modular forms and Hecke operators:} Computations on the
70spaces of modular forms $M_k(\Gamma_1(N),\eps)$, for $k\geq 2$, over
71cyclotomic and finite fields.  Functions include:
72 \begin{itemize}
73 \item Computation of bases of newforms.
74      Within computational
75      limits, the level, weight, and character can be pretty
76      much arbitrary, with the restriction that $k\geq 2$ be
77      an integer.  Furthermore, all eigenforms are computed,
78      {\em not} just the ones with eigenvalues in $\Q$.
79 \item Computation of the Birch and Swinnerton-Dyer'' rational
80       numbers $L(M_f,i)/\Omega_i$ where $M_f$ is a complex torus
81       attached to $f$ and $\Omega_i$ is a certain volume.
82 \item For optimal quotients $A_f$ of $J_0(N)$
83associated to newforms:
84 \begin{enumerate}
85   \item The modular degree and group structure of the canonical
86         polarization obtained by pullback of the $\theta$ divisor.
87   \item Intersection of $A_f^{\vee}$ and $A_g^{\vee}$.
88   \item Order of image of $(0)-(\infty)$ in $A_f(\Q)_{\tor}$.
89   \item Multiple of order of $A_f(\Q)_{\tor}$.
90   \item Tamagawa numbers of quotients of $J_0(p)$,
91         with $p$ prime.  (Note: Component group
92        order at~$p$ for quotient of $J_0(N)$,
93        when $\ord_p(N)=1$, is available in {\sc Magma}.)
94 \end{enumerate}
95(Note: Similar computations for quotients of $J_1(N)$
96are mostly implemented in {\sc Magma}, though not
97well documented as of January 2004.)
98 \item Discriminants of Hecke algebras.
99 \item Numerical computation of special values and period
100       lattices of forms of even weight $k\geq 2$, in many
101       (but not all) cases. When $f$ has rational Fourier
102       coefficients, computation of the invariants of
103       the associated elliptic curve over $\R$ (the implementation
104       of this is not nearly as refined as in Cremona's elliptic
105       curve package).
106  \end{itemize}
107
108  \item {\bf Formulas:} The classical formulas, such
109as the numbers of cusps on modular curves, dimensions of spaces
110of cusps forms, and computation of
111$\dim S_k(\Gamma_1(N),\eps)$ for $k\geq 2$
112and $\eps$ a Dirichlet character modulo $N$.
113(Note: Computation of $\dim S_k(\Gamma_1(N),\eps)$
114using the Hijikata trace formula is non-optimal;
115there is a much simpler formula of Cohen and
116Oesterle, which is what is implemented in {\sc Magma}.)
117
118  \item {\bf Character groups of tori:} Action of Hecke operators
119$T_{\ell}$, for $\ell=2,3,5,7$, on the character group associated to
120$J_0(p)$ (using the Mestre-Oesterl\'{e} graph method).  The matrices
121attained in this way are very sparse.
122
123  \item {\bf Tables:} Functions for making tables.
124
125\end{itemize}
126
127
128\bighead{Guided tour}In this guided tour, you will see how to use
129\hecke{} to compute the action of Hecke operators, bases of
130eigenforms, and obtain information about special values of
131$L$-functions.  The output given below is a small subset of
132the actual output, which is much more verbose.
133
135{\tt hecke} at the command line.  You will see something like this:
136\begin{verbatim}
137# hecke
138HECKE Version 0.4, Copyright (C) 1999-2003, William A. Stein
139HECKE comes with ABSOLUTELY NO WARRANTY.
140This is free software, and you are welcome to redistribute it
141under certain conditions; read the included COPYING file for details.
142
143
144          HECKE:  Modular Forms Calculator   Version 0.4 (Sep. 24, 2003)
145
146                               William Stein
147        Ported to Mac OS X (Justin C. Walker) and Windows (Alex F. Brown)
148Send bug reports and suggestions to was@math.harvard.edu.
149Type ? for help.
150
151HECKE>
152\end{verbatim}
153Typing {\tt ?} gives a list of commands and modes which include:
154\begin{verbatim}
155HECKE> ?
156
158  calc:      Motive calculator
159  exsymbols: Extended modular symbols mode
160  formulas:  Formula calculator
161  graphs:    Monodromy pairing calculator
162  msymbols:  Modular symbols calculator
163  tables:    Table making routines
164  quit:      Quit
165\end{verbatim}
166\head{Modular forms and Hecke operators calculator}Type {\tt
167msymbols} to start the modular forms and Hecke operators calculator.
168You will be asked for several pieces of information, which define the
169space on which to work.  In this mode you can only compute with
170one space of modular forms at a time (see the {\tt calc} mode for
171computations that relate different spaces). Answer as follows:
172\begin{verbatim}
173   level N = 389
174   character chi = 0
175   weight k = 2
176\end{verbatim}
177After a brief computation the calculator interface will
178print some information about $M_2(\Gamma_0(389))$ and
180\begin{verbatim}
181   ---------------------------------------------------------------
182   Current space:   M_2(Gamma_0(389); Q)^+, dim=33
183   Hecke action on: V=M_2, dim=33
184   ---------------------------------------------------------------
185   M_2(389) ?
186\end{verbatim}
187The \verb+Q)^+{\tt +} means that we are actually computing with the $+1$
188quotient of modular symbols, so in general some Eisenstein series
189could be missing, but all cusp forms will be present.  Use the
190{\tt exsymbols} mode for more precise control.
191
192Typing {\tt ?} gives a list of help topics.
193\begin{verbatim}
194   1: computing OPERATORS
195   2: setting current SPACE
196   3: cutting out SUBSPACES
197   4: computing BASIS
198   5: CONVERSIONS between representations
199   6: arithmetic INVARIANTS of torus A_V
200   7: INVARIANTS of Hecke algebra
201   8: OPTIONS
202\end{verbatim}
203To get an idea of what  $M_2(\Gamma_0(389))$ looks like, we compute
204the characteristic polynomials of several Hecke operators $T_n$.
205We do this by typing {\tt t}, then entering a positive integer $n$.
206\begin{verbatim}
207   ? t
208   Tn: Enter values of n, then q when done.
209   2
210   f2=(x-3)*(x + 2)*(x^2 -2)*(x^3 -4*x -2)*
211      (x^20 -3*x^19 -29*x^18 + 91*x^17 + 338*x^16 -1130*x^15
212       -2023*x^14 + 7432*x^13 + 6558*x^12 -28021*x^11 -10909*x^10
213       + 61267*x^9 + 6954*x^8 -74752*x^7 + 1407*x^6 + 46330*x^5
214       -1087*x^4 -12558*x^3 -942*x^2 + 960*x + 148)*
215      (x^6 + 3*x^5 -2*x^4 -8*x^3 + 2*x^2 + 4*x -1);
216   q
217\end{verbatim}
218Let's compute the action of a few Hecke operators on the factor of
219degree two.  Type {\tt subeigenpoly}, then select the appropriate
220factor:
221\begin{verbatim}
222   M_2(389) ? subeigenpoly
223   [...]
224   n = 2                             <---- you type this
225   Choose one of the following factors.
226        1: x+2
227        2: x-3
228        3: x^2-2
229        4: x^3-4*x-2
230        5: x^20-3*x^19-29*x^18+91*x^17+338*x^16-1130*x^15-2023*x^14+
231        7432*x^13+6558*x^12-28021*x^11-10909*x^10+61267*x^9+6954*x^8-
232        74752*x^7+1407*x^6+46330*x^5-1087*x^4-12558*x^3-942*x^2+960*x+148
233        6: x^6+3*x^5-2*x^4-8*x^3+2*x^2+4*x-1
234        7: ALL factors
235   Select a factor: 3               <---- you type this
236\end{verbatim}
237
238When the {\tt M\_2(389) ? } prompt appears, type {\tt opmatrix} to
239turn on matrix display and {\tt opcharpoly} to turn off
240computation of characteristic polynomials. Now you can compute
241matrices which represent the Hecke operators on this dimension two
242space:
243\begin{verbatim}
244   M_2(389) ? opmatrix
245   matrix display on
246   M_2(389) ? opcharpoly
247   charpoly display off
248   M_2(389) ? t
249   2
250   T2=[2,1;-2,-2];
251   3
252   T3=[0,1;-2,-4];
253   6
254   T6=[-2,-2;4,6];
255   q
256   M_2(389) ? opmatrix
257   matrix display off
258   M_2(389) ? opcharpoly
259   charpoly display on
260\end{verbatim}
261Let $A$ denote the corresponding two-dimensional optimal quotient of
262$J_0(389)$.  To compute the BSD value $L(A,1)/\Omega_A$, type {\tt
263torusbsd}.  \hecke{} outputs $0$ along with the first few terms of the
264$q$-expansion of $f$ and the discriminant of the ring
265$\Z[\ldots,a_n,\ldots]$:
266\begin{verbatim}
267   \\ L(A_f1,1)/Omega_f = 0
268   \\ disc(Z[f]) = 2^3
269   a1 = Mod(a,a^2-2);
270   f1 = q + (a1)*q^2 + (a1-2)*q^3 + -1*q^5 + (-2*a1+2)*q^6 +
271            (-2*a1-1)*q^7 + O(q^8);
272\end{verbatim}
273
274That $L(A_f,1)=0$ is consistent with the sign of the functional
275equation for $L(A_f,s)$.  The sign in the functional equation for the
276$L$-function is minus the sign of the Atkin-Lehner involution
277$W_{389}$.  To compute this involution, type {\tt actatkin} and then
278enter {\tt 389} for $p$.  \hecke{} compute that $W_{389}=I$ on~$A$,
279so the sign in the functional equation is $-1$ and $L(A,1)$ is forced
280to vanish.
281\begin{verbatim}
282   M_2(389) ? actatkin
283   Compute W_q where p = 389
284   [...]
285   charpoly(W389) = (x -1)^2
286\end{verbatim}
287Where it says Compute $W_q$ where $p=$'', the subscript~$q$
288is the power of the prime~$p$ that exactly divides the level.
289
290
291To obtain the $q$-expansion of a normalized eigenform in
292our two-dimensional space, type {\tt basisnew} then {\tt n=7}.
293The result is
294\begin{verbatim}
295s1=t^2-2;  s=Mod(t,t^2-2);
296f1 = q + (s)*q^2 + (s-2)*q^3 + -1*q^5 +
297         (-2*s+2)*q^6 + (-2*s-1)*q^7 + O(q^8);
298\end{verbatim}
299which means that a normalized newform is
300$$f_1 = q +\sqrt{2}q^2 + (\sqrt{2}-2)q^3 301 -q^5 + (-2\sqrt{2}+2)q^6 302 +(-2\sqrt{2}-1)q^7 + \cdots$$
303
304The space $S_2(\Gamma_0(389))$ is of particular interest because
305$p=389$ is the only prime $<50000$ such that $p$ divides
306the discriminant of the Hecke algebra associated to
307$S_2(\Gamma_0(p))$.
308To compute the discriminant of the Hecke algebra $\T$ on $S_2(\Gamma_0(389))$,
309first switch back to the full cuspidal subspace using the
310{\tt spacecusp} command.
311\begin{verbatim}
312   M_2(389) ? ?2
313
314   spacecusp       spaceeisenstein     spaceintegral
316   spacenew        spacesave
317
318   M_2(389) ? spacecusp
319   ---------------------------------------------------------------
320   Current space:   M_2(Gamma_0(389); Q)^+, dim=33
321   Hecke action on: V=S_2, dim=32
322   ---------------------------------------------------------------
323\end{verbatim}
324Next type {\tt heckedisc} and wait a minute while Hecke operators
325$T_n$, for $n\leq 65$ are computed by \hecke{} in order to compute the
326discriminant.
327\begin{verbatim}
328   M_2(389) ? heckedisc
329   ... (wait) ...
330   disc(T|V) = 151275502126849231372972147100629748722244296572574
331               00664317000679427623878656000000
332   [It seems to wait forever in the current version, perhaps
333    trying to factor the discriminant...]
334\end{verbatim}
335We find that the discriminant of the $\Z$-module generated by
336$T_1,\ldots,T_{65}$ is
337$$592456554486106225601956409404798293104261020095616213409857536000000$$
338$$=2^{53} \cdot 3^4\cdot 5^6\cdot31^2\cdot 37\cdot97^2\cdot 389\cdot3881 339\cdot 215517113148241 340\cdot 477439237737571441$$
341
342
343
345a basis of eigenforms for
346$S_4(\Gamma_0(13),\eps)$
347where $\eps:(\Z/13\Z)\ra\C^*$ is a character whose image has
348order $3$. Type {\tt x} to quit computing on $M_2(389)$, type
349{\tt msymbols} again and enter {\tt N = 13}, {\tt chi = 3},
350and {\tt k = 4}.  In a second, the status display will appear:
351\begin{verbatim}
352   -------------------------------------------------------------------
353   Current space:   M_4(Gamma_0(13), eps=[3]; Q[a]/(x^2 + -1 * x + 1))^+, dim=5
354   Hecke action on: V=M_4, dim=5
355   -------------------------------------------------------------------
356   M_4(13) ?
357\end{verbatim}
358(Note: The quadratic polynomial in the quotient should
359be in terms of $a$ instead of $x$, but I never implemented
360this.)
361Type {\tt basisnew}, then {\tt n = 3} to get the first $3$
362terms of the $q$-expansions of a basis of newforms.
363\begin{verbatim}
364   M_4(13) ? basisnew
365   max n=3
366\end{verbatim}
367(Note: Only one representative from each Galois conjugacy class
368of newforms is provided.)   The output is
369\begin{verbatim}
370   f1 = q + (-4*a)*q^2 + (-2*a)*q^3 + O(q^4);
371   s2=t^2+(-5*a)*t+(2*a-2); s=Mod(t,t^2+(-5*a)*t+(2*a-2));
372   f2 = q + (s)*q^2 + ((-3)*s+(5*a))*q^3 + O(q^4);
373\end{verbatim}
374This means that there are two conjugacy classes of normalized
375eigenforms, with representatives $f_1$ and $f_2$.  The first is
376$f_1=q-4aq^2-2aq^3+\cdots$, where~$a$ is a primitive cube root of~$1$,
377and the second is $f_2 =q + sq^2 +(-3s+5a)q^3 +\cdots$ where~$s$ is a
378root of $t^2-5at+2a-2=0$.
379
380To work in fields of characteristic other than $0$,
381use the extended mode by typing {\tt exsymbols} instead of {\tt msymbols}
382at the {\tt HECKE> } prompt.
383
384\head{Motives associated to modular forms}The {\tt msymbols} mode is
385useful for computing basis of eigenforms and the action of Hecke
386operators on spaces of modular forms.  It is less useful
387for computing specific information about the structure of $J_0(N)$.
388For that, use the {\tt calc} mode.  Type {\tt x} to get to the {\tt
389HECKE>} prompt, then type {\tt calc}.  When asked if you want to work
390in the fast $+1$ quotient, typing {\tt n}. (If you type {\tt yes},
391many computations will be an order of magnitude faster, but are likely
392to be wrong by a power of~$2$.)
393
394A space (or the corresponding abelian variety) is specified in the
395{\tt calc} mode as follows:
396\begin{center}
397   {\bf [level]k[weight][isogeny class].[command][(arguments)]}
398\end{center}
399where the level is an integer, the weight is an integer $\geq 2$,
400the isogeny classes are  A, B, C, \ldots, Z, AA, BB, CC, and
401the commands will be outlined below.
402Omitting the weight part of the command is the same as specifying
403$k=2$.
404
405First enter the calc mode, then type {\tt 125} to obtain a list of
406optimal quotients of $J_0(125)$.
407\begin{verbatim}
408   M_4(13) ? q
409   Leaving modular symbols calculator.
410   HECKE> ?
411
413     calc:      Motive calculator
414     exsymbols: Extended modular symbols mode
415     formulas:  Formula calculator
416     graphs:    Monodromy pairing calculator
417     msymbols:  Modular symbols calculator
418     tables:    Table making routines
419     quit:      Quit
420
421   HECKE> calc
422   Welcome to the motive calculator.
423   WORK IN FAST MODE (+1 quotient, certain powers of 2 *wrong*)?   [y] n
424   Type ? for help.
425
426   ? 125
427
428  MOTIVECOMMAND = Summarize level.
429  ****** SUMMARIZE LEVEL.
430125k2  dim      W
431A       2       +
432B       2       -
433C       4       -
434\end{verbatim}
435The first time you type 125, a huge amount of log information will be
436printed.  Simply type 125 again to list the above without the logging
437information.  The second time you compute level 125, it takes no extra
438time, since everything is stored in the {\tt data} directory.   Even
439if you quit \hecke{} and restart, it will still list 125 quickly.
440
441This means that $J_0(125)\sim A\cross B\cross C$
442where $A,B,C$ are abelian varieties of dimensions
443$2$, $2$, and $4$.  We can compute $L(A,1)/\Omega_A$,
444$L(B,1)/\Omega_B$ and $L(C,1)/\Omega_C$:
445\begin{verbatim}
446   ? 125A.bsdratio
447   0
448   ? 125B.bsdratio
449   2^2/5
450   ? 125C.bsdratio
451   1/5
452\end{verbatim}
453You may also type {\tt 125a.bsdratio}, as the isogeny
454code is not case sensitive.
455The signs in the {\tt W} column above give the signs of the
456Atkin-Lehner involution $W_{125}$.
457
458What about the torsion?  Type {\tt 125.torsionbound(13)} to get an
459upper bound on the torsion subgroup of $J_0(125)$.  Then type {\tt
460125.cusporder} to compute the order of $(0)-(\infty)\in 461J_0(125)(\Q)$.
462\begin{verbatim}
463   ? 125.torsionbound(13)
464   5^2
465   ? 125.cusporder
466   5^2
467\end{verbatim}
468We're lucky because the divisor and multiple match up, so we conclude
469that $J(\Q)\ncisom\Z^2\oplus(\Z/25\Z)$. Next type {\tt
470125A.intersection(B)} to obtain the structure of the finite
471abelian group $A'\intersect B'\subset J$, where $A'$, $B'$ are the
472abelian varieties dual to $A$ and $B$. The answer {\tt [2,2,2,2]}
473indicates that the intersection is $(\Z/2\Z)^4$.  This implies
474that the corresponding newforms satisfy a congruence in
475characteristic $2$. To exit {\tt calc} mode, type {\tt
476$\backslash{}$q}.
477
478Unfortunately, I have not written a tutorial for using the
479extended modular symbols mode or making tables.
480
481\end{document}
482
483
484%(For more on $J_0(125)$,
485%see Poluakis, D. {\em La courbe modulaire $X_0(125)$ et sa
486%jacobienne}, J. Num. Theory {\bf 25} (1987), no. 1, 112--131.)
487
488To compute the modular degree of $A$ type {\tt torusmoddeg}.
489It will again ask for a factor of $T_2$; enter choice $1$.
490The answer which \hecke{} returns is $2^2\cdot 3^2$.
491{\em Warning:} We are really computing the action of Hecke
492operators on the $+1$ subspace of $H_1(X_0(N))$ so the modular
493degree can be wrong by a power of $2$; to compute the correct
494modular degree it is necessary to start the modular symbols
495mode using the command {\tt Modular} instead of {\tt modular}.
496