Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Trouble transforming a groebner basis

I'm using sage to compute Gröbner bases (in lexicographic order) over a fractional field. This has been working out well so far. For computational efficiency I've read that degrevlex order is often preferred for the initial basis calculation, followed by a transformation (using the FGLM algorithm) to the desired order (lex in my case).

However, I'm facing a problem when I try to transform the basis, my invocation might be wrong, but currently this is yielding me a TypeError: no conversion to a Singular ring defined.

This is the .sage file:

P.<p0, p1, p2, p3, p4, p5, p6, p7, p8, p9> = PolynomialRing(QQ)
F = Frac(P)
R = PolynomialRing(F, order='degrevlex', names=('z0', 'z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7'))
(z0, z1, z2, z3, z4, z5, z6, z7,) = R._first_ngens(8)

I = R.ideal(p0*z0*z1 - z2*z3, p1*z4 - z3*z5, p2*z1*z5 - z6, -p3 - p4 - p5 + z4 + z5 + z6, -p5 - p6 - p7 + z0 + z3 + z4, -p3 - p8 - p9 + z1 + z2 + z6, -p7 - p8 + z0 + z2, -z6 + z7)
gb = I.groebner_basis()
print('So far so good...')
S = PolynomialRing(F, order='lex', names=('z0', 'z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7'))
gbasis = Ideal(gb).transformed_basis('fglm', S)

print([{k: str(v) for k, v in _.dict().items()} for _ in gbasis])

and this is my backtrace:

So far so good...
Traceback (most recent call last):
  File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1222, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular._singular_ (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:13949)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/", line 16, in <module>
    gbasis = Ideal(gb).transformed_basis('fglm', S)
  File "/usr/lib/python3/dist-packages/sage/rings/polynomial/", line 297, in __call__
    return self.f(self._instance, *args, **kwds)
  File "/usr/lib/python3/dist-packages/sage/rings/", line 96, in wrapper
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/sage/interfaces/", line 2763, in wrapper
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/sage/libs/singular/", line 142, in wrapper
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/sage/rings/polynomial/", line 2055, in transformed_basis
    Rs = singular(R)
  File "/usr/lib/python3/dist-packages/sage/interfaces/", line 766, in __call__
    return x._singular_(self)
  File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1236, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular._singular_ (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:14457)
  File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1433, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular._singular_init_ (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:16290)
TypeError: no conversion to a Singular ring defined

Any clue as to what I might be doing wrong?

I'm using sage 9.5, provided by Debian 12 (bookworm)