passagemath-lcalc 10.6.31rc1__cp311-cp311-macosx_13_0_arm64.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.
Potentially problematic release.
This version of passagemath-lcalc might be problematic. Click here for more details.
- passagemath_lcalc-10.6.31rc1.dist-info/METADATA +92 -0
- passagemath_lcalc-10.6.31rc1.dist-info/RECORD +19 -0
- passagemath_lcalc-10.6.31rc1.dist-info/WHEEL +6 -0
- passagemath_lcalc-10.6.31rc1.dist-info/top_level.txt +2 -0
- passagemath_lcalc.dylibs/libLfunction.2.0.0.dylib +0 -0
- passagemath_lcalc.dylibs/libgf2x.3.dylib +0 -0
- passagemath_lcalc.dylibs/libgmp.10.dylib +0 -0
- passagemath_lcalc.dylibs/libmpfr.6.dylib +0 -0
- passagemath_lcalc.dylibs/libntl.44.dylib +0 -0
- passagemath_lcalc.dylibs/libpari-gmp-tls.dylib +0 -0
- sage/all__sagemath_lcalc.py +2 -0
- sage/lfunctions/all__sagemath_lcalc.py +7 -0
- sage/lfunctions/lcalc.py +413 -0
- sage/libs/all__sagemath_lcalc.py +1 -0
- sage/libs/lcalc/__init__.py +1 -0
- sage/libs/lcalc/lcalc_Lfunction.cpython-311-darwin.so +0 -0
- sage/libs/lcalc/lcalc_Lfunction.pxd +129 -0
- sage/libs/lcalc/lcalc_Lfunction.pyx +982 -0
- sage/libs/lcalc/lcalc_sage.h +66 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: passagemath-lcalc
|
|
3
|
+
Version: 10.6.31rc1
|
|
4
|
+
Summary: passagemath: L-function calculations with lcalc
|
|
5
|
+
Author-email: The Sage Developers <sage-support@googlegroups.com>
|
|
6
|
+
Maintainer: Matthias Köppe, passagemath contributors
|
|
7
|
+
License-Expression: GPL-2.0-or-later
|
|
8
|
+
Project-URL: release notes, https://github.com/passagemath/passagemath/releases
|
|
9
|
+
Project-URL: repo (upstream), https://github.com/sagemath/sage
|
|
10
|
+
Project-URL: repo, https://github.com/passagemath/passagemath
|
|
11
|
+
Project-URL: documentation, https://passagemath.org/docs/latest
|
|
12
|
+
Project-URL: homepage (upstream), https://www.sagemath.org
|
|
13
|
+
Project-URL: discourse, https://passagemath.discourse.group
|
|
14
|
+
Project-URL: tracker (upstream), https://github.com/sagemath/sage/issues
|
|
15
|
+
Project-URL: tracker, https://github.com/passagemath/passagemath/issues
|
|
16
|
+
Classifier: Development Status :: 6 - Mature
|
|
17
|
+
Classifier: Intended Audience :: Education
|
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
|
19
|
+
Classifier: Operating System :: POSIX
|
|
20
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
29
|
+
Requires-Python: <3.14,>=3.10
|
|
30
|
+
Description-Content-Type: text/x-rst
|
|
31
|
+
Requires-Dist: passagemath-objects==10.6.31rc1
|
|
32
|
+
Requires-Dist: passagemath-categories==10.6.31rc1
|
|
33
|
+
Requires-Dist: passagemath-modules==10.6.31rc1
|
|
34
|
+
Requires-Dist: memory_allocator
|
|
35
|
+
Requires-Dist: cysignals<1.12.4; sys_platform == "win32"
|
|
36
|
+
Requires-Dist: cysignals!=1.12.0,>=1.11.2
|
|
37
|
+
Provides-Extra: test
|
|
38
|
+
|
|
39
|
+
============================================================================
|
|
40
|
+
passagemath: L-function calculations with lcalc
|
|
41
|
+
============================================================================
|
|
42
|
+
|
|
43
|
+
`passagemath <https://github.com/passagemath/passagemath>`__ is open
|
|
44
|
+
source mathematical software in Python, released under the GNU General
|
|
45
|
+
Public Licence GPLv2+.
|
|
46
|
+
|
|
47
|
+
It is a fork of `SageMath <https://www.sagemath.org/>`__, which has been
|
|
48
|
+
developed 2005-2025 under the motto “Creating a Viable Open Source
|
|
49
|
+
Alternative to Magma, Maple, Mathematica, and MATLAB”.
|
|
50
|
+
|
|
51
|
+
The passagemath fork uses the motto "Creating a Free Passage Between the
|
|
52
|
+
Scientific Python Ecosystem and Mathematical Software Communities."
|
|
53
|
+
It was created in October 2024 with the following goals:
|
|
54
|
+
|
|
55
|
+
- providing modularized installation with pip,
|
|
56
|
+
- establishing first-class membership in the scientific Python
|
|
57
|
+
ecosystem,
|
|
58
|
+
- giving `clear attribution of upstream
|
|
59
|
+
projects <https://groups.google.com/g/sage-devel/c/6HO1HEtL1Fs/m/G002rPGpAAAJ>`__,
|
|
60
|
+
- providing independently usable Python interfaces to upstream
|
|
61
|
+
libraries,
|
|
62
|
+
- offering `platform portability and integration testing
|
|
63
|
+
services <https://github.com/passagemath/passagemath/issues/704>`__
|
|
64
|
+
to upstream projects,
|
|
65
|
+
- inviting collaborations with upstream projects,
|
|
66
|
+
- `building a professional, respectful, inclusive
|
|
67
|
+
community <https://groups.google.com/g/sage-devel/c/xBzaINHWwUQ>`__,
|
|
68
|
+
- `empowering Sage users to participate in the scientific Python ecosystem
|
|
69
|
+
<https://github.com/passagemath/passagemath/issues/248>`__ by publishing packages,
|
|
70
|
+
- developing a port to `Pyodide <https://pyodide.org/en/stable/>`__ for
|
|
71
|
+
serverless deployment with Javascript,
|
|
72
|
+
- developing a native Windows port.
|
|
73
|
+
|
|
74
|
+
`Full documentation <https://passagemath.org/docs/latest/html/en/index.html>`__ is
|
|
75
|
+
available online.
|
|
76
|
+
|
|
77
|
+
passagemath attempts to support and provides binary wheels suitable for
|
|
78
|
+
all major Linux distributions and recent versions of macOS.
|
|
79
|
+
|
|
80
|
+
Binary wheels for native Windows (x86_64) are are available for a subset of
|
|
81
|
+
the passagemath distributions. Use of the full functionality of passagemath
|
|
82
|
+
on Windows currently requires the use of Windows Subsystem for Linux (WSL)
|
|
83
|
+
or virtualization.
|
|
84
|
+
|
|
85
|
+
The supported Python versions in the passagemath 10.6.x series are 3.10.x-3.13.x.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
About this pip-installable distribution package
|
|
89
|
+
-----------------------------------------------
|
|
90
|
+
|
|
91
|
+
This pip-installable distribution ``passagemath-lcalc`` provides
|
|
92
|
+
an interface to Michael Rubinstein's L-function calculator.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
passagemath_lcalc-10.6.31rc1.dist-info/RECORD,,
|
|
2
|
+
passagemath_lcalc-10.6.31rc1.dist-info/WHEEL,sha256=_2eWE0XUrAnNpxPyXffVnsvXkR9SkDAS3wnEDHyQ9s4,136
|
|
3
|
+
passagemath_lcalc-10.6.31rc1.dist-info/top_level.txt,sha256=Kmzulf9WsphADFQuqgvdy5mvTLDj_V2zkFHU2s3UXos,6
|
|
4
|
+
passagemath_lcalc-10.6.31rc1.dist-info/METADATA,sha256=jJieUmUwbCRyaCF6P0QriJqqcKtENXbgxn-cGNQ7tUQ,4369
|
|
5
|
+
passagemath_lcalc.dylibs/libgf2x.3.dylib,sha256=nb16UZWmpvYh0YMgbx-jLA7SzSwltQ-edWN74AN17wo,137056
|
|
6
|
+
passagemath_lcalc.dylibs/libntl.44.dylib,sha256=8jHzjynRpmMwuhIOq9smjTBkLKbnPVMzakF1E4naKpc,2170096
|
|
7
|
+
passagemath_lcalc.dylibs/libpari-gmp-tls.dylib,sha256=8b_DslZNOGsiLdglj_EmZpYWfLk6TDVaQXQyDQwwWHg,9062448
|
|
8
|
+
passagemath_lcalc.dylibs/libgmp.10.dylib,sha256=DgL3lBxg9OcC_p7PaNkTvNxKG63-zrCIMQ4eEiab3UY,464688
|
|
9
|
+
passagemath_lcalc.dylibs/libmpfr.6.dylib,sha256=UIeJHDY9IKWFhqDYXAn182xRB0aBaHHz_yXjuuX1Ojw,466160
|
|
10
|
+
passagemath_lcalc.dylibs/libLfunction.2.0.0.dylib,sha256=pEVlV8MrcHQhkNNfT2QkVQNZK-SO5KJy0RFMLqIkUy0,979376
|
|
11
|
+
sage/all__sagemath_lcalc.py,sha256=D9iHi3nLdsQCdZPBeiqScQWx038s3f7AAakrOTZp6kE,64
|
|
12
|
+
sage/lfunctions/all__sagemath_lcalc.py,sha256=SoqrpDKr69vZp_s5EhcbUzvMZ1xWT7kGPVFzwriXHdA,155
|
|
13
|
+
sage/lfunctions/lcalc.py,sha256=r8AAsv6jZPEoTB7nr1YJ4l012erjpxUNBLsyZsnEgck,12904
|
|
14
|
+
sage/libs/all__sagemath_lcalc.py,sha256=KQWtVG_LW-OnPa5fWIkPbhXFcSDwkvAILxVmAzMNJyw,44
|
|
15
|
+
sage/libs/lcalc/lcalc_Lfunction.cpython-311-darwin.so,sha256=QEoLWxE2F-2CCsa_wcLS9voAJUfqtFSiZI9B35VDA7w,580768
|
|
16
|
+
sage/libs/lcalc/__init__.py,sha256=KQWtVG_LW-OnPa5fWIkPbhXFcSDwkvAILxVmAzMNJyw,44
|
|
17
|
+
sage/libs/lcalc/lcalc_sage.h,sha256=gcR7C1PK7mt_xFnDKlBjCvmBMfy2O_Om4fTNZ5Xg6Po,1365
|
|
18
|
+
sage/libs/lcalc/lcalc_Lfunction.pyx,sha256=JHuW-AID04L0mUbwIjY7PSqQEgzNklrKd6CyFM0vL9c,37362
|
|
19
|
+
sage/libs/lcalc/lcalc_Lfunction.pxd,sha256=8NThJ5A6o1ASc5Y5pZ6ofA1AjlRM6dX-ypv4imz5MXM,5509
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
sage/lfunctions/lcalc.py
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-lcalc
|
|
2
|
+
r"""
|
|
3
|
+
Rubinstein's `L`-function calculator
|
|
4
|
+
|
|
5
|
+
This interface provides complete
|
|
6
|
+
access to Rubinstein's lcalc calculator with extra PARI
|
|
7
|
+
functionality compiled in
|
|
8
|
+
and is a standard part of Sage.
|
|
9
|
+
|
|
10
|
+
.. NOTE::
|
|
11
|
+
|
|
12
|
+
Each call to ``lcalc`` runs a complete
|
|
13
|
+
``lcalc`` process. On a typical Linux system, this
|
|
14
|
+
entails about 0.3 seconds overhead.
|
|
15
|
+
|
|
16
|
+
AUTHORS:
|
|
17
|
+
|
|
18
|
+
- Michael Rubinstein (2005): released under GPL the C++ program lcalc
|
|
19
|
+
|
|
20
|
+
- William Stein (2006-03-05): wrote Sage interface to lcalc
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
# ######################################################################
|
|
24
|
+
# Copyright (C) 2006 William Stein <wstein@gmail.com>
|
|
25
|
+
#
|
|
26
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
27
|
+
#
|
|
28
|
+
# https://www.gnu.org/licenses/
|
|
29
|
+
# ######################################################################
|
|
30
|
+
|
|
31
|
+
import os
|
|
32
|
+
|
|
33
|
+
from sage.structure.sage_object import SageObject
|
|
34
|
+
from sage.misc.lazy_import import lazy_import
|
|
35
|
+
from sage.misc.pager import pager
|
|
36
|
+
from sage.rings.integer_ring import ZZ
|
|
37
|
+
from sage.rings.rational_field import QQ
|
|
38
|
+
|
|
39
|
+
lazy_import('sage.rings.complex_mpfr', 'ComplexField')
|
|
40
|
+
lazy_import('sage.rings.real_mpfr', 'RealField')
|
|
41
|
+
lazy_import('sage.schemes.elliptic_curves.ell_generic', 'EllipticCurve_generic', as_='EllipticCurve')
|
|
42
|
+
|
|
43
|
+
prec = 32
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class LCalc(SageObject):
|
|
47
|
+
r"""
|
|
48
|
+
Rubinstein's `L`-functions Calculator.
|
|
49
|
+
|
|
50
|
+
Type ``lcalc.[tab]`` for a list of useful commands that
|
|
51
|
+
are implemented using the command line interface, but return
|
|
52
|
+
objects that make sense in Sage. For each command the possible
|
|
53
|
+
inputs for the `L`-function are:
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
- ``"`` -- (default) the Riemann zeta function
|
|
57
|
+
|
|
58
|
+
- ``'tau'`` -- the L function of the Ramanujan delta function
|
|
59
|
+
|
|
60
|
+
- ``E`` -- an elliptic curve over `\QQ`; defines `L(E,s)`
|
|
61
|
+
|
|
62
|
+
You can also use the complete command-line interface of
|
|
63
|
+
Rubinstein's `L`-functions calculations program via this
|
|
64
|
+
class. Type ``lcalc.help()`` for a list of commands and
|
|
65
|
+
how to call them.
|
|
66
|
+
"""
|
|
67
|
+
def _repr_(self):
|
|
68
|
+
return "Rubinsteins L-function Calculator"
|
|
69
|
+
|
|
70
|
+
def __call__(self, args):
|
|
71
|
+
cmd = 'lcalc %s' % args
|
|
72
|
+
with os.popen(cmd) as f:
|
|
73
|
+
res = f.read().strip()
|
|
74
|
+
return res
|
|
75
|
+
|
|
76
|
+
def _compute_L(self, L):
|
|
77
|
+
if isinstance(L, str):
|
|
78
|
+
if L == 'tau':
|
|
79
|
+
return '--tau'
|
|
80
|
+
return L
|
|
81
|
+
if isinstance(L, EllipticCurve):
|
|
82
|
+
if L.base_ring() == QQ:
|
|
83
|
+
L = L.minimal_model()
|
|
84
|
+
return '-e --a1 %s --a2 %s --a3 %s --a4 %s --a6 %s' % tuple(L.a_invariants())
|
|
85
|
+
raise TypeError("$L$-function of %s not known" % L)
|
|
86
|
+
|
|
87
|
+
def help(self):
|
|
88
|
+
try:
|
|
89
|
+
h = self.__help
|
|
90
|
+
except AttributeError:
|
|
91
|
+
h = "-" * 70 + '\n'
|
|
92
|
+
h += " Call lcalc with one argument, e.g., \n"
|
|
93
|
+
h += " sage: lcalc('--tau -z 1000')\n"
|
|
94
|
+
h += " is translated into the command line\n"
|
|
95
|
+
h += " $ lcalc --tau -z 1000\n"
|
|
96
|
+
h += "-" * 70 + '\n'
|
|
97
|
+
h += '\n' + self('--help')
|
|
98
|
+
self.__help = h
|
|
99
|
+
pager()(h)
|
|
100
|
+
|
|
101
|
+
def zeros(self, n, L=''):
|
|
102
|
+
"""
|
|
103
|
+
Return the imaginary parts of the first `n` nontrivial
|
|
104
|
+
zeros of the `L`-function in the upper half plane, as
|
|
105
|
+
32-bit reals.
|
|
106
|
+
|
|
107
|
+
INPUT:
|
|
108
|
+
|
|
109
|
+
- ``n`` -- integer
|
|
110
|
+
|
|
111
|
+
- ``L`` -- defines `L`-function (default: Riemann zeta function)
|
|
112
|
+
|
|
113
|
+
This function also checks the Riemann Hypothesis and makes sure no
|
|
114
|
+
zeros are missed. This means it looks for several dozen zeros to
|
|
115
|
+
make sure none have been missed before outputting any zeros at all,
|
|
116
|
+
so takes longer than
|
|
117
|
+
``self.zeros_of_zeta_in_interval(...)``.
|
|
118
|
+
|
|
119
|
+
EXAMPLES::
|
|
120
|
+
|
|
121
|
+
sage: lcalc.zeros(4) # long time
|
|
122
|
+
[14.1347251, 21.0220396, 25.0108576, 30.4248761]
|
|
123
|
+
sage: lcalc.zeros(5, L='--tau') # long time
|
|
124
|
+
[9.22237940, 13.9075499, 17.4427770, 19.6565131, 22.3361036]
|
|
125
|
+
sage: lcalc.zeros(3, EllipticCurve('37a')) # long time
|
|
126
|
+
[0.000000000, 5.00317001, 6.87039122]
|
|
127
|
+
"""
|
|
128
|
+
L = self._compute_L(L)
|
|
129
|
+
RR = RealField(prec)
|
|
130
|
+
X = self('-z %s %s' % (int(n), L))
|
|
131
|
+
return [RR(z) for z in X.split()]
|
|
132
|
+
|
|
133
|
+
def zeros_in_interval(self, x, y, stepsize, L=''):
|
|
134
|
+
r"""
|
|
135
|
+
Return the imaginary parts of (most of) the nontrivial zeros of the
|
|
136
|
+
`L`-function on the line `\Re(s)=1/2` with positive
|
|
137
|
+
imaginary part between `x` and `y`, along with a
|
|
138
|
+
technical quantity for each.
|
|
139
|
+
|
|
140
|
+
INPUT:
|
|
141
|
+
|
|
142
|
+
- ``x, y, stepsize`` -- positive floating point numbers
|
|
143
|
+
|
|
144
|
+
- ``L`` -- defines `L`-function (default: Riemann zeta function)
|
|
145
|
+
|
|
146
|
+
OUTPUT: list of pairs (zero, S(T)).
|
|
147
|
+
|
|
148
|
+
Rubinstein writes: The first column outputs the imaginary part of
|
|
149
|
+
the zero, the second column a quantity related to `S(T)`
|
|
150
|
+
(it increases roughly by 2 whenever a sign change, i.e. pair of
|
|
151
|
+
zeros, is missed). Higher up the critical strip you should use a
|
|
152
|
+
smaller stepsize so as not to miss zeros.
|
|
153
|
+
|
|
154
|
+
EXAMPLES::
|
|
155
|
+
|
|
156
|
+
sage: lcalc.zeros_in_interval(10, 30, 0.1)
|
|
157
|
+
[(14.1347251, 0.184672916), (21.0220396, -0.0677893290), (25.0108576, -0.0555872781)]
|
|
158
|
+
"""
|
|
159
|
+
L = self._compute_L(L)
|
|
160
|
+
RR = RealField(prec)
|
|
161
|
+
X = self('--zeros-interval -x %s -y %s --stepsize=%s %s' % (
|
|
162
|
+
float(x), float(y), float(stepsize), L))
|
|
163
|
+
return [tuple([RR(z) for z in t.split()]) for t in X.split('\n')]
|
|
164
|
+
|
|
165
|
+
def value(self, s, L=''):
|
|
166
|
+
r"""
|
|
167
|
+
Return `L(s)` for `s` a complex number.
|
|
168
|
+
|
|
169
|
+
INPUT:
|
|
170
|
+
|
|
171
|
+
- ``s`` -- complex number
|
|
172
|
+
|
|
173
|
+
- ``L`` -- defines `L`-function (default: Riemann zeta function)
|
|
174
|
+
|
|
175
|
+
EXAMPLES::
|
|
176
|
+
|
|
177
|
+
sage: I = CC.0
|
|
178
|
+
sage: lcalc.value(0.5 + 100*I)
|
|
179
|
+
2.69261989 - 0.0203860296*I
|
|
180
|
+
|
|
181
|
+
Note, Sage can also compute zeta at complex numbers (using the PARI
|
|
182
|
+
C library)::
|
|
183
|
+
|
|
184
|
+
sage: (0.5 + 100*I).zeta()
|
|
185
|
+
2.69261988568132 - 0.0203860296025982*I
|
|
186
|
+
"""
|
|
187
|
+
L = self._compute_L(L)
|
|
188
|
+
CC = ComplexField(prec)
|
|
189
|
+
s = CC(s)
|
|
190
|
+
x, y = self('-v -x %s -y %s %s' % (s.real(), s.imag(), L)).split()
|
|
191
|
+
return CC((float(x), float(y)))
|
|
192
|
+
|
|
193
|
+
def values_along_line(self, s0, s1, number_samples, L=''):
|
|
194
|
+
r"""
|
|
195
|
+
Return values of `L(s)` at ``number_samples``
|
|
196
|
+
equally-spaced sample points along the line from `s_0` to
|
|
197
|
+
`s_1` in the complex plane.
|
|
198
|
+
|
|
199
|
+
INPUT:
|
|
200
|
+
|
|
201
|
+
- ``s0, s1`` -- complex numbers
|
|
202
|
+
|
|
203
|
+
- ``number_samples`` -- integer
|
|
204
|
+
|
|
205
|
+
- ``L`` -- defines `L`-function (default: Riemann zeta function)
|
|
206
|
+
|
|
207
|
+
OUTPUT: list of pairs `(s, L(s))`, where the `s` are equally spaced
|
|
208
|
+
sampled points on the line from `s_0` to `s_1`
|
|
209
|
+
|
|
210
|
+
EXAMPLES::
|
|
211
|
+
|
|
212
|
+
sage: I = CC.0
|
|
213
|
+
sage: values = lcalc.values_along_line(0.5, 0.5+20*I, 5)
|
|
214
|
+
sage: values[0][0] # abs tol 1e-8
|
|
215
|
+
0.5
|
|
216
|
+
sage: values[0][1] # abs tol 1e-8
|
|
217
|
+
-1.46035451 + 0.0*I
|
|
218
|
+
sage: values[1][0] # abs tol 1e-8
|
|
219
|
+
0.5 + 4.0*I
|
|
220
|
+
sage: values[1][1] # abs tol 1e-8
|
|
221
|
+
0.606783764 + 0.0911121400*I
|
|
222
|
+
sage: values[2][0] # abs tol 1e-8
|
|
223
|
+
0.5 + 8.0*I
|
|
224
|
+
sage: values[2][1] # abs tol 1e-8
|
|
225
|
+
1.24161511 + 0.360047588*I
|
|
226
|
+
sage: values[3][0] # abs tol 1e-8
|
|
227
|
+
0.5 + 12.0*I
|
|
228
|
+
sage: values[3][1] # abs tol 1e-8
|
|
229
|
+
1.01593665 - 0.745112472*I
|
|
230
|
+
sage: values[4][0] # abs tol 1e-8
|
|
231
|
+
0.5 + 16.0*I
|
|
232
|
+
sage: values[4][1] # abs tol 1e-8
|
|
233
|
+
0.938545408 + 1.21658782*I
|
|
234
|
+
|
|
235
|
+
Sometimes warnings are printed (by lcalc) when this command is
|
|
236
|
+
run::
|
|
237
|
+
|
|
238
|
+
sage: E = EllipticCurve('389a')
|
|
239
|
+
sage: values = E.lseries().values_along_line(0.5, 3, 5)
|
|
240
|
+
sage: values[0][0] # abs tol 1e-8
|
|
241
|
+
0.0
|
|
242
|
+
sage: values[0][1] # abs tol 1e-8
|
|
243
|
+
0.209951303 + 0.0*I
|
|
244
|
+
sage: values[1][0] # abs tol 1e-8
|
|
245
|
+
0.5
|
|
246
|
+
sage: values[1][1] # abs tol 1e-8
|
|
247
|
+
0.0 + 0.0*I
|
|
248
|
+
sage: values[2][0] # abs tol 1e-8
|
|
249
|
+
1.0
|
|
250
|
+
sage: values[2][1] # abs tol 1e-8
|
|
251
|
+
0.133768433 - 0.0*I
|
|
252
|
+
sage: values[3][0] # abs tol 1e-8
|
|
253
|
+
1.5
|
|
254
|
+
sage: values[3][1] # abs tol 1e-8
|
|
255
|
+
0.360092864 - 0.0*I
|
|
256
|
+
sage: values[4][0] # abs tol 1e-8
|
|
257
|
+
2.0
|
|
258
|
+
sage: values[4][1] # abs tol 1e-8
|
|
259
|
+
0.552975867 + 0.0*I
|
|
260
|
+
"""
|
|
261
|
+
L = self._compute_L(L)
|
|
262
|
+
CC = ComplexField(prec)
|
|
263
|
+
s0 = CC(s0)
|
|
264
|
+
s1 = CC(s1)
|
|
265
|
+
v = self('--value-line-segment -x %s -y %s -X %s -Y %s --number-samples %s %s' % (
|
|
266
|
+
(s0.real(), s0.imag(), s1.real(), s1.imag(), int(number_samples), L)))
|
|
267
|
+
w = []
|
|
268
|
+
for a in v.split('\n'):
|
|
269
|
+
try:
|
|
270
|
+
x0, y0, x1, y1 = a.split()
|
|
271
|
+
w.append((CC(x0, y0), CC(x1, y1)))
|
|
272
|
+
except ValueError:
|
|
273
|
+
print('lcalc: {}'.format(a))
|
|
274
|
+
return w
|
|
275
|
+
|
|
276
|
+
def twist_values(self, s, dmin, dmax, L=''):
|
|
277
|
+
r"""
|
|
278
|
+
Return values of `L(s, \chi_k)` for each quadratic
|
|
279
|
+
character `\chi_k` whose discriminant `d` satisfies
|
|
280
|
+
`d_{\min} \leq d \leq d_{\max}`.
|
|
281
|
+
|
|
282
|
+
INPUT:
|
|
283
|
+
|
|
284
|
+
- ``s`` -- complex numbers
|
|
285
|
+
|
|
286
|
+
- ``dmin`` -- integer
|
|
287
|
+
|
|
288
|
+
- ``dmax`` -- integer
|
|
289
|
+
|
|
290
|
+
- ``L`` -- defines `L`-function (default: Riemann zeta function)
|
|
291
|
+
|
|
292
|
+
OUTPUT: list of pairs `(d, L(s,\chi_d))`
|
|
293
|
+
|
|
294
|
+
EXAMPLES::
|
|
295
|
+
|
|
296
|
+
sage: values = lcalc.twist_values(0.5, -10, 10)
|
|
297
|
+
sage: values[0][0]
|
|
298
|
+
-8
|
|
299
|
+
sage: values[0][1] # abs tol 1e-8
|
|
300
|
+
1.10042141 + 0.0*I
|
|
301
|
+
sage: values[1][0]
|
|
302
|
+
-7
|
|
303
|
+
sage: values[1][1] # abs tol 1e-8
|
|
304
|
+
1.14658567 + 0.0*I
|
|
305
|
+
sage: values[2][0]
|
|
306
|
+
-4
|
|
307
|
+
sage: values[2][1] # abs tol 1e-8
|
|
308
|
+
0.667691457 + 0.0*I
|
|
309
|
+
sage: values[3][0]
|
|
310
|
+
-3
|
|
311
|
+
sage: values[3][1] # abs tol 1e-8
|
|
312
|
+
0.480867558 + 0.0*I
|
|
313
|
+
sage: values[4][0]
|
|
314
|
+
5
|
|
315
|
+
sage: values[4][1] # abs tol 1e-8
|
|
316
|
+
0.231750947 + 0.0*I
|
|
317
|
+
sage: values[5][0]
|
|
318
|
+
8
|
|
319
|
+
sage: values[5][1] # abs tol 1e-8
|
|
320
|
+
0.373691713 + 0.0*I
|
|
321
|
+
"""
|
|
322
|
+
L = self._compute_L(L)
|
|
323
|
+
CC = ComplexField(prec)
|
|
324
|
+
s = CC(s)
|
|
325
|
+
typ = '--twist-quadratic'
|
|
326
|
+
dmin = int(dmin)
|
|
327
|
+
dmax = int(dmax)
|
|
328
|
+
v = self('-v -x %s -y %s %s --start %s --finish %s %s' % (
|
|
329
|
+
(s.real(), s.imag(), typ, dmin, dmax, L)))
|
|
330
|
+
w = []
|
|
331
|
+
if len(v) == 0:
|
|
332
|
+
return w
|
|
333
|
+
if len(v) == 0:
|
|
334
|
+
return w
|
|
335
|
+
for a in v.split('\n'):
|
|
336
|
+
d, x, y = a.split()
|
|
337
|
+
w.append((ZZ(d), CC(x, y)))
|
|
338
|
+
return w
|
|
339
|
+
|
|
340
|
+
def twist_zeros(self, n, dmin, dmax, L=''):
|
|
341
|
+
r"""
|
|
342
|
+
Return first `n` real parts of nontrivial zeros for each
|
|
343
|
+
quadratic character `\chi_k` whose discriminant `d` satisfies
|
|
344
|
+
`d_{\min} \leq d \leq d_{\max}`.
|
|
345
|
+
|
|
346
|
+
INPUT:
|
|
347
|
+
|
|
348
|
+
- ``n`` -- integer
|
|
349
|
+
|
|
350
|
+
- ``dmin`` -- integer
|
|
351
|
+
|
|
352
|
+
- ``dmax`` -- integer
|
|
353
|
+
|
|
354
|
+
- ``L`` -- defines `L`-function (default: Riemann zeta function)
|
|
355
|
+
|
|
356
|
+
OUTPUT: dictionary; keys are the discriminants `d`, and values are list
|
|
357
|
+
of corresponding zeros
|
|
358
|
+
|
|
359
|
+
EXAMPLES::
|
|
360
|
+
|
|
361
|
+
sage: lcalc.twist_zeros(3, -3, 6)
|
|
362
|
+
{-3: [8.03973716, 11.2492062, 15.7046192], 5: [6.64845335, 9.83144443, 11.9588456]}
|
|
363
|
+
"""
|
|
364
|
+
L = self._compute_L(L)
|
|
365
|
+
RR = RealField(prec)
|
|
366
|
+
typ = '--twist-quadratic'
|
|
367
|
+
n = int(n)
|
|
368
|
+
v = self('-z %s %s --start %s --finish %s %s' % (
|
|
369
|
+
(n, typ, dmin, dmax, L)))
|
|
370
|
+
w = {}
|
|
371
|
+
if len(v) == 0:
|
|
372
|
+
return w
|
|
373
|
+
for a in v.split('\n'):
|
|
374
|
+
d, x = a.split()
|
|
375
|
+
x = RR(x)
|
|
376
|
+
d = ZZ(d)
|
|
377
|
+
if d in w:
|
|
378
|
+
w[d].append(x)
|
|
379
|
+
else:
|
|
380
|
+
w[d] = [x]
|
|
381
|
+
return w
|
|
382
|
+
|
|
383
|
+
def analytic_rank(self, L=''):
|
|
384
|
+
r"""
|
|
385
|
+
Return the analytic rank of the `L`-function at the central
|
|
386
|
+
critical point.
|
|
387
|
+
|
|
388
|
+
INPUT:
|
|
389
|
+
|
|
390
|
+
- ``L`` -- defines `L`-function (default: Riemann zeta function)
|
|
391
|
+
|
|
392
|
+
OUTPUT: integer
|
|
393
|
+
|
|
394
|
+
.. NOTE::
|
|
395
|
+
|
|
396
|
+
Of course this is not provably correct in general, since it
|
|
397
|
+
is an open problem to compute analytic ranks provably
|
|
398
|
+
correctly in general.
|
|
399
|
+
|
|
400
|
+
EXAMPLES::
|
|
401
|
+
|
|
402
|
+
sage: E = EllipticCurve('37a')
|
|
403
|
+
sage: lcalc.analytic_rank(E)
|
|
404
|
+
1
|
|
405
|
+
"""
|
|
406
|
+
L = self._compute_L(L)
|
|
407
|
+
s = self('--rank-compute %s' % L)
|
|
408
|
+
i = s.find('equals')
|
|
409
|
+
return ZZ(s[i + 6:])
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
# An instance
|
|
413
|
+
lcalc = LCalc()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-lcalc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-lcalc
|
|
Binary file
|