# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1332182953 25200
# Node ID 9d29db850bbe5eb0c2dde55877b6d32203d6c116
# Parent 5d59e2d89b9c54c4a673fc69fe565c04e26e732d
Trac #12640: some special cases of dimension_new_cusp_forms are broken
diff --git a/sage/modular/dims.py b/sage/modular/dims.py
a
|
b
|
|
299 | 299 | 12 |
300 | 300 | sage: dimension_new_cusp_forms(Gamma1(30),3) |
301 | 301 | 12 |
| 302 | |
| 303 | Check that Trac #12640 is fixed:: |
| 304 | |
| 305 | sage: dimension_new_cusp_forms(DirichletGroup(1)(1), 12) |
| 306 | 1 |
| 307 | sage: dimension_new_cusp_forms(DirichletGroup(2)(1), 24) |
| 308 | 1 |
302 | 309 | """ |
303 | 310 | if is_GammaH(X): |
304 | 311 | return X.dimension_new_cusp_forms(k,p=p) |
305 | 312 | elif isinstance(X, dirichlet.DirichletCharacter): |
306 | | return Gamma1(X.modulus()).dimension_new_cusp_forms(k,eps=X,p=p) |
| 313 | N = X.modulus() |
| 314 | if N <= 2: |
| 315 | return Gamma0(N).dimension_new_cusp_forms(k,p=p) |
| 316 | else: |
| 317 | # Gamma1(N) for N<=2 just returns Gamma0(N), which has no eps parameter. See Trac #12640. |
| 318 | return Gamma1(N).dimension_new_cusp_forms(k,eps=X,p=p) |
307 | 319 | elif isinstance(X, (int,long,Integer)): |
308 | 320 | return Gamma0(X).dimension_new_cusp_forms(k,p=p) |
309 | 321 | else: |
… |
… |
|
400 | 412 | 0 |
401 | 413 | sage: dimension_cusp_forms(e^2,2) |
402 | 414 | 1 |
| 415 | |
| 416 | Check that Trac #12640 is fixed:: |
| 417 | |
| 418 | sage: dimension_cusp_forms(DirichletGroup(1)(1), 12) |
| 419 | 1 |
| 420 | sage: dimension_cusp_forms(DirichletGroup(2)(1), 24) |
| 421 | 5 |
403 | 422 | """ |
404 | 423 | if isinstance(X, dirichlet.DirichletCharacter): |
405 | | return Gamma1(X.modulus()).dimension_cusp_forms(k, X) |
| 424 | N = X.modulus() |
| 425 | if N <= 2: |
| 426 | return Gamma0(N).dimension_cusp_forms(k) |
| 427 | else: |
| 428 | return Gamma1(N).dimension_cusp_forms(k, X) |
406 | 429 | elif is_ArithmeticSubgroup(X): |
407 | 430 | return X.dimension_cusp_forms(k) |
408 | 431 | elif isinstance(X, (Integer,int,long)): |