Ask Your Question
1

Equivalent of Polynomial.list() for expression involving generator of GaloisField

asked 2017-08-01 17:43:49 -0600

Vitor gravatar image

I know that it is possible to use the method list() to get a list with the coefficients of a polynomial. For instance:

sage: S.<x> = PolynomialRing(ZZ, 'x')
sage: (1 - 5*x + 3*x**2 + 2*x**3).list()
[1, -5, 3, 2]

I would like to do something like that with an expression involving a generator of a Galois Field.

For example:

sage: q = 5
sage: m = 2
sage: F.<a> = GF(q**m)
sage: a**9
3*a + 1

So, ideally, I would like to do the following

(a**9).list()

and get

[1, 3]

Is there any simple way to that?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-08-01 17:53:56 -0600

tmonteil gravatar image

You are close to the solution: just turn your field element into a polynomial in the undeterminate a:

sage: (a**9).polynomial().list()
[1, 3]
edit flag offensive delete link more

Comments

That works! I had tried similar things, but not really that. Thank you!

Vitor gravatar imageVitor ( 2017-08-02 01:33:49 -0600 )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

1 follower

Stats

Asked: 2017-08-01 17:43:08 -0600

Seen: 26 times

Last updated: Aug 01