From 5d152512a8d7045fc17abbd99c272c42fe20cf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 30 Jan 2023 11:04:46 -0300 Subject: [PATCH 1/2] brial: update to 1.2.12. --- srcpkgs/brial/template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/srcpkgs/brial/template b/srcpkgs/brial/template index 8f988c1296c6..2f8e195a8804 100644 --- a/srcpkgs/brial/template +++ b/srcpkgs/brial/template @@ -1,6 +1,6 @@ # Template file for 'brial' pkgname=brial -version=1.2.11 +version=1.2.12 revision=1 build_style=gnu-configure hostmakedepends="pkg-config" @@ -9,8 +9,9 @@ short_desc="BRiAl (Boolean Ring Algebra) is the successor to PolyBoRi" maintainer="Gonzalo Tornaría " license="GPL-2.0-or-later" homepage="https://github.com/BRiAl/BRiAl" +changelog="https://github.com/BRiAl/BRiAl/releases" distfiles="https://github.com/BRiAl/BRiAl/releases/download/$version/brial-$version.tar.bz2" -checksum=6c0f622009dcd9928295d748226baa9cdc1a87c32552e13772fddf95bbb6f02c +checksum=ca009e3722dd3f0a60d15501caed1413146c80abced57423e32ae0116f407494 if [ -n "$CROSS_BUILD" ]; then configure_args+=" --with-boost-unit-test-framework=no" From d1ea2ee3ae5ae9e7a255c13d021540e8410a3ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 2 Feb 2023 19:03:34 -0300 Subject: [PATCH 2/2] sagemath: rebuild for updates Also: - rebuild for boost update in sync with brial (same PR) - fixes for numpy 1.24 (already updated) - fixes to support updating giac to 1.9.0.37 - fixes to support updating tachyon 0.99.5 - fixes to doctest failures in 32 bit after upgrade of pari to 2.15.2 - fix an edge case of python 3.11 integer conversion on 32 bit - fix singular interface bug that triggers under very heavy load (e.g. on CI) - tarball was moved; sha256 changed only b/c of main dirname change --- ...4623a4b7404f5e4f9d152366d53e9c21cfa6.patch | 75 ++++ ...1c2fc8bcfb5e6555716d05ce70511795ffa1.patch | 106 +++++ .../trac-34537-sagemath-pari-2.15c.patch | 403 ++++++++++++++++++ .../patches/trac-34816-numpy_1.24.patch | 76 ++++ ...c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch | 65 +++ .../zz-fix_edge_case_of_integer_check.patch | 38 ++ srcpkgs/sagemath/template | 6 +- srcpkgs/sagemath/update | 2 + 8 files changed, 768 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch create mode 100644 srcpkgs/sagemath/patches/trac-33907-fix_singular_interface-6f5c1c2fc8bcfb5e6555716d05ce70511795ffa1.patch create mode 100644 srcpkgs/sagemath/patches/trac-34537-sagemath-pari-2.15c.patch create mode 100644 srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch create mode 100644 srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch create mode 100644 srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch create mode 100644 srcpkgs/sagemath/update diff --git a/srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch b/srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch new file mode 100644 index 000000000000..77c0dcb9a95b --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch @@ -0,0 +1,75 @@ +From 55c04623a4b7404f5e4f9d152366d53e9c21cfa6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= +Date: Wed, 21 Dec 2022 19:43:02 -0300 +Subject: Trac #23712: support tachyon >= 0.99.2 + +In tachyon 0.99.2 the keyword `focallength` was changed to `focaldist`. +To support it, when running on version >= 0.99.2 we "patch" the model as +constructed by class `sage.plot.plot3d.tachyon.Tachyon`. + +In the future (possibly when tachyon in sage gets upgraded), all the +focallength occurences in sage.plot.plot3d.tachyon can be replaced by +focaldist for consistency with new tachyon, and the logic here can be +reversed (i.e. patch the model when self.version() < '0.99.2') or just +drop support for old versions. +--- + src/sage/interfaces/tachyon.py | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py +index 23671e5..21cc1db 100644 +--- a/src/sage/interfaces/tachyon.py ++++ b/src/sage/interfaces/tachyon.py +@@ -683,12 +683,14 @@ properly. + #***************************************************************************** + + import os ++import re + + from sage.cpython.string import bytes_to_str + from sage.misc.pager import pager + from sage.misc.superseded import deprecation + from sage.misc.temporary_file import tmp_filename + from sage.structure.sage_object import SageObject ++from sage.misc.cachefunc import cached_method + + + class TachyonRT(SageObject): +@@ -799,6 +801,11 @@ class TachyonRT(SageObject): + Parser failed due to an input file syntax error. + Aborting render. + """ ++ if self.version() >= '0.99.2': ++ # this keyword was changed in 0.99.2 ++ model = model.replace( ++ " focallength ", ++ " focaldist ") + modelfile = tmp_filename(ext='.dat') + with open(modelfile, 'w') as file: + file.write(model) +@@ -851,6 +858,22 @@ class TachyonRT(SageObject): + else: + print(r) + ++ @cached_method ++ def version(self): ++ """ ++ Returns the version of the Tachyon raytracer being used. ++ ++ TESTS:: ++ ++ sage: tachyon_rt.version() # not tested ++ 0.98.9 ++ sage: tachyon_rt.version() >= '0.98.9' ++ True ++ """ ++ with os.popen('tachyon') as f: ++ r = f.read() ++ return re.search(r"Version ([\d.]*)", r)[1] ++ + def help(self, use_pager=True): + """ + Deprecated: type 'sage.interfaces.tachyon?' for help +-- +cgit v1.0-1-gd88e + diff --git a/srcpkgs/sagemath/patches/trac-33907-fix_singular_interface-6f5c1c2fc8bcfb5e6555716d05ce70511795ffa1.patch b/srcpkgs/sagemath/patches/trac-33907-fix_singular_interface-6f5c1c2fc8bcfb5e6555716d05ce70511795ffa1.patch new file mode 100644 index 000000000000..3db3bb94cdcf --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-33907-fix_singular_interface-6f5c1c2fc8bcfb5e6555716d05ce70511795ffa1.patch @@ -0,0 +1,106 @@ +From 6f5c1c2fc8bcfb5e6555716d05ce70511795ffa1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= +Date: Fri, 16 Dec 2022 15:25:38 -0300 +Subject: Trac 33907: fix singular interface + +This essentially reverts 85f65bf and a10d19d from trac #31846. +It turns out this was originaly written for #30945, but that issue was +fixed by upgrading cysignals. + +Singular really needs a custom `_send_interrupt()` method, because the +default one will quit singular. Moreover, this handles two quirks of +singular: + + - a small delay before sending `chr(3)` works around a bug in singular. + - sometimes one needs to send `;` a few times after interrupt to get + back a prompt. + +The original author of the custom `_send_interrupt()` is Jeroen Demeyer +in commit 17d23e9 (trac #10476). I changed the timeout for a smaller +one, and rewrote the doctest to call `interrupt()` explicitly instead of +using `alarm()` which introduces more noise. +--- + src/sage/interfaces/expect.py | 1 - + src/sage/interfaces/singular.py | 47 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 47 insertions(+), 1 deletion(-) + +diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py +index c4dc2d4..eb25daf 100644 +--- a/src/sage/interfaces/expect.py ++++ b/src/sage/interfaces/expect.py +@@ -941,7 +941,6 @@ If this all works, you can then make calls like: + The interface still works after this interrupt:: + + sage: singular('2+3') +- Singular crashed -- automatically restarting. + 5 + + Last, we demonstrate that by default the execution of a command +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index 9c9586d..2c377f0 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -341,6 +341,7 @@ import re + import sys + import pexpect + import shlex ++import time + + from .expect import Expect, ExpectElement, FunctionElement, ExpectFunction + +@@ -508,6 +509,52 @@ class Singular(ExtraTabCompletion, Expect): + """ + return 'quit;' + ++ def _send_interrupt(self): ++ """ ++ Send an interrupt to Singular. If needed, additional ++ semi-colons are sent until we get back at the prompt. ++ ++ TESTS: ++ ++ The following works without restarting Singular:: ++ ++ sage: a = singular(1) ++ sage: _ = singular._expect.sendline('while(1){};') ++ sage: singular.interrupt() ++ True ++ ++ We can still access a:: ++ ++ sage: 2*a ++ 2 ++ ++ Interrupting nothing or unfinished input also works:: ++ ++ sage: singular.interrupt() ++ True ++ sage: _ = singular._expect.sendline('1+') ++ sage: singular.interrupt() ++ True ++ sage: 3*a ++ 3 ++ ++ """ ++ # Work around for Singular bug ++ # http://www.singular.uni-kl.de:8002/trac/ticket/727 ++ time.sleep(0.1) ++ ++ E = self._expect ++ E.sendline(chr(3)) ++ # The following is needed so interrupt() works even when ++ # there is no computation going on. ++ for i in range(5): ++ try: ++ E.expect_upto(self._prompt, timeout=0.1) ++ return ++ except pexpect.TIMEOUT: ++ pass ++ E.sendline(";") ++ + def _read_in_file_command(self, filename): + r""" + EXAMPLES:: +-- +cgit v1.0-1-gd88e + diff --git a/srcpkgs/sagemath/patches/trac-34537-sagemath-pari-2.15c.patch b/srcpkgs/sagemath/patches/trac-34537-sagemath-pari-2.15c.patch new file mode 100644 index 000000000000..e199fff237e7 --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-34537-sagemath-pari-2.15c.patch @@ -0,0 +1,403 @@ +From 77b7786c653d5dd3c9b3040e895643798f3f6fb2 Mon Sep 17 00:00:00 2001 +From: John Cremona +Date: Thu, 5 Jan 2023 10:31:52 +0000 +Subject: [PATCH 1/5] #34537: make number_field_element tests more robust + +--- + .../number_field/number_field_element.pyx | 51 ++++++++++--------- + 1 file changed, 27 insertions(+), 24 deletions(-) + +diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx +index 8330dea3b35..bbe5b90fb34 100644 +--- a/src/sage/rings/number_field/number_field_element.pyx ++++ b/src/sage/rings/number_field/number_field_element.pyx +@@ -1637,10 +1637,10 @@ cdef class NumberFieldElement(FieldElement): + sage: K. = NumberField(x^3 + x + 1) + sage: Q. = K[] + sage: L. = NumberField(X^4 + a) +- sage: t = (-a).is_norm(L, element=True); t +- (True, -b^3 - 1) +- sage: t[1].norm(K) +- -a ++ sage: t, u = (-a).is_norm(L, element=True); u # random (not unique) ++ b^3 + 1 ++ sage: t and u.norm(K) == -a ++ True + + Verify that :trac:`27469` has been fixed:: + +@@ -1648,8 +1648,7 @@ cdef class NumberFieldElement(FieldElement): + Cyclotomic Field of order 24 and degree 8 + sage: K = L.subfield(z24^3, 'z8')[0]; K + Number Field in z8 with defining polynomial x^4 + 1 with z8 = 0.7071067811865475? + 0.7071067811865475?*I +- sage: flag, c = K(-7).is_norm(K, element=True) +- sage: flag ++ sage: flag, c = K(-7).is_norm(K, element=True); flag + True + sage: c.norm(K) + -7 +@@ -1746,30 +1745,34 @@ cdef class NumberFieldElement(FieldElement): + sage: K. = NumberField(x^3 + x^2 - 2*x - 1, 'a') + sage: P. = K[] + sage: L = NumberField(X^2 + a^2 + 2*a + 1, 'b') +- sage: K(17)._rnfisnorm(L) # representation depends, not tested +- ((a^2 - 2)*b - 4, 1) ++ sage: y, q = K(17)._rnfisnorm(L) ++ sage: q==1 ++ True ++ sage: y # random (not unique) ++ (a^2 - 2)*b - 4 + + sage: K. = NumberField(x^3 + x + 1) + sage: Q. = K[] + sage: L. = NumberField(X^4 + a) +- sage: t = (-a)._rnfisnorm(L); t +- (-b^3 - 1, 1) +- sage: t[0].norm(K) +- -a +- sage: t = K(3)._rnfisnorm(L); t ++ sage: y, q = (-a)._rnfisnorm(L) ++ sage: y # random (not unique) ++ b^3 + 1 ++ sage: q == 1 and y.norm(K) == -a ++ True ++ sage: y, q = K(3)._rnfisnorm(L); y, q # random (not unique) + (b^3 + a*b^2 + a^2*b - 1, 3*a^2 - 3*a + 6) +- sage: t[0].norm(K)*t[1] +- 3 ++ sage: y.norm(K)*q == 3 ++ True + + An example where the base field is a relative field:: + + sage: K. = NumberField([x^2 - 2, x^2 - 3]) + sage: L. = K.extension(x^3 + 2) + sage: s = 2*a + b +- sage: t = s._rnfisnorm(L) +- sage: t[1] == 1 # True iff s is a norm ++ sage: y, q = s._rnfisnorm(L) ++ sage: q == 1 # True iff s is a norm + False +- sage: s == t[0].norm(K)*t[1] ++ sage: s == y.norm(K)*q + True + + TESTS: +@@ -1779,7 +1782,9 @@ cdef class NumberFieldElement(FieldElement): + + sage: K. = NumberField(x^2 + 1/2) + sage: L. = K.extension(x^2 - 1/2) +- sage: a._rnfisnorm(L) ++ sage: y, q = a._rnfisnorm(L) ++ sage: y # random (not unique) ++ q == 1 and y.norm(K) == a + (a*b + a + 1/2, 1) + + We test the above doctest, which was not tested. +@@ -1788,12 +1793,10 @@ cdef class NumberFieldElement(FieldElement): + sage: K. = NumberField(x^3 + x^2 - 2*x - 1, 'a') + sage: P. = K[] + sage: L. = NumberField(X^2 + a^2 + 2*a + 1, 'b') +- sage: (xbar, q) = K(17)._rnfisnorm(L) +- sage: q == 1 +- 1 +- sage: xbar.norm() ++ sage: y, q = K(17)._rnfisnorm(L) ++ sage: y.norm() + 4913 +- sage: xbar in ((a^2 - 2)*b - 4, (a^2 - 2)*b + 4) ++ sage: q == 1 and y in ((a^2 - 2)*b - 4, (a^2 - 2)*b + 4) + True + + AUTHORS: +-- +2.39.1 + + +From 37dcd374ce2f63b38b3f3be27cc10fb5eb5256c2 Mon Sep 17 00:00:00 2001 +From: John Cremona +Date: Thu, 5 Jan 2023 10:51:05 +0000 +Subject: [PATCH 2/5] #34537: make number_field_ideal_rel tests more robust + +--- + .../number_field/number_field_ideal_rel.py | 20 +++++++++---------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/src/sage/rings/number_field/number_field_ideal_rel.py b/src/sage/rings/number_field/number_field_ideal_rel.py +index f64bd5b761c..192c8f15034 100644 +--- a/src/sage/rings/number_field/number_field_ideal_rel.py ++++ b/src/sage/rings/number_field/number_field_ideal_rel.py +@@ -204,8 +204,6 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal): + r""" + Convert the absolute ideal id to a relative number field ideal. + +- Assumes id.number_field() == self.absolute_field('a'). +- + WARNING: This is an internal helper function. + + TESTS:: +@@ -218,18 +216,18 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal): + True + sage: J.absolute_norm() + 22584817 +- sage: J.absolute_ideal() +- Fractional ideal (22584817, -1473/812911*a^5 + 8695/4877466*a^4 - 1308209/4877466*a^3 + 117415/443406*a^2 - 22963264/2438733*a - 13721081784272/2438733) +- sage: J.absolute_ideal().norm() ++ sage: Labs. = L.absolute_field(); Labs # random (polynomial not unique) ++ Number Field in c with defining polynomial x^6 + 217*x^4 - 2*x^3 + 15127*x^2 + 422*x + 338032 ++ sage: Jabs = J.absolute_ideal(names='c') ++ sage: Jabs == Labs.ideal(22584817, -1473/812911*c^5 + 8695/4877466*c^4 - 1308209/4877466*c^3 + 117415/443406*c^2 - 22963264/2438733*c - 13721081784272/2438733) ++ True ++ sage: Jabs.norm() + 22584817 +- +- sage: J._from_absolute_ideal(J.absolute_ideal()) == J ++ sage: J._from_absolute_ideal(Jabs) == J + True + """ +- L = self.number_field() +- K = L.absolute_field('a') +- to_L = K.structure()[0] +- return L.ideal([to_L(_) for _ in id.gens()]) ++ f, _ = id.number_field().structure() ++ return self.number_field().ideal([f(_) for _ in id.gens()]) + + def free_module(self): + r""" +-- +2.39.1 + + +From 52e18fba1a4d77ddae9b27a94e736a940ab25ac3 Mon Sep 17 00:00:00 2001 +From: John Cremona +Date: Thu, 5 Jan 2023 11:30:39 +0000 +Subject: [PATCH 3/5] #34537: make qqbar tests more robust + +--- + src/sage/rings/qqbar.py | 50 ++++++++++++++++++++++++++++++----------- + 1 file changed, 37 insertions(+), 13 deletions(-) + +diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py +index 31e0a721a52..18228844684 100644 +--- a/src/sage/rings/qqbar.py ++++ b/src/sage/rings/qqbar.py +@@ -2656,9 +2656,11 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal + + sage: elems = [sqrt(5), 2^(1/3)+sqrt(3)*I, 3/4] + sage: nf, nums, hom = number_field_elements_from_algebraics(elems, embedded=True) +- sage: nf ++ sage: nf # random (polynomial and root not unique) + Number Field in a with defining polynomial y^24 - 6*y^23 ...- 9*y^2 + 1 + with a = 0.2598679? + 0.0572892?*I ++ sage: nf.is_isomorphic(NumberField(x^24 - 9*x^22 + 135*x^20 - 720*x^18 + 1821*x^16 - 3015*x^14 + 3974*x^12 - 3015*x^10 + 1821*x^8 - 720*x^6 + 135*x^4 - 9*x^2 + 1, 'a')) ++ True + sage: list(map(QQbar, nums)) == elems == list(map(hom, nums)) + True + +@@ -7857,16 +7859,21 @@ class ANExtensionElement(ANDescr): + sage: b = a._descr + sage: type(b) + +- sage: b.neg(a) +- -1/3*a^3 + 1/3*a^2 - a - 1 where a^4 - 2*a^3 + a^2 + 6*a + 3 = 0 and a in 1.724744871391589? + 1.573132184970987?*I +- sage: b.neg("ham spam and eggs") ++ sage: c = b.neg(None); c # random (not uniquely represented) + -1/3*a^3 + 1/3*a^2 - a - 1 where a^4 - 2*a^3 + a^2 + 6*a + 3 = 0 and a in 1.724744871391589? + 1.573132184970987?*I ++ sage: c.generator() == b.generator() and c.field_element_value() + b.field_element_value() == 0 ++ True ++ ++ The parameter is ignored:: ++ ++ sage: b.neg("random").generator() == c.generator() and b.neg("random").field_element_value() == c.field_element_value() ++ True + """ + return ANExtensionElement(self._generator, -self._value) + + def invert(self, n): + r""" +- 1/self. ++ Reciprocal of self. + + EXAMPLES:: + +@@ -7875,16 +7882,20 @@ class ANExtensionElement(ANDescr): + sage: b = a._descr + sage: type(b) + +- sage: b.invert(a) +- -7/3*a^3 + 19/3*a^2 - 7*a - 9 where a^4 - 2*a^3 + a^2 + 6*a + 3 = 0 and a in 1.724744871391589? + 1.573132184970987?*I +- sage: b.invert("ham spam and eggs") ++ sage: c = b.invert(None); c # random (not uniquely represented) + -7/3*a^3 + 19/3*a^2 - 7*a - 9 where a^4 - 2*a^3 + a^2 + 6*a + 3 = 0 and a in 1.724744871391589? + 1.573132184970987?*I ++ sage: c.generator() == b.generator() and c.field_element_value() * b.field_element_value() == 1 ++ True ++ ++ The parameter is ignored:: ++ ++ sage: b.invert("random").generator() == c.generator() and b.invert("random").field_element_value() == c.field_element_value() ++ True + """ + return ANExtensionElement(self._generator, ~self._value) + + def conjugate(self, n): +- r""" +- Negation of self. ++ r"""Complex conjugate of self. + + EXAMPLES:: + +@@ -7893,10 +7904,23 @@ class ANExtensionElement(ANDescr): + sage: b = a._descr + sage: type(b) + +- sage: b.conjugate(a) +- 1/3*a^3 - 1/3*a^2 + a + 1 where a^4 - 2*a^3 + a^2 + 6*a + 3 = 0 and a in 1.724744871391589? - 1.573132184970987?*I +- sage: b.conjugate("ham spam and eggs") ++ sage: c = b.conjugate(None); c # random (not uniquely represented) + 1/3*a^3 - 1/3*a^2 + a + 1 where a^4 - 2*a^3 + a^2 + 6*a + 3 = 0 and a in 1.724744871391589? - 1.573132184970987?*I ++ ++ Internally, complex conjugation is implemented by taking the ++ same abstract field element but conjugating the complex embedding of ++ the field:: ++ ++ sage: c.generator() == b.generator().conjugate() ++ True ++ sage: c.field_element_value() == b.field_element_value() ++ True ++ ++ The parameter is ignored:: ++ ++ sage: b.conjugate("random").generator() == c.generator() and b.conjugate("random").field_element_value() == c.field_element_value() ++ True ++ + """ + if self._exactly_real: + return self +-- +2.39.1 + + +From 238f4de34714989b866757523f2a46088dbfb720 Mon Sep 17 00:00:00 2001 +From: Dima Pasechnik +Date: Fri, 20 Jan 2023 01:25:39 +0000 +Subject: [PATCH 4/5] fixed doctests for elliptic curves on 32-bit + +--- + .../schemes/elliptic_curves/ell_number_field.py | 13 ++++++++----- + .../schemes/elliptic_curves/isogeny_small_degree.py | 13 ++----------- + 2 files changed, 10 insertions(+), 16 deletions(-) + +diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py +index c44c803aa82..656ccbf86bc 100644 +--- a/src/sage/schemes/elliptic_curves/ell_number_field.py ++++ b/src/sage/schemes/elliptic_curves/ell_number_field.py +@@ -2294,9 +2294,10 @@ class EllipticCurve_number_field(EllipticCurve_field): + sage: E = EllipticCurve(K, [1, 0, 5*y^2 + 16, 0, 0]) + sage: E.gens(lim1=1, lim3=1) + [] +- sage: E.rank(), E.gens(lim3=12) # long time (about 4s) +- (1, +- [(369/25*y^3 + 539/25*y^2 + 1178/25*y + 1718/25 : -29038/125*y^3 - 43003/125*y^2 - 92706/125*y - 137286/125 : 1)]) ++ sage: E.rank() ++ 1 ++ sage: E.gens(lim3=13) # long time (about 4s) ++ [(... : 1)] + + Here is a curve of rank 2:: + +@@ -2644,7 +2645,7 @@ class EllipticCurve_number_field(EllipticCurve_field): + sage: [phi.codomain().cm_discriminant() for phi in E.isogenies_prime_degree()] # long time + [-92, -23, -23] + +- sage: C.matrix() # long time ++ sage: C.matrix() # long time # random + [1 2 2 4 4 2] + [2 1 2 4 2 4] + [2 2 1 2 4 4] +@@ -2676,13 +2677,15 @@ class EllipticCurve_number_field(EllipticCurve_field): + determined:: + + sage: G = C.graph() # long time +- sage: G.adjacency_matrix() # long time ++ sage: G.adjacency_matrix() # long time # random + [0 1 1 0 0 1] + [1 0 1 0 1 0] + [1 1 0 1 0 0] + [0 0 1 0 1 1] + [0 1 0 1 0 1] + [1 0 0 1 1 0] ++ sage: Graph(polytopes.simplex(2).prism().adjacency_matrix()).is_isomorphic(G) # long time ++ True + + To display the graph without any edge labels:: + +diff --git a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py +index 11bb61c9f21..f5657f2cf19 100644 +--- a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py ++++ b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py +@@ -1205,17 +1205,8 @@ def isogenies_13_0(E, minimal_models=True): + sage: K. = 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)] # long time (4s) +- [(0, +- 0, +- 20360599/165164973653422080*a^11 - 3643073/41291243413355520*a^10 + 1887439/1146978983704320*a^9 + 5557619461/573489491852160*a^8 - 82824971/11947697746920*a^7 + 1030632647/7965131831280*a^6 - 475752603733/29409717530880*a^5 + 87205112531/7352429382720*a^4 - 43618899433/204234149520*a^3 + 5858744881/12764634345*a^2 - 1858703809/2836585410*a + 2535050171/1418292705, +- -139861295/2650795873449984*a^11 - 3455957/5664093746688*a^10 - 345310571/50976843720192*a^9 - 500530795/118001953056*a^8 - 12860048113/265504394376*a^7 - 25007420461/44250732396*a^6 + 458134176455/1416023436672*a^5 + 16701880631/9077073312*a^4 + 155941666417/9077073312*a^3 + 3499310115/378211388*a^2 - 736774863/94552847*a - 21954102381/94552847, +- 8342795944891/198197968384106496*a^11 + 8908625263589/20645621706677760*a^10 + 53130542636623/6881873902225920*a^9 + 376780111042213/114697898370432*a^8 + 614884052146333/15930263662560*a^7 + 3566768133324359/7965131831280*a^6 - 1885593809102545/35291661037056*a^5 - 2443732172026523/3676214691360*a^4 - 9525729503937541/1225404897120*a^3 + 51990274442321/40846829904*a^2 + 67834019370596/4254878115*a + 267603083706812/1418292705), +- (0, +- 0, +- 20360599/165164973653422080*a^11 - 3643073/41291243413355520*a^10 + 1887439/1146978983704320*a^9 + 5557619461/573489491852160*a^8 - 82824971/11947697746920*a^7 + 1030632647/7965131831280*a^6 - 475752603733/29409717530880*a^5 + 87205112531/7352429382720*a^4 - 43618899433/204234149520*a^3 + 5858744881/12764634345*a^2 - 1858703809/2836585410*a + 2535050171/1418292705, +- -6465569317/1325397936724992*a^11 - 112132307/1960647835392*a^10 - 17075412917/25488421860096*a^9 - 207832519229/531008788752*a^8 - 1218275067617/265504394376*a^7 - 9513766502551/177002929584*a^6 + 4297077855437/708011718336*a^5 + 354485975837/4538536656*a^4 + 4199379308059/4538536656*a^3 - 30841577919/189105694*a^2 - 181916484042/94552847*a - 2135779171614/94552847, +- -1316873026840277/34172063514501120*a^11 - 18637401045099413/41291243413355520*a^10 - 36382234917217247/6881873902225920*a^9 - 61142238484016213/19775499719040*a^8 - 576888119306045123/15930263662560*a^7 - 3378443313906256321/7965131831280*a^6 + 326466167429333279/6084769144320*a^5 + 4620083325391594991/7352429382720*a^4 + 9018783894167184149/1225404897120*a^3 - 9206015742300283/7042556880*a^2 - 65141531411426446/4254878115*a - 254321286054666133/1418292705)] ++ sage: len([phi.codomain().ainvs() for phi in isogenies_13_0(E)]) # long time (4s) ++ 2 + """ + if E.j_invariant()!=0: + raise ValueError("j-invariant must be 0.") +-- +2.39.1 + + +From c7654e85a763eb42e4c547c4a4627112b850f8c2 Mon Sep 17 00:00:00 2001 +From: Dima Pasechnik +Date: Fri, 20 Jan 2023 14:12:05 +0000 +Subject: [PATCH 5/5] rename the gen, and do basic tests on the found generator + +--- + .../schemes/elliptic_curves/ell_number_field.py | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py +index 656ccbf86bc..b9787c1fd6b 100644 +--- a/src/sage/schemes/elliptic_curves/ell_number_field.py ++++ b/src/sage/schemes/elliptic_curves/ell_number_field.py +@@ -2290,15 +2290,22 @@ class EllipticCurve_number_field(EllipticCurve_field): + It can happen that no points are found if the height bounds + used in the search are too small (see :trac:`10745`):: + +- sage: K. = NumberField(x^4 + x^2 - 7) +- sage: E = EllipticCurve(K, [1, 0, 5*y^2 + 16, 0, 0]) ++ sage: K. = NumberField(x^4 + x^2 - 7) ++ sage: E = EllipticCurve(K, [1, 0, 5*t^2 + 16, 0, 0]) + sage: E.gens(lim1=1, lim3=1) + [] + sage: E.rank() + 1 +- sage: E.gens(lim3=13) # long time (about 4s) ++ sage: gg=E.gens(lim3=13); gg # long time (about 4s) + [(... : 1)] + ++ Check that the the point found has infinite order, and that it is on the curve:: ++ ++ sage: P=gg[0]; P.order() # long time ++ +Infinity ++ sage: E.defining_polynomial()(*P) # long time ++ 0 ++ + Here is a curve of rank 2:: + + sage: K. = NumberField(x^2-17) +-- +2.39.1 + diff --git a/srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch b/srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch new file mode 100644 index 000000000000..5fbab81ebcde --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch @@ -0,0 +1,76 @@ +commit 1f22dea27235eeb7dd74cab2cee60cffa55fff2a +Author: Gonzalo Tornaría +Date: Wed Jan 4 22:16:32 2023 -0300 + + complex_plot: fix plot of undefined values + + Undefined values would get some random color. + Rreplace all undefined values by white. + + In numpy 1.24 this avoids a runtime warning (cast of nan to uint8). + +diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx +index 6f0aeab87ae..b77c69b2f77 100644 +--- a/src/sage/plot/complex_plot.pyx ++++ b/src/sage/plot/complex_plot.pyx +@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False, + rgb[i, j, 2] = b + + sig_off() ++ nan_indices = np.isnan(rgb).any(-1) # Mask for undefined points ++ rgb[nan_indices] = 1 # Make nan_indices white + return rgb + + + +commit c57458d245f9e24c0283d72d5b97ace0ff011fd6 +Author: Gonzalo Tornaría +Date: Wed Jan 4 20:25:15 2023 -0300 + + doctest: fixes for numpy 1.24 + +diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx +index 3ac5f1cc2b0..cb1f327c199 100644 +--- a/src/sage/misc/persist.pyx ++++ b/src/sage/misc/persist.pyx +@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs): + ....: _ = f.write(code) + sage: load(t) + sage: hello +- ++ + """ + import sage.repl.load + if len(filename) != 1: +diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py +index 3bc2b76b58e..388c2d1391d 100644 +--- a/src/sage/plot/histogram.py ++++ b/src/sage/plot/histogram.py +@@ -87,13 +87,8 @@ class Histogram(GraphicPrimitive): + + TESTS:: + +- sage: h = histogram([10,3,5], normed=True)[0] +- doctest:warning...: +- DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead. +- See https://trac.sagemath.org/25260 for details. ++ sage: h = histogram([10,3,5], density=True)[0] + sage: h.get_minmax_data() +- doctest:warning ... +- ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy. + {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0} + """ + import numpy +diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py +index 798671aab42..cad6a47ca8b 100644 +--- a/src/sage/repl/ipython_extension.py ++++ b/src/sage/repl/ipython_extension.py +@@ -405,7 +405,7 @@ class SageMagics(Magics): + ....: C END FILE FIB1.F + ....: ''') + sage: fib +- ++ + sage: from numpy import array + sage: a = array(range(10), dtype=float) + sage: fib(a, 10) diff --git a/srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch b/srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch new file mode 100644 index 000000000000..7b072e2ba18e --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch @@ -0,0 +1,65 @@ +From f28961e88271c6685f9d7e4697f36affe3bbe65c Mon Sep 17 00:00:00 2001 +From: Antonio Rojas +Date: Fri, 20 Jan 2023 21:36:27 +0100 +Subject: Fix tests with giac 1.9.0.35 + +--- + src/sage/libs/giac/giac.pyx | 3 +-- + src/sage/symbolic/relation.py | 15 +++++---------- + 2 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx +index 4e451db..ccad516 100644 +--- a/src/sage/libs/giac/giac.pyx ++++ b/src/sage/libs/giac/giac.pyx +@@ -374,8 +374,7 @@ def _giac(s): + + sage: x = libgiac('x') + sage: (1+2*sin(3*x)).solve(x).simplify() +- Warning, argument is not an equation, solving 1+2*sin(3*x)=0 +- list[-pi/18,7*pi/18] ++ ...list[-pi/18,7*pi/18] + + sage: libgiac.solve('sin(3*x)>2*sin(x)',x) + Traceback (most recent call last): +diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py +index e9dbc0f..b8896a9 100644 +--- a/src/sage/symbolic/relation.py ++++ b/src/sage/symbolic/relation.py +@@ -935,8 +935,7 @@ def solve(f, *args, **kwds): + + sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x)) + sage: solve(f, x, algorithm='giac') +- ... +- [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] ++ ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] + + sage: x, y = SR.var('x,y') + sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac') +@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False): + EXAMPLES:: + + sage: solve([(2/3)^x-2], [x], algorithm='giac') +- ... +- [[-log(2)/(log(3) - log(2))]] ++ ...[[-log(2)/(log(3) - log(2))]] + sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True) +- ... +- [{x: -log(2)/(log(3) - log(2))}] ++ ...[{x: -log(2)/(log(3) - log(2))}] + + sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x)) + sage: solve(f, x, algorithm='giac') +- ... +- [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] ++ ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] + sage: solve(f, x, algorithm='giac', solution_dict=True) +- ... +- [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}] ++ ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}] + + sage: x, y = SR.var('x,y') + sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac') +-- +cgit v1.0-1-gd88e + diff --git a/srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch new file mode 100644 index 000000000000..384d73283a2e --- /dev/null +++ b/srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch @@ -0,0 +1,38 @@ +commit d95ccbdc02a63124bd5dd2743a2356c6f873c5b4 +Author: Gonzalo Tornaría +Date: Wed Jan 4 20:21:51 2023 -0300 + + sage.arith.long: fix edge case of integer_check_py + +diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd +index 1c9a53387a0..16d13512f68 100644 +--- a/src/sage/arith/long.pxd ++++ b/src/sage/arith/long.pxd +@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): + sage: L += [-x for x in L] + [0, long_min()] + sage: for v in L: + ....: assert check_long_py(int(v)) == v ++ sage: check_long_py(int(2^60)) ++ 1152921504606846976 # 64-bit ++ 'Overflow (...)' # 32-bit ++ sage: check_long_py(int(2^61)) ++ 2305843009213693952 # 64-bit ++ 'Overflow (...)' # 32-bit ++ sage: check_long_py(int(2^62)) ++ 4611686018427387904 # 64-bit ++ 'Overflow (...)' # 32-bit ++ sage: check_long_py(int(2^63)) ++ 'Overflow (...)' + sage: check_long_py(int(2^100)) + 'Overflow (...)' + sage: check_long_py(int(long_max() + 1)) +@@ -310,6 +321,9 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): + cdef long lead + cdef long lead_2_overflow = (1) << (BITS_IN_LONG - PyLong_SHIFT) + cdef long lead_3_overflow = (1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) ++ if BITS_IN_LONG < 2 * PyLong_SHIFT: ++ # in this case 3 digit is always overflow ++ lead_3_overflow = 0 + if size == 0: + value[0] = 0 + err[0] = 0 diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 74445c3aa8c1..c5af07ee73a9 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,7 +1,7 @@ # Template file for 'sagemath' pkgname=sagemath version=9.7 -revision=4 +revision=5 build_wrksrc=pkgs/sagemath-standard build_style=python3-module _bindir=/usr/lib/sagemath/$version/bin @@ -31,8 +31,8 @@ short_desc="Open source mathematics software" maintainer="Gonzalo Tornaría " license="GPL-2.0-or-later" homepage="http://sagemath.org/" -distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz" -checksum=9f26f14aa322e3cf38a71835b12ac34b23026b467f74d54b064c5d025e76fbfd +distfiles="https://github.com/sagemath/sage-archive-2023-02-01/archive/refs/tags/$version.tar.gz" +checksum=7c09f0ab84fa44380146cf1305b9c0e8ec7aea86d975259ca264be6798202bde do_configure() { # git tree needs bootstrapping diff --git a/srcpkgs/sagemath/update b/srcpkgs/sagemath/update new file mode 100644 index 000000000000..68be3c5752d0 --- /dev/null +++ b/srcpkgs/sagemath/update @@ -0,0 +1,2 @@ +pkgname="sage" +site="https://mirrors.mit.edu/sage/src/index.html"