Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241818 views
1
#################################################################################
2
#
3
# (c) Copyright 2010 William Stein
4
#
5
# This file is part of PSAGE
6
#
7
# PSAGE is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# PSAGE is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#
20
#################################################################################
21
22
23
"""
24
Bases of newforms for classical GL2 modular forms over QQ.
25
"""
26
27
def degrees(N, k, eps=None):
28
"""
29
Return the degrees of the newforms of level N, weight k, with character eps.
30
31
INPUT:
32
33
- N -- level; positive integer or Dirichlet character
34
- k -- weight; integer at least 2
35
- eps -- None or Dirichlet character; if specified N is ignored
36
37
EXAMPLES::
38
39
sage: import psage
40
sage: psage.modform.rational.degrees(11,2)
41
[1]
42
sage: psage.modform.rational.degrees(37,2)
43
[1, 1]
44
sage: psage.modform.rational.degrees(43,2)
45
[1, 2]
46
sage: psage.modform.rational.degrees(DirichletGroup(13).0^2,2)
47
[1]
48
sage: psage.modform.rational.degrees(13,2,DirichletGroup(13).0^2)
49
[1]
50
sage: psage.modform.rational.degrees(13,2)
51
[]
52
"""
53
group = eps if eps else N
54
from sage.all import ModularSymbols, dimension_new_cusp_forms
55
d = dimension_new_cusp_forms(group, k)
56
if d == 0:
57
# A useful optimization!
58
return []
59
M = ModularSymbols(group=group, weight=k, sign=1).cuspidal_subspace()
60
N = M.new_subspace()
61
D = N.decomposition()
62
# TODO: put in a consistency check.
63
degs = [f.dimension() for f in D]
64
assert sum(degs) == d, "major consistency check failed in degrees"
65
return degs
66
67
def eigenvalue_fields(N, k, eps=None):
68
"""
69
Return Hecke eigenvalue fields of the newforms in the space with
70
given level, weight, and character.
71
72
Note that computing this field involves taking random linear
73
combinations of Hecke eigenvalues, so is not deterministic. Set
74
the random seed first (set_random_seed(0)) if you want this to be
75
deterministic.
76
77
INPUT:
78
79
- N -- level; positive integer
80
- k -- weight; integer at least 2
81
- eps -- None or Dirichlet character; if specified N is ignored
82
83
EXAMPLES::
84
85
sage: import psage
86
sage: psage.modform.rational.eigenvalue_fields(11,2)
87
[Rational Field]
88
sage: psage.modform.rational.eigenvalue_fields(43,2)
89
[Rational Field, Number Field in alpha with defining polynomial x^2 - 2]
90
sage: psage.modform.rational.eigenvalue_fields(DirichletGroup(13).0^2,2)
91
[Cyclotomic Field of order 6 and degree 2]
92
sage: psage.modform.rational.eigenvalue_fields(13,2,DirichletGroup(13).0^2)
93
[Cyclotomic Field of order 6 and degree 2]
94
"""
95
group = eps if eps else N
96
from sage.all import ModularSymbols
97
M = ModularSymbols(group=group, weight=k, sign=1).cuspidal_subspace()
98
N = M.new_subspace()
99
D = N.decomposition()
100
X = [f.compact_system_of_eigenvalues([2])[1].base_ring() for f in D]
101
return X
102
103
104
105
106
107
108
109