ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 02 Aug 2017 00:43:08 +0200Equivalent of Polynomial.list() for expression involving generator of GaloisFieldhttps://ask.sagemath.org/question/38458/equivalent-of-polynomiallist-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
(a**9).list()
and get
[1, 3]
Is there any simple way to that?Hilder Vitor Lima PereiraWed, 02 Aug 2017 00:43:08 +0200https://ask.sagemath.org/question/38458/given a list of coefficients how can I get a polynomialhttps://ask.sagemath.org/question/24252/given-a-list-of-coefficients-how-can-i-get-a-polynomial/ In sage,
given a list/vector v of coefficients, how can I get the polynomial v[i]*x^i ?
Here is my environment;
n = 11
K = GF(4,'a')
R = PolynomialRing(GF(4,'a'),"x")
x = R.gen()
a = K.gen()
v = vector([1,a,0,0,1,1,1,a,a,0,1])
I want to get the polynomial v(x) in x, having v as the list of coefficients.
This seems simple but I couldn't write it...
Can anyone help?
algebraicallyclosedTue, 23 Sep 2014 11:26:39 +0200https://ask.sagemath.org/question/24252/