Ask Your Question

How does one add new variables to a multivariate polynomial ring?

asked 2014-08-21 14:29:35 -0500

Kirill gravatar image

If I try this, it fails:

R.<x,y> = PolynomialRing(QQ, 'x, y')
AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular' object has no attribute 'extend_variables'

(But a univariate polynomial ring PolynomialRing(QQ, 'x') has an extend_variables function.)

How do I take a polynomial ring $R$ and make a new ring $R'$ with more variables, such that $R\subset R'$?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-21 14:54:58 -0500

You can create a new polynomial ring with variables having the same names.

sage: R.<x,y> = PolynomialRing(QQ)
sage: S = PolynomialRing(QQ,'x,y,z')

Then it's easy to move from R to S:

sage: p = R.random_element(); p
sage: q = S(p); q
edit flag offensive delete link more


Thank you. I think I can't upvote due to not having any reputation.

Kirill gravatar imageKirill ( 2014-08-21 15:00:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-08-21 14:29:35 -0500

Seen: 203 times

Last updated: Aug 21 '14