Ask Your Question
1

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

asked 2017-08-02 00:43:49 +0100

Hilder Vitor Lima Pereira 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-02 00:53:56 +0100

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!

Hilder Vitor Lima Pereira gravatar imageHilder Vitor Lima Pereira ( 2017-08-02 08:33:49 +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

1 follower

Stats

Asked: 2017-08-02 00:43:08 +0100

Seen: 402 times

Last updated: Aug 02 '17