Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/modular/modform/ambient_g0.py
4077 views
1
r"""
2
Modular Forms for `\Gamma_0(N)` over `\QQ`
3
4
TESTS::
5
6
sage: m = ModularForms(Gamma0(389),6)
7
sage: loads(dumps(m)) == m
8
True
9
"""
10
11
#########################################################################
12
# Copyright (C) 2006 William Stein <[email protected]>
13
#
14
# Distributed under the terms of the GNU General Public License (GPL)
15
#
16
# http://www.gnu.org/licenses/
17
#########################################################################
18
19
import sage.rings.all as rings
20
21
import sage.modular.arithgroup.all as arithgroup
22
23
import ambient
24
import cuspidal_submodule
25
import eisenstein_submodule
26
27
class ModularFormsAmbient_g0_Q(ambient.ModularFormsAmbient):
28
"""
29
A space of modular forms for `\Gamma_0(N)` over `\QQ`.
30
"""
31
def __init__(self, level, weight):
32
r"""
33
Create a space of modular symbols for `\Gamma_0(N)` of given
34
weight defined over `\QQ`.
35
36
EXAMPLES::
37
38
sage: m = ModularForms(Gamma0(11),4); m
39
Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) of weight 4 over Rational Field
40
sage: type(m)
41
<class 'sage.modular.modform.ambient_g0.ModularFormsAmbient_g0_Q_with_category'>
42
"""
43
ambient.ModularFormsAmbient.__init__(self, arithgroup.Gamma0(level), weight, rings.QQ)
44
45
####################################################################
46
# Computation of Special Submodules
47
####################################################################
48
def cuspidal_submodule(self):
49
r"""
50
Return the cuspidal submodule of this space of modular forms for
51
`\Gamma_0(N)`.
52
53
EXAMPLES::
54
55
sage: m = ModularForms(Gamma0(33),4)
56
sage: s = m.cuspidal_submodule(); s
57
Cuspidal subspace of dimension 10 of Modular Forms space of dimension 14 for Congruence Subgroup Gamma0(33) of weight 4 over Rational Field
58
sage: type(s)
59
<class 'sage.modular.modform.cuspidal_submodule.CuspidalSubmodule_g0_Q_with_category'>
60
"""
61
try:
62
return self.__cuspidal_submodule
63
except AttributeError:
64
if self.level() == 1:
65
self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_level1_Q(self)
66
else:
67
self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_g0_Q(self)
68
return self.__cuspidal_submodule
69
70
def eisenstein_submodule(self):
71
r"""
72
Return the Eisenstein submodule of this space of modular forms for
73
`\Gamma_0(N)`.
74
75
EXAMPLES::
76
77
sage: m = ModularForms(Gamma0(389),6)
78
sage: m.eisenstein_submodule()
79
Eisenstein subspace of dimension 2 of Modular Forms space of dimension 163 for Congruence Subgroup Gamma0(389) of weight 6 over Rational Field
80
"""
81
try:
82
return self.__eisenstein_submodule
83
except AttributeError:
84
self.__eisenstein_submodule = eisenstein_submodule.EisensteinSubmodule_g0_Q(self)
85
return self.__eisenstein_submodule
86
87
def _compute_atkin_lehner_matrix(self, d):
88
r"""
89
Compute the matrix of the Atkin-Lehner involution W_d acting on self,
90
where d is a divisor of the level. This is only implemented in the
91
(trivial) level 1 case.
92
93
EXAMPLE::
94
95
sage: ModularForms(1, 30).atkin_lehner_operator()
96
Hecke module morphism Atkin-Lehner operator W_1 defined by the matrix
97
[1 0 0]
98
[0 1 0]
99
[0 0 1]
100
Domain: Modular Forms space of dimension 3 for Modular Group SL(2,Z) ...
101
Codomain: Modular Forms space of dimension 3 for Modular Group SL(2,Z) ...
102
"""
103
if self.level() == 1:
104
from sage.matrix.matrix_space import MatrixSpace
105
return MatrixSpace(self.base_ring(), self.rank())(1)
106
else:
107
raise NotImplementedError
108
109