Skip to content

Commit b9bd305

Browse files
Release Managervbraun
Release Manager
authored andcommitted
Trac #21884: giacpy_sage doctest failure and new libsingular cf.type == n_unknown ring test
Related to #21860 : one failure in ptestlong : {{{ charpent@asus16-ec:/usr/local/sage-7$ sage -t --long --warn-long 100.3 src/sage/rings/polynomial/multi_polynomial_ideal.py Running doctests with ID 2016-11-17-09-17-43-cce569e2. Git branch: t/21860/giacblas Using --optional=database_gap,giac,giacpy_sage,mpir,python2,sage Doctesting 1 file. sage -t --long --warn-long 100.3 src/sage/rings/polynomial/multi_polynomial_ideal.py ********************************************************************** File "src/sage/rings/polynomial/multi_polynomial_ideal.py", line 3533, in sage.rings.polynomial.multi_polynomial_ideal.NCPolynomialIdeal.groebn er_basis Failed example: ideal(J.transformed_basis()).change_ring(P).interreduced_basis() # optional - giacpy_sage Expected: [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] Got: [7*a - 420*c^3 + 158*c^2 + 8*c - 7, 7*b + 210*c^3 - 79*c^2 + 3*c, 84*c^4 - 40*c^3 + c^2 + c] ********************************************************************** 1 item had failures: 1 of 67 in sage.rings.polynomial.multi_polynomial_ideal.NCPolynomial Ideal.groebner_basis [723 tests, 1 failure, 9.10 s] ---------------------------------------------------------------------- sage -t --long --warn-long 100.3 src/sage/rings/polynomial/multi_polynomial_ideal.py # 1 doctest failed ---------------------------------------------------------------------- Total time for all tests: 9.2 seconds cpu time: 15.5 seconds cumulative wall time: 9.1 seconds }}} in fact it is related to the singular update #17254 where all the {{{ if r.ringtype == 0: }}} were replaced by {{{ if r.cf.type == n_unknown: }}} but it seems not equivalent with QQ coefficients. Remarks: The interred_libsingular function of multi_polynomial_ideal_libsingular.pyx ends with an explicit: {{{ # divide head by coeffi ... }}} and the groebner_basis function doc have still five examples giving: {{{ [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] }}} so what is the best thing for the interreduced_basis command to output? URL: https://trac.sagemath.org/21884 Reported by: charpent Ticket author(s): Frederic Han Reviewer(s): Emmanuel Charpentier
2 parents d092f44 + fd60c06 commit b9bd305

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/sage/rings/polynomial/multi_polynomial_ideal.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3530,7 +3530,8 @@ def groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=Fal
35303530
sage: gb # optional - giacpy_sage
35313531
[c^3 - 79/210*c^2 + 1/30*b + 1/70*c, b^2 - 3/5*c^2 - 1/5*b + 1/5*c, b*c + 6/5*c^2 - 1/10*b - 2/5*c, a + 2*b + 2*c - 1]
35323532
3533-
sage: ideal(J.transformed_basis()).change_ring(P).interreduced_basis() # optional - giacpy_sage
3533+
sage: J.groebner_basis.set_cache(gb) # optional - giacpy_sage
3534+
sage: ideal(J.transformed_basis()).change_ring(P).interreduced_basis() # testing trac 21884
35343535
[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]
35353536
35363537
Giac's gbasis over `\QQ` can benefit from a probabilistic lifting and

src/sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def interred_libsingular(I):
280280
sage: P.<x,y,z> = PolynomialRing(QQ)
281281
sage: I = ideal( x^2 - 3*y, y^3 - x*y, z^3 - x, x^4 - y*z + 1 )
282282
sage: I.interreduced_basis()
283-
[y*z^2 - 81*x*y - 9*y - z, z^3 - x, x^2 - 3*y, 9*y^2 - y*z + 1]
283+
[y*z^2 - 81*x*y - 9*y - z, z^3 - x, x^2 - 3*y, y^2 - 1/9*y*z + 1/9]
284284
"""
285285
global singular_options
286286

@@ -310,7 +310,7 @@ def interred_libsingular(I):
310310

311311

312312
# divide head by coefficients
313-
if r.cf.type == n_unknown:
313+
if r.cf.type != n_Z and r.cf.type != n_Znm and r.cf.type != n_Zn and r.cf.type != n_Z2m :
314314
for j from 0 <= j < IDELEMS(result):
315315
p = result.m[j]
316316
if p:

0 commit comments

Comments
 (0)