Compute decomposition of $S_2(\Gamma_0(N), \chi)$, $N \leq 100$ for all $\chi: (\mathbb{Z}/N)^* \rightarrow \mathbb{C}^*$
def f(N,k,i):
"""
INPUT:
N -- positive integer
k -- even integer >= 2
i -- integer identifying the character to use
OUTPUT:
(N,k) -- level and weight
(t0,t1,t2,t3,tall) -- timings
Modular symbols space -- with new cuspidal subspace decomposed.
"""
G = DirichletGroup(N)
Gorb = G.galois_orbits()
try:
char = Gorb[i]
except IndexError:
raise ValueError, "Dirichlet group of level N (=%s) has only %s orbits, so no orbit of index %s"%(N,len(Gorb),i)
tall = cputime(); t = cputime()
M = ModularSymbols(chi,k,sign=1)
t0 = cputime(t); t = cputime()
S = M.cuspidal_subspace()
t1 = cputime(t); t = cputime()
new = S.new_subspace()
t2 = cputime(t); t = cputime()
D = new.decomposition()
t3 = cputime(t)
return ( (N, k, i), (t0,t1,t2,t3,cputime(tall)), M)