This is a graduate-level textbook about algorithms for computing with mod-
ular forms. It is nontraditional in that the primary focus is not on underly-
ing theory; instead, it answers the question “how do you use a computer to
explicitly compute spaces of modular forms?”
This book emerged from notes for a course the author taught at Harvard
University in 2004, a course at UC San Diego in 2005, and a course at the
University of Washington in 2006.
The author has spent years trying to find good practical ways to compute
with classical modular forms for congruence subgroups of SL2(Z) and has
implemented most of these algorithms several times, first in C++ [Ste99b],
then in MAGMA [BCP97], and as part of the free open source computer
algebra system SAGE (see [Ste06]). Much of this work has involved turning
formulas and constructions buried in obscure research papers into precise
computational recipes then testing these and eliminating inaccuracies.
The author is aware of no other textbooks on computing with modular
forms, the closest work being Cremona’s book [Cre97a], which is about
computing with elliptic curves, and Cohen’s book [Coh93] about algebraic
In this book we focus on how to compute in practice the spaces Mk(N, ε)
of modular forms, where k ≥ 2 is an integer and ε is a Dirichlet character
of modulus N (the appendix treats modular forms for higher rank groups).
We spend the most effort explaining the general algorithms that appear so
far to be the best (in practice!) for such computations. We will not dis-
cuss in any detail computing with quaternion algebras, half-integral weight
forms, weight 1 forms, forms for noncongruence subgroups or groups other