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
25
Miscellaneous code related to rational modular forms, until I find a
26
better place to put it.
27
28
WARNING: Depend on this code at your own risk! It will get moved to
29
another module at some point, probably.
30
31
"""
32
33
34
def modular_symbols_from_curve(C, N, num_factors=3):
35
"""
36
Find the modular symbols spaces that shoudl correspond to the
37
Jacobian of the given hyperelliptic curve, up to the number of
38
factors we consider.
39
40
INPUT:
41
- C -- a hyperelliptic curve over QQ
42
- N -- a positive integer
43
- num_factors -- number of Euler factors to verify match up; this is
44
important, because if, e.g., there is only one factor of degree g(C), we
45
don't want to just immediately conclude that Jac(C) = A_f.
46
47
OUTPUT:
48
- list of all sign 1 simple modular symbols factor of level N
49
that correspond to a simple modular abelian A_f
50
that is isogenous to Jac(C).
51
52
EXAMPLES::
53
54
sage: from psage.modform.rational.unfiled import modular_symbols_from_curve
55
56
sage: R.<x> = ZZ[]
57
sage: f = x^7+4*x^6+5*x^5+x^4-3*x^3-2*x^2+1
58
sage: C1 = HyperellipticCurve(f)
59
sage: modular_symbols_from_curve(C1, 284)
60
[Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 39 for Gamma_0(284) of weight 2 with sign 1 over Rational Field]
61
62
sage: f = x^7-7*x^5-11*x^4+5*x^3+18*x^2+4*x-11
63
sage: C2 = HyperellipticCurve(f)
64
sage: modular_symbols_from_curve(C2, 284)
65
[Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 39 for Gamma_0(284) of weight 2 with sign 1 over Rational Field]
66
"""
67
# We will use the Eichler-Shimura relation and David Harvey's
68
# p-adic point counting hypellfrob. Harvey's code has the
69
# constraint: p > (2*g + 1)*(2*prec - 1).
70
# So, find the smallest p not dividing N that satisfies the
71
# above constraint, for our given choice of prec.
72
73
f, f2 = C.hyperelliptic_polynomials()
74
if f2 != 0:
75
raise NotImplementedError, "curve must be of the form y^2 = f(x)"
76
if f.degree() % 2 == 0:
77
raise NotImplementedError, "curve must be of the form y^2 = f(x) with f(x) odd"
78
79
prec = 1
80
81
g = C.genus()
82
B = (2*g + 1)*(2*prec - 1)
83
84
from sage.rings.all import next_prime
85
p = B
86
87
# We use that if F(X) is the characteristic polynomial of the
88
# Hecke operator T_p, then X^g*F(X+p/X) is the characteristic
89
# polynomial of Frob_p, because T_p = Frob_p + p/Frob_p, according
90
# to Eichler-Shimura. Use this to narrow down the factors.
91
92
from sage.all import ModularSymbols, Integers, get_verbose
93
D = ModularSymbols(N,sign=1).cuspidal_subspace().new_subspace().decomposition()
94
D = [A for A in D if A.dimension() == g]
95
96
from sage.schemes.hyperelliptic_curves.hypellfrob import hypellfrob
97
98
while num_factors > 0:
99
p = next_prime(p)
100
while N % p == 0: p = next_prime(p)
101
102
R = Integers(p**prec)['X']
103
X = R.gen()
104
D2 = []
105
# Compute the charpoly of Frobenius using hypellfrob
106
M = hypellfrob(p, 1, f)
107
H = R(M.charpoly())
108
109
for A in D:
110
F = R(A.hecke_polynomial(p))
111
# Compute charpoly of Frobenius from F(X)
112
G = R(F.parent()(X**g * F(X + p/X)))
113
if get_verbose(): print (p, G, H)
114
if G == H:
115
D2.append(A)
116
D = D2
117
num_factors -= 1
118
119
return D
120
121
122