Ask Your Question

Translating a list of polynomials using sage

asked 2020-12-27 19:11:04 +0200

klaaa gravatar image

updated 2020-12-27 20:45:06 +0200

Juanjo gravatar image

I have a list of polynomials in Sage as follows:

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 flag offensive close merge delete



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

FrédéricC gravatar imageFrédéricC ( 2020-12-27 20:52:44 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-12-27 20:44:17 +0200

Juanjo gravatar image

updated 2020-12-27 23:53:16 +0200

slelievre gravatar image

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)]


n = 5
R.<x> = PolynomialRing(ComplexField(100))
W = [R(P.coxeter_polynomial()) for P in posets(n)]
edit flag offensive delete link more

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


Asked: 2020-12-27 19:11:04 +0200

Seen: 86 times

Last updated: Dec 27 '20