-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path67.3.b.b.qexp.sage
266 lines (259 loc) · 10.2 KB
/
67.3.b.b.qexp.sage
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# q-expansion of newform 67.3.b.b, downloaded from the LMFDB on 14 February 2022.
# We generate the q-expansion using the Hecke eigenvalues a_p at the primes.
# Each a_p is given as a linear combination
# of the following basis for the coefficient ring.
# To create the q-expansion as a power series, type "qexp = make_data()"
def make_data():
from sage.all import prod, floor, prime_powers, gcd, QQ, primes_first_n, next_prime, RR
def discrete_log(elts, gens, mod):
# algorithm 2.2, page 16 of https://arxiv.org/abs/0903.2785
def table_gens(gens, mod):
T = [1]
n = len(gens)
r = [None]*n
s = [None]*n
for i in range(n):
beta = gens[i]
r[i] = 1
N = len(T)
while beta not in T:
for Tj in T[:N]:
T.append((beta*Tj) % mod)
beta = (beta*gens[i]) % mod
r[i] += 1
s[i] = T.index(beta)
return T, r, s
T, r, s = table_gens(gens, mod)
n = len(gens)
N = [ prod(r[:j]) for j in range(n) ]
Z = lambda s: [ (floor(s/N[j]) % r[j]) for j in range(n)]
return [Z(T.index(elt % mod)) for elt in elts]
def extend_multiplicatively(an):
for pp in prime_powers(len(an)-1):
for k in range(1, (len(an) - 1)//pp + 1):
if gcd(k, pp) == 1:
an[pp*k] = an[pp]*an[k]
from sage.all import PolynomialRing, NumberField, ZZ
R = PolynomialRing(QQ, "x")
f = R(poly_data)
K = NumberField(f, "a")
betas = [K([c/ZZ(den) for c in num]) for num, den in basis_data]
convert_elt_to_field = lambda elt: sum(c*beta for c, beta in zip(elt, betas))
# convert aps to K elements
primes = primes_first_n(len(aps_data))
good_primes = [p for p in primes if not p.divides(level)]
aps = map(convert_elt_to_field, aps_data)
if not hecke_ring_character_values:
# trivial character
char_values = dict(zip(good_primes, [1]*len(good_primes)))
else:
gens = [elt[0] for elt in hecke_ring_character_values]
gens_values = [convert_elt_to_field(elt[1]) for elt in hecke_ring_character_values]
char_values = dict([(
p,prod(g**k for g, k in zip(gens_values, elt)))
for p, elt in zip(good_primes, discrete_log(good_primes, gens, level))
])
an_list_bound = next_prime(primes[-1])
an = [0]*an_list_bound
an[1] = 1
from sage.all import PowerSeriesRing
PS = PowerSeriesRing(K, "q")
for p, ap in zip(primes, aps):
if p.divides(level):
euler_factor = [1, -ap]
else:
euler_factor = [1, -ap, p**(weight - 1) * char_values[p]]
k = RR(an_list_bound).log(p).floor() + 1
foo = (1/PS(euler_factor)).padded_list(k)
for i in range(1, k):
an[p**i] = foo[i]
extend_multiplicatively(an)
return PS(an)
level = 67
weight = 3
poly_data = [1519, 0, 3366, 0, 1725, 0, 357, 0, 32, 0, 1]
# The entries in the following list give a basis for the
# coefficient ring in terms of a root of the defining polynomial above.
# Each line consists of the coefficients of the numerator, and a denominator.
basis_data = [\
[[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1],
[[0, 1, 0, 0, 0, 0, 0, 0, 0, 0], 1],
[[-311, 0, -375, 0, -150, 0, -23, 0, -1, 0], 80],
[[0, 951, 0, 455, 0, 150, 0, 23, 0, 1], 80],
[[-291, 0, -615, 0, -222, 0, -27, 0, -1, 0], 16],
[[1123, 0, 1765, 0, 630, 0, 79, 0, 3, 0], 40],
[[0, -1163, 0, -1765, 0, -630, 0, -79, 0, -3], 40],
[[0, -247, 0, -910, 0, -380, 0, -51, 0, -2], 10],
[[0, 347, 0, 920, 0, 380, 0, 51, 0, 2], 10],
[[2551, 0, 5445, 0, 2150, 0, 283, 0, 11, 0], 40]]
hecke_ring_character_values = [\
[2, [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]
aps_data = [\
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, -1, 0, 0, 0],
[0, 0, 0, -1, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 0, -1, 0],
[0, 1, 0, 1, 0, 0, 1, -1, 0, 0],
[0, -2, 0, 1, 0, 0, 1, 0, 1, 0],
[9, 0, 3, 0, 0, 1, 0, 0, 0, -3],
[5, 0, -1, 0, 5, 0, 0, 0, 0, 5],
[2, 0, -1, 0, -5, 3, 0, 0, 0, 1],
[2, 0, -4, 0, -4, -3, 0, 0, 0, -5],
[0, -6, 0, 4, 0, 0, 4, 1, 0, 0],
[-9, 0, -3, 0, 5, -11, 0, 0, 0, -2],
[0, 1, 0, -4, 0, 0, 6, -1, -5, 0],
[0, -1, 0, 3, 0, 0, 8, 2, 5, 0],
[-29, 0, 7, 0, -10, -1, 0, 0, 0, -2],
[0, -7, 0, 2, 0, 0, -3, -2, -1, 0],
[-34, 0, -4, 0, -2, 6, 0, 0, 0, 8],
[0, -16, 0, -6, 0, 0, -1, 1, 0, 0],
[9, 7, -7, -4, -15, 1, -8, 3, 0, 2],
[17, 0, -7, 0, 0, -22, 0, 0, 0, -4],
[-46, 0, -2, 0, 5, 16, 0, 0, 0, 12],
[0, -21, 0, 4, 0, 0, -6, 1, -5, 0],
[-21, 0, 13, 0, 5, -4, 0, 0, 0, 17],
[-48, 0, 1, 0, 31, 1, 0, 0, 0, 5],
[0, -16, 0, -2, 0, 0, -22, -3, 0, 0],
[0, 42, 0, 2, 0, 0, 27, -2, 0, 0],
[11, 0, 12, 0, 0, 19, 0, 0, 0, -32],
[-32, 0, -4, 0, -10, -3, 0, 0, 0, -21],
[0, 21, 0, 1, 0, 0, -14, 4, 5, 0],
[0, 25, 0, -10, 0, 0, -16, 0, 5, 0],
[-52, 0, -4, 0, -15, -8, 0, 0, 0, 9],
[18, 0, -22, 0, 36, 21, 0, 0, 0, 13],
[0, -16, 0, 2, 0, 0, -18, 9, 6, 0],
[0, -28, 0, 12, 0, 0, 22, -7, 0, 0],
[-25, 0, 9, 0, -17, -28, 0, 0, 0, -35],
[-66, 0, 2, 0, -17, -7, 0, 0, 0, 17],
[-19, 0, -33, 0, 15, -1, 0, 0, 0, 8],
[-9, 0, -13, 0, 5, 14, 0, 0, 0, -27],
[4, 0, 18, 0, -5, 26, 0, 0, 0, 2],
[-5, 0, -15, 0, -75, -20, 0, 0, 0, -15],
[0, 41, 0, -4, 0, 0, -9, -1, -5, 0],
[-3, 0, -17, 0, -17, 50, 0, 0, 0, -9],
[0, -26, 0, 4, 0, 0, -36, 11, 20, 0],
[-25, 0, 40, 0, 10, -10, 0, 0, 0, -35],
[0, -7, 0, 3, 0, 0, 27, 7, 0, 0],
[-4, 0, -26, 0, 21, -13, 0, 0, 0, 52],
[65, 0, -3, 0, 1, 23, 0, 0, 0, 14],
[37, 0, -21, 0, -40, 13, 0, 0, 0, 11],
[55, 0, 35, 0, 25, 45, 0, 0, 0, -50],
[0, -67, 0, 8, 0, 0, -32, -3, -15, 0],
[0, 40, 0, -16, 0, 0, -26, -4, -6, 0],
[0, 75, 0, -30, 0, 0, -20, 10, 5, 0],
[15, 0, 17, 0, 26, 3, 0, 0, 0, 44],
[0, -6, 0, 39, 0, 0, 44, 1, -10, 0],
[94, 0, -12, 0, 65, -29, 0, 0, 0, 37],
[133, 0, 56, 0, 0, -8, 0, 0, 0, -31],
[-27, 0, -17, 0, 61, 25, 0, 0, 0, -2],
[0, -24, 0, -44, 0, 0, 16, -1, -20, 0],
[-30, 0, 0, 0, -40, 20, 0, 0, 0, -10],
[0, -75, 0, -20, 0, 0, -10, -10, 15, 0],
[76, 0, 62, 0, 40, -61, 0, 0, 0, 23],
[-2, 0, 6, 0, -70, -53, 0, 0, 0, -11],
[150, 0, 50, 0, 110, 50, 0, 0, 0, 40],
[0, -36, 0, 14, 0, 0, -6, 16, 20, 0],
[0, -17, 0, -14, 0, 0, 88, 12, 5, 0],
[48, 0, -14, 0, 70, -43, 0, 0, 0, 59],
[0, -36, 0, -21, 0, 0, -16, 1, 0, 0],
[0, 25, 0, 30, 0, 0, -36, 25, 35, 0],
[0, 16, 0, -25, 0, 0, 50, 10, -26, 0],
[218, 0, -12, 0, -74, -34, 0, 0, 0, -62],
[0, 85, 0, 8, 0, 0, 18, -7, -9, 0],
[78, 0, 48, 0, 76, 36, 0, 0, 0, 88],
[0, 92, 0, -34, 0, 0, 26, -16, -20, 0],
[0, 52, 0, 27, 0, 0, 21, -27, -5, 0],
[0, -97, 0, 33, 0, 0, -57, 22, 40, 0],
[0, -55, 0, -16, 0, 0, -26, 6, -35, 0],
[320, 0, -6, 0, -10, -40, 0, 0, 0, 0],
[49, 0, 43, 0, 55, 111, 0, 0, 0, 42],
[0, -47, 0, 38, 0, 0, 58, -8, 45, 0],
[0, 32, 0, -18, 0, 0, -38, -42, 10, 0],
[-216, 0, -38, 0, 100, -74, 0, 0, 0, 2],
[-219, 0, -11, 0, -49, 32, 0, 0, 0, -33],
[-216, 0, 0, 0, -89, -21, 0, 0, 0, 1],
[0, -15, 0, 14, 0, 0, -46, 36, 9, 0],
[-115, 0, -38, 0, 6, -41, 0, 0, 0, -26],
[0, -55, 0, 9, 0, 0, -51, -9, 20, 0],
[-128, 0, 6, 0, 11, 117, 0, 0, 0, 10],
[353, 0, 61, 0, 0, 2, 0, 0, 0, -66],
[1, 0, -99, 0, -137, -39, 0, 0, 0, 18],
[0, 135, 0, 40, 0, 0, 74, -10, -15, 0],
[48, 0, 66, 0, -10, -123, 0, 0, 0, -91],
[-24, 0, -22, 0, -115, -104, 0, 0, 0, 12],
[0, -10, 0, -70, 0, 0, -26, -15, -20, 0],
[52, 0, 98, 0, 140, 93, 0, 0, 0, -49],
[0, -29, 0, -64, 0, 0, 41, -16, -45, 0],
[0, 8, 0, -32, 0, 0, -8, -33, 0, 0],
[78, 0, 80, 0, 0, -88, 0, 0, 0, 44],
[0, -78, 0, -18, 0, 0, 2, -12, -20, 0],
[29, 0, -107, 0, 55, -99, 0, 0, 0, -58],
[0, 41, 0, -39, 0, 0, -29, -16, 20, 0],
[0, -13, 0, -15, 0, 0, 120, -4, 21, 0],
[325, 0, -75, 0, 175, 50, 0, 0, 0, 135],
[0, 21, 0, 15, 0, 0, -35, 30, 24, 0],
[-256, 0, 35, 0, -59, 4, 0, 0, 0, -54],
[217, 0, -89, 0, -169, 52, 0, 0, 0, 25],
[0, 70, 0, -16, 0, 0, -126, 21, 14, 0],
[0, 128, 0, 52, 0, 0, -53, -7, -30, 0],
[0, -148, 0, -28, 0, 0, -54, -2, -40, 0],
[0, -154, 0, -14, 0, 0, 36, 24, -30, 0],
[216, 0, 171, 0, 113, 26, 0, 0, 0, -32],
[265, 0, 135, 0, 130, 150, 0, 0, 0, 65],
[24, 0, 8, 0, -50, -189, 0, 0, 0, -23],
[-187, 0, 81, 0, -35, 197, 0, 0, 0, -36],
[414, 0, 60, 0, 86, 124, 0, 0, 0, 66],
[0, 27, 0, 42, 0, 0, 22, 28, 15, 0],
[0, 82, 0, 112, 0, 0, 82, -47, 20, 0],
[-505, 0, -85, 0, -75, 110, 0, 0, 0, 65],
[0, 114, 0, -88, 0, 0, -28, 24, 26, 0],
[0, -40, 0, -16, 0, 0, 24, 56, -10, 0],
[368, 0, 12, 0, -60, 9, 0, 0, 0, -177],
[0, 233, 0, -82, 0, 0, -27, -8, -25, 0],
[0, -199, 0, 4, 0, 0, 76, -31, -35, 0],
[0, 15, 0, 39, 0, 0, -21, 71, 50, 0],
[0, 141, 0, -21, 0, 0, -34, -21, -35, 0],
[178, 0, -22, 0, -44, -4, 0, 0, 0, 18],
[0, 250, 0, -20, 0, 0, 120, -10, -60, 0],
[-194, 0, 36, 0, 8, 16, 0, 0, 0, -112],
[-299, 0, -159, 0, -50, -126, 0, 0, 0, 58],
[0, -78, 0, -8, 0, 0, -144, -22, 10, 0],
[0, -208, 0, 1, 0, 0, 86, -1, 54, 0],
[0, 84, 0, 4, 0, 0, -71, -9, -70, 0],
[-618, 0, 34, 0, 135, 113, 0, 0, 0, 61],
[92, 0, -157, 0, -185, 3, 0, 0, 0, -129],
[0, -120, 0, -25, 0, 0, -36, 20, 40, 0],
[242, 0, -152, 0, -140, -22, 0, 0, 0, 46],
[0, 26, 0, -64, 0, 0, -34, -21, 50, 0],
[176, 0, 42, 0, -130, 99, 0, 0, 0, -197],
[0, 251, 0, 19, 0, 0, 151, -31, 40, 0],
[-225, 0, 5, 0, 65, -80, 0, 0, 0, -95],
[0, 191, 0, -74, 0, 0, 96, -21, 35, 0],
[0, 91, 0, -24, 0, 0, 31, -66, -105, 0],
[-124, 0, 34, 0, 36, 57, 0, 0, 0, 207],
[191, 0, -23, 0, 10, -156, 0, 0, 0, -147],
[310, 0, -90, 0, -30, -80, 0, 0, 0, -170],
[-306, 0, 90, 0, 206, -95, 0, 0, 0, 31],
[-146, 0, 65, 0, 221, 130, 0, 0, 0, -54],
[33, 0, -89, 0, 105, -28, 0, 0, 0, 109],
[0, 168, 0, 66, 0, 0, 146, -35, -74, 0],
[-15, 0, 49, 0, -137, -108, 0, 0, 0, 55],
[195, 0, 115, 0, -45, 65, 0, 0, 0, -50],
[-68, 0, 154, 0, 320, 13, 0, 0, 0, 231],
[278, 0, -115, 0, -65, 187, 0, 0, 0, 169],
[0, -209, 0, 159, 0, 0, -1, 37, 56, 0],
[-255, 0, -175, 0, -20, -60, 0, 0, 0, -50],
[-335, 0, -95, 0, -145, -110, 0, 0, 0, 225],
[-73, 0, 160, 0, -200, -30, 0, 0, 0, -35],
[0, 2, 0, 32, 0, 0, 122, -7, -70, 0],
[0, -10, 0, 30, 0, 0, -40, -35, -80, 0],
[0, -156, 0, 82, 0, 0, -148, -11, 26, 0],
[0, -210, 0, 120, 0, 0, 90, -5, 130, 0],
[547, 0, 49, 0, 225, -67, 0, 0, 0, 106],
[-84, 0, -78, 0, -95, 239, 0, 0, 0, -57],
[-701, 0, -97, 0, -130, -84, 0, 0, 0, 32],
[-516, 0, 110, 0, -154, 45, 0, 0, 0, 41],
[-92, 0, -104, 0, -20, -213, 0, 0, 0, 79],
[0, -228, 0, -24, 0, 0, -214, -11, -66, 0],
[0, -275, 0, -50, 0, 0, -270, 35, 65, 0],
[-668, 0, 104, 0, -60, 223, 0, 0, 0, -59]]