Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

recognize a rational function is a polynomial

Is it possible to make sage recognize that a certain rational function as a Laurent polynomial, and treat it as such?

A simple example:

Rtest = LaurentPolynomialRing(ZZ, ['q1'])
Rtest.inject_variables(verbose=False)
(1/(1-q1) + 1/(1-q1^-1)).category()

lives correctly in the fraction field. However, it is in particualr a polynomial, to which I'd like to apply the polynomials' methods, e.g. get its monomial list.

Is this possible to achieve?

recognize a rational function is a polynomial

Is it possible to make sage recognize that a certain rational function as is a Laurent polynomial, and treat it as such?

A simple example:

Rtest = LaurentPolynomialRing(ZZ, ['q1'])
Rtest.inject_variables(verbose=False)
(1/(1-q1) + 1/(1-q1^-1)).category()

lives correctly in the fraction field. However, it is in particualr a polynomial, to which I'd like to apply the polynomials' methods, e.g. get its monomial list.

Is this possible to achieve?

recognize a rational function is a polynomial

Is it possible to make sage recognize that a certain rational function function is a Laurent polynomial, and treat it as such?

A simple example:

Rtest sage: R = LaurentPolynomialRing(ZZ, ['q1'])
Rtest.inject_variables(verbose=False)
sage: R.inject_variables(verbose=False)
sage: f = (1/(1-q1) + 1/(1-q1^-1)).category()
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, However, it is in particualr particular a polynomial, to which I'd like to apply apply the polynomials' polynomial methods, e.g. get its monomial list.

Is this possible to achieve?