\documentclass{article}1\include{macros}23\newcommand{\head}[1]{\vspace{3ex}\par\noindent{\large \bf4#1}\vspace{1ex}\par\noindent}56\newcommand{\bighead}[1]{\vspace{4ex}\par\noindent{\Large \bf7#1}\vspace{1ex}\par\noindent}89\begin{document}10\begin{center}11{\bf \Large \sc HECKE: Modular Forms Calculator}\vspace{1ex}\\12by William Stein\\13January 2, 200414\end{center}1516\head{What is \hecke{}?}\hecke{} is a {\sf C++} program that I wrote17in 1999-2000 for computing with modular symbols and modular forms. It18implements algorithms of Cremona, Hijikata, Merel,19Mestre-Oesterl\'{e}, Shimura, and others. It is free20software, released under the GPL,21and available for Linux and OS X here:22\begin{verbatim}23http://modular.fas.harvard.edu/Tables/hecke-cpp.html24\end{verbatim}25(There is also a Windows port, but I'm not sure how to get a copy.)26\hecke{} is {\em not} ``rock solid'', so you should be skeptical of27the results it gives and aware that the interface is primitive.28Nonetheless, \hecke{} is capable of many computations which aren't29currently available in any other free package.3031\hecke{} grew out of work on my thesis32which involves computing special values of $L$-functions, congruences,33and verifying modularity of certain Galois representations. In a34sense, \hecke{} is also the program I wish had existed when I was35taking my first modular forms course and wanted to see lots of36concrete examples of modular forms. Some of the tables computed37using \hecke{} can be found at {\tt http://modular.fas.harvard.edu/\~{38}was/Tables}.3940I stopped new development of \hecke{} in 2000 and implemented many of41the same algorithms (and more) in {\sc Magma}, which is a closed42source, non-free, but not for profit, computer algebra system43developed at the University of Sydney. (All of the code I wrote for44{\sc Magma} is written in {\sc Magma} and can be viewed by anyone.)45Fortunately, several volunteers (Alex Brown, Ami Fischman, and Justin46Walker) have kept \hecke{} up-to-date, in the sense that it will47compile on modern computers.4849\hecke{} is much different than the modular forms package I wrote in50{\sc Magma}. One major difference is that {\sc Magma} is a far more51complicated system, and using it to do anything nontrivial requires52some basic familiarity with how {\sc Magma} works, which takes some53time to acquire. In contrast, \hecke{} (especially the ``msymbols''54mode, see below) does nothing besides computations with modular forms,55and has menus, so you can immediately start computing Hecke operators56and basis. However, when using \hecke{} you'll probably often import57the results of computations to another system, such as PARI, Maple, or58Mathematica, and work with them further there. Another key difference59is that \hecke{} computations are persistent, in the sense that60\hecke{} saves the result of {\em every} computation you do to your hard61drive (in a folder called {\tt data}), so next time you do the62computation it is loaded from disk. In contrast, the {\sc Magma}63modular forms package as no built-in functionality for saving64computations to disk (as of Jan. 2004).6566\newpage\head{What does \hecke{} do?}\hecke{} is an interactive calculator.67\begin{itemize}68\item {\bf Modular forms and Hecke operators:} Computations on the69spaces of modular forms $M_k(\Gamma_1(N),\eps)$, for $k\geq 2$, over70cyclotomic and finite fields. Functions include:71\begin{itemize}72\item Computation of bases of newforms.73Within computational74limits, the level, weight, and character can be pretty75much arbitrary, with the restriction that $k\geq 2$ be76an integer. Furthermore, all eigenforms are computed,77{\em not} just the ones with eigenvalues in $\Q$.78\item Computation of the ``Birch and Swinnerton-Dyer'' rational79numbers $L(M_f,i)/\Omega_i$ where $M_f$ is a complex torus80attached to $f$ and $\Omega_i$ is a certain volume.81\item For optimal quotients $A_f$ of $J_0(N)$82associated to newforms:83\begin{enumerate}84\item The modular degree and group structure of the canonical85polarization obtained by pullback of the $\theta$ divisor.86\item Intersection of $A_f^{\vee}$ and $A_g^{\vee}$.87\item Order of image of $(0)-(\infty)$ in $A_f(\Q)_{\tor}$.88\item Multiple of order of $A_f(\Q)_{\tor}$.89\item Tamagawa numbers of quotients of $J_0(p)$,90with $p$ prime. (Note: Component group91order at~$p$ for quotient of $J_0(N)$,92when $\ord_p(N)=1$, is available in {\sc Magma}.)93\end{enumerate}94(Note: Similar computations for quotients of $J_1(N)$95are mostly implemented in {\sc Magma}, though not96well documented as of January 2004.)97\item Discriminants of Hecke algebras.98\item Numerical computation of special values and period99lattices of forms of even weight $k\geq 2$, in many100(but not all) cases. When $f$ has rational Fourier101coefficients, computation of the invariants of102the associated elliptic curve over $\R$ (the implementation103of this is not nearly as refined as in Cremona's elliptic104curve package).105\end{itemize}106107\item {\bf Formulas:} The classical formulas, such108as the numbers of cusps on modular curves, dimensions of spaces109of cusps forms, and computation of110$\dim S_k(\Gamma_1(N),\eps)$ for $k\geq 2$111and $\eps$ a Dirichlet character modulo $N$.112(Note: Computation of $\dim S_k(\Gamma_1(N),\eps)$113using the Hijikata trace formula is non-optimal;114there is a much simpler formula of Cohen and115Oesterle, which is what is implemented in {\sc Magma}.)116117\item {\bf Character groups of tori:} Action of Hecke operators118$T_{\ell}$, for $\ell=2,3,5,7$, on the character group associated to119$J_0(p)$ (using the Mestre-Oesterl\'{e} graph method). The matrices120attained in this way are very sparse.121122\item {\bf Tables:} Functions for making tables.123124\end{itemize}125126127\bighead{Guided tour}In this guided tour, you will see how to use128\hecke{} to compute the action of Hecke operators, bases of129eigenforms, and obtain information about special values of130$L$-functions. The output given below is a small subset of131the actual output, which is much more verbose.132133\head{Starting \hecke}To start \hecke{}, type134{\tt hecke} at the command line. You will see something like this:135\begin{verbatim}136# hecke137HECKE Version 0.4, Copyright (C) 1999-2003, William A. Stein138HECKE comes with ABSOLUTELY NO WARRANTY.139This is free software, and you are welcome to redistribute it140under certain conditions; read the included COPYING file for details.141142143HECKE: Modular Forms Calculator Version 0.4 (Sep. 24, 2003)144145William Stein146Ported to Mac OS X (Justin C. Walker) and Windows (Alex F. Brown)147Send bug reports and suggestions to was@math.harvard.edu.148Type ? for help.149150HECKE>151\end{verbatim}152Typing {\tt ?} gives a list of commands and modes which include:153\begin{verbatim}154HECKE> ?155156about: About157calc: Motive calculator158exsymbols: Extended modular symbols mode159formulas: Formula calculator160graphs: Monodromy pairing calculator161msymbols: Modular symbols calculator162tables: Table making routines163quit: Quit164\end{verbatim}165\head{Modular forms and Hecke operators calculator}Type {\tt166msymbols} to start the modular forms and Hecke operators calculator.167You will be asked for several pieces of information, which define the168space on which to work. In this mode you can only compute with169one space of modular forms at a time (see the {\tt calc} mode for170computations that relate different spaces). Answer as follows:171\begin{verbatim}172level N = 389173character chi = 0174weight k = 2175\end{verbatim}176After a brief computation the calculator interface will177print some information about $M_2(\Gamma_0(389))$ and178await your command.179\begin{verbatim}180---------------------------------------------------------------181Current space: M_2(Gamma_0(389); Q)^+, dim=33182Hecke action on: V=M_2, dim=33183---------------------------------------------------------------184M_2(389) ?185\end{verbatim}186The \verb+Q)^+{\tt +} means that we are actually computing with the $+1$187quotient of modular symbols, so in general some Eisenstein series188could be missing, but all cusp forms will be present. Use the189{\tt exsymbols} mode for more precise control.190191Typing {\tt ?} gives a list of help topics.192\begin{verbatim}1931: computing OPERATORS1942: setting current SPACE1953: cutting out SUBSPACES1964: computing BASIS1975: CONVERSIONS between representations1986: arithmetic INVARIANTS of torus A_V1997: INVARIANTS of Hecke algebra2008: OPTIONS201\end{verbatim}202To get an idea of what $M_2(\Gamma_0(389))$ looks like, we compute203the characteristic polynomials of several Hecke operators $T_n$.204We do this by typing {\tt t}, then entering a positive integer $n$.205\begin{verbatim}206? t207Tn: Enter values of n, then q when done.2082209f2=(x-3)*(x + 2)*(x^2 -2)*(x^3 -4*x -2)*210(x^20 -3*x^19 -29*x^18 + 91*x^17 + 338*x^16 -1130*x^15211-2023*x^14 + 7432*x^13 + 6558*x^12 -28021*x^11 -10909*x^10212+ 61267*x^9 + 6954*x^8 -74752*x^7 + 1407*x^6 + 46330*x^5213-1087*x^4 -12558*x^3 -942*x^2 + 960*x + 148)*214(x^6 + 3*x^5 -2*x^4 -8*x^3 + 2*x^2 + 4*x -1);215q216\end{verbatim}217Let's compute the action of a few Hecke operators on the factor of218degree two. Type {\tt subeigenpoly}, then select the appropriate219factor:220\begin{verbatim}221M_2(389) ? subeigenpoly222[...]223n = 2 <---- you type this224Choose one of the following factors.2251: x+22262: x-32273: x^2-22284: x^3-4*x-22295: x^20-3*x^19-29*x^18+91*x^17+338*x^16-1130*x^15-2023*x^14+2307432*x^13+6558*x^12-28021*x^11-10909*x^10+61267*x^9+6954*x^8-23174752*x^7+1407*x^6+46330*x^5-1087*x^4-12558*x^3-942*x^2+960*x+1482326: x^6+3*x^5-2*x^4-8*x^3+2*x^2+4*x-12337: ALL factors234Select a factor: 3 <---- you type this235\end{verbatim}236237When the {\tt M\_2(389) ? } prompt appears, type {\tt opmatrix} to238turn on matrix display and {\tt opcharpoly} to turn off239computation of characteristic polynomials. Now you can compute240matrices which represent the Hecke operators on this dimension two241space:242\begin{verbatim}243M_2(389) ? opmatrix244matrix display on245M_2(389) ? opcharpoly246charpoly display off247M_2(389) ? t2482249T2=[2,1;-2,-2];2503251T3=[0,1;-2,-4];2526253T6=[-2,-2;4,6];254q255M_2(389) ? opmatrix256matrix display off257M_2(389) ? opcharpoly258charpoly display on259\end{verbatim}260Let $A$ denote the corresponding two-dimensional optimal quotient of261$J_0(389)$. To compute the BSD value $L(A,1)/\Omega_A$, type {\tt262torusbsd}. \hecke{} outputs $0$ along with the first few terms of the263$q$-expansion of $f$ and the discriminant of the ring264$\Z[\ldots,a_n,\ldots]$:265\begin{verbatim}266\\ L(A_f1,1)/Omega_f = 0267\\ disc(Z[f]) = 2^3268a1 = Mod(a,a^2-2);269f1 = q + (a1)*q^2 + (a1-2)*q^3 + -1*q^5 + (-2*a1+2)*q^6 +270(-2*a1-1)*q^7 + O(q^8);271\end{verbatim}272273That $L(A_f,1)=0$ is consistent with the sign of the functional274equation for $L(A_f,s)$. The sign in the functional equation for the275$L$-function is minus the sign of the Atkin-Lehner involution276$W_{389}$. To compute this involution, type {\tt actatkin} and then277enter {\tt 389} for $p$. \hecke{} compute that $W_{389}=I$ on~$A$,278so the sign in the functional equation is $-1$ and $L(A,1)$ is forced279to vanish.280\begin{verbatim}281M_2(389) ? actatkin282Compute W_q where p = 389283[...]284charpoly(W389) = (x -1)^2285\end{verbatim}286Where it says ``Compute $W_q$ where $p=$'', the subscript~$q$287is the power of the prime~$p$ that exactly divides the level.288289290To obtain the $q$-expansion of a normalized eigenform in291our two-dimensional space, type {\tt basisnew} then {\tt n=7}.292The result is293\begin{verbatim}294s1=t^2-2; s=Mod(t,t^2-2);295f1 = q + (s)*q^2 + (s-2)*q^3 + -1*q^5 +296(-2*s+2)*q^6 + (-2*s-1)*q^7 + O(q^8);297\end{verbatim}298which means that a normalized newform is299$$f_1 = q +\sqrt{2}q^2 + (\sqrt{2}-2)q^3300-q^5 + (-2\sqrt{2}+2)q^6301+(-2\sqrt{2}-1)q^7 + \cdots$$302303The space $S_2(\Gamma_0(389))$ is of particular interest because304$p=389$ is the only prime $<50000$ such that $p$ divides305the discriminant of the Hecke algebra associated to306$S_2(\Gamma_0(p))$.307To compute the discriminant of the Hecke algebra $\T$ on $S_2(\Gamma_0(389))$,308first switch back to the full cuspidal subspace using the309{\tt spacecusp} command.310\begin{verbatim}311M_2(389) ? ?2312313spacecusp spaceeisenstein spaceintegral314spacefull spaceload spacemkz315spacenew spacesave316317M_2(389) ? spacecusp318---------------------------------------------------------------319Current space: M_2(Gamma_0(389); Q)^+, dim=33320Hecke action on: V=S_2, dim=32321---------------------------------------------------------------322\end{verbatim}323Next type {\tt heckedisc} and wait a minute while Hecke operators324$T_n$, for $n\leq 65$ are computed by \hecke{} in order to compute the325discriminant.326\begin{verbatim}327M_2(389) ? heckedisc328... (wait) ...329disc(T|V) = 15127550212684923137297214710062974872224429657257433000664317000679427623878656000000331[It seems to wait forever in the current version, perhaps332trying to factor the discriminant...]333\end{verbatim}334We find that the discriminant of the $\Z$-module generated by335$T_1,\ldots,T_{65}$ is336$$592456554486106225601956409404798293104261020095616213409857536000000$$337$$=2^{53} \cdot 3^4\cdot 5^6\cdot31^2\cdot 37\cdot97^2\cdot 389\cdot3881338\cdot 215517113148241339\cdot 477439237737571441$$340341342343\newpage\head{Nontrivial character and weight}Next, compute344a basis of eigenforms for345$S_4(\Gamma_0(13),\eps)$346where $\eps:(\Z/13\Z)\ra\C^*$ is a character whose image has347order $3$. Type {\tt x} to quit computing on $M_2(389)$, type348{\tt msymbols} again and enter {\tt N = 13}, {\tt chi = 3},349and {\tt k = 4}. In a second, the status display will appear:350\begin{verbatim}351-------------------------------------------------------------------352Current space: M_4(Gamma_0(13), eps=[3]; Q[a]/(x^2 + -1 * x + 1))^+, dim=5353Hecke action on: V=M_4, dim=5354-------------------------------------------------------------------355M_4(13) ?356\end{verbatim}357(Note: The quadratic polynomial in the quotient should358be in terms of $a$ instead of $x$, but I never implemented359this.)360Type {\tt basisnew}, then {\tt n = 3} to get the first $3$361terms of the $q$-expansions of a basis of newforms.362\begin{verbatim}363M_4(13) ? basisnew364max n=3365\end{verbatim}366(Note: Only one representative from each Galois conjugacy class367of newforms is provided.) The output is368\begin{verbatim}369f1 = q + (-4*a)*q^2 + (-2*a)*q^3 + O(q^4);370s2=t^2+(-5*a)*t+(2*a-2); s=Mod(t,t^2+(-5*a)*t+(2*a-2));371f2 = q + (s)*q^2 + ((-3)*s+(5*a))*q^3 + O(q^4);372\end{verbatim}373This means that there are two conjugacy classes of normalized374eigenforms, with representatives $f_1$ and $f_2$. The first is375$f_1=q-4aq^2-2aq^3+\cdots$, where~$a$ is a primitive cube root of~$1$,376and the second is $f_2 =q + sq^2 +(-3s+5a)q^3 +\cdots$ where~$s$ is a377root of $t^2-5at+2a-2=0$.378379To work in fields of characteristic other than $0$,380use the extended mode by typing {\tt exsymbols} instead of {\tt msymbols}381at the {\tt HECKE> } prompt.382383\head{Motives associated to modular forms}The {\tt msymbols} mode is384useful for computing basis of eigenforms and the action of Hecke385operators on spaces of modular forms. It is less useful386for computing specific information about the structure of $J_0(N)$.387For that, use the {\tt calc} mode. Type {\tt x} to get to the {\tt388HECKE>} prompt, then type {\tt calc}. When asked if you want to work389in the fast $+1$ quotient, typing {\tt n}. (If you type {\tt yes},390many computations will be an order of magnitude faster, but are likely391to be wrong by a power of~$2$.)392393A space (or the corresponding abelian variety) is specified in the394{\tt calc} mode as follows:395\begin{center}396{\bf [level]k[weight][isogeny class].[command][(arguments)]}397\end{center}398where the level is an integer, the weight is an integer $\geq 2$,399the isogeny classes are A, B, C, \ldots, Z, AA, BB, CC, and400the commands will be outlined below.401Omitting the weight part of the command is the same as specifying402$k=2$.403404First enter the calc mode, then type {\tt 125} to obtain a list of405optimal quotients of $J_0(125)$.406\begin{verbatim}407M_4(13) ? q408Leaving modular symbols calculator.409HECKE> ?410411about: About412calc: Motive calculator413exsymbols: Extended modular symbols mode414formulas: Formula calculator415graphs: Monodromy pairing calculator416msymbols: Modular symbols calculator417tables: Table making routines418quit: Quit419420HECKE> calc421Welcome to the motive calculator.422WORK IN FAST MODE (+1 quotient, certain powers of 2 *wrong*)? [y] n423Type ? for help.424425? 125426427MOTIVECOMMAND = Summarize level.428****** SUMMARIZE LEVEL.429125k2 dim W430A 2 +431B 2 -432C 4 -433\end{verbatim}434The first time you type 125, a huge amount of log information will be435printed. Simply type 125 again to list the above without the logging436information. The second time you compute level 125, it takes no extra437time, since everything is stored in the {\tt data} directory. Even438if you quit \hecke{} and restart, it will still list 125 quickly.439440This means that $J_0(125)\sim A\cross B\cross C$441where $A,B,C$ are abelian varieties of dimensions442$2$, $2$, and $4$. We can compute $L(A,1)/\Omega_A$,443$L(B,1)/\Omega_B$ and $L(C,1)/\Omega_C$:444\begin{verbatim}445? 125A.bsdratio4460447? 125B.bsdratio4482^2/5449? 125C.bsdratio4501/5451\end{verbatim}452You may also type {\tt 125a.bsdratio}, as the isogeny453code is not case sensitive.454The signs in the {\tt W} column above give the signs of the455Atkin-Lehner involution $W_{125}$.456457What about the torsion? Type {\tt 125.torsionbound(13)} to get an458upper bound on the torsion subgroup of $J_0(125)$. Then type {\tt459125.cusporder} to compute the order of $(0)-(\infty)\in460J_0(125)(\Q)$.461\begin{verbatim}462? 125.torsionbound(13)4635^2464? 125.cusporder4655^2466\end{verbatim}467We're lucky because the divisor and multiple match up, so we conclude468that $J(\Q)\ncisom\Z^2\oplus(\Z/25\Z)$. Next type {\tt469125A.intersection(B)} to obtain the structure of the finite470abelian group $A'\intersect B'\subset J$, where $A'$, $B'$ are the471abelian varieties dual to $A$ and $B$. The answer {\tt [2,2,2,2]}472indicates that the intersection is $(\Z/2\Z)^4$. This implies473that the corresponding newforms satisfy a congruence in474characteristic $2$. To exit {\tt calc} mode, type {\tt475$\backslash{}$q}.476477Unfortunately, I have not written a tutorial for using the478extended modular symbols mode or making tables.479480\end{document}481482483%(For more on $J_0(125)$,484%see Poluakis, D. {\em La courbe modulaire $X_0(125)$ et sa485%jacobienne}, J. Num. Theory {\bf 25} (1987), no. 1, 112--131.)486487To compute the modular degree of $A$ type {\tt torusmoddeg}.488It will again ask for a factor of $T_2$; enter choice $1$.489The answer which \hecke{} returns is ``$2^2\cdot 3^2$.490{\em Warning:} We are really computing the action of Hecke491operators on the $+1$ subspace of $H_1(X_0(N))$ so the modular492degree can be wrong by a power of $2$; to compute the correct493modular degree it is necessary to start the modular symbols494mode using the command {\tt Modular} instead of {\tt modular}.495496