Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

r""" 

Modular Forms for `\Gamma_1(N)` and `\Gamma_H(N)` over `\QQ` 

 

EXAMPLES:: 

 

sage: M = ModularForms(Gamma1(13),2); M 

Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field 

sage: S = M.cuspidal_submodule(); S 

Cuspidal subspace of dimension 2 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field 

sage: S.basis() 

[ 

q - 4*q^3 - q^4 + 3*q^5 + O(q^6), 

q^2 - 2*q^3 - q^4 + 2*q^5 + O(q^6) 

] 

 

sage: M = ModularForms(GammaH(11, [3])); M 

Modular Forms space of dimension 2 for Congruence Subgroup Gamma_H(11) with H generated by [3] of weight 2 over Rational Field 

sage: M.q_expansion_basis(8) 

[ 

q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 + O(q^8), 

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) 

] 

 

 

TESTS:: 

 

sage: m = ModularForms(Gamma1(20),2) 

sage: loads(dumps(m)) == m 

True 

 

sage: m = ModularForms(GammaH(15, [4]), 2) 

sage: loads(dumps(m)) == m 

True 

 

 

We check that :trac:`10453` is fixed:: 

 

sage: CuspForms(Gamma1(11), 2).old_submodule() 

Modular Forms subspace of dimension 0 of Modular Forms space of dimension 10 for Congruence Subgroup Gamma1(11) of weight 2 over Rational Field 

sage: ModularForms(Gamma1(3), 12).old_submodule() 

Modular Forms subspace of dimension 4 of Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(3) of weight 12 over Rational Field 

 

""" 

from __future__ import absolute_import 

 

######################################################################### 

# Copyright (C) 2006 William Stein <wstein@gmail.com> 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# 

# http://www.gnu.org/licenses/ 

######################################################################### 

 

import sage.rings.all as rings 

 

import sage.modular.arithgroup.all as arithgroup 

 

from . import ambient 

from . import cuspidal_submodule 

from . import eisenstein_submodule 

 

class ModularFormsAmbient_gH_Q(ambient.ModularFormsAmbient): 

""" 

A space of modular forms for the group `\Gamma_H(N)` over the rational numbers. 

""" 

def __init__(self, group, weight, eis_only): 

r""" 

Create a space of modular forms for `\Gamma_H(N)` of integral weight over the 

rational numbers. 

 

EXAMPLES:: 

 

sage: m = ModularForms(GammaH(100, [41]),5); m 

Modular Forms space of dimension 270 for Congruence Subgroup Gamma_H(100) with H generated by [41] of weight 5 over Rational Field 

sage: type(m) 

<class 'sage.modular.modform.ambient_g1.ModularFormsAmbient_gH_Q_with_category'> 

""" 

ambient.ModularFormsAmbient.__init__(self, group, weight, rings.QQ, eis_only=eis_only) 

 

#################################################################### 

# Computation of Special Submodules 

#################################################################### 

def cuspidal_submodule(self): 

""" 

Return the cuspidal submodule of this modular forms space. 

 

EXAMPLES:: 

 

sage: m = ModularForms(GammaH(100, [29]),2); m 

Modular Forms space of dimension 48 for Congruence Subgroup Gamma_H(100) with H generated by [29] of weight 2 over Rational Field 

sage: m.cuspidal_submodule() 

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 

""" 

try: 

return self.__cuspidal_submodule 

except AttributeError: 

if self.level() == 1: 

self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_level1_Q(self) 

else: 

self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_gH_Q(self) 

return self.__cuspidal_submodule 

 

def eisenstein_submodule(self): 

""" 

Return the Eisenstein submodule of this modular forms space. 

 

EXAMPLES:: 

 

sage: E = ModularForms(GammaH(100, [29]),3).eisenstein_submodule(); E 

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 

sage: type(E) 

<class 'sage.modular.modform.eisenstein_submodule.EisensteinSubmodule_gH_Q_with_category'> 

""" 

try: 

return self.__eisenstein_submodule 

except AttributeError: 

self.__eisenstein_submodule = eisenstein_submodule.EisensteinSubmodule_gH_Q(self) 

return self.__eisenstein_submodule 

 

def _compute_diamond_matrix(self, d): 

r""" 

Compute the matrix of the diamond operator <d> on this space. 

 

EXAMPLES:: 

 

sage: ModularForms(GammaH(9, [4]), 7)._compute_diamond_matrix(2) 

[-1 0 0 0 0 0 0 0] 

[ 0 -1 0 0 0 0 0 0] 

[ 0 0 -1 0 0 0 0 0] 

[ 0 0 0 -1 0 0 0 0] 

[ 0 0 0 0 -1 0 0 0] 

[ 0 0 0 0 0 -1 0 0] 

[ 0 0 0 0 0 0 -1 0] 

[ 0 0 0 0 0 0 0 -1] 

""" 

return self.cuspidal_submodule().diamond_bracket_matrix(d).block_sum(self.eisenstein_submodule().diamond_bracket_matrix(d)) 

 

def _compute_hecke_matrix(self, n): 

r""" 

Compute the matrix of the Hecke operator T_n acting on this space. 

 

EXAMPLES:: 

 

sage: ModularForms(Gamma1(7), 4).hecke_matrix(3) # indirect doctest 

[ 0 -42 133 0 0 0 0 0 0] 

[ 0 -28 91 0 0 0 0 0 0] 

[ 1 -8 19 0 0 0 0 0 0] 

[ 0 0 0 28 0 0 0 0 0] 

[ 0 0 0 -10152/259 0 5222/37 -13230/37 -22295/37 92504/37] 

[ 0 0 0 -6087/259 0 312067/4329 1370420/4329 252805/333 3441466/4329] 

[ 0 0 0 -729/259 1 485/37 3402/37 5733/37 7973/37] 

[ 0 0 0 729/259 0 -189/37 -1404/37 -2366/37 -3348/37] 

[ 0 0 0 255/259 0 -18280/4329 -51947/4329 -10192/333 -190855/4329] 

""" 

return self.cuspidal_submodule().hecke_matrix(n).block_sum(self.eisenstein_submodule().hecke_matrix(n)) 

 

 

class ModularFormsAmbient_g1_Q(ModularFormsAmbient_gH_Q): 

""" 

A space of modular forms for the group `\Gamma_1(N)` over the rational numbers. 

""" 

def __init__(self, level, weight, eis_only): 

r""" 

Create a space of modular forms for `\Gamma_1(N)` of integral weight over the 

rational numbers. 

 

EXAMPLES:: 

 

sage: m = ModularForms(Gamma1(100),5); m 

Modular Forms space of dimension 1270 for Congruence Subgroup Gamma1(100) of weight 5 over Rational Field 

sage: type(m) 

<class 'sage.modular.modform.ambient_g1.ModularFormsAmbient_g1_Q_with_category'> 

""" 

ambient.ModularFormsAmbient.__init__(self, arithgroup.Gamma1(level), weight, rings.QQ, eis_only=eis_only) 

 

#################################################################### 

# Computation of Special Submodules 

#################################################################### 

def cuspidal_submodule(self): 

""" 

Return the cuspidal submodule of this modular forms space. 

 

EXAMPLES:: 

 

sage: m = ModularForms(Gamma1(17),2); m 

Modular Forms space of dimension 20 for Congruence Subgroup Gamma1(17) of weight 2 over Rational Field 

sage: m.cuspidal_submodule() 

Cuspidal subspace of dimension 5 of Modular Forms space of dimension 20 for Congruence Subgroup Gamma1(17) of weight 2 over Rational Field 

""" 

try: 

return self.__cuspidal_submodule 

except AttributeError: 

if self.level() == 1: 

self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_level1_Q(self) 

else: 

self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_g1_Q(self) 

return self.__cuspidal_submodule 

 

def eisenstein_submodule(self): 

""" 

Return the Eisenstein submodule of this modular forms space. 

 

EXAMPLES:: 

 

sage: ModularForms(Gamma1(13),2).eisenstein_submodule() 

Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field 

sage: ModularForms(Gamma1(13),10).eisenstein_submodule() 

Eisenstein subspace of dimension 12 of Modular Forms space of dimension 69 for Congruence Subgroup Gamma1(13) of weight 10 over Rational Field 

""" 

try: 

return self.__eisenstein_submodule 

except AttributeError: 

self.__eisenstein_submodule = eisenstein_submodule.EisensteinSubmodule_g1_Q(self) 

return self.__eisenstein_submodule