Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 2011-05-22 14:21:44 -0500

DSM gravatar image

Here's how I'd get around it if I needed it to work Right Now(tm):

sage: var("x y")
(x, y)
sage: t = gp.simplify((x+y)/y)
sage: 
sage: R.<x,y> = PolynomialRing(QQ)
sage: S = R.fraction_field()
sage: 
sage: t2 = S(sage_eval(repr(t),locals=locals()))
sage: t2
(x + y)/y
sage: parent(t2)
Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
sage: parent(t2) is S
True

Here's how I'd get around it the problem if I needed it to work Right Now(tm):

sage: var("x y")
(x, y)
sage: t = gp.simplify((x+y)/y)
sage: 
sage: R.<x,y> = PolynomialRing(QQ)
sage: S = R.fraction_field()
sage: 
sage: t2 = S(sage_eval(repr(t),locals=locals()))
sage: t2
(x + y)/y
sage: parent(t2)
Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
sage: parent(t2) is S
True