[[(-h)/(-h), 0, h/(-h),0],
[0, ((-h*q^-1 + h*q)*u0 + (-h*q^-1 + h*q)*u1)/((-h*q^-1 + h*q)*u0 + (-h*q^-1 + h*q)*u1), 0, 0], [0, 0, 0, h^2*u0*u1/(h^2*u0*u1)]]
[[1, 0, 1, 0],
[0, 1, 0, 0],
[0, 0, 0, 1]]
Is there a way to make sage do this reduction? Everything that I have tried so far as failed. If I take the (1,1) entry above to be a then it's parent is
sage: a.parent()
Fraction Field of Multivariate Polynomial Ring in c0, c1, c2, c3 over Multivariate Laurent Polynomial Ring in u0, u1 over Univariate Laurent Polynomial Ring in q over Univariate Laurent Polynomial Ring in h over Integer Ring
So I get errors when I try things like:
sage: a.reduce()
---------------------------------------------------------------------------
ArithmeticError Traceback (most recent call last)
...
ArithmeticError: unable to reduce because gcd algorithm not implemented on input
sage: R( f )
If by mapping to R you mean applying
sage: R( f )then, no, this doesn't work. I'll see if I can post an example to make this more concrete.
sage: Rq.<q> = LaurentPolynomialRing(ZZ,'q')
sage: Ruq.<u> = PolynomialRing(Rq,'u')
sage: mat = matrix([[q-q,u-q],[1,1]])
sage: mat.rref()
[ 1 0]
[ 0 (u - q)/(u - q)]
sage: c = _[1][1]; c; c.parent()
(u - q)/(u - q)
Fraction Field of Univariate Polynomial Ring in u over Univariate Laurent Polynomial Ring in q over Integer Ring
sage: c==1
True
sage: c.reduce()
------------------------------------- ------------------------------
ArithmeticError Traceback
...
ArithmeticError: unable to reduce because gcd algorithm not implemented on input
sage: Rq.<q> = PolynomialRing(ZZ,'q')
sage: Ruq.<u> = PolynomialRing(Rq,'u')
sage: mat = matrix([[q-u,u-q],[1,1]])
sage: mat.rref()
[1 0]
[0 1]