Ask Your Question
0

create polynomial from list of coefficients

asked 2014-07-24 06:25:49 -0500

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"?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2014-07-24 06:52:20 -0500

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
edit flag offensive delete link more

Comments

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

xyzzyz gravatar imagexyzzyz ( 2014-07-24 08:15:39 -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

Stats

Asked: 2014-07-24 06:25:49 -0500

Seen: 139 times

Last updated: Jul 24 '14