[arch-commits] Commit in sagemath/trunk (3 files)

Antonio Rojas arojas at archlinux.org
Sat Dec 19 10:42:44 UTC 2020


    Date: Saturday, December 19, 2020 @ 10:42:43
  Author: arojas
Revision: 779936

Port to singular 4.2 library names

Added:
  sagemath/trunk/sagemath-singular-4.2.patch
    (from rev 779935, sagemath/trunk/sagemath-singular-4.1.2.patch)
Modified:
  sagemath/trunk/PKGBUILD
Deleted:
  sagemath/trunk/sagemath-singular-4.1.2.patch

-------------------------------+
 PKGBUILD                      |   16 
 sagemath-singular-4.1.2.patch |  759 ---------------------------------
 sagemath-singular-4.2.patch   |  915 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 921 insertions(+), 769 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-12-19 10:42:11 UTC (rev 779935)
+++ PKGBUILD	2020-12-19 10:42:43 UTC (rev 779936)
@@ -8,7 +8,7 @@
 pkgbase=sagemath
 pkgname=(sagemath sagemath-jupyter)
 pkgver=9.2
-pkgrel=8
+pkgrel=9
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(x86_64)
 url="http://www.sagemath.org"
@@ -39,7 +39,7 @@
         latte-count.patch
         test-optional.patch
         sagemath-cremona.patch
-        sagemath-singular-4.1.2.patch
+        sagemath-singular-4.2.patch
         sagemath-gap-4.11.patch
         sagemath-flint-2.6.patch
         sagemath-cypari-2.1.2.patch
@@ -50,7 +50,7 @@
             'af922e1f978821a9a1f6c9a56130d71e5011c84a7aee7bf66a591bee658af30b'
             '7da0dbcda15a327c21dc33853cb8f98cb86a283139f8735e3b20a71d49458a88'
             '937074fa7a8a4e2aba9ea77ec622fe937985a1a9176c48460d51325ee877a4f5'
-            '881186d016a6eb47b919765b9d4e6abc4560fce54e08cf42bd948ba77e16aa85'
+            'a15446a96f2f6ddc0be37c768cbb4695e1efe6630a3479c625f4ef631aface3b'
             '34f06f9776f84f6998b1350555316e0ffea76ed16e149916970f19ef750a467f'
             '5d00b24c1d36b41b8ea3f07b93fc0e00b42dd84d9bc4e9b3d26e5f2cfeba6405'
             'dc507eeb75eae1109273879771b4eb56172b7417e87a0693381106afd7554e04'
@@ -65,8 +65,8 @@
 # Upstream patches
 # use Features to detect Cremona databases https://trac.sagemath.org/ticket/25825
   patch -p1 -i ../sagemath-cremona.patch
-# Fixes for singular 4.1.2 https://trac.sagemath.org/ticket/25993
-  patch -p1 -i ../sagemath-singular-4.1.2.patch
+# Fixes for singular 4.2 https://trac.sagemath.org/ticket/25993
+  patch -p1 -i ../sagemath-singular-4.2.patch
 # Fix segfault and tests with flint 2.6 https://trac.sagemath.org/ticket/29719
   patch -p1 -i ../sagemath-flint-2.6.patch
 # Fix gap.version() and doctests with GAP 4.11 https://trac.sagemath.org/ticket/29314
@@ -106,12 +106,8 @@
 
   python setup.py install --root="$pkgdir" --optimize=1
 
-  _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
 # Remove sage_setup
-  rm -r "$pkgdir"/$_pythonpath/sage_setup
-# Install tests
-  cp -r sage/doctest/tests "$pkgdir"/$_pythonpath/sage/doctest
-  cp -r sage/tests/books "$pkgdir"/$_pythonpath/sage/tests
+  rm -r "$pkgdir"/usr/lib/python*/site-packages/sage_setup
 
 # Split jupyter kernel
   rm -r "$pkgdir"/usr/share

Deleted: sagemath-singular-4.1.2.patch
===================================================================
--- sagemath-singular-4.1.2.patch	2020-12-19 10:42:11 UTC (rev 779935)
+++ sagemath-singular-4.1.2.patch	2020-12-19 10:42:43 UTC (rev 779936)
@@ -1,759 +0,0 @@
-diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst
-index a312548..d1c9c95 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)
-@@ -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/sage/algebras/free_algebra.py b/src/sage/algebras/free_algebra.py
-index 7391dd9..7234f91 100644
---- a/src/sage/algebras/free_algebra.py
-+++ b/src/sage/algebras/free_algebra.py
-@@ -39,7 +39,15 @@ two-sided ideals, and thus provide ideal containment tests::
-     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
- 
-@@ -233,7 +241,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):
-         """
-@@ -264,6 +272,8 @@ class FreeAlgebraFactory(UniqueFactory):
-             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:
-@@ -274,7 +284,7 @@ class FreeAlgebraFactory(UniqueFactory):
-             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_element_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx
-index ad863ea..d6127c9 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.repr import repr_lincomb
- from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal
-@@ -25,7 +26,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
-@@ -445,9 +445,10 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement):
-         cdef int i
-         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 = singular_system("stest",s_poly,1,
--                                     A._degbound,A.__ngens,ring=P)
-+            s_poly = s_poly * CG[realngens]
-             if P.monomial_divides(s_poly,p_poly):
-                 return True
-         return False
-@@ -601,7 +602,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)
-+        realngens = A._commutative_ring.ngens()
-+        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):
-@@ -627,10 +630,11 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement):
-         self._poly = A._current_ring(self._poly)
-         cdef int d = self._poly.degree()
-         q = p = self._poly
-+        realngens = A._commutative_ring.ngens()
-         cdef int i
-+        CG = CyclicPermutationGroup(A._current_ring.ngens())
-         for i from 0<i<n:
--            q = singular_system("stest",q,d,A._degbound,A.__ngens,
--                                     ring=A._current_ring)
-+            q = q * CG[d * realngens]
-             p *= q
-         return FreeAlgebraElement_letterplace(A, p, check=False)
- 
-diff --git a/src/sage/algebras/letterplace/free_algebra_letterplace.pxd b/src/sage/algebras/letterplace/free_algebra_letterplace.pxd
-index 7e5f2bb..d1d162c 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 a9d09ad..714284e 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,15 +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")
--singular_system=singular_function("system")
-+freeAlgebra = singular_function("freeAlgebra")
- 
- # unfortunately we can not set Singular attributes for MPolynomialRing_libsingular
- # Hence, we must constantly work around Letterplace's sanity checks,
-@@ -242,7 +257,7 @@ cdef class FreeAlgebra_letterplace(Algebra):
-             sage: F.<a,b,c> = 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:
-@@ -260,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))
-@@ -666,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")
-@@ -682,8 +699,10 @@ cdef class FreeAlgebra_letterplace(Algebra):
-         ngens = self.__ngens
-         degbound = self._degbound
-         cdef list G = [C(x._poly) for x in g]
-+        from sage.groups.perm_gps.all import CyclicPermutationGroup
-+        CG = CyclicPermutationGroup(C.ngens())
-         for y in G:
--            out.extend([y]+[singular_system("stest",y,n+1,degbound,ngens,ring=C) for n in xrange(d-y.degree())])
-+            out.extend([y]+[y * CG[ngens*(n+1)] for n in xrange(d-y.degree())])
-         return C.ideal(out)
- 
-     ###########################
-@@ -879,3 +898,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 d7214d1..5b8cf48 100644
---- a/src/sage/algebras/letterplace/letterplace_ideal.pyx
-+++ b/src/sage/algebras/letterplace/letterplace_ideal.pyx
-@@ -18,7 +18,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
-@@ -42,14 +46,14 @@ 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
- 
- #####################
- # Define some singular functions
- lib("freegb.lib")
--singular_system=singular_function("system")
-+singular_twostd=singular_function("twostd")
- poly_reduce=singular_function("NF")
- 
- class LetterplaceIdeal(Ideal_nc):
-@@ -69,14 +73,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::
- 
-@@ -116,8 +128,11 @@ class LetterplaceIdeal(Ideal_nc):
-         sage: F.<x,y,z> = 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 -
-@@ -135,10 +150,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::
-@@ -226,7 +238,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)
-@@ -238,7 +258,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
-@@ -276,9 +303,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_system("freegb",P.ideal([x._poly for x in self.__GB.gens()]),
--                               degbound,A.__ngens, 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/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 51f4113..ba42ed1 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -746,7 +746,7 @@ class HeckeAlgebraRepresentation(WithEqualityById, SageObject):
-              -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 3537772..ee8ddec 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]-om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 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^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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 e664e21..cc525b4 100644
---- a/src/sage/combinat/sf/macdonald.py
-+++ b/src/sage/combinat/sf/macdonald.py
-@@ -483,7 +483,7 @@ class Macdonald(UniqueRepresentation):
-             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]
-         """
-@@ -901,7 +901,7 @@ class MacdonaldPolynomials_generic(sfa.SymmetricFunctionAlgebra_generic):
-             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 88a33b0..a7cf5ea 100644
---- a/src/sage/interfaces/singular.py
-+++ b/src/sage/interfaces/singular.py
-@@ -191,13 +191,21 @@ The 1x1 and 2x2 minors::
-     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/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
-index 0fea70a..26c74d0 100644
---- a/src/sage/libs/singular/function.pyx
-+++ b/src/sage/libs/singular/function.pyx
-@@ -1257,7 +1257,7 @@ cdef class SingularFunction(SageObject):
-             Traceback (most recent call last):
-             ...
-             RuntimeError: error in Singular function call 'size':
--            Wrong number of arguments (got 2 arguments, arity code is 300)
-+            Wrong number of arguments (got 2 arguments, arity code is 302)
-             sage: size('foobar', ring=P)
-             6
- 
-@@ -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`::
- 
-@@ -1671,17 +1671,17 @@ def singular_function(name):
-         Traceback (most recent call last):
-         ...
-         RuntimeError: error in Singular function call 'factorize':
--        Wrong number of arguments (got 0 arguments, arity code is 303)
-+        Wrong number of arguments (got 0 arguments, arity code is 305)
-         sage: factorize(f, 1, 2)
-         Traceback (most recent call last):
-         ...
-         RuntimeError: error in Singular function call 'factorize':
--        Wrong number of arguments (got 3 arguments, arity code is 303)
-+        Wrong number of arguments (got 3 arguments, arity code is 305)
-         sage: factorize(f, 1, 2, 3)
-         Traceback (most recent call last):
-         ...
-         RuntimeError: error in Singular function call 'factorize':
--        Wrong number of arguments (got 4 arguments, arity code is 303)
-+        Wrong number of arguments (got 4 arguments, arity code is 305)
- 
-     The Singular function ``list`` can be called with any number of
-     arguments::
-diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
-index 8b9367e..ef04d4f 100644
---- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
-+++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
-@@ -1579,7 +1579,7 @@ class FractionWithFactoredDenominator(RingElement):
-             (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)
-@@ -1613,7 +1613,7 @@ class FractionWithFactoredDenominator(RingElement):
-             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}
-diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py
-index d86833f..3742439 100644
---- a/src/sage/rings/polynomial/multi_polynomial_element.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_element.py
-@@ -2231,7 +2231,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 f025b3a..94e130d 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -154,7 +154,7 @@ when the system has no solutions over the rationals.
-     which is not 1. ::
- 
-         sage: I.groebner_basis()
--        [x + 130433*y + 59079*z, y^2 + 3*y + 17220, y*z + 5*y + 14504, 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878]
-+        [x + y + 57119*z + 4, y^2 + 3*y + 17220, y*z + y + 26532, 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878]
- 
-     Now for each prime `p` dividing this integer 164878, the Groebner
-     basis of I modulo `p` will be non-trivial and will thus give a
-@@ -1567,8 +1567,8 @@ class MPolynomialIdeal_singular_repr(
-             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::
- 
-@@ -4008,7 +4008,7 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \
- 
-             sage: J.groebner_basis.set_cache(gb)
-             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::
-@@ -4111,9 +4111,9 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \
-             sage: P.<a,b,c> = 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 1758424..553d22d 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -1349,7 +1349,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/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index c2792ae..aa2ef59 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -390,28 +390,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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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)
- 
-@@ -2886,7 +2888,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)
-diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
-index 74b8b82..beee5ad 100644
---- a/src/sage/rings/polynomial/polynomial_singular_interface.py
-+++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
-@@ -165,7 +165,7 @@ class PolynomialRing_singular_repr:
-             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/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py
-index 1091c29..4f5936e 100644
---- a/src/sage/schemes/curves/projective_curve.py
-+++ b/src/sage/schemes/curves/projective_curve.py
-@@ -2001,7 +2001,7 @@ class ProjectivePlaneCurve_finite_field(ProjectivePlaneCurve_field):
-             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::
- 

Copied: sagemath/trunk/sagemath-singular-4.2.patch (from rev 779935, sagemath/trunk/sagemath-singular-4.1.2.patch)
===================================================================
--- sagemath-singular-4.2.patch	                        (rev 0)
+++ sagemath-singular-4.2.patch	2020-12-19 10:42:43 UTC (rev 779936)
@@ -0,0 +1,915 @@
+diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst
+index a312548..d1c9c95 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)
+@@ -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/sage/algebras/free_algebra.py b/src/sage/algebras/free_algebra.py
+index 7391dd9..7234f91 100644
+--- a/src/sage/algebras/free_algebra.py
++++ b/src/sage/algebras/free_algebra.py
+@@ -39,7 +39,15 @@ two-sided ideals, and thus provide ideal containment tests::
+     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
+ 
+@@ -233,7 +241,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):
+         """
+@@ -264,6 +272,8 @@ class FreeAlgebraFactory(UniqueFactory):
+             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:
+@@ -274,7 +284,7 @@ class FreeAlgebraFactory(UniqueFactory):
+             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_element_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx
+index ad863ea..d6127c9 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.repr import repr_lincomb
+ from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal
+@@ -25,7 +26,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
+@@ -445,9 +445,10 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement):
+         cdef int i
+         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 = singular_system("stest",s_poly,1,
+-                                     A._degbound,A.__ngens,ring=P)
++            s_poly = s_poly * CG[realngens]
+             if P.monomial_divides(s_poly,p_poly):
+                 return True
+         return False
+@@ -601,7 +602,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)
++        realngens = A._commutative_ring.ngens()
++        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):
+@@ -627,10 +630,11 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement):
+         self._poly = A._current_ring(self._poly)
+         cdef int d = self._poly.degree()
+         q = p = self._poly
++        realngens = A._commutative_ring.ngens()
+         cdef int i
++        CG = CyclicPermutationGroup(A._current_ring.ngens())
+         for i from 0<i<n:
+-            q = singular_system("stest",q,d,A._degbound,A.__ngens,
+-                                     ring=A._current_ring)
++            q = q * CG[d * realngens]
+             p *= q
+         return FreeAlgebraElement_letterplace(A, p, check=False)
+ 
+diff --git a/src/sage/algebras/letterplace/free_algebra_letterplace.pxd b/src/sage/algebras/letterplace/free_algebra_letterplace.pxd
+index 7e5f2bb..d1d162c 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 a9d09ad..714284e 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,15 +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")
+-singular_system=singular_function("system")
++freeAlgebra = singular_function("freeAlgebra")
+ 
+ # unfortunately we can not set Singular attributes for MPolynomialRing_libsingular
+ # Hence, we must constantly work around Letterplace's sanity checks,
+@@ -242,7 +257,7 @@ cdef class FreeAlgebra_letterplace(Algebra):
+             sage: F.<a,b,c> = 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:
+@@ -260,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))
+@@ -666,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")
+@@ -682,8 +699,10 @@ cdef class FreeAlgebra_letterplace(Algebra):
+         ngens = self.__ngens
+         degbound = self._degbound
+         cdef list G = [C(x._poly) for x in g]
++        from sage.groups.perm_gps.all import CyclicPermutationGroup
++        CG = CyclicPermutationGroup(C.ngens())
+         for y in G:
+-            out.extend([y]+[singular_system("stest",y,n+1,degbound,ngens,ring=C) for n in xrange(d-y.degree())])
++            out.extend([y]+[y * CG[ngens*(n+1)] for n in xrange(d-y.degree())])
+         return C.ideal(out)
+ 
+     ###########################
+@@ -879,3 +898,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 d7214d1..5b8cf48 100644
+--- a/src/sage/algebras/letterplace/letterplace_ideal.pyx
++++ b/src/sage/algebras/letterplace/letterplace_ideal.pyx
+@@ -18,7 +18,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
+@@ -42,14 +46,14 @@ 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
+ 
+ #####################
+ # Define some singular functions
+ lib("freegb.lib")
+-singular_system=singular_function("system")
++singular_twostd=singular_function("twostd")
+ poly_reduce=singular_function("NF")
+ 
+ class LetterplaceIdeal(Ideal_nc):
+@@ -69,14 +73,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::
+ 
+@@ -116,8 +128,11 @@ class LetterplaceIdeal(Ideal_nc):
+         sage: F.<x,y,z> = 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 -
+@@ -135,10 +150,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::
+@@ -226,7 +238,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)
+@@ -238,7 +258,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
+@@ -276,9 +303,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_system("freegb",P.ideal([x._poly for x in self.__GB.gens()]),
+-                               degbound,A.__ngens, 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/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
+index 51f4113..ba42ed1 100644
+--- a/src/sage/combinat/root_system/hecke_algebra_representation.py
++++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
+@@ -746,7 +746,7 @@ class HeckeAlgebraRepresentation(WithEqualityById, SageObject):
+              -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 3537772..ee8ddec 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-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^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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-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 e664e21..cc525b4 100644
+--- a/src/sage/combinat/sf/macdonald.py
++++ b/src/sage/combinat/sf/macdonald.py
+@@ -483,7 +483,7 @@ class Macdonald(UniqueRepresentation):
+             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]
+         """
+@@ -901,7 +901,7 @@ class MacdonaldPolynomials_generic(sfa.SymmetricFunctionAlgebra_generic):
+             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 88a33b0..a7cf5ea 100644
+--- a/src/sage/interfaces/singular.py
++++ b/src/sage/interfaces/singular.py
+@@ -191,13 +191,21 @@ The 1x1 and 2x2 minors::
+     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/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
+index 0fea70a..26c74d0 100644
+--- a/src/sage/libs/singular/function.pyx
++++ b/src/sage/libs/singular/function.pyx
+@@ -1257,7 +1257,7 @@ cdef class SingularFunction(SageObject):
+             Traceback (most recent call last):
+             ...
+             RuntimeError: error in Singular function call 'size':
+-            Wrong number of arguments (got 2 arguments, arity code is 300)
++            Wrong number of arguments (got 2 arguments, arity code is 302)
+             sage: size('foobar', ring=P)
+             6
+ 
+@@ -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`::
+ 
+@@ -1671,17 +1671,17 @@ def singular_function(name):
+         Traceback (most recent call last):
+         ...
+         RuntimeError: error in Singular function call 'factorize':
+-        Wrong number of arguments (got 0 arguments, arity code is 303)
++        Wrong number of arguments (got 0 arguments, arity code is 305)
+         sage: factorize(f, 1, 2)
+         Traceback (most recent call last):
+         ...
+         RuntimeError: error in Singular function call 'factorize':
+-        Wrong number of arguments (got 3 arguments, arity code is 303)
++        Wrong number of arguments (got 3 arguments, arity code is 305)
+         sage: factorize(f, 1, 2, 3)
+         Traceback (most recent call last):
+         ...
+         RuntimeError: error in Singular function call 'factorize':
+-        Wrong number of arguments (got 4 arguments, arity code is 303)
++        Wrong number of arguments (got 4 arguments, arity code is 305)
+ 
+     The Singular function ``list`` can be called with any number of
+     arguments::
+diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+index 8b9367e..ef04d4f 100644
+--- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
++++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+@@ -1579,7 +1579,7 @@ class FractionWithFactoredDenominator(RingElement):
+             (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)
+@@ -1613,7 +1613,7 @@ class FractionWithFactoredDenominator(RingElement):
+             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}
+diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py
+index d86833f..3742439 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_element.py
++++ b/src/sage/rings/polynomial/multi_polynomial_element.py
+@@ -2231,7 +2231,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 f025b3a..94e130d 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+@@ -154,7 +154,7 @@ when the system has no solutions over the rationals.
+     which is not 1. ::
+ 
+         sage: I.groebner_basis()
+-        [x + 130433*y + 59079*z, y^2 + 3*y + 17220, y*z + 5*y + 14504, 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878]
++        [x + y + 57119*z + 4, y^2 + 3*y + 17220, y*z + y + 26532, 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878]
+ 
+     Now for each prime `p` dividing this integer 164878, the Groebner
+     basis of I modulo `p` will be non-trivial and will thus give a
+@@ -1567,8 +1567,8 @@ class MPolynomialIdeal_singular_repr(
+             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::
+ 
+@@ -4008,7 +4008,7 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \
+ 
+             sage: J.groebner_basis.set_cache(gb)
+             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::
+@@ -4111,9 +4111,9 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \
+             sage: P.<a,b,c> = 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 1758424..553d22d 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+@@ -1349,7 +1349,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/plural.pyx b/src/sage/rings/polynomial/plural.pyx
+index c2792ae..aa2ef59 100644
+--- a/src/sage/rings/polynomial/plural.pyx
++++ b/src/sage/rings/polynomial/plural.pyx
+@@ -390,28 +390,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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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.<x,y,z> = 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)
+ 
+@@ -2886,7 +2888,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)
+diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
+index 74b8b82..beee5ad 100644
+--- a/src/sage/rings/polynomial/polynomial_singular_interface.py
++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
+@@ -165,7 +165,7 @@ class PolynomialRing_singular_repr:
+             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/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py
+index 1091c29..4f5936e 100644
+--- a/src/sage/schemes/curves/projective_curve.py
++++ b/src/sage/schemes/curves/projective_curve.py
+@@ -2001,7 +2001,7 @@ class ProjectivePlaneCurve_finite_field(ProjectivePlaneCurve_field):
+             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::
+ 
+diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py
+index 5ec54bfb15..1864fd1d37 100644
+--- a/src/sage/interfaces/singular.py
++++ b/src/sage/interfaces/singular.py
+@@ -248,7 +248,7 @@ Groebner basis for some ideal, using Singular through Sage.
+ 
+ ::
+ 
+-    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 @@ We restart everything and try again, but correctly.
+ ::
+ 
+     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 26c74d0d7f..b8a848312e 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 72548769de..53076ac62e 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 886458ff1e..ec8e83ea80 100644
+--- a/src/sage/rings/polynomial/laurent_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/laurent_polynomial_ideal.py
+@@ -470,8 +470,8 @@ class LaurentPolynomialIdeal( Ideal_generic ):
+             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 @@ class LaurentPolynomialIdeal( Ideal_generic ):
+             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 5cd58e99ce..b09123ac5c 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+@@ -711,16 +711,16 @@ class MPolynomialIdeal_singular_repr(
+             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 @@ class MPolynomialIdeal_singular_repr(
+             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 @@ class MPolynomialIdeal_singular_repr(
+             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 @@ class MPolynomialIdeal_singular_repr(
+             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 @@ class MPolynomialIdeal_singular_repr(
+             return out
+         elif algorithm == 'singular':
+             import sage.libs.singular.function_factory
+-            hilbPoly = sage.libs.singular.function_factory.ff.poly__lib.hilbPoly
++            hilbPoly = sage.libs.singular.function_factory.ff.polylib__lib.hilbPoly
+ 
+             hp = hilbPoly(self)
+             t = ZZ['t'].gen()



More information about the arch-commits mailing list