Skip to content

Add "needs" tags for eclib and mwrank #40546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doc/de/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Tutorial der richtige Ort um damit anzufangen. Zum Beispiel:
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ more general, but doesn't scale nearly so well (yet).

::

sage: # needs sage.libs.eclib
sage: M = CremonaModularSymbols(20014) # few seconds
sage: M
Cremona Modular Symbols space of dimension 5005 for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ the :math:`5`-adic and :math:`997`-adic regulators of this curve.

::

sage: # needs sage.libs.eclib
sage: E = EllipticCurve('389a')
sage: E.padic_regulator(5, 10)
5^2 + 2*5^3 + 2*5^4 + 4*5^5 + 3*5^6 + 4*5^7 + 3*5^8 + 5^9 + O(5^11)
Expand All @@ -154,6 +155,7 @@ nontrivial computational challenge. Now in Sage computing the

::

sage: # needs sage.libs.eclib
sage: E.padic_regulator(100003,5) # a couple of seconds
42582*100003^2 + 35250*100003^3 + 12790*100003^4 + 64078*100003^5 + O(100003^6)

Expand All @@ -176,6 +178,7 @@ rank :math:`2`.

::

sage: # needs.sage.libs.eclib
sage: E = EllipticCurve('389a')
sage: L = E.padic_lseries(5)
sage: L
Expand All @@ -199,7 +202,7 @@ unpublished papers of Wuthrich and me.
sage: E.sha().bound() # so only 2 could divide sha
[2]
sage: E = EllipticCurve('37a1') # so only 2 could divide sha
sage: E.sha().bound()
sage: E.sha().bound() # needs sage.libs.eclib
([2], 1)
sage: E = EllipticCurve('389a1')
sage: E.sha().bound()
Expand All @@ -223,6 +226,7 @@ and :math:`7` do not divide the Shafarevich-Tate group of our rank

::

sage: # needs sage.libs.eclib
sage: E = EllipticCurve('389a1')
sage: sha = E.sha()
sage: sha.p_primary_bound(5) # iwasawa theory ==> 5 doesn't divide sha
Expand All @@ -242,6 +246,7 @@ number in general!

::

sage: # needs sage.libs.eclib
sage: E.sha().an()
1.00000000000000

Expand All @@ -257,7 +262,7 @@ GP scripts for computing Mordell-Weil groups of elliptic curves.
sage: E = EllipticCurve([1,2,5,17,159])
sage: E.conductor() # not in the Tables
10272987
sage: E.gens() # a few seconds
sage: E.gens() # a few seconds, needs sage.libs.eclib
[(-3 : 9 : 1), (-3347/3249 : 1873597/185193 : 1)]


Expand All @@ -274,6 +279,7 @@ the only free open source implementation available.

::

sage: # needs sage.libs.eclib
sage: E = EllipticCurve([1,2,5,7,17])
sage: E.integral_points(both_signs=True)
[(1 : -9 : 1), (1 : 3 : 1)]
Expand All @@ -283,6 +289,7 @@ rank :math:`3`, which has 36 integral points.

::

sage: # needs sage.libs.eclib
sage: E = elliptic_curves.rank(3)[0]
sage: E.integral_points(both_signs=True) # less than 3 seconds
[(-3 : -1 : 1), (-3 : 0 : 1), (-2 : -4 : 1), (-2 : 3 : 1), ...(816 : -23310 : 1), (816 : 23309 : 1)]
Expand All @@ -299,6 +306,7 @@ points).

::

sage: # needs sage.libs.eclib
sage: E = elliptic_curves.rank(4)[0]
sage: E.integral_points(both_signs=True) # about a minute
[(-10 : 3 : 1), (-10 : 7 : 1), ...
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tutorial is the place to start. For example:
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
2 changes: 1 addition & 1 deletion src/doc/es/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lugar justo para empezar. Por ejemplo:
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
2 changes: 1 addition & 1 deletion src/doc/fr/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tutoriel est le bon endroit où commencer. Voici quelques exemples :
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
2 changes: 1 addition & 1 deletion src/doc/it/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Per esempio:
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Sageのかなりの部分がPythonを使って実装されているものの,
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs.sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
2 changes: 1 addition & 1 deletion src/doc/pt/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ certo para começar. Por exemplo:
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ru/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
2 changes: 1 addition & 1 deletion src/doc/zh/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Python 初学者指南 [PyB]_ 列出了许多选择。如果你只是想快速
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1

sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k
Expand Down
34 changes: 34 additions & 0 deletions src/sage/features/mwrank.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# sage_setup: distribution = sagemath-environment
r"""
Feature for testing the presence of the ``mwrank`` program (part
of eclib)
"""

from . import Executable, FeatureTestResult


class Mwrank(Executable):
r"""
A :class:`~sage.features.Feature` describing the presence of
the ``mwrank`` program.

EXAMPLES::

sage: from sage.features.mwrank import Mwrank
sage: Mwrank().is_present() # needs mwrank
FeatureTestResult('mwrank', True)
"""
def __init__(self):
r"""
TESTS::

sage: from sage.features.mwrank import Mwrank
sage: isinstance(Mwrank(), Mwrank)
True
"""
Executable.__init__(self, 'mwrank', executable='mwrank',
spkg='eclib', type='standard')


def all_features():
return [Mwrank()]
27 changes: 27 additions & 0 deletions src/sage/features/sagemath.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,33 @@ def __init__(self):
spkg='sagemath_ntl', type='standard')


class sage__libs__eclib(JoinFeature):
r"""
A :class:`sage.features.Feature` describing the presence of
:mod:`sage.libs.eclib`.

In addition to the modularization purposes that this tag serves,
it also provides attribution to the upstream project.

TESTS::

sage: from sage.features.sagemath import sage__libs__eclib
sage: sage__libs__eclib().is_present() # needs sage.libs.eclib
FeatureTestResult('sage.libs.eclib', True)
"""
def __init__(self):
r"""
TESTS::

sage: from sage.features.sagemath import sage__libs__eclib
sage: isinstance(sage__libs__eclib(), sage__libs__eclib)
True
"""
JoinFeature.__init__(self, 'sage.libs.eclib',
[PythonModule('sage.libs.eclib.mwrank')],
spkg='eclib', type='standard')


class sage__libs__giac(JoinFeature):
r"""
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.giac`.
Expand Down
1 change: 1 addition & 0 deletions src/sage/interfaces/mwrank.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: needs mwrank
r"""
Interface to mwrank
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/lfunctions/zero_sums.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ cdef class LFunctionZeroSum_EllipticCurve(LFunctionZeroSum_abstract):
0

sage: E = EllipticCurve([-39,123])
sage: E.rank()
sage: E.rank() # needs sage.libs.eclib
1
sage: Z = LFunctionZeroSum(E)
sage: Z.analytic_rank_upper_bound(max_Delta=1)
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/eclib/constructor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: needs sage.libs.eclib
"Cremona modular symbols"


Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/eclib/homspace.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: needs sage.libs.eclib
"Cremona modular symbols"

from cysignals.signals cimport sig_on, sig_off
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/eclib/interface.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: needs sage.libs.eclib
r"""
Sage interface to Cremona's ``eclib`` library (also known as ``mwrank``)

Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/eclib/mat.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: needs sage.libs.eclib
"""
Cremona matrices
"""
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/eclib/mwrank.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: needs sage.libs.eclib
"""
Cython interface to Cremona's ``eclib`` library (also known as ``mwrank``)

Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/eclib/newforms.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: needs sage.libs.eclib
"""
Modular symbols using eclib newforms
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ def block_matrix(*args, **kwds):
...
ValueError: an element of parent <class 'list'> was passed in,
but only matrices, vectors and ring elements are accepted
sage: matrix.block([
sage: matrix.block([ # needs sage.libs.eclib
....: [EllipticCurve('37a1').0],
....: ])
Traceback (most recent call last):
Expand Down
3 changes: 3 additions & 0 deletions src/sage/misc/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def benchmark(n=-1):

EXAMPLES::

sage: # needs sage.libs.eclib
sage: from sage.misc.benchmark import *
sage: _ = benchmark()
Running benchmark 0
Expand Down Expand Up @@ -105,6 +106,7 @@ def bench1():

BENCHMARK::

sage: # needs sage.libs.eclib
sage: from sage.misc.benchmark import *
sage: print(bench1()[0])
Find the Mordell-Weil group of the elliptic curve 5077A using mwrank
Expand Down Expand Up @@ -208,6 +210,7 @@ def bench7():

BENCHMARK::

sage: # needs sage.libs.eclib
sage: from sage.misc.benchmark import *
sage: print(bench7()[0])
Compute the Mordell-Weil group of y^2 = x^3 + 37*x - 997.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/misc/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ def regulator(x):
sage: x = polygen(ZZ, 'x')
sage: regulator(NumberField(x^2 - 2, 'a')) # needs sage.rings.number_field
0.881373587019543
sage: regulator(EllipticCurve('11a')) # needs sage.schemes
sage: regulator(EllipticCurve('11a')) # needs sage.schemes sage.libs.eclib
1.00000000000000
"""
return x.regulator()
Expand Down
1 change: 1 addition & 0 deletions src/sage/modular/modform/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@
These can be used to express the periods of `f` as exact
linear combinations of the real and the imaginary period of `E`::

sage: # needs sage.libs.eclib
sage: s = E.modular_symbol(sign=+1)
sage: t = E.modular_symbol(sign=-1, implementation='sage')
sage: s(3/11), t(3/11)
Expand Down Expand Up @@ -2761,7 +2762,7 @@
Testing modular forms of nontrivial character::

sage: F = ModularForms(DirichletGroup(17).0^2, 2).2
sage: F3 = F^3; F3

Check warning on line 2765 in src/sage/modular/modform/element.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.11, all)

Warning: slow doctest:

slow doctest:: Test ran for 5.22s cpu, 5.82s wall Check ran for 0.00s cpu, 0.00s wall
q^3 + (-3*zeta8^2 + 6)*q^4 + (-12*zeta8^2 + 3*zeta8 + 18)*q^5 + O(q^6)
sage: F3.qexp(6) == F.qexp(6)^3
True
Expand Down
2 changes: 2 additions & 0 deletions src/sage/modular/pollack_stevens/fund_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,7 @@ def prep_hecke_on_gen(self, l, gen, modulus=None):

EXAMPLES::

sage: # needs sage.libs.eclib
sage: E = EllipticCurve('11a')
sage: phi = E.pollack_stevens_modular_symbol()
sage: phi.values()
Expand Down Expand Up @@ -1518,6 +1519,7 @@ def prep_hecke_on_gen_list(self, l, gen, modulus=None):

EXAMPLES::

sage: # needs sage.libs.eclib
sage: E = EllipticCurve('11a')
sage: phi = E.pollack_stevens_modular_symbol()
sage: phi.values()
Expand Down
3 changes: 3 additions & 0 deletions src/sage/modular/pollack_stevens/manin_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

EXAMPLES::

sage: # needs sage.libs.eclib
sage: E = EllipticCurve('11a')
sage: phi = E.pollack_stevens_modular_symbol()
sage: phi
Expand Down Expand Up @@ -779,6 +780,7 @@ def hecke(self, ell, algorithm='prep'):

EXAMPLES::

sage: # needs sage.libs.eclib
sage: E = EllipticCurve('11a')
sage: phi = E.pollack_stevens_modular_symbol()
sage: phi.values()
Expand Down Expand Up @@ -831,6 +833,7 @@ def p_stabilize(self, p, alpha, V):

EXAMPLES::

sage: # needs.sage.libs.eclib
sage: E = EllipticCurve('11a')
sage: phi = E.pollack_stevens_modular_symbol()
sage: f = phi._map
Expand Down
Loading
Loading