First time here? Check out the FAQ!

Ask Your Question
0

given a list of coefficients how can I get a polynomial

asked 10 years ago

algebraicallyclosed gravatar image

In sage,

given a list/vector v of coefficients, how can I get the polynomial v[i]*x^i ?

Here is my environment;

n = 11
K = GF(4,'a')
R = PolynomialRing(GF(4,'a'),"x")
x = R.gen()
a = K.gen()
v = vector([1,a,0,0,1,1,1,a,a,0,1])

I want to get the polynomial v(x) in x, having v as the list of coefficients. This seems simple but I couldn't write it... Can anyone help?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 10 years ago

FrédéricC gravatar image

Like that

sage: R(v.list())
x^10 + a*x^8 + a*x^7 + x^6 + x^5 + x^4 + a*x + 1
Preview: (hide)
link

Comments

Ah, thanks, little before that, I wrote R(v) and it worked. Thank you for answering.

algebraicallyclosed gravatar imagealgebraicallyclosed ( 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: 2,292 times

Last updated: Sep 23 '14