# HG changeset patch
# User David Loeffler <D.Loeffler@dpmms.cam.ac.uk>
# Date 1241513458 -3600
# Node ID ca1f179559ede4256d2a2206a5f2e072d28a6443
# Parent 810c7ca6f8087c98e80d84a053e5f1c4ab9c9205
#6071: weight 1 Eisenstein series
diff -r 810c7ca6f808 -r ca1f179559ed sage/modular/modform/ambient.py
a
|
b
|
|
115 | 115 | character = dirichlet.TrivialCharacter(group.level(), base_ring) |
116 | 116 | |
117 | 117 | space.ModularFormsSpace.__init__(self, group, weight, character, base_ring) |
118 | | hecke.AmbientHeckeModule.__init__(self, base_ring, self.dimension(), group.level(), weight) |
| 118 | try: |
| 119 | d = self.dimension() |
| 120 | except NotImplementedError: |
| 121 | d = None |
| 122 | hecke.AmbientHeckeModule.__init__(self, base_ring, d, group.level(), weight) |
119 | 123 | |
120 | 124 | def _repr_(self): |
121 | 125 | """ |
… |
… |
|
134 | 138 | sage: m._repr_() |
135 | 139 | 'Modular Forms space of dimension 1198 for Congruence Subgroup Gamma1(20) of weight 100 over Rational Field' |
136 | 140 | """ |
| 141 | try: |
| 142 | d = self.dimension() |
| 143 | except NotImplementedError: |
| 144 | d = "(unknown)" |
137 | 145 | return "Modular Forms space of dimension %s for %s of weight %s over %s"%( |
138 | | self.dimension(), self.group(), self.weight(), self.base_ring()) |
| 146 | d, self.group(), self.weight(), self.base_ring()) |
139 | 147 | |
140 | 148 | def _submodule_class(self): |
141 | 149 | """ |
… |
… |
|
348 | 356 | Vector space of dimension 69 over Rational Field |
349 | 357 | sage: ModularForms(Gamma1(13),4, GF(49,'b')).free_module() |
350 | 358 | Vector space of dimension 27 over Finite Field in b of size 7^2 |
| 359 | |
| 360 | sage: M = ModularForms(Gamma1(57), 1); M |
| 361 | Modular Forms space of dimension (unknown) for Congruence ... |
| 362 | sage: M.free_module() |
| 363 | Vector space of dimension 36 over Rational Field |
| 364 | sage: M.basis() |
| 365 | Traceback (most recent call last): |
| 366 | ... |
| 367 | NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general |
351 | 368 | """ |
352 | 369 | if hasattr(self, "__module"): return self.__module |
353 | | self.__module = free_module.VectorSpace(self.base_ring(), |
354 | | self.dimension()) |
| 370 | try: |
| 371 | d = self.dimension() |
| 372 | except NotImplementedError: |
| 373 | |
| 374 | # This only comes up for weight 1 forms, where we want to be able |
| 375 | # to embed Eisenstein forms (which we know how to calculate) into |
| 376 | # some suitable ambient space. Because we can't even calculate the |
| 377 | # dimension of the weight 1 cusp forms in general, we just map |
| 378 | # Eisenstein series onto basis vectors, and then make it clear by |
| 379 | # raising errors in appropriate places that some cusp forms might |
| 380 | # exist but we don't know how to compute them. |
| 381 | |
| 382 | d = self._dim_eisenstein() |
| 383 | self.__module = free_module.VectorSpace(self.base_ring(), d) |
355 | 384 | return self.__module |
356 | 385 | |
| 386 | def free_module(self): return self.module() |
| 387 | # stupid thing: there are functions in classes ModularFormsSpace and |
| 388 | # HeckeModule that both do much the same thing, and one has to override |
| 389 | # both of them! |
| 390 | |
357 | 391 | def prec(self, new_prec=None): |
358 | 392 | """ |
359 | 393 | Set or get default initial precision for printing modular forms. |
diff -r 810c7ca6f808 -r ca1f179559ed sage/modular/modform/ambient_eps.py
a
|
b
|
|
144 | 144 | sage: m |
145 | 145 | Modforms of level 8 |
146 | 146 | """ |
| 147 | try: |
| 148 | d = self.dimension() |
| 149 | except NotImplementedError: |
| 150 | d = "(unknown)" |
147 | 151 | return "Modular Forms space of dimension %s, character %s and weight %s over %s"%( |
148 | | self.dimension(), self.character(), self.weight(), self.base_ring()) |
| 152 | d, self.character(), self.weight(), self.base_ring()) |
149 | 153 | |
150 | 154 | def cuspidal_submodule(self): |
151 | 155 | """ |
diff -r 810c7ca6f808 -r ca1f179559ed sage/modular/modform/constructor.py
a
|
b
|
|
15 | 15 | 1 + 4092/50521*q^2 + 472384/50521*q^3 + 4194300/50521*q^4 + O(q^6), |
16 | 16 | q + 1024*q^2 + 59048*q^3 + 1048576*q^4 + 9765626*q^5 + O(q^6) |
17 | 17 | ] |
| 18 | |
18 | 19 | """ |
19 | 20 | |
20 | 21 | ######################################################################### |
… |
… |
|
91 | 92 | ValueError: group and level do not match. |
92 | 93 | """ |
93 | 94 | weight = rings.Integer(weight) |
94 | | if weight <= 1: |
95 | | raise NotImplementedError, "weight must be at least 2" |
| 95 | if weight <= 0: |
| 96 | raise NotImplementedError, "weight must be at least 1" |
96 | 97 | |
97 | 98 | if isinstance(group, dirichlet.DirichletCharacter): |
98 | 99 | if ( group.level() != rings.Integer(level) ): |
… |
… |
|
235 | 236 | |
236 | 237 | sage: ModularForms(gp(1), gap(12)) |
237 | 238 | Modular Forms space of dimension 2 for Modular Group SL(2,Z) of weight 12 over Rational Field |
| 239 | |
| 240 | |
| 241 | We create some weight 1 spaces. The first example works fine, since we can prove purely by Riemann surface theory that there are no weight 1 cusp forms:: |
| 242 | |
| 243 | sage: M = ModularForms(Gamma1(11), 1); M |
| 244 | Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(11) of weight 1 over Rational Field |
| 245 | sage: M.basis() |
| 246 | [ |
| 247 | 1 + 22*q^5 + O(q^6), |
| 248 | q + 4*q^5 + O(q^6), |
| 249 | q^2 - 4*q^5 + O(q^6), |
| 250 | q^3 - 5*q^5 + O(q^6), |
| 251 | q^4 - 3*q^5 + O(q^6) |
| 252 | ] |
| 253 | sage: M.cuspidal_subspace().basis() |
| 254 | [ |
| 255 | ] |
| 256 | sage: M == M.eisenstein_subspace() |
| 257 | True |
| 258 | |
| 259 | This example doesn't work so well, because we can't calculate the cusp |
| 260 | forms; but we can still work with the Eisenstein series. |
| 261 | |
| 262 | sage: M = ModularForms(Gamma1(57), 1); M |
| 263 | Modular Forms space of dimension (unknown) for Congruence Subgroup Gamma1(57) of weight 1 over Rational Field |
| 264 | sage: M.basis() |
| 265 | Traceback (most recent call last): |
| 266 | ... |
| 267 | NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general |
| 268 | sage: M.cuspidal_subspace().basis() |
| 269 | Traceback (most recent call last): |
| 270 | ... |
| 271 | NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general |
| 272 | |
| 273 | sage: E = M.eisenstein_subspace(); E |
| 274 | Eisenstein subspace of dimension 36 of Modular Forms space of dimension (unknown) for Congruence Subgroup Gamma1(57) of weight 1 over Rational Field |
| 275 | sage: (E.0 + E.2).q_expansion(40) |
| 276 | 1 + q^2 + 1473/2*q^36 - 1101/2*q^37 + q^38 - 373/2*q^39 + O(q^40) |
| 277 | |
238 | 278 | """ |
239 | 279 | if isinstance(group, dirichlet.DirichletCharacter): |
240 | 280 | if base_ring is None: |
diff -r 810c7ca6f808 -r ca1f179559ed sage/modular/modform/cuspidal_submodule.py
a
|
b
|
|
199 | 199 | prec = self.prec() |
200 | 200 | else: |
201 | 201 | prec = Integer(prec) |
| 202 | if self.dimension() == 0: |
| 203 | return [] |
202 | 204 | M = self.modular_symbols(sign = 1) |
203 | 205 | return M.q_expansion_basis(prec) |
204 | 206 | |
diff -r 810c7ca6f808 -r ca1f179559ed sage/modular/modform/eis_series.py
a
|
b
|
|
231 | 231 | if chi*psi == eps: |
232 | 232 | chi0, psi0 = __common_minimal_basering(chi, psi) |
233 | 233 | for t in divisors(N//(R*L)): |
234 | | params.append( (chi0,psi0,t) ) |
| 234 | if k != 1 or ((psi0, chi0, t) not in params): |
| 235 | params.append( (chi0,psi0,t) ) |
235 | 236 | return params |
236 | 237 | |
237 | 238 | |
… |
… |
|
275 | 276 | for j in range(i,len(E)): |
276 | 277 | if parity[i]*parity[j] == s and N % (E[i].conductor()*E[j].conductor()) == 0: |
277 | 278 | chi, psi = __common_minimal_basering(E[i], E[j]) |
278 | | pairs.append((chi, psi)) |
279 | | if i!=j: pairs.append((psi,chi)) |
| 279 | if k != 1: |
| 280 | pairs.append((chi, psi)) |
| 281 | if i!=j: pairs.append((psi,chi)) |
| 282 | else: |
| 283 | # if weight is 1 then (chi, psi) and (chi, psi) are the |
| 284 | # same form |
| 285 | if psi.is_trivial() and not chi.is_trivial(): |
| 286 | # need to put the trivial character first to get the L-value right |
| 287 | pairs.append((psi, chi)) |
| 288 | else: |
| 289 | pairs.append((chi, psi)) |
280 | 290 | #end fors |
281 | 291 | #end if |
282 | 292 | |
… |
… |
|
354 | 364 | Compute and return a list of all parameters `(\chi,\psi,t)` that |
355 | 365 | define the Eisenstein series with given character and weight `k`. |
356 | 366 | |
357 | | Only the parity of `k` is relevant. |
| 367 | Only the parity of `k` is relevant (unless k = 1, which is a slightly different case). |
358 | 368 | |
359 | 369 | If character is an integer `N`, then the parameters for |
360 | 370 | `\Gamma_1(N)` are computed instead. Then the condition is that |
… |
… |
|
374 | 384 | ([1, 1], [1, 1], 10), |
375 | 385 | ([1, 1], [1, 1], 15), |
376 | 386 | ([1, 1], [1, 1], 30)] |
| 387 | |
| 388 | sage: sage.modular.modform.eis_series.compute_eisenstein_params(15, 1) |
| 389 | [([1, 1], [-1, 1], 1), |
| 390 | ([1, 1], [-1, 1], 5), |
| 391 | ([1, 1], [1, zeta4], 1), |
| 392 | ([1, 1], [1, zeta4], 3), |
| 393 | ([1, 1], [-1, -1], 1), |
| 394 | ([1, 1], [1, -zeta4], 1), |
| 395 | ([1, 1], [1, -zeta4], 3), |
| 396 | ([-1, 1], [1, -1], 1)] |
| 397 | |
| 398 | sage: sage.modular.modform.eis_series.compute_eisenstein_params(DirichletGroup(15).0, 1) |
| 399 | [([1, 1], [-1, 1], 1), ([1, 1], [-1, 1], 5)] |
377 | 400 | """ |
378 | 401 | if isinstance(character, (int,long,Integer)): |
379 | 402 | N = character |
diff -r 810c7ca6f808 -r ca1f179559ed sage/modular/modform/eisenstein_submodule.py
a
|
b
|
|
66 | 66 | |
67 | 67 | def modular_symbols(self, sign=0): |
68 | 68 | r""" |
69 | | Return the corresponding space of modular symbols with given sign. |
| 69 | Return the corresponding space of modular symbols with given sign. This |
| 70 | will fail in weight 1. |
70 | 71 | |
71 | 72 | .. warning:: |
72 | 73 | |
… |
… |
|
96 | 97 | sage: E = EisensteinForms(eps^2, 2) |
97 | 98 | sage: E.modular_symbols() |
98 | 99 | Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 |
| 100 | |
| 101 | sage: E = EisensteinForms(eps, 1); E |
| 102 | Eisenstein subspace of dimension 1 of Modular Forms space of dimension 1, character [zeta12] and weight 1 over Cyclotomic Field of order 12 and degree 4 |
| 103 | sage: E.modular_symbols() |
| 104 | Traceback (most recent call last): |
| 105 | ... |
| 106 | ValueError: the weight must be at least 2 |
99 | 107 | """ |
100 | 108 | try: |
101 | 109 | return self.__modular_symbols[sign] |
… |
… |
|
143 | 151 | ([-1, 1, 1], [1, 1, 1], 2), |
144 | 152 | ([-1, 1, 1], [1, 1, 1], 3), |
145 | 153 | ([-1, 1, 1], [1, 1, 1], 6)] |
| 154 | sage: EisensteinForms(DirichletGroup(24).0,1).parameters() |
| 155 | [([1, 1, 1], [-1, 1, 1], 1), |
| 156 | ([1, 1, 1], [-1, 1, 1], 2), |
| 157 | ([1, 1, 1], [-1, 1, 1], 3), |
| 158 | ([1, 1, 1], [-1, 1, 1], 6)] |
146 | 159 | """ |
147 | 160 | try: |
148 | 161 | return self.__parameters |
… |
… |
|
269 | 282 | sage: M.eisenstein_series() |
270 | 283 | [ |
271 | 284 | ] |
| 285 | |
| 286 | sage: M = ModularForms(DirichletGroup(13).0, 1) |
| 287 | sage: M.eisenstein_series() |
| 288 | [ |
| 289 | -1/13*zeta12^3 + 6/13*zeta12^2 + 4/13*zeta12 + 2/13 + q + (zeta12 + 1)*q^2 + zeta12^2*q^3 + (zeta12^2 + zeta12 + 1)*q^4 + (-zeta12^3 + 1)*q^5 + O(q^6) |
| 290 | ] |
272 | 291 | """ |
273 | 292 | try: |
274 | 293 | return self.__eisenstein_series |