# Translating a list of polynomials using sage I have a list of polynomials in Sage as follows:

n=5
W=[P.coxeter_polynomial() for P in posets(n)]


Now I want to have the list of all such polynomials as polynomials in R.<x> = PolynomialRing(ComplexField(100)) .

My question is: Is there an easy way to translate the above list W so that Sage views every polynomial in that list as a polynomial in R.<x> = PolynomialRing(ComplexField(100))?

edit retag close merge delete

1

Side remark : sage: P.is_cyclotomic_product() is useful to recognize polynomials with all their roots on the unit circle.

Sort by » oldest newest most voted Yes, there is.

This can be done either as post-treatment after you have already built the list of polynomials, or at the time of building the list.

If you already have the list W defined as in the question, you can write:

C = ComplexField(100)
W = [w.change_ring(C) for w in W]


Or you could regenerate the list to directly get polynomials in the desired ring:

n = 5
C = ComplexField(100)
W = [P.coxeter_polynomial().change_ring(C) for P in posets(n)]


or

n = 5
R.<x> = PolynomialRing(ComplexField(100))
W = [R(P.coxeter_polynomial()) for P in posets(n)]

more