Ask Your Question
0

get the coefficients from the Polynomial

asked 2015-05-21 00:39:40 -0500

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
1

answered 2015-05-21 02:31:44 -0500

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 09:32:11 -0500 )edit

Useful option. Doesn't exist in Sage 5.8.

candide gravatar imagecandide ( 2015-06-19 17:44:57 -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: 2015-05-21 00:39:40 -0500

Seen: 281 times

Last updated: May 21 '15