Ask Your Question
0

create polynomial from list of coefficients

asked 2014-07-24 13:25:49 +0100

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 13:52:20 +0100

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 15:15:39 +0100 )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 13:25:49 +0100

Seen: 1,248 times

Last updated: Jul 24 '14