Skip to content

Commit

Permalink
New package: sagemath-9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tornaria authored and leahneukirchen committed Feb 3, 2022
1 parent c351fbe commit 9289a1a
Show file tree
Hide file tree
Showing 17 changed files with 1,073 additions and 0 deletions.
397 changes: 397 additions & 0 deletions srcpkgs/sagemath/files/timings2.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- do not link ratpoints where it's not used

--- a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
+++ b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
@@ -1,5 +1,3 @@
-# distutils: libraries = ratpoints
-
r"""
Descent on elliptic curves over `\QQ` with a 2-isogeny
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- fix _get_shared_lib_path() so we don't need to configure GAP_SO

--- a/src/sage/env.py
+++ b/src/sage/env.py
@@ -293,7 +293,7 @@ def _get_shared_lib_path(*libnames: str) -> Optional[str]:
if sys.platform == 'darwin':
ext = 'dylib'
else:
- ext = 'so'
+ ext = 'so*'

if SAGE_LOCAL:
search_directories.append(Path(SAGE_LOCAL) / 'lib')
20 changes: 20 additions & 0 deletions srcpkgs/sagemath/patches/03-doctest_have_program.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- we don't know `SAGE_VENV/bin` contains `sage`, but `sys.argv[0]` should
be the full path to `sage-ipython` and the same directory should have `sage`

--- a/src/sage/misc/sage_ostools.pyx
+++ b/src/sage/misc/sage_ostools.pyx
@@ -32,12 +32,11 @@ def have_program(program, path=None):
True
sage: have_program('there_is_not_a_program_with_this_name')
False
- sage: from sage.env import SAGE_VENV
- sage: have_program('sage', os.path.join(SAGE_VENV, 'bin'))
+ sage: have_program('sage', os.path.dirname(sys.argv[0]))
True
sage: have_program('sage', '/there_is_not_a_path_with_this_name')
False
- sage: have_program('there_is_not_a_program_with_this_name', os.path.join(SAGE_VENV, 'bin'))
+ sage: have_program('there_is_not_a_program_with_this_name', "/bin")
False
"""
if path is None:
22 changes: 22 additions & 0 deletions srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- add one doctest for coverage

--- a/src/sage/misc/sageinspect.py
+++ b/src/sage/misc/sageinspect.py
@@ -1341,10 +1342,12 @@ def sage_getfile(obj):
EXAMPLES::

sage: from sage.misc.sageinspect import sage_getfile
- sage: sage_getfile(sage.rings.rational)[-23:]
- 'sage/rings/rational.pyx'
- sage: sage_getfile(Sq)[-42:]
- 'sage/algebras/steenrod/steenrod_algebra.py'
+ sage: sage_getfile(sage.rings.rational)
+ '...sage/rings/rational.pyx'
+ sage: sage_getfile(Sq)
+ '...sage/algebras/steenrod/steenrod_algebra.py'
+ sage: sage_getfile(x)
+ '...sage/symbolic/expression.pyx'

The following tests against some bugs fixed in :trac:`9976`::


16 changes: 16 additions & 0 deletions srcpkgs/sagemath/patches/05-fix_sage_getfile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- fix sage_getfile() by checking all possible EXTENSION_SUFFIXES

--- a/src/sage/misc/sageinspect.py
+++ b/src/sage/misc/sageinspect.py
@@ -1400,8 +1403,9 @@ def sage_getfile(obj):
sourcefile = inspect.getabsfile(obj)
except TypeError: # this happens for Python builtins
return ''
- if sourcefile.endswith(loadable_module_extension()):
- return sourcefile[:-len(loadable_module_extension())]+os.path.extsep+'pyx'
+ for suffix in import_machinery.EXTENSION_SUFFIXES:
+ if sourcefile.endswith(suffix):
+ return sourcefile[:-len(suffix)]+os.path.extsep+'pyx'
return sourcefile


15 changes: 15 additions & 0 deletions srcpkgs/sagemath/patches/07-ignore_warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- this ignores a warning caused by old notebook

--- a/src/sage/all.py
+++ b/src/sage/all.py
@@ -100,6 +100,9 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
message='The distutils(.sysconfig module| package) is deprecated',
module='Cython|distutils|numpy|sage.env|sage.features')

+warnings.filterwarnings('ignore', category=DeprecationWarning,
+ message=r"invalid escape sequence '\\s'")
+
################ end setup warnings ###############################



27 changes: 27 additions & 0 deletions srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- using pytest is broken, see #31924

--- a/src/bin/sage-runtests
+++ b/src/bin/sage-runtests
@@ -154,21 +154,4 @@ if __name__ == "__main__":
DC = DocTestController(args, args.filenames)
err = DC.run()

- try:
- exit_code_pytest = 0
- import pytest
- pytest_options = ["--import-mode", "importlib"]
- if args.verbose:
- pytest_options.append("-v")
- exit_code_pytest = pytest.main(pytest_options + args.filenames)
- if exit_code_pytest == 5:
- # Exit code 5 means there were no test files, pass in this case
- exit_code_pytest = 0
-
- except ModuleNotFoundError:
- print("Pytest is not installed, skip checking tests that rely on it.")
-
- if err == 0:
- sys.exit(exit_code_pytest)
- else:
- sys.exit(err)
+ sys.exit(err)
14 changes: 14 additions & 0 deletions srcpkgs/sagemath/patches/09-doctest_numerical_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- This fixes a doctest failure due to a small numerical issue when running
maxima-sbcl on 32 bit

--- a/src/sage/interfaces/maxima_abstract.py
+++ b/src/sage/interfaces/maxima_abstract.py
@@ -1525,7 +1525,7 @@ class MaximaAbstractElement(ExtraTabCompletion, InterfaceElement):
EXAMPLES::

sage: maxima('exp(-sqrt(x))').nintegral('x',0,1)
- (0.5284822353142306, 4.1633141378838...e-11, 231, 0)
+ (0.5284822353142306, 4.163...e-11, 231, 0)

Note that GP also does numerical integration, and can do so to very
high precision very quickly::
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/src/sage/rings/polynomial/polynomial_zmod_flint.pyx
+++ b/src/sage/rings/polynomial/polynomial_zmod_flint.pyx
@@ -237,8 +237,9 @@ cdef class Polynomial_zmod_flint(Polynomial_template):

sage: a = ZZ['x'](range(100000))
sage: R = Integers(3)['x']
- sage: R(a) # long time (7s on sage.math, 2013)
- 2*x^99998 + ... + x
+ sage: p = R(a)
+ sage: p.truncate(10) # testing the whole poly is VERY SLOW
+ 2*x^8 + x^7 + 2*x^5 + x^4 + 2*x^2 + x
"""
sig_on()
fmpz_poly_get_nmod_poly(&self.x, x)
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
diff --git a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
index 43727346269..9d3ccd475cd 100644
--- a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
+++ b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
@@ -186,7 +186,7 @@ def Psi(l, use_stored=True):
sage: assert Psi(3, use_stored=True) == Psi(3, use_stored=False)
sage: assert Psi(5, use_stored=True) == Psi(5, use_stored=False)
sage: assert Psi(7, use_stored=True) == Psi(7, use_stored=False)
- sage: assert Psi(13, use_stored=True) == Psi(13, use_stored=False) # not tested (very long time)
+ sage: assert Psi(13, use_stored=True) == Psi(13, use_stored=False) # long time (2s)
"""
if l not in [2, 3, 5, 7, 13]:
raise ValueError("Genus zero primes are 2, 3, 5, 7 or 13.")
@@ -1207,7 +1207,7 @@ def isogenies_13_0(E, minimal_models=True):
sage: K.<a> = NumberField(f)
sage: E = EllipticCurve(j=K(0)); E.ainvs()
(0, 0, 0, 0, 1)
- sage: [phi.codomain().ainvs() for phi in isogenies_13_0(E)]
+ sage: [phi.codomain().ainvs() for phi in isogenies_13_0(E)] # long time (4s)
[(0,
0,
20360599/165164973653422080*a^11 - 3643073/41291243413355520*a^10 - 101/8789110986240*a^9 + 5557619461/573489491852160*a^8 - 82824971/11947697746920*a^7 - 19487/21127670640*a^6 - 475752603733/29409717530880*a^5 + 87205112531/7352429382720*a^4 + 8349/521670880*a^3 + 5858744881/12764634345*a^2 - 1858703809/2836585410*a + 58759402/48906645,
@@ -1325,7 +1325,7 @@ def isogenies_13_1728(E, minimal_models=True):
sage: f = x^12 + 1092*x^10 - 432432*x^8 + 6641024*x^6 - 282896640*x^4 - 149879808*x^2 - 349360128
sage: K.<a> = NumberField(f)
sage: E = EllipticCurve(K, [1,0])
- sage: [phi.codomain().ainvs() for phi in isogenies_13_1728(E)]
+ sage: [phi.codomain().ainvs() for phi in isogenies_13_1728(E)] # long time (3s)
[(0,
0,
0,
@@ -1550,8 +1550,11 @@ def Psi2(l):
sage: from sage.schemes.elliptic_curves.isogeny_small_degree import Psi2
sage: Psi2(11)
x^5 - 55*x^4*u + 994*x^3*u^2 - 8774*x^2*u^3 + 41453*x*u^4 - 928945/11*u^5 + 33*x^4 + 276*x^3*u - 7794*x^2*u^2 + 4452*x*u^3 + 1319331/11*u^4 + 216*x^3*v - 4536*x^2*u*v + 31752*x*u^2*v - 842616/11*u^3*v + 162*x^3 + 38718*x^2*u - 610578*x*u^2 + 33434694/11*u^3 - 4536*x^2*v + 73872*x*u*v - 2745576/11*u^2*v - 16470*x^2 + 580068*x*u - 67821354/11*u^2 - 185976*x*v + 14143896/11*u*v + 7533*x - 20437029/11*u - 12389112/11*v + 19964151/11
- sage: Psi2(71) # long time (1 second)
- -2209380711722505179506258739515288584116147237393815266468076436521/71*u^210 + ... - 14790739586438315394567393301990769678157425619440464678252277649/71
+ sage: f = Psi2(71)
+ sage: f.coefficient([0, 210, 0])
+ -2209380711722505179506258739515288584116147237393815266468076436521/71
+ sage: f.coefficient([0, 0, 0])
+ -14790739586438315394567393301990769678157425619440464678252277649/71

TESTS::

@@ -1665,17 +1668,17 @@ def isogenies_prime_degree_genus_plus_0(E, l=None, minimal_models=True):
sage: K = QuadraticField(5,'a')
sage: a = K.gen()
sage: E = EllipticCurve_from_j(184068066743177379840*a - 411588709724712960000)
- sage: isogenies_prime_degree_genus_plus_0(E, 47) # long time (4.3s)
+ sage: isogenies_prime_degree_genus_plus_0(E, 47) # long time (2s)
[Isogeny of degree 47 from Elliptic Curve defined by y^2 = x^3 + (454562028554080355857852049849975895490560*a-1016431595837124114668689286176511361024000)*x + (-249456798429896080881440540950393713303830363999480904280965120*a+557802358738710443451273320227578156598454035482869042774016000) over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790? to Elliptic Curve defined by y^2 = x^3 + (39533118442361013730577638493616965245992960*a-88398740199669828340617478832005245173760000)*x + (214030321479466610282320528611562368963830105830555363061803253760*a-478586348074220699687616322532666163722004497458452316582576128000) over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?]

sage: K = QuadraticField(-66827,'a')
sage: a = K.gen()
sage: E = EllipticCurve_from_j(-98669236224000*a + 4401720074240000)
- sage: isogenies_prime_degree_genus_plus_0(E, 59) # long time (25s, 2012)
+ sage: isogenies_prime_degree_genus_plus_0(E, 59) # long time (5s)
[Isogeny of degree 59 from Elliptic Curve defined by y^2 = x^3 + (2605886146782144762297974784000*a+1893681048912773634944634716160000)*x + (-116918454256410782232296183198067568744071168000*a+17012043538294664027185882358514011304812871680000) over Number Field in a with defining polynomial x^2 + 66827 with a = 258.5091874576221?*I to Elliptic Curve defined by y^2 = x^3 + (-19387084027159786821400775098368000*a-4882059104868154225052787156713472000)*x + (-25659862010101415428713331477227179429538847260672000*a-2596038148441293485938798119003462972840818381946880000) over Number Field in a with defining polynomial x^2 + 66827 with a = 258.5091874576221?*I]

sage: E = EllipticCurve_from_j(GF(13)(5))
- sage: isogenies_prime_degree_genus_plus_0(E, 71) # long time
+ sage: isogenies_prime_degree_genus_plus_0(E, 71)
[Isogeny of degree 71 from Elliptic Curve defined by y^2 = x^3 + x + 4 over Finite Field of size 13 to Elliptic Curve defined by y^2 = x^3 + 10*x + 7 over Finite Field of size 13, Isogeny of degree 71 from Elliptic Curve defined by y^2 = x^3 + x + 4 over Finite Field of size 13 to Elliptic Curve defined by y^2 = x^3 + 10*x + 7 over Finite Field of size 13]

sage: E = EllipticCurve(GF(13),[0,1,1,1,0])
@@ -2117,11 +2120,11 @@ def isogenies_prime_degree_general(E, l, minimal_models=True):
sage: isogenies_prime_degree_general(E, 19)
[Isogeny of degree 19 from Elliptic Curve defined by y^2 + y = x^3 - 1862*x - 30956 over Rational Field to Elliptic Curve defined by y^2 + y = x^3 - 672182*x + 212325489 over Rational Field]
sage: E = EllipticCurve([0, -1, 0, -6288, 211072])
- sage: isogenies_prime_degree_general(E, 37) # long time (10s)
+ sage: isogenies_prime_degree_general(E, 37) # long time (2s)
[Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 - x^2 - 6288*x + 211072 over Rational Field to Elliptic Curve defined by y^2 = x^3 - x^2 - 163137088*x - 801950801728 over Rational Field]

sage: E = EllipticCurve([-3440, 77658])
- sage: isogenies_prime_degree_general(E, 43) # long time (16s)
+ sage: isogenies_prime_degree_general(E, 43) # long time (2s)
[Isogeny of degree 43 from Elliptic Curve defined by y^2 = x^3 - 3440*x + 77658 over Rational Field to Elliptic Curve defined by y^2 = x^3 - 6360560*x - 6174354606 over Rational Field]

Isogenies of degree equal to the characteristic are computed (but
@@ -2175,7 +2178,7 @@ def isogenies_prime_degree_general(E, l, minimal_models=True):

sage: K.<i> = QuadraticField(-1)
sage: E = EllipticCurve(K,[0,0,0,1,0])
- sage: [phi.codomain().ainvs() for phi in E.isogenies_prime_degree(37)] # long time
+ sage: [phi.codomain().ainvs() for phi in E.isogenies_prime_degree(37)] # long time (6s)
[(0, 0, 0, -840*i + 1081, 0), (0, 0, 0, 840*i + 1081, 0)]
"""
if not l.is_prime():
@@ -2329,14 +2332,14 @@ def isogenies_prime_degree(E, l, minimal_models=True):
sage: E = EllipticCurve(GF(101), [-3440, 77658])
sage: E.isogenies_prime_degree(71) # fast
[]
- sage: E.isogenies_prime_degree(73) # slower (2s)
+ sage: E.isogenies_prime_degree(73) # long time (2s)
[]

Test that :trac:`32269` is fixed::

sage: K = QuadraticField(-11)
sage: E = EllipticCurve(K, [0,1,0,-117,-541])
- sage: E.isogenies_prime_degree(37)
+ sage: E.isogenies_prime_degree(37) # long time (9s)
[Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 + x^2 + (-117)*x + (-541) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I to Elliptic Curve defined by y^2 = x^3 + x^2 + (30800*a+123963)*x + (3931312*a-21805005) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I,
Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 + x^2 + (-117)*x + (-541) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I to Elliptic Curve defined by y^2 = x^3 + x^2 + (-30800*a+123963)*x + (-3931312*a-21805005) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I]

Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
--- a/src/sage/rings/function_field/function_field.py
+++ b/src/sage/rings/function_field/function_field.py
@@ -111,22 +111,21 @@ Function fields over the algebraic field are supported::
sage: m = L.completion(pl, prec=5)
sage: m(x)
I + s + O(s^5)
- sage: m(y)
+ sage: m(y) # long time (4s)
-2*s + (-4 - I)*s^2 + (-15 - 4*I)*s^3 + (-75 - 23*I)*s^4 + (-413 - 154*I)*s^5 + O(s^6)
- sage: m(y)^2 + m(y) + m(x) + 1/m(x)
+ sage: m(y)^2 + m(y) + m(x) + 1/m(x) # long time (8s)
O(s^5)

TESTS::

sage: TestSuite(J).run()
- sage: TestSuite(K).run(max_runs=1024) # long time (5s)
- sage: TestSuite(L).run(max_runs=64) # long time (10s)
- sage: TestSuite(M).run(max_runs=32) # long time (30s)
- sage: TestSuite(N).run(max_runs=64, skip = '_test_derivation') # long time (8s)
- sage: TestSuite(O).run(max_runs=128, skip = '_test_derivation') # long time (8s)
-
+ sage: TestSuite(K).run(max_runs=256) # long time (10s)
+ sage: TestSuite(L).run(max_runs=8) # long time (25s)
+ sage: TestSuite(M).run(max_runs=8) # long time (35s)
+ sage: TestSuite(N).run(max_runs=8, skip = '_test_derivation') # long time (15s)
+ sage: TestSuite(O).run()
sage: TestSuite(R).run()
- sage: TestSuite(S).run() # long time (3s)
+ sage: TestSuite(S).run() # long time (4s)

Global function fields
----------------------
@@ -287,7 +286,7 @@ class FunctionField(Field):
TESTS::

sage: K.<x> = FunctionField(QQ)
- sage: TestSuite(K).run()
+ sage: TestSuite(K).run() # long time (3s)
"""
Field.__init__(self, base_field, names=names, category=category)

@@ -729,7 +728,7 @@ class FunctionField(Field):
EXAMPLES::

sage: K.<x> = FunctionField(QQ)
- sage: TestSuite(K).run() # indirect doctest
+ sage: TestSuite(K).run() # indirect doctest, long time (3s)
"""
tester = self._tester(**options)
S = tester.some_elements()
@@ -1209,7 +1208,7 @@ class FunctionField_polymod(FunctionField):
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L = K.extension(y^5 - x^3 - 3*x + x*y); L
Function field in y defined by y^5 + x*y - x^3 - 3*x
- sage: TestSuite(L).run() # long time
+ sage: TestSuite(L).run(max_runs=512) # long time (15s)

We can set the variable name, which doesn't have to be y::

@@ -2888,7 +2887,8 @@ class FunctionField_simple(FunctionField_polymod):
sage: F.<y> = K.extension(Y^3 - x^2*(x^2 + x + 1)^2)
sage: O = K.maximal_order()
sage: pls = [O.ideal(x-QQbar(sqrt(c))).place() for c in [-2, -1, 0, 1, 2]]
- sage: all(q.place_below() == p for p in pls for q in F.places_above(p))
+ sage: all(q.place_below() == p # long time (4s)
+ ....: for p in pls for q in F.places_above(p))
True
"""
R = self.base_field()
@@ -3091,7 +3091,7 @@ class FunctionField_global(FunctionField_simple):

sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]
sage: L.<y> = K.extension((1 - x)*Y^7 - x^3)
- sage: L.gaps()
+ sage: L.gaps() # long time (6s)
[1, 2, 3]

or may define a trivial extension::
@@ -3111,7 +3111,7 @@ class FunctionField_global(FunctionField_simple):

sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))
- sage: TestSuite(L).run()
+ sage: TestSuite(L).run() # long time (7s)
"""
FunctionField_polymod.__init__(self, polynomial, names)

@@ -3807,7 +3807,7 @@ class RationalFunctionField(FunctionField):

sage: K.<t> = FunctionField(CC); K
Rational function field in t over Complex Field with 53 bits of precision
- sage: TestSuite(K).run()
+ sage: TestSuite(K).run() # long time (5s)

sage: FunctionField(QQ[I], 'alpha')
Rational function field in alpha over Number Field in I with defining polynomial x^2 + 1 with I = 1*I
Loading

0 comments on commit 9289a1a

Please sign in to comment.