ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 25 Feb 2022 17:28:49 +0100recognize a rational function is a polynomialhttps://ask.sagemath.org/question/61279/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?rue82Fri, 25 Feb 2022 17:28:49 +0100https://ask.sagemath.org/question/61279/reduce() for fraction field elementshttps://ask.sagemath.org/question/60856/reduce-for-fraction-field-elements/I am having an issue with the `reduce()` method for `FractionFieldElement`.
In a Jupyter notebook I executed the following code
sage: S = FractionField(QQ['t'])
sage: S.inject_variables()
sage: R = PolynomialRing(FractionField(QQ['t']),'x',3)
sage: R.inject_variables()
sage: (((x0^2-x1^2)/(x0-x1)).reduce())
but this returned an object with `NoneType`, rather than
a fraction field element or ring element. What am I doing wrong?AShahFri, 28 Jan 2022 17:06:38 +0100https://ask.sagemath.org/question/60856/FractionFieldElement works incorrectly over large fieldshttps://ask.sagemath.org/question/59419/fractionfieldelement-works-incorrectly-over-large-fields/ The code below returns a*b/a instead of b if characteristic of field is large. How can I bypass this limitation?
A=PolynomialRing(GF(2^31-1),['a','b'])
x, y = A.gens()[0], A.gens()[1]
print(x*y/x)Alex KareninWed, 20 Oct 2021 20:08:59 +0200https://ask.sagemath.org/question/59419/