Ask Your Question

Revision history [back]

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

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


and get

[1, 3]

Is there any simple way to that?