Ask Your Question
0

create polynomial from list of coefficients

asked 10 years ago

xyzzyz gravatar image

Hey,

I created a polynomial ring object:

 R.<x,y>=QQbar[]

and now I wonder how should I create a polynomial from a list of coefficients: assume that I have something like [{x: 5, y: 4}, {x: 2, y: 0}]. How to transform it to "x^5 y^4 + x^2"?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 10 years ago

FrédéricC gravatar image

Here is a way:

sage: R.<x,y>=QQbar[]
sage: R({(1,1):2})
2*x*y

sage: R({(1,1):2,(3,4):77})
77*x^3*y^4 + 2*x*y
Preview: (hide)
link

Comments

I see, thanks! It would be nice if it was made clear in documentation.

xyzzyz gravatar imagexyzzyz ( 10 years ago )

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 10 years ago

Seen: 1,289 times

Last updated: Jul 24 '14