From 0ff739083a982e73a3aeb2a1fe5496835adbeccc Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sun, 19 Jan 2020 12:05:04 +0100 Subject: [PATCH 01/34] 25993: upgrade to singular 4.1.2p1 This incorporates parts of the arch patch for singular 4.1.2p2 from https://aur.archlinux.org/cgit/aur.git/tree/sagemath-singular-4.1.2.patch?h=sagemath-git In particular, Groebner bases over ZZ now give different results (using Macaulay2, the new results have been independently confirmed to still generate the same ideal as before). --- build/pkgs/singular/checksums.ini | 6 +- build/pkgs/singular/package-version.txt | 2 +- .../patches/singular-ntl-error-handler.patch | 75 ------------------- .../en/constructions/algebraic_geometry.rst | 2 +- .../free_algebra_element_letterplace.pyx | 15 ++-- .../letterplace/free_algebra_letterplace.pyx | 3 +- .../letterplace/letterplace_ideal.pyx | 5 +- src/sage/libs/singular/function.pyx | 8 +- .../polynomial/multi_polynomial_ideal.py | 8 +- .../multi_polynomial_libsingular.pyx | 9 +++ 10 files changed, 34 insertions(+), 99 deletions(-) delete mode 100644 build/pkgs/singular/patches/singular-ntl-error-handler.patch diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index 55751d34293..7096c45e783 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,4 +1,4 @@ tarball=singular-VERSION.tar.gz -sha1=5c6b6c3d2b5ebaca164967eec67e59ebb4e6142f -md5=cb50d64ab1b2b49a0c3f519e5c87639e -cksum=4294037094 +sha1=f680f2dd63013f9178b2321f4f86ad5835cbfbfa +md5=14a2966b652bcb020364c6824cd0de6d +cksum=3018464869 diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index dc3219d462a..639086f8fff 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.1.1p2.p0 +4.1.2p1.p0 diff --git a/build/pkgs/singular/patches/singular-ntl-error-handler.patch b/build/pkgs/singular/patches/singular-ntl-error-handler.patch deleted file mode 100644 index 3d495293239..00000000000 --- a/build/pkgs/singular/patches/singular-ntl-error-handler.patch +++ /dev/null @@ -1,75 +0,0 @@ -Move NTL error handler out of libsingular, otherwise it takes over Sage's error handler and makes it quit on NTL errors. -See https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2769 and https://trac.sagemath.org/ticket/24735#comment:29 -Rebased from upstream commit https://github.com/Singular/Sources/commit/502cf86d0bb2a96715be6764774b64a69c1ca34c - -From 502cf86d0bb2a96715be6764774b64a69c1ca34c Mon Sep 17 00:00:00 2001 -From: Hans Schoenemann -Date: Wed, 25 Jul 2018 11:03:32 +0200 -Subject: [PATCH] move error handler for factory,NTL to the non-libSingular part - -(see forum: "NTL error handling", for SAGE) - -diff --git a/Singular/cntrlc.cc b/Singular/cntrlc.cc -index 622495490c..874a5deb79 100644 ---- a/Singular/cntrlc.cc -+++ b/Singular/cntrlc.cc -@@ -20,6 +20,14 @@ - #include "Singular/links/silink.h" - #include "Singular/links/ssiLink.h" - -+#ifdef HAVE_NTL -+#include -+#include -+#ifdef NTL_CLIENT -+NTL_CLIENT -+#endif -+#endif -+ - /* undef, if you don't want GDB to come up on error */ - - #define CALL_GDB -@@ -549,11 +557,20 @@ static void stack_trace (char *const*args) - - # endif /* !__OPTIMIZE__ */ - --/*2 --* init signal handlers --*/ -+/// init signal handlers and error handling for libraries: NTL, factory - void init_signals() - { -+// NTL error handling (>= 9.3.0) ---------------------------------------- -+#ifdef HAVE_NTL -+#if (((NTL_MAJOR_VERSION==9)&&(NTL_MINOR_VERSION>=3))||(NTL_MAJOR_VERSION>=10)) -+ ErrorMsgCallback=WerrorS; -+ ErrorCallback=HALT; -+#endif -+#endif -+// factory error handling: ----------------------------------------------- -+ factoryError=WerrorS; -+ -+// signal handler ------------------------------------------------------- - #ifdef SIGSEGV - si_set_signal(SIGSEGV,(si_hdl_typ)sigsegv_handler); - #endif -diff --git a/Singular/misc_ip.cc b/Singular/misc_ip.cc -index 49eddaae6f..3d5775edd7 100644 ---- a/Singular/misc_ip.cc -+++ b/Singular/misc_ip.cc -@@ -1316,16 +1316,6 @@ static BOOLEAN iiCrossProd(leftv res, leftv args) - On(SW_USE_EZGCD_P); - On(SW_USE_QGCD); - Off(SW_USE_NTL_SORT); // may be changed by an command line option -- factoryError=WerrorS; -- --// NTL error handling (>= 9.3.0) --#ifdef HAVE_NTL --#if (((NTL_MAJOR_VERSION==9)&&(NTL_MINOR_VERSION>=3))||(NTL_MAJOR_VERSION>=10)) -- ErrorMsgCallback=WerrorS; -- ErrorCallback=HALT; --#endif --#endif -- - // memory initialization: ----------------------------------------------- - om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc; - #ifndef OM_NDEBUG diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst index a3125485b27..db84096fa16 100644 --- a/src/doc/en/constructions/algebraic_geometry.rst +++ b/src/doc/en/constructions/algebraic_geometry.rst @@ -139,7 +139,7 @@ Other methods sage: singular.lib("brnoeth.lib") sage: s = singular.ring(2,'(x,y)','lp') - sage: I = singular.ideal('[x^4+x, y^4+y]') + sage: I = singular.ideal('x^4+x', 'y^4+y') sage: L = singular.closed_points(I) sage: # Here you have all the points : sage: print(L) diff --git a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx index f78b522dc4a..1b6c26ac032 100644 --- a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx +++ b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx @@ -24,7 +24,6 @@ from cpython.object cimport PyObject_RichCompare # Define some singular functions lib("freegb.lib") poly_reduce = singular_function("NF") -singular_system=singular_function("system") ##################### # Free algebra elements @@ -444,9 +443,10 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): cdef int i if P.monomial_divides(s_poly,p_poly): return True + # current_ring has one additional variable if the variables have weights + realngens = A._current_ring.ngens() / A.degbound() for i from 0 <= i < p_d-s_d: - s_poly = singular_system("stest",s_poly,1, - A._degbound,A.__ngens,ring=P) + s_poly = s_poly.shift(realngens) if P.monomial_divides(s_poly,p_poly): return True return False @@ -600,7 +600,9 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): # we must put the polynomials into the same ring left._poly = A._current_ring(left._poly) right._poly = A._current_ring(right._poly) - rshift = singular_system("stest",right._poly,left._poly.degree(),A._degbound,A.__ngens, ring=A._current_ring) + # current_ring has one additional variable if the variables have weights + realngens = A._current_ring.ngens() / A.degbound() + rshift = right._poly.shift(left._poly.degree()*realngens) return FreeAlgebraElement_letterplace(A,left._poly*rshift, check=False) def __pow__(FreeAlgebraElement_letterplace self, int n, k): @@ -626,10 +628,11 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): self._poly = A._current_ring(self._poly) cdef int d = self._poly.degree() q = p = self._poly + # current_ring has one additional variable if the variables have weights + realngens = A._current_ring.ngens() / A.degbound() cdef int i for i from 0 = PolynomialRing(ZZ,3) sage: I = P * (a + 2*b + 2*c - 1, a^2 - a + 2*b^2 + 2*c^2, 2*a*b + 2*b*c - b) sage: I.groebner_basis() - [b^3 - 181*b*c^2 + 222*c^3 - 26*b*c - 146*c^2 + 19*b + 24*c, - 2*b*c^2 - 48*c^3 + 3*b*c + 22*c^2 - 2*b - 2*c, - 42*c^3 + 45*b^2 + 54*b*c + 22*c^2 - 13*b - 12*c, + [b^3 + b*c^2 + 12*c^3 + b^2 + b*c - 4*c^2, + 2*b*c^2 - 6*c^3 - b^2 - b*c + 2*c^2, + 42*c^3 + b^2 + 2*b*c - 14*c^2 + b, 2*b^2 + 6*b*c + 6*c^2 - b - 2*c, 10*b*c + 12*c^2 - b - 4*c, a + 2*b + 2*c - 1] diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index 74f964c9845..8b7099e02b4 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -2588,6 +2588,15 @@ cdef class MPolynomial_libsingular(MPolynomial): """ return singular_polynomial_str_with_changed_varnames(self._poly, self._parent_ring, varnames) + def shift(self, int n): + r = self.parent() + olddict = self.dict() + newdict = dict() + for key in olddict: + newkey = key[-n:]+key[:-n] + newdict[newkey] = olddict[key] + return r(newdict) + def degree(self, MPolynomial_libsingular x=None, int std_grading=False): """ Return the maximal degree of this polynomial in ``x``, where From 71c871fb917d6ac0caa48e8e2414340473b9eea9 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Thu, 2 Jan 2020 18:29:33 +0100 Subject: [PATCH 02/34] 25993: rename polynomial shift method to _cycle Univariate polynomials already have a `shift` method with a different meaning. --- .../free_algebra_element_letterplace.pyx | 15 ++++++--------- .../letterplace/free_algebra_letterplace.pyx | 2 +- .../polynomial/multi_polynomial_libsingular.pyx | 13 ++++++++++++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx index 1b6c26ac032..4b5b834db86 100644 --- a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx +++ b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx @@ -443,10 +443,9 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): cdef int i if P.monomial_divides(s_poly,p_poly): return True - # current_ring has one additional variable if the variables have weights - realngens = A._current_ring.ngens() / A.degbound() + realngens = A._commutative_ring.ngens() for i from 0 <= i < p_d-s_d: - s_poly = s_poly.shift(realngens) + s_poly = s_poly._cycle(realngens) if P.monomial_divides(s_poly,p_poly): return True return False @@ -600,9 +599,8 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): # we must put the polynomials into the same ring left._poly = A._current_ring(left._poly) right._poly = A._current_ring(right._poly) - # current_ring has one additional variable if the variables have weights - realngens = A._current_ring.ngens() / A.degbound() - rshift = right._poly.shift(left._poly.degree()*realngens) + realngens = A._commutative_ring.ngens() + rshift = right._poly._cycle(left._poly.degree() * realngens) return FreeAlgebraElement_letterplace(A,left._poly*rshift, check=False) def __pow__(FreeAlgebraElement_letterplace self, int n, k): @@ -628,11 +626,10 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): self._poly = A._current_ring(self._poly) cdef int d = self._poly.degree() q = p = self._poly - # current_ring has one additional variable if the variables have weights - realngens = A._current_ring.ngens() / A.degbound() + realngens = A._commutative_ring.ngens() cdef int i for i from 0 = QQ[] + sage: f = a*b + c + sage: f._cycle(-1), f._cycle(0), f._cycle(1) + (a*d + b, a*b + c, b*c + d) + """ r = self.parent() + n = n % r.ngens() olddict = self.dict() newdict = dict() for key in olddict: From 0c071234ae99343c40735b17280cdf5d0b3a2d6d Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sun, 5 Jan 2020 17:47:43 +0100 Subject: [PATCH 03/34] 25993: call new Singular API for letterplace algebras This is a direct workaround for the API changes in Singular. For letterplace algebras with `degrees`, this changes the default term ordering to `deglex`. With previous versions of Singular, the ordering did not get properly respected, so this choice achieves similar results as before. --- src/sage/algebras/free_algebra.py | 16 +++- .../letterplace/free_algebra_letterplace.pxd | 7 ++ .../letterplace/free_algebra_letterplace.pyx | 57 +++++++++++-- .../letterplace/letterplace_ideal.pyx | 81 +++++++++++++++---- src/sage/rings/polynomial/plural.pyx | 3 +- 5 files changed, 138 insertions(+), 26 deletions(-) diff --git a/src/sage/algebras/free_algebra.py b/src/sage/algebras/free_algebra.py index c24add03fd7..25e84ff85ff 100644 --- a/src/sage/algebras/free_algebra.py +++ b/src/sage/algebras/free_algebra.py @@ -39,7 +39,15 @@ Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F sage: I.groebner_basis(degbound=4) - Twosided Ideal (y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z, y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x + y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field + Twosided Ideal (x*y + y*z, + x*x - y*x - y*y - y*z, + y*y*y - y*y*z + y*z*y - y*z*z, + y*y*x + y*y*z + y*z*x + y*z*z, + y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, + y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, + y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, + y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z) of Free Associative Unital + Algebra on 3 generators (x, y, z) over Rational Field sage: y*z*y*y*z*z + 2*y*z*y*z*z*x + y*z*y*z*z*z - y*z*z*y*z*x + y*z*z*z*z*x in I True @@ -236,7 +244,7 @@ class FreeAlgebraFactory(UniqueFactory): a*b^2*c^3 """ def create_key(self, base_ring, arg1=None, arg2=None, - sparse=None, order='degrevlex', + sparse=None, order=None, names=None, name=None, implementation=None, degrees=None): """ @@ -267,6 +275,8 @@ def create_key(self, base_ring, arg1=None, arg2=None, return tuple(degrees),base_ring # test if we can use libSingular/letterplace if implementation == "letterplace": + if order is None: + order = 'degrevlex' if degrees is None else 'deglex' args = [arg for arg in (arg1, arg2) if arg is not None] kwds = dict(sparse=sparse, order=order, implementation="singular") if name is not None: @@ -277,7 +287,7 @@ def create_key(self, base_ring, arg1=None, arg2=None, if degrees is None: return (PolRing,) from sage.all import TermOrder - T = PolRing.term_order() + TermOrder('lex',1) + T = TermOrder(PolRing.term_order(), PolRing.ngens() + 1) varnames = list(PolRing.variable_names()) newname = 'x' while newname in varnames: diff --git a/src/sage/algebras/letterplace/free_algebra_letterplace.pxd b/src/sage/algebras/letterplace/free_algebra_letterplace.pxd index 7e5f2bbe978..d1d162c3b40 100644 --- a/src/sage/algebras/letterplace/free_algebra_letterplace.pxd +++ b/src/sage/algebras/letterplace/free_algebra_letterplace.pxd @@ -13,8 +13,15 @@ from sage.rings.ring cimport Algebra from sage.structure.element cimport AlgebraElement, ModuleElement, RingElement, Element from sage.rings.polynomial.multi_polynomial_libsingular cimport MPolynomialRing_libsingular, MPolynomial_libsingular from sage.algebras.letterplace.free_algebra_element_letterplace cimport FreeAlgebraElement_letterplace +from sage.libs.singular.decl cimport ring +cdef class FreeAlgebra_letterplace_libsingular(): + cdef ring* _lp_ring + cdef MPolynomialRing_libsingular _commutative_ring + cdef MPolynomialRing_libsingular _lp_ring_internal + cdef object __ngens + cdef class FreeAlgebra_letterplace(Algebra): cdef MPolynomialRing_libsingular _commutative_ring cdef MPolynomialRing_libsingular _current_ring diff --git a/src/sage/algebras/letterplace/free_algebra_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_letterplace.pyx index 88eac5dea90..02d0e8912b7 100644 --- a/src/sage/algebras/letterplace/free_algebra_letterplace.pyx +++ b/src/sage/algebras/letterplace/free_algebra_letterplace.pyx @@ -37,7 +37,15 @@ The preceding containment test is based on the computation of Groebner bases with degree bound:: sage: I.groebner_basis(degbound=4) - Twosided Ideal (y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z, y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x + y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field + Twosided Ideal (x*y + y*z, + x*x - y*x - y*y - y*z, + y*y*y - y*y*z + y*z*y - y*z*z, + y*y*x + y*y*z + y*z*x + y*z*z, + y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, + y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, + y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, + y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z) of Free Associative Unital + Algebra on 3 generators (x, y, z) over Rational Field When reducing an element by `I`, the original generators are chosen:: @@ -67,7 +75,13 @@ different normal form:: Lexicographic term order sage: J = L*[a*b+b*c,a^2+a*b-b*c-c^2]*L sage: J.groebner_basis(4) - Twosided Ideal (2*b*c*b - b*c*c + c*c*b, a*c*c - 2*b*c*a - 2*b*c*c - c*c*a, a*b + b*c, a*a - 2*b*c - c*c) of Free Associative Unital Algebra on 3 generators (a, b, c) over Rational Field + Twosided Ideal (2*b*c*b - b*c*c + c*c*b, + a*b + b*c, + -a*c*c + 2*b*c*a + 2*b*c*c + c*c*a, + a*c*c*b - 2*b*c*c*b + b*c*c*c, + a*a - 2*b*c - c*c, + a*c*c*a - 2*b*c*c*a - 4*b*c*c*c - c*c*c*c) of Free Associative Unital + Algebra on 3 generators (a, b, c) over Rational Field sage: (b*c*b*b).normal_form(J) 1/2*b*c*c*b - 1/2*c*c*b*b @@ -105,14 +119,16 @@ TESTS:: from sage.misc.misc_c import prod from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.libs.singular.function import lib, singular_function -from sage.rings.polynomial.term_order import TermOrder +from sage.libs.singular.function cimport RingWrap +from sage.libs.singular.ring cimport singular_ring_delete, singular_ring_reference from sage.categories.algebras import Algebras from sage.rings.noncommutative_ideals import IdealMonoid_nc +from sage.rings.polynomial.plural cimport new_CRing ##################### # Define some singular functions lib("freegb.lib") -poly_reduce = singular_function("NF") +freeAlgebra = singular_function("freeAlgebra") # unfortunately we can not set Singular attributes for MPolynomialRing_libsingular # Hence, we must constantly work around Letterplace's sanity checks, @@ -241,7 +257,7 @@ cdef class FreeAlgebra_letterplace(Algebra): sage: F. = FreeAlgebra(K, implementation='letterplace') sage: TestSuite(F).run() """ - if not isinstance(R,MPolynomialRing_libsingular): + if not isinstance(R, MPolynomialRing_libsingular): raise TypeError("A letterplace algebra must be provided by a polynomial ring of type %s" % MPolynomialRing_libsingular) self.__ngens = R.ngens() if degrees is None: @@ -259,7 +275,9 @@ cdef class FreeAlgebra_letterplace(Algebra): if degrees is None: self._degrees = tuple([int(1)]*self.__ngens) else: - if (not isinstance(degrees,(tuple,list))) or len(degrees)!=self.__ngens-1 or any(i <= 0 for i in degrees): + if (not isinstance(degrees, (tuple, list))) \ + or len(degrees) != self.__ngens - self._nb_slackvars \ + or any(i <= 0 for i in degrees): raise TypeError("The generator degrees must be given by a list or tuple of %d positive integers" % (self.__ngens-1)) self._degrees = tuple([int(i) for i in degrees]) self.set_degbound(max(self._degrees)) @@ -665,7 +683,7 @@ cdef class FreeAlgebra_letterplace(Algebra): Sage, since it does the reductions in a different order compared to Singular. Therefore, we call the original Singular reduction method, and prevent a warning message by asserting - that `G` is a Groebner basis. + that `G` is a Groebner basis. :: sage: from sage.libs.singular.function import singular_function sage: poly_reduce = singular_function("NF") @@ -878,3 +896,28 @@ cdef class FreeAlgebra_letterplace(Algebra): PNames[P.ngens(): len(PNames): P.ngens()+1] = list(Names[self.ngens(): len(Names): self.ngens()+1])[:P.degbound()] x = Ppoly.hom([Gens[Names.index(asdf)] for asdf in PNames])(x.letterplace_polynomial()) return FreeAlgebraElement_letterplace(self,self._current_ring(x)) + +cdef class FreeAlgebra_letterplace_libsingular(): + """ + Internally used wrapper around a Singular Letterplace polynomial ring. + """ + + def __cinit__(self, MPolynomialRing_libsingular commutative_ring, + int degbound): + cdef RingWrap rw = freeAlgebra(commutative_ring, degbound) + self._lp_ring = singular_ring_reference(rw._ring) + # `_lp_ring` viewed as `MPolynomialRing_libsingular` with additional + # letterplace attributes set (for internal use only) + self._lp_ring_internal = new_CRing(rw, commutative_ring.base_ring()) + self._commutative_ring = commutative_ring + + def __init__(self, commutative_ring, degbound): + self.__ngens = commutative_ring.ngens() * degbound + + def __dealloc__(self): + r""" + Carefully deallocate the ring, without changing ``currRing`` + (since this method can be at unpredictable times due to garbage + collection). + """ + singular_ring_delete(self._lp_ring) diff --git a/src/sage/algebras/letterplace/letterplace_ideal.pyx b/src/sage/algebras/letterplace/letterplace_ideal.pyx index 52d3477bf68..e73663bc055 100644 --- a/src/sage/algebras/letterplace/letterplace_ideal.pyx +++ b/src/sage/algebras/letterplace/letterplace_ideal.pyx @@ -27,7 +27,11 @@ One can compute Groebner bases out to a finite degree, can compute normal forms and can test containment in the ideal:: sage: I.groebner_basis(degbound=3) - Twosided Ideal (y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x + y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field + Twosided Ideal (x*y + y*z, + x*x - y*x - y*y - y*z, + y*y*y - y*y*z + y*z*y - y*z*z, + y*y*x + y*y*z + y*z*x + y*z*z) of Free Associative Unital Algebra + on 3 generators (x, y, z) over Rational Field sage: (x*y*z*y*x).normal_form(I) y*z*z*y*z + y*z*z*z*x + y*z*z*z*z sage: x*y*z*y*x - (x*y*z*y*x).normal_form(I) in I @@ -41,7 +45,7 @@ AUTHOR: from sage.rings.noncommutative_ideals import Ideal_nc from sage.libs.singular.function import lib, singular_function -from sage.algebras.letterplace.free_algebra_letterplace cimport FreeAlgebra_letterplace +from sage.algebras.letterplace.free_algebra_letterplace cimport FreeAlgebra_letterplace, FreeAlgebra_letterplace_libsingular from sage.algebras.letterplace.free_algebra_element_letterplace cimport FreeAlgebraElement_letterplace from sage.rings.infinity import Infinity @@ -68,14 +72,22 @@ class LetterplaceIdeal(Ideal_nc): sage: I.groebner_basis(2) Twosided Ideal (x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field sage: I.groebner_basis(4) - Twosided Ideal (y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z, y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x + y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field + Twosided Ideal (x*y + y*z, + x*x - y*x - y*y - y*z, + y*y*y - y*y*z + y*z*y - y*z*z, + y*y*x + y*y*z + y*z*x + y*z*z, + y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, + y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, + y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, + y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z) of Free Associative Unital + Algebra on 3 generators (x, y, z) over Rational Field Groebner bases are cached. If one has computed a Groebner basis out to a high degree then it will also be returned if a Groebner basis with a lower degree bound is requested:: - sage: I.groebner_basis(2) - Twosided Ideal (y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z, y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x + y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field + sage: I.groebner_basis(2) is I.groebner_basis(4) + True Of course, the normal form of any element has to satisfy the following:: @@ -115,8 +127,11 @@ class LetterplaceIdeal(Ideal_nc): sage: F. = FreeAlgebra(QQ, implementation='letterplace',degrees=[1,2,3]) sage: I = F*[x*y+z-y*x,x*y*z-x^6+y^3]*F sage: I.groebner_basis(Infinity) - Twosided Ideal (x*z*z - y*x*x*z - y*x*y*y + y*x*z*x + y*y*y*x + z*x*z + z*y*y - z*z*x, - x*y - y*x + z, + Twosided Ideal (x*y - y*x + z, + x*x*x*x*x*x - y*x*z - y*y*y + z*z, + x*z*z - y*x*x*z + y*x*z*x + y*y*z + y*z*y + z*x*z + z*y*y - z*z*x, + x*x*x*x*x*z + x*x*x*x*z*x + x*x*x*z*x*x + x*x*z*x*x*x + x*z*x*x*x*x + + y*x*z*y - y*y*x*z + y*z*z + z*x*x*x*x*x - z*z*y, x*x*x*x*z*y*y + x*x*x*z*y*y*x - x*x*x*z*y*z - x*x*z*y*x*z + x*x*z*y*y*x*x + x*x*z*y*y*y - x*x*z*y*z*x - x*z*y*x*x*z - x*z*y*x*z*x + x*z*y*y*x*x*x + 2*x*z*y*y*y*x - 2*x*z*y*y*z - x*z*y*z*x*x - @@ -134,10 +149,7 @@ class LetterplaceIdeal(Ideal_nc): z*y*y*y*y - 3*z*y*y*z*x - z*y*z*x*x*x - 2*z*y*z*y*x + 2*z*y*z*z - z*z*x*x*x*x*x + 4*z*z*x*x*z + 4*z*z*x*z*x - 4*z*z*y*x*x*x - 3*z*z*y*y*x + 4*z*z*y*z + 4*z*z*z*x*x + - 2*z*z*z*y, - x*x*x*x*x*z + x*x*x*x*z*x + x*x*x*z*x*x + x*x*z*x*x*x + x*z*x*x*x*x + - y*x*z*y - y*y*x*z + y*z*z + z*x*x*x*x*x - z*z*y, - x*x*x*x*x*x - y*x*z - y*y*y + z*z) + 2*z*z*z*y) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field Again, we can compute normal forms:: @@ -225,7 +237,15 @@ class LetterplaceIdeal(Ideal_nc): sage: I.groebner_basis() # not tested Twosided Ideal (y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x + y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field sage: I.groebner_basis(4) - Twosided Ideal (y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z, y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x + y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field + Twosided Ideal (x*y + y*z, + x*x - y*x - y*y - y*z, + y*y*y - y*y*z + y*z*y - y*z*z, + y*y*x + y*y*z + y*z*x + y*z*z, + y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z, + y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z, + y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z, + y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z) of Free Associative + Unital Algebra on 3 generators (x, y, z) over Rational Field sage: I.groebner_basis(2) is I.groebner_basis(4) True sage: G = I.groebner_basis(4) @@ -237,7 +257,14 @@ class LetterplaceIdeal(Ideal_nc): sage: I = F*[x*y-y*x,x*z-z*x,y*z-z*y,x^2*y-z^3,x*y^2+z*x^2]*F sage: I.groebner_basis(Infinity) - Twosided Ideal (z*z*z*y*y + z*z*z*z*x, z*x*x*x + z*z*z*y, y*z - z*y, y*y*x + z*x*x, y*x*x - z*z*z, x*z - z*x, x*y - y*x) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field + Twosided Ideal (-y*z + z*y, + -x*z + z*x, + -x*y + y*x, + x*x*z + x*y*y, + x*x*y - z*z*z, + x*x*x*z + y*z*z*z, + x*z*z*z*z + y*y*z*z*z) of Free Associative Unital Algebra + on 3 generators (x, y, z) over Rational Field Since the commutators of the generators are contained in the ideal, we can verify the above result by a computation in a polynomial ring @@ -275,8 +302,32 @@ class LetterplaceIdeal(Ideal_nc): libsingular_options['redSB'] = True A.set_degbound(degbound) P = A._current_ring - out = [FreeAlgebraElement_letterplace(A,X,check=False) for X in - singular_twostd(P.ideal([x._poly for x in self.__GB.gens()]), ring = P)] + + # note that degbound might be smaller than A._degbound due to caching, + # but degbound must be large enough to map all generators to the + # letterplace ring L + if degbound < A._degbound: + max_deg = max([x._poly.degree() for x in self.__GB.gens()]) + if degbound < max_deg: + degbound = max_deg + + # The following is a workaround for calling Singular's new Letterplace + # API (see :trac:`25993`). We construct a temporary polynomial ring L + # with letterplace attributes set as required by the API. As L has + # duplicate variable names, we need to handle this ring carefully; in + # particular, we cannot coerce to and from L, so we use homomorphisms + # for the conversion. + + cdef FreeAlgebra_letterplace_libsingular lp_ring = \ + FreeAlgebra_letterplace_libsingular(A._commutative_ring, degbound) + L = lp_ring._lp_ring_internal + to_L = P.hom(L.gens(), L, check=False) + from_L = L.hom(P.gens(), P, check=False) + I = L.ideal([to_L(x._poly) for x in self.__GB.gens()]) + gb = singular_twostd(I) + out = [FreeAlgebraElement_letterplace(A, from_L(X), check=False) + for X in gb] + libsingular_options['redTail'] = bck[0] libsingular_options['redSB'] = bck[1] self.__GB = A.ideal(out,side='twosided',coerce=False) diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx index d2dec781fbb..6fa268090e4 100644 --- a/src/sage/rings/polynomial/plural.pyx +++ b/src/sage/rings/polynomial/plural.pyx @@ -2876,7 +2876,8 @@ cpdef MPolynomialRing_libsingular new_CRing(RingWrap rw, base_ring): self.__ngens = rw.ngens() self.__term_order = TermOrder(rw.ordering_string(), force=True) - ParentWithGens.__init__(self, base_ring, rw.var_names()) + ParentWithGens.__init__(self, base_ring, tuple(rw.var_names()), + normalize=False) # self._populate_coercion_lists_() # ??? #MPolynomialRing_generic.__init__(self, base_ring, n, names, order) From 9dbc2badedcda7046e37bc5adc2a4768f60318e6 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Wed, 19 Feb 2020 11:00:34 +0100 Subject: [PATCH 04/34] 25993: upgrade to singular 4.1.2p4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The doctest changes are due to: - sign changes in fraction field elements - minors which include non-zero elements as per Singular docs: https://www.singular.uni-kl.de/Manual/4-1-2/sing_298.htm - order of rational points being undetermined - intersection of ideals not returning a Gröbner basis anymore; neither Sage nor Singular clearly state that the result should be a Gröbner basis: https://www.singular.uni-kl.de/Manual/4-1-2/sing_271.htm --- build/pkgs/singular/checksums.ini | 6 +++--- build/pkgs/singular/package-version.txt | 2 +- src/doc/en/constructions/algebraic_geometry.rst | 2 +- src/doc/en/developer/coding_in_other.rst | 5 ----- .../root_system/hecke_algebra_representation.py | 2 +- .../non_symmetric_macdonald_polynomials.py | 16 ++++------------ src/sage/combinat/sf/macdonald.py | 4 ++-- src/sage/interfaces/singular.py | 12 ++++++++++-- .../rings/polynomial/multi_polynomial_element.py | 2 +- .../rings/polynomial/multi_polynomial_ideal.py | 4 ++-- src/sage/schemes/curves/projective_curve.py | 2 +- 11 files changed, 26 insertions(+), 31 deletions(-) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index 7096c45e783..ba838511214 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,4 +1,4 @@ tarball=singular-VERSION.tar.gz -sha1=f680f2dd63013f9178b2321f4f86ad5835cbfbfa -md5=14a2966b652bcb020364c6824cd0de6d -cksum=3018464869 +sha1=a14e0f9b53785505475d3769cc17f13dd2657a6b +md5=54683318f34cdab6d145b30dd4e4f22d +cksum=897381337 diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index 639086f8fff..8bd9c56067b 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.1.2p1.p0 +4.1.2p4.p0 diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst index db84096fa16..d1c9c951598 100644 --- a/src/doc/en/constructions/algebraic_geometry.rst +++ b/src/doc/en/constructions/algebraic_geometry.rst @@ -325,7 +325,7 @@ Singular itself to help an understanding of how the wrapper works. sage: X = Curve(f); pts = X.rational_points() sage: D = X.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ]) sage: X.riemann_roch_basis(D) - [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)] + [(-2*x + y)/(x + y), (-x + z)/(x + y)] - Using Singular's ``BrillNoether`` command (for details see the section Brill-Noether in the Singular online documentation diff --git a/src/doc/en/developer/coding_in_other.rst b/src/doc/en/developer/coding_in_other.rst index ee713736c92..799f16f9225 100644 --- a/src/doc/en/developer/coding_in_other.rst +++ b/src/doc/en/developer/coding_in_other.rst @@ -449,11 +449,6 @@ interface to Singular:: 0 [2]: [1]: - -2 - [2]: - -1 - [3]: - 1 ... From looking at the output, notice that our wrapper function will need diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py index 7c4f64a6a5e..24750bee605 100644 --- a/src/sage/combinat/root_system/hecke_algebra_representation.py +++ b/src/sage/combinat/root_system/hecke_algebra_representation.py @@ -745,7 +745,7 @@ def Y_eigenvectors(self): -2121 + 212, (q2/(q1-q2))*2121 + (q2/(-q1+q2))*121 + (q2/(-q1+q2))*212 - 12 + ((-q2)/(-q1+q2))*21 + 2, ((-q2^2)/(-q1^2+q1*q2-q2^2))*2121 - 121 + (q2^2/(-q1^2+q1*q2-q2^2))*212 + 21, - ((q1^2+q2^2)/(-q1^2+q1*q2-q2^2))*2121 + ((-q1^2-q2^2)/(-q1^2+q1*q2-q2^2))*121 + ((-q2^2)/(-q1^2+q1*q2-q2^2))*212 + (q2^2/(-q1^2+q1*q2-q2^2))*12 - 21 + 1, + ((-q1^2-q2^2)/(q1^2-q1*q2+q2^2))*2121 + ((-q1^2-q2^2)/(-q1^2+q1*q2-q2^2))*121 + ((-q2^2)/(-q1^2+q1*q2-q2^2))*212 + (q2^2/(-q1^2+q1*q2-q2^2))*12 - 21 + 1, 2121, (q2/(-q1+q2))*2121 + ((-q2)/(-q1+q2))*121 - 212 + 12, -2121 + 121] diff --git a/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py b/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py index 3205a0935f0..d24a69131d3 100644 --- a/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py +++ b/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py @@ -555,8 +555,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): B[(1, 0, 0)] sage: E[-omega[1]] - B[(-1, 0, 0)] + ((-q*q1^6-q*q1^5*q2-q1*q2^5-q2^6)/(-q^3*q1^6-q^2*q1^5*q2-q*q1*q2^5-q2^6))*B[(1, 0, 0)] + ((-q1-q2)/(-q*q1-q2))*B[(0, -1, 0)] - + ((q1+q2)/(q*q1+q2))*B[(0, 1, 0)] + ((-q1-q2)/(-q*q1-q2))*B[(0, 0, -1)] + ((-q1-q2)/(-q*q1-q2))*B[(0, 0, 1)] + B[(-1, 0, 0)] + ((q*q1^6+q*q1^5*q2+q1*q2^5+q2^6)/(q^3*q1^6+q^2*q1^5*q2+q*q1*q2^5+q2^6))*B[(1, 0, 0)] + ((q1+q2)/(q*q1+q2))*B[(0, -1, 0)] + ((q1+q2)/(q*q1+q2))*B[(0, 1, 0)] + ((q1+q2)/(q*q1+q2))*B[(0, 0, -1)] + ((q1+q2)/(q*q1+q2))*B[(0, 0, 1)] sage: E[omega[2]] ((-q1*q2^3-q2^4)/(q*q1^4-q2^4))*B[(1, 0, 0)] + B[(0, 1, 0)] @@ -567,14 +566,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): + ((-q1*q2-q2^2)/(q*q1^2-q2^2))*B[(0, 0, -1)] + ((q1*q2+q2^2)/(-q*q1^2+q2^2))*B[(0, 0, 1)] sage: E[-omega[1]-omega[2]] - ((-q^3*q1^6-q^3*q1^5*q2-2*q^2*q1^6-3*q^2*q1^5*q2+q^2*q1^4*q2^2+2*q^2*q1^3*q2^3+q*q1^5*q2+2*q*q1^4*q2^2-q*q1^3*q2^3-2*q*q1^2*q2^4+q*q1*q2^5+q*q2^6-q1^3*q2^3-q1^2*q2^4+2*q1*q2^5+2*q2^6)/(-q^4*q1^6-q^3*q1^5*q2+q^3*q1^4*q2^2-q*q1^2*q2^4+q*q1*q2^5+q2^6))*B[(0, 0, 0)] + B[(-1, -1, 0)] - + ((q*q1^4+q*q1^3*q2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(-1, 1, 0)] + ((q1+q2)/(q*q1+q2))*B[(-1, 0, -1)] + ((-q1-q2)/(-q*q1-q2))*B[(-1, 0, 1)] - + ((q*q1^4+q*q1^3*q2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(1, -1, 0)] - + ((-q^2*q1^6-q^2*q1^5*q2-q*q1^5*q2+q*q1^3*q2^3+q1^5*q2+q1^4*q2^2-q1^3*q2^3-q1^2*q2^4+q1*q2^5+q2^6)/(-q^4*q1^6-q^3*q1^5*q2+q^3*q1^4*q2^2-q*q1^2*q2^4+q*q1*q2^5+q2^6))*B[(1, 1, 0)] - + ((-q*q1^4-2*q*q1^3*q2-q*q1^2*q2^2+q1^3*q2+q1^2*q2^2-q1*q2^3-q2^4)/(-q^3*q1^4-q^2*q1^3*q2-q*q1*q2^3-q2^4))*B[(1, 0, -1)] - + ((-q*q1^4-2*q*q1^3*q2-q*q1^2*q2^2+q1^3*q2+q1^2*q2^2-q1*q2^3-q2^4)/(-q^3*q1^4-q^2*q1^3*q2-q*q1*q2^3-q2^4))*B[(1, 0, 1)] + ((q1+q2)/(q*q1+q2))*B[(0, -1, -1)] - + ((-q1-q2)/(-q*q1-q2))*B[(0, -1, 1)] + ((q*q1^4+2*q*q1^3*q2+q*q1^2*q2^2-q1^3*q2-q1^2*q2^2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(0, 1, -1)] - + ((q*q1^4+2*q*q1^3*q2+q*q1^2*q2^2-q1^3*q2-q1^2*q2^2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(0, 1, 1)] + ((q^3*q1^6+q^3*q1^5*q2+2*q^2*q1^6+3*q^2*q1^5*q2-q^2*q1^4*q2^2-2*q^2*q1^3*q2^3-q*q1^5*q2-2*q*q1^4*q2^2+q*q1^3*q2^3+2*q*q1^2*q2^4-q*q1*q2^5-q*q2^6+q1^3*q2^3+q1^2*q2^4-2*q1*q2^5-2*q2^6)/(q^4*q1^6+q^3*q1^5*q2-q^3*q1^4*q2^2+q*q1^2*q2^4-q*q1*q2^5-q2^6))*B[(0, 0, 0)] + B[(-1, -1, 0)] + ((q*q1^4+q*q1^3*q2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(-1, 1, 0)] + ((q1+q2)/(q*q1+q2))*B[(-1, 0, -1)] + ((-q1-q2)/(-q*q1-q2))*B[(-1, 0, 1)] + ((q*q1^4+q*q1^3*q2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(1, -1, 0)] + ((q^2*q1^6+q^2*q1^5*q2+q*q1^5*q2-q*q1^3*q2^3-q1^5*q2-q1^4*q2^2+q1^3*q2^3+q1^2*q2^4-q1*q2^5-q2^6)/(q^4*q1^6+q^3*q1^5*q2-q^3*q1^4*q2^2+q*q1^2*q2^4-q*q1*q2^5-q2^6))*B[(1, 1, 0)] + ((q*q1^4+2*q*q1^3*q2+q*q1^2*q2^2-q1^3*q2-q1^2*q2^2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(1, 0, -1)] + ((q*q1^4+2*q*q1^3*q2+q*q1^2*q2^2-q1^3*q2-q1^2*q2^2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(1, 0, 1)] + ((q1+q2)/(q*q1+q2))*B[(0, -1, -1)] + ((q1+q2)/(q*q1+q2))*B[(0, -1, 1)] + ((q*q1^4+2*q*q1^3*q2+q*q1^2*q2^2-q1^3*q2-q1^2*q2^2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(0, 1, -1)] + ((q*q1^4+2*q*q1^3*q2+q*q1^2*q2^2-q1^3*q2-q1^2*q2^2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(0, 1, 1)] sage: E[omega[1]-omega[2]] ((q^3*q1^7+q^3*q1^6*q2-q*q1*q2^6-q*q2^7)/(q^3*q1^7-q^2*q1^5*q2^2+q*q1^2*q2^5-q2^7))*B[(0, 0, 0)] + B[(1, -1, 0)] @@ -812,7 +804,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): ((-q*q1*q2^3-q*q2^4)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] sage: E[2*omega[2]] # long time # not checked against Bogdan's notes, but a good self-consistency test - ((-q^12*q1^6-q^12*q1^5*q2+2*q^10*q1^5*q2+5*q^10*q1^4*q2^2+3*q^10*q1^3*q2^3+2*q^8*q1^5*q2+4*q^8*q1^4*q2^2+q^8*q1^3*q2^3-q^8*q1^2*q2^4+q^8*q1*q2^5+q^8*q2^6-q^6*q1^3*q2^3+q^6*q1^2*q2^4+4*q^6*q1*q2^5+2*q^6*q2^6+q^4*q1^3*q2^3+3*q^4*q1^2*q2^4+4*q^4*q1*q2^5+2*q^4*q2^6)/(-q^12*q1^6-q^10*q1^5*q2-q^8*q1^3*q2^3+q^6*q1^4*q2^2-q^6*q1^2*q2^4+q^4*q1^3*q2^3+q^2*q1*q2^5+q2^6))*B[(0, 0)] + ((q^7*q1^2*q2+2*q^7*q1*q2^2+q^7*q2^3+q^5*q1^2*q2+2*q^5*q1*q2^2+q^5*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(-1, 0)] + ((q^6*q1*q2+q^6*q2^2)/(-q^6*q1^2+q2^2))*B[(-1, -1)] + ((q^6*q1^2*q2+2*q^6*q1*q2^2+q^6*q2^3+q^4*q1^2*q2+2*q^4*q1*q2^2+q^4*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(-1, 1)] + ((q^3*q1*q2+q^3*q2^2)/(-q^6*q1^2+q2^2))*B[(-1, 2)] + ((-q^7*q1^3-q^7*q1^2*q2+q^7*q1*q2^2+q^7*q2^3+2*q^5*q1^2*q2+4*q^5*q1*q2^2+2*q^5*q2^3+2*q^3*q1^2*q2+4*q^3*q1*q2^2+2*q^3*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(1, 0)] + ((-q^6*q1^2*q2-2*q^6*q1*q2^2-q^6*q2^3-q^4*q1^2*q2-2*q^4*q1*q2^2-q^4*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(1, -1)] + ((q^8*q1^3+q^8*q1^2*q2+q^6*q1^3+q^6*q1^2*q2-q^6*q1*q2^2-q^6*q2^3-2*q^4*q1^2*q2-4*q^4*q1*q2^2-2*q^4*q2^3-q^2*q1^2*q2-3*q^2*q1*q2^2-2*q^2*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(1, 1)] + ((-q^5*q1^2-q^5*q1*q2+q^3*q1*q2+q^3*q2^2+q*q1*q2+q*q2^2)/(-q^6*q1^2+q2^2))*B[(1, 2)] + ((-q^6*q1^2-q^6*q1*q2+q^4*q1*q2+q^4*q2^2+q^2*q1*q2+q^2*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 0)] + ((q^3*q1*q2+q^3*q2^2)/(-q^6*q1^2+q2^2))*B[(2, -1)] + ((-q^5*q1^2-q^5*q1*q2+q^3*q1*q2+q^3*q2^2+q*q1*q2+q*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 1)] + B[(2, 2)] + ((-q^7*q1^2*q2-2*q^7*q1*q2^2-q^7*q2^3-q^5*q1^2*q2-2*q^5*q1*q2^2-q^5*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(0, -1)] + ((q^7*q1^3+q^7*q1^2*q2-q^7*q1*q2^2-q^7*q2^3-2*q^5*q1^2*q2-4*q^5*q1*q2^2-2*q^5*q2^3-2*q^3*q1^2*q2-4*q^3*q1*q2^2-2*q^3*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(0, 1)] + ((-q^6*q1^2-q^6*q1*q2+q^4*q1*q2+q^4*q2^2+q^2*q1*q2+q^2*q2^2)/(-q^6*q1^2+q2^2))*B[(0, 2)] + ((-q^12*q1^6-q^12*q1^5*q2+2*q^10*q1^5*q2+5*q^10*q1^4*q2^2+3*q^10*q1^3*q2^3+2*q^8*q1^5*q2+4*q^8*q1^4*q2^2+q^8*q1^3*q2^3-q^8*q1^2*q2^4+q^8*q1*q2^5+q^8*q2^6-q^6*q1^3*q2^3+q^6*q1^2*q2^4+4*q^6*q1*q2^5+2*q^6*q2^6+q^4*q1^3*q2^3+3*q^4*q1^2*q2^4+4*q^4*q1*q2^5+2*q^4*q2^6)/(-q^12*q1^6-q^10*q1^5*q2-q^8*q1^3*q2^3+q^6*q1^4*q2^2-q^6*q1^2*q2^4+q^4*q1^3*q2^3+q^2*q1*q2^5+q2^6))*B[(0, 0)] + ((q^7*q1^2*q2+2*q^7*q1*q2^2+q^7*q2^3+q^5*q1^2*q2+2*q^5*q1*q2^2+q^5*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(-1, 0)] + ((-q^6*q1*q2-q^6*q2^2)/(q^6*q1^2-q2^2))*B[(-1, -1)] + ((q^6*q1^2*q2+2*q^6*q1*q2^2+q^6*q2^3+q^4*q1^2*q2+2*q^4*q1*q2^2+q^4*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(-1, 1)] + ((-q^3*q1*q2-q^3*q2^2)/(q^6*q1^2-q2^2))*B[(-1, 2)] + ((q^7*q1^3+q^7*q1^2*q2-q^7*q1*q2^2-q^7*q2^3-2*q^5*q1^2*q2-4*q^5*q1*q2^2-2*q^5*q2^3-2*q^3*q1^2*q2-4*q^3*q1*q2^2-2*q^3*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(1, 0)] + ((q^6*q1^2*q2+2*q^6*q1*q2^2+q^6*q2^3+q^4*q1^2*q2+2*q^4*q1*q2^2+q^4*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(1, -1)] + ((q^8*q1^3+q^8*q1^2*q2+q^6*q1^3+q^6*q1^2*q2-q^6*q1*q2^2-q^6*q2^3-2*q^4*q1^2*q2-4*q^4*q1*q2^2-2*q^4*q2^3-q^2*q1^2*q2-3*q^2*q1*q2^2-2*q^2*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(1, 1)] + ((q^5*q1^2+q^5*q1*q2-q^3*q1*q2-q^3*q2^2-q*q1*q2-q*q2^2)/(q^6*q1^2-q2^2))*B[(1, 2)] + ((-q^6*q1^2-q^6*q1*q2+q^4*q1*q2+q^4*q2^2+q^2*q1*q2+q^2*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 0)] + ((-q^3*q1*q2-q^3*q2^2)/(q^6*q1^2-q2^2))*B[(2, -1)] + ((-q^5*q1^2-q^5*q1*q2+q^3*q1*q2+q^3*q2^2+q*q1*q2+q*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 1)] + B[(2, 2)] + ((q^7*q1^2*q2+2*q^7*q1*q2^2+q^7*q2^3+q^5*q1^2*q2+2*q^5*q1*q2^2+q^5*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(0, -1)] + ((q^7*q1^3+q^7*q1^2*q2-q^7*q1*q2^2-q^7*q2^3-2*q^5*q1^2*q2-4*q^5*q1*q2^2-2*q^5*q2^3-2*q^3*q1^2*q2-4*q^3*q1*q2^2-2*q^3*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(0, 1)] + ((q^6*q1^2+q^6*q1*q2-q^4*q1*q2-q^4*q2^2-q^2*q1*q2-q^2*q2^2)/(q^6*q1^2-q2^2))*B[(0, 2)] sage: E.recursion(2*omega[2]) [0, 1, 0, 2, 1, 0, 2, 1, 0] @@ -997,7 +989,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: L0 = E.keys() sage: omega = L0.fundamental_weights() sage: E[2*omega[2]] - ((q*q1+q*q2)/(q*q1+q2))*B[(1, 2, 1)] + ((q*q1+q*q2)/(q*q1+q2))*B[(2, 1, 1)] + B[(2, 2, 0)] + ((-q*q1-q*q2)/(-q*q1-q2))*B[(1, 2, 1)] + ((-q*q1-q*q2)/(-q*q1-q2))*B[(2, 1, 1)] + B[(2, 2, 0)] sage: for d in range(4): # long time (9s) ....: for weight in IntegerVectors(d,3).map(list).map(L0): ....: eigenvalues = E.eigenvalues(E[L0(weight)]) diff --git a/src/sage/combinat/sf/macdonald.py b/src/sage/combinat/sf/macdonald.py index 0d32a8dfbf0..5e48f87aad8 100644 --- a/src/sage/combinat/sf/macdonald.py +++ b/src/sage/combinat/sf/macdonald.py @@ -483,7 +483,7 @@ def Ht(self): sage: Ht = Sym.macdonald().Ht() sage: s = Sym.schur() sage: Ht(s([2,1])) - ((-q)/(-q*t^2+t^3+q^2-q*t))*McdHt[1, 1, 1] + ((q^2+q*t+t^2)/(-q^2*t^2+q^3+t^3-q*t))*McdHt[2, 1] + (t/(-q^3+q^2*t+q*t-t^2))*McdHt[3] + (q/(q*t^2-t^3-q^2+q*t))*McdHt[1, 1, 1] + ((-q^2-q*t-t^2)/(q^2*t^2-q^3-t^3+q*t))*McdHt[2, 1] + (t/(-q^3+q^2*t+q*t-t^2))*McdHt[3] sage: Ht(s([2])) ((-q)/(-q+t))*McdHt[1, 1] + (t/(-q+t))*McdHt[2] """ @@ -899,7 +899,7 @@ def _multiply(self, left, right): sage: Q._multiply(Q[1],Q[2]) McdQ[2, 1] + ((q^2*t-q^2+q*t-q+t-1)/(q^2*t-1))*McdQ[3] sage: Ht._multiply(Ht[1],Ht[2]) - ((-q^2+1)/(-q^2+t))*McdHt[2, 1] + ((-t+1)/(q^2-t))*McdHt[3] + ((q^2-1)/(q^2-t))*McdHt[2, 1] + ((t-1)/(-q^2+t))*McdHt[3] """ return self( self._s(left)*self._s(right) ) diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py index 2f08a9dd3c3..dbf9b1349f8 100644 --- a/src/sage/interfaces/singular.py +++ b/src/sage/interfaces/singular.py @@ -191,13 +191,21 @@ 6*y+2*x^3-6*x^2*y, 6*x^2*y-6*x*y^2, 6*x^2*y-6*x*y^2, - 6*x+6*x*y^2-2*y^3 + 6*x+6*x*y^2-2*y^3, + 0, + 0, + 0, + 0 sage: H.minor(2) 12*y+4*x^3-12*x^2*y, 12*x^2*y-12*x*y^2, 12*x^2*y-12*x*y^2, 12*x+12*x*y^2-4*y^3, - -36*x*y-12*x^4+36*x^3*y-36*x*y^3+12*y^4+24*x^4*y^2-32*x^3*y^3+24*x^2*y^4 + -36*x*y-12*x^4+36*x^3*y-36*x*y^3+12*y^4+24*x^4*y^2-32*x^3*y^3+24*x^2*y^4, + 0, + 0, + 0, + 0 :: diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index e5d692150c6..f4027eb11e3 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -2147,7 +2147,7 @@ def degree_lowest_rational_function(r, x): :: sage: r = f/g; r - (-b*c^2 + 2)/(a*b^3*c^6 - 2*a*c) + (-2*b*c^2 - 1)/(2*a*b^3*c^6 + a*c) sage: degree_lowest_rational_function(r,a) -1 sage: degree_lowest_rational_function(r,b) diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index d5f47adb9a8..09a2306e804 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -1563,8 +1563,8 @@ def intersection(self, *others): sage: I2 = y*R sage: I3 = (x, y)*R sage: I4 = (x^2 + x*y*z, y^2 - z^3*y, z^3 + y^5*x*z)*R - sage: I1.intersection(I2, I3, I4) - Ideal (x*y*z^20 - x*y*z^3, x*y^2 - x*y*z^3, x^2*y + x*y*z^4) of Multivariate Polynomial Ring in x, y, z over Rational Field + sage: I1.intersection(I2, I3, I4).groebner_basis() + [x^2*y + x*y*z^4, x*y^2 - x*y*z^3, x*y*z^20 - x*y*z^3] The ideals must share the same ring:: diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index 592bb68dc65..962821cc440 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -1938,7 +1938,7 @@ def riemann_roch_basis(self, D): sage: C = Curve(f); pts = C.rational_points() sage: D = C.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ]) sage: C.riemann_roch_basis(D) - [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)] + [(-2*x + y)/(x + y), (-x + z)/(x + y)] .. NOTE:: From bdf81bebcd649a293471e4130a6e19fb5bfe67c8 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sat, 4 Apr 2020 22:50:37 +0200 Subject: [PATCH 05/34] 25993: update doctests in asymptotics for Singular 4.1.2p4 These changes are down to Singular choosing different representatives in `lift()`. --- .../asymptotics_multivariate_generating_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py index 8b03d221b61..c5cd87b7d67 100644 --- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py @@ -1580,7 +1580,7 @@ def asymptotics(self, p, alpha, N, asy_var=None, numerical=0, (1, [(x*y + x + y - 1, 2)]) sage: alpha = [4, 3] sage: decomp = F.asymptotic_decomposition(alpha); decomp - (0, []) + (-3/2*r*(1/y + 1) - 1/2/y - 1/2, [(x*y + x + y - 1, 1)]) + (0, []) + (-2*r*(1/x + 1) - 1/2/x - 1/2, [(x*y + x + y - 1, 1)]) sage: F1 = decomp[1] sage: p = {y: 1/3, x: 1/2} sage: asy = F1.asymptotics(p, alpha, 2, verbose=True) @@ -1614,7 +1614,7 @@ def asymptotics(self, p, alpha, N, asy_var=None, numerical=0, sage: alpha = [3, 3, 2] sage: decomp = F.asymptotic_decomposition(alpha); decomp (0, []) + - (-16*r*(3/y - 4/z) - 16/y + 32/z, + (16*r*(3/x - 2/z) + 16/x - 16/z, [(x + 2*y + z - 4, 1), (2*x + y + z - 4, 1)]) sage: F1 = decomp[1] sage: p = {x: 1, y: 1, z: 1} From 78f439e57fe3cceb59f7850cde7aa56692351099 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sat, 4 Apr 2020 23:06:25 +0200 Subject: [PATCH 06/34] 25993: add upstream_url for singular --- build/pkgs/singular/checksums.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index ba838511214..c51338b4524 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -2,3 +2,4 @@ tarball=singular-VERSION.tar.gz sha1=a14e0f9b53785505475d3769cc17f13dd2657a6b md5=54683318f34cdab6d145b30dd4e4f22d cksum=897381337 +upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-1-2/singular-VERSION.tar.gz From 8722c0f11e1567dd4598bee604511208ad7f847d Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Tue, 7 Apr 2020 22:14:42 +0200 Subject: [PATCH 07/34] 25993: upgrade to singular 4.1.3 --- build/pkgs/singular/checksums.ini | 8 ++++---- build/pkgs/singular/package-version.txt | 2 +- src/sage/libs/singular/function.pyx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index c51338b4524..4beac1eb947 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=a14e0f9b53785505475d3769cc17f13dd2657a6b -md5=54683318f34cdab6d145b30dd4e4f22d -cksum=897381337 -upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-1-2/singular-VERSION.tar.gz +sha1=5ffbb82046499ce571769bee62522fea1748ffd4 +md5=e4880d35fbcdb10bb07a73e5ddf8053c +cksum=3533935118 +upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-1-3/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index 8bd9c56067b..cef1a1bf369 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.1.2p4.p0 +4.1.3.p0 diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx index 3742260aa9b..a405ab25532 100644 --- a/src/sage/libs/singular/function.pyx +++ b/src/sage/libs/singular/function.pyx @@ -1308,7 +1308,7 @@ cdef class SingularFunction(SageObject): ... RuntimeError: error in Singular function call 'triangL': The input is no groebner basis. - leaving triang.lib::triangL + leaving triang.lib::triangL (0) Flush any stray output -- see :trac:`28622`:: From 5e496abfe428e9ea37db55a8f3a94dc3a462cfa2 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Tue, 14 Apr 2020 18:42:35 +0200 Subject: [PATCH 08/34] 25993: remove patch "Fix building singular with -DNDEBUG" This reverts commit 0eec02ed50df07aaa990430daff439ae25d5ce1a. --- .../patches/fix-building-with-nodebug.patch | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 build/pkgs/singular/patches/fix-building-with-nodebug.patch diff --git a/build/pkgs/singular/patches/fix-building-with-nodebug.patch b/build/pkgs/singular/patches/fix-building-with-nodebug.patch deleted file mode 100644 index 46b8ab83cec..00000000000 --- a/build/pkgs/singular/patches/fix-building-with-nodebug.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 80a9ffc773542e3329935e5377f6906628be16e6 Mon Sep 17 00:00:00 2001 -From: Yue Ren -Date: Thu, 15 Nov 2018 10:48:24 -0500 -Subject: [PATCH] fix: building with NDEBUG=1, trac ticket 840 - ---- - Singular/dyn_modules/gfanlib/groebnerCone.h | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/Singular/dyn_modules/gfanlib/groebnerCone.h b/Singular/dyn_modules/gfanlib/groebnerCone.h -index cb067250a0..8a212a7b7f 100644 ---- a/Singular/dyn_modules/gfanlib/groebnerCone.h -+++ b/Singular/dyn_modules/gfanlib/groebnerCone.h -@@ -99,12 +99,16 @@ class groebnerCone - */ - groebnerCones tropicalNeighbours() const; - -+ /** -+ * Return 1 if w points is in the dual of the polyhedral cone, 0 otherwise -+ */ -+ bool pointsOutwards(const gfan::ZVector w) const; -+ - /** - * Debug tools. - */ - #ifndef NDEBUG - bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const; -- bool pointsOutwards(const gfan::ZVector) const; - #endif - }; - From 827aa6c8a1d99bd50de6d431085c77164d3a39bb Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sat, 18 Apr 2020 18:41:30 +0200 Subject: [PATCH 09/34] 25993: disable problematic doctest in plural.pyx This problem is now tracked at :trac:`29528`. --- src/sage/rings/polynomial/plural.pyx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx index 8e4eea9a5ce..03c4e9c49c7 100644 --- a/src/sage/rings/polynomial/plural.pyx +++ b/src/sage/rings/polynomial/plural.pyx @@ -389,28 +389,30 @@ cdef class NCPolynomialRing_plural(Ring): TESTS: This example caused a segmentation fault with a previous version - of this method:: + of this method. This doctest still results in a segmentation fault + occasionally which is difficult to isolate, so this test is partially + disabled (:trac:`29528`):: sage: import gc sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural sage: from sage.algebras.free_algebra import FreeAlgebra sage: A1. = FreeAlgebra(QQ, 3) sage: R1 = A1.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) - sage: A2. = FreeAlgebra(GF(5), 3) - sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) - sage: A3. = FreeAlgebra(GF(11), 3) - sage: R3 = A3.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) - sage: A4. = FreeAlgebra(GF(13), 3) - sage: R4 = A4.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) + sage: A2. = FreeAlgebra(GF(5), 3) # not tested + sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) # not tested + sage: A3. = FreeAlgebra(GF(11), 3) # not tested + sage: R3 = A3.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) # not tested + sage: A4. = FreeAlgebra(GF(13), 3) # not tested + sage: R4 = A4.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) # not tested sage: _ = gc.collect() sage: foo = R1.gen(0) sage: del foo sage: del R1 sage: _ = gc.collect() - sage: del R2 - sage: _ = gc.collect() - sage: del R3 - sage: _ = gc.collect() + sage: del R2 # not tested + sage: _ = gc.collect() # not tested + sage: del R3 # not tested + sage: _ = gc.collect() # not tested """ singular_ring_delete(self._ring) From 5e6a383fcfc62d1df3ee6ad7509a5c1173d1a917 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sat, 6 Jun 2020 10:59:39 +0200 Subject: [PATCH 10/34] 25993: fix ntl patch --- .../configure-no-ntl-header-check.patch | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/build/pkgs/singular/patches/configure-no-ntl-header-check.patch b/build/pkgs/singular/patches/configure-no-ntl-header-check.patch index 3109e57f4b2..b4ec33fc054 100644 --- a/build/pkgs/singular/patches/configure-no-ntl-header-check.patch +++ b/build/pkgs/singular/patches/configure-no-ntl-header-check.patch @@ -49,30 +49,4 @@ index db6423d..c0a2260 100755 +## fi done - if test "x$ntl_found" = "xyes" ; then -diff --git a/libpolys/configure b/libpolys/configure -index 41b0928..9a4b9f5 100755 ---- a/libpolys/configure -+++ b/libpolys/configure -@@ -20660,7 +20660,7 @@ fi - - for NTL_HOME in ${NTL_HOME_PATH} - do --if test -r "$NTL_HOME/include/NTL/ZZ.h"; then -+## if test -r "$NTL_HOME/include/NTL/ZZ.h"; then - - if test "x$NTL_HOME" != "x/usr"; then - NTL_CPPFLAGS="-I${NTL_HOME}/include" -@@ -20731,9 +20731,9 @@ else - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext --else -- ntl_found="no" --fi -+## else -+## ntl_found="no" -+## fi - done - if test "x$ntl_found" = "xyes" ; then From 301a554716f886e4d07e09ec0ca64234f14bde82 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sat, 6 Jun 2020 12:05:02 +0200 Subject: [PATCH 11/34] 25993: fix doctest with flaky singular pexpect output This is a side-effect in the singular pexpect interface that emerged from ticket #29543 and non-commutative ideals. It seems safe to ignore this warning message: // ** redefining xR ( keepring basering;) --- src/sage/rings/polynomial/multi_polynomial_ideal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 787a67af9b7..1c46315950b 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -4002,7 +4002,7 @@ def groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=Fal sage: J.groebner_basis.set_cache(gb) # optional - giacpy_sage sage: ideal(J.transformed_basis()).change_ring(P).interreduced_basis() # testing trac 21884 - [a - 60*c^3 + 158/7*c^2 + 8/7*c - 1, b + 30*c^3 - 79/7*c^2 + 3/7*c, c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c] + ...[a - 60*c^3 + 158/7*c^2 + 8/7*c - 1, b + 30*c^3 - 79/7*c^2 + 3/7*c, c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c] Giac's gbasis over `\QQ` can benefit from a probabilistic lifting and multi threaded operations:: From 6f57ea5d63f4f1886f039dec900e48bf1acc880d Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sat, 6 Jun 2020 13:35:09 +0200 Subject: [PATCH 12/34] 25993: replace _cycle by permutation action on polynomials --- .../free_algebra_element_letterplace.pyx | 10 +++++++--- .../letterplace/free_algebra_letterplace.pyx | 4 +++- .../multi_polynomial_libsingular.pyx | 20 ------------------- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx index 9c9944e6716..6092ac204c0 100644 --- a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx +++ b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx @@ -17,6 +17,7 @@ AUTHOR: # https://www.gnu.org/licenses/ # **************************************************************************** +from sage.groups.perm_gps.all import CyclicPermutationGroup from sage.libs.singular.function import lib, singular_function from sage.misc.misc import repr_lincomb from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal @@ -445,8 +446,9 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): if P.monomial_divides(s_poly,p_poly): return True realngens = A._commutative_ring.ngens() + CG = CyclicPermutationGroup(P.ngens()) for i from 0 <= i < p_d-s_d: - s_poly = s_poly._cycle(realngens) + s_poly = s_poly * CG[realngens] if P.monomial_divides(s_poly,p_poly): return True return False @@ -601,7 +603,8 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): left._poly = A._current_ring(left._poly) right._poly = A._current_ring(right._poly) realngens = A._commutative_ring.ngens() - rshift = right._poly._cycle(left._poly.degree() * realngens) + CG = CyclicPermutationGroup(A._current_ring.ngens()) + rshift = right._poly * CG[left._poly.degree() * realngens] return FreeAlgebraElement_letterplace(A,left._poly*rshift, check=False) def __pow__(FreeAlgebraElement_letterplace self, int n, k): @@ -629,8 +632,9 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement): q = p = self._poly realngens = A._commutative_ring.ngens() cdef int i + CG = CyclicPermutationGroup(A._current_ring.ngens()) for i from 0 = QQ[] - sage: f = a*b + c - sage: f._cycle(-1), f._cycle(0), f._cycle(1) - (a*d + b, a*b + c, b*c + d) - """ - r = self.parent() - n = n % r.ngens() - olddict = self.dict() - newdict = dict() - for key in olddict: - newkey = key[-n:]+key[:-n] - newdict[newkey] = olddict[key] - return r(newdict) - def degree(self, MPolynomial_libsingular x=None, int std_grading=False): """ Return the degree of this polynomial. From edd946ec0bb9eff72d45b112cba027af42b4b8a2 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sun, 7 Jun 2020 18:51:44 +0200 Subject: [PATCH 13/34] =?UTF-8?q?25993:=20make=20tests=20compatible=20with?= =?UTF-8?q?=20Singular=20=E2=89=A5=204.1.3p1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 2 +- src/sage/rings/polynomial/polynomial_singular_interface.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index ab1879650e4..2eb8f24909f 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -1348,7 +1348,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): sage: R = IntegerModRing(15)['x,y'] sage: singular(R) polynomial ring, over a ring (with zero-divisors), global ordering - // coefficients: ZZ/bigint(15) + // coefficients: ZZ/...(15) // number of vars : 2 // block 1 : ordering dp // : names x y diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py index 74b8b822b16..beee5ad1def 100644 --- a/src/sage/rings/polynomial/polynomial_singular_interface.py +++ b/src/sage/rings/polynomial/polynomial_singular_interface.py @@ -165,7 +165,7 @@ def _singular_(self, singular=singular): sage: R = IntegerModRing(15)['x,y'] sage: singular(R) polynomial ring, over a ring (with zero-divisors), global ordering - // coefficients: ZZ/bigint(15) + // coefficients: ZZ/...(15) // number of vars : 2 // block 1 : ordering dp // : names x y From 3bc9caa3ac50a7831b32c641574bf66d7773da13 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Sun, 5 Jul 2020 15:00:47 +0200 Subject: [PATCH 14/34] 25993: add patch fixing hang in primdecSY and upgrade to 4.1.3p2 --- build/pkgs/singular/checksums.ini | 6 ++-- build/pkgs/singular/package-version.txt | 2 +- .../patches/fix-hang-in-primdec.patch | 28 +++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 build/pkgs/singular/patches/fix-hang-in-primdec.patch diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index 4beac1eb947..7952e1e5055 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=5ffbb82046499ce571769bee62522fea1748ffd4 -md5=e4880d35fbcdb10bb07a73e5ddf8053c -cksum=3533935118 +sha1=3b1f278a47fae3c749c26b745d472471ea1cf7c6 +md5=86f8e3f5791ce859fbb07a0d6d72dd9e +cksum=1289674079 upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-1-3/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index cef1a1bf369..d3a58be4fd8 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.1.3.p0 +4.1.3p2.p0 diff --git a/build/pkgs/singular/patches/fix-hang-in-primdec.patch b/build/pkgs/singular/patches/fix-hang-in-primdec.patch new file mode 100644 index 00000000000..e754e9e16dc --- /dev/null +++ b/build/pkgs/singular/patches/fix-hang-in-primdec.patch @@ -0,0 +1,28 @@ +from https://github.com/Singular/Singular/commit/0d015456.patch + +From 0d01545670bb6a3fa6190c1d2d50ba0984746eff Mon Sep 17 00:00:00 2001 +From: Hans Schoenemann +Date: Mon, 8 Jun 2020 13:21:28 +0200 +Subject: [PATCH] Revert "opt: use resultantFp" + +This reverts commit 517ffa70e651cf45ae68e0c02434f13e622fc87f. +--- + factory/facAlgFunc.cc | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/factory/facAlgFunc.cc b/factory/facAlgFunc.cc +index a442f6a31f..6d745556fc 100644 +--- a/factory/facAlgFunc.cc ++++ b/factory/facAlgFunc.cc +@@ -192,10 +192,8 @@ resultante (const CanonicalForm & f, const CanonicalForm& g, const Variable & v) + if (getCharacteristic() == 0) + result= resultantZ (fz, gz,v); + else +- result= resultantFp (fz,gz,v); +-#else +- result= resultant (fz,gz,v); + #endif ++ result= resultant (fz,gz,v); + + return result; + } From e0748b6d61ac6e3e48c081c6bcf9822fa4c3cf01 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 6 Jul 2020 11:04:58 -0700 Subject: [PATCH 15/34] build/pkgs/singular: Remove python dependency, configure --without-python (singular only supports python2) --- build/pkgs/singular/dependencies | 2 +- build/pkgs/singular/spkg-install.in | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/pkgs/singular/dependencies b/build/pkgs/singular/dependencies index 1f27ce1b707..01af3373fa6 100644 --- a/build/pkgs/singular/dependencies +++ b/build/pkgs/singular/dependencies @@ -1,4 +1,4 @@ -$(MP_LIBRARY) $(PYTHON) ntl flint readline mpfr cddlib +$(MP_LIBRARY) ntl flint readline mpfr cddlib ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index 75306d57805..b9359d999fe 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -85,7 +85,8 @@ config() --enable-factory \ --disable-doc \ --disable-polymake \ - --with-python=sage-python23 \ + --without-python \ + --disable-python \ $SINGULAR_CONFIGURE } From 7206432db68f6a1e7e5500586a0ae140fe911e97 Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Sat, 19 Dec 2020 11:30:58 +0100 Subject: [PATCH 16/34] Update singular to 4.2.0p0 --- build/pkgs/singular/checksums.ini | 8 +++--- build/pkgs/singular/package-version.txt | 2 +- .../patches/fix-hang-in-primdec.patch | 28 ------------------- 3 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 build/pkgs/singular/patches/fix-hang-in-primdec.patch diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index 7952e1e5055..9c6990e3536 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=3b1f278a47fae3c749c26b745d472471ea1cf7c6 -md5=86f8e3f5791ce859fbb07a0d6d72dd9e -cksum=1289674079 -upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-1-3/singular-VERSION.tar.gz +sha1=95b5930125a097089e22c07884159e99facc7acb +md5=5d18fcfcd078f4876c5d0e2637c5f334 +cksum=3775772497 +upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-2-0/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index d3a58be4fd8..4e849c9e97d 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.1.3p2.p0 +4.2.0p0 diff --git a/build/pkgs/singular/patches/fix-hang-in-primdec.patch b/build/pkgs/singular/patches/fix-hang-in-primdec.patch deleted file mode 100644 index e754e9e16dc..00000000000 --- a/build/pkgs/singular/patches/fix-hang-in-primdec.patch +++ /dev/null @@ -1,28 +0,0 @@ -from https://github.com/Singular/Singular/commit/0d015456.patch - -From 0d01545670bb6a3fa6190c1d2d50ba0984746eff Mon Sep 17 00:00:00 2001 -From: Hans Schoenemann -Date: Mon, 8 Jun 2020 13:21:28 +0200 -Subject: [PATCH] Revert "opt: use resultantFp" - -This reverts commit 517ffa70e651cf45ae68e0c02434f13e622fc87f. ---- - factory/facAlgFunc.cc | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/factory/facAlgFunc.cc b/factory/facAlgFunc.cc -index a442f6a31f..6d745556fc 100644 ---- a/factory/facAlgFunc.cc -+++ b/factory/facAlgFunc.cc -@@ -192,10 +192,8 @@ resultante (const CanonicalForm & f, const CanonicalForm& g, const Variable & v) - if (getCharacteristic() == 0) - result= resultantZ (fz, gz,v); - else -- result= resultantFp (fz,gz,v); --#else -- result= resultant (fz,gz,v); - #endif -+ result= resultant (fz,gz,v); - - return result; - } From ded1588ed92f4d64f05eeb1c45cb6327d5ef22df Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Sat, 19 Dec 2020 11:32:19 +0100 Subject: [PATCH 17/34] Adapt to library rename poly.lib -> polylib.lib --- src/sage/interfaces/singular.py | 4 +-- src/sage/libs/singular/function.pyx | 2 +- src/sage/rings/ideal.py | 4 +-- .../polynomial/laurent_polynomial_ideal.py | 8 ++--- .../polynomial/multi_polynomial_ideal.py | 32 +++++++++---------- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py index 5ec54bfb15b..1864fd1d379 100644 --- a/src/sage/interfaces/singular.py +++ b/src/sage/interfaces/singular.py @@ -248,7 +248,7 @@ :: - sage: singular.lib('poly.lib') + sage: singular.lib('polylib.lib') sage: singular.ring(32003, '(a,b,c,d,e,f)', 'lp') polynomial ring, over a field, global ordering // coefficients: ZZ/32003 @@ -268,7 +268,7 @@ :: sage: singular.quit() - sage: singular.lib('poly.lib'); R = singular.ring(32003, '(a,b,c,d,e,f)', 'lp') + sage: singular.lib('polylib.lib'); R = singular.ring(32003, '(a,b,c,d,e,f)', 'lp') sage: I = singular.ideal('cyclic(6)') sage: I.groebner() f^48-2554*f^42-15674*f^36+12326*f^30-12326*f^18+15674*f^12+2554*f^6-1, diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx index 26c74d0d7f0..b8a848312ef 100644 --- a/src/sage/libs/singular/function.pyx +++ b/src/sage/libs/singular/function.pyx @@ -938,7 +938,7 @@ cdef class Converter(SageObject): sage: C = Curve((x-y)*(y-z)*(z-x)) sage: I = C.defining_ideal() sage: import sage.libs.singular.function_factory - sage: freerank = sage.libs.singular.function_factory.ff.poly__lib.freerank + sage: freerank = sage.libs.singular.function_factory.ff.polylib__lib.freerank sage: freerank(I, true) [-1, [x^2*y - x*y^2 - x^2*z + y^2*z + x*z^2 - y*z^2]] diff --git a/src/sage/rings/ideal.py b/src/sage/rings/ideal.py index 72548769de0..53076ac62ed 100644 --- a/src/sage/rings/ideal.py +++ b/src/sage/rings/ideal.py @@ -1709,7 +1709,7 @@ def Cyclic(R, n=None, homog=False, singular=None): from sage.interfaces.singular import singular as singular_default singular = singular_default - singular.lib("poly") + singular.lib("polylib") R2 = R.change_ring(RationalField()) R2._singular_().set_ring() @@ -1760,7 +1760,7 @@ def Katsura(R, n=None, homog=False, singular=None): if singular is None: from sage.interfaces.singular import singular as singular_default singular = singular_default - singular.lib("poly") + singular.lib("polylib") R2 = R.change_ring(RationalField()) R2._singular_().set_ring() diff --git a/src/sage/rings/polynomial/laurent_polynomial_ideal.py b/src/sage/rings/polynomial/laurent_polynomial_ideal.py index 886458ff1ed..ec8e83ea805 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ideal.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ideal.py @@ -470,8 +470,8 @@ def associated_primes(self): sage: p = z^2 + 1; q = z^3 + 2 sage: I = P.ideal((p*q^2, y-z^2)) sage: I.associated_primes() - (Ideal (y + 1, z^2 + 1) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) + (Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, + Ideal (y + 1, z^2 + 1) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) """ l = self.polynomial_ideal(saturate=False).associated_primes() l2 = [self.ring().ideal(I.gens(), hint=I) for I in l] @@ -490,8 +490,8 @@ def minimal_associated_primes(self, saturate=False): sage: p = z^2 + 1; q = z^3 + 2 sage: I = P.ideal((p*q^2, y-z^2)) sage: I.minimal_associated_primes() - (Ideal (z^2 + 1, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, - Ideal (z^3 + 2, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) + (Ideal (z^3 + 2, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 + 1, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) """ l = self.polynomial_ideal(saturate=saturate).minimal_associated_primes() l2 = [self.ring().ideal(I.gens(), hint=I) for I in l] diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 5cd58e99ce6..b09123ac5c6 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -711,16 +711,16 @@ def complete_primary_decomposition(self, algorithm="sy"): sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: pd = I.complete_primary_decomposition(); pd - [(Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field), - (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field)] - - sage: I.primary_decomposition_complete(algorithm = 'gtz') [(Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field), - (Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field)] + (Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field)] + + sage: I.primary_decomposition_complete(algorithm = 'gtz') + [(Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field), + (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field)] sage: from functools import reduce sage: reduce(lambda Qi,Qj: Qi.intersection(Qj), [Qi for (Qi,radQi) in pd]) == I @@ -823,8 +823,8 @@ def primary_decomposition(self, algorithm='sy'): sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: pd = I.primary_decomposition(); pd - [Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field] + [Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field] :: @@ -895,8 +895,8 @@ def associated_primes(self, algorithm='sy'): sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: pd = I.associated_primes(); pd - [Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field] + [Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field] ALGORITHM: @@ -1617,10 +1617,8 @@ def minimal_associated_primes(self): sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: I.minimal_associated_primes () - [Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring - in x, y, z over Rational Field, Ideal (z^3 + 2, -z^2 + y) - of Multivariate Polynomial Ring in x, y, z over Rational - Field] + [Ideal (z^3 + 2, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field] ALGORITHM: @@ -2699,7 +2697,7 @@ def hilbert_polynomial(self, algorithm='sage'): return out elif algorithm == 'singular': from sage.libs.singular.function_factory import ff - hilbPoly = ff.poly__lib.hilbPoly + hilbPoly = ff.polylib__lib.hilbPoly hp = hilbPoly(self) t = ZZ['t'].gen() From 8451f2f6ebc71cc78e6e75fc691674e16d401d1b Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Wed, 6 Jan 2021 17:39:49 +0100 Subject: [PATCH 18/34] Update to singular 4.2.0p1 --- build/pkgs/singular/checksums.ini | 6 +++--- build/pkgs/singular/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index 9c6990e3536..ff4ab29cbe0 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=95b5930125a097089e22c07884159e99facc7acb -md5=5d18fcfcd078f4876c5d0e2637c5f334 -cksum=3775772497 +sha1=3f85ab3e099928af4f1a44693ad425e4861d1b21 +md5=cd8ee869421ca225b4c469a0ea74c5ee +cksum=3689677991 upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-2-0/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index 4e849c9e97d..78a1780baf4 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.2.0p0 +4.2.0p1 From efea26253cbe080cb5b77fa4dec1ef7ba2ebdeb9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Feb 2021 14:55:45 -0800 Subject: [PATCH 19/34] build/pkgs/singular/spkg-install.in [CYGWIN]: Use configure options suggested by Hans Schoenemann --- build/pkgs/singular/spkg-install.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index 49d66d23187..9ec8aa80fb1 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -58,6 +58,10 @@ remove_old_version() config() { + if [ "$UNAME" = "CYGWIN" ]; then + SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --with-builtinmodules=gfanlib,syzextra,customstd,interval,subsets,loctriv,gitfan,freealgebra --disable-p-procs-dynamic --enable-p-procs-static" + fi + # configure notes (dates from Singular 3.x, maybe outdated for 4.x): # 1) We really need to add --exec-prefix and --bindir as Singular # uses some weird defaults. From 32f7ba3bbde8acbd46ee6249cd0a80dc78a7efd0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Feb 2021 20:46:23 -0800 Subject: [PATCH 20/34] Do not use --disable-p-procs-dynamic --enable-p-procs-static --- build/pkgs/singular/spkg-install.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index 9ec8aa80fb1..a623157c35f 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -59,7 +59,7 @@ remove_old_version() config() { if [ "$UNAME" = "CYGWIN" ]; then - SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --with-builtinmodules=gfanlib,syzextra,customstd,interval,subsets,loctriv,gitfan,freealgebra --disable-p-procs-dynamic --enable-p-procs-static" + SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --with-builtinmodules=gfanlib,syzextra,customstd,interval,subsets,loctriv,gitfan,freealgebra" fi # configure notes (dates from Singular 3.x, maybe outdated for 4.x): From 05ed3430da3abe7af43409685240606c19855c35 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 19 Feb 2021 15:29:04 -0800 Subject: [PATCH 21/34] build/pkgs/pysingular: Update to 0.9.7, add upstream_url --- build/pkgs/pysingular/checksums.ini | 7 ++++--- build/pkgs/pysingular/package-version.txt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/pkgs/pysingular/checksums.ini b/build/pkgs/pysingular/checksums.ini index da367b69484..eedd093dcdd 100644 --- a/build/pkgs/pysingular/checksums.ini +++ b/build/pkgs/pysingular/checksums.ini @@ -1,4 +1,5 @@ tarball=PySingular-VERSION.tar.gz -sha1=760ccdd20c869c5a874100df02e9031fc0c6157a -md5=f2698b633915199fc27c9772e4688754 -cksum=1655432975 +sha1=c8d4bbe4552490aac37afe6d87a2cd3a7b445a7e +md5=84a8639d33a5b03637a7ca3ea322b085 +cksum=822399760 +upstream_url=https://pypi.io/packages/source/p/pysingular/PySingular-VERSION.tar.gz diff --git a/build/pkgs/pysingular/package-version.txt b/build/pkgs/pysingular/package-version.txt index b0bb878545d..c81aa44afbf 100644 --- a/build/pkgs/pysingular/package-version.txt +++ b/build/pkgs/pysingular/package-version.txt @@ -1 +1 @@ -0.9.5 +0.9.7 From 16ae9803110ae673a5be4eebfc710eada30e097f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 22 Feb 2021 08:31:11 -0800 Subject: [PATCH 22/34] build/pkgs/singular/spkg-install.in [CYGWIN]: New set of configure flags from Hans Schoenemann --- build/pkgs/singular/spkg-install.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index a623157c35f..80ba2bc3e63 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -59,7 +59,8 @@ remove_old_version() config() { if [ "$UNAME" = "CYGWIN" ]; then - SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --with-builtinmodules=gfanlib,syzextra,customstd,interval,subsets,loctriv,gitfan,freealgebra" + # from Hans Schoenemann - https://github.com/Singular/Singular/issues/1017 + SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --disable-static --disable-p-procs-dynamic --enable-p-procs-static --with-builtinmodules=gfanlib,gitfan,interval,loctriv,partialgb,syzextra,customstd,cohomo,subsets,freealgebra,systhreads --disable-cf-inline" fi # configure notes (dates from Singular 3.x, maybe outdated for 4.x): @@ -80,6 +81,7 @@ config() --disable-doc \ --disable-polymake \ --without-python \ + --without-pythonmodule \ --disable-python \ $SINGULAR_CONFIGURE } From 075b225349c2a12dcbe236191fea3be52e3eac90 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 22 Feb 2021 09:48:52 -0800 Subject: [PATCH 23/34] build/pkgs/singular/spkg-install.in: Use make -j1 to work around makefile parallelization bugs in Singular spielwiese HEAD --- build/pkgs/singular/spkg-install.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index 80ba2bc3e63..5f2e5eb8c57 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -89,7 +89,7 @@ config() build_singular() { - sdh_make + sdh_make -j1 sdh_make_install } From eedcd5fe4b056ee0109fced2f5edfe8616bfb8de Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 26 Feb 2021 13:22:31 -0800 Subject: [PATCH 24/34] build/pkgs/singular: Use singular from spielwiese HEAD + Sage PR --- build/pkgs/singular/checksums.ini | 8 ++++---- build/pkgs/singular/package-version.txt | 2 +- build/pkgs/singular/spkg-install.in | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index ff4ab29cbe0..840dfdcfa5a 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=3f85ab3e099928af4f1a44693ad425e4861d1b21 -md5=cd8ee869421ca225b4c469a0ea74c5ee -cksum=3689677991 -upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-2-0/singular-VERSION.tar.gz +sha1=5bb478b4c4e390218005faae9e4746868dccc432 +md5=a548e0d68e57c38b50c09617e09652ce +cksum=1519525518 +upstream_url=https://trac.sagemath.org/raw-attachment/ticket/25993/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index 78a1780baf4..b99addff994 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.2.0p1 +4.2.0p1+spielwiese-2021-02-26+sage diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index 5f2e5eb8c57..b378d5b3ab9 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -60,7 +60,7 @@ config() { if [ "$UNAME" = "CYGWIN" ]; then # from Hans Schoenemann - https://github.com/Singular/Singular/issues/1017 - SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --disable-static --disable-p-procs-dynamic --enable-p-procs-static --with-builtinmodules=gfanlib,gitfan,interval,loctriv,partialgb,syzextra,customstd,cohomo,subsets,freealgebra,systhreads --disable-cf-inline" + SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --disable-static --disable-p-procs-dynamic --enable-p-procs-static --with-builtinmodules=gfanlib,gitfan,interval,loctriv,partialgb,syzextra,customstd,cohomo,subsets,freealgebra,systhreads --disable-cf-inline --disable-Order-module --disable-bigintm-module --disable-pyobject-module" fi # configure notes (dates from Singular 3.x, maybe outdated for 4.x): @@ -83,6 +83,8 @@ config() --without-python \ --without-pythonmodule \ --disable-python \ + --disable-python_module \ + --disable-python-module \ $SINGULAR_CONFIGURE } From 935d1bd23dfa911ced0a5059a9f8ee5801d035dc Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Feb 2021 12:26:45 -0800 Subject: [PATCH 25/34] build/pkgs/singular: Use 4.2.0p1+spielwiese-2021-02-28+sage --- build/pkgs/singular/checksums.ini | 6 +++--- build/pkgs/singular/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index 840dfdcfa5a..e340b10e449 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=5bb478b4c4e390218005faae9e4746868dccc432 -md5=a548e0d68e57c38b50c09617e09652ce -cksum=1519525518 +sha1=72f5527e8e8233fa7f8c4c8db5e2115cca45a071 +md5=e7c176fc7db9878c7f81b63d3c3174e7 +cksum=4093028295 upstream_url=https://trac.sagemath.org/raw-attachment/ticket/25993/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index b99addff994..eb01eb9429e 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.2.0p1+spielwiese-2021-02-26+sage +4.2.0p1+spielwiese-2021-02-28+sage From 09b7174e21c10fe340f7e48be7e3d65a31c08aaf Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 7 Mar 2021 15:33:47 -0800 Subject: [PATCH 26/34] build/pkgs/singular: Use 4.2.0p1+2021-03-05+sage --- build/pkgs/singular/checksums.ini | 6 +++--- build/pkgs/singular/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index e340b10e449..d8ef64df2e3 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=72f5527e8e8233fa7f8c4c8db5e2115cca45a071 -md5=e7c176fc7db9878c7f81b63d3c3174e7 -cksum=4093028295 +sha1=98d1b206dfce1eacc0610a35b5850ff4c52c8c38 +md5=bffb1ac230bad2f34578cdbc2f915f0c +cksum=72430926 upstream_url=https://trac.sagemath.org/raw-attachment/ticket/25993/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index eb01eb9429e..79d91ce4b25 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.2.0p1+spielwiese-2021-02-28+sage +4.2.0p1+2021-03-05+sage From 5639440ee1eb5d970390954dd5af159fd7bf4f9a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 9 Mar 2021 12:10:00 -0800 Subject: [PATCH 27/34] src/sage/rings/polynomial/laurent_polynomial_ideal.py: Use sorted() to make doctests more stable --- src/sage/rings/polynomial/laurent_polynomial_ideal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/polynomial/laurent_polynomial_ideal.py b/src/sage/rings/polynomial/laurent_polynomial_ideal.py index ec8e83ea805..da10f1f210f 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ideal.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ideal.py @@ -469,7 +469,7 @@ def associated_primes(self): sage: P. = LaurentPolynomialRing(QQ, 3) sage: p = z^2 + 1; q = z^3 + 2 sage: I = P.ideal((p*q^2, y-z^2)) - sage: I.associated_primes() + sage: tuple(sorted(I.associated_primes())) (Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, Ideal (y + 1, z^2 + 1) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) """ @@ -489,7 +489,7 @@ def minimal_associated_primes(self, saturate=False): sage: P. = LaurentPolynomialRing(QQ, 3) sage: p = z^2 + 1; q = z^3 + 2 sage: I = P.ideal((p*q^2, y-z^2)) - sage: I.minimal_associated_primes() + sage: tuple(sorted(I.minimal_associated_primes())) (Ideal (z^3 + 2, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) """ From 797bacd52216c35799393c66c7b6179e73e1bf94 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 9 Mar 2021 12:17:30 -0800 Subject: [PATCH 28/34] src/sage/rings/polynomial/multi_polynomial_ideal.py: Use sorted() to make doctests more stable --- src/sage/rings/polynomial/multi_polynomial_ideal.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 8e76b063137..42d580ccc74 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -710,13 +710,13 @@ def complete_primary_decomposition(self, algorithm="sy"): sage: R. = PolynomialRing(QQ, 3, order='lex') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: pd = I.complete_primary_decomposition(); pd + sage: pd = I.complete_primary_decomposition(); sorted(pd) [(Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field), (Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field)] - sage: I.primary_decomposition_complete(algorithm = 'gtz') + sage: pdc = I.primary_decomposition_complete(algorithm = 'gtz'); sorted(pdc) [(Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field), (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, @@ -822,7 +822,7 @@ def primary_decomposition(self, algorithm='sy'): sage: R. = PolynomialRing(QQ, 3, order='lex') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: pd = I.primary_decomposition(); pd + sage: pd = I.primary_decomposition(); sorted(pd) [Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field] @@ -894,7 +894,7 @@ def associated_primes(self, algorithm='sy'): sage: R. = PolynomialRing(QQ, 3, order='lex') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: pd = I.associated_primes(); pd + sage: pd = I.associated_primes(); sorted(pd) [Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field] @@ -1616,7 +1616,7 @@ def minimal_associated_primes(self): sage: R. = PolynomialRing(QQ, 3, 'xyz') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: I.minimal_associated_primes () + sage: sorted(I.minimal_associated_primes()) [Ideal (z^3 + 2, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field] From 31fe1eb9954477a83638c76c4dd8053d7bb137d9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 11 Mar 2021 20:18:54 -0800 Subject: [PATCH 29/34] build/pkgs/singular/spkg-install.in: Build the documentation if the Singular tarball does not contain it --- build/pkgs/singular/spkg-install.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index b378d5b3ab9..6d0a3d479a1 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -93,6 +93,11 @@ build_singular() { sdh_make -j1 sdh_make_install + + # Singular tarballs made using "make dist" do not contain built documentation. + if [ ! -e doc/doc.tbz2 ]; then + (cd doc && make singular.hlp && sdh_install singular.hlp "$SAGE_SHARE/info/") || sdh_die "Building documentation failed" + fi } From 49de2ff4a4f41676df6a54aae99ed4d9d8e78d54 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Mar 2021 12:05:05 -0700 Subject: [PATCH 30/34] build/pkgs/singular: Use 4.2.0p1+2021-03-13+sage --- build/pkgs/singular/checksums.ini | 6 +++--- build/pkgs/singular/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini index d8ef64df2e3..b9f442b8f4a 100644 --- a/build/pkgs/singular/checksums.ini +++ b/build/pkgs/singular/checksums.ini @@ -1,5 +1,5 @@ tarball=singular-VERSION.tar.gz -sha1=98d1b206dfce1eacc0610a35b5850ff4c52c8c38 -md5=bffb1ac230bad2f34578cdbc2f915f0c -cksum=72430926 +sha1=eeb0b250e481e710daea45c2f78ccff9b84e6f15 +md5=88c4500c2d6ac3eb9b112111fc9404ad +cksum=3131197750 upstream_url=https://trac.sagemath.org/raw-attachment/ticket/25993/singular-VERSION.tar.gz diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt index 79d91ce4b25..f3faa815f96 100644 --- a/build/pkgs/singular/package-version.txt +++ b/build/pkgs/singular/package-version.txt @@ -1 +1 @@ -4.2.0p1+2021-03-05+sage +4.2.0p1+2021-03-13+sage From f816f077ac20a61b643a0448853a4bcab5da3965 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Mar 2021 14:01:39 -0700 Subject: [PATCH 31/34] build/pkgs/singular/spkg-install.in: Use --disable-static on all platforms --- build/pkgs/singular/spkg-install.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index 6d0a3d479a1..1eac79ac441 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -60,7 +60,7 @@ config() { if [ "$UNAME" = "CYGWIN" ]; then # from Hans Schoenemann - https://github.com/Singular/Singular/issues/1017 - SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --disable-static --disable-p-procs-dynamic --enable-p-procs-static --with-builtinmodules=gfanlib,gitfan,interval,loctriv,partialgb,syzextra,customstd,cohomo,subsets,freealgebra,systhreads --disable-cf-inline --disable-Order-module --disable-bigintm-module --disable-pyobject-module" + SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --disable-p-procs-dynamic --enable-p-procs-static --with-builtinmodules=gfanlib,gitfan,interval,loctriv,partialgb,syzextra,customstd,cohomo,subsets,freealgebra,systhreads --disable-cf-inline --disable-Order-module --disable-bigintm-module --disable-pyobject-module" fi # configure notes (dates from Singular 3.x, maybe outdated for 4.x): @@ -85,6 +85,7 @@ config() --disable-python \ --disable-python_module \ --disable-python-module \ + --disable-static \ $SINGULAR_CONFIGURE } From b0d77488c3486d26300381903da28435cbbde868 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Mar 2021 14:02:04 -0700 Subject: [PATCH 32/34] build/pkgs/singular/spkg-install.in: Build subdirs in parallel --- build/pkgs/singular/spkg-install.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index 1eac79ac441..baec6f12db6 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -92,6 +92,10 @@ config() build_singular() { + for subdir in omalloc gfanlib resources omalloc factory libpolys gfanlib IntegerProgramming; do + sdh_make -w -C $subdir + done + # Possible parallelization bugs in subdirectory Singular sdh_make -j1 sdh_make_install From c33ca2ba67ee980cb9ee844ca401e2c9fa2f052c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Mar 2021 14:22:21 -0700 Subject: [PATCH 33/34] src/sage/rings/polynomial/{laurent,multi}_polynomial_ideal: Use sorted(..., key=str) to make doctests stable --- .../polynomial/laurent_polynomial_ideal.py | 12 ++++---- .../polynomial/multi_polynomial_ideal.py | 30 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/sage/rings/polynomial/laurent_polynomial_ideal.py b/src/sage/rings/polynomial/laurent_polynomial_ideal.py index da10f1f210f..525f20302ea 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ideal.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ideal.py @@ -469,9 +469,9 @@ def associated_primes(self): sage: P. = LaurentPolynomialRing(QQ, 3) sage: p = z^2 + 1; q = z^3 + 2 sage: I = P.ideal((p*q^2, y-z^2)) - sage: tuple(sorted(I.associated_primes())) - (Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, - Ideal (y + 1, z^2 + 1) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) + sage: tuple(sorted(I.associated_primes(), key=str)) + (Ideal (y + 1, z^2 + 1) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) """ l = self.polynomial_ideal(saturate=False).associated_primes() l2 = [self.ring().ideal(I.gens(), hint=I) for I in l] @@ -489,9 +489,9 @@ def minimal_associated_primes(self, saturate=False): sage: P. = LaurentPolynomialRing(QQ, 3) sage: p = z^2 + 1; q = z^3 + 2 sage: I = P.ideal((p*q^2, y-z^2)) - sage: tuple(sorted(I.minimal_associated_primes())) - (Ideal (z^3 + 2, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 + 1, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) + sage: tuple(sorted(I.minimal_associated_primes(), key=str)) + (Ideal (z^2 + 1, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field, + Ideal (z^3 + 2, -z^2 + y) of Multivariate Laurent Polynomial Ring in x, y, z over Rational Field) """ l = self.polynomial_ideal(saturate=saturate).minimal_associated_primes() l2 = [self.ring().ideal(I.gens(), hint=I) for I in l] diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 42d580ccc74..47270760a2b 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -710,13 +710,13 @@ def complete_primary_decomposition(self, algorithm="sy"): sage: R. = PolynomialRing(QQ, 3, order='lex') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: pd = I.complete_primary_decomposition(); sorted(pd) - [(Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field), - (Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field)] + sage: pd = I.complete_primary_decomposition(); sorted(pd, key=str) + [(Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field), + (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field)] - sage: pdc = I.primary_decomposition_complete(algorithm = 'gtz'); sorted(pdc) + sage: pdc = I.primary_decomposition_complete(algorithm = 'gtz'); sorted(pdc, key=str) [(Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field), (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, @@ -822,9 +822,9 @@ def primary_decomposition(self, algorithm='sy'): sage: R. = PolynomialRing(QQ, 3, order='lex') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: pd = I.primary_decomposition(); sorted(pd) - [Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field] + sage: pd = I.primary_decomposition(); sorted(pd, key=str) + [Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field] :: @@ -894,9 +894,9 @@ def associated_primes(self, algorithm='sy'): sage: R. = PolynomialRing(QQ, 3, order='lex') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: pd = I.associated_primes(); sorted(pd) - [Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field] + sage: pd = I.associated_primes(); sorted(pd, key=str) + [Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field] ALGORITHM: @@ -1616,9 +1616,9 @@ def minimal_associated_primes(self): sage: R. = PolynomialRing(QQ, 3, 'xyz') sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R - sage: sorted(I.minimal_associated_primes()) - [Ideal (z^3 + 2, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field, - Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field] + sage: sorted(I.minimal_associated_primes(), key=str) + [Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field, + Ideal (z^3 + 2, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field] ALGORITHM: From ec471e0c792a7540e9777b33fb37be2e1a2f1267 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 17 Mar 2021 00:39:04 -0700 Subject: [PATCH 34/34] build/pkgs/singular/SPKG.rst: Add link to branch --- build/pkgs/singular/SPKG.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/pkgs/singular/SPKG.rst b/build/pkgs/singular/SPKG.rst index f71f98d49b4..b754451aac7 100644 --- a/build/pkgs/singular/SPKG.rst +++ b/build/pkgs/singular/SPKG.rst @@ -35,7 +35,8 @@ Dependencies Special Update/Build Instructions --------------------------------- -See spkg-src to create the source tarball. +The current upstream tarball is made from the branch at +https://github.com/mkoeppe/Singular/tree/Release-4-2-0-p1%2Bsage Other notes: