Ask Your Question
2

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

asked 2014-08-21 21:29:35 +0200

Kirill gravatar image

If I try this, it fails:

R.<x,y> = PolynomialRing(QQ, 'x, y')
R.extend_variables('z')
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
3

answered 2014-08-21 21:54:58 +0200

slelievre gravatar image

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

Comments

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

Kirill gravatar imageKirill ( 2014-08-21 22:00:55 +0200 )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

Stats

Asked: 2014-08-21 21:29:35 +0200

Seen: 863 times

Last updated: Aug 21 '14