jsMath

# Tutorial: Computing With Modular Forms Using SAGE

Contents, General, Modular Forms, Modular Symbols, Future

# Defining Ambient Spaces of Modular Symbols

`ModularSymbols(11)`
 ```Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field``` `Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field`
`ModularSymbols(Gamma1(13),3)`
 ```Modular Symbols space of dimension 28 for Gamma_1(13) of weight 3 with sign 0 and over Rational Field``` `Modular Symbols space of dimension 28 for Gamma_1(13) of weight 3 with sign 0 and over Rational Field`
```G.<a> = DirichletGroup(13)
ModularSymbols(a^2,2)```
 ```Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2``` `Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2`

# Cutting Out Submodules: Eisenstein, Cuspidal, New, Old

`M = ModularSymbols(Gamma0(33)); M`
 ```Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field``` `Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field`
`M.eisenstein_subspace().basis()`
 ```((1,0) + (11,3), (3,5) + (3,10) + (3,17) + (3,20) + 3*(11,1) + 3*(11,2) + 4*(11,3), (3,7) + 1/2*(3,10) + 1/2*(3,20) - 1/2*(11,1) - 3/2*(11,2) - 3*(11,3))``` `((1,0) + (11,3), (3,5) + (3,10) + (3,17) + (3,20) + 3*(11,1) + 3*(11,2) + 4*(11,3), (3,7) + 1/2*(3,10) + 1/2*(3,20) - 1/2*(11,1) - 3/2*(11,2) - 3*(11,3))`
`M.cuspidal_subspace().basis()`
 ```((3,5) - (11,2) + (11,3), (3,7) - (11,2) + (11,3), (3,10) - (11,2) + (11,3), (3,17) - (11,2) + (11,3), (3,20) - (11,2) + (11,3), (11,1) - (11,2))``` `((3,5) - (11,2) + (11,3), (3,7) - (11,2) + (11,3), (3,10) - (11,2) + (11,3), (3,17) - (11,2) + (11,3), (3,20) - (11,2) + (11,3), (11,1) - (11,2))`
`M.new_subspace().basis()`
 ```((1,0) + 2/5*(3,7) + 2/5*(3,17) + 4/5*(11,1) + 2/5*(11,2) - 1/5*(11,3), (3,5) - (3,17), (3,10) + (3,20) - (11,1) - (11,2) + 2*(11,3))``` `((1,0) + 2/5*(3,7) + 2/5*(3,17) + 4/5*(11,1) + 2/5*(11,2) - 1/5*(11,3), (3,5) - (3,17), (3,10) + (3,20) - (11,1) - (11,2) + 2*(11,3))`
`O = M.old_subspace(); O`
 ```Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field``` `Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field`
`O.basis()`
 ```((1,0) + (11,3), (3,5) - 3*(11,2) - 3*(11,3), (3,7) - (11,2) - (11,3), (3,10) - (11,2) - 3*(11,3), (3,17) + 3*(11,2) + 3*(11,3), (3,20) + (11,2) + (11,3), (11,1) + (11,2) + 2*(11,3))``` `((1,0) + (11,3), (3,5) - 3*(11,2) - 3*(11,3), (3,7) - (11,2) - (11,3), (3,10) - (11,2) - 3*(11,3), (3,17) + 3*(11,2) + 3*(11,3), (3,20) + (11,2) + (11,3), (11,1) + (11,2) + 2*(11,3))`
`t3 = O.hecke_operator(3); t3`
 ```Hecke operator T_3 on Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field``` `Hecke operator T_3 on Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field`
`t3.matrix()`
 ```[ 1 0 0 0 0 0 0] [ 12 -1 2 7 0 4 0] [ 4 1 2 1 1 1 0] [ 8 0 4 3 1 3 -1] [-12 0 -4 -5 -1 -2 0] [ -4 0 -1 -1 -1 -1 2] [ -8 0 -3 -3 0 -3 0]``` ```[ 1 0 0 0 0 0 0] [ 12 -1 2 7 0 4 0] [ 4 1 2 1 1 1 0] [ 8 0 4 3 1 3 -1] [-12 0 -4 -5 -1 -2 0] [ -4 0 -1 -1 -1 -1 2] [ -8 0 -3 -3 0 -3 0]```

# Newforms Corresponding to Simple Modular Symbols Factors

`M = ModularSymbols(389,2,1); M`
 ```Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field``` `Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field`
`time D = M.decomposition(); D`
 ```[ Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 6 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 20 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field ] CPU time: 0.31 s, Wall time: 0.70 s``` ```[ Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 6 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field, Modular Symbols subspace of dimension 20 of Modular Symbols space of dimension 33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field ] CPU time: 0.31 s, Wall time: 0.70 s```
```for A in D:
if A.is_cuspidal():
print A.q_eigenform(4)```
 ```q - 2*q^2 - 2*q^3 + O(q^4) q + alpha*q^2 + (alpha - 2)*q^3 + O(q^4) q + alpha*q^2 + -alpha*q^3 + O(q^4) q + alpha*q^2 + (alpha^5 + 3*alpha^4 - 2*alpha^3 - 8*alpha^2 + alpha + 2)*q^3 + O(q^4) q + alpha*q^2 + (-20146763/1097385680*alpha^19 + 20466323/219477136*alpha^18 + 119884773/274346420*alpha^17 - 753611053/274346420*alpha^16 - 381358355/109738568*alpha^15 + 3611475535/109738568*alpha^14 + 6349339639/1097385680*alpha^13 - 56878934241/274346420*alpha^12 + 71555185319/1097385680*alpha^11 + 163330998525/219477136*alpha^10 - 223188336749/548692840*alpha^9 - 169878973265/109738568*alpha^8 + 265944624817/274346420*alpha^7 + 199655892261/109738568*alpha^6 - 1167579836501/1097385680*alpha^5 - 619178000979/548692840*alpha^4 + 261766056911/548692840*alpha^3 + 4410485304/13717321*alpha^2 - 14646077211/274346420*alpha - 1604641167/68586605)*q^3 + O(q^4)``` ```q - 2*q^2 - 2*q^3 + O(q^4) q + alpha*q^2 + (alpha - 2)*q^3 + O(q^4) q + alpha*q^2 + -alpha*q^3 + O(q^4) q + alpha*q^2 + (alpha^5 + 3*alpha^4 - 2*alpha^3 - 8*alpha^2 + alpha + 2)*q^3 + O(q^4) q + alpha*q^2 + (-20146763/1097385680*alpha^19 + 20466323/219477136*alpha^18 + 119884773/274346420*alpha^17 - 753611053/274346420*alpha^16 - 381358355/109738568*alpha^15 + 3611475535/109738568*alpha^14 + 6349339639/1097385680*alpha^13 - 56878934241/274346420*alpha^12 + 71555185319/1097385680*alpha^11 + 163330998525/219477136*alpha^10 - 223188336749/548692840*alpha^9 - 169878973265/109738568*alpha^8 + 265944624817/274346420*alpha^7 + 199655892261/109738568*alpha^6 - 1167579836501/1097385680*alpha^5 - 619178000979/548692840*alpha^4 + 261766056911/548692840*alpha^3 + 4410485304/13717321*alpha^2 - 14646077211/274346420*alpha - 1604641167/68586605)*q^3 + O(q^4)```
```# what is alpha?
f = D[5].q_eigenform(4)```
`f.parent()`
 ```Power Series Ring in q over Univariate Quotient Polynomial Ring in alpha over Rational Field with modulus 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``` `Power Series Ring in q over Univariate Quotient Polynomial Ring in alpha over Rational Field with modulus 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`

# Atkin-Lehner Operators

`M = ModularSymbols(33,2,1); M`
 ```Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field``` `Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field`
`M.atkin_lehner_operator(3).matrix()`
 ```[ 0 0 0 0 0 -1] [ 0 0 -1 0 0 0] [ 0 -1 0 0 0 0] [ 0 0 0 -1 0 0] [-1 -1 -1 0 1 -1] [-1 0 0 0 0 0]``` ```[ 0 0 0 0 0 -1] [ 0 0 -1 0 0 0] [ 0 -1 0 0 0 0] [ 0 0 0 -1 0 0] [-1 -1 -1 0 1 -1] [-1 0 0 0 0 0]```
`S = M.cuspidal_subspace()`
`S.atkin_lehner_operator(3).matrix()`
 ```[ 1 0 0] [ 0 1 0] [ 1 1 -1]``` ```[ 1 0 0] [ 0 1 0] [ 1 1 -1]```
`S.atkin_lehner_operator(1).matrix()`
 ```[1 0 0] [0 1 0] [0 0 1]``` ```[1 0 0] [0 1 0] [0 0 1]```
`S.atkin_lehner_operator(7).matrix()`
 ```Exception (click to the left for traceback): ... ArithmeticError: d (=7) must be a divisor of the level (=33)``` ```Traceback (most recent call last): File "", line 1, in File "/home/was/talks/2007-06-05-banff-modform-sage/sage_notebook/worksheets/modsymspaces/code/22.py", line 4, in S.atkin_lehner_operator(Integer(7)).matrix() File "/home/was/talks/2007-06-05-banff-modform-sage/", line 1, in File "/home/was/sage-bdist/local/lib/python2.5/site-packages/sage/modular/hecke/module.py", line 385, in atkin_lehner_operator raise ArithmeticError, "d (=%s) must be a divisor of the level (=%s)"%(d,self.level()) ArithmeticError: d (=7) must be a divisor of the level (=33)```