Ask Your Question
2

get the coefficients from the Polynomial

asked 2015-05-21 07:39:40 +0100

ZHANG gravatar image

Just like that

R.<x> = GF(2^4, 'a')[]

f=x^3+x+1

print f.coefficients()

it returns [1, 1, 1],but I want it to retun [1,0,1,1],that is i need all the coefficients of every term(x^3,x^2,x^1,x^0),what should i do? thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2015-05-21 09:31:44 +0100

Francis Clarke gravatar image
sage: f.coefficients(sparse=False)
[1, 1, 0, 1]

or

sage: f.list()
[1, 1, 0, 1]
edit flag offensive delete link more

Comments

thank you! That's what i want

ZHANG gravatar imageZHANG ( 2015-05-21 16:32:11 +0100 )edit

Useful option. Doesn't exist in Sage 5.8.

candide gravatar imagecandide ( 2015-06-20 00:44:57 +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: 2015-05-21 07:39:40 +0100

Seen: 17,117 times

Last updated: May 21 '15