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
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: passagemath-eclib
|
|
3
|
+
Version: 10.6.42
|
|
4
|
+
Summary: passagemath: Elliptic curves over the rationals with eclib/mwrank
|
|
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 :: 3.14
|
|
28
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
30
|
+
Requires-Python: <3.15,>=3.10
|
|
31
|
+
Description-Content-Type: text/x-rst
|
|
32
|
+
Requires-Dist: passagemath-linbox~=10.6.42.0
|
|
33
|
+
Requires-Dist: passagemath-modules~=10.6.42.0
|
|
34
|
+
Requires-Dist: passagemath-ntl~=10.6.42.0
|
|
35
|
+
Requires-Dist: memory_allocator
|
|
36
|
+
Requires-Dist: cysignals!=1.12.4; sys_platform == "win32"
|
|
37
|
+
Requires-Dist: cysignals!=1.12.0,>=1.11.2
|
|
38
|
+
Provides-Extra: test
|
|
39
|
+
Requires-Dist: passagemath-repl; extra == "test"
|
|
40
|
+
Requires-Dist: passagemath-schemes; extra == "test"
|
|
41
|
+
|
|
42
|
+
==============================================================================================
|
|
43
|
+
passagemath: Elliptic curves over the rationals with eclib/mwrank
|
|
44
|
+
==============================================================================================
|
|
45
|
+
|
|
46
|
+
`passagemath <https://github.com/passagemath/passagemath>`__ is open
|
|
47
|
+
source mathematical software in Python, released under the GNU General
|
|
48
|
+
Public Licence GPLv2+.
|
|
49
|
+
|
|
50
|
+
It is a fork of `SageMath <https://www.sagemath.org/>`__, which has been
|
|
51
|
+
developed 2005-2025 under the motto “Creating a Viable Open Source
|
|
52
|
+
Alternative to Magma, Maple, Mathematica, and MATLAB”.
|
|
53
|
+
|
|
54
|
+
The passagemath fork uses the motto "Creating a Free Passage Between the
|
|
55
|
+
Scientific Python Ecosystem and Mathematical Software Communities."
|
|
56
|
+
It was created in October 2024 with the following goals:
|
|
57
|
+
|
|
58
|
+
- providing modularized installation with pip,
|
|
59
|
+
- establishing first-class membership in the scientific Python
|
|
60
|
+
ecosystem,
|
|
61
|
+
- giving `clear attribution of upstream
|
|
62
|
+
projects <https://groups.google.com/g/sage-devel/c/6HO1HEtL1Fs/m/G002rPGpAAAJ>`__,
|
|
63
|
+
- providing independently usable Python interfaces to upstream
|
|
64
|
+
libraries,
|
|
65
|
+
- offering `platform portability and integration testing
|
|
66
|
+
services <https://github.com/passagemath/passagemath/issues/704>`__
|
|
67
|
+
to upstream projects,
|
|
68
|
+
- inviting collaborations with upstream projects,
|
|
69
|
+
- `building a professional, respectful, inclusive
|
|
70
|
+
community <https://groups.google.com/g/sage-devel/c/xBzaINHWwUQ>`__,
|
|
71
|
+
- `empowering Sage users to participate in the scientific Python ecosystem
|
|
72
|
+
<https://github.com/passagemath/passagemath/issues/248>`__ by publishing packages,
|
|
73
|
+
- developing a port to `Pyodide <https://pyodide.org/en/stable/>`__ for
|
|
74
|
+
serverless deployment with Javascript,
|
|
75
|
+
- developing a native Windows port.
|
|
76
|
+
|
|
77
|
+
`Full documentation <https://passagemath.org/docs/latest/html/en/index.html>`__ is
|
|
78
|
+
available online.
|
|
79
|
+
|
|
80
|
+
passagemath attempts to support and provides binary wheels suitable for
|
|
81
|
+
all major Linux distributions and recent versions of macOS.
|
|
82
|
+
|
|
83
|
+
Binary wheels for native Windows (x86_64) are are available for a subset of
|
|
84
|
+
the passagemath distributions. Use of the full functionality of passagemath
|
|
85
|
+
on Windows currently requires the use of Windows Subsystem for Linux (WSL)
|
|
86
|
+
or virtualization.
|
|
87
|
+
|
|
88
|
+
The supported Python versions in the passagemath 10.6.x series are 3.10.x-3.14.x.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
About this pip-installable distribution package
|
|
92
|
+
-----------------------------------------------
|
|
93
|
+
|
|
94
|
+
This pip-installable distribution ``passagemath-eclib`` provides the
|
|
95
|
+
Cython interface to John Cremona's programs for enumerating and computing
|
|
96
|
+
with elliptic curves defined over the rational numbers.
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
What is included
|
|
100
|
+
----------------
|
|
101
|
+
|
|
102
|
+
- `Sage interface to Cremona’s eclib library (also known as mwrank) <https://passagemath.org/docs/latest/html/en/reference/libs/sage/libs/eclib/interface.html>`_
|
|
103
|
+
|
|
104
|
+
- `Cython interface to Cremona’s eclib library (also known as mwrank) <https://passagemath.org/docs/latest/html/en/reference/libs/sage/libs/eclib/mwrank.html>`_
|
|
105
|
+
|
|
106
|
+
- `Cremona matrices <https://passagemath.org/docs/latest/html/en/reference/libs/sage/libs/eclib/mat.html>`_
|
|
107
|
+
|
|
108
|
+
- `Modular symbols using eclib newforms <https://passagemath.org/docs/latest/html/en/reference/libs/sage/libs/eclib/newforms.html>`_
|
|
109
|
+
|
|
110
|
+
- `Cremona modular symbols <https://passagemath.org/docs/latest/html/en/reference/libs/sage/libs/eclib/homspace.html>`_
|
|
111
|
+
|
|
112
|
+
- `Cremona modular symbols (constructor) <https://passagemath.org/docs/latest/html/en/reference/libs/sage/libs/eclib/constructor.html>`_
|
|
113
|
+
|
|
114
|
+
- `Interface to the mwrank program <https://passagemath.org/docs/latest/html/en/reference/interfaces/sage/interfaces/mwrank.html#module-sage.interfaces.mwrank>`_
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
Examples
|
|
118
|
+
--------
|
|
119
|
+
|
|
120
|
+
A quick way to try it out interactively::
|
|
121
|
+
|
|
122
|
+
$ pipx run --pip-args="--prefer-binary" --spec "passagemath-eclib[test]" ipython
|
|
123
|
+
|
|
124
|
+
In [1]: from passagemath_eclib import *
|
|
125
|
+
|
|
126
|
+
In [2]: M = CremonaModularSymbols(43, cuspidal=True); M
|
|
127
|
+
Out[2]: Cremona Cuspidal Modular Symbols space of dimension 6 for Gamma_0(43) of weight 2 with sign 0
|
|
128
|
+
|
|
129
|
+
Finding the installation location of the mwrank program::
|
|
130
|
+
|
|
131
|
+
$ pipx run --pip-args="--prefer-binary" --spec "passagemath-eclib" python
|
|
132
|
+
>>> from sage.features.eclib import Mwrank
|
|
133
|
+
>>> Mwrank().absolute_filename()
|
|
134
|
+
'.../bin/mwrank'
|
|
135
|
+
|
|
136
|
+
Use with `sage.schemes.elliptic_curves <https://passagemath.org/docs/latest/html/en/reference/arithmetic_curves/index.html#elliptic-curves>`_::
|
|
137
|
+
|
|
138
|
+
$ pipx run --pip-args="--prefer-binary" --spec "passagemath-eclib[test]" ipython
|
|
139
|
+
|
|
140
|
+
In [1]: from passagemath_eclib import *
|
|
141
|
+
|
|
142
|
+
In [2]: x = polygen(ZZ, 'x')
|
|
143
|
+
|
|
144
|
+
In [3]: K = NumberField(x**2 + 23, 'a'); a = K.gen()
|
|
145
|
+
|
|
146
|
+
In [4]: E = EllipticCurve(K, [0,0,0,101,0])
|
|
147
|
+
|
|
148
|
+
In [5]: E.gens()
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
Development
|
|
152
|
+
-----------
|
|
153
|
+
|
|
154
|
+
::
|
|
155
|
+
|
|
156
|
+
$ git clone --origin passagemath https://github.com/passagemath/passagemath.git
|
|
157
|
+
$ cd passagemath
|
|
158
|
+
passagemath $ ./bootstrap
|
|
159
|
+
passagemath $ python3 -m venv eclib-venv
|
|
160
|
+
passagemath $ source eclib-venv/bin/activate
|
|
161
|
+
(eclib-venv) passagemath $ pip install -v -e pkgs/sagemath-eclib
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
passagemath_eclib/__init__.py,sha256=zMD8y2IByHS2O6bJW-aznIYrFHjoZtYxoYoqUos3YZ0,84
|
|
2
|
+
passagemath_eclib.libs/libec-7d1d8090.so.14.1.0,sha256=y5fUuY41LK8qGwe833cj6JFdKgNkKlZ3LLX4Vow_YGo,46566513
|
|
3
|
+
passagemath_eclib.libs/libflint-edf7fb90.so.22.0.0,sha256=MD3YZou85hLe1nME9zmMO9rgpWntwei2_yI19VNhFGo,12776233
|
|
4
|
+
passagemath_eclib.libs/libgcc_s-2d945d6c.so.1,sha256=NdOgO2If8roY3PSnJ81CsBa1rjMvN_uWPCo_V0ThwEY,203337
|
|
5
|
+
passagemath_eclib.libs/libgf2x-e54d5509.so.3.0.0,sha256=cs5LUFwNaOw-g_4-iUDPbFMMG6JSHk9Bfj165VQIEdg,199849
|
|
6
|
+
passagemath_eclib.libs/libgmp-28992bcb.so.10.5.0,sha256=chvEgOPn69KHFEAC4oKOFhJ2LjYfSTYlyAEyFvE1hJg,668217
|
|
7
|
+
passagemath_eclib.libs/libmpfr-1fc8ea36.so.6.2.2,sha256=6QZDznN7C9yVcv5AG5GpXZWrvxsAw1kqTlkqECWjLIQ,931889
|
|
8
|
+
passagemath_eclib.libs/libntl-21cb123c.so.45.0.0,sha256=47h5iJkAWZEANvKCgFB3zTM7EKC89TzFiF7eT8cTB68,3076193
|
|
9
|
+
passagemath_eclib.libs/libpari-gmp-tls-f714c61d.so.2.17.2,sha256=QF53j1EjOBqAulZbIyWetvL433RZlnR_d4h7B_k6nT8,11094969
|
|
10
|
+
passagemath_eclib.libs/libstdc++-85f2cd6d.so.6.0.33,sha256=D3uBWNGP8cz5PIqwr4jUgv7u70AIVsNEjLuj90icFcw,3651889
|
|
11
|
+
sage/all__sagemath_eclib.py,sha256=PnPfHmKUTc7cMx6GOd0BupMBdOugvB3CDOKnfLdfzFY,348
|
|
12
|
+
sage/interfaces/all__sagemath_eclib.py,sha256=VjiZlK64wgH3SQYvGUcepeTUQngHlgGRH90Uyv5LnSE,44
|
|
13
|
+
sage/interfaces/mwrank.py,sha256=y6lal269BI5a2Uvf35qN8ovvYikn3MRJ7_L_a2KU0a8,12478
|
|
14
|
+
sage/libs/all__sagemath_eclib.py,sha256=H84MU_RUF7AFi4kYwqjD7qf-5Ubp8p1JM0CQ3zQPEbM,497
|
|
15
|
+
sage/libs/eclib/__init__.pxd,sha256=J-IK32oq6HIKmFTHYGbr4Q6EJ33Vcsv5YVeaD-9vyIo,4784
|
|
16
|
+
sage/libs/eclib/__init__.py,sha256=VjiZlK64wgH3SQYvGUcepeTUQngHlgGRH90Uyv5LnSE,44
|
|
17
|
+
sage/libs/eclib/all.py,sha256=Nwq0p-bytJLGjPQi9SA0ej_gnjDmhUYHsqr6owIimss,316
|
|
18
|
+
sage/libs/eclib/constructor.py,sha256=k4ug-84zOdPsVkcc0fQECuaXcxdWuK34j76U4n0k80Y,2962
|
|
19
|
+
sage/libs/eclib/homspace.cpython-313-aarch64-linux-musl.so,sha256=-76ixosvFsfTVa1VGmShMlm_75mErOcM6Urw8pphYe8,923289
|
|
20
|
+
sage/libs/eclib/homspace.pxd,sha256=snYcG_sEmIHuV1zAlVjXgYfCyJ_BIBRKplJ8dOVisMw,131
|
|
21
|
+
sage/libs/eclib/homspace.pyx,sha256=uzmWG8kKgH9NNAEx-Ym1JaW7UVUwoJ-jwsWdwh7jfw4,9653
|
|
22
|
+
sage/libs/eclib/interface.py,sha256=bNn_mVlAJU9OxOQ_SvUfIlscFepNDIAf4qLi0YqTfac,50561
|
|
23
|
+
sage/libs/eclib/mat.cpython-313-aarch64-linux-musl.so,sha256=JKXWsZsGSLZAU6gygWYk-lhpo8uBxCtbXhodq3hJZcc,595449
|
|
24
|
+
sage/libs/eclib/mat.pxd,sha256=JXuI8yzgKxxGkVWfM5hNvr3I8bIu-HKzmNuddrV0Hf8,173
|
|
25
|
+
sage/libs/eclib/mat.pyx,sha256=m1iEfSMrBFqBOZScc0LLbim3GgNJz5OTiEpDSmiyeG4,7316
|
|
26
|
+
sage/libs/eclib/mwrank.cpython-313-aarch64-linux-musl.so,sha256=XIm_aZTBtbqbawGXQZBWRIiGRwZjOSKBKZb5G17WhWI,1648145
|
|
27
|
+
sage/libs/eclib/mwrank.pyx,sha256=39FNEm22seSBoepMAUdf-aUT5DGVkErzqzFfun8BkqQ,43700
|
|
28
|
+
sage/libs/eclib/newforms.cpython-313-aarch64-linux-musl.so,sha256=F-Zpr31_HOShVwsXqk3jw3eCOxU9eks4b8k4R288M60,1058553
|
|
29
|
+
sage/libs/eclib/newforms.pxd,sha256=7OmyBO8Tj8hncCdPAPHNLIS4axhZRM-rRYoyLjZ7-Mc,186
|
|
30
|
+
sage/libs/eclib/newforms.pyx,sha256=sqx0yta_mul8McABIBlzK0Xj9COo-HFDM_zFCWtbKMc,15483
|
|
31
|
+
sage_wheels/bin/mwrank,sha256=1C6WalT7x8H2GyxDePojRQkoMFElR7c2sRxzO4voBpM,661681
|
|
32
|
+
passagemath_eclib-10.6.42.dist-info/METADATA,sha256=iZG75SkPLfpCozKtrPb33AUCs6YKnO457CuFD0uFoYU,7056
|
|
33
|
+
passagemath_eclib-10.6.42.dist-info/WHEEL,sha256=3IjWZRuuq2q-vKtU0x2XxSbfx92VUEmTDWR0AUEtZxI,113
|
|
34
|
+
passagemath_eclib-10.6.42.dist-info/top_level.txt,sha256=0XP-a724JYuL7lNTHSaQ05dyR3Jxz-IUzAWaASLTSHE,24
|
|
35
|
+
passagemath_eclib-10.6.42.dist-info/RECORD,,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-eclib
|
|
2
|
+
# delvewheel: patch
|
|
3
|
+
|
|
4
|
+
try:
|
|
5
|
+
from sage.all__sagemath_repl import *
|
|
6
|
+
except ImportError:
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
from sage.all__sagemath_modules import *
|
|
10
|
+
from sage.all__sagemath_linbox import *
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from sage.all__sagemath_schemes import *
|
|
14
|
+
except ImportError:
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
from sage.libs.all__sagemath_eclib import *
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-eclib
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-eclib
|
|
2
|
+
r"""
|
|
3
|
+
Interface to mwrank
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ****************************************************************************
|
|
7
|
+
# Copyright (C) 2005 William Stein <wstein@gmail.com>
|
|
8
|
+
#
|
|
9
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
10
|
+
#
|
|
11
|
+
# This code is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# The full text of the GPL is available at:
|
|
17
|
+
#
|
|
18
|
+
# https://www.gnu.org/licenses/
|
|
19
|
+
# ****************************************************************************
|
|
20
|
+
|
|
21
|
+
import os
|
|
22
|
+
import shlex
|
|
23
|
+
import weakref
|
|
24
|
+
|
|
25
|
+
from sage.features.eclib import Mwrank as mwrank_executable
|
|
26
|
+
|
|
27
|
+
from .expect import Expect
|
|
28
|
+
|
|
29
|
+
instances = {}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def Mwrank(options='', server=None, server_tmpdir=None):
|
|
33
|
+
"""
|
|
34
|
+
Create and return an mwrank interpreter, with given options.
|
|
35
|
+
|
|
36
|
+
INPUT:
|
|
37
|
+
|
|
38
|
+
- ``options`` -- string; passed when starting mwrank.
|
|
39
|
+
The format is::
|
|
40
|
+
|
|
41
|
+
-h help prints this info and quits
|
|
42
|
+
-q quiet turns OFF banner display and prompt
|
|
43
|
+
-v n verbosity sets verbosity to n (default=1)
|
|
44
|
+
-o PARI/GP output turns ON extra PARI/GP short output (default: OFF)
|
|
45
|
+
-p n precision sets precision to n decimals (default=15)
|
|
46
|
+
-b n quartic bound bound on quartic point search (default=10)
|
|
47
|
+
-x n n aux number of aux primes used for sieving (default=6)
|
|
48
|
+
-l list turns ON listing of points (default: ON, unless v=0)
|
|
49
|
+
-s selmer_only if set, computes Selmer rank only (default: not set)
|
|
50
|
+
-d skip_2nd_descent if set, skips the second descent for curves with 2-torsion (default: not set)
|
|
51
|
+
-S n sat_bd upper bound on saturation primes (default=100, -1 for automatic)
|
|
52
|
+
|
|
53
|
+
.. WARNING::
|
|
54
|
+
|
|
55
|
+
Do not use the option "-q" which turns off the prompt.
|
|
56
|
+
|
|
57
|
+
EXAMPLES::
|
|
58
|
+
|
|
59
|
+
sage: M = Mwrank('-v 0 -l')
|
|
60
|
+
sage: print(M('0 0 1 -1 0'))
|
|
61
|
+
Curve [0,0,1,-1,0] : Rank = 1
|
|
62
|
+
Generator 1 is [0:-1:1]; height 0.051...
|
|
63
|
+
Regulator = 0.051...
|
|
64
|
+
"""
|
|
65
|
+
global instances
|
|
66
|
+
try:
|
|
67
|
+
X = instances[options]()
|
|
68
|
+
if X:
|
|
69
|
+
return X
|
|
70
|
+
except KeyError:
|
|
71
|
+
pass
|
|
72
|
+
X = Mwrank_class(options, server=server, server_tmpdir=server_tmpdir)
|
|
73
|
+
instances[options] = weakref.ref(X)
|
|
74
|
+
return X
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
import re
|
|
78
|
+
# regex matching '[a1,a2,a3,a4,a6]', no spaces, each ai a possibly signed integer
|
|
79
|
+
AINVS_LIST_RE = re.compile(r'\[[+-]?(\d+)(,[+-]?\d+){4}]')
|
|
80
|
+
# regex matching ' a1 a2 a3 a4 a6 ', any whitespace, each ai a possibly signed integer
|
|
81
|
+
AINVS_PLAIN_RE = re.compile(r'^(\s*)([+-]?(\d+)(\s+)){4}([+-]?(\d+))(\s*)$')
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def validate_mwrank_input(s):
|
|
85
|
+
r"""
|
|
86
|
+
Return a string suitable for mwrank input, or raises an error.
|
|
87
|
+
|
|
88
|
+
INPUT:
|
|
89
|
+
|
|
90
|
+
- ``s`` -- one of the following:
|
|
91
|
+
|
|
92
|
+
- a list or tuple of 5 integers [a1,a2,a3,a4,a6] or (a1,a2,a3,a4,a6)
|
|
93
|
+
- a string of the form '[a1,a2,a3,a4,a6]' or 'a1 a2 a3 a4 a6' where a1, a2, a3, a4, a6 are integers
|
|
94
|
+
|
|
95
|
+
OUTPUT:
|
|
96
|
+
|
|
97
|
+
For valid input, a string of the form '[a1,a2,a3,a4,a6]'.
|
|
98
|
+
For invalid input a :exc:`ValueError` is raised.
|
|
99
|
+
|
|
100
|
+
EXAMPLES:
|
|
101
|
+
|
|
102
|
+
A list or tuple of 5 integers::
|
|
103
|
+
|
|
104
|
+
sage: from sage.interfaces.mwrank import validate_mwrank_input
|
|
105
|
+
sage: validate_mwrank_input([1,2,3,4,5])
|
|
106
|
+
'[1, 2, 3, 4, 5]'
|
|
107
|
+
sage: validate_mwrank_input((-1,2,-3,4,-55))
|
|
108
|
+
'[-1, 2, -3, 4, -55]'
|
|
109
|
+
sage: validate_mwrank_input([1,2,3,4])
|
|
110
|
+
Traceback (most recent call last):
|
|
111
|
+
...
|
|
112
|
+
ValueError: [1, 2, 3, 4] is not valid input to mwrank (should have 5 entries)
|
|
113
|
+
sage: validate_mwrank_input([1,2,3,4,i])
|
|
114
|
+
Traceback (most recent call last):
|
|
115
|
+
...
|
|
116
|
+
ValueError: [1, 2, 3, 4, I] is not valid input to mwrank (entries should be integers)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
A string of the form '[a1,a2,a3,a4,a6]' with any whitespace and integers ai::
|
|
120
|
+
|
|
121
|
+
sage: validate_mwrank_input('0 -1 1 -7 6')
|
|
122
|
+
'[0,-1,1,-7,6]'
|
|
123
|
+
sage: validate_mwrank_input("[0,-1,1,0,0]\n")
|
|
124
|
+
'[0,-1,1,0,0]'
|
|
125
|
+
sage: validate_mwrank_input('0\t -1\t 1\t 0\t 0\n')
|
|
126
|
+
'[0,-1,1,0,0]'
|
|
127
|
+
sage: validate_mwrank_input('0 -1 1 -7 ')
|
|
128
|
+
Traceback (most recent call last):
|
|
129
|
+
...
|
|
130
|
+
ValueError: 0 -1 1 -7 is not valid input to mwrank
|
|
131
|
+
"""
|
|
132
|
+
if isinstance(s, (list, tuple)):
|
|
133
|
+
from sage.rings.integer_ring import ZZ
|
|
134
|
+
if len(s) != 5:
|
|
135
|
+
raise ValueError("%s is not valid input to mwrank (should have 5 entries)" % s)
|
|
136
|
+
try:
|
|
137
|
+
ai = [ZZ(a) for a in s]
|
|
138
|
+
return str(ai)
|
|
139
|
+
except (TypeError, ValueError):
|
|
140
|
+
raise ValueError("%s is not valid input to mwrank (entries should be integers)" % s)
|
|
141
|
+
|
|
142
|
+
if isinstance(s, str):
|
|
143
|
+
if AINVS_PLAIN_RE.match(s):
|
|
144
|
+
ai = s.split()
|
|
145
|
+
return "[" + ",".join(ai) + "]"
|
|
146
|
+
ss = s.replace(' ', '').replace('\n', '').replace('\t', '')
|
|
147
|
+
if AINVS_LIST_RE.match(ss):
|
|
148
|
+
return ss
|
|
149
|
+
raise ValueError("%s is not valid input to mwrank" % s)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class Mwrank_class(Expect):
|
|
153
|
+
"""
|
|
154
|
+
Interface to the Mwrank interpreter.
|
|
155
|
+
"""
|
|
156
|
+
def __init__(self, options='', server=None, server_tmpdir=None):
|
|
157
|
+
"""
|
|
158
|
+
INPUT:
|
|
159
|
+
|
|
160
|
+
- ``options`` -- string; passed when starting mwrank.
|
|
161
|
+
The format is::
|
|
162
|
+
|
|
163
|
+
-h help prints this info and quits
|
|
164
|
+
-q quiet turns OFF banner display and prompt
|
|
165
|
+
-v n verbosity sets verbosity to n (default=1)
|
|
166
|
+
-o PARI/GP output turns ON extra PARI/GP short output (default: OFF)
|
|
167
|
+
-p n precision sets precision to n decimals (default=15)
|
|
168
|
+
-b n quartic bound bound on quartic point search (default=10)
|
|
169
|
+
-x n n aux number of aux primes used for sieving (default=6)
|
|
170
|
+
-l list turns ON listing of points (default: ON, unless v=0)
|
|
171
|
+
-s selmer_only if set, computes Selmer rank only (default: not set)
|
|
172
|
+
-d skip_2nd_descent if set, skips the second descent for curves with 2-torsion (default: not set)
|
|
173
|
+
-S n sat_bd upper bound on saturation primes (default=100, -1 for automatic)
|
|
174
|
+
|
|
175
|
+
.. WARNING::
|
|
176
|
+
|
|
177
|
+
Do not use the option "-q" which turns off the prompt.
|
|
178
|
+
|
|
179
|
+
.. NOTE::
|
|
180
|
+
|
|
181
|
+
Normally instances of this class would be created by
|
|
182
|
+
calling the global function :meth:`Mwrank`.
|
|
183
|
+
|
|
184
|
+
EXAMPLES::
|
|
185
|
+
|
|
186
|
+
sage: from sage.interfaces.mwrank import Mwrank_class
|
|
187
|
+
sage: M = Mwrank_class('-v 0 -l')
|
|
188
|
+
sage: M('0 -1 1 0 0')
|
|
189
|
+
'Curve [0,-1,1,0,0] :...Rank = 0...Regulator = 1...'
|
|
190
|
+
|
|
191
|
+
sage: from sage.interfaces.mwrank import Mwrank_class
|
|
192
|
+
sage: TestSuite(Mwrank_class).run()
|
|
193
|
+
"""
|
|
194
|
+
Expect.__init__(self,
|
|
195
|
+
name='mwrank',
|
|
196
|
+
prompt='Enter curve: ',
|
|
197
|
+
command=f"{shlex.quote(mwrank_executable().absolute_filename())} {options}",
|
|
198
|
+
server=server,
|
|
199
|
+
server_tmpdir=server_tmpdir,
|
|
200
|
+
restart_on_ctrlc=True,
|
|
201
|
+
verbose_start=False)
|
|
202
|
+
|
|
203
|
+
def __getattr__(self, attrname):
|
|
204
|
+
"""
|
|
205
|
+
Standard function to return an attribute.
|
|
206
|
+
|
|
207
|
+
EXAMPLES::
|
|
208
|
+
|
|
209
|
+
sage: mwrank.zzz
|
|
210
|
+
Traceback (most recent call last):
|
|
211
|
+
...
|
|
212
|
+
AttributeError
|
|
213
|
+
"""
|
|
214
|
+
raise AttributeError
|
|
215
|
+
|
|
216
|
+
def __reduce__(self):
|
|
217
|
+
"""
|
|
218
|
+
EXAMPLES::
|
|
219
|
+
|
|
220
|
+
sage: Mwrank().__reduce__()
|
|
221
|
+
(<function _reduce_load_mwrank at 0x...>, ())
|
|
222
|
+
"""
|
|
223
|
+
|
|
224
|
+
return _reduce_load_mwrank, tuple([])
|
|
225
|
+
|
|
226
|
+
def __call__(self, cmd):
|
|
227
|
+
"""
|
|
228
|
+
Interface to eval method.
|
|
229
|
+
|
|
230
|
+
INPUT:
|
|
231
|
+
|
|
232
|
+
- ``cmd`` A string, or Sage object which when converted to a
|
|
233
|
+
string gives valid input to ``mwrank``. The conversion is
|
|
234
|
+
done by :meth:`validate_mwrank_input`.
|
|
235
|
+
|
|
236
|
+
EXAMPLES:
|
|
237
|
+
|
|
238
|
+
The input can be five integers separated by whitespace::
|
|
239
|
+
|
|
240
|
+
sage: mwrank('0 -1 1 0 0')
|
|
241
|
+
'Curve [0,-1,1,0,0] :...Basic pair: I=16, J=-304...'
|
|
242
|
+
|
|
243
|
+
Or a list or tuple of exactly five integers::
|
|
244
|
+
|
|
245
|
+
sage: s = mwrank([0,-1,1,0,0])
|
|
246
|
+
sage: "Rank = 0" in s and "been determined unconditionally" in s
|
|
247
|
+
True
|
|
248
|
+
|
|
249
|
+
TESTS:
|
|
250
|
+
|
|
251
|
+
Invalid input raises an :exc:`ValueError` (see :issue:`10108`); this
|
|
252
|
+
includes syntactically valid input which defines a singular curve::
|
|
253
|
+
|
|
254
|
+
sage: mwrank(10)
|
|
255
|
+
Traceback (most recent call last):
|
|
256
|
+
...
|
|
257
|
+
ValueError: Invalid input: 10 is not valid input to mwrank
|
|
258
|
+
|
|
259
|
+
sage: mwrank('0 0 0 0 0')
|
|
260
|
+
Traceback (most recent call last):
|
|
261
|
+
...
|
|
262
|
+
ValueError: Invalid input ([0,0,0,0,0]) to mwrank (singular curve)
|
|
263
|
+
|
|
264
|
+
sage: mwrank('0 0 0 -3 2')
|
|
265
|
+
Traceback (most recent call last):
|
|
266
|
+
...
|
|
267
|
+
ValueError: Invalid input ([0,0,0,-3,2]) to mwrank (singular curve)
|
|
268
|
+
"""
|
|
269
|
+
try:
|
|
270
|
+
s = validate_mwrank_input(cmd)
|
|
271
|
+
except ValueError as err:
|
|
272
|
+
raise ValueError("Invalid input: %s" % err)
|
|
273
|
+
try:
|
|
274
|
+
return self.eval(s)
|
|
275
|
+
except ValueError as err:
|
|
276
|
+
raise ValueError(err)
|
|
277
|
+
except RuntimeError:
|
|
278
|
+
raise ValueError(cmd)
|
|
279
|
+
|
|
280
|
+
def eval(self, s, **kwds):
|
|
281
|
+
"""
|
|
282
|
+
Return mwrank's output for the given input.
|
|
283
|
+
|
|
284
|
+
INPUT:
|
|
285
|
+
|
|
286
|
+
- ``s`` -- string; a Sage object which when converted to a string
|
|
287
|
+
gives valid input to ``mwrank``. The conversion is done by
|
|
288
|
+
:meth:`validate_mwrank_input`. Possible formats are:
|
|
289
|
+
|
|
290
|
+
- a string representing exactly five integers separated by
|
|
291
|
+
whitespace, for example '1 2 3 4 5'
|
|
292
|
+
|
|
293
|
+
- a string representing exactly five integers separated by
|
|
294
|
+
commas, preceded by '[' and followed by ']' (with
|
|
295
|
+
arbitrary whitespace), for example '[1 2 3 4 5]'
|
|
296
|
+
|
|
297
|
+
- a list or tuple of exactly 5 integers.
|
|
298
|
+
|
|
299
|
+
.. NOTE::
|
|
300
|
+
|
|
301
|
+
If a :exc:`RuntimeError` exception is raised, then the mwrank
|
|
302
|
+
interface is restarted and the command is retried once.
|
|
303
|
+
|
|
304
|
+
EXAMPLES::
|
|
305
|
+
|
|
306
|
+
sage: mwrank.eval('12 3 4 5 6')
|
|
307
|
+
'Curve [12,3,4,5,6] :...'
|
|
308
|
+
sage: mwrank.eval('[12, 3, 4, 5, 6]')
|
|
309
|
+
'Curve [12,3,4,5,6] :...'
|
|
310
|
+
sage: mwrank.eval([12, 3, 4, 5, 6])
|
|
311
|
+
'Curve [12,3,4,5,6] :...'
|
|
312
|
+
sage: mwrank.eval((12, 3, 4, 5, 6))
|
|
313
|
+
'Curve [12,3,4,5,6] :...'
|
|
314
|
+
"""
|
|
315
|
+
if self._expect is not None and not self._expect.isalive():
|
|
316
|
+
# if mwrank is interrupted twice in rapid succession,
|
|
317
|
+
# then it doesn't restart correctly, and we're left with:
|
|
318
|
+
# "RuntimeError: [Errno 9] Bad file descriptor"
|
|
319
|
+
# Doing _start again fixes that always. See trac #5157.
|
|
320
|
+
self._start()
|
|
321
|
+
try:
|
|
322
|
+
ss = validate_mwrank_input(s)
|
|
323
|
+
return Expect.eval(self, ss, **kwds)
|
|
324
|
+
except ValueError as err:
|
|
325
|
+
raise ValueError('Invalid input: %s' % err)
|
|
326
|
+
except RuntimeError:
|
|
327
|
+
raise ValueError('Invalid input (%s) to mwrank (singular curve)' % s)
|
|
328
|
+
|
|
329
|
+
def console(self):
|
|
330
|
+
"""
|
|
331
|
+
Start the mwrank console.
|
|
332
|
+
|
|
333
|
+
EXAMPLES::
|
|
334
|
+
|
|
335
|
+
sage: mwrank.console() # not tested: expects console input
|
|
336
|
+
Program mwrank: ...
|
|
337
|
+
"""
|
|
338
|
+
mwrank_console()
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
# An instance
|
|
342
|
+
mwrank = Mwrank()
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
def _reduce_load_mwrank():
|
|
346
|
+
"""
|
|
347
|
+
Return the standard mwrank instance.
|
|
348
|
+
|
|
349
|
+
EXAMPLES::
|
|
350
|
+
|
|
351
|
+
sage: from sage.interfaces.mwrank import _reduce_load_mwrank
|
|
352
|
+
sage: _reduce_load_mwrank()
|
|
353
|
+
Mwrank
|
|
354
|
+
"""
|
|
355
|
+
return mwrank
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
def mwrank_console():
|
|
359
|
+
"""
|
|
360
|
+
Start the mwrank console.
|
|
361
|
+
|
|
362
|
+
EXAMPLES::
|
|
363
|
+
|
|
364
|
+
sage: mwrank_console() # not tested: expects console input
|
|
365
|
+
Program mwrank: ...
|
|
366
|
+
"""
|
|
367
|
+
from sage.repl.rich_output.display_manager import get_display_manager
|
|
368
|
+
if not get_display_manager().is_in_terminal():
|
|
369
|
+
raise RuntimeError('Can use the console only in the terminal. Try %%mwrank magics instead.')
|
|
370
|
+
os.system(f'{shlex.quote(mwrank_executable().absolute_filename())}')
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-eclib
|
|
2
|
+
|
|
3
|
+
from sage.misc.lazy_import import lazy_import
|
|
4
|
+
|
|
5
|
+
lazy_import('sage.libs.eclib.constructor', 'CremonaModularSymbols')
|
|
6
|
+
lazy_import('sage.libs.eclib.interface', ['mwrank_EllipticCurve', 'mwrank_MordellWeil'])
|
|
7
|
+
lazy_import('sage.libs.eclib.mwrank', 'get_precision', 'mwrank_get_precision')
|
|
8
|
+
lazy_import('sage.libs.eclib.mwrank', 'set_precision', 'mwrank_set_precision')
|
|
9
|
+
lazy_import('sage.libs.eclib.mwrank', 'initprimes', 'mwrank_initprimes')
|
|
10
|
+
|
|
11
|
+
del lazy_import
|