recognize a rational function is a polynomial
Is it possible to make sage recognize that a certain rational function is a Laurent polynomial, and treat it as such?
A simple example:
sage: R = LaurentPolynomialRing(ZZ, ['q1'])
sage: R.inject_variables(verbose=False)
sage: f = (1/(1-q1) + 1/(1-q1^-1))
sage: parent(f)
Fraction Field of Univariate Polynomial Ring in q1 over Integer Ring
Here, f
lives correctly in the fraction field. However,
it is in particular a polynomial, to which I'd like to apply
the polynomial methods, e.g. get its monomial list.
Is this possible to achieve?