Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/modular/modform/submodule.py
4038 views
1
"""
2
Submodules of spaces of modular forms
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: M.eisenstein_subspace()
9
Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
10
sage: M == loads(dumps(M))
11
True
12
sage: M.cuspidal_subspace()
13
Cuspidal subspace of dimension 2 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
14
"""
15
16
#########################################################################
17
# Copyright (C) 2004--2006 William Stein <[email protected]>
18
#
19
# Distributed under the terms of the GNU General Public License (GPL)
20
#
21
# http://www.gnu.org/licenses/
22
#########################################################################
23
24
import space
25
26
import sage.modular.hecke.submodule
27
28
class ModularFormsSubmodule(space.ModularFormsSpace,
29
sage.modular.hecke.submodule.HeckeSubmodule):
30
"""
31
A submodule of an ambient space of modular forms.
32
"""
33
def __init__(self, ambient_module, submodule, dual=None, check=False):
34
"""
35
INPUT:
36
37
- ambient_module -- ModularFormsSpace
38
- submodule -- a submodule of the ambient space.
39
- dual_module -- (default: None) ignored
40
- check -- (default: False) whether to check that the
41
submodule is Hecke equivariant
42
43
EXAMPLES::
44
45
sage: M = ModularForms(Gamma1(13),2); M
46
Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
47
sage: M.eisenstein_subspace()
48
Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
49
50
"""
51
A = ambient_module
52
sage.modular.hecke.submodule.HeckeSubmodule.__init__(self, A, submodule, check=check)
53
space.ModularFormsSpace.__init__(self, A.group(), A.weight(),
54
A.character(), A.base_ring())
55
56
def _repr_(self):
57
"""
58
EXAMPLES::
59
60
sage: ModularForms(Gamma1(13),2).eisenstein_subspace()._repr_()
61
'Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field'
62
"""
63
return "Modular Forms subspace of dimension %s of %s"%(self.dimension(), self.ambient_module())
64
65
def _compute_coefficients(self, element, X):
66
"""
67
Compute all coefficients of the modular form element in self for
68
indices in X.
69
70
TODO: Implement this function.
71
72
EXAMPLES::
73
74
sage: M = ModularForms(6,4).cuspidal_subspace()
75
sage: M._compute_coefficients( M.basis()[0], range(1,100) )
76
Traceback (most recent call last):
77
...
78
NotImplementedError
79
"""
80
raise NotImplementedError
81
82
def _compute_q_expansion_basis(self, prec):
83
"""
84
Compute q_expansions to precision prec for each element in self.basis().
85
86
EXAMPLES::
87
88
sage: M = ModularForms(Gamma1(13),2); M
89
Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
90
sage: S = M.eisenstein_subspace(); S
91
Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
92
sage: S._compute_q_expansion_basis(5)
93
[1 + O(q^5),
94
q + O(q^5),
95
q^2 + O(q^5),
96
q^3 + O(q^5),
97
q^4 + O(q^5),
98
O(q^5),
99
O(q^5),
100
O(q^5),
101
O(q^5),
102
O(q^5),
103
O(q^5)]
104
"""
105
A = self.ambient_module()
106
return [A._q_expansion(element = f.element(), prec=prec) for f in self.basis()]
107
108
109
# TODO
110
class ModularFormsSubmoduleWithBasis(ModularFormsSubmodule):
111
pass
112
113
114
115
116
117
118