Ask Your Question
0

Question about arguments of a polynomial

asked 10 years ago

ruidongshuai@gmail.com gravatar image

updated 10 years ago

slelievre gravatar image

I want to define a polynomial ring R with 5 variables, and a function f belonging to R with 2 variables, for example, f=x1+x2,however, the arguments of f are just x1 and x2, how can I let the arguments of f be x0,x1,x2,x3,x4?

R=PolynomialRing(QQ,5,"x",order='lex')
vx=[var("x"+str(i))for i in range(5)]
vx=R.gens()
f=x1+x2;f
f.args()
g=R.random_element();g
g.args()
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 10 years ago

slelievre gravatar image

To have x0, ..., x4 refer to the generators of R, replace your second and third lines by

R.inject_variables()
Preview: (hide)
link

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: 10 years ago

Seen: 263 times

Last updated: Jul 13 '14