# Multivariate Polynomials over Rational Function Fields

Is it possible to define multivariate polynomials where the coefficients lie in a rational function field and do Groebner basis computations on them? Maple, Reduce and Axiom support this. For example I would like to be able to compute the Groebner basis of the polynomials

{v * x^2 + y, u* x * y + y^2}


where the polynomials belong to the ring Q(u,v)[x,y].

I tried the following

B.<u,v> = PolynomialRing(QQ, 'u', 'v')
R.<x,y> = PolynomialRing(B, 'x', 'y')
I = R.ideal(v * x^2 + y, u* x * y + y^2)
g = I.groebner_basis()


This fails with the error

TypeError: Can only reduce polynomials over fields.

edit retag close merge delete

Sort by » oldest newest most voted

Make u and v be in the Fraction field:

sage: B.<u,v> = Frac(QQ['u,v'])
sage: R.<x,y> = PolynomialRing(B, 'x', 'y')
sage: I = R.ideal(v * x^2 + y, u* x * y + y^2)
sage: g = I.groebner_basis()
sage: g
[y^3 + u^2/v*y^2, x^2 + 1/v*y, x*y + 1/u*y^2]

more

1

Thanks, that works perfectly. Now my quest for the Elimination ideal I2 = I.elimination_ideal([x]) fails with TypeError: Cannot call Singular function 'eliminate' with ring parameter of type '<class 'sage.rings.polynomial.multi_polynomial_ring.mpolynomialring_polydict_do\="" main'="">'

When I try this, the error I get is a little more informative:

sage: I2 = I.elimination_ideal([x])
...
TypeError: Cannot call Singular function 'eliminate' with ring parameter of type
'<class 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain'>'


The function eliminte comes from

sage: eliminate = sage.libs.singular.ff.eliminate


which is a wrapper for the Singular function and is supposed to convert Sage's rings to rings that Singular understands . . . however it seems that this wrapper does not understand the _polydict_domain rings. Perhaps one could convert R to a ring that the wrapper does understand (or file this as a bug in the wrapper and fix it). Checking, I see that there is a ring type MPolynomialRing_libsingular, but it only allows base rings from a very small list (like ZZ and finite fields).

Maybe someone who knows more about the Singular interface can help here?

more