passagemath-eclib 10.6.42__cp313-cp313-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_eclib/__init__.py +3 -0
- passagemath_eclib-10.6.42.dist-info/METADATA +161 -0
- passagemath_eclib-10.6.42.dist-info/RECORD +35 -0
- passagemath_eclib-10.6.42.dist-info/WHEEL +5 -0
- passagemath_eclib-10.6.42.dist-info/top_level.txt +3 -0
- passagemath_eclib.libs/libec-7d1d8090.so.14.1.0 +0 -0
- passagemath_eclib.libs/libflint-edf7fb90.so.22.0.0 +0 -0
- passagemath_eclib.libs/libgcc_s-2d945d6c.so.1 +0 -0
- passagemath_eclib.libs/libgf2x-e54d5509.so.3.0.0 +0 -0
- passagemath_eclib.libs/libgmp-28992bcb.so.10.5.0 +0 -0
- passagemath_eclib.libs/libmpfr-1fc8ea36.so.6.2.2 +0 -0
- passagemath_eclib.libs/libntl-21cb123c.so.45.0.0 +0 -0
- passagemath_eclib.libs/libpari-gmp-tls-f714c61d.so.2.17.2 +0 -0
- passagemath_eclib.libs/libstdc++-85f2cd6d.so.6.0.33 +0 -0
- sage/all__sagemath_eclib.py +17 -0
- sage/interfaces/all__sagemath_eclib.py +1 -0
- sage/interfaces/mwrank.py +370 -0
- sage/libs/all__sagemath_eclib.py +11 -0
- sage/libs/eclib/__init__.pxd +158 -0
- sage/libs/eclib/__init__.py +1 -0
- sage/libs/eclib/all.py +5 -0
- sage/libs/eclib/constructor.py +75 -0
- sage/libs/eclib/homspace.cpython-313-aarch64-linux-musl.so +0 -0
- sage/libs/eclib/homspace.pxd +5 -0
- sage/libs/eclib/homspace.pyx +285 -0
- sage/libs/eclib/interface.py +1329 -0
- sage/libs/eclib/mat.cpython-313-aarch64-linux-musl.so +0 -0
- sage/libs/eclib/mat.pxd +8 -0
- sage/libs/eclib/mat.pyx +247 -0
- sage/libs/eclib/mwrank.cpython-313-aarch64-linux-musl.so +0 -0
- sage/libs/eclib/mwrank.pyx +1327 -0
- sage/libs/eclib/newforms.cpython-313-aarch64-linux-musl.so +0 -0
- sage/libs/eclib/newforms.pxd +8 -0
- sage/libs/eclib/newforms.pyx +394 -0
- sage_wheels/bin/mwrank +0 -0
|
Binary file
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-eclib
|
|
2
|
+
"""
|
|
3
|
+
Modular symbols using eclib newforms
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ****************************************************************************
|
|
7
|
+
# Copyright (C) 2008 Tom Boothby <boothby@u.washington.edu>
|
|
8
|
+
#
|
|
9
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
10
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
11
|
+
# the License, or (at your option) any later version.
|
|
12
|
+
# https://www.gnu.org/licenses/
|
|
13
|
+
# ****************************************************************************
|
|
14
|
+
|
|
15
|
+
from cysignals.signals cimport sig_on, sig_off
|
|
16
|
+
|
|
17
|
+
from sage.libs.eclib cimport *
|
|
18
|
+
from sage.libs.gmp.mpq cimport mpq_numref
|
|
19
|
+
from sage.libs.ntl.convert cimport mpz_to_ZZ
|
|
20
|
+
from sage.rings.rational_field import QQ
|
|
21
|
+
from sage.rings.rational cimport Rational
|
|
22
|
+
from sage.modular.all import Cusp
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
cdef class ECModularSymbol:
|
|
26
|
+
r"""
|
|
27
|
+
Modular symbol associated with an elliptic curve, using John Cremona's newforms class.
|
|
28
|
+
|
|
29
|
+
EXAMPLES::
|
|
30
|
+
|
|
31
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
32
|
+
sage: E = EllipticCurve('11a')
|
|
33
|
+
sage: M = ECModularSymbol(E,1); M
|
|
34
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
|
|
35
|
+
|
|
36
|
+
By default, symbols are based at the cusp `\infty`, i.e. we evaluate `\{\infty,r\}`::
|
|
37
|
+
|
|
38
|
+
sage: [M(1/i) for i in range(1,11)]
|
|
39
|
+
[2/5, -8/5, -3/5, 7/5, 12/5, 12/5, 7/5, -3/5, -8/5, 2/5]
|
|
40
|
+
|
|
41
|
+
We can also switch the base point to the cusp `0`::
|
|
42
|
+
|
|
43
|
+
sage: [M(1/i, base_at_infinity=False) for i in range(1,11)]
|
|
44
|
+
[0, -2, -1, 1, 2, 2, 1, -1, -2, 0]
|
|
45
|
+
|
|
46
|
+
For the minus symbols this makes no difference since
|
|
47
|
+
`\{0,\infty\}` is in the plus space. Note that to evaluate minus
|
|
48
|
+
symbols the space must be defined with sign 0, which makes both
|
|
49
|
+
signs available::
|
|
50
|
+
|
|
51
|
+
sage: M = ECModularSymbol(E,0); M
|
|
52
|
+
Modular symbol with sign 0 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
|
|
53
|
+
sage: [M(1/i, -1) for i in range(1,11)]
|
|
54
|
+
[0, 0, 1, 1, 0, 0, -1, -1, 0, 0]
|
|
55
|
+
sage: [M(1/i, -1, base_at_infinity=False) for i in range(1,11)]
|
|
56
|
+
[0, 0, 1, 1, 0, 0, -1, -1, 0, 0]
|
|
57
|
+
|
|
58
|
+
If the ECModularSymbol is created with sign 0 then as well as
|
|
59
|
+
asking for both + and - symbols, we can also obtain both (as a
|
|
60
|
+
tuple). However it is more work to create the full modular
|
|
61
|
+
symbol space::
|
|
62
|
+
|
|
63
|
+
sage: E = EllipticCurve('11a1')
|
|
64
|
+
sage: M = ECModularSymbol(E,0); M
|
|
65
|
+
Modular symbol with sign 0 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
|
|
66
|
+
sage: [M(1/i) for i in range(2,11)]
|
|
67
|
+
[[-8/5, 0],
|
|
68
|
+
[-3/5, 1],
|
|
69
|
+
[7/5, 1],
|
|
70
|
+
[12/5, 0],
|
|
71
|
+
[12/5, 0],
|
|
72
|
+
[7/5, -1],
|
|
73
|
+
[-3/5, -1],
|
|
74
|
+
[-8/5, 0],
|
|
75
|
+
[2/5, 0]]
|
|
76
|
+
|
|
77
|
+
The curve is automatically converted to its minimal model::
|
|
78
|
+
|
|
79
|
+
sage: E = EllipticCurve([0,0,0,0,1/4])
|
|
80
|
+
sage: ECModularSymbol(E)
|
|
81
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 over Rational Field
|
|
82
|
+
|
|
83
|
+
Non-optimal curves are handled correctly in eclib, by comparing the ratios of real and/or imaginary periods::
|
|
84
|
+
|
|
85
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
86
|
+
sage: E1 = EllipticCurve('11a1') # optimal
|
|
87
|
+
sage: E1.period_lattice().basis()
|
|
88
|
+
(1.26920930427955, 0.634604652139777 + 1.45881661693850*I)
|
|
89
|
+
sage: M1 = ECModularSymbol(E1,0)
|
|
90
|
+
sage: M1(0)
|
|
91
|
+
[2/5, 0]
|
|
92
|
+
sage: M1(1/3)
|
|
93
|
+
[-3/5, 1]
|
|
94
|
+
|
|
95
|
+
One non-optimal curve has real period 1/5 that of the optimal one, so plus symbols scale up by a factor of 5 while minus symbols are unchanged::
|
|
96
|
+
|
|
97
|
+
sage: E2 = EllipticCurve('11a2') # not optimal
|
|
98
|
+
sage: E2.period_lattice().basis()
|
|
99
|
+
(0.253841860855911, 0.126920930427955 + 1.45881661693850*I)
|
|
100
|
+
sage: M2 = ECModularSymbol(E2,0)
|
|
101
|
+
sage: M2(0)
|
|
102
|
+
[2, 0]
|
|
103
|
+
sage: M2(1/3)
|
|
104
|
+
[-3, 1]
|
|
105
|
+
sage: all((M2(r,1)==5*M1(r,1)) for r in QQ.range_by_height(10))
|
|
106
|
+
True
|
|
107
|
+
sage: all((M2(r,-1)==M1(r,-1)) for r in QQ.range_by_height(10))
|
|
108
|
+
True
|
|
109
|
+
|
|
110
|
+
The other non-optimal curve has real period 5 times that of the optimal one, so plus symbols scale down by a factor of 5; again, minus symbols are unchanged::
|
|
111
|
+
|
|
112
|
+
sage: E3 = EllipticCurve('11a3') # not optimal
|
|
113
|
+
sage: E3.period_lattice().basis()
|
|
114
|
+
(6.34604652139777, 3.17302326069888 + 1.45881661693850*I)
|
|
115
|
+
sage: M3 = ECModularSymbol(E3,0)
|
|
116
|
+
sage: M3(0)
|
|
117
|
+
[2/25, 0]
|
|
118
|
+
sage: M3(1/3)
|
|
119
|
+
[-3/25, 1]
|
|
120
|
+
sage: all((5*M3(r,1)==M1(r,1)) for r in QQ.range_by_height(10))
|
|
121
|
+
True
|
|
122
|
+
sage: all((M3(r,-1)==M1(r,-1)) for r in QQ.range_by_height(10))
|
|
123
|
+
True
|
|
124
|
+
|
|
125
|
+
TESTS::
|
|
126
|
+
|
|
127
|
+
sage: ECModularSymbol.__new__(ECModularSymbol)
|
|
128
|
+
Modular symbol with sign 0 over Rational Field attached to None
|
|
129
|
+
"""
|
|
130
|
+
def __init__(self, E, sign=1, nap=1000):
|
|
131
|
+
"""
|
|
132
|
+
Construct the modular symbol object from an elliptic curve.
|
|
133
|
+
|
|
134
|
+
INPUT:
|
|
135
|
+
|
|
136
|
+
- ``E``- an elliptic curve defined over Q.
|
|
137
|
+
|
|
138
|
+
- ``sign`` -- integer; 0 or +1. If +1, only plus modular symbols
|
|
139
|
+
of this sign are available. If 0, modular symbols of both
|
|
140
|
+
signs are available but the construction is more expensive.
|
|
141
|
+
|
|
142
|
+
- ``nap`` -- integer (default: 1000); the number of ap of E to use
|
|
143
|
+
in determining the normalisation of the modular symbols.
|
|
144
|
+
Note that eclib will increase this to 100*sqrt(N) if necessary.
|
|
145
|
+
|
|
146
|
+
EXAMPLES::
|
|
147
|
+
|
|
148
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
149
|
+
sage: E = EllipticCurve('11a')
|
|
150
|
+
sage: M = ECModularSymbol(E, +1)
|
|
151
|
+
sage: M
|
|
152
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
|
|
153
|
+
sage: E = EllipticCurve('37a')
|
|
154
|
+
sage: M = ECModularSymbol(E, -1)
|
|
155
|
+
Traceback (most recent call last):
|
|
156
|
+
...
|
|
157
|
+
ValueError: ECModularSymbol can only be created with signs +1 or 0, not -1
|
|
158
|
+
sage: E = EllipticCurve('389a')
|
|
159
|
+
sage: M = ECModularSymbol(E, 0)
|
|
160
|
+
sage: M
|
|
161
|
+
Modular symbol with sign 0 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
|
|
162
|
+
|
|
163
|
+
TESTS:
|
|
164
|
+
|
|
165
|
+
This one is from :issue:`8042`::
|
|
166
|
+
|
|
167
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
168
|
+
sage: E = EllipticCurve('858k2')
|
|
169
|
+
sage: ECModularSymbol(E)
|
|
170
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + x*y = x^3 + 16353089*x - 335543012233 over Rational Field
|
|
171
|
+
|
|
172
|
+
We allow a-invariants which are larger than 64 bits
|
|
173
|
+
(:issue:`16977`)::
|
|
174
|
+
|
|
175
|
+
sage: E = EllipticCurve([-25194941007454971, -1539281792450963687794218]) # non-minimal model of 21758k3
|
|
176
|
+
sage: ECModularSymbol(E) # long time
|
|
177
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + x*y = x^3 - 19440540900814*x - 32992152521343165084 over Rational Field
|
|
178
|
+
|
|
179
|
+
The curve needs to be defined over the rationals::
|
|
180
|
+
|
|
181
|
+
sage: K.<i> = QuadraticField(-1)
|
|
182
|
+
sage: E = EllipticCurve(K, [0,0,0,0,1])
|
|
183
|
+
sage: ECModularSymbol(E)
|
|
184
|
+
Traceback (most recent call last):
|
|
185
|
+
...
|
|
186
|
+
TypeError: the elliptic curve must have coefficients in the rational numbers
|
|
187
|
+
"""
|
|
188
|
+
cdef ZZ_c a1, a2, a3, a4, a6, N
|
|
189
|
+
cdef Curve C
|
|
190
|
+
cdef Curvedata CD
|
|
191
|
+
cdef CurveRed CR
|
|
192
|
+
cdef int n
|
|
193
|
+
|
|
194
|
+
if E.base_field() is not QQ:
|
|
195
|
+
raise TypeError("the elliptic curve must have coefficients in the rational numbers")
|
|
196
|
+
|
|
197
|
+
E = E.minimal_model()
|
|
198
|
+
self._E = E
|
|
199
|
+
|
|
200
|
+
# The a invariants are rational numbers with denominator 1
|
|
201
|
+
mpz_to_ZZ(&a1, mpq_numref((<Rational>(E.a1())).value))
|
|
202
|
+
mpz_to_ZZ(&a2, mpq_numref((<Rational>(E.a2())).value))
|
|
203
|
+
mpz_to_ZZ(&a3, mpq_numref((<Rational>(E.a3())).value))
|
|
204
|
+
mpz_to_ZZ(&a4, mpq_numref((<Rational>(E.a4())).value))
|
|
205
|
+
mpz_to_ZZ(&a6, mpq_numref((<Rational>(E.a6())).value))
|
|
206
|
+
|
|
207
|
+
sig_on()
|
|
208
|
+
C = Curve(a1,a2,a3,a4,a6)
|
|
209
|
+
CD = Curvedata(C,0)
|
|
210
|
+
CR = CurveRed(CD)
|
|
211
|
+
N = getconductor(CR)
|
|
212
|
+
n = I2int(N)
|
|
213
|
+
self.n = n
|
|
214
|
+
if not (sign == 0 or sign == 1):
|
|
215
|
+
sig_off()
|
|
216
|
+
raise ValueError("ECModularSymbol can only be created with signs +1 or 0, not {}".format(sign))
|
|
217
|
+
self.sign = sign
|
|
218
|
+
|
|
219
|
+
self.nfs = new newforms(n, 0)
|
|
220
|
+
self.nfs.createfromcurve(sign, CR, nap)
|
|
221
|
+
sig_off()
|
|
222
|
+
|
|
223
|
+
def __dealloc__(self):
|
|
224
|
+
del self.nfs
|
|
225
|
+
|
|
226
|
+
def __repr__(self):
|
|
227
|
+
"""
|
|
228
|
+
TESTS::
|
|
229
|
+
|
|
230
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
231
|
+
sage: E = EllipticCurve('11a')
|
|
232
|
+
sage: M = ECModularSymbol(E); M
|
|
233
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
|
|
234
|
+
sage: E = EllipticCurve('37a')
|
|
235
|
+
sage: M = ECModularSymbol(E, 1); M
|
|
236
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
|
|
237
|
+
sage: E = EllipticCurve('389a')
|
|
238
|
+
sage: M = ECModularSymbol(E, 0); M
|
|
239
|
+
Modular symbol with sign 0 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
|
|
240
|
+
"""
|
|
241
|
+
return "Modular symbol with sign %s over Rational Field attached to %s" % (self.sign, self._E)
|
|
242
|
+
|
|
243
|
+
def __call__(self, r, sign=None, base_at_infinity=True):
|
|
244
|
+
r"""
|
|
245
|
+
Compute the value of ``self`` on `\{0,r\}` or `\{\infty, r\}` for
|
|
246
|
+
rational `r`.
|
|
247
|
+
|
|
248
|
+
INPUT:
|
|
249
|
+
|
|
250
|
+
- ``r`` -- rational; a rational number
|
|
251
|
+
|
|
252
|
+
- ``sign`` -- integer; either +1, -1 or 0. If the sign of the
|
|
253
|
+
space is +1, only sign +1 is allowed. Default: ``self.sign``, or +1
|
|
254
|
+
when ``self.sign==0``.
|
|
255
|
+
|
|
256
|
+
- ``base_at_infinity`` -- boolean; if ``True``, evaluates
|
|
257
|
+
`\{\infty, r\}`. Otherwise (default) evaluates `\{0,r\}`.
|
|
258
|
+
|
|
259
|
+
OUTPUT:
|
|
260
|
+
|
|
261
|
+
If sign=+1, the rational value of the plus modular symbol is
|
|
262
|
+
returned. If sign=-1, the rational value of the minus modular
|
|
263
|
+
symbol is returned. If sign=0, a tuple of both the plus and
|
|
264
|
+
minus modular symbols is returned. In the last two cases, the
|
|
265
|
+
space must have sign 0 or an error will be raised.
|
|
266
|
+
|
|
267
|
+
EXAMPLES::
|
|
268
|
+
|
|
269
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
270
|
+
sage: E = EllipticCurve('11a')
|
|
271
|
+
sage: M = ECModularSymbol(E)
|
|
272
|
+
sage: [M(1/i) for i in range(1,11)]
|
|
273
|
+
[2/5, -8/5, -3/5, 7/5, 12/5, 12/5, 7/5, -3/5, -8/5, 2/5]
|
|
274
|
+
sage: [M(1/i, base_at_infinity=False) for i in range(1,11)]
|
|
275
|
+
[0, -2, -1, 1, 2, 2, 1, -1, -2, 0]
|
|
276
|
+
sage: E = EllipticCurve('37a')
|
|
277
|
+
sage: M = ECModularSymbol(E)
|
|
278
|
+
sage: [M(1/i) for i in range(1,11)]
|
|
279
|
+
[0, 0, 0, 0, 1, 0, 1, 1, 0, 0]
|
|
280
|
+
sage: E = EllipticCurve('389a')
|
|
281
|
+
sage: M = ECModularSymbol(E)
|
|
282
|
+
sage: [M(1/i) for i in range(1,11)]
|
|
283
|
+
[0, 0, 0, 0, 2, 0, 1, 0, -1, 0]
|
|
284
|
+
|
|
285
|
+
When the class is created with sign 0 we can ask for +1 or -1 symbols or (by default) both::
|
|
286
|
+
|
|
287
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
288
|
+
sage: E = EllipticCurve('11a1')
|
|
289
|
+
sage: M = ECModularSymbol(E,0)
|
|
290
|
+
sage: [M(1/i, 1) for i in range(2,11)]
|
|
291
|
+
[-8/5, -3/5, 7/5, 12/5, 12/5, 7/5, -3/5, -8/5, 2/5]
|
|
292
|
+
sage: [M(1/i, -1) for i in range(2,11)]
|
|
293
|
+
[0, 1, 1, 0, 0, -1, -1, 0, 0]
|
|
294
|
+
sage: [M(1/i) for i in range(2,11)]
|
|
295
|
+
[[-8/5, 0],
|
|
296
|
+
[-3/5, 1],
|
|
297
|
+
[7/5, 1],
|
|
298
|
+
[12/5, 0],
|
|
299
|
+
[12/5, 0],
|
|
300
|
+
[7/5, -1],
|
|
301
|
+
[-3/5, -1],
|
|
302
|
+
[-8/5, 0],
|
|
303
|
+
[2/5, 0]]
|
|
304
|
+
|
|
305
|
+
When the class is created with sign +1 we can only ask for +1 symbols::
|
|
306
|
+
|
|
307
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
308
|
+
sage: E = EllipticCurve('11a1')
|
|
309
|
+
sage: M = ECModularSymbol(E)
|
|
310
|
+
sage: M
|
|
311
|
+
Modular symbol with sign 1 over Rational Field attached to Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
|
|
312
|
+
sage: M(0)
|
|
313
|
+
2/5
|
|
314
|
+
sage: M(1/3, sign=-1)
|
|
315
|
+
Traceback (most recent call last):
|
|
316
|
+
...
|
|
317
|
+
ValueError: impossible to evaluate a minus symbol on a plus space
|
|
318
|
+
sage: M(2/3, sign=0)
|
|
319
|
+
Traceback (most recent call last):
|
|
320
|
+
...
|
|
321
|
+
ValueError: impossible to evaluate both symbols on a plus space
|
|
322
|
+
|
|
323
|
+
TESTS (see :issue:`11211`)::
|
|
324
|
+
|
|
325
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
326
|
+
sage: E = EllipticCurve('11a')
|
|
327
|
+
sage: M = ECModularSymbol(E)
|
|
328
|
+
sage: M(oo)
|
|
329
|
+
0
|
|
330
|
+
sage: M(oo, base_at_infinity=False)
|
|
331
|
+
-2/5
|
|
332
|
+
sage: M(7/5)
|
|
333
|
+
-13/5
|
|
334
|
+
sage: M("garbage")
|
|
335
|
+
Traceback (most recent call last):
|
|
336
|
+
...
|
|
337
|
+
TypeError: unable to convert 'garbage' to a cusp
|
|
338
|
+
sage: M(7/5)
|
|
339
|
+
-13/5
|
|
340
|
+
"""
|
|
341
|
+
cdef rational _r
|
|
342
|
+
cdef rational _sp, _sm
|
|
343
|
+
cdef pair[rational,rational] _spm
|
|
344
|
+
cdef long n, d
|
|
345
|
+
|
|
346
|
+
r = Cusp(r)
|
|
347
|
+
d = r.denominator()
|
|
348
|
+
n = r.numerator()
|
|
349
|
+
if d != 0:
|
|
350
|
+
n = n % d
|
|
351
|
+
sig_on()
|
|
352
|
+
_r = rational(n, d)
|
|
353
|
+
if sign is None or sign not in [-1, 0, 1]:
|
|
354
|
+
sign = self.sign
|
|
355
|
+
if sign == +1:
|
|
356
|
+
_sp = self.nfs.plus_modular_symbol(_r, 0, int(base_at_infinity))
|
|
357
|
+
elif sign == -1:
|
|
358
|
+
if self.sign != 0:
|
|
359
|
+
sig_off()
|
|
360
|
+
raise ValueError("impossible to evaluate a minus symbol on a plus space")
|
|
361
|
+
else:
|
|
362
|
+
_sm = self.nfs.minus_modular_symbol(_r, 0, int(base_at_infinity))
|
|
363
|
+
else: # sign == 0
|
|
364
|
+
if self.sign != 0:
|
|
365
|
+
sig_off()
|
|
366
|
+
raise ValueError("impossible to evaluate both symbols on a plus space")
|
|
367
|
+
else:
|
|
368
|
+
_spm = self.nfs.full_modular_symbol(_r, 0, int(base_at_infinity))
|
|
369
|
+
_sp = _spm.first
|
|
370
|
+
_sm = _spm.second
|
|
371
|
+
|
|
372
|
+
sig_off()
|
|
373
|
+
|
|
374
|
+
if sign == +1:
|
|
375
|
+
return Rational((rational_num(_sp), rational_den(_sp)))
|
|
376
|
+
elif sign == -1:
|
|
377
|
+
return Rational((rational_num(_sm), rational_den(_sm)))
|
|
378
|
+
else:
|
|
379
|
+
return [Rational((rational_num(_sp), rational_den(_sp))),
|
|
380
|
+
Rational((rational_num(_sm), rational_den(_sm)))]
|
|
381
|
+
|
|
382
|
+
def __reduce__(self):
|
|
383
|
+
"""
|
|
384
|
+
TESTS::
|
|
385
|
+
|
|
386
|
+
sage: from sage.libs.eclib.newforms import ECModularSymbol
|
|
387
|
+
sage: E = EllipticCurve('11a')
|
|
388
|
+
sage: M = ECModularSymbol(E)
|
|
389
|
+
sage: M.__reduce__()
|
|
390
|
+
(<class 'sage.libs.eclib.newforms.ECModularSymbol'>,
|
|
391
|
+
(Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field,
|
|
392
|
+
1))
|
|
393
|
+
"""
|
|
394
|
+
return (ECModularSymbol, (self._E, self.sign))
|
sage_wheels/bin/mwrank
ADDED
|
Binary file
|