From 9869c3e3425cb02afb15bd641488e4497b4986af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 11 Oct 2022 19:14:02 -0300 Subject: [PATCH 01/12] flintlib: update to 2.9.0. --- common/shlibs | 2 +- srcpkgs/flintlib/template | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/common/shlibs b/common/shlibs index 9f95ac87a7ea..f5ecd7a99746 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4013,7 +4013,7 @@ libgtkdatabox.so.1 gtkdatabox3-1.0.0_1 libxcvt.so.0 libxcvt-0.1.1_1 libgf2x.so.3 gf2x-1.3.0_1 libntl.so.44 ntl-11.5.1_1 -libflint.so.16 flintlib-2.8.0_1 +libflint.so.17 flintlib-2.9.0_1 libarb.so.2 arb-2.20.0_1 libec.so.8 eclib-20210625_1 libsymmetrica.so.2 symmetrica-3.0.1_1 diff --git a/srcpkgs/flintlib/template b/srcpkgs/flintlib/template index 968dbcb525c2..bf5cfe0c0bd9 100644 --- a/srcpkgs/flintlib/template +++ b/srcpkgs/flintlib/template @@ -1,6 +1,6 @@ # Template file for 'flintlib' pkgname=flintlib -version=2.8.5 +version=2.9.0 revision=1 wrksrc="flint-${version}" build_style=configure @@ -14,11 +14,10 @@ license="LGPL-2.1-or-later" homepage="https://flintlib.org" changelog="https://raw.githubusercontent.com/wbhart/flint2/trunk/NEWS" distfiles="https://flintlib.org/flint-${version}.tar.gz" -checksum=5911fedff911100f15781f35e3a4fa934fe60e4aea02a8c10cc8918101c1eed8 +checksum=2fc090d51033c93208e6c10d406397a53c983ae5343b958eb25f72a57a4ce76a build_options="ntl openblas" desc_option_ntl="enable NTL support" -build_options_default="" if [ -z "$CROSS_BUILD" ]; then build_options_default+=" ntl" @@ -28,8 +27,6 @@ case "$XBPS_TARGET_MACHINE" in x86_64*|i686*|aarch64*|arm*|ppc64*) build_options_default+=" openblas";; esac -CFLAGS="-D_GNU_SOURCE" # needed for cpu_set_t - flintlib-devel_package() { depends="${sourcepkg}>=${version}_${revision} mpfr-devel" short_desc+=" - development files" From cfeb9c641c0a6eb80522266ef2ba9dfd5e7904ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 11 Oct 2022 19:16:18 -0300 Subject: [PATCH 02/12] arb: update to 2.23.0. --- srcpkgs/arb/template | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/srcpkgs/arb/template b/srcpkgs/arb/template index 52f11ef83c90..84a62c7ffdba 100644 --- a/srcpkgs/arb/template +++ b/srcpkgs/arb/template @@ -1,6 +1,6 @@ # Template file for 'arb' pkgname=arb -version=2.22.1 +version=2.23.0 revision=1 build_style=configure configure_args="--prefix=/usr --with-gmp=/usr --with-mpfr=/usr --with-flint=/usr" @@ -11,9 +11,7 @@ license="LGPL-2.1-or-later" homepage="https://arblib.org" changelog="https://raw.githubusercontent.com/fredrik-johansson/arb/master/doc/source/history.rst" distfiles="https://github.com/fredrik-johansson/arb/archive/${version}.tar.gz" -checksum=1ef85518eee04885e8a90196498bc75e4e2410621d4184f2bc01d46b7080a243 - -CFLAGS="-D_GNU_SOURCE" # needed for cpu_set_t +checksum=977d41bde46f5442511d5165c705cec32c03e852c84d7d1836135d412ce702bb arb-devel_package() { depends="${sourcepkg}>=${version}_${revision} ${makedepends}" From 3dc8a2fb02999bed1de4923b0e23100ff9de66a6 Mon Sep 17 00:00:00 2001 From: dkwo Date: Mon, 10 Oct 2022 10:14:06 -0400 Subject: [PATCH 03/12] singular: update to 4.3.1p2 (fix gcc 12 build) --- common/shlibs | 10 +++++----- srcpkgs/singular/template | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/common/shlibs b/common/shlibs index f5ecd7a99746..108073356e34 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4055,11 +4055,11 @@ libumfpack.so.5 SuiteSparse-5.10.1_1 libecl.so.21.2 ecl-21.2.1_1 libecm.so.1 ecm-7.0.4_3 libcliquer.so.1 cliquer-1.22_1 -libSingular-4.3.0.so singular-4.3.0_1 -libfactory-4.3.0.so singular-4.3.0_1 -libpolys-4.3.0.so singular-4.3.0_1 -libomalloc-0.9.6.so singular-4.3.0_1 -libsingular_resources-4.3.0.so singular-4.3.0_1 +libSingular-4.3.1.so singular-4.3.1p2_1 +libfactory-4.3.1.so singular-4.3.1p2_1 +libpolys-4.3.1.so singular-4.3.1p2_1 +libomalloc-0.9.6.so singular-4.3.1p2_1 +libsingular_resources-4.3.1.so singular-4.3.1p2_1 libbrial.so.3 brial-1.2.10_1 libbrial_groebner.so.3 brial-1.2.10_1 libm4ri-0.0.20200125.so m4ri-20200125_1 diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template index f23659ef5d83..a30beef915d2 100644 --- a/srcpkgs/singular/template +++ b/srcpkgs/singular/template @@ -1,25 +1,27 @@ # Template file for 'singular' pkgname=singular -version=4.3.0 +version=4.3.1p2 revision=1 +_majver=${version%p*} +wrksrc=singular-${_majver} build_style=gnu-configure configure_args="--with-readline=ncurses - --enable-gfanlib - --enable-Singular - --enable-factory - --disable-doc - --disable-polymake - --without-python - --with-libparse - ac_cv_lib_cddgmp_dd_free_global_constants=yes" + --enable-gfanlib + --enable-Singular + --enable-factory + --disable-doc + --disable-polymake + --without-python + --with-libparse + ac_cv_lib_cddgmp_dd_free_global_constants=yes" hostmakedepends="perl tar doxygen" makedepends="flintlib-devel cddlib-devel readline-devel graphviz" short_desc="Computer algebra system for polynomial computations" -maintainer="dkwo " +maintainer="dkwo " license="GPL-2.0-or-later" homepage="https://www.singular.uni-kl.de" -distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version//./-}/singular-${version}.tar.gz" -checksum=74f38288203720e3f280256f2f8deb94030dd032b4237d844652aff0faab36e7 +distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz" +checksum=95814bba0f0bd0290cd9799ec1d2ecc6f4c8a4e6429d9a02eb7f9c4e5649682a if [ -z "$CROSS_BUILD" ]; then makedepends+=" ntl-devel" From 9ce30bdf92fee48de1435eaebe8a2db560a12cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 10 Oct 2022 19:34:32 -0300 Subject: [PATCH 04/12] pari-nflistdata: update to 20220729. Note that upstream doesn't change the filenames on updates. We use the timestamp in the http server to manage the version. In b7a1bbcde8d5277e7c9186928aca11bbd2d67dc2 the checksum was "fixed" (i.e. changed to the checksum of the new version) but the package in the void packages repository was not rebuilt. Now we change the version so it's rebuilt. --- srcpkgs/pari-nflistdata/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/pari-nflistdata/template b/srcpkgs/pari-nflistdata/template index cd64a18eabb9..ef4e37a791d0 100644 --- a/srcpkgs/pari-nflistdata/template +++ b/srcpkgs/pari-nflistdata/template @@ -1,6 +1,6 @@ # Template file for 'pari-nflistdata' pkgname=pari-nflistdata -version=20220326 +version=20220729 revision=1 create_wrksrc=yes short_desc="PARI/GP database needed by nflist" From b76fd349a88259fdb2e66811ced86ff2e41a0bf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 10 Oct 2022 19:59:20 -0300 Subject: [PATCH 05/12] pari: update to 2.15.0. --- common/shlibs | 3 +-- srcpkgs/pari/template | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/shlibs b/common/shlibs index 108073356e34..53415e6baf74 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4004,8 +4004,7 @@ libsimavrparts.so.1 simavr-1.6_2 libsword-1.8.1.so libsword-1.8.1_6 libgivaro.so.9 givaro-4.1.1_1 liblinbox.so.0 linbox-1.6.3_1 -libpari-gmp.so.7 pari-2.13.0_1 -libpari-gmp-tls.so.7 pari-2.13.2_1 +libpari-gmp-tls.so.8 pari-2.15.0_1 libtree-sitter.so.0 tree-sitter-0.19.0_1 libplanarity.so.0 planarity-3.0.1.1_1 libgap.so.0 gap-4.11.1_1 diff --git a/srcpkgs/pari/template b/srcpkgs/pari/template index 8bac1e0343f8..873cddb4946f 100644 --- a/srcpkgs/pari/template +++ b/srcpkgs/pari/template @@ -1,6 +1,6 @@ # Template file for 'pari' pkgname=pari -version=2.13.4 +version=2.15.0 revision=1 build_style=configure build_helper=qemu @@ -11,14 +11,15 @@ make_check_target=statest-all make_install_target="install install-lib-sta install-lib-dyn" hostmakedepends="perl texlive" makedepends="gmp-devel readline-devel $(vopt_if x11 libX11-devel)" -checkdepends="pari-elldata-small pari-galdata pari-galpol-small pari-seadata-small" +checkdepends="pari-elldata-small pari-galdata pari-galpol-small + pari-seadata-small pari-nflistdata" short_desc="Fast computations library in number theory" maintainer="Gonzalo Tornaría " license="GPL-2.0-or-later" homepage="https://pari.math.u-bordeaux.fr" changelog="https://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=blob_plain;f=CHANGES;hb=refs/heads/pari-${version%.*}" distfiles="https://pari.math.u-bordeaux.fr/pub/pari/unix/${pkgname}-${version}.tar.gz" -checksum=bcde9eceae1592814381c1697cdb7063567b6504201b1be47bb58920f3bce185 +checksum=e474851e0d16d4e4f9a0d9612c746a2ae7c9a1ec185d04c440b1c74a85755685 build_options="x11 pthreads" build_options_default="x11 pthreads" From 814885a38d662ffd59d267b5fef6022b8c8e6223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 10 Oct 2022 20:33:23 -0300 Subject: [PATCH 06/12] gp2c: update to 0.0.13. --- srcpkgs/gp2c/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/gp2c/template b/srcpkgs/gp2c/template index f82cf95c2d90..9cf0f6fdce6e 100644 --- a/srcpkgs/gp2c/template +++ b/srcpkgs/gp2c/template @@ -1,6 +1,6 @@ # Template file for 'gp2c' pkgname=gp2c -version=0.0.12pl1 +version=0.0.13 revision=1 build_style=gnu-configure hostmakedepends="perl" @@ -12,4 +12,4 @@ license="GPL-2.0-or-later" homepage="http://pari.math.u-bordeaux.fr/" changelog="http://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=gp2c.git;a=blob_plain;f=ChangeLog;hb=HEAD" distfiles="${homepage}pub/pari/GP2C/${pkgname}-${version}.tar.gz" -checksum=79a8c46f7ad3331e4d8ae6af6b496c4742fd73a73b996b3ca7ead61452ca6e8d +checksum=261374eca73ebd76c112a9593dca28b64812aa762561fda5a4b2c2cd79a69d36 From 636f6dd1865a1f9246a4448eae83cdb6e46e63c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Fri, 23 Sep 2022 16:42:40 -0300 Subject: [PATCH 07/12] eclib: update to 20220621. --- common/shlibs | 2 +- srcpkgs/eclib/template | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/shlibs b/common/shlibs index 53415e6baf74..2fbb20102502 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4014,7 +4014,7 @@ libgf2x.so.3 gf2x-1.3.0_1 libntl.so.44 ntl-11.5.1_1 libflint.so.17 flintlib-2.9.0_1 libarb.so.2 arb-2.20.0_1 -libec.so.8 eclib-20210625_1 +libec.so.10 eclib-20220621_1 libsymmetrica.so.2 symmetrica-3.0.1_1 libLfunction.so.1 lcalc-2.0.4_1 liblrcalc.so.2 lrcalc-2.1_1 diff --git a/srcpkgs/eclib/template b/srcpkgs/eclib/template index 694a39ed4068..e33da0a859ca 100644 --- a/srcpkgs/eclib/template +++ b/srcpkgs/eclib/template @@ -1,7 +1,7 @@ # Template file for 'eclib' pkgname=eclib -version=20210625 -revision=2 +version=20220621 +revision=1 build_style=gnu-configure configure_args="--with-flint --with-boost" hostmakedepends="automake autoconf-archive libtool" @@ -11,7 +11,7 @@ maintainer="Gonzalo Tornaría " license="GPL-2.0-or-later" homepage="https://github.com/JohnCremona/eclib" distfiles="https://github.com/JohnCremona/eclib/archive/refs/tags/${version}.tar.gz" -checksum=00333fd36afd237c9e6e410c7ab98536ddcd7fdc430e6837fe293247b835c572 +checksum=b0e06ffe6cd669354627eb1ff351cf558a4376dca1cf5c2d4ad042ae49fa5462 pre_configure() { autoreconf -fi From 28a63ef5a50b6af0e700cdc02e9db6461a21b7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 11 Oct 2022 18:56:19 -0300 Subject: [PATCH 08/12] lcalc: revbump for pari 2.15.0 --- srcpkgs/lcalc/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/lcalc/template b/srcpkgs/lcalc/template index 270078df9a54..3c6be5fcbc28 100644 --- a/srcpkgs/lcalc/template +++ b/srcpkgs/lcalc/template @@ -1,7 +1,7 @@ # Template file for 'lcalc' pkgname=lcalc version=2.0.5 -revision=1 +revision=2 build_style=gnu-configure configure_args="--with-pari" hostmakedepends="automake libtool pkg-config gengetopt" From 650d68b687e73fb1f37cf31d77885273fa7ffeeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 11 Oct 2022 18:56:20 -0300 Subject: [PATCH 09/12] giac: update to 1.9.0.21. --- srcpkgs/giac/patches/giac-pari-2.15.patch | 20 ++++++++++++++++++++ srcpkgs/giac/template | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/giac/patches/giac-pari-2.15.patch diff --git a/srcpkgs/giac/patches/giac-pari-2.15.patch b/srcpkgs/giac/patches/giac-pari-2.15.patch new file mode 100644 index 000000000000..be409be38f53 --- /dev/null +++ b/srcpkgs/giac/patches/giac-pari-2.15.patch @@ -0,0 +1,20 @@ +ANYARG patch + +diff --git a/src/pari.cc b/src/pari.cc +index 76ce8e1..50d08ab 100644 +--- a/src/pari.cc ++++ b/src/pari.cc +@@ -40,6 +40,13 @@ using namespace std; + + #ifdef HAVE_LIBPARI + ++// Anyarg disappeared from PARI 2.15.0 ++#ifdef __cplusplus ++# define ANYARG ... ++#else ++# define ANYARG ++#endif ++ + #ifdef HAVE_PTHREAD_H + #include + #endif diff --git a/srcpkgs/giac/template b/srcpkgs/giac/template index e892c8bf7506..31045e9128ee 100644 --- a/srcpkgs/giac/template +++ b/srcpkgs/giac/template @@ -1,6 +1,6 @@ # Template file for 'giac' pkgname=giac -version=1.9.0.7 +version=1.9.0.21 revision=1 wrksrc="giac-${version%.*}" build_style=gnu-configure @@ -14,7 +14,7 @@ license="GPL-3.0-or-later" homepage="https://www-fourier.ujf-grenoble.fr/~parisse/giac.html" changelog="https://www-fourier.ujf-grenoble.fr/~parisse/install_en#new" distfiles="https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version%.*}-${version##*.}.tar.gz" -checksum=72016988b7180e9b630ecabecc60969213e7b61418c2598c91acbaec139fd740 +checksum=120cd16f2e033817302d2a03a22bd413dc1d85df8b225ba4f76b93a7805b07fe # need more than 4*65536 stack, see try_parse() in gen.cc line 11812 LDFLAGS="-Wl,-z,stack-size=2097152" From dc5582fca8dc721e56706afb73fddd9946abd6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 11 Oct 2022 18:56:21 -0300 Subject: [PATCH 10/12] python3-cysignals: revbump for pari 2.15.0 --- srcpkgs/python3-cysignals/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/python3-cysignals/template b/srcpkgs/python3-cysignals/template index 4655eead2a9c..08d1010976ff 100644 --- a/srcpkgs/python3-cysignals/template +++ b/srcpkgs/python3-cysignals/template @@ -1,7 +1,7 @@ # Template file for 'python3-cysignals' pkgname=python3-cysignals version=1.11.2 -revision=1 +revision=2 wrksrc="cysignals-${version}" build_style=python3-module hostmakedepends="python3-setuptools python3-Cython autoconf" From 1ef07032a03968b63854240623109b5d71f8c60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 11 Oct 2022 18:58:16 -0300 Subject: [PATCH 11/12] python3-cypari2: revbump for pari 2.15.0 --- srcpkgs/python3-cypari2/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/python3-cypari2/template b/srcpkgs/python3-cypari2/template index 9ded61101e8e..9db3070a087c 100644 --- a/srcpkgs/python3-cypari2/template +++ b/srcpkgs/python3-cypari2/template @@ -1,7 +1,7 @@ # Template file for 'python3-cypari2' pkgname=python3-cypari2 version=2.1.2 -revision=1 +revision=2 wrksrc=cypari2-${version} build_style=python3-module hostmakedepends="python3-setuptools python3-Cython pari perl" From 0a9293a7b5f6c09df6112836316756545af4ea97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 10 Oct 2022 00:49:01 -0300 Subject: [PATCH 12/12] sagemath: update to 9.7. --- .../patches/01-dont_link_ratpoints.patch | 10 - ...2-fix_get_shared_lib_path--see_29644.patch | 13 - .../patches/03-doctest_have_program.patch | 20 - .../patches/04-doctest_sage_getfile.patch | 22 - .../patches/05-fix_sage_getfile.patch | 16 - .../sagemath/patches/07-ignore_warning.patch | 15 - .../08-dont_run_pytest--see_31924.patch | 27 - ...y_slow_doctest-polynomial_zmod_flint.patch | 14 - ...ry_slow_doctest-isogeny_small_degree.patch | 106 - ...fix_very_slow_doctest-function_field.patch | 97 - srcpkgs/sagemath/patches/matplotlib-3.6.patch | 72 + srcpkgs/sagemath/patches/python-3.11.patch | 45 + .../sagemath/patches/sagemath-pari-2.15.patch | 1750 +++++++++++++++++ .../patches/sagemath-pari-2.15b.patch | 29 + .../trac-31355-upgrade_lrcalc_to_2.1.patch | 670 ------- .../trac-33170-fix_doctest_ipython_8.patch | 40 - .../trac-33170b-fix_doctest_ipython_8.1.patch | 13 - ...2ddd4e2dc92469c1590ebf0c40f8f69bf579.patch | 126 -- ...2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch | 40 - .../trac-33336-fix_doctest_scipy_1.8.patch | 19 - ...cee1a69229b2f5d8ac4a09a73d8152f5e14d.patch | 53 + ...d9deaeaa6380ab2f0d50276d911233c00a04.patch | 99 - ...ff347454ac7f07e5918470b20e97b8f2357e.patch | 29 - ...0a0b14f67f4804e7113c3db41bbcf8a58296.patch | 26 - ...d4e56243c609f44afc1f21c112b026f9e1fe.patch | 42 + ...1318f032caf8dc1c0de9489346d894409091.patch | 19 + .../zzz-loadable_module_extension.patch | 14 - srcpkgs/sagemath/template | 12 +- 28 files changed, 2016 insertions(+), 1422 deletions(-) delete mode 100644 srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch delete mode 100644 srcpkgs/sagemath/patches/02-fix_get_shared_lib_path--see_29644.patch delete mode 100644 srcpkgs/sagemath/patches/03-doctest_have_program.patch delete mode 100644 srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch delete mode 100644 srcpkgs/sagemath/patches/05-fix_sage_getfile.patch delete mode 100644 srcpkgs/sagemath/patches/07-ignore_warning.patch delete mode 100644 srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch delete mode 100644 srcpkgs/sagemath/patches/10-fix_very_slow_doctest-polynomial_zmod_flint.patch delete mode 100644 srcpkgs/sagemath/patches/11-fix_very_slow_doctest-isogeny_small_degree.patch delete mode 100644 srcpkgs/sagemath/patches/12-fix_very_slow_doctest-function_field.patch create mode 100644 srcpkgs/sagemath/patches/matplotlib-3.6.patch create mode 100644 srcpkgs/sagemath/patches/python-3.11.patch create mode 100644 srcpkgs/sagemath/patches/sagemath-pari-2.15.patch create mode 100644 srcpkgs/sagemath/patches/sagemath-pari-2.15b.patch delete mode 100644 srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33226-fix_doctests_giac-1.7.0-33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch create mode 100644 srcpkgs/sagemath/patches/trac-33360-avoid_factoring_in_is_prime-6330cee1a69229b2f5d8ac4a09a73d8152f5e14d.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch delete mode 100644 srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch create mode 100644 srcpkgs/sagemath/patches/trac-34118-update_sympy_to_1.11.1-5db5d4e56243c609f44afc1f21c112b026f9e1fe.patch create mode 100644 srcpkgs/sagemath/patches/trac-34465-fix_invalid_escape_sequence-04971318f032caf8dc1c0de9489346d894409091.patch delete mode 100644 srcpkgs/sagemath/patches/zzz-loadable_module_extension.patch diff --git a/srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch b/srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch deleted file mode 100644 index e5c3f5776aa2..000000000000 --- a/srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch +++ /dev/null @@ -1,10 +0,0 @@ - - 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 - """ diff --git a/srcpkgs/sagemath/patches/02-fix_get_shared_lib_path--see_29644.patch b/srcpkgs/sagemath/patches/02-fix_get_shared_lib_path--see_29644.patch deleted file mode 100644 index d3672b094c1c..000000000000 --- a/srcpkgs/sagemath/patches/02-fix_get_shared_lib_path--see_29644.patch +++ /dev/null @@ -1,13 +0,0 @@ - - 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') diff --git a/srcpkgs/sagemath/patches/03-doctest_have_program.patch b/srcpkgs/sagemath/patches/03-doctest_have_program.patch deleted file mode 100644 index 27ba3776470c..000000000000 --- a/srcpkgs/sagemath/patches/03-doctest_have_program.patch +++ /dev/null @@ -1,20 +0,0 @@ - - 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: diff --git a/srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch b/srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch deleted file mode 100644 index 95bce107f854..000000000000 --- a/srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch +++ /dev/null @@ -1,22 +0,0 @@ - - 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`:: - - diff --git a/srcpkgs/sagemath/patches/05-fix_sage_getfile.patch b/srcpkgs/sagemath/patches/05-fix_sage_getfile.patch deleted file mode 100644 index 56c58078f319..000000000000 --- a/srcpkgs/sagemath/patches/05-fix_sage_getfile.patch +++ /dev/null @@ -1,16 +0,0 @@ - - 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 - - diff --git a/srcpkgs/sagemath/patches/07-ignore_warning.patch b/srcpkgs/sagemath/patches/07-ignore_warning.patch deleted file mode 100644 index 69668678a40b..000000000000 --- a/srcpkgs/sagemath/patches/07-ignore_warning.patch +++ /dev/null @@ -1,15 +0,0 @@ - - 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 ############################### - - - diff --git a/srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch b/srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch deleted file mode 100644 index 06bd2ccae6fb..000000000000 --- a/srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch +++ /dev/null @@ -1,27 +0,0 @@ - - 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) diff --git a/srcpkgs/sagemath/patches/10-fix_very_slow_doctest-polynomial_zmod_flint.patch b/srcpkgs/sagemath/patches/10-fix_very_slow_doctest-polynomial_zmod_flint.patch deleted file mode 100644 index bae8387cf94a..000000000000 --- a/srcpkgs/sagemath/patches/10-fix_very_slow_doctest-polynomial_zmod_flint.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- 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) diff --git a/srcpkgs/sagemath/patches/11-fix_very_slow_doctest-isogeny_small_degree.patch b/srcpkgs/sagemath/patches/11-fix_very_slow_doctest-isogeny_small_degree.patch deleted file mode 100644 index f3da5bbb555e..000000000000 --- a/srcpkgs/sagemath/patches/11-fix_very_slow_doctest-isogeny_small_degree.patch +++ /dev/null @@ -1,106 +0,0 @@ -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. = 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. = 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. = 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] - diff --git a/srcpkgs/sagemath/patches/12-fix_very_slow_doctest-function_field.patch b/srcpkgs/sagemath/patches/12-fix_very_slow_doctest-function_field.patch deleted file mode 100644 index 3b7b1ea843df..000000000000 --- a/srcpkgs/sagemath/patches/12-fix_very_slow_doctest-function_field.patch +++ /dev/null @@ -1,97 +0,0 @@ ---- 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. = 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. = 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. = FunctionField(QQ); R. = 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. = 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. = FunctionField(GF(4)); _. = K[] - sage: L. = 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. = FunctionField(GF(5)); _. = K[] - sage: L. = 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. = 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 diff --git a/srcpkgs/sagemath/patches/matplotlib-3.6.patch b/srcpkgs/sagemath/patches/matplotlib-3.6.patch new file mode 100644 index 000000000000..6afaf1b7162f --- /dev/null +++ b/srcpkgs/sagemath/patches/matplotlib-3.6.patch @@ -0,0 +1,72 @@ +commit 5501e0de0dca1cff0355326dd42bd8c7e5749568 +Author: Gonzalo Tornaría +Date: Tue Oct 11 17:25:04 2022 -0300 + + Support matplotlib 3.6 + +diff --git a/src/sage/plot/arc.py b/src/sage/plot/arc.py +index bb834763afc..f65973bcbd5 100644 +--- a/src/sage/plot/arc.py ++++ b/src/sage/plot/arc.py +@@ -273,9 +273,9 @@ class Arc(GraphicPrimitive): + p = patches.Arc((self.x, self.y), + 2. * self.r1, + 2. * self.r2, +- fmod(self.angle, 2 * pi) * (180. / pi), +- self.s1 * (180. / pi), +- self.s2 * (180. / pi)) ++ angle=fmod(self.angle, 2 * pi) * (180. / pi), ++ theta1=self.s1 * (180. / pi), ++ theta2=self.s2 * (180. / pi)) + return p + + def bezier_path(self): +diff --git a/src/sage/plot/ellipse.py b/src/sage/plot/ellipse.py +index a77e6fe640a..c35bed574ef 100644 +--- a/src/sage/plot/ellipse.py ++++ b/src/sage/plot/ellipse.py +@@ -192,7 +192,8 @@ class Ellipse(GraphicPrimitive): + options = self.options() + p = patches.Ellipse( + (self.x,self.y), +- self.r1*2.,self.r2*2.,self.angle/pi*180.) ++ self.r1*2.,self.r2*2., ++ angle=self.angle/pi*180.) + p.set_linewidth(float(options['thickness'])) + p.set_fill(options['fill']) + a = float(options['alpha']) +diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py +index e779e1210e3..8d620b5c625 100644 +--- a/src/sage/plot/graphics.py ++++ b/src/sage/plot/graphics.py +@@ -2007,7 +2007,7 @@ class Graphics(WithEqualityById, SageObject): + We can also do custom formatting if you need it. See above for full + details:: + +- sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") ++ sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") # not tested (broken with matplotlib 3.6) + Graphics object consisting of 1 graphics primitive + + This is particularly useful when setting custom ticks in multiples +@@ -2341,7 +2341,7 @@ class Graphics(WithEqualityById, SageObject): + sage: subplot = Figure().add_subplot(111) + sage: p._objects[0]._render_on_subplot(subplot) + sage: p._matplotlib_tick_formatter(subplot, **d) +- (, ++ (, + , + , + , +diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py +index b36ee57227c..5301a05c3dc 100644 +--- a/src/sage/plot/plot.py ++++ b/src/sage/plot/plot.py +@@ -1741,7 +1741,7 @@ def plot(funcs, *args, **kwds): + + :: + +- sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") ++ sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") # not tested (broken with matplotlib 3.6) + Graphics object consisting of 1 graphics primitive + + .. PLOT:: diff --git a/srcpkgs/sagemath/patches/python-3.11.patch b/srcpkgs/sagemath/patches/python-3.11.patch new file mode 100644 index 000000000000..eafe76bfb794 --- /dev/null +++ b/srcpkgs/sagemath/patches/python-3.11.patch @@ -0,0 +1,45 @@ +--- a/src/sage/cpython/cython_metaclass.h ++++ b/src/sage/cpython/cython_metaclass.h +@@ -66,7 +66,7 @@ + } + + /* Now, set t.__class__ to metaclass */ +- Py_TYPE(t) = metaclass; ++ Py_SET_TYPE(t, metaclass); + PyType_Modified(t); + } + else +--- a/src/sage/symbolic/ginac/numeric.cpp ++++ b/src/sage/symbolic/ginac/numeric.cpp +@@ -52,7 +52,6 @@ + #define register + #define PY_SSIZE_T_CLEAN + #include +-#include + #include "flint/fmpz.h" + #include "flint/fmpz_factor.h" + +--- a/src/sage/libs/gmp/pylong.pyx ++++ b/src/sage/libs/gmp/pylong.pyx +@@ -32,7 +32,7 @@ + from .mpz cimport * + + cdef extern from *: +- Py_ssize_t* Py_SIZE_PTR "&Py_SIZE"(object) ++ void Py_SET_SIZE(object, Py_ssize_t) + int hash_bits """ + #ifdef _PyHASH_BITS + _PyHASH_BITS /* Python 3 */ +@@ -57,10 +57,8 @@ + mpz_export(L.ob_digit, NULL, + -1, sizeof(digit), 0, PyLong_nails, z) + if mpz_sgn(z) < 0: +- # Set correct size (use a pointer to hack around Cython's +- # non-support for lvalues). +- sizeptr = Py_SIZE_PTR(L) +- sizeptr[0] = -pylong_size ++ # Set correct size ++ Py_SET_SIZE(L, -pylong_size) + return L + + diff --git a/srcpkgs/sagemath/patches/sagemath-pari-2.15.patch b/srcpkgs/sagemath/patches/sagemath-pari-2.15.patch new file mode 100644 index 000000000000..ccafad5070c4 --- /dev/null +++ b/srcpkgs/sagemath/patches/sagemath-pari-2.15.patch @@ -0,0 +1,1750 @@ +diff --git a/build/pkgs/giac/patches/pari_2_15.patch b/build/pkgs/giac/patches/pari_2_15.patch +new file mode 100644 +index 0000000000..d2900a5ffc +--- /dev/null ++++ b/build/pkgs/giac/patches/pari_2_15.patch +@@ -0,0 +1,21 @@ ++ANYARG patch ++ ++diff --git a/src/pari.cc b/src/pari.cc ++index 76ce8e1..50d08ab 100644 ++--- a/src/pari.cc +++++ b/src/pari.cc ++@@ -40,6 +40,13 @@ using namespace std; ++ ++ #ifdef HAVE_LIBPARI ++ +++// Anyarg disappeared from PARI 2.15.0 +++#ifdef __cplusplus +++# define ANYARG ... +++#else +++# define ANYARG +++#endif +++ ++ #ifdef HAVE_PTHREAD_H ++ #include ++ #endif ++ +diff --git a/build/pkgs/pari/checksums.ini b/build/pkgs/pari/checksums.ini +index b736feed31..bafd0f36f4 100644 +--- a/build/pkgs/pari/checksums.ini ++++ b/build/pkgs/pari/checksums.ini +@@ -1,5 +1,5 @@ + tarball=pari-VERSION.tar.gz +-sha1=e01647aab7e96a8cb4922cf26a4f224337c6647f +-md5=922f740fcdf8630b30d63dc76b58f756 +-cksum=297133525 ++sha1=cba9b279f67d5efe2fbbccf3be6e9725f816cf07 ++md5=76d430f1bea1b07fa2ad9712deeaa736 ++cksum=1990743897 + upstream_url=https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-VERSION.tar.gz +diff --git a/build/pkgs/pari/package-version.txt b/build/pkgs/pari/package-version.txt +index a1a4224dd5..68e69e405e 100644 +--- a/build/pkgs/pari/package-version.txt ++++ b/build/pkgs/pari/package-version.txt +@@ -1 +1 @@ +-2.13.3 ++2.15.0 +diff --git a/src/doc/de/tutorial/tour_numtheory.rst b/src/doc/de/tutorial/tour_numtheory.rst +index a012234c99..e3149fe949 100644 +--- a/src/doc/de/tutorial/tour_numtheory.rst ++++ b/src/doc/de/tutorial/tour_numtheory.rst +@@ -157,7 +157,7 @@ implementiert. + Univariate Quotient Polynomial Ring in a over Rational Field with modulus + x^3 + x^2 - 2*x + 8 + sage: K.units() +- (3*a^2 + 13*a + 13,) ++ (-3*a^2 - 13*a - 13,) + sage: K.discriminant() + -503 + sage: K.class_group() +diff --git a/src/doc/en/tutorial/tour_numtheory.rst b/src/doc/en/tutorial/tour_numtheory.rst +index 3064d100e2..075e0ac0ad 100644 +--- a/src/doc/en/tutorial/tour_numtheory.rst ++++ b/src/doc/en/tutorial/tour_numtheory.rst +@@ -157,7 +157,7 @@ NumberField class. + Univariate Quotient Polynomial Ring in a over Rational Field with modulus + x^3 + x^2 - 2*x + 8 + sage: K.units() +- (3*a^2 + 13*a + 13,) ++ (-3*a^2 - 13*a - 13,) + sage: K.discriminant() + -503 + sage: K.class_group() +diff --git a/src/doc/es/tutorial/tour_numtheory.rst b/src/doc/es/tutorial/tour_numtheory.rst +index a1f7d1a87b..48e5376cfe 100644 +--- a/src/doc/es/tutorial/tour_numtheory.rst ++++ b/src/doc/es/tutorial/tour_numtheory.rst +@@ -140,7 +140,7 @@ Varios métodos relacionados están implementados en la clase ``NumberField``:: + Univariate Quotient Polynomial Ring in a over Rational Field with modulus + x^3 + x^2 - 2*x + 8 + sage: K.units() +- (3*a^2 + 13*a + 13,) ++ (-3*a^2 - 13*a - 13,) + sage: K.discriminant() + -503 + sage: K.class_group() +diff --git a/src/doc/fr/tutorial/tour_numtheory.rst b/src/doc/fr/tutorial/tour_numtheory.rst +index 871092f5fa..d1b2fee883 100644 +--- a/src/doc/fr/tutorial/tour_numtheory.rst ++++ b/src/doc/fr/tutorial/tour_numtheory.rst +@@ -159,7 +159,7 @@ dans la classe NumberField. + Univariate Quotient Polynomial Ring in a over Rational Field with modulus + x^3 + x^2 - 2*x + 8 + sage: K.units() +- (3*a^2 + 13*a + 13,) ++ (-3*a^2 - 13*a - 13,) + sage: K.discriminant() + -503 + sage: K.class_group() +diff --git a/src/doc/ja/tutorial/tour_numtheory.rst b/src/doc/ja/tutorial/tour_numtheory.rst +index 47af68c862..4d4ed52d50 100644 +--- a/src/doc/ja/tutorial/tour_numtheory.rst ++++ b/src/doc/ja/tutorial/tour_numtheory.rst +@@ -161,7 +161,7 @@ Sageには :math:`p` \-進数体も組込まれている. + Univariate Quotient Polynomial Ring in a over Rational Field with modulus + x^3 + x^2 - 2*x + 8 + sage: K.units() +- (3*a^2 + 13*a + 13,) ++ (-3*a^2 - 13*a - 13,) + sage: K.discriminant() + -503 + sage: K.class_group() +diff --git a/src/doc/pt/tutorial/tour_numtheory.rst b/src/doc/pt/tutorial/tour_numtheory.rst +index 6371b491ea..a3dc973a93 100644 +--- a/src/doc/pt/tutorial/tour_numtheory.rst ++++ b/src/doc/pt/tutorial/tour_numtheory.rst +@@ -157,7 +157,7 @@ NumberField. + Univariate Quotient Polynomial Ring in a over Rational Field with modulus + x^3 + x^2 - 2*x + 8 + sage: K.units() +- (3*a^2 + 13*a + 13,) ++ (-3*a^2 - 13*a - 13,) + sage: K.discriminant() + -503 + sage: K.class_group() +diff --git a/src/doc/ru/tutorial/tour_numtheory.rst b/src/doc/ru/tutorial/tour_numtheory.rst +index 652abfbc99..a985d49fbd 100644 +--- a/src/doc/ru/tutorial/tour_numtheory.rst ++++ b/src/doc/ru/tutorial/tour_numtheory.rst +@@ -150,7 +150,7 @@ Sage содержит стандартные функции теории чис + Univariate Quotient Polynomial Ring in a over Rational Field with modulus + x^3 + x^2 - 2*x + 8 + sage: K.units() +- (3*a^2 + 13*a + 13,) ++ (-3*a^2 - 13*a - 13,) + sage: K.discriminant() + -503 + sage: K.class_group() +diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py +index e57076646f..fec75d07c1 100644 +--- a/src/sage/arith/misc.py ++++ b/src/sage/arith/misc.py +@@ -1465,13 +1465,13 @@ def divisors(n): + + sage: K. = QuadraticField(7) + sage: divisors(K.ideal(7)) +- [Fractional ideal (1), Fractional ideal (-a), Fractional ideal (7)] ++ [Fractional ideal (1), Fractional ideal (a), Fractional ideal (7)] + sage: divisors(K.ideal(3)) + [Fractional ideal (1), Fractional ideal (3), +- Fractional ideal (-a + 2), Fractional ideal (-a - 2)] ++ Fractional ideal (a - 2), Fractional ideal (a + 2)] + sage: divisors(K.ideal(35)) +- [Fractional ideal (1), Fractional ideal (5), Fractional ideal (-a), +- Fractional ideal (7), Fractional ideal (-5*a), Fractional ideal (35)] ++ [Fractional ideal (1), Fractional ideal (5), Fractional ideal (a), ++ Fractional ideal (7), Fractional ideal (5*a), Fractional ideal (35)] + + TESTS:: + +@@ -2569,7 +2569,7 @@ def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds): + + sage: K. = QuadraticField(-1) + sage: factor(122 - 454*i) +- (-3*i - 2) * (-i - 2)^3 * (i + 1)^3 * (i + 4) ++ (-i) * (-i - 2)^3 * (i + 1)^3 * (-2*i + 3) * (i + 4) + + To access the data in a factorization:: + +diff --git a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py +index cdfc11a9e5..b6e1280d6e 100644 +--- a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py ++++ b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py +@@ -7825,9 +7825,9 @@ class DynamicalSystem_projective_field(DynamicalSystem_projective, + sage: f = DynamicalSystem_projective([x^2 + QQbar(sqrt(3))*y^2, y^2, QQbar(sqrt(2))*z^2]) + sage: f.reduce_base_field() + Dynamical System of Projective Space of dimension 2 over Number Field in a with +- defining polynomial y^4 - 4*y^2 + 1 with a = 1.931851652578137? ++ defining polynomial y^4 - 4*y^2 + 1 with a = -0.5176380902050415? + Defn: Defined on coordinates by sending (x : y : z) to +- (x^2 + (a^2 - 2)*y^2 : y^2 : (a^3 - 3*a)*z^2) ++ (x^2 + (-a^2 + 2)*y^2 : y^2 : (a^3 - 3*a)*z^2) + + :: + +diff --git a/src/sage/ext_data/pari/simon/ellQ.gp b/src/sage/ext_data/pari/simon/ellQ.gp +index 420af8f6a2..65e8386779 100644 +--- a/src/sage/ext_data/pari/simon/ellQ.gp ++++ b/src/sage/ext_data/pari/simon/ellQ.gp +@@ -40,7 +40,7 @@ + gp > \r ellcommon.gp + gp > \r ellQ.gp + +- The main function is ellrank(), which takes as an argument ++ The main function is ellQ_ellrank(), which takes as an argument + any elliptic curve in the form [a1,a2,a3,a4,a6] + the result is a vector [r,s,v], where + r is a lower bound for the rank, +@@ -50,7 +50,7 @@ + Example: + + gp > ell = [1,2,3,4,5]; +- gp > ellrank(ell) ++ gp > ellQ_ellrank(ell) + %1 = [1, 1, [[1,2]] + In this example, the rank is exactly 1, and [1,2] has infinite order. + +@@ -92,7 +92,7 @@ + \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + + Explications succintes : +- La fonction ellrank() accepte toutes les courbes sous la forme ++ La fonction ellQ_ellrank() accepte toutes les courbes sous la forme + [a1,a2,a3,a4,a6] + Les coefficients peuvent etre entiers ou non. + L'algorithme utilise est celui de la 2-descente. +@@ -100,7 +100,7 @@ + Il suffit de taper : + + gp > ell = [a1,a2,a3,a4,a6]; +- gp > ellrank(ell) ++ gp > ellQ_ellrank(ell) + + Retourne un vecteur [r,s,v] ou + r est le rang probable (c'est toujours une minoration du rang), +@@ -110,7 +110,7 @@ + Exemple : + + gp > ell = [1,2,3,4,5]; +- gp > ellrank(ell) ++ gp > ellQ_ellrank(ell) + %1 = [1, 1, [[1,2]] + Ici, le rang est exactement 1, et le point [1,2] est d'ordre infini. + +@@ -1571,12 +1571,12 @@ if( DEBUGLEVEL_ell >= 4, print(" end of ell2descent_gen")); + print("rank(E/Q) >= ",m1) + ); + } +-{ellrank(ell,help=[]) = ++{ellQ_ellrank(ell,help=[]) = + \\ Algorithm of 2-descent on the elliptic curve ell. + \\ help is a list of known points on ell. + my(urst,urst1,den,eqell,tors2,bnf,rang,time1); + +-if( DEBUGLEVEL_ell >= 3, print(" starting ellrank")); ++if( DEBUGLEVEL_ell >= 3, print(" starting ellQ_ellrank")); + if( #ell < 13, ell = ellinit(ell)); + + \\ kill the coefficients a1 and a3 +@@ -1630,7 +1630,7 @@ if( DEBUGLEVEL_ell >= 1, print(" Elliptic curve: Y^2 = ",eqell)); + )); + + rang[3] = ellchangepoint(rang[3],ellinverturst(urst)); +-if( DEBUGLEVEL_ell >= 3, print(" end of ellrank")); ++if( DEBUGLEVEL_ell >= 3, print(" end of ellQ_ellrank")); + + return(rang); + } +@@ -2106,13 +2106,13 @@ if( DEBUGLEVEL_ell >= 3, print(" end of ell2descent_viaisog")); + { + \\ functions for elliptic curves + addhelp(ell2descent_complete, +- "ell2descent_complete(e1,e2,e3): Performs a complete 2-descent on the elliptic curve y^2 = (x-e1)*(x-e2)*(x-e3). See ?ellrank for the format of the output."); ++ "ell2descent_complete(e1,e2,e3): Performs a complete 2-descent on the elliptic curve y^2 = (x-e1)*(x-e2)*(x-e3). See ?ellQ_ellrank for the format of the output."); + addhelp(ell2descent_gen, +- "ell2descent_gen((E,bnf,k=1,help=[]): E is a vector of the form [0,A,0,B,C], (or the result of ellinit of such a vector) A,B,C integers such that x^3+A*x^2+B*x+C; bnf is the corresponding bnfinit(,1); Performs 2-descent on the elliptic curve Ek: k*y^2=x^3+A*x^2+B*x+C. See ?ellrank for the format of the output."); ++ "ell2descent_gen((E,bnf,k=1,help=[]): E is a vector of the form [0,A,0,B,C], (or the result of ellinit of such a vector) A,B,C integers such that x^3+A*x^2+B*x+C; bnf is the corresponding bnfinit(,1); Performs 2-descent on the elliptic curve Ek: k*y^2=x^3+A*x^2+B*x+C. See ?ellQ_ellrank for the format of the output."); + addhelp(ell2descent_viaisog, +- "ell2descent_viaisog(E,help=[]): E is an elliptic curve of the form [0,a,0,b,0], with a, b integers. Performs a 2-descent via isogeny on E. See ?ellrank for the format of the output."); +- addhelp(ellrank, +- "ellrank(E,help=[]): E is any elliptic curve defined over Q. Returns a vector [r,s,v], where r is a lower bound for the rank of E, s is the rank of its 2-Selmer group and v is a list of independant points in E(Q)/2E(Q). If help is a vector of nontrivial points on E, the result might be faster. This function might be used in conjunction with elltors2(E). See also ?default_ellQ"); ++ "ell2descent_viaisog(E,help=[]): E is an elliptic curve of the form [0,a,0,b,0], with a, b integers. Performs a 2-descent via isogeny on E. See ?ellQ_ellrank for the format of the output."); ++ addhelp(ellQ_ellrank, ++ "ellQ_ellrank(E,help=[]): E is any elliptic curve defined over Q. Returns a vector [r,s,v], where r is a lower bound for the rank of E, s is the rank of its 2-Selmer group and v is a list of independant points in E(Q)/2E(Q). If help is a vector of nontrivial points on E, the result might be faster. This function might be used in conjunction with elltors2(E). See also ?default_ellQ"); + addhelp(ellhalf, + "ellhalf(E,P): returns the vector of all points Q on the elliptic curve E such that 2Q = P"); + addhelp(ellredgen, +@@ -2143,7 +2143,7 @@ if( DEBUGLEVEL_ell >= 3, print(" end of ell2descent_viaisog")); + + \\ others + addhelp(default_ellQ, +- "default_ellQ(DEBUGLEVEL_ell, LIM1, LIM3, LIMTRIV, ELLREDGENFLAG, COMPLETE, MAXPROB, LIMBIGPRIME): set the value of the global variables used for ellrank() and other related functions. DEBUGLEVEL_ell: 0-5: choose the quantity of information printed during the computation (default=0: print nothing); LIM1 (resp LIM3): search limit for easy (resp hard) points on quartics; LIMTRIV: search limit for trivial points on elliptic curves; ELLREDGENFLAG: if != 0, try to reduce the generators at the end; COMPLETE: if != 0 and full 2-torsion, use complete 2-descent, otherwise via 2-isogeny; MAXPROB, LIMBIGPRIME: technical."); ++ "default_ellQ(DEBUGLEVEL_ell, LIM1, LIM3, LIMTRIV, ELLREDGENFLAG, COMPLETE, MAXPROB, LIMBIGPRIME): set the value of the global variables used for ellQ_ellrank() and other related functions. DEBUGLEVEL_ell: 0-5: choose the quantity of information printed during the computation (default=0: print nothing); LIM1 (resp LIM3): search limit for easy (resp hard) points on quartics; LIMTRIV: search limit for trivial points on elliptic curves; ELLREDGENFLAG: if != 0, try to reduce the generators at the end; COMPLETE: if != 0 and full 2-torsion, use complete 2-descent, otherwise via 2-isogeny; MAXPROB, LIMBIGPRIME: technical."); + /* addhelp(DEBUGLEVEL_ell, + "DEBUGLEVEL_ell: Choose a higher value of this global variable to have more details of the computations printed during the 2-descent algorithm. 0 = don't print anything; 1 = (default) just print the result; 2 = print more details including the Selmer group and the nontrivial quartics."); + */ +diff --git a/src/sage/ext_data/pari/simon/qfsolve.gp b/src/sage/ext_data/pari/simon/qfsolve.gp +index 501fb50828..2107288c1d 100644 +--- a/src/sage/ext_data/pari/simon/qfsolve.gp ++++ b/src/sage/ext_data/pari/simon/qfsolve.gp +@@ -434,146 +434,6 @@ my(cc); + return([U3~*G3*U3,red[2]*U1*U2*U3]); + } + +-\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +-\\ QUADRATIC FORMS MINIMIZATION \\ +-\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +- +-\\ Minimization of the quadratic form G, with nonzero determinant. +-\\ of dimension n>=2. +-\\ G must by symmetric and have integral coefficients. +-\\ Returns [G',U,factd] with U in GLn(Q) such that G'=U~*G*U*constant +-\\ is integral and has minimal determinant. +-\\ In dimension 3 or 4, may return a prime p +-\\ if the reduction at p is impossible because of the local non solvability. +-\\ If given, factdetG must be equal to factor(abs(det(G))). +-{qfminimize(G,factdetG) = +-my(factd,U,Ker,Ker2,sol,aux,di); +-my(p); +-my(n,lf,i,vp,dimKer,dimKer2,m); +- +- n = length(G); +- factd = matrix(0,2); +- if( !factdetG, factdetG = factor(matdet(G))); +- +- lf = length(factdetG[,1]); +- i = 1; U = matid(n); +- +- while(i <= lf, +- vp = factdetG[i,2]; +- if( vp == 0, i++; next); +- p = factdetG[i,1]; +- if( p == -1, i++; next); +-if( DEBUGLEVEL_qfsolve >= 4, print(" p = ",p,"^",vp)); +- +-\\ The case vp = 1 can be minimized only if n is odd. +- if( vp == 1 && n%2 == 0, +- factd = concat(factd~, Mat([p,1])~)~; +- i++; next +- ); +- Ker = kermodp(G,p); dimKer = Ker[1]; Ker = Ker[2]; +- +-\\ Rem: we must have dimKer <= vp +-if( DEBUGLEVEL_qfsolve >= 4, print(" dimKer = ",dimKer)); +-\\ trivial case: dimKer = n +- if( dimKer == n, +-if( DEBUGLEVEL_qfsolve >= 4, print(" case 0: dimKer = n")); +- G /= p; +- factdetG[i,2] -= n; +- next +- ); +- G = Ker~*G*Ker; +- U = U*Ker; +- +-\\ 1st case: dimKer < vp +-\\ then the kernel mod p contains a kernel mod p^2 +- if( dimKer < vp, +-if( DEBUGLEVEL_qfsolve >= 4, print(" case 1: dimker < vp")); +- if( dimKer == 1, +-\\ G[,1] /= p; G[1,] /= p; +- G[,1] /= p; G[1,] = G[1,]/p; +- U[,1] /= p; +- factdetG[i,2] -= 2 +- , +- Ker2 = kermodp(matrix(dimKer,dimKer,j,k,G[j,k]/p),p); +- dimKer2 = Ker2[1]; Ker2 = Ker2[2]; +- for( j = 1, dimKer2, Ker2[,j] /= p); +- Ker2 = matdiagonalblock([Ker2,matid(n-dimKer)]); +- G = Ker2~*G*Ker2; +- U = U*Ker2; +- factdetG[i,2] -= 2*dimKer2 +-); +- +-if( DEBUGLEVEL_qfsolve >= 4, print(" end of case 1")); +- next +- ); +- +-\\ Now, we have vp = dimKer +-\\ 2nd case: the dimension of the kernel is >=2 +-\\ and contains an element of norm 0 mod p^2 +- +-\\ search for an element of norm p^2... in the kernel +- if( dimKer > 2 || +- (dimKer == 2 && issquare( di = Mod((G[1,2]^2-G[1,1]*G[2,2])/p^2,p))), +- if( dimKer > 2, +-if( DEBUGLEVEL_qfsolve >= 4, print(" case 2.1")); +- dimKer = 3; +- sol = qfsolvemodp(matrix(3,3,j,k,G[j,k]/p),p) +- , +-if( DEBUGLEVEL_qfsolve >= 4, print(" case 2.2")); +- if( G[1,1]%p^2 == 0, +- sol = [1,0]~ +- , sol = [-G[1,2]/p+sqrt(di),Mod(G[1,1]/p,p)]~ +- ) +- ); +- sol = centerlift(sol); +- sol /= content(sol); +-if( DEBUGLEVEL_qfsolve >= 4, print(" sol = ",sol)); +- Ker = vectorv(n, j, if( j<= dimKer, sol[j], 0)); \\ fill with 0's +- Ker = completebasis(Ker,1); +- Ker[,n] /= p; +- G = Ker~*G*Ker; +- U = U*Ker; +- factdetG[i,2] -= 2; +-if( DEBUGLEVEL_qfsolve >= 4, print(" end of case 2")); +- next +- ); +- +-\\ Now, we have vp = dimKer <= 2 +-\\ and the kernel contains no vector with norm p^2... +- +-\\ In some cases, exchanging the kernel and the image +-\\ makes the minimization easy. +- +- m = (n-1)\2-1; +- if( ( vp == 1 && issquare(Mod(-(-1)^m*matdet(G)/G[1,1],p))) +- || ( vp == 2 && n%2 == 1 && n >= 5) +- || ( vp == 2 && n%2 == 0 && !issquare(Mod((-1)^m*matdet(G)/p^2,p))) +- , +-if( DEBUGLEVEL_qfsolve >= 4, print(" case 3")); +- Ker = matid(n); +- for( j = dimKer+1, n, Ker[j,j] = p); +- G = Ker~*G*Ker/p; +- U = U*Ker; +- factdetG[i,2] -= 2*dimKer-n; +-if( DEBUGLEVEL_qfsolve >= 4, print(" end of case 3")); +- next +- ); +- +-\\ Minimization was not possible se far. +-\\ If n == 3 or 4, this proves the local non-solubility at p. +- if( n == 3 || n == 4, +-if( DEBUGLEVEL_qfsolve >= 1, print(" no local solution at ",p)); +- return(p)); +- +-if( DEBUGLEVEL_qfsolve >= 4, print(" prime ",p," finished")); +- factd = concat(factd~,Mat([p,vp])~)~; +- i++ +- ); +-\\ apply LLL to avoid coefficients explosion +- aux = qflll(U/content(U)); +-return([aux~*G*aux,U*aux,factd]); +-} +- + \\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + \\ CLASS GROUP COMPUTATIONS \\ + \\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +diff --git a/src/sage/geometry/polyhedron/backend_field.py b/src/sage/geometry/polyhedron/backend_field.py +index 6b921d23a6..2f32c58b1e 100644 +--- a/src/sage/geometry/polyhedron/backend_field.py ++++ b/src/sage/geometry/polyhedron/backend_field.py +@@ -265,7 +265,7 @@ class Polyhedron_field(Polyhedron_base): + An inequality (-0.1419794359520263?, -1.698172434277148?) x + 1.200789243901438? >= 0, + An inequality (0.3001973109753594?, 0.600394621950719?) x - 0.4245431085692869? >= 0) + sage: p.Vrepresentation() # optional - sage.rings.number_field +- (A vertex at (0.?e-15, 0.707106781186548?), ++ (A vertex at (0.?e-16, 0.7071067811865475?), + A vertex at (1.414213562373095?, 0), + A vertex at (4.000000000000000?, 0.372677996249965?)) + """ +@@ -308,7 +308,7 @@ class Polyhedron_field(Polyhedron_base): + An inequality (-0.1419794359520263?, -1.698172434277148?) x + 1.200789243901438? >= 0, + An inequality (0.3001973109753594?, 0.600394621950719?) x - 0.4245431085692869? >= 0) + sage: p.Vrepresentation() # optional - sage.rings.number_field +- (A vertex at (0.?e-15, 0.707106781186548?), ++ (A vertex at (0.?e-16, 0.7071067811865475?), + A vertex at (1.414213562373095?, 0), + A vertex at (4.000000000000000?, 0.372677996249965?)) + """ +diff --git a/src/sage/geometry/polyhedron/backend_normaliz.py b/src/sage/geometry/polyhedron/backend_normaliz.py +index 86b89632a5..ca8a43b248 100644 +--- a/src/sage/geometry/polyhedron/backend_normaliz.py ++++ b/src/sage/geometry/polyhedron/backend_normaliz.py +@@ -53,7 +53,7 @@ def _number_field_elements_from_algebraics_list_of_lists_of_lists(listss, **kwds + 1.732050807568878? + sage: from sage.geometry.polyhedron.backend_normaliz import _number_field_elements_from_algebraics_list_of_lists_of_lists + sage: K, results, hom = _number_field_elements_from_algebraics_list_of_lists_of_lists([[[rt2], [1]], [[rt3]], [[1], []]]); results # optional - sage.rings.number_field +- [[[-a^3 + 3*a], [1]], [[-a^2 + 2]], [[1], []]] ++ [[[-a^3 + 3*a], [1]], [[a^2 - 2]], [[1], []]] + """ + from sage.rings.qqbar import number_field_elements_from_algebraics + numbers = [] +diff --git a/src/sage/groups/matrix_gps/isometries.py b/src/sage/groups/matrix_gps/isometries.py +index f9111a2c92..cca45e7175 100644 +--- a/src/sage/groups/matrix_gps/isometries.py ++++ b/src/sage/groups/matrix_gps/isometries.py +@@ -11,11 +11,11 @@ EXAMPLES:: + sage: L = IntegralLattice("D4") + sage: O = L.orthogonal_group() + sage: O +- Group of isometries with 5 generators ( +- [-1 0 0 0] [0 0 0 1] [-1 -1 -1 -1] [ 1 1 0 0] [ 1 0 0 0] +- [ 0 -1 0 0] [0 1 0 0] [ 0 0 1 0] [ 0 0 1 0] [-1 -1 -1 -1] +- [ 0 0 -1 0] [0 0 1 0] [ 0 1 0 1] [ 0 1 0 1] [ 0 0 1 0] +- [ 0 0 0 -1], [1 0 0 0], [ 0 -1 -1 0], [ 0 -1 -1 0], [ 0 0 0 1] ++ Group of isometries with 3 generators ( ++ [0 0 0 1] [ 1 1 0 0] [ 1 0 0 0] ++ [0 1 0 0] [ 0 0 1 0] [-1 -1 -1 -1] ++ [0 0 1 0] [ 0 1 0 1] [ 0 0 1 0] ++ [1 0 0 0], [ 0 -1 -1 0], [ 0 0 0 1] + ) + + Basic functionality is provided by GAP:: +diff --git a/src/sage/interfaces/genus2reduction.py b/src/sage/interfaces/genus2reduction.py +index 56ae04b235..7a4794daf2 100644 +--- a/src/sage/interfaces/genus2reduction.py ++++ b/src/sage/interfaces/genus2reduction.py +@@ -143,31 +143,31 @@ class ReductionData(SageObject): + sur un corps de valuation discrète", Trans. AMS 348 (1996), + 4577-4610, Section 7.2, Proposition 4). + """ +- def __init__(self, pari_result, P, Q, minimal_equation, minimal_disc, +- local_data, conductor, prime_to_2_conductor_only): ++ def __init__(self, pari_result, P, Q, Pmin, Qmin, minimal_disc, ++ local_data, conductor): + self.pari_result = pari_result + self.P = P + self.Q = Q +- self.minimal_equation = minimal_equation ++ self.Pmin = Pmin ++ self.Qmin = Qmin + self.minimal_disc = minimal_disc + self.local_data = local_data + self.conductor = conductor +- self.prime_to_2_conductor_only = prime_to_2_conductor_only + + def _repr_(self): +- if self.prime_to_2_conductor_only: +- ex = ' (away from 2)' +- else: +- ex = '' + if self.Q == 0: + yterm = '' + else: + yterm = '+ (%s)*y '%self.Q ++ + s = 'Reduction data about this proper smooth genus 2 curve:\n' + s += '\ty^2 %s= %s\n'%(yterm, self.P) +- s += 'A Minimal Equation (away from 2):\n\ty^2 = %s\n'%self.minimal_equation +- s += 'Minimal Discriminant (away from 2): %s\n'%self.minimal_disc +- s += 'Conductor%s: %s\n'%(ex, self.conductor) ++ if self.Qmin: ++ s += 'A Minimal Equation:\n\ty^2 + (%s)y = %s\n'%(self.Qmin, self.Pmin) ++ else: ++ s += 'A Minimal Equation:\n\ty^2 = %s\n'%self.Pmin ++ s += 'Minimal Discriminant: %s\n'%self.minimal_disc ++ s += 'Conductor: %s\n'%self.conductor + s += 'Local Data:\n%s'%self._local_data_str() + return s + +@@ -242,17 +242,7 @@ class Genus2reduction(SageObject): + sage: factor(R.conductor) + 5^4 * 2267 + +- This means that only the odd part of the conductor is known. +- +- :: +- +- sage: R.prime_to_2_conductor_only +- True +- +- The discriminant is always minimal away from 2, but possibly not at +- 2. +- +- :: ++ The discriminant is always minimal:: + + sage: factor(R.minimal_disc) + 2^3 * 5^5 * 2267 +@@ -264,10 +254,10 @@ class Genus2reduction(SageObject): + sage: R + Reduction data about this proper smooth genus 2 curve: + y^2 + (x^3 - 2*x^2 - 2*x + 1)*y = -5*x^5 +- A Minimal Equation (away from 2): +- y^2 = x^6 - 240*x^4 - 2550*x^3 - 11400*x^2 - 24100*x - 19855 +- Minimal Discriminant (away from 2): 56675000 +- Conductor (away from 2): 1416875 ++ A Minimal Equation: ++ y^2 ... ++ Minimal Discriminant: 56675000 ++ Conductor: 1416875 + Local Data: + p=2 + (potential) stable reduction: (II), j=1 +@@ -293,10 +283,10 @@ class Genus2reduction(SageObject): + sage: genus2reduction(0, x^6 + 3*x^3 + 63) + Reduction data about this proper smooth genus 2 curve: + y^2 = x^6 + 3*x^3 + 63 +- A Minimal Equation (away from 2): +- y^2 = x^6 + 3*x^3 + 63 +- Minimal Discriminant (away from 2): 10628388316852992 +- Conductor (away from 2): 2893401 ++ A Minimal Equation: ++ y^2 ... ++ Minimal Discriminant: -10628388316852992 ++ Conductor: 2893401 + Local Data: + p=2 + (potential) stable reduction: (V), j1+j2=0, j1*j2=0 +@@ -327,9 +317,9 @@ class Genus2reduction(SageObject): + sage: genus2reduction(x^3-x^2-1, x^2 - x) + Reduction data about this proper smooth genus 2 curve: + y^2 + (x^3 - x^2 - 1)*y = x^2 - x +- A Minimal Equation (away from 2): +- y^2 = x^6 + 58*x^5 + 1401*x^4 + 18038*x^3 + 130546*x^2 + 503516*x + 808561 +- Minimal Discriminant (away from 2): 169 ++ A Minimal Equation: ++ y^2 ... ++ Minimal Discriminant: -169 + Conductor: 169 + Local Data: + p=13 +@@ -370,10 +360,10 @@ class Genus2reduction(SageObject): + sage: genus2reduction(x^3 - 2*x^2 - 2*x + 1, -5*x^5) + Reduction data about this proper smooth genus 2 curve: + y^2 + (x^3 - 2*x^2 - 2*x + 1)*y = -5*x^5 +- A Minimal Equation (away from 2): +- y^2 = x^6 - 240*x^4 - 2550*x^3 - 11400*x^2 - 24100*x - 19855 +- Minimal Discriminant (away from 2): 56675000 +- Conductor (away from 2): 1416875 ++ A Minimal Equation: ++ y^2 ... ++ Minimal Discriminant: 56675000 ++ Conductor: 1416875 + Local Data: + p=2 + (potential) stable reduction: (II), j=1 +@@ -389,9 +379,9 @@ class Genus2reduction(SageObject): + sage: genus2reduction(x^2 + 1, -5*x^5) + Reduction data about this proper smooth genus 2 curve: + y^2 + (x^2 + 1)*y = -5*x^5 +- A Minimal Equation (away from 2): +- y^2 = -20*x^5 + x^4 + 2*x^2 + 1 +- Minimal Discriminant (away from 2): 48838125 ++ A Minimal Equation: ++ y^2 ... ++ Minimal Discriminant: 48838125 + Conductor: 32025 + Local Data: + p=3 +@@ -412,9 +402,9 @@ class Genus2reduction(SageObject): + sage: genus2reduction(x^3 + x^2 + x,-2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2) + Reduction data about this proper smooth genus 2 curve: + y^2 + (x^3 + x^2 + x)*y = -2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2 +- A Minimal Equation (away from 2): +- y^2 = x^6 + 18*x^3 + 36*x^2 - 27 +- Minimal Discriminant (away from 2): 1520984142 ++ A Minimal Equation: ++ y^2 ... ++ Minimal Discriminant: 1520984142 + Conductor: 954 + Local Data: + p=2 +@@ -436,18 +426,10 @@ class Genus2reduction(SageObject): + raise ValueError("Q (=%s) must have degree at most 3" % Q) + + res = pari.genus2red([P, Q]) +- + conductor = ZZ(res[0]) +- minimal_equation = R(res[2]) +- +- minimal_disc = QQ(res[2].poldisc()).abs() +- if minimal_equation.degree() == 5: +- minimal_disc *= minimal_equation[5]**2 +- # Multiply with suitable power of 2 of the form 2^(2*(d-1) - 12) +- b = 2 * (minimal_equation.degree() - 1) +- k = QQ((12 - minimal_disc.valuation(2), b)).ceil() +- minimal_disc >>= 12 - b*k +- minimal_disc = ZZ(minimal_disc) ++ Pmin = R(res[2][0]) ++ Qmin = R(res[2][1]) ++ minimal_disc = ZZ(pari.hyperelldisc(res[2])) + + local_data = {} + for red in res[3]: +@@ -468,9 +450,7 @@ class Genus2reduction(SageObject): + + local_data[p] = data + +- prime_to_2_conductor_only = (-1 in res[1].component(2)) +- return ReductionData(res, P, Q, minimal_equation, minimal_disc, local_data, +- conductor, prime_to_2_conductor_only) ++ return ReductionData(res, P, Q, Pmin, Qmin, minimal_disc, local_data, conductor) + + def __reduce__(self): + return _reduce_load_genus2reduction, tuple([]) +diff --git a/src/sage/lfunctions/dokchitser.py b/src/sage/lfunctions/dokchitser.py +index fec450d7bc..236402c293 100644 +--- a/src/sage/lfunctions/dokchitser.py ++++ b/src/sage/lfunctions/dokchitser.py +@@ -337,6 +337,7 @@ class Dokchitser(SageObject): + # After init_coeffs is called, future calls to this method should + # return the full output for further parsing + raise RuntimeError("unable to create L-series, due to precision or other limits in PARI") ++ t = t.replace(" *** _^_: Warning: normalizing a series with 0 leading term.\n", "") + return t + + def __check_init(self): +diff --git a/src/sage/lfunctions/pari.py b/src/sage/lfunctions/pari.py +index d2b20f1891..6c31efe239 100644 +--- a/src/sage/lfunctions/pari.py ++++ b/src/sage/lfunctions/pari.py +@@ -339,7 +339,7 @@ def lfun_eta_quotient(scalings, exponents): + 0.0374412812685155 + + sage: lfun_eta_quotient([6],[4]) +- [[Vecsmall([7]), [Vecsmall([6]), Vecsmall([4])]], 0, [0, 1], 2, 36, 1] ++ [[Vecsmall([7]), [Vecsmall([6]), Vecsmall([4]), 0]], 0, [0, 1], 2, 36, 1] + + sage: lfun_eta_quotient([2,1,4], [5,-2,-2]) + Traceback (most recent call last): +diff --git a/src/sage/libs/pari/tests.py b/src/sage/libs/pari/tests.py +index e5a2aa2517..0efcb15de0 100644 +--- a/src/sage/libs/pari/tests.py ++++ b/src/sage/libs/pari/tests.py +@@ -356,7 +356,7 @@ Constructors:: + [2, 4]~*x + [1, 3]~ + + sage: pari(3).Qfb(7, 1) +- Qfb(3, 7, 1, 0.E-19) ++ Qfb(3, 7, 1) + sage: pari(3).Qfb(7, 2) + Traceback (most recent call last): + ... +@@ -512,7 +512,7 @@ Basic functions:: + sage: pari('sqrt(-2)').frac() + Traceback (most recent call last): + ... +- PariError: incorrect type in gfloor (t_COMPLEX) ++ PariError: incorrect type in gfrac (t_COMPLEX) + + sage: pari('1+2*I').imag() + 2 +diff --git a/src/sage/modular/cusps_nf.py b/src/sage/modular/cusps_nf.py +index 25d93cac92..157ebabe29 100644 +--- a/src/sage/modular/cusps_nf.py ++++ b/src/sage/modular/cusps_nf.py +@@ -1220,7 +1220,7 @@ def units_mod_ideal(I): + sage: I = k.ideal(5, a + 1) + sage: units_mod_ideal(I) + [1, +- 2*a^2 + 4*a - 1, ++ -2*a^2 - 4*a + 1, + ...] + + :: +diff --git a/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py b/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +index a881336596..090d1bfaf0 100644 +--- a/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py ++++ b/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +@@ -43,7 +43,7 @@ def coerce_AA(p): + sage: AA(p)._exact_field() + Number Field in a with defining polynomial y^8 ... with a in ... + sage: coerce_AA(p)._exact_field() +- Number Field in a with defining polynomial y^4 - 1910*y^2 - 3924*y + 681058 with a in 39.710518724...? ++ Number Field in a with defining polynomial y^4 - 1910*y^2 - 3924*y + 681058 with a in ...? + """ + el = AA(p) + el.simplify() +diff --git a/src/sage/modular/modsym/p1list_nf.py b/src/sage/modular/modsym/p1list_nf.py +index 222caacca8..f9d969732c 100644 +--- a/src/sage/modular/modsym/p1list_nf.py ++++ b/src/sage/modular/modsym/p1list_nf.py +@@ -58,7 +58,7 @@ Lift an MSymbol to a matrix in `SL(2, R)`: + + sage: alpha = MSymbol(N, a + 2, 3*a^2) + sage: alpha.lift_to_sl2_Ok() +- [-3*a^2 + a + 12, 25*a^2 - 50*a + 100, a + 2, a^2 - 3*a + 3] ++ [-1, 4*a^2 - 13*a + 23, a + 2, 5*a^2 + 3*a - 3] + sage: Ok = k.ring_of_integers() + sage: M = Matrix(Ok, 2, alpha.lift_to_sl2_Ok()) + sage: det(M) +@@ -945,11 +945,11 @@ class P1NFList(SageObject): + sage: N = k.ideal(5, a + 1) + sage: P = P1NFList(N) + sage: u = k.unit_group().gens_values(); u +- [-1, 2*a^2 + 4*a - 1] ++ [-1, -2*a^2 - 4*a + 1] + sage: P.apply_J_epsilon(4, -1) + 2 + sage: P.apply_J_epsilon(4, u[0], u[1]) +- 1 ++ 5 + + :: + +diff --git a/src/sage/modules/free_quadratic_module_integer_symmetric.py b/src/sage/modules/free_quadratic_module_integer_symmetric.py +index a206f0c721..aeb19ab669 100644 +--- a/src/sage/modules/free_quadratic_module_integer_symmetric.py ++++ b/src/sage/modules/free_quadratic_module_integer_symmetric.py +@@ -1168,11 +1168,11 @@ class FreeQuadraticModule_integer_symmetric(FreeQuadraticModule_submodule_with_b + sage: A4 = IntegralLattice("A4") + sage: Aut = A4.orthogonal_group() + sage: Aut +- Group of isometries with 5 generators ( +- [-1 0 0 0] [0 0 0 1] [-1 -1 -1 0] [ 1 0 0 0] [ 1 0 0 0] +- [ 0 -1 0 0] [0 0 1 0] [ 0 0 0 -1] [-1 -1 -1 -1] [ 0 1 0 0] +- [ 0 0 -1 0] [0 1 0 0] [ 0 0 1 1] [ 0 0 0 1] [ 0 0 1 1] +- [ 0 0 0 -1], [1 0 0 0], [ 0 1 0 0], [ 0 0 1 0], [ 0 0 0 -1] ++ Group of isometries with 4 generators ( ++ [0 0 0 1] [-1 -1 -1 0] [ 1 0 0 0] [ 1 0 0 0] ++ [0 0 1 0] [ 0 0 0 -1] [-1 -1 -1 -1] [ 0 1 0 0] ++ [0 1 0 0] [ 0 0 1 1] [ 0 0 0 1] [ 0 0 1 1] ++ [1 0 0 0], [ 0 1 0 0], [ 0 0 1 0], [ 0 0 0 -1] + ) + + The group acts from the right on the lattice and its discriminant group:: +@@ -1180,19 +1180,19 @@ class FreeQuadraticModule_integer_symmetric(FreeQuadraticModule_submodule_with_b + sage: x = A4.an_element() + sage: g = Aut.an_element() + sage: g +- [ 1 1 1 0] +- [ 0 0 -1 0] +- [ 0 0 1 1] +- [ 0 -1 -1 -1] ++ [-1 -1 -1 0] ++ [ 0 0 1 0] ++ [ 0 0 -1 -1] ++ [ 0 1 1 1] + sage: x*g +- (1, 1, 1, 0) ++ (-1, -1, -1, 0) + sage: (x*g).parent()==A4 + True + sage: (g*x).parent() + Vector space of dimension 4 over Rational Field + sage: y = A4.discriminant_group().an_element() + sage: y*g +- (1) ++ (4) + + If the group is finite we can compute the usual things:: + +@@ -1208,10 +1208,10 @@ class FreeQuadraticModule_integer_symmetric(FreeQuadraticModule_submodule_with_b + + sage: A2 = IntegralLattice(matrix.identity(3),Matrix(ZZ,2,3,[1,-1,0,0,1,-1])) + sage: A2.orthogonal_group() +- Group of isometries with 3 generators ( +- [-1/3 2/3 2/3] [ 2/3 2/3 -1/3] [1 0 0] +- [ 2/3 -1/3 2/3] [ 2/3 -1/3 2/3] [0 0 1] +- [ 2/3 2/3 -1/3], [-1/3 2/3 2/3], [0 1 0] ++ Group of isometries with 2 generators ( ++ [ 2/3 2/3 -1/3] [1 0 0] ++ [ 2/3 -1/3 2/3] [0 0 1] ++ [-1/3 2/3 2/3], [0 1 0] + ) + + It can be negative definite as well:: +diff --git a/src/sage/quadratic_forms/binary_qf.py b/src/sage/quadratic_forms/binary_qf.py +index cfa3ada73e..5ac823bc6c 100755 +--- a/src/sage/quadratic_forms/binary_qf.py ++++ b/src/sage/quadratic_forms/binary_qf.py +@@ -141,7 +141,7 @@ class BinaryQF(SageObject): + and a.degree() == 2 and a.parent().ngens() == 2): + x, y = a.parent().gens() + a, b, c = [a.monomial_coefficient(mon) for mon in [x**2, x*y, y**2]] +- elif isinstance(a, pari_gen) and a.type() in ('t_QFI', 't_QFR'): ++ elif isinstance(a, pari_gen) and a.type() in ('t_QFI', 't_QFR', 't_QFB'): + # a has 3 or 4 components + a, b, c = a[0], a[1], a[2] + try: +diff --git a/src/sage/quadratic_forms/genera/genus.py b/src/sage/quadratic_forms/genera/genus.py +index 8290b6c4fa..0fc43f33c6 100644 +--- a/src/sage/quadratic_forms/genera/genus.py ++++ b/src/sage/quadratic_forms/genera/genus.py +@@ -3088,8 +3088,8 @@ class GenusSymbol_global_ring(): + sage: G = Genus(matrix(ZZ, 3, [6,3,0, 3,6,0, 0,0,2])) + sage: G.representatives() + ( +- [2 0 0] [ 2 -1 0] +- [0 6 3] [-1 2 0] ++ [2 0 0] [ 2 1 0] ++ [0 6 3] [ 1 2 0] + [0 3 6], [ 0 0 18] + ) + +diff --git a/src/sage/quadratic_forms/qfsolve.py b/src/sage/quadratic_forms/qfsolve.py +index ddde95e04f..d5e15d9f83 100644 +--- a/src/sage/quadratic_forms/qfsolve.py ++++ b/src/sage/quadratic_forms/qfsolve.py +@@ -70,7 +70,7 @@ def qfsolve(G): + + sage: M = Matrix(QQ, [[3, 0, 0, 0], [0, 5, 0, 0], [0, 0, -7, 0], [0, 0, 0, -11]]) + sage: qfsolve(M) +- (3, -4, -3, -2) ++ (3, 4, -3, -2) + """ + ret = G.__pari__().qfsolve() + if ret.type() == 't_COL': +diff --git a/src/sage/quadratic_forms/quadratic_form__automorphisms.py b/src/sage/quadratic_forms/quadratic_form__automorphisms.py +index c36c667e3b..3d72cf3be1 100644 +--- a/src/sage/quadratic_forms/quadratic_form__automorphisms.py ++++ b/src/sage/quadratic_forms/quadratic_form__automorphisms.py +@@ -300,9 +300,9 @@ def automorphism_group(self): + sage: Q = DiagonalQuadraticForm(ZZ, [1,1,1]) + sage: Q.automorphism_group() + Matrix group over Rational Field with 3 generators ( +- [-1 0 0] [0 0 1] [ 0 0 1] +- [ 0 -1 0] [0 1 0] [-1 0 0] +- [ 0 0 -1], [1 0 0], [ 0 1 0] ++ [ 0 0 1] [1 0 0] [ 1 0 0] ++ [-1 0 0] [0 0 1] [ 0 -1 0] ++ [ 0 1 0], [0 1 0], [ 0 0 1] + ) + + :: +diff --git a/src/sage/rings/finite_rings/finite_field_prime_modn.py b/src/sage/rings/finite_rings/finite_field_prime_modn.py +index 9129ecb56a..d5a4cb8f22 100644 +--- a/src/sage/rings/finite_rings/finite_field_prime_modn.py ++++ b/src/sage/rings/finite_rings/finite_field_prime_modn.py +@@ -111,7 +111,7 @@ class FiniteField_prime_modn(FiniteField_generic, integer_mod_ring.IntegerModRin + sage: RF13 = K.residue_field(pp) + sage: RF13.hom([GF(13)(1)]) + Ring morphism: +- From: Residue field of Fractional ideal (w + 18) ++ From: Residue field of Fractional ideal (-w - 18) + To: Finite Field of size 13 + Defn: 1 |--> 1 + +diff --git a/src/sage/rings/finite_rings/residue_field.pyx b/src/sage/rings/finite_rings/residue_field.pyx +index 7596f2a302..1e1869f1b1 100644 +--- a/src/sage/rings/finite_rings/residue_field.pyx ++++ b/src/sage/rings/finite_rings/residue_field.pyx +@@ -20,13 +20,13 @@ monogenic (i.e., 2 is an essential discriminant divisor):: + + sage: K. = NumberField(x^3 + x^2 - 2*x + 8) + sage: F = K.factor(2); F +- (Fractional ideal (1/2*a^2 - 1/2*a + 1)) * (Fractional ideal (-a^2 + 2*a - 3)) * (Fractional ideal (-3/2*a^2 + 5/2*a - 4)) ++ (Fractional ideal (-1/2*a^2 + 1/2*a - 1)) * (Fractional ideal (-a^2 + 2*a - 3)) * (Fractional ideal (3/2*a^2 - 5/2*a + 4)) + sage: F[0][0].residue_field() +- Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) ++ Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) + sage: F[1][0].residue_field() + Residue field of Fractional ideal (-a^2 + 2*a - 3) + sage: F[2][0].residue_field() +- Residue field of Fractional ideal (-3/2*a^2 + 5/2*a - 4) ++ Residue field of Fractional ideal (3/2*a^2 - 5/2*a + 4) + + We can also form residue fields from `\ZZ`:: + +@@ -258,9 +258,9 @@ class ResidueFieldFactory(UniqueFactory): + the index of ``ZZ[a]`` in the maximal order for all ``a``:: + + sage: K. = NumberField(x^3 + x^2 - 2*x + 8); P = K.ideal(2).factor()[0][0]; P +- Fractional ideal (1/2*a^2 - 1/2*a + 1) ++ Fractional ideal (-1/2*a^2 + 1/2*a - 1) + sage: F = K.residue_field(P); F +- Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) ++ Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) + sage: F(a) + 0 + sage: B = K.maximal_order().basis(); B +@@ -270,7 +270,7 @@ class ResidueFieldFactory(UniqueFactory): + sage: F(B[2]) + 0 + sage: F +- Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) ++ Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) + sage: F.degree() + 1 + +@@ -730,15 +730,15 @@ class ResidueField_generic(Field): + EXAMPLES:: + + sage: I = QQ[3^(1/3)].factor(5)[1][0]; I +- Fractional ideal (-a + 2) ++ Fractional ideal (a - 2) + sage: k = I.residue_field(); k +- Residue field of Fractional ideal (-a + 2) ++ Residue field of Fractional ideal (a - 2) + sage: f = k.lift_map(); f + Lifting map: +- From: Residue field of Fractional ideal (-a + 2) ++ From: Residue field of Fractional ideal (a - 2) + To: Maximal Order in Number Field in a with defining polynomial x^3 - 3 with a = 1.442249570307409? + sage: f.domain() +- Residue field of Fractional ideal (-a + 2) ++ Residue field of Fractional ideal (a - 2) + sage: f.codomain() + Maximal Order in Number Field in a with defining polynomial x^3 - 3 with a = 1.442249570307409? + sage: f(k.0) +@@ -768,7 +768,7 @@ class ResidueField_generic(Field): + + sage: K. = NumberField(x^3-11) + sage: F = K.ideal(37).factor(); F +- (Fractional ideal (37, a + 9)) * (Fractional ideal (37, a + 12)) * (Fractional ideal (2*a - 5)) ++ (Fractional ideal (37, a + 9)) * (Fractional ideal (37, a + 12)) * (Fractional ideal (-2*a + 5)) + sage: k = K.residue_field(F[0][0]) + sage: l = K.residue_field(F[1][0]) + sage: k == l +@@ -846,7 +846,7 @@ cdef class ReductionMap(Map): + sage: F.reduction_map() + Partially defined reduction map: + From: Number Field in a with defining polynomial x^3 + x^2 - 2*x + 8 +- To: Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) ++ To: Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) + + sage: K. = CyclotomicField(5) + sage: F = K.factor(7)[0][0].residue_field() +diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py +index e99dff850f..759cbfb334 100644 +--- a/src/sage/rings/number_field/S_unit_solver.py ++++ b/src/sage/rings/number_field/S_unit_solver.py +@@ -1781,20 +1781,20 @@ def sieve_ordering(SUK, q): + sage: SUK = K.S_unit_group(S=3) + sage: sieve_data = list(sieve_ordering(SUK, 19)) + sage: sieve_data[0] +- (Fractional ideal (xi - 3), +- Fractional ideal (-2*xi^2 + 3), ++ (Fractional ideal (-2*xi^2 + 3), ++ Fractional ideal (-xi + 3), + Fractional ideal (2*xi + 1)) + + sage: sieve_data[1] +- (Residue field of Fractional ideal (xi - 3), +- Residue field of Fractional ideal (-2*xi^2 + 3), ++ (Residue field of Fractional ideal (-2*xi^2 + 3), ++ Residue field of Fractional ideal (-xi + 3), + Residue field of Fractional ideal (2*xi + 1)) + + sage: sieve_data[2] +- ([18, 7, 16, 4], [18, 9, 12, 8], [18, 3, 10, 10]) ++ ([18, 12, 16, 8], [18, 16, 10, 4], [18, 10, 12, 10]) + + sage: sieve_data[3] +- (486, 648, 11664) ++ (648, 2916, 3888) + """ + + K = SUK.number_field() +diff --git a/src/sage/rings/number_field/bdd_height.py b/src/sage/rings/number_field/bdd_height.py +index beb047ae02..b7c8c33d0b 100644 +--- a/src/sage/rings/number_field/bdd_height.py ++++ b/src/sage/rings/number_field/bdd_height.py +@@ -248,7 +248,7 @@ def bdd_norm_pr_ideal_gens(K, norm_list): + sage: from sage.rings.number_field.bdd_height import bdd_norm_pr_ideal_gens + sage: K. = QuadraticField(123) + sage: bdd_norm_pr_ideal_gens(K, range(5)) +- {0: [0], 1: [1], 2: [-g - 11], 3: [], 4: [2]} ++ {0: [0], 1: [1], 2: [g + 11], 3: [], 4: [2]} + + :: + +diff --git a/src/sage/rings/number_field/class_group.py b/src/sage/rings/number_field/class_group.py +index 018ff5f5c6..73c0462cd1 100644 +--- a/src/sage/rings/number_field/class_group.py ++++ b/src/sage/rings/number_field/class_group.py +@@ -221,11 +221,11 @@ class FractionalIdealClass(AbelianGroupWithValuesElement): + Class group of order 76 with structure C38 x C2 + of Number Field in a with defining polynomial x^2 + 20072 + sage: I = (G.0)^11; I +- Fractional ideal class (41, 1/2*a + 5) ++ Fractional ideal class (33, 1/2*a + 8) + sage: J = G(I.ideal()^5); J +- Fractional ideal class (115856201, 1/2*a + 40407883) ++ Fractional ideal class (39135393, 1/2*a + 13654253) + sage: J.reduce() +- Fractional ideal class (57, 1/2*a + 44) ++ Fractional ideal class (73, 1/2*a + 47) + sage: J == I^5 + True + """ +diff --git a/src/sage/rings/number_field/galois_group.py b/src/sage/rings/number_field/galois_group.py +index 79acd053bb..e060148e4d 100644 +--- a/src/sage/rings/number_field/galois_group.py ++++ b/src/sage/rings/number_field/galois_group.py +@@ -944,7 +944,7 @@ class GaloisGroup_v2(GaloisGroup_perm): + sage: K. = NumberField(x^4 - 2*x^2 + 2, 'a').galois_closure() + sage: G = K.galois_group() + sage: [G.artin_symbol(P) for P in K.primes_above(7)] +- [(1,5)(2,6)(3,7)(4,8), (1,5)(2,6)(3,7)(4,8), (1,4)(2,3)(5,8)(6,7), (1,4)(2,3)(5,8)(6,7)] ++ [(1,4)(2,3)(5,8)(6,7), (1,4)(2,3)(5,8)(6,7), (1,5)(2,6)(3,7)(4,8), (1,5)(2,6)(3,7)(4,8)] + sage: G.artin_symbol(17) + Traceback (most recent call last): + ... +diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py +index 58463d570d..ff65634e99 100644 +--- a/src/sage/rings/number_field/number_field.py ++++ b/src/sage/rings/number_field/number_field.py +@@ -3643,7 +3643,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + sage: L. = K.extension(x^2 - 3, x^2 + 1) + sage: M. = L.extension(x^2 + 1) + sage: L.ideal(K.ideal(2, a)) +- Fractional ideal (-a) ++ Fractional ideal (a) + sage: M.ideal(K.ideal(2, a)) == M.ideal(a*(b - c)/2) + True + +@@ -4227,7 +4227,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + (y^2 + 6, Mod(1/6*y, y^2 + 6), Mod(6*y, y^2 + 1/6)) + """ + f = self.absolute_polynomial()._pari_with_name('y') +- if f.pollead() == f.content().denominator() == 1: ++ f = f * f.content().denominator() ++ if f.pollead() == 1: + g = f + alpha = beta = g.variable().Mod(g) + else: +@@ -4821,7 +4822,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + + sage: K. = NumberField(2*x^2 - 1/3) + sage: K._S_class_group_and_units(tuple(K.primes_above(2) + K.primes_above(3))) +- ([-6*a + 2, 6*a + 3, -1, 12*a + 5], []) ++ ([6*a + 2, 6*a + 3, -1, -12*a + 5], []) + """ + K_pari = self.pari_bnf(proof=proof) + S_pari = [p.pari_prime() for p in sorted(set(S))] +@@ -5166,7 +5167,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + + sage: [K.ideal(g).factor() for g in gens] + [(Fractional ideal (2, a + 1)) * (Fractional ideal (3, a + 1)), +- Fractional ideal (-a), ++ Fractional ideal (a), + (Fractional ideal (2, a + 1))^2, + 1] + +@@ -5751,7 +5752,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + sage: K.elements_of_norm(3) + [] + sage: K.elements_of_norm(50) +- [-7*a + 1, 5*a - 5, 7*a + 1] ++ [-a - 7, 5*a - 5, 7*a + 1] + + TESTS: + +@@ -5863,7 +5864,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + sage: K.factor(1+a) + Fractional ideal (a + 1) + sage: K.factor(1+a/5) +- (Fractional ideal (a + 1)) * (Fractional ideal (-a - 2))^-1 * (Fractional ideal (2*a + 1))^-1 * (Fractional ideal (-3*a - 2)) ++ (Fractional ideal (a + 1)) * (Fractional ideal (-a - 2))^-1 * (Fractional ideal (2*a + 1))^-1 * (Fractional ideal (-2*a + 3)) + + An example over a relative number field:: + +@@ -6460,9 +6461,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + sage: new_basis = k.reduced_basis(prec=120) + sage: [c.minpoly() for c in new_basis] + [x - 1, +- x^2 - x + 1, ++ x^2 + x + 1, ++ x^6 + 3*x^5 - 102*x^4 - 103*x^3 + 10572*x^2 - 59919*x + 127657, + x^6 + 3*x^5 - 102*x^4 - 103*x^3 + 10572*x^2 - 59919*x + 127657, +- x^6 - 3*x^5 - 102*x^4 + 315*x^3 + 10254*x^2 - 80955*x + 198147, + x^3 - 171*x + 848, + x^6 + 171*x^4 + 1696*x^3 + 29241*x^2 + 145008*x + 719104] + sage: R = k.order(new_basis) +@@ -7058,7 +7059,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + -a^16 - a^15 - a^14 - a^13 - a^12 - a^11 - a^10 - a^9 - a^8 - a^7 - a^6 - a^5 - a^4 - a^3 - a^2 + 2, + -2*a^16 + 3*a^15 - 3*a^14 + 3*a^13 - 3*a^12 + a^11 - a^9 + 3*a^8 - 4*a^7 + 5*a^6 - 6*a^5 + 4*a^4 - 3*a^3 + 2*a^2 + 2*a - 4, + a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2, +- -a^14 - a^13 + a^12 + 2*a^10 + a^8 - 2*a^7 - 2*a^6 + 2*a^3 - a^2 + 2*a - 2) ++ 2*a^16 + a^15 - a^11 - 3*a^10 - 4*a^9 - 4*a^8 - 4*a^7 - 5*a^6 - 7*a^5 - 8*a^4 - 6*a^3 - 5*a^2 - 6*a - 7) + + TESTS: + +@@ -7067,7 +7068,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + + sage: K. = NumberField(1/2*x^2 - 1/6) + sage: K.units() +- (-3*a + 2,) ++ (3*a - 2,) + """ + proof = proof_flag(proof) + +@@ -7146,7 +7147,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField): + sage: U.gens() + (u0, u1, u2, u3, u4, u5, u6, u7, u8) + sage: U.gens_values() # result not independently verified +- [-1, -a^9 - a + 1, -a^16 + a^15 - a^14 + a^12 - a^11 + a^10 + a^8 - a^7 + 2*a^6 - a^4 + 3*a^3 - 2*a^2 + 2*a - 1, 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4, a^15 + a^14 + 2*a^11 + a^10 - a^9 + a^8 + 2*a^7 - a^5 + 2*a^3 - a^2 - 3*a + 1, -a^16 - a^15 - a^14 - a^13 - a^12 - a^11 - a^10 - a^9 - a^8 - a^7 - a^6 - a^5 - a^4 - a^3 - a^2 + 2, -2*a^16 + 3*a^15 - 3*a^14 + 3*a^13 - 3*a^12 + a^11 - a^9 + 3*a^8 - 4*a^7 + 5*a^6 - 6*a^5 + 4*a^4 - 3*a^3 + 2*a^2 + 2*a - 4, a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2, -a^14 - a^13 + a^12 + 2*a^10 + a^8 - 2*a^7 - 2*a^6 + 2*a^3 - a^2 + 2*a - 2] ++ [-1, -a^9 - a + 1, -a^16 + a^15 - a^14 + a^12 - a^11 + a^10 + a^8 - a^7 + 2*a^6 - a^4 + 3*a^3 - 2*a^2 + 2*a - 1, 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4, a^15 + a^14 + 2*a^11 + a^10 - a^9 + a^8 + 2*a^7 - a^5 + 2*a^3 - a^2 - 3*a + 1, -a^16 - a^15 - a^14 - a^13 - a^12 - a^11 - a^10 - a^9 - a^8 - a^7 - a^6 - a^5 - a^4 - a^3 - a^2 + 2, -2*a^16 + 3*a^15 - 3*a^14 + 3*a^13 - 3*a^12 + a^11 - a^9 + 3*a^8 - 4*a^7 + 5*a^6 - 6*a^5 + 4*a^4 - 3*a^3 + 2*a^2 + 2*a - 4, a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2, 2*a^16 + a^15 - a^11 - 3*a^10 - 4*a^9 - 4*a^8 - 4*a^7 - 5*a^6 - 7*a^5 - 8*a^4 - 6*a^3 - 5*a^2 - 6*a - 7] + """ + proof = proof_flag(proof) + +diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx +index 784c239dc1..aa740069dc 100644 +--- a/src/sage/rings/number_field/number_field_element.pyx ++++ b/src/sage/rings/number_field/number_field_element.pyx +@@ -4446,7 +4446,7 @@ cdef class NumberFieldElement(FieldElement): + sage: f = Qi.embeddings(K)[0] + sage: a = f(2+3*i) * (2-zeta)^2 + sage: a.descend_mod_power(Qi,2) +- [-3*i - 2, -2*i + 3] ++ [-2*i + 3, 3*i + 2] + + An absolute example:: + +@@ -5124,7 +5124,7 @@ cdef class NumberFieldElement_relative(NumberFieldElement): + EXAMPLES:: + + sage: K. = NumberField([x^2 - 2, x^2 - 3, x^2 - 5]) +- sage: P = K.prime_factors(5)[0] ++ sage: P = K.prime_factors(5)[1] + sage: (2*a + b - c).valuation(P) + 1 + """ +diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py +index 5f587556a4..33481fead0 100644 +--- a/src/sage/rings/number_field/number_field_ideal.py ++++ b/src/sage/rings/number_field/number_field_ideal.py +@@ -3355,7 +3355,7 @@ def quotient_char_p(I, p): + [] + + sage: I = K.factor(13)[0][0]; I +- Fractional ideal (-3*i - 2) ++ Fractional ideal (-2*i + 3) + sage: I.residue_class_degree() + 1 + sage: quotient_char_p(I, 13)[0] +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 bae36d4b9c..f64bd5b761 100644 +--- a/src/sage/rings/number_field/number_field_ideal_rel.py ++++ b/src/sage/rings/number_field/number_field_ideal_rel.py +@@ -272,7 +272,7 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal): + sage: L. = K.extension(5*x^2 + 1) + sage: P = L.primes_above(2)[0] + sage: P.gens_reduced() +- (2, 15*a*b + 3*a + 1) ++ (2, -15*a*b + 3*a + 1) + """ + try: + # Compute the single generator, if it exists +@@ -401,7 +401,7 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal): + sage: L. = K.extension(5*x^2 + 1) + sage: P = L.primes_above(2)[0] + sage: P.relative_norm() +- Fractional ideal (-6*a + 2) ++ Fractional ideal (6*a + 2) + """ + L = self.number_field() + K = L.base_field() +@@ -518,7 +518,7 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal): + sage: L. = K.extension(5*x^2 + 1) + sage: P = L.primes_above(2)[0] + sage: P.ideal_below() +- Fractional ideal (-6*a + 2) ++ Fractional ideal (6*a + 2) + """ + L = self.number_field() + K = L.base_field() +diff --git a/src/sage/rings/number_field/number_field_rel.py b/src/sage/rings/number_field/number_field_rel.py +index d33980c4b1..50e846b205 100644 +--- a/src/sage/rings/number_field/number_field_rel.py ++++ b/src/sage/rings/number_field/number_field_rel.py +@@ -213,14 +213,14 @@ class NumberField_relative(NumberField_generic): + sage: l. = k.extension(5*x^2 + 3); l + Number Field in b with defining polynomial 5*x^2 + 3 over its base field + sage: l.pari_rnf() +- [x^2 + (-1/2*y^2 + y - 3/2)*x + (-1/4*y^3 + 1/4*y^2 - 3/4*y - 13/4), ..., y^4 + 6*y^2 + 1, x^2 + (-1/2*y^2 + y - 3/2)*x + (-1/4*y^3 + 1/4*y^2 - 3/4*y - 13/4)], [0, 0]] ++ [x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4), ..., y^4 + 6*y^2 + 1, x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4)], [0, 0]] + sage: b + b + + sage: l. = k.extension(x^2 + 3/5); l + Number Field in b with defining polynomial x^2 + 3/5 over its base field + sage: l.pari_rnf() +- [x^2 + (-1/2*y^2 + y - 3/2)*x + (-1/4*y^3 + 1/4*y^2 - 3/4*y - 13/4), ..., y^4 + 6*y^2 + 1, x^2 + (-1/2*y^2 + y - 3/2)*x + (-1/4*y^3 + 1/4*y^2 - 3/4*y - 13/4)], [0, 0]] ++ [x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4), ..., y^4 + 6*y^2 + 1, x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4)], [0, 0]] + sage: b + b + +diff --git a/src/sage/rings/number_field/order.py b/src/sage/rings/number_field/order.py +index 6eca89ed8d..78ef4c3b33 100644 +--- a/src/sage/rings/number_field/order.py ++++ b/src/sage/rings/number_field/order.py +@@ -520,7 +520,7 @@ class Order(IntegralDomain, sage.rings.abc.Order): + sage: k. = NumberField(x^2 + 5077); G = k.class_group(); G + Class group of order 22 with structure C22 of Number Field in a with defining polynomial x^2 + 5077 + sage: G.0 ^ -9 +- Fractional ideal class (11, a + 7) ++ Fractional ideal class (43, a + 13) + sage: Ok = k.maximal_order(); Ok + Maximal Order in Number Field in a with defining polynomial x^2 + 5077 + sage: Ok * (11, a + 7) +diff --git a/src/sage/rings/number_field/selmer_group.py b/src/sage/rings/number_field/selmer_group.py +index c534aaa9f6..6bc67565d2 100644 +--- a/src/sage/rings/number_field/selmer_group.py ++++ b/src/sage/rings/number_field/selmer_group.py +@@ -491,7 +491,7 @@ def pSelmerGroup(K, S, p, proof=None, debug=False): + + sage: [K.ideal(g).factor() for g in gens] + [(Fractional ideal (2, a + 1)) * (Fractional ideal (3, a + 1)), +- Fractional ideal (-a), ++ Fractional ideal (a), + (Fractional ideal (2, a + 1))^2, + 1] + +diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring.py b/src/sage/rings/polynomial/polynomial_quotient_ring.py +index bb5d8356be..8a7e5fa66f 100644 +--- a/src/sage/rings/polynomial/polynomial_quotient_ring.py ++++ b/src/sage/rings/polynomial/polynomial_quotient_ring.py +@@ -1791,7 +1791,7 @@ class PolynomialQuotientRing_generic(CommutativeRing): + sage: D.selmer_generators([K.ideal(2, -a+1), K.ideal(3, a+1)], 3) + [2, a + 1] + sage: D.selmer_generators([K.ideal(2, -a+1), K.ideal(3, a+1), K.ideal(a)], 3) +- [2, a + 1, a] ++ [2, a + 1, -a] + + """ + fields, isos, iso_classes = self._S_decomposition(tuple(S)) +diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py +index 704b77ce5f..83ee4549e4 100644 +--- a/src/sage/rings/qqbar.py ++++ b/src/sage/rings/qqbar.py +@@ -312,8 +312,8 @@ and we get a way to produce the number directly:: + True + sage: sage_input(n) + R. = QQ[] +- v = AA.polynomial_root(AA.common_polynomial(y^4 - 4*y^2 + 1), RIF(RR(0.51763809020504148), RR(0.51763809020504159))) +- -109*v^3 - 89*v^2 + 327*v + 178 ++ v = AA.polynomial_root(AA.common_polynomial(y^4 - 4*y^2 + 1), RIF(-RR(1.9318516525781366), -RR(1.9318516525781364))) ++ -109*v^3 + 89*v^2 + 327*v - 178 + + We can also see that some computations (basically, those which are + easy to perform exactly) are performed directly, instead of storing +@@ -362,7 +362,7 @@ algorithms in :trac:`10255`:: + # Verified + R1. = QQbar[] + R2. = QQ[] +- v = AA.polynomial_root(AA.common_polynomial(y^4 - 4*y^2 + 1), RIF(RR(0.51763809020504148), RR(0.51763809020504159))) ++ v = AA.polynomial_root(AA.common_polynomial(y^4 - 4*y^2 + 1), RIF(-RR(1.9318516525781366), -RR(1.9318516525781364))) + AA.polynomial_root(AA.common_polynomial(x^4 + QQbar(v^3 - 3*v - 1)*x^3 + QQbar(-v^3 + 3*v - 3)*x^2 + QQbar(-3*v^3 + 9*v + 3)*x + QQbar(3*v^3 - 9*v)), RIF(RR(0.99999999999999989), RR(1.0000000000000002))) + sage: one + 1 +@@ -2310,7 +2310,7 @@ def do_polred(poly, threshold=32): + cost = 2 * bitsize.nbits() + 5 * poly.degree().nbits() + if cost > threshold: + return parent.gen(), parent.gen(), poly +- new_poly, elt_back = poly.__pari__().polredbest(flag=1) ++ new_poly, elt_back = poly.numerator().__pari__().polredbest(flag=1) + elt_fwd = elt_back.modreverse() + return parent(elt_fwd.lift()), parent(elt_back.lift()), parent(new_poly) + +@@ -2542,10 +2542,10 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal + Defn: a |--> 1.414213562373095?) + + sage: number_field_elements_from_algebraics((rt2,rt3)) +- (Number Field in a with defining polynomial y^4 - 4*y^2 + 1, [-a^3 + 3*a, -a^2 + 2], Ring morphism: ++ (Number Field in a with defining polynomial y^4 - 4*y^2 + 1, [-a^3 + 3*a, a^2 - 2], Ring morphism: + From: Number Field in a with defining polynomial y^4 - 4*y^2 + 1 + To: Algebraic Real Field +- Defn: a |--> 0.5176380902050415?) ++ Defn: a |--> -1.931851652578137?) + + ``rt3a`` is a real number in ``QQbar``. Ordinarily, we'd get a homomorphism + to ``AA`` (because all elements are real), but if we specify ``same_field=True``, +@@ -2570,7 +2570,7 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal + (Number Field in a with defining polynomial y^4 - 4*y^2 + 1, -a^3 + 3*a, Ring morphism: + From: Number Field in a with defining polynomial y^4 - 4*y^2 + 1 + To: Algebraic Real Field +- Defn: a |--> 0.5176380902050415?) ++ Defn: a |--> -1.931851652578137?) + + We can specify ``minimal=True`` if we want the smallest number field:: + +@@ -2618,7 +2618,7 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal + sage: nfI^2 + -1 + sage: sum = nfrt2 + nfrt3 + nfI + nfz3; sum +- 2*a^6 + a^5 - a^4 - a^3 - 2*a^2 - a ++ a^5 + a^4 - a^3 + 2*a^2 - a - 1 + sage: hom(sum) + 2.646264369941973? + 1.866025403784439?*I + sage: hom(sum) == rt2 + rt3 + qqI + z3 +@@ -2658,7 +2658,7 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal + sage: nf, nums, hom = number_field_elements_from_algebraics(elems, embedded=True) + sage: nf + Number Field in a with defining polynomial y^24 - 6*y^23 ...- 9*y^2 + 1 +- with a = 0.2598678911433438? + 0.0572892247058457?*I ++ with a = 0.2598679? + 0.0572892?*I + sage: list(map(QQbar, nums)) == elems == list(map(hom, nums)) + True + +@@ -2725,7 +2725,7 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal + sqrt(2), AA.polynomial_root(x^3-3, RIF(0,3)), 11/9, 1] + sage: res = number_field_elements_from_algebraics(my_nums, embedded=True) + sage: res[0] +- Number Field in a with defining polynomial y^24 - 107010*y^22 - 24*y^21 + ... + 250678447193040618624307096815048024318853254384 with a = -95.5053039433554? ++ Number Field in a with defining polynomial y^24 - 107010*y^22 - 24*y^21 + ... + 250678447193040618624307096815048024318853254384 with a = 93.32530798172420? + """ + gen = qq_generator + +@@ -3129,7 +3129,7 @@ class AlgebraicGenerator(SageObject): + sage: root = ANRoot(x^2 - x - 1, RIF(1, 2)) + sage: gen = AlgebraicGenerator(nf, root) + sage: gen.pari_field() +- [y^2 - y - 1, [2, 0], ...] ++ [[y^2 - y - 1, [2, 0], ...] + """ + if self.is_trivial(): + raise ValueError("No PARI field attached to trivial generator") +@@ -3213,7 +3213,7 @@ class AlgebraicGenerator(SageObject): + sage: qq_generator.union(gen3) is gen3 + True + sage: gen2.union(gen3) +- Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in 0.5176380902050415? ++ Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in -1.931851652578137? + """ + if self._trivial: + return other +@@ -3306,13 +3306,13 @@ class AlgebraicGenerator(SageObject): + Number Field in a with defining polynomial y^2 - 3 with a in 1.732050807568878? + sage: gen2_3 = gen2.union(gen3) + sage: gen2_3 +- Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in 0.5176380902050415? ++ Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in -1.931851652578137? + sage: qq_generator.super_poly(gen2) is None + True + sage: gen2.super_poly(gen2_3) + -a^3 + 3*a + sage: gen3.super_poly(gen2_3) +- -a^2 + 2 ++ a^2 - 2 + + """ + if checked is None: +@@ -3360,13 +3360,13 @@ class AlgebraicGenerator(SageObject): + sage: sqrt3 = ANExtensionElement(gen3, nf3.gen()) + sage: gen2_3 = gen2.union(gen3) + sage: gen2_3 +- Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in 0.5176380902050415? ++ Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in -1.931851652578137? + sage: gen2_3(sqrt2) + -a^3 + 3*a + sage: gen2_3(ANRational(1/7)) + 1/7 + sage: gen2_3(sqrt3) +- -a^2 + 2 ++ a^2 - 2 + """ + if self._trivial: + return elt._value +@@ -4336,10 +4336,10 @@ class AlgebraicNumber_base(sage.structure.element.FieldElement): + sage: rt3 = AA(sqrt(3)) + sage: rt3b = rt2 + rt3 - rt2 + sage: rt3b.as_number_field_element() +- (Number Field in a with defining polynomial y^4 - 4*y^2 + 1, -a^2 + 2, Ring morphism: ++ (Number Field in a with defining polynomial y^4 - 4*y^2 + 1, a^2 - 2, Ring morphism: + From: Number Field in a with defining polynomial y^4 - 4*y^2 + 1 + To: Algebraic Real Field +- Defn: a |--> 0.5176380902050415?) ++ Defn: a |--> -1.931851652578137?) + sage: rt3b.as_number_field_element(minimal=True) + (Number Field in a with defining polynomial y^2 - 3, a, Ring morphism: + From: Number Field in a with defining polynomial y^2 - 3 +@@ -4401,7 +4401,7 @@ class AlgebraicNumber_base(sage.structure.element.FieldElement): + sage: rt2b = rt3 + rt2 - rt3 + sage: rt2b.exactify() + sage: rt2b._exact_value() +- a^3 - 3*a where a^4 - 4*a^2 + 1 = 0 and a in 1.931851652578137? ++ a^3 - 3*a where a^4 - 4*a^2 + 1 = 0 and a in -0.5176380902050415? + sage: rt2b.simplify() + sage: rt2b._exact_value() + a where a^2 - 2 = 0 and a in 1.414213562373095? +@@ -4422,7 +4422,7 @@ class AlgebraicNumber_base(sage.structure.element.FieldElement): + sage: QQbar(2)._exact_field() + Trivial generator + sage: (sqrt(QQbar(2)) + sqrt(QQbar(19)))._exact_field() +- Number Field in a with defining polynomial y^4 - 20*y^2 + 81 with a in 2.375100220297941? ++ Number Field in a with defining polynomial y^4 - 20*y^2 + 81 with a in -3.789313782671036? + sage: (QQbar(7)^(3/5))._exact_field() + Number Field in a with defining polynomial y^5 - 2*y^4 - 18*y^3 + 38*y^2 + 82*y - 181 with a in 2.554256611698490? + """ +@@ -4442,7 +4442,7 @@ class AlgebraicNumber_base(sage.structure.element.FieldElement): + sage: QQbar(2)._exact_value() + 2 + sage: (sqrt(QQbar(2)) + sqrt(QQbar(19)))._exact_value() +- -1/9*a^3 - a^2 + 11/9*a + 10 where a^4 - 20*a^2 + 81 = 0 and a in 2.375100220297941? ++ -1/9*a^3 + a^2 + 11/9*a - 10 where a^4 - 20*a^2 + 81 = 0 and a in -3.789313782671036? + sage: (QQbar(7)^(3/5))._exact_value() + 2*a^4 + 2*a^3 - 34*a^2 - 17*a + 150 where a^5 - 2*a^4 - 18*a^3 + 38*a^2 + 82*a - 181 = 0 and a in 2.554256611698490? + """ +@@ -6857,7 +6857,7 @@ class AlgebraicPolynomialTracker(SageObject): + sage: p = sqrt(AA(2)) * x^2 - sqrt(AA(3)) + sage: cp = AA.common_polynomial(p) + sage: cp.generator() +- Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in 1.931851652578137? ++ Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in -0.5176380902050415? + """ + self.exactify() + return self._gen +@@ -7706,7 +7706,7 @@ class ANExtensionElement(ANDescr): + + sage: rt2b.exactify() + sage: rt2b._descr +- a^3 - 3*a where a^4 - 4*a^2 + 1 = 0 and a in 1.931851652578137? ++ a^3 - 3*a where a^4 - 4*a^2 + 1 = 0 and a in -0.5176380902050415? + sage: rt2b._descr.is_simple() + False + """ +@@ -7791,7 +7791,7 @@ class ANExtensionElement(ANDescr): + sage: rt2b = rt3 + rt2 - rt3 + sage: rt2b.exactify() + sage: rt2b._descr +- a^3 - 3*a where a^4 - 4*a^2 + 1 = 0 and a in 1.931851652578137? ++ a^3 - 3*a where a^4 - 4*a^2 + 1 = 0 and a in -0.5176380902050415? + sage: rt2b._descr.simplify(rt2b) + a where a^2 - 2 = 0 and a in 1.414213562373095? + """ +@@ -7830,9 +7830,9 @@ class ANExtensionElement(ANDescr): + sage: type(b) + + sage: b.neg(a) +- 1/3*a^3 - 2/3*a^2 + 4/3*a - 2 where a^4 - 2*a^3 + a^2 - 6*a + 9 = 0 and a in -0.7247448713915890? - 1.573132184970987?*I ++ -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") +- 1/3*a^3 - 2/3*a^2 + 4/3*a - 2 where a^4 - 2*a^3 + a^2 - 6*a + 9 = 0 and a in -0.7247448713915890? - 1.573132184970987?*I ++ -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 + """ + return ANExtensionElement(self._generator, -self._value) + +@@ -7848,9 +7848,9 @@ class ANExtensionElement(ANDescr): + sage: type(b) + + sage: b.invert(a) +- 7/3*a^3 - 2/3*a^2 + 4/3*a - 12 where a^4 - 2*a^3 + a^2 - 6*a + 9 = 0 and a in -0.7247448713915890? - 1.573132184970987?*I ++ -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") +- 7/3*a^3 - 2/3*a^2 + 4/3*a - 12 where a^4 - 2*a^3 + a^2 - 6*a + 9 = 0 and a in -0.7247448713915890? - 1.573132184970987?*I ++ -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 + """ + return ANExtensionElement(self._generator, ~self._value) + +@@ -7866,9 +7866,9 @@ class ANExtensionElement(ANDescr): + sage: type(b) + + sage: b.conjugate(a) +- -1/3*a^3 + 2/3*a^2 - 4/3*a + 2 where a^4 - 2*a^3 + a^2 - 6*a + 9 = 0 and a in -0.7247448713915890? + 1.573132184970987?*I ++ 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") +- -1/3*a^3 + 2/3*a^2 - 4/3*a + 2 where a^4 - 2*a^3 + a^2 - 6*a + 9 = 0 and a in -0.7247448713915890? + 1.573132184970987?*I ++ 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 + """ + if self._exactly_real: + return self +@@ -8501,7 +8501,7 @@ def an_binop_expr(a, b, op): + sage: x = an_binop_expr(a, b, operator.add); x + + sage: x.exactify() +- -6/7*a^7 + 2/7*a^6 + 71/7*a^5 - 26/7*a^4 - 125/7*a^3 + 72/7*a^2 + 43/7*a - 47/7 where a^8 - 12*a^6 + 23*a^4 - 12*a^2 + 1 = 0 and a in 3.12580...? ++ 6/7*a^7 - 2/7*a^6 - 71/7*a^5 + 26/7*a^4 + 125/7*a^3 - 72/7*a^2 - 43/7*a + 47/7 where a^8 - 12*a^6 + 23*a^4 - 12*a^2 + 1 = 0 and a in -0.3199179336182997? + + sage: a = QQbar(sqrt(2)) + QQbar(sqrt(3)) + sage: b = QQbar(sqrt(3)) + QQbar(sqrt(5)) +@@ -8510,7 +8510,7 @@ def an_binop_expr(a, b, op): + sage: x = an_binop_expr(a, b, operator.mul); x + + sage: x.exactify() +- 2*a^7 - a^6 - 24*a^5 + 12*a^4 + 46*a^3 - 22*a^2 - 22*a + 9 where a^8 - 12*a^6 + 23*a^4 - 12*a^2 + 1 = 0 and a in 3.1258...? ++ 2*a^7 - a^6 - 24*a^5 + 12*a^4 + 46*a^3 - 22*a^2 - 22*a + 9 where a^8 - 12*a^6 + 23*a^4 - 12*a^2 + 1 = 0 and a in -0.3199179336182997? + """ + return ANBinaryExpr(a, b, op) + +diff --git a/src/sage/schemes/affine/affine_morphism.py b/src/sage/schemes/affine/affine_morphism.py +index 1c4f2dff18..32c2e47e49 100644 +--- a/src/sage/schemes/affine/affine_morphism.py ++++ b/src/sage/schemes/affine/affine_morphism.py +@@ -1148,9 +1148,9 @@ class SchemeMorphism_polynomial_affine_space_field(SchemeMorphism_polynomial_aff + sage: H = End(A) + sage: f = H([(QQbar(sqrt(2))*x^2 + 1/QQbar(sqrt(3))) / (5*x)]) + sage: f.reduce_base_field() +- Scheme endomorphism of Affine Space of dimension 1 over Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a = 1.931851652578137? ++ Scheme endomorphism of Affine Space of dimension 1 over Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a = ...? + Defn: Defined on coordinates by sending (x) to +- (((a^3 - 3*a)*x^2 + (1/3*a^2 - 2/3))/(5*x)) ++ (((a^3 - 3*a)*x^2 + (-1/3*a^2 + 2/3))/(5*x)) + + :: + +diff --git a/src/sage/schemes/elliptic_curves/ell_field.py b/src/sage/schemes/elliptic_curves/ell_field.py +index 68b8375dae..48f358ea6a 100644 +--- a/src/sage/schemes/elliptic_curves/ell_field.py ++++ b/src/sage/schemes/elliptic_curves/ell_field.py +@@ -845,7 +845,7 @@ class EllipticCurve_field(ell_generic.EllipticCurve_generic, ProjectivePlaneCurv + sage: E = E.base_extend(G).quadratic_twist(c); E + Elliptic Curve defined by y^2 = x^3 + 5*a0*x^2 + (-200*a0^2)*x + (-42000*a0^2+42000*a0+126000) over Number Field in a0 with defining polynomial x^3 - 3*x^2 + 3*x + 9 + sage: K. = E.division_field(3, simplify_all=True); K +- Number Field in b with defining polynomial x^12 - 10*x^10 + 55*x^8 - 60*x^6 + 75*x^4 + 1350*x^2 + 2025 ++ Number Field in b with defining polynomial x^12 + 5*x^10 + 40*x^8 + 315*x^6 + 750*x^4 + 675*x^2 + 2025 + + Some higher-degree examples:: + +diff --git a/src/sage/schemes/elliptic_curves/ell_generic.py b/src/sage/schemes/elliptic_curves/ell_generic.py +index 926ae310ea..3bae819fb0 100644 +--- a/src/sage/schemes/elliptic_curves/ell_generic.py ++++ b/src/sage/schemes/elliptic_curves/ell_generic.py +@@ -3324,8 +3324,8 @@ class EllipticCurve_generic(WithEqualityById, plane_curve.ProjectivePlaneCurve): + sage: K. = QuadraticField(2) + sage: E = EllipticCurve([1,a]) + sage: E.pari_curve() +- [Mod(0, y^2 - 2), Mod(0, y^2 - 2), Mod(0, y^2 - 2), Mod(1, y^2 - 2), +- Mod(y, y^2 - 2), Mod(0, y^2 - 2), Mod(2, y^2 - 2), Mod(4*y, y^2 - 2), ++ [0, 0, 0, Mod(1, y^2 - 2), ++ Mod(y, y^2 - 2), 0, Mod(2, y^2 - 2), Mod(4*y, y^2 - 2), + Mod(-1, y^2 - 2), Mod(-48, y^2 - 2), Mod(-864*y, y^2 - 2), + Mod(-928, y^2 - 2), Mod(3456/29, y^2 - 2), Vecsmall([5]), + [[y^2 - 2, [2, 0], 8, 1, [[1, -1.41421356237310; +diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py +index edbd196090..c44c803aa8 100644 +--- a/src/sage/schemes/elliptic_curves/ell_number_field.py ++++ b/src/sage/schemes/elliptic_curves/ell_number_field.py +@@ -218,7 +218,7 @@ class EllipticCurve_number_field(EllipticCurve_field): + sage: E == loads(dumps(E)) + True + sage: E.simon_two_descent() +- (2, 2, [(0 : 0 : 1)]) ++ (2, 2, [(0 : 0 : 1), (1/18*a + 7/18 : -5/54*a - 17/54 : 1)]) + sage: E.simon_two_descent(lim1=5, lim3=5, limtriv=10, maxprob=7, limbigprime=10) + (2, 2, [(-1 : 0 : 1), (-2 : -1/2*a - 1/2 : 1)]) + +@@ -274,7 +274,7 @@ class EllipticCurve_number_field(EllipticCurve_field): + sage: E.simon_two_descent() # long time (4s on sage.math, 2013) + (3, + 3, +- [(5/8*zeta43_0^2 + 17/8*zeta43_0 - 9/4 : -27/16*zeta43_0^2 - 103/16*zeta43_0 + 39/8 : 1), ++ [(1/8*zeta43_0^2 - 3/8*zeta43_0 - 1/4 : -5/16*zeta43_0^2 + 7/16*zeta43_0 + 1/8 : 1), + (0 : 0 : 1)]) + """ + verbose = int(verbose) +@@ -865,7 +865,7 @@ class EllipticCurve_number_field(EllipticCurve_field): + Conductor exponent: 1 + Kodaira Symbol: I1 + Tamagawa Number: 1, +- Local data at Fractional ideal (-3*i - 2): ++ Local data at Fractional ideal (-2*i + 3): + Reduction type: bad split multiplicative + Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1 + Minimal discriminant valuation: 2 +@@ -2645,12 +2645,12 @@ class EllipticCurve_number_field(EllipticCurve_field): + [-92, -23, -23] + + sage: C.matrix() # long time +- [1 2 2 4 2 4] +- [2 1 2 2 4 4] +- [2 2 1 4 4 2] +- [4 2 4 1 3 3] +- [2 4 4 3 1 3] +- [4 4 2 3 3 1] ++ [1 2 2 4 4 2] ++ [2 1 2 4 2 4] ++ [2 2 1 2 4 4] ++ [4 4 2 1 3 3] ++ [4 2 4 3 1 3] ++ [2 4 4 3 3 1] + + The graph of this isogeny class has a shape which does not + occur over `\QQ`: a triangular prism. Note that for curves +@@ -2677,12 +2677,12 @@ class EllipticCurve_number_field(EllipticCurve_field): + + sage: G = C.graph() # long time + sage: G.adjacency_matrix() # long time +- [0 1 1 0 1 0] +- [1 0 1 1 0 0] +- [1 1 0 0 0 1] +- [0 1 0 0 1 1] +- [1 0 0 1 0 1] +- [0 0 1 1 1 0] ++ [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] + + To display the graph without any edge labels:: + +@@ -3316,7 +3316,7 @@ class EllipticCurve_number_field(EllipticCurve_field): + sage: points = [E.lift_x(x) for x in xi] + sage: newpoints, U = E.lll_reduce(points) # long time (35s on sage.math, 2011) + sage: [P[0] for P in newpoints] # long time +- [6823803569166584943, 5949539878899294213, 2005024558054813068, 5864879778877955778, 23955263915878682727/4, 5922188321411938518, 5286988283823825378, 175620639884534615751/25, -11451575907286171572, 3502708072571012181, 1500143935183238709184/225, 27180522378120223419/4, -5811874164190604461581/625, 26807786527159569093, 7404442636649562303, 475656155255883588, 265757454726766017891/49, 7272142121019825303, 50628679173833693415/4, 6951643522366348968, 6842515151518070703, 111593750389650846885/16, 2607467890531740394315/9, -1829928525835506297] ++ [6823803569166584943, 5949539878899294213, 2005024558054813068, 5864879778877955778, 23955263915878682727/4, 5922188321411938518, 5286988283823825378, 11465667352242779838, -11451575907286171572, 3502708072571012181, 1500143935183238709184/225, 27180522378120223419/4, -5811874164190604461581/625, 26807786527159569093, 7041412654828066743, 475656155255883588, 265757454726766017891/49, 7272142121019825303, 50628679173833693415/4, 6951643522366348968, 6842515151518070703, 111593750389650846885/16, 2607467890531740394315/9, -1829928525835506297] + + An example to show the explicit use of the height pairing matrix:: + +diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py +index 3808822812..a75290ea35 100644 +--- a/src/sage/schemes/elliptic_curves/ell_rational_field.py ++++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py +@@ -1827,7 +1827,7 @@ class EllipticCurve_rational_field(EllipticCurve_number_field): + sage: E = EllipticCurve('389a1') + sage: E._known_points = [] # clear cached points + sage: E.simon_two_descent() +- (2, 2, [(1 : 0 : 1), (-11/9 : 28/27 : 1)]) ++ (2, 2, [(5/4 : 5/8 : 1), (-3/4 : 7/8 : 1)]) + sage: E = EllipticCurve('5077a1') + sage: E.simon_two_descent() + (3, 3, [(1 : 0 : 1), (2 : 0 : 1), (0 : 2 : 1)]) +diff --git a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py +index 81ad295160..d484a4a18b 100644 +--- a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py ++++ b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py +@@ -780,12 +780,12 @@ def deg_one_primes_iter(K, principal_only=False): + [Fractional ideal (2, a + 1), + Fractional ideal (3, a + 1), + Fractional ideal (3, a + 2), +- Fractional ideal (-a), ++ Fractional ideal (a), + Fractional ideal (7, a + 3), + Fractional ideal (7, a + 4)] + sage: it = deg_one_primes_iter(K, True) + sage: [next(it) for _ in range(6)] +- [Fractional ideal (-a), ++ [Fractional ideal (a), + Fractional ideal (-2*a + 3), + Fractional ideal (2*a + 3), + Fractional ideal (a + 6), +diff --git a/src/sage/schemes/elliptic_curves/gp_simon.py b/src/sage/schemes/elliptic_curves/gp_simon.py +index 28b97f34af..9f7d1b6020 100644 +--- a/src/sage/schemes/elliptic_curves/gp_simon.py ++++ b/src/sage/schemes/elliptic_curves/gp_simon.py +@@ -56,7 +56,7 @@ def simon_two_descent(E, verbose=0, lim1=None, lim3=None, limtriv=None, + sage: import sage.schemes.elliptic_curves.gp_simon + sage: E=EllipticCurve('389a1') + sage: sage.schemes.elliptic_curves.gp_simon.simon_two_descent(E) +- (2, 2, [(1 : 0 : 1), (-11/9 : 28/27 : 1)]) ++ (2, 2, [(5/4 : 5/8 : 1), (-3/4 : 7/8 : 1)]) + + TESTS:: + +@@ -117,7 +117,7 @@ def simon_two_descent(E, verbose=0, lim1=None, lim3=None, limtriv=None, + # The block below mimics the defaults in Simon's scripts, and needs to be changed + # when these are updated. + if K is QQ: +- cmd = 'ellrank(%s, %s);' % (list(E.ainvs()), [P.__pari__() for P in known_points]) ++ cmd = 'ellQ_ellrank(%s, %s);' % (list(E.ainvs()), [P.__pari__() for P in known_points]) + if lim1 is None: + lim1 = 5 + if lim3 is None: +@@ -144,7 +144,7 @@ def simon_two_descent(E, verbose=0, lim1=None, lim3=None, limtriv=None, + if verbose > 0: + print(s) + v = gp.eval('ans') +- if v=='ans': # then the call to ellrank() or bnfellrank() failed ++ if v=='ans': # then the call to ellQ_ellrank() or bnfellrank() failed + raise RuntimeError("An error occurred while running Simon's 2-descent program") + if verbose >= 2: + print("v = %s" % v) +diff --git a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py +index a936deb74f..dc19254d8c 100644 +--- a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py ++++ b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py +@@ -1208,14 +1208,14 @@ def isogenies_13_0(E, minimal_models=True): + 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, ++ 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, +- 579363345221/13763747804451840*a^11 + 371192377511/860234237778240*a^10 + 8855090365657/1146978983704320*a^9 + 5367261541663/1633873196160*a^8 + 614883554332193/15930263662560*a^7 + 30485197378483/68078049840*a^6 - 131000897588387/2450809794240*a^5 - 203628705777949/306351224280*a^4 - 1587619388190379/204234149520*a^3 + 14435069706551/11346341640*a^2 + 7537273048614/472764235*a + 89198980034806/472764235), ++ 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 - 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, ++ 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, +- -132601797212627/3440936951112960*a^11 - 6212467020502021/13763747804451840*a^10 - 1515926454902497/286744745926080*a^9 - 15154913741799637/4901619588480*a^8 - 576888119803859263/15930263662560*a^7 - 86626751639648671/204234149520*a^6 + 16436657569218427/306351224280*a^5 + 1540027900265659087/2450809794240*a^4 + 375782662805915809/51058537380*a^3 - 14831920924677883/11346341640*a^2 - 7237947774817724/472764235*a - 84773764066089509/472764235)] ++ -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)] + """ + if E.j_invariant()!=0: + raise ValueError("j-invariant must be 0.") diff --git a/srcpkgs/sagemath/patches/sagemath-pari-2.15b.patch b/srcpkgs/sagemath/patches/sagemath-pari-2.15b.patch new file mode 100644 index 000000000000..762bb2612632 --- /dev/null +++ b/srcpkgs/sagemath/patches/sagemath-pari-2.15b.patch @@ -0,0 +1,29 @@ +From f0365f30834b6890313790b3845c647d0160fa6a Mon Sep 17 00:00:00 2001 +From: Vincent Delecroix <20100.delecroix@gmail.com*> +Date: Fri, 30 Sep 2022 16:31:08 +0200 +Subject: fix doctest if fqf_orthogonal + +--- + src/sage/groups/fqf_orthogonal.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py +index 75de408..7fc4dbe 100644 +--- a/src/sage/groups/fqf_orthogonal.py ++++ b/src/sage/groups/fqf_orthogonal.py +@@ -245,10 +245,10 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup): + sage: all(x*f==x*fbar for x in q.gens()) + True + sage: L = IntegralLattice("A2").twist(3) +- sage: q = L.discriminant_group() + sage: OL = L.orthogonal_group() ++ sage: assert OL(OL.0.matrix()) == OL.0 ++ sage: q = L.discriminant_group() + sage: Oq = q.orthogonal_group() +- sage: assert Oq(OL.0) == Oq(OL.0.matrix()) + sage: assert Oq(Oq.0.matrix()) == Oq.0 + """ + from sage.libs.gap.element import GapElement +-- +cgit v1.0-1-gd88e + diff --git a/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch b/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch deleted file mode 100644 index 4bd6f4f4e2dc..000000000000 --- a/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch +++ /dev/null @@ -1,670 +0,0 @@ -As produced by `git diff 9.5 9.6.beta3 -- src/sage/libs/lrcalc` - -diff --git a/src/sage/libs/lrcalc/lrcalc.pxd b/src/sage/libs/lrcalc/lrcalc.pxd -deleted file mode 100644 -index 10b88db93f2..00000000000 ---- a/src/sage/libs/lrcalc/lrcalc.pxd -+++ /dev/null -@@ -1,77 +0,0 @@ --# distutils: libraries = lrcalc -- --cdef extern from "lrcalc/hashtab.h": -- ctypedef struct hashtab: -- pass -- -- ctypedef struct hash_itr: -- pass -- -- ctypedef unsigned long hashkey_t -- ctypedef int (*cmp_t) (void* a, void* b) -- ctypedef hashkey_t (*hash_t) (void* a) -- -- hashtab* hash_new(cmp_t cm, hash_t hsh) -- void hash_free(hashtab *ht) -- -- void* hash_lookup(hashtab *ht, void *key) -- void* hash_insert(hashtab *ht, void *key, void *value) -- -- bint hash_good(hash_itr) -- void hash_first(hashtab* s, hash_itr itr) -- void hash_next(hash_itr itr) -- void* hash_key(hash_itr itr) -- void* hash_value(hash_itr itr) -- int hash_intvalue(hash_itr itr) -- --cdef extern from "lrcalc/vector.h": -- ctypedef struct vector: -- size_t length -- int* array -- -- vector* v_new(int length) -- void v_free(vector* v) -- void v_print(vector *v) -- int v_length(vector* v) -- int v_elem(vector* v, int i) -- -- ctypedef struct vecpair: -- vector *first -- vector *second -- -- vector* vp_first(vecpair* vp) -- vector* vp_second(vecpair* vp) -- --cdef extern from "lrcalc/list.h": -- cdef struct _list: -- void **array -- size_t allocated -- size_t length -- void l_free(_list *lst) -- --cdef extern from "lrcalc/symfcn.h": -- long long lrcoef_c "lrcoef"(vector* outer, vector* inner1, vector* inner2) -- hashtab* mult_c "mult"(vector *sh1, vector *sh2, int maxrows) -- hashtab* skew_c "skew"(vector *outer, vector *inner, int maxrows) -- hashtab* coprod_c "coprod"(vector *part, int all) -- void fusion_reduce_c "fusion_reduce"(hashtab* ht, int rows, int cols, int opt_zero) -- _list *quantum_reduce_c "quantum_reduce"(hashtab* ht, int rows, int col) -- -- ctypedef struct skewtab: -- vector *outer -- vector *inner -- vector *conts -- int maxrows -- vector *conjugate -- int rows -- int cols -- int matrix[1] -- -- skewtab *st_new(vector *outer, vector *inner, vector *conts, int maxrows) -- int st_next(skewtab *st) -- void st_print(skewtab *st) -- void st_free(skewtab *st) -- -- --cdef extern from "lrcalc/schublib.h": -- hashtab* mult_schubert_c "mult_schubert"(vector *sh1, vector *sh2, int rank) -diff --git a/src/sage/libs/lrcalc/lrcalc.pyx b/src/sage/libs/lrcalc/lrcalc.py -similarity index 60% -rename from src/sage/libs/lrcalc/lrcalc.pyx -rename to src/sage/libs/lrcalc/lrcalc.py -index b591081ec4c..b541bfacd89 100644 ---- a/src/sage/libs/lrcalc/lrcalc.pyx -+++ b/src/sage/libs/lrcalc/lrcalc.py -@@ -10,7 +10,8 @@ fusion products. All of the above are achieved by counting LR - appropriate shape and content by iterating through them. - Additionally, ``lrcalc`` handles products of Schubert polynomials. - --The web page of ``lrcalc`` is ``_. -+The web page of ``lrcalc`` is -+``_. - - The following describes the Sage interface to this library. - -@@ -36,12 +37,13 @@ Schur expansion:: - [4, 2]: 1} - - Same product, but include only partitions with at most 3 rows. This --corresponds to computing in the representation ring of gl(3):: -+corresponds to computing in the representation ring of `\mathfrak{gl}(3)`:: - - sage: lrcalc.mult([2,1], [2,1], 3) - {[2, 2, 2]: 1, [3, 2, 1]: 2, [3, 3]: 1, [4, 1, 1]: 1, [4, 2]: 1} - --We can also compute the fusion product, here for sl(3) and level 2:: -+We can also compute the fusion product, here for `\mathfrak{sl}(3)` -+and level 2:: - - sage: lrcalc.mult([3,2,1], [3,2,1], 3,2) - {[4, 4, 4]: 1, [5, 4, 3]: 1} -@@ -77,42 +79,38 @@ Multiply two Schubert polynomials:: - [6, 2, 1, 4, 3, 5]: 1} - - Same product, but include only permutations of 5 elements in the result. --This corresponds to computing in the cohomology ring of Fl(5):: -+This corresponds to computing in the cohomology ring of `Fl(5)`:: - - sage: lrcalc.mult_schubert([4,2,1,3], [1,4,2,5,3], 5) - {[4, 5, 1, 3, 2]: 1, [5, 3, 1, 4, 2]: 1, [5, 4, 1, 2, 3]: 1} - - List all Littlewood-Richardson tableaux of skew shape `\mu/\nu`; in - this example `\mu=[3,2,1]` and `\nu=[2,1]`. Specifying a third entry --`maxrows` restricts the alphabet to `\{1,2,\ldots,maxrows\}`:: -+`M' = ``maxrows`` restricts the alphabet to `\{1,2,\ldots,M\}`:: - - sage: list(lrcalc.lrskew([3,2,1],[2,1])) - [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]], - [[None, None, 1], [None, 2], [1]], [[None, None, 1], [None, 2], [3]]] - - sage: list(lrcalc.lrskew([3,2,1],[2,1],maxrows=2)) -- [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]], [[None, None, 1], [None, 2], [1]]] -+ [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]], -+ [[None, None, 1], [None, 2], [1]]] - - .. TODO:: - -- use this library in the :class:`SymmetricFunctions` code, to -+ Use this library in the :class:`SymmetricFunctions` code, to - make it easy to apply it to linear combinations of Schur functions. - - .. SEEALSO:: - - - :func:`lrcoef` -- - - :func:`mult` -- - - :func:`coprod` -- - - :func:`skew` -- - - :func:`lrskew` -- - - :func:`mult_schubert` - --.. rubric:: Underlying algorithmic in lrcalc -+.. RUBRIC:: Underlying algorithmic in lrcalc - - Here is some additional information regarding the main low-level - C-functions in `lrcalc`. Given two partitions ``outer`` and ``inner`` -@@ -187,180 +185,24 @@ AUTHORS: - # https://www.gnu.org/licenses/ - # **************************************************************************** - --from sage.rings.integer cimport Integer --from sage.structure.parent cimport Parent - from sage.combinat.partition import _Partitions - from sage.combinat.permutation import Permutation --from sage.combinat.skew_tableau import SkewTableau -- -- --cdef vector* iterable_to_vector(it): -- """ -- Return an lrcalc vector (which is a list of integers) from a Python iterable. -- -- TESTS:: -- -- sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector -- sage: x = test_iterable_to_vector(Partition([3,2,1])); x #indirect doctest -- [3, 2, 1] -- """ -- cdef vector* v -- cdef list itr = list(it) -- cdef int n = len(itr) -- cdef int i -- v = v_new(n) -- for i in range(n): -- v.array[i] = int(itr[i]) -- return v -- -- --cdef list vector_to_list(vector *v): -- """ -- Converts a lrcalc vector to Python list. -- -- TESTS:: -- -- sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector -- sage: x = test_iterable_to_vector([]); x #indirect doctest -- [] -- """ -- cdef int i, n -- n = v_length(v) -- cdef list result = [None]*n -- for i in range(n): -- result[i] = Integer(v_elem(v, i)) -- return result -- -- --def test_iterable_to_vector(it): -- """ -- A wrapper function for the cdef function ``iterable_to_vector`` -- and ``vector_to_list``, to test that they are working correctly. -+from sage.combinat.skew_tableau import SemistandardSkewTableaux -+from sage.combinat.skew_partition import SkewPartition -+from sage.rings.integer import Integer -+import lrcalc - -- EXAMPLES:: -- -- sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector -- sage: x = test_iterable_to_vector([3,2,1]); x -- [3, 2, 1] -- """ -- cdef vector *v = iterable_to_vector(it) -- result = vector_to_list(v) -- v_free(v) -- return result -- -- --cdef skewtab_to_SkewTableau(skewtab *st): -- """ -- A wrapper function which transforms the data set ``st`` used in -- ``lrcalc`` to a ``SkewTableau`` in Sage. -+def _lrcalc_dict_to_sage(result): -+ r""" -+ Translate from lrcalc output format to Sage expected format. - - TESTS:: - -- sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau -- sage: test_skewtab_to_SkewTableau([],[]) -- [] -- """ -- inner = vector_to_list(st.inner) -- outer = vector_to_list(st.outer) -- return SkewTableau(expr=[[inner[y] for y in range(len(outer))], -- [[st.matrix[x + y * st.cols] + 1 -- for x in range(inner[y], outer[y])] -- for y in range(len(outer) - 1, -1, -1)]]) -- -- --def test_skewtab_to_SkewTableau(outer, inner): -- """ -- A wrapper function for the cdef function ``skewtab_to_SkewTableau`` -- for testing purposes. -- -- It constructs the first LR skew tableau of shape ``outer/inner`` -- as an ``lrcalc`` ``skewtab``, and converts it to a -- :class:`SkewTableau`. -- -- EXAMPLES:: -- -- sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau -- sage: test_skewtab_to_SkewTableau([3,2,1],[]) -- [[1, 1, 1], [2, 2], [3]] -- sage: test_skewtab_to_SkewTableau([4,3,2,1],[1,1]).pp() -- . 1 1 1 -- . 2 2 -- 1 3 -- 2 -- """ -- cdef vector* o = iterable_to_vector(outer) -- cdef vector* i = iterable_to_vector(inner+[0]*(len(outer)-len(inner))) -- cdef skewtab* st = st_new(o, i, NULL, 0) -- return skewtab_to_SkewTableau(st) -- -- --cdef dict sf_hashtab_to_dict(hashtab *ht): -- """ -- Return a dictionary representing a Schur function. The keys are -- partitions and the values are integers . -- -- EXAMPLES:: -- - sage: from sage.libs.lrcalc.lrcalc import mult -- sage: sorted(mult([1],[1]).items()) #indirect doctest -- [([1, 1], 1), ([2], 1)] -- sage: assert isinstance(mult([1],[1]),dict)#indirect doctest -- """ -- cdef hash_itr itr -- cdef dict result = {} -- cdef list p -- hash_first(ht, itr) -- while hash_good(itr): -- p = vector_to_list( hash_key(itr)) -- result[_Partitions(p)] = Integer(hash_intvalue(itr)) -- hash_next(itr) -- return result -- -- --cdef dict schubert_hashtab_to_dict(hashtab *ht): -- """ -- Return a dictionary corresponding to a Schubert polynomial whose keys -- are permutations and whose values are integers . -- -- EXAMPLES:: -- -- sage: from sage.libs.lrcalc.lrcalc import mult_schubert -- sage: mult_schubert([3,2,1], [1,2,3]) #indirect doctest -- {[3, 2, 1]: 1} -- """ -- cdef hash_itr itr -- cdef dict result = {} -- hash_first(ht, itr) -- while hash_good(itr): -- p = vector_to_list( hash_key(itr)) -- result[Permutation(p)] = Integer(hash_intvalue(itr)) -- hash_next(itr) -- return result -- -- --cdef dict vp_hashtab_to_dict(hashtab *ht): -- """ -- Return a dictionary corresponding to the coproduct of a Schur function whose keys are -- pairs of partitions and whose values are integers . -- -- EXAMPLES:: -- -- sage: from sage.libs.lrcalc.lrcalc import coprod -- sage: coprod([1]) #indirect doctest -- {([1], []): 1} -+ sage: mult([2,1],[3,2,1],3) # indirect doctest -+ {[3, 3, 3]: 1, [4, 3, 2]: 2, [4, 4, 1]: 1, [5, 2, 2]: 1, [5, 3, 1]: 1} - """ -- cdef hash_itr itr -- cdef vecpair* vp -- cdef dict result = {} -- hash_first(ht, itr) -- while hash_good(itr): -- vp = hash_key(itr) -- p1 = _Partitions(vector_to_list(vp_first(vp))) -- p2 = _Partitions(vector_to_list(vp_second(vp))) -- result[(p1, p2)] = Integer(hash_intvalue(itr)) -- hash_next(itr) -- return result -- -+ return {_Partitions(la): Integer(k) for la, k in result.items()} - - def lrcoef_unsafe(outer, inner1, inner2): - r""" -@@ -371,13 +213,11 @@ def lrcoef_unsafe(outer, inner1, inner2): - - INPUT: - -- - ``outer`` -- a partition (weakly decreasing list of non-negative integers). -- -- - ``inner1`` -- a partition. -+ - ``outer`` -- a partition (weakly decreasing list of non-negative integers) -+ - ``inner1`` -- a partition -+ - ``inner2`` -- a partition - -- - ``inner2`` -- a partition. -- -- .. warning:: -+ .. WARNING:: - - This function does not do any check on its input. If you want - to use a safer version, use :func:`lrcoef`. -@@ -392,18 +232,7 @@ def lrcoef_unsafe(outer, inner1, inner2): - sage: lrcoef_unsafe([2,1,1,1,1], [2,1], [2,1]) - 0 - """ -- cdef long long result -- cdef vector *o -- cdef vector *i1 -- cdef vector *i2 -- o = iterable_to_vector(outer) -- i1 = iterable_to_vector(inner1) -- i2 = iterable_to_vector(inner2) -- result = lrcoef_c(o, i1, i2) -- v_free(o) -- v_free(i1) -- v_free(i2) -- return Integer(result) -+ return Integer(lrcalc.lrcoef(outer, inner1, inner2)) - - - def lrcoef(outer, inner1, inner2): -@@ -415,11 +244,9 @@ def lrcoef(outer, inner1, inner2): - - INPUT: - -- - ``outer`` -- a partition (weakly decreasing list of non-negative integers). -- -- - ``inner1`` -- a partition. -- -- - ``inner2`` -- a partition. -+ - ``outer`` -- a partition (weakly decreasing list of non-negative integers) -+ - ``inner1`` -- a partition -+ - ``inner2`` -- a partition - - .. NOTE:: - -@@ -436,7 +263,6 @@ def lrcoef(outer, inner1, inner2): - 1 - sage: lrcoef([2,1,1,1,1], [2,1], [2,1]) - 0 -- - """ - return lrcoef_unsafe(_Partitions(outer), _Partitions(inner1), _Partitions(inner2)) - -@@ -451,13 +277,9 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None): - INPUT: - - - ``part1`` -- a partition -- - - ``part2`` -- a partition -- - - ``maxrows`` -- (optional) an integer -- - - ``level`` -- (optional) an integer -- - - ``quantum`` -- (optional) an element of a ring - - If ``maxrows`` is specified, then only partitions with at most -@@ -479,7 +301,8 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None): - sage: sorted(mult([2],[2]).items()) - [([2, 2], 1), ([3, 1], 1), ([4], 1)] - sage: sorted(mult([2,1],[2,1]).items()) -- [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1), ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)] -+ [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1), -+ ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)] - sage: sorted(mult([2,1],[2,1],maxrows=2).items()) - [([3, 3], 1), ([4, 2], 1)] - sage: mult([2,1],[3,2,1],3) -@@ -510,44 +333,24 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None): - if quantum is not None and (level is None or maxrows is None): - raise ValueError('missing parameters maxrows or level') - -- cdef vector* v1 = iterable_to_vector(part1) -- cdef vector* v2 = iterable_to_vector(part2) -- if maxrows is None: -- maxrows = 0 -- cdef hashtab* ht = mult_c(v1, v2, int(maxrows)) -- cdef hashtab* tab -- cdef dict result -- - if quantum is None: - if level is not None: -- fusion_reduce_c(ht, int(maxrows), int(level), int(0)) -- result = sf_hashtab_to_dict(ht) -- v_free(v1) -- v_free(v2) -- hash_free(ht) -- return result -+ return _lrcalc_dict_to_sage(lrcalc.mult_fusion(part1, part2, maxrows, level)) -+ if maxrows is None: -+ maxrows = -1 -+ return _lrcalc_dict_to_sage(lrcalc.mult(part1, part2, maxrows)) - - # Otherwise do quantum multiplication -- cdef _list *qlist -- cdef dict temp -- qlist = quantum_reduce_c(ht, int(maxrows), int(level)) -- # The above call frees the memory associated with ht -- v_free(v1) -- v_free(v2) -- -- cdef Parent P = quantum.parent() -- result = {} -- for i in range(qlist.length): -- tab = (qlist.array[i]) -- temp = sf_hashtab_to_dict(tab) -- for k in temp: -- result[k] = result.get(k, P.zero()) + quantum**i * temp[k] -- hash_free(tab) -- l_free(qlist) -- return result -- -- --def skew(outer, inner, maxrows=0): -+ result = lrcalc.mult_quantum(part1, part2, maxrows, level, degrees=True) -+ P = quantum.parent() -+ output = {} -+ for i,k in result.items(): -+ la = _Partitions(i[0]) -+ output[la] = output.get(la, P.zero()) + k * quantum**(i[1]) -+ return output -+ -+ -+def skew(outer, inner, maxrows=-1): - """ - Compute the Schur expansion of a skew Schur function. - -@@ -557,11 +360,9 @@ def skew(outer, inner, maxrows=0): - - INPUT: - -- - ``outer`` -- a partition. -- -- - ``inner`` -- a partition. -- -- - ``maxrows`` -- an integer or ``None``. -+ - ``outer`` -- a partition -+ - ``inner`` -- a partition -+ - ``maxrows`` -- an integer or ``None`` - - If ``maxrows`` is specified, then only partitions with at most - this number of rows are included in the result. -@@ -572,14 +373,7 @@ def skew(outer, inner, maxrows=0): - sage: sorted(skew([2,1],[1]).items()) - [([1, 1], 1), ([2], 1)] - """ -- cdef vector* v1 = iterable_to_vector(outer) -- cdef vector* v2 = iterable_to_vector(inner) -- cdef hashtab* ht = skew_c(v1, v2, int(maxrows)) -- result = sf_hashtab_to_dict(ht) -- v_free(v1) -- v_free(v2) -- hash_free(ht) -- return result -+ return _lrcalc_dict_to_sage(lrcalc.skew(outer, inner, maxrows)) - - - def coprod(part, all=0): -@@ -592,9 +386,8 @@ def coprod(part, all=0): - - INPUT: - -- - ``part`` -- a partition. -- -- - ``all`` -- an integer. -+ - ``part`` -- a partition -+ - ``all`` -- an integer - - If ``all`` is non-zero then all terms are included in the result. - If ``all`` is zero, then only pairs of partitions ``(part1, -@@ -609,12 +402,9 @@ def coprod(part, all=0): - sage: sorted(coprod([2,1]).items()) - [(([1, 1], [1]), 1), (([2], [1]), 1), (([2, 1], []), 1)] - """ -- cdef vector* v1 = iterable_to_vector(part) -- cdef hashtab* ht = coprod_c(v1, int(all)) -- result = vp_hashtab_to_dict(ht) -- v_free(v1) -- hash_free(ht) -- return result -+ result = lrcalc.coprod(part, all) -+ return {tuple([_Partitions(mu) for mu in la]): Integer(k) -+ for la, k in result.items()} - - - def mult_schubert(w1, w2, rank=0): -@@ -627,11 +417,9 @@ def mult_schubert(w1, w2, rank=0): - - INPUT: - -- - ``w1`` -- a permutation. -- -- - ``w2`` -- a permutation. -- -- - ``rank`` -- an integer. -+ - ``w1`` -- a permutation -+ - ``w2`` -- a permutation -+ - ``rank`` -- an integer - - If ``rank`` is non-zero, then only permutations from the symmetric - group `S(\mathrm{rank})` are included in the result. -@@ -646,33 +434,24 @@ def mult_schubert(w1, w2, rank=0): - ([6, 4, 3, 1, 2, 5], 1), ([6, 5, 2, 1, 3, 4], 1), - ([7, 3, 4, 1, 2, 5, 6], 1), ([7, 4, 2, 1, 3, 5, 6], 1)] - """ -- cdef vector* v1 = iterable_to_vector(w1) -- cdef vector* v2 = iterable_to_vector(w2) -- cdef hashtab* ht = mult_schubert_c(v1, v2, int(rank)) -- result = schubert_hashtab_to_dict(ht) -- v_free(v1) -- v_free(v2) -- hash_free(ht) -- return result -+ result = lrcalc.schubmult(w1, w2, rank) -+ return {Permutation(list(la)):Integer(k) for la,k in result.items()} - - --def lrskew(outer, inner, weight=None, maxrows=0): -+def lrskew(outer, inner, weight=None, maxrows=-1): - r""" - Iterate over the skew LR tableaux of shape ``outer / inner``. - - INPUT: - - - ``outer`` -- a partition -- - - ``inner`` -- a partition -- - - ``weight`` -- a partition (optional) -- -- - ``maxrows`` -- an integer (optional) -+ - ``maxrows`` -- a positive integer (optional) - - OUTPUT: an iterator of :class:`SkewTableau` - -- Specifying ``maxrows`` restricts the alphabet to `\{1,2,\ldots,maxrows\}`. -+ Specifying ``maxrows`` = `M` restricts the alphabet to `\{1,2,\ldots,M\}`. - - Specifying ``weight`` returns only those tableaux of given content/weight. - -@@ -702,22 +481,40 @@ def lrskew(outer, inner, weight=None, maxrows=0): - - sage: list(lrskew([3,2,1],[2], weight=[3,1])) - [[[None, None, 1], [1, 1], [2]]] -+ -+ TESTS:: -+ -+ sage: from sage.libs.lrcalc.lrcalc import lrskew -+ sage: list(lrskew([3,2,1],[2], weight=[])) -+ [] -+ sage: list(lrskew([3,2,1],[2], weight=[0])) -+ [] -+ sage: list(lrskew([3,2,1],[3,2,1], weight=[])) -+ [[[None, None, None], [None, None], [None]]] -+ sage: list(lrskew([3,2,1],[3,2,1], weight=[0])) -+ [[[None, None, None], [None, None], [None]]] -+ sage: list(lrskew([3,2,1],[3,2,1], weight=[1])) -+ [] - """ -- cdef vector* o = iterable_to_vector(outer) -- cdef vector* i = iterable_to_vector(inner + [0]*(len(outer) - len(inner))) -- cdef skewtab* st = st_new(o, i, NULL, int(maxrows)) -+ iterator = lrcalc.lr_iterator(outer, inner, maxrows) -+ shape = SkewPartition([outer, inner]) - - if weight is None: -- yield skewtab_to_SkewTableau(st) -- while st_next(st): -- yield skewtab_to_SkewTableau(st) -+ ST = SemistandardSkewTableaux(shape) -+ for data in iterator: -+ yield ST.from_shape_and_word(shape, [i+1 for i in data]) - else: - wt = _Partitions(weight) -- r = skewtab_to_SkewTableau(st) -- if r.weight() == wt: -- yield r -- while st_next(st): -- r = skewtab_to_SkewTableau(st) -- if r.weight() == wt: -- yield r -- st_free(st) -+ ST = SemistandardSkewTableaux(shape, wt) -+ m = len(wt) -+ for data in iterator: -+ w = [0] * m -+ for j in data: -+ if j >= m: -+ # We know they are not equal, so make the check below quick -+ w = None -+ break -+ w[j] += 1 -+ if w == wt: -+ yield ST.from_shape_and_word(shape, [i+1 for i in data]) -+ diff --git a/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch b/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch deleted file mode 100644 index 1e2e0ba90742..000000000000 --- a/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch +++ /dev/null @@ -1,40 +0,0 @@ -As produced by `git diff a90a3146{^^,}` - -diff --git a/src/sage/repl/interface_magic.py b/src/sage/repl/interface_magic.py -index 8a455b69b0e..a93e1c9e04c 100644 ---- a/src/sage/repl/interface_magic.py -+++ b/src/sage/repl/interface_magic.py -@@ -260,7 +260,7 @@ class InterfaceMagic(object): - 2 - 120 - sage: shell.run_cell('%%gap foo\n1+1;\n') -- ...File "", line unknown -+ ...File...... - SyntaxError: Interface magics have no options, got "foo" - - sage: shell.run_cell('%%gap?') -diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py -index 7468afe52d7..06c47b7374a 100644 ---- a/src/sage/repl/interpreter.py -+++ b/src/sage/repl/interpreter.py -@@ -78,9 +78,9 @@ Check that Cython source code appears in tracebacks:: - dummy line - ... - ZeroDivisionError...Traceback (most recent call last) -- in ... -+ ...in ... - ----> 1 Integer(1)/Integer(0) -- .../sage/rings/integer.pyx in sage.rings.integer.Integer...div... -+ .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div... - ... - -> ... raise ZeroDivisionError("rational division by zero") - ....: x = Rational.__new__(Rational) -@@ -423,7 +423,7 @@ def SagePreparseTransformer(lines): - sage: from sage.repl.interpreter import get_test_shell - sage: shell = get_test_shell() - sage: shell.run_cell(bad_syntax) -- File "", line unknown -+ File...... - SyntaxError: Mismatched ']' - - sage: shell.quit() diff --git a/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch b/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch deleted file mode 100644 index 853813b0f5bd..000000000000 --- a/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch +++ /dev/null @@ -1,13 +0,0 @@ -Fix for ipython 8.1 - ---- a/src/sage/repl/interpreter.py -+++ b/src/sage/repl/interpreter.py -@@ -78,7 +78,7 @@ Check that Cython source code appears in tracebacks:: - dummy line - ... - ZeroDivisionError...Traceback (most recent call last) -- ...in ... -+ ... - ----> 1 Integer(1)/Integer(0) - .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div... - ... diff --git a/srcpkgs/sagemath/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch b/srcpkgs/sagemath/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch deleted file mode 100644 index b861af7ec982..000000000000 --- a/srcpkgs/sagemath/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 24cc94b1988a90f3bd22a2368ec30c086283af13 Mon Sep 17 00:00:00 2001 -From: Antonio Rojas -Date: Sun, 16 Jan 2022 11:55:04 +0100 -Subject: Add abs tol to some arb tests - ---- - src/sage/functions/error.py | 2 +- - src/sage/rings/complex_arb.pyx | 6 +++--- - src/sage/rings/real_arb.pyx | 10 +++++----- - 3 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/sage/functions/error.py b/src/sage/functions/error.py -index f48d04f..06f0b24 100644 ---- a/src/sage/functions/error.py -+++ b/src/sage/functions/error.py -@@ -267,7 +267,7 @@ class Function_erf(BuiltinFunction): - - Check that real ball evaluation is fixed :trac:`28061`:: - -- sage: RealBallField(128)(erf(5)) -+ sage: RealBallField(128)(erf(5)) # abs tol 1e-38 - [0.99999999999846254020557196514981165651 +/- 7.33e-39] - """ - R = parent or s_parent(x) -diff --git a/src/sage/rings/complex_arb.pyx b/src/sage/rings/complex_arb.pyx -index f986970..93ff565 100644 ---- a/src/sage/rings/complex_arb.pyx -+++ b/src/sage/rings/complex_arb.pyx -@@ -3974,8 +3974,8 @@ cdef class ComplexBall(RingElement): - - EXAMPLES:: - -- sage: CBF(20).erfc() -- [5.39586561160790e-176 +/- ...e-191] -+ sage: CBF(20).erfc() # abs tol 1e-190 -+ [5.39586561160790e-176 +/- 6.73e-191] - sage: CBF(100, 100).erfc() - [0.00065234366376858 +/- ...e-18] + [-0.00393572636292141 +/- ...e-18]*I - """ -@@ -4280,7 +4280,7 @@ cdef class ComplexBall(RingElement): - - TESTS: - -- sage: CBF(Shi(I)) -+ sage: CBF(Shi(I)) # abs tol 1e-15 - [0.946083070367183 +/- 9.22e-16]*I - """ - cdef ComplexBall result = self._new() -diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx -index 4a81784..292bfea 100644 ---- a/src/sage/rings/real_arb.pyx -+++ b/src/sage/rings/real_arb.pyx -@@ -3506,7 +3506,7 @@ cdef class RealBall(RingElement): - - EXAMPLES:: - -- sage: RBF(1/2).erf() -+ sage: RBF(1/2).erf() # abs tol 1e-16 - [0.520499877813047 +/- 6.10e-16] - """ - cdef RealBall res = self._new() -@@ -3556,12 +3556,12 @@ cdef class RealBall(RingElement): - - EXAMPLES:: - -- sage: RBF(1).Si() -+ sage: RBF(1).Si() # abs tol 1e-15 - [0.946083070367183 +/- 9.22e-16] - - TESTS:: - -- sage: RBF(Si(1)) -+ sage: RBF(Si(1)) # abs tol 1e-15 - [0.946083070367183 +/- 9.22e-16] - """ - cdef RealBall res = self._new() -@@ -3578,12 +3578,12 @@ cdef class RealBall(RingElement): - - EXAMPLES:: - -- sage: RBF(1).Ci() # abs tol 1e-16 -+ sage: RBF(1).Ci() # abs tol 1e-15 - [0.337403922900968 +/- 3.25e-16] - - TESTS:: - -- sage: RBF(Ci(1)) # abs tol 1e-16 -+ sage: RBF(Ci(1)) # abs tol 1e-15 - [0.337403922900968 +/- 3.25e-16] - """ - cdef RealBall res = self._new() --- -cgit v1.0-1-gd88e - - -From 53532ddd4e2dc92469c1590ebf0c40f8f69bf579 Mon Sep 17 00:00:00 2001 -From: Antonio Rojas -Date: Sun, 16 Jan 2022 14:16:53 +0100 -Subject: Decrease abs tol - ---- - src/sage/rings/real_arb.pyx | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx -index 292bfea..eb30f7f 100644 ---- a/src/sage/rings/real_arb.pyx -+++ b/src/sage/rings/real_arb.pyx -@@ -3578,12 +3578,12 @@ cdef class RealBall(RingElement): - - EXAMPLES:: - -- sage: RBF(1).Ci() # abs tol 1e-15 -+ sage: RBF(1).Ci() # abs tol 5e-16 - [0.337403922900968 +/- 3.25e-16] - - TESTS:: - -- sage: RBF(Ci(1)) # abs tol 1e-15 -+ sage: RBF(Ci(1)) # abs tol 5e-16 - [0.337403922900968 +/- 3.25e-16] - """ - cdef RealBall res = self._new() --- -cgit v1.0-1-gd88e - diff --git a/srcpkgs/sagemath/patches/trac-33226-fix_doctests_giac-1.7.0-33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch b/srcpkgs/sagemath/patches/trac-33226-fix_doctests_giac-1.7.0-33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch deleted file mode 100644 index d4e8f8be60e3..000000000000 --- a/srcpkgs/sagemath/patches/trac-33226-fix_doctests_giac-1.7.0-33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c Mon Sep 17 00:00:00 2001 -From: Michael Orlitzky -Date: Mon, 24 Jan 2022 09:03:29 -0500 -Subject: Trac #33226: update doctests for giac-1.7.0.45. - -We have two failing doctests with giac-1.7.0.45: one is a trivial -tolerance issue, but the other is a symbolic integration result for -which giac is no longer willing to return a symbolic answer. We add -"abs tol" to the numeric test, and drop the symbolic one entirely. ---- - src/sage/functions/min_max.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/sage/functions/min_max.py b/src/sage/functions/min_max.py -index fc18373..9b7d6d9 100644 ---- a/src/sage/functions/min_max.py -+++ b/src/sage/functions/min_max.py -@@ -228,15 +228,15 @@ class MaxSymbolic(MinMax_base): - ... - TypeError: cannot evaluate symbolic expression numerically - -- :: -+ We can usually integrate these expressions, but can't -+ guarantee a symbolic answer in closed form:: - - sage: f = max_symbolic(sin(x), cos(x)) - sage: r = integral(f, x, 0, 1) - ... -- sage: r -- sqrt(2) - cos(1) -- sage: r.n() -+ sage: r.n() # abs tol 1e-8 - 0.873911256504955 -+ - """ - return max_symbolic(args) - --- -cgit v1.0-1-gd88e - diff --git a/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch b/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch deleted file mode 100644 index 19b69700a4f6..000000000000 --- a/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 9c8235e44ffb509efa8a3ca6cdb55154e2b5066d -Author: Antonio Rojas -Date: Sun Feb 13 19:53:14 2022 +0100 - - Fix deprecation warning with scipy 1.8 - -diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py -index e9b60dae5ec..7932167b41d 100644 ---- a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py -+++ b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py -@@ -356,7 +356,7 @@ Sage example in ./linsolve.tex, line 2230:: - - Sage example in ./linsolve.tex, line 2609:: - -- sage: from scipy.sparse.linalg.dsolve import * -+ sage: from scipy.sparse.linalg import factorized - sage: from scipy.sparse import lil_matrix - sage: from numpy import array - sage: n = 200 diff --git a/srcpkgs/sagemath/patches/trac-33360-avoid_factoring_in_is_prime-6330cee1a69229b2f5d8ac4a09a73d8152f5e14d.patch b/srcpkgs/sagemath/patches/trac-33360-avoid_factoring_in_is_prime-6330cee1a69229b2f5d8ac4a09a73d8152f5e14d.patch new file mode 100644 index 000000000000..e052e306e7a1 --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-33360-avoid_factoring_in_is_prime-6330cee1a69229b2f5d8ac4a09a73d8152f5e14d.patch @@ -0,0 +1,53 @@ +From 6330cee1a69229b2f5d8ac4a09a73d8152f5e14d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= +Date: Mon, 28 Feb 2022 23:15:16 -0300 +Subject: trac 33360: avoid factoring in is_prime() + +In the added TEST, the ideal norm is product of two primes but factoring +this product takes about half an hour, so factoring the ideal is slow. + +To fix the issue, we only factor the ideal if the norm is a prime power. +--- + src/sage/rings/number_field/number_field_ideal.py | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py +index f785f22..10d1f88 100644 +--- a/src/sage/rings/number_field/number_field_ideal.py ++++ b/src/sage/rings/number_field/number_field_ideal.py +@@ -995,10 +995,32 @@ class NumberFieldIdeal(Ideal_generic): + False + sage: K.ideal(17).is_prime() # ramified + False ++ ++ TESTS:: ++ ++ Check that we do not factor the norm of the ideal, this used ++ to take half an hour, see :trac:`33360` ++ ++ sage: K. = NumberField([x^2-2,x^2-3,x^2-5]) ++ sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c ++ ....: + 10130950)*a + (1343014/7653*c - 8349770)*b ++ ....: + 6477058*c - 2801449990/4002519) ++ sage: t.is_prime() ++ False ++ + """ + try: + return self._pari_prime is not None + except AttributeError: ++ K = self.number_field().pari_nf() ++ I = self.pari_hnf() ++ # This would be better, but it is broken in pari 2.13.3. ++ # self._pari_prime = K.idealismaximal(I) or None ++ # Instead we factor I, but only if the norm is a prime power ++ n = K.idealnorm(I) ++ if n.denominator() > 1 or not n.isprimepower(): ++ self._pari_prime = None ++ return False + F = self.factor() # factorization with caching + if len(F) != 1 or F[0][1] != 1: + self._pari_prime = None +-- +cgit v1.0-1-gd88e + diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch deleted file mode 100644 index 9ba7ca5a6b7d..000000000000 --- a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 609dd9deaeaa6380ab2f0d50276d911233c00a04 Mon Sep 17 00:00:00 2001 -From: Matthias Koeppe -Date: Fri, 4 Mar 2022 16:07:09 -0800 -Subject: sage.manifolds: Update doctests for SymPy 1.10 - ---- - src/sage/manifolds/continuous_map.py | 3 +-- - src/sage/manifolds/differentiable/diff_form.py | 4 ++-- - src/sage/manifolds/differentiable/tensorfield.py | 8 ++++---- - src/sage/manifolds/vector_bundle_fiber_element.py | 2 +- - 4 files changed, 8 insertions(+), 9 deletions(-) - -diff --git a/src/sage/manifolds/continuous_map.py b/src/sage/manifolds/continuous_map.py -index a6356e7..f6f9b6d 100644 ---- a/src/sage/manifolds/continuous_map.py -+++ b/src/sage/manifolds/continuous_map.py -@@ -1357,8 +1357,7 @@ class ContinuousMap(Morphism): - sage: Phi.coord_functions(c_uv, c_xyz) - Coordinate functions (u*v, u/v, u + v) on the Chart (M, (u, v)) - sage: Phi.coord_functions(c_UV, c_xyz) -- Coordinate functions (-U**2/4 + V**2/4, -(U + V)/(U - V), V) -- on the Chart (M, (U, V)) -+ Coordinate functions (-U**2/4 + V**2/4, (-U - V)/(U - V), V) on the Chart (M, (U, V)) - sage: Phi.coord_functions(c_UV, c_XYZ) - Coordinate functions ((-U**3 + U**2*V + U*V**2 + 2*U*V + 6*U - V**3 - - 2*V**2 + 6*V)/(2*(U - V)), (U**3/4 - U**2*V/4 - U*V**2/4 + U*V -diff --git a/src/sage/manifolds/differentiable/diff_form.py b/src/sage/manifolds/differentiable/diff_form.py -index 70dd8fb..0aa3469 100644 ---- a/src/sage/manifolds/differentiable/diff_form.py -+++ b/src/sage/manifolds/differentiable/diff_form.py -@@ -266,7 +266,7 @@ class DiffForm(TensorField): - - sage: s = a.wedge(b) - sage: s.display(eU) -- a∧b = -x*(2*x*y + 1) dx∧dy -+ a∧b = x*(-2*x*y - 1) dx∧dy - sage: s.display(eV) - a∧b = (u**3/8 + u**2*v/8 - u*v**2/8 + u/4 - v**3/8 + v/4) du∧dv - -@@ -275,7 +275,7 @@ class DiffForm(TensorField): - sage: f = M.scalar_field({c_xy: (x+y)^2, c_uv: u^2}, name='f') - sage: s = f*a - sage: s.display(eU) -- f*a = -y*(x**2 + 2*x*y + y**2) dx + x*(x**2 + 2*x*y + y**2) dy -+ f*a = y*(-x**2 - 2*x*y - y**2) dx + x*(x**2 + 2*x*y + y**2) dy - sage: s.display(eV) - f*a = u**2*v/2 du - u**3/2 dv - -diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py -index 2775be9..6bc5c50 100644 ---- a/src/sage/manifolds/differentiable/tensorfield.py -+++ b/src/sage/manifolds/differentiable/tensorfield.py -@@ -334,7 +334,7 @@ class TensorField(ModuleElementWithMutability): - sage: f.display() # long time - t(a,b): S^2 → ℝ - on U: (x, y) ↦ -2*x*y - 3*x - y**2 -- on V: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4) -+ on V: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4) - - The vectors can be defined only on subsets of `S^2`, the domain of the - result is then the common subset:: -@@ -343,12 +343,12 @@ class TensorField(ModuleElementWithMutability): - sage: s.display() # long time - t(a,b): U → ℝ - (x, y) ↦ -2*x*y - 3*x - y**2 -- on W: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4) -+ on W: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4) - sage: s = t(a.restrict(U), b.restrict(W)) # long time - sage: s.display() # long time - t(a,b): W → ℝ - (x, y) ↦ -2*x*y - 3*x - y**2 -- (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4) -+ (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4) - - The tensor itself can be defined only on some open subset of `S^2`, - yielding a result whose domain is this subset:: -@@ -356,7 +356,7 @@ class TensorField(ModuleElementWithMutability): - sage: s = t.restrict(V)(a,b) # long time - sage: s.display() # long time - t(a,b): V → ℝ -- (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4) -+ (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4) - on W: (x, y) ↦ -2*x*y - 3*x - y**2 - - Tests regarding the multiplication by a scalar field:: -diff --git a/src/sage/manifolds/vector_bundle_fiber_element.py b/src/sage/manifolds/vector_bundle_fiber_element.py -index 29ee81d..048275a 100644 ---- a/src/sage/manifolds/vector_bundle_fiber_element.py -+++ b/src/sage/manifolds/vector_bundle_fiber_element.py -@@ -110,4 +110,4 @@ class VectorBundleFiberElement(FiniteRankFreeModuleElement): - desc += str(self._name) + " " - desc += "in the fiber of {} at {}".format(self._vbundle._name, - self._point) -- return desc -\ No newline at end of file -+ return desc --- -cgit v1.0-1-gd88e - diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch deleted file mode 100644 index f5ac180baa90..000000000000 --- a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c49eff347454ac7f07e5918470b20e97b8f2357e Mon Sep 17 00:00:00 2001 -From: Matthias Koeppe -Date: Fri, 4 Mar 2022 15:14:43 -0800 -Subject: src/sage/calculus/calculus.py: Update laplace doctest for sympy 1.10 - ---- - src/sage/calculus/calculus.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py -index 9c2f226..b335093 100644 ---- a/src/sage/calculus/calculus.py -+++ b/src/sage/calculus/calculus.py -@@ -1639,9 +1639,9 @@ def laplace(ex, t, s, algorithm='maxima'): - sage: laplace(dirac_delta(t), t, s) - 1 - sage: F, a, cond = laplace(dirac_delta(t), t, s, algorithm='sympy') -- sage: a, cond -- (-oo, True) -- sage: F # random - sympy <1.9 includes undefined heaviside(0) in answer -+ sage: a, cond # random - sympy <1.10 gives (-oo, True) -+ (0, True) -+ sage: F # random - sympy <1.9 includes undefined heaviside(0) in answer - 1 - sage: laplace(dirac_delta(t), t, s, algorithm='giac') - 1 --- -cgit v1.0-1-gd88e - diff --git a/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch b/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch deleted file mode 100644 index 8e7bb64f5b01..000000000000 --- a/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch +++ /dev/null @@ -1,26 +0,0 @@ -From a04a0a0b14f67f4804e7113c3db41bbcf8a58296 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= -Date: Mon, 28 Mar 2022 20:39:59 -0300 -Subject: Trac #33585: fix doctest when dochtml is missing... - -...but sphinx is available in PYTHONPATH. ---- - src/sage/misc/sagedoc.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py -index 4b3853f..08c4225 100644 ---- a/src/sage/misc/sagedoc.py -+++ b/src/sage/misc/sagedoc.py -@@ -1401,7 +1401,7 @@ class _sage_doc: - "...**File:**...**Type:**...**Definition:** identity_matrix..." - sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst') - True -- sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx -+ sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx sagemath_doc_html - '...div...File:...Type:...Definition:...identity_matrix...' - - In the 'text' version, double colons have been replaced with --- -cgit v1.0-1-gd88e - diff --git a/srcpkgs/sagemath/patches/trac-34118-update_sympy_to_1.11.1-5db5d4e56243c609f44afc1f21c112b026f9e1fe.patch b/srcpkgs/sagemath/patches/trac-34118-update_sympy_to_1.11.1-5db5d4e56243c609f44afc1f21c112b026f9e1fe.patch new file mode 100644 index 000000000000..977a42400e59 --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-34118-update_sympy_to_1.11.1-5db5d4e56243c609f44afc1f21c112b026f9e1fe.patch @@ -0,0 +1,42 @@ +commit 5db5d4e56243c609f44afc1f21c112b026f9e1fe +Author: Oscar Benjamin +Date: Mon Jul 11 21:24:01 2022 +0100 + + Update doctests for SymPy 1.11 + + Doctests related to SymPy's rsolve function are updated in: + + src/sage/calculus/test_sympy.py + src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py + + The form of the output from SymPy has changed since + + https://github.com/sympy/sympy/pull/23567 + +diff --git a/src/sage/calculus/test_sympy.py b/src/sage/calculus/test_sympy.py +index 7cf7f3f6bfd..927e6ee4fb6 100644 +--- a/src/sage/calculus/test_sympy.py ++++ b/src/sage/calculus/test_sympy.py +@@ -193,7 +193,7 @@ This was fixed in Sympy, see :trac:`14437`:: + sage: u = Function('u') + sage: n = Symbol('n', integer=True) + sage: f = u(n+2) - u(n+1) + u(n)/4 +- sage: 2**n * rsolve(f,u(n)) +- C1*n + C0 ++ sage: expand(2**n * rsolve(f,u(n))) ++ 2*C1*n + C0 + + """ +diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py +index 1062f4f7e8c..f53f813d793 100644 +--- a/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py ++++ b/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py +@@ -382,7 +382,7 @@ Sage example in ./recequadiff.tex, line 1798:: + sage: from sympy import rsolve_hyper + sage: from sympy.abc import n + sage: rsolve_hyper([-2,1],2**(n+2),n) +- 2**n*C0 + 2**(n + 2)*(C0 + n/2) ++ 2**n*C0 + 2**(n + 1)*n + + """ + diff --git a/srcpkgs/sagemath/patches/trac-34465-fix_invalid_escape_sequence-04971318f032caf8dc1c0de9489346d894409091.patch b/srcpkgs/sagemath/patches/trac-34465-fix_invalid_escape_sequence-04971318f032caf8dc1c0de9489346d894409091.patch new file mode 100644 index 000000000000..8fedcb78cf71 --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-34465-fix_invalid_escape_sequence-04971318f032caf8dc1c0de9489346d894409091.patch @@ -0,0 +1,19 @@ +commit 04971318f032caf8dc1c0de9489346d894409091 +Author: John H. Palmieri +Date: Wed Aug 31 14:22:26 2022 -0700 + + trac 34465: fix invalid escape sequence in functions/special.py + +diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py +index 02596e49620..901f02f9bee 100644 +--- a/src/sage/functions/special.py ++++ b/src/sage/functions/special.py +@@ -849,7 +849,7 @@ class EllipticF(BuiltinFunction): + - :wikipedia:`Elliptic_integral#Incomplete_elliptic_integral_of_the_first_kind` + """ + def __init__(self): +- """ ++ r""" + EXAMPLES:: + + sage: loads(dumps(elliptic_f)) diff --git a/srcpkgs/sagemath/patches/zzz-loadable_module_extension.patch b/srcpkgs/sagemath/patches/zzz-loadable_module_extension.patch deleted file mode 100644 index f3eb0aad2cca..000000000000 --- a/srcpkgs/sagemath/patches/zzz-loadable_module_extension.patch +++ /dev/null @@ -1,14 +0,0 @@ - - this is not a proper fix... should fix sage_getfile() instead - ---- a/src/sage/misc/sageinspect.py -+++ b/src/sage/misc/sageinspect.py -@@ -187,7 +187,8 @@ def loadable_module_extension(): - True - """ - # Return the full platform-specific extension module suffix -- return import_machinery.EXTENSION_SUFFIXES[0] -+ # PATCHED for void linux, we use the shortest extension (.so) -+ return import_machinery.EXTENSION_SUFFIXES[-1] - - - def isclassinstance(obj): diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 0d793262d572..8df50e4e13b6 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,7 +1,7 @@ # Template file for 'sagemath' pkgname=sagemath -version=9.5 -revision=2 +version=9.7 +revision=1 wrksrc=sage-$version build_wrksrc=pkgs/sagemath-standard build_style=python3-module @@ -33,12 +33,9 @@ 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=8d70a3b26080802c5b2e33dda4c23795d494d8216a0c2ecfcd608ebab0e64ff6 +checksum=9f26f14aa322e3cf38a71835b12ac34b23026b467f74d54b064c5d025e76fbfd post_patch() { - # these are unused and nothing else uses ratpoints - rm sage/libs/ratpoints.{pyx,pxd} - # git tree needs bootstrapping pushd $wrksrc/build/pkgs/sagelib PATH=../../bin:$PATH BOOTSTRAP_QUIET=no ./bootstrap @@ -65,6 +62,7 @@ do_configure() { pre_build() { export PYTHONPATH=../sage-setup + export PYTHONDONTWRITEBYTECODE=yes export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" } @@ -77,6 +75,7 @@ post_build() { pre_install() { export PYTHONPATH=../sage-setup + export PYTHONDONTWRITEBYTECODE=yes export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" } @@ -104,6 +103,7 @@ post_install() { do_check() { _scripts=$(cd build/scripts* && pwd) export PYTHONPATH=$(cd build/lib* && pwd) + export PYTHONDONTWRITEBYTECODE=yes # get out of $build_wrksrc, otherwise python picks the wrong sage module cd $(mktemp -dp build)