HECKE: The Modular Forms Calculator

William A. Stein

What is HECKE?

HECKE is a program for computing with modular forms. It implements algorithms of Cremona, Hijikata, Merel, Mestre-Oesterlé, Shimura, and others. It is completely free software, currently available only for Linux machines at

       http://shimura.math.berkeley.edu/~was/Tables/hecke.html

Unfortunately it is still in development, and quite a bit of work remains to be done^{1}. I should emphasize that HECKE is not yet “rock solid” and ready for general release, so you should be especially skeptical of the results it gives and aware that the interface is at certain points very primitive. Nonetheless, HECKE is capable of many computations which aren’t currently possible in any other single, integrated, publicly available, package. The main drawbacks are that the interface may be awkward and certain parts of the implementation have not been properly optimized.

What can HECKE do?

HECKE consists both of a C++ library and an interactive calculator. Most of the following is implemented.

• Modular forms and Hecke operators: Computations on the spaces M_{k}(Γ_{1}(N), ε), k ≥ 2, over cyclotomic and finite fields. Functions include:

– Computation of bases of newforms. Within computational limits, the level, weight, and character can be pretty much arbitrary, with the restriction that k ≥ 2 be an integer. Furthermore, all eigenforms are computed, not just the ones with eigenvalues in Q.

– Exact computation of the rational numbers L(M_{f}, i)/Ω_{i} where M_{f} is a complex torus attached to f and Ω_{i} is a certain volume.

– Optimal quotients A_{f} of J_{0}(N) associated to newforms. (An optimal quotient is a quotient J_{0}(N) → A_{f} with connected kernel.)

1. The modular degree and structure of the canonical polarization.

2. Congruences.

3. Order of image of (0) − (∞).

4. Upper bound on torsion.

5. Tamagawa numbers of semistable quotients of J_{0}(N) (currently only for N prime).

– Discriminants of Hecke algebras.

1Hecke is being written by me, with advice from K. Buzzard and H.W. Lenstra.

– Numerical computation of special values and period lattices of forms of even weight k ≥ 2, in many (but not all) cases. When f has rational Fourier coefficients, computation of the invariants of the associated elliptic curve over R.

• Formulas: The classical formulas, such as the numbers of cusps on modular curves, dimensions of spaces of cusps forms, and computation of dim S_{k}(Γ_{1}(N), ε) for k ≥ 2 and ε a Dirichlet character modulo N (using the Hijikata trace formula).

• Character groups of tori: Action of Hecke operators on the character group associated to J_{0}(p) (using the Mestre-Oesterlé graph method). The matrices attained in this way are very sparse.

• Tables: Functions for making tables of eigenforms.

• More: And much more...

Why does HECKE exist?

HECKE grew out of work on my thesis which involves computing special values of L-functions, congruences, and verifying modularity of certain Galois representations. In a sense, HECKE is also the program I wish had existed when I was taking my first modular forms course and wanted to see lots of concrete examples of modular forms. (Some of the tables computed using HECKE can be

found at http://shimura.math.berkeley.edu/~was/Tables.)

Guided tour

In this guided tour, you will see how to use HECKE to compute the action of Hecke operators, bases of eigenforms, and obtain information about special values of L-functions.

Starting HECKE.

To start HECKE, type hecke at the command line. You will see something like

# hecke
  HECKE:  Modular Forms Calculator   Version 0.4 (June 14, 1999)
                    William A. Stein
Send bug reports and suggestions to was@math.berkeley.edu.
Type ? for help.
HECKE>

Typing ? gives a list of “modes” which include:

  calc:      Motive calculator
  exsymbols: Extended modular symbols mode
  formulas:  Formula calculator

graphs:    Monodromy pairing calculator
msymbols:  Modular symbols calculator
tables:    Table making routines

Modular forms and Hecke operators calculator.

Type msymbols to start the modular forms and Hecke operators calculator. You will be asked for several bits of information which define the space on which to work. Answer as follows:

level N = 389
character chi = 0
weight k = 2

After a brief computation the calculator interface will print some information about M_{2}(Γ_{0}(389)) and await your command.

---------------------------------------------------------------
Current space:   M_2(Gamma_0(389); Q)^+, dim=33
Hecke action on: V=M_2, dim=33
---------------------------------------------------------------
M_2(389) ?

The help system is similar to that in PARI. Typing ? gives a list of subtopics.

1: computing OPERATORS
2: setting current SPACE
3: cutting out SUBSPACES
4: computing BASIS
5: CONVERSIONS between representations
6: arithmetic INVARIANTS of torus A_V
7: INVARIANTS of Hecke algebra
8: OPTIONS

To get an idea of what M_{2}(Γ_{0}(389)) looks like, compute the characteristic polynomials of several Hecke operators T_{n}. Type t then enter a positive integer n.

? t
Tn: Enter values of n, then q when done.
2
f2=(x-3)*(x + 2)*(x^2 -2)*(x^3 -4*x -2)*
   (x^20 -3*x^19 -29*x^18 + 91*x^17 + 338*x^16 -1130*x^15
    -2023*x^14 + 7432*x^13 + 6558*x^12 -28021*x^11 -10909*x^10
    + 61267*x^9 + 6954*x^8 -74752*x^7 + 1407*x^6 + 46330*x^5
    -1087*x^4 -12558*x^3 -942*x^2 + 960*x + 148)*
   (x^6 + 3*x^5 -2*x^4 -8*x^3 + 2*x^2 + 4*x -1);
q

Let’s compute the action of a few Hecke operators on the dimension two factor. Type subeigenpoly, then select the dimension two factor:

   M_2(389) ? subeigenpoly
   [...]
   n = 2                             <---- you type this
   Choose one of the following factors.
        1: x+2
        2: x-3
        3: x^2-2
        4: x^3-4*x-2
        5: x^20-3*x^19-29*x^18+91*x^17+338*x^16-1130*x^15-2023*x^14+
        7432*x^13+6558*x^12-28021*x^11-10909*x^10+61267*x^9+6954*x^8-
        74752*x^7+1407*x^6+46330*x^5-1087*x^4-12558*x^3-942*x^2+960*x+148
        6: x^6+3*x^5-2*x^4-8*x^3+2*x^2+4*x-1
        7: ALL factors
   Select a factor: 3               <---- you type this

When the M 2(389) ? prompt appears, type opmatrix to turn on matrix display and opcharpoly to turn off computation of characteristic polynomials. Now you can compute matrices which represent the Hecke operators on this dimension two space:

   M_2(389) ? t
   2
   T2=[2,1;-2,-2];
   3
   T3=[0,1;-2,-4];
   6
   T6=[-2,-2;4,6];

Let A denote the corresponding dimension two optimal quotient of J_{0}(389). To compute the BSD value L(A, 1)/Ω_{A}, type torusbsd. HECKE outputs 0 along with the first few terms of the q-expansion of f and the discriminant of the ring Z[…, a_{n}, …]. The sign in the functional equation for the L-function is minus the sign of the Atkin-Lehner involution W_{389}. To compute this involution, type actatkin and then enter 389 for p. HECKE compute that W_{389} = +1 on A, so the sign in the functional equation is −1 and L(A, 1) is forced to vanish.

To obtain the q-expansion of a normalized eigenform in our dimension two space, type basisnew then n=7. The result is

s1=t^2-2;  s=Mod(t,t^2-2);
f1 = q + (s)*q^2 + (s-2)*q^3 + -1*q^5 + (-2*s+2)*q^6 + (-2*s-1)*q^7 + O(q^8);

which means that a normalized newform is

f_{1} = q + \sqrt{2}q^{2} + (\sqrt{2} − 2)q^{3} − q^{5} + (−2\sqrt{2} + 2)q^{6} + (−2\sqrt{2} − 1)q^{7} + ⋯ To compute the discriminant of the Hecke algebra T, type heckedisc. HECKE computes the discriminant of the Z-module generated by T_{1}, …, T and finds:

592456554486106225601956409404798293104261020095616213409857536000000

= 2^{53} · 3^{4} · 5^{6} · 31^{2} · 37 · 97^{2} · 389 · 3881 · 215517113148241 · 477439237737571441

This is only known example in which p | disc(T_{389}) (there are no other such p < 12000).

Nontrivial character and weight.

Next, compute a basis of eigenforms for S_{4}(Γ_{0}(13), ε) where ε : (Z/13Z) → C^{∗} is a character whose image has order 3. Type x to quit computing on M_{2}(389), type msymbols again and enter N = 13, chi = 3, and k = 4. In a second, the status display will appear:

   -------------------------------------------------------------------
   Current space:   M_4(Gamma_0(13), eps=[3]; Q[a]/(a^2-a+1))^+, dim=5
   Hecke action on: V=M_4, dim=5
   -------------------------------------------------------------------
   M_4(13) ?

(In the version you’re using, the quadratic polynomial might be in x instead of a.) Type basisnew, then n = 3 to get the first 3 terms of the q-expansions of a basis of newforms. Note: only one representative from each Galois conjugacy class of newforms is provided. The output is

   f1 = q + (-4*a)*q^2 + (-2*a)*q^3 + O(q^4);
   s2=t^2+(-5*a)*t+(2*a-2); s=Mod(t,t^2+(-5*a)*t+(2*a-2));
   f2 = q + (s)*q^2 + ((-3)*s+(5*a))*q^3 + O(q^4);

This means that there are two (conjugacy classes of) eigenforms f_{1} and f_{2}. The first is f_{1} = q − 4aq^{2} − 2aq^{3} + ⋯ where a is a primitive cube root of 1, and the second is f_{2} = q+sq^{2}+(−3s+5a)q^{3}+⋯ where s is a root of t^{2}−5at+2a−2 = 0.

To work in fields of characteristic other than 0, use the extended mode by typing exsymbols instead of msymbols at the HECKE> prompt.

Motives associated to modular forms.

The msymbols mode is useful for computing basis of eigenforms and the action of Hecke operators on rather general spaces of modular forms. It is less useful for computing specific information about the structure of J_{0}(N). For that, use the calc mode. Type x to get to the HECKE> prompt, then type calc. When asked if you want to work in the fast +1 quotient, typing n. (If you type yes, many computations will be orders of magnitude faster, but are likely to be wrong by a power of 2.) The basic syntax of a calc mode command is as follows:

[level]k[weight][isogeny class].[command][(arguments)] Omitting the weight part of the command is the same as specifying k = 2. Type 125 to obtain a list of optimal quotients of J_{0}(125).

  ? 125
  ****** SUMMARIZE LEVEL.
  125k2:    dim    W
   A        2      +
   B        2      -
   C        4      -

This means that J_{0}(125) ∼ A × B × C where A, B, C are abelian varieties of dimensions 2, 2, and 4. We can compute L(A, 1)/Ω_{A}, L(B, 1)/Ω_{B} and L(C, 1)/Ω_{C}:

   ? 125A.bsdratio
   0
   ? 125B.bsdratio
   2^2/5
   ? 125C.bsdratio
   1/5

The signs in the W column above give the signs of the Atkin-Lehner involution W_{125}. Thus one expects, because the level is low, that J(Q) ⊗ Q ≅ A(Q) ⊗ Q ≈ Q ⊕ Q. This is in fact the case, though we will not prove it here. (I haven’t yet implemented a function for computation L′(A, 1), so the rank can’t yet be bounded from within HECKE.) What about the torsion? Type 125.torsionbound(13) to get an upper bound on the torsion subgroup of J_{0}(125). Then type 125.cusporder to compute the order of (0) − (∞) ∈ J_{0}(125)(Q).

   ? 125.torsionbound(13)
   5^2
   ? 125.cusporder
   5^2

We’re lucky – the lower and upper bounds match up and we conclude that J(Q) ≈ Z^{2} ⊕ (Z/25Z). Next type 125A.intersection(B) to obtain the structure of the finite abelian group A′ ∩ B′ ⊂ J, where A′, B′ are the abelian varieties dual to A and B. The answer [2,2,2,2] indicates that the intersection is (Z/2Z)^{4}. This implies that the corresponding newforms satisfy a congruence in characteristic 2. To exit calc mode, type \q.

This tutorial has barely scratched the surface of what is possible using HECKE. If you are interesting in learning more, talk to me.