# HG changeset patch
# User David Loeffler <D.Loeffler@dpmms.cam.ac.uk>
# Date 1241513458 -3600
# Node ID daf2231db4789777ccb2fbfd8c6ec046ad5873d4
# Parent 7488340543618251888907e60499593a1c911890
#6071: weight 1 Eisenstein series
diff -r 748834054361 -r daf2231db478 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 | """ |
… |
… |
|
350 | 358 | Vector space of dimension 27 over Finite Field in b of size 7^2 |
351 | 359 | """ |
352 | 360 | if hasattr(self, "__module"): return self.__module |
353 | | self.__module = free_module.VectorSpace(self.base_ring(), |
354 | | self.dimension()) |
| 361 | try: |
| 362 | d = self.dimension() |
| 363 | except NotImplementedError: |
| 364 | d = self._dim_eisenstein() |
| 365 | self.__module = free_module.VectorSpace(self.base_ring(), d) |
355 | 366 | return self.__module |
356 | 367 | |
| 368 | def free_module(self): return self.module() |
| 369 | # stupid thing: there are functions in classes ModularFormsSpace and |
| 370 | # HeckeModule that both do much the same thing, and one has to override |
| 371 | # both of them! |
| 372 | |
357 | 373 | def prec(self, new_prec=None): |
358 | 374 | """ |
359 | 375 | Set or get default initial precision for printing modular forms. |
diff -r 748834054361 -r daf2231db478 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 748834054361 -r daf2231db478 sage/modular/modform/constructor.py
a
|
b
|
|
91 | 91 | ValueError: group and level do not match. |
92 | 92 | """ |
93 | 93 | weight = rings.Integer(weight) |
94 | | if weight <= 1: |
95 | | raise NotImplementedError, "weight must be at least 2" |
| 94 | if weight <= 0: |
| 95 | raise NotImplementedError, "weight must be at least 1" |
96 | 96 | |
97 | 97 | if isinstance(group, dirichlet.DirichletCharacter): |
98 | 98 | if ( group.level() != rings.Integer(level) ): |
diff -r 748834054361 -r daf2231db478 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 748834054361 -r daf2231db478 sage/modular/modform/eis_series.py
a
|
b
|
|
233 | 233 | if chi*psi == eps: |
234 | 234 | chi0, psi0 = __common_minimal_basering(chi, psi) |
235 | 235 | for t in divisors(N//(R*L)): |
236 | | params.append( (chi0,psi0,t) ) |
| 236 | if k != 1 or ((psi0, chi0, t) not in params): |
| 237 | params.append( (chi0,psi0,t) ) |
237 | 238 | return params |
238 | 239 | |
239 | 240 | |
… |
… |
|
277 | 278 | for j in range(i,len(E)): |
278 | 279 | if parity[i]*parity[j] == s and N % (E[i].conductor()*E[j].conductor()) == 0: |
279 | 280 | chi, psi = __common_minimal_basering(E[i], E[j]) |
280 | | pairs.append((chi, psi)) |
281 | | if i!=j: pairs.append((psi,chi)) |
| 281 | if k != 1: |
| 282 | pairs.append((chi, psi)) |
| 283 | if i!=j: pairs.append((psi,chi)) |
| 284 | else: |
| 285 | # if weight is 1 then (chi, psi) and (chi, psi) are the |
| 286 | # same form |
| 287 | if psi.is_trivial() and not chi.is_trivial(): |
| 288 | # need to put the trivial character first to get the L-value right |
| 289 | pairs.append((psi, chi)) |
| 290 | else: |
| 291 | pairs.append((chi, psi)) |
282 | 292 | #end fors |
283 | 293 | #end if |
284 | 294 | |
… |
… |
|
355 | 365 | Compute and return a list of all parameters `(\chi,\psi,t)` that |
356 | 366 | define the Eisenstein series with given character and weight `k`. |
357 | 367 | |
358 | | Only the parity of `k` is relevant. |
| 368 | Only the parity of `k` is relevant (unless k = 1, which is a slightly different case). |
359 | 369 | |
360 | 370 | If character is an integer `N`, then the parameters for |
361 | 371 | `\Gamma_1(N)` are computed instead. Then the condition is that |
… |
… |
|
375 | 385 | ([1, 1], [1, 1], 10), |
376 | 386 | ([1, 1], [1, 1], 15), |
377 | 387 | ([1, 1], [1, 1], 30)] |
| 388 | |
| 389 | sage: sage.modular.modform.eis_series.compute_eisenstein_params(15, 1) |
| 390 | [([1, 1], [-1, 1], 1), |
| 391 | ([1, 1], [-1, 1], 5), |
| 392 | ([1, 1], [1, zeta4], 1), |
| 393 | ([1, 1], [1, zeta4], 3), |
| 394 | ([1, 1], [-1, -1], 1), |
| 395 | ([1, 1], [1, -zeta4], 1), |
| 396 | ([1, 1], [1, -zeta4], 3), |
| 397 | ([-1, 1], [1, -1], 1)] |
| 398 | |
| 399 | sage: sage.modular.modform.eis_series.compute_eisenstein_params(DirichletGroup(15).0, 1) |
| 400 | [([1, 1], [-1, 1], 1), ([1, 1], [-1, 1], 5)] |
378 | 401 | """ |
379 | 402 | if isinstance(character, (int,long,Integer)): |
380 | 403 | N = character |