coefficients of power series with Laurent series coefficients

asked 2023-06-01 21:00:22 +0200

zaz gravatar image

updated 2023-06-01 21:43:53 +0200

Emmanuel Charpentier gravatar image

I want to be able to pick out the different monomials in a power series ring with coefficient ring Laurent series in another variable (or more). For example:

Q.<q> = LaurentSeriesRing(QQ)
S.<X> = LaurentSeriesRing(Q)
SS.<s> = PowerSeriesRing(S)

U = 1 + 2*X^3*s^4 + 5*q^6*X^7*s^8

What's the best way to extract the different monomials together with their coefficients?

edit retag flag offensive close merge delete

Comments

Reformatted for intelligibility : to quote code, isolate it with blank lines and indent it four spaces (or use the "101010" button).

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-06-01 21:45:07 +0200 )edit

FWIW :

sage: U.list()
[1, 0, 0, 0, 2*X^3, 0, 0, 0, 5*q^6*X^7]

which is consitent with:

sage: U.parent()
Power Series Ring in s over Laurent Series Ring in X over Laurent Series Ring in q over Rational Field

Is that what you want ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-06-01 21:47:12 +0200 )edit

Thank you! I always forget "list" and never find it in my documentation searches! Since this list will begin with the power series coefficient of 0, that's easy -- but to get the coefficient of a power of X, I'll need to know where the Laurent series starts. I typically do a zip of exponents and coefficients, but that seems rather clunky. Is there a better way? Thanks again.

zaz gravatar imagezaz ( 2023-06-01 22:48:06 +0200 )edit

Try conversion to polynomial via U.polynomial()

Max Alekseyev gravatar imageMax Alekseyev ( 2023-06-02 14:23:04 +0200 )edit