Skip to content

Commit a6b03dd

Browse files
author
Release Manager
committed
Trac #27508: Force tail reduction in polynomial quotient ring
I'd like to "remove squares" in some polynomials living in a polynomial ring over `QQ`, in 2 variables: `x`,`y`. I tried to implement this by modding out by the ideal `(x^2 - x, y^2 - y)`. Depending on the ordering, the result of `.mod()` does not always output the polynomial I am looking for. Without specifying an ordering, everything seems fine: {{{ #!python sage: R1.<x,y> = PolynomialRing(QQ, 2) sage: I1 = R1.ideal(["x^2 - x", "y^2 - y"]) sage: R1("x^2 + y").mod(I1) x + y sage: R1("x + y^2").mod(I1) x + y }}} However, when specifying the order `lex` the reduction of `x + y^2` is not as expected: {{{ #!python sage: R2.<x,y> = PolynomialRing(QQ, 2, order="lex") sage: I2 = R2.ideal(["x^2 - x", "y^2 - y"]) sage: R2("x^2 + y").mod(I2) x + y sage: R2("x + y^2").mod(I2) x + y^2 }}} This issue was reported in [[https://groups.google.com/forum/#!topic /sage-support/80Scc9pTkPM|sage-support]] where it was pointed out that it is likely a bug in Singular, or in the Singular interface to Sage. In particular, using the order `lex` works when `implementation="generic"` is also specified: {{{ #!python sage: R3.<x,y> = PolynomialRing(QQ, 2, order="lex", implementation="generic") sage: I3 = R3.ideal(["x^2 - x", "y^2 - y"]) sage: R3("x^2 + y").mod(I3) x + y sage: R3("x + y^2").mod(I3) x + y }}} For reference, I am using Sage version 8.6 on macOS Mojave 10.14.3. PS. see also https://groups.google.com/d/msg/sage- devel/K49-V3BbWbg/pxuoehPvAAAJ URL: https://trac.sagemath.org/27508 Reported by: gh-rachelplayer Ticket author(s): Dima Pasechnik Reviewer(s): Markus Wageringel
2 parents eb49937 + 21e4f9a commit a6b03dd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/sage/libs/singular/decl.pxd

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ cdef extern from "singular/Singular/libsingular.h":
334334
bint *pairtest
335335
void *R
336336
int *S_2_R
337+
bint noTailReduction
337338

338339
ctypedef struct data_union:
339340
ring *uring

src/sage/libs/singular/groebner_strategy.pyx

+7
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ cdef class GroebnerStrategy(SageObject):
9393
...
9494
NotImplementedError: Only coefficient fields are implemented so far.
9595
96+
Check that :trac:`27508` is fixed::
97+
98+
sage: R2.<x,y> = PolynomialRing(QQ, 2, order="lex")
99+
sage: I2 = R2.ideal(["x^2 - x", "y^2 - y"])
100+
sage: R2("x^2 + y").mod(I2), R2("x + y^2").mod(I2)
101+
(x + y, x + y)
96102
"""
97103
if not isinstance(L, MPolynomialIdeal):
98104
raise TypeError("First parameter must be a multivariate polynomial ideal.")
@@ -127,6 +133,7 @@ cdef class GroebnerStrategy(SageObject):
127133
self._strat.sl = -1
128134
#- init local data struct
129135
initS(i, NULL, self._strat)
136+
self._strat.noTailReduction = False
130137

131138
cdef int j
132139
cdef bint base_ring_is_field = R.base_ring().is_field()

0 commit comments

Comments
 (0)