Subsections

13. Modular forms


13.1 Cusp forms

To compute the dimension of the space of cusp forms for Gamma use the command dimension_cusp_forms. Here is an example from section 2.4 ``Modular forms" in the tutorial:

sage: dimension_cusp_forms(Gamma0(11),2)
     1
sage: dimension_cusp_forms(Gamma0(1),12)
     1
sage: dimension_cusp_forms(Gamma1(389),2)
     6112

Related commands: dimension_new_cusp_forms_gamma0 (for dimensions of newforms), dimension_modular_forms (for modular forms), dimension_eis (for Eisenstein series), and dimension_cusp_forms_eps (for ``twisted'' cusp forms). The synatx is similar - see the reference manual for examples.

In future versions of SAGE, more related commands will be added.


13.2 Coset representatives

The coset representatives of $ SL_2(\mathbf{Z})/\Gamma_0(11)$ :

sage: G = Gamma0(11); G
Congruence Subgroup Gamma0(11)
sage: list(G.coset_reps())
[[1, 0, 0, 1],
 [0, -1, 1, 0],
 [0, -1, 1, 1],
 [0, -1, 1, 2],
 [0, -1, 1, 3],
 [0, -1, 1, 4],
 [0, -1, 1, 5],
 [0, -1, 1, 6],
 [0, -1, 1, 7],
 [0, -1, 1, 8],
 [0, -1, 1, 9],
 [0, -1, 1, 10]]


13.3 Modular form associated to an elliptic curve over $ \mathbb{Q}$

Let $ E$ be an elliptic curve whose equation has integer coefficients, let $ N$ be the conductor of $ E$ and, for each $ n$ , let $ a_n$ be the number appearing in the Hasse-Weil $ L$ -function of $ E$ . The Taniyama-Shimura conjecture (proven by Wiles) states that there exists a modular form of weight two and level $ N$ which is an eigenform under the Hecke operators and has a Fourier series $ \sum_{n = 0}^\infty a_n q^n$ . SAGE can compute the sequence $ a_n$ . Here is an example.

sage: E = EllipticCurve([0, -1, 1, -10, -20])
sage: E
Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
sage: E.conductor()
11
sage: E.anlist(20)
[0, 1, -2, -1, 2, 1, 2, -2, 0, -2, -2, 1, -2, 4, 4, -1, -4, -2, 4, 0, 2]
sage: E.analytic_rank()
0


13.4 Modular symbols and Hecke operators

Next we illustrate computation of Hecke operators on a space of modular symbols of level 1 and weight 12.

sage: M = ModularSymbols(1,12)
sage: M.basis()
([X^8*Y^2,(0,0)], [X^9*Y,(0,0)], [X^10,(0,0)])
sage: t2 = M.T(2)
sage: f = t2.charpoly(); f
x^3 - 2001*x^2 - 97776*x - 1180224
sage: factor(f)
(x - 2049) * (x + 24)^2
sage: M.T(11).charpoly().factor()
(x - 285311670612) * (x - 534612)^2

Here t2 represents the Hecke operator $ T_2$ on the space of Full Modular Symbols for $ \Gamma_0(1)$ of weight $ 12$ with sign 0 and dimension $ 3$ over $ \mathbb{Q}$ .

sage: M = ModularSymbols(Gamma1(6),3,sign=0)
sage: M
Modular Symbols space of dimension 4 for Gamma_1(6) of weight 3 with sign 0 and over Rational Field
sage: M.basis()
 ([X,(0,5)], [X,(3,2)], [X,(4,5)], [X,(5,4)])
sage: M._compute_hecke_matrix_prime(2).charpoly()
 x^4 - 17*x^2 + 16
sage: M.integral_structure()
Free module of degree 4 and rank 4 over Integer Ring
Echelon basis matrix:
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]

See the section on modular forms in the tutorial or the reference manual for more examples.

13.5 Genus formulas

SAGE can compute the genus of $ X_0(N)$ , $ X_1(N)$ , and related curves.

sage: sage.modular.dims.g0(22)
2
sage: sage.modular.dims.g0(30)
3
sage: sage.modular.dims.g1(30)
9

See the code for computing dimensions of spaces of modular forms (in sage/modular/dims.py) or the paper by Oesterle and Cohen [CO] for some details.

See About this document... for information on suggesting changes.