Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/modular/modform/ambient_g1.py
4077 views
1
r"""
2
Modular Forms for `\Gamma_1(N)` and `\Gamma_H(N)` over `\QQ`
3
4
EXAMPLES::
5
6
sage: M = ModularForms(Gamma1(13),2); M
7
Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
8
sage: S = M.cuspidal_submodule(); S
9
Cuspidal subspace of dimension 2 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
10
sage: S.basis()
11
[
12
q - 4*q^3 - q^4 + 3*q^5 + O(q^6),
13
q^2 - 2*q^3 - q^4 + 2*q^5 + O(q^6)
14
]
15
16
sage: M = ModularForms(GammaH(11, [4])); M
17
Modular Forms space of dimension 2 for Congruence Subgroup Gamma_H(11) with H generated by [4] of weight 2 over Rational Field
18
sage: M.q_expansion_basis(8)
19
[
20
q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 + O(q^8),
21
1 + 12/5*q + 36/5*q^2 + 48/5*q^3 + 84/5*q^4 + 72/5*q^5 + 144/5*q^6 + 96/5*q^7 + O(q^8)
22
]
23
24
25
TESTS::
26
27
sage: m = ModularForms(Gamma1(20),2)
28
sage: loads(dumps(m)) == m
29
True
30
31
sage: m = ModularForms(GammaH(15, [4]), 2)
32
sage: loads(dumps(m)) == m
33
True
34
35
36
We check that #10453 is fixed::
37
38
sage: CuspForms(Gamma1(11), 2).old_submodule()
39
Modular Forms subspace of dimension 0 of Modular Forms space of dimension 10 for Congruence Subgroup Gamma1(11) of weight 2 over Rational Field
40
sage: ModularForms(Gamma1(3), 12).old_submodule()
41
Modular Forms subspace of dimension 4 of Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(3) of weight 12 over Rational Field
42
43
"""
44
45
#########################################################################
46
# Copyright (C) 2006 William Stein <[email protected]>
47
#
48
# Distributed under the terms of the GNU General Public License (GPL)
49
#
50
# http://www.gnu.org/licenses/
51
#########################################################################
52
53
import sage.rings.all as rings
54
55
import sage.modular.arithgroup.all as arithgroup
56
57
import ambient
58
import cuspidal_submodule
59
import eisenstein_submodule
60
61
class ModularFormsAmbient_gH_Q(ambient.ModularFormsAmbient):
62
"""
63
A space of modular forms for the group `\Gamma_H(N)` over the rational numbers.
64
"""
65
def __init__(self, group, weight):
66
r"""
67
Create a space of modular forms for `\Gamma_H(N)` of integral weight over the
68
rational numbers.
69
70
EXAMPLES::
71
72
sage: m = ModularForms(GammaH(100, [41]),5); m
73
Modular Forms space of dimension 270 for Congruence Subgroup Gamma_H(100) with H generated by [41] of weight 5 over Rational Field
74
sage: type(m)
75
<class 'sage.modular.modform.ambient_g1.ModularFormsAmbient_gH_Q_with_category'>
76
"""
77
ambient.ModularFormsAmbient.__init__(self, group, weight, rings.QQ)
78
79
####################################################################
80
# Computation of Special Submodules
81
####################################################################
82
def cuspidal_submodule(self):
83
"""
84
Return the cuspidal submodule of this modular forms space.
85
86
EXAMPLES::
87
88
sage: m = ModularForms(GammaH(100, [29]),2); m
89
Modular Forms space of dimension 48 for Congruence Subgroup Gamma_H(100) with H generated by [29] of weight 2 over Rational Field
90
sage: m.cuspidal_submodule()
91
Cuspidal subspace of dimension 13 of Modular Forms space of dimension 48 for Congruence Subgroup Gamma_H(100) with H generated by [29] of weight 2 over Rational Field
92
"""
93
try:
94
return self.__cuspidal_submodule
95
except AttributeError:
96
if self.level() == 1:
97
self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_level1_Q(self)
98
else:
99
self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_gH_Q(self)
100
return self.__cuspidal_submodule
101
102
def eisenstein_submodule(self):
103
"""
104
Return the Eisenstein submodule of this modular forms space.
105
106
EXAMPLES::
107
108
sage: E = ModularForms(GammaH(100, [29]),3).eisenstein_submodule(); E
109
Eisenstein subspace of dimension 24 of Modular Forms space of dimension 72 for Congruence Subgroup Gamma_H(100) with H generated by [29] of weight 3 over Rational Field
110
sage: type(E)
111
<class 'sage.modular.modform.eisenstein_submodule.EisensteinSubmodule_gH_Q_with_category'>
112
"""
113
try:
114
return self.__eisenstein_submodule
115
except AttributeError:
116
self.__eisenstein_submodule = eisenstein_submodule.EisensteinSubmodule_gH_Q(self)
117
return self.__eisenstein_submodule
118
119
def _compute_diamond_matrix(self, d):
120
r"""
121
Compute the matrix of the diamond operator <d> on this space.
122
123
EXAMPLE::
124
125
sage: ModularForms(GammaH(9, [4]), 7)._compute_diamond_matrix(2)
126
[-1 0 0 0 0 0 0 0]
127
[ 0 -1 0 0 0 0 0 0]
128
[ 0 0 -1 0 0 0 0 0]
129
[ 0 0 0 -1 0 0 0 0]
130
[ 0 0 0 0 -1 0 0 0]
131
[ 0 0 0 0 0 -1 0 0]
132
[ 0 0 0 0 0 0 -1 0]
133
[ 0 0 0 0 0 0 0 -1]
134
"""
135
return self.cuspidal_submodule().diamond_bracket_matrix(d).block_sum(self.eisenstein_submodule().diamond_bracket_matrix(d))
136
137
def _compute_hecke_matrix(self, n):
138
r"""
139
Compute the matrix of the Hecke operator T_n acting on this space.
140
141
EXAMPLE::
142
143
sage: ModularForms(Gamma1(7), 4).hecke_matrix(3) # indirect doctest
144
[ 0 -42 133 0 0 0 0 0 0]
145
[ 0 -28 91 0 0 0 0 0 0]
146
[ 1 -8 19 0 0 0 0 0 0]
147
[ 0 0 0 28 0 0 0 0 0]
148
[ 0 0 0 -10152/259 0 5222/37 -13230/37 -22295/37 92504/37]
149
[ 0 0 0 -6087/259 0 312067/4329 1370420/4329 252805/333 3441466/4329]
150
[ 0 0 0 -729/259 1 485/37 3402/37 5733/37 7973/37]
151
[ 0 0 0 729/259 0 -189/37 -1404/37 -2366/37 -3348/37]
152
[ 0 0 0 255/259 0 -18280/4329 -51947/4329 -10192/333 -190855/4329]
153
"""
154
return self.cuspidal_submodule().hecke_matrix(n).block_sum(self.eisenstein_submodule().hecke_matrix(n))
155
156
157
class ModularFormsAmbient_g1_Q(ModularFormsAmbient_gH_Q):
158
"""
159
A space of modular forms for the group `\Gamma_1(N)` over the rational numbers.
160
"""
161
def __init__(self, level, weight):
162
r"""
163
Create a space of modular forms for `\Gamma_1(N)` of integral weight over the
164
rational numbers.
165
166
EXAMPLES::
167
168
sage: m = ModularForms(Gamma1(100),5); m
169
Modular Forms space of dimension 1270 for Congruence Subgroup Gamma1(100) of weight 5 over Rational Field
170
sage: type(m)
171
<class 'sage.modular.modform.ambient_g1.ModularFormsAmbient_g1_Q_with_category'>
172
"""
173
ambient.ModularFormsAmbient.__init__(self, arithgroup.Gamma1(level), weight, rings.QQ)
174
175
####################################################################
176
# Computation of Special Submodules
177
####################################################################
178
def cuspidal_submodule(self):
179
"""
180
Return the cuspidal submodule of this modular forms space.
181
182
EXAMPLES::
183
184
sage: m = ModularForms(Gamma1(17),2); m
185
Modular Forms space of dimension 20 for Congruence Subgroup Gamma1(17) of weight 2 over Rational Field
186
sage: m.cuspidal_submodule()
187
Cuspidal subspace of dimension 5 of Modular Forms space of dimension 20 for Congruence Subgroup Gamma1(17) of weight 2 over Rational Field
188
"""
189
try:
190
return self.__cuspidal_submodule
191
except AttributeError:
192
if self.level() == 1:
193
self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_level1_Q(self)
194
else:
195
self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_g1_Q(self)
196
return self.__cuspidal_submodule
197
198
def eisenstein_submodule(self):
199
"""
200
Return the Eisenstein submodule of this modular forms space.
201
202
EXAMPLES::
203
204
sage: ModularForms(Gamma1(13),2).eisenstein_submodule()
205
Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
206
sage: ModularForms(Gamma1(13),10).eisenstein_submodule()
207
Eisenstein subspace of dimension 12 of Modular Forms space of dimension 69 for Congruence Subgroup Gamma1(13) of weight 10 over Rational Field
208
"""
209
try:
210
return self.__eisenstein_submodule
211
except AttributeError:
212
self.__eisenstein_submodule = eisenstein_submodule.EisensteinSubmodule_g1_Q(self)
213
return self.__eisenstein_submodule
214
215
216