Rational functions and content

19 views
Skip to first unread message

Victor Miller

unread,
Sep 29, 2014, 11:58:39 AM9/29/14
to sage-s...@googlegroups.com
I've been calculating some sequence of rational functions associated with a combinatorial problem.  I'm doing the following:


sage: K.<x> = PolynomialRing()
sage: R = FractionField(K)

I then do some calculations in for elements in R.  When I get back the answer (say in f), and I look at

f.numerator() and f.denominator()

they are both polynomials with integer coefficients (even though their parent is PolynomialRing(RationalField())) which are of the form a*monic polynomial, with the same value of a.  Why isn't this leading coefficient (which is the content) cancelled?


Nils Bruin

unread,
Sep 29, 2014, 12:10:24 PM9/29/14
to sage-s...@googlegroups.com
On Monday, September 29, 2014 8:58:39 AM UTC-7, Victor Miller wrote:
they are both polynomials with integer coefficients (even though their parent is PolynomialRing(RationalField())) which are of the form a*monic polynomial, with the same value of a.  Why isn't this leading coefficient (which is the content) cancelled?

This is causing problems elsewhere (notably, hashing) and is being tracked. It's a little better for the field of fractions of ZZ['x']:

sage: A.<x>=ZZ[]
sage: 3*(x^2+1)/(3*(x+2))
(x^2 + 1)/(x + 2)
sage: -3*(x^2+1)/(-3*(x+2))
(-x^2 - 1)/(-x - 2)

We still need to take care of units as leading coefficients of denominators, even in ZZ['x']!
Reply all
Reply to author
Forward
0 new messages