mmarco a écrit :
Dealing with polynomial ringsi found something that seems incorrect

sage: R=QQ['x','y']
sage: S=QQ['x']['y']

Shouldn't there be natural coercions  from rings like QQ[x,y][z] or
QQ[x][y][z] to QQ[x,y,z] and vice-versa?
One easy way to coerce is Domain("the-expression")

sage: R.<x,y> = QQ[]

creates (in the variable R) the domain QQ[x,y]
and adds generators x and y from this domain

sage: S=QQ['x']['y']

creates this second domains, and x and y remain generators from R.

The last S(...) command translates the expression to S domain.

sage: parent ((1/2+x/3+y/5)^3)
sage: S((1/2+x/3+y/5)^3)
sage: parent (S((1/2+x/3+y/5)^3))

Multivariate Polynomial Ring in x, y over Rational Field
1/125*y^3 + (1/25*x + 3/50)*y^2 + (1/15*x^2 + 1/5*x + 3/20)*y + 1/27*x^3 + 1/6*x^2 + 1/4*x + 1/8 Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field

R(... a polynomial in S ...) translates S to R.

You can't have the same x variable in R and in S.
But it's possible to give an other name to these variables.

sage: ys = S.gen() ; xs = S.base_ring().gen() sage: R ((xs+ys+1/2)^4)

I hope I understand your question.


F.

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to