ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 11 Jan 2020 16:20:20 -0600Monomials' list for Laurent polynomialshttps://ask.sagemath.org/question/49505/monomials-list-for-laurent-polynomials/ Given a Laurent polynomial, is there a method to list its monomials?
For example, for the polynomial $f(x,y) = x/y + y +3/x$ in the ring $R[x^\pm,y^\pm]$, it should give a list of the form `[x/y,y,3/x]`. Something similar exists for polynomials, it is given by monomials().Sat, 11 Jan 2020 09:27:05 -0600https://ask.sagemath.org/question/49505/monomials-list-for-laurent-polynomials/Answer by FrédéricC for <p>Given a Laurent polynomial, is there a method to list its monomials?
For example, for the polynomial $f(x,y) = x/y + y +3/x$ in the ring $R[x^\pm,y^\pm]$, it should give a list of the form <code>[x/y,y,3/x]</code>. Something similar exists for polynomials, it is given by monomials().</p>
https://ask.sagemath.org/question/49505/monomials-list-for-laurent-polynomials/?answer=49507#post-id-49507Like this
sage: x, y = LaurentPolynomialRing(QQ, 'x,y').gens()
sage: f = x+2/y
sage: list(f)
[(1, x), (2, y^-1)]Sat, 11 Jan 2020 10:41:58 -0600https://ask.sagemath.org/question/49505/monomials-list-for-laurent-polynomials/?answer=49507#post-id-49507Comment by rue82 for <p>Like this</p>
<pre><code>sage: x, y = LaurentPolynomialRing(QQ, 'x,y').gens()
sage: f = x+2/y
sage: list(f)
[(1, x), (2, y^-1)]
</code></pre>
https://ask.sagemath.org/question/49505/monomials-list-for-laurent-polynomials/?comment=49510#post-id-49510Many thanks. If I previously introduced x,y as symbolic variables, is there a way to covert the elements in the list back to symbolic variables?Sat, 11 Jan 2020 16:20:20 -0600https://ask.sagemath.org/question/49505/monomials-list-for-laurent-polynomials/?comment=49510#post-id-49510