I want to take, for example,  x^2 + 1  mod  a*x  and get quotient (1/a)*x 
 and remainder 1.    It doesn't work if I work in PolynomialRing  because 
then you can't have 1/a.  
It doesn't work in the quotient field because then you always get remainder 
0.    To have  f.quo_rem(g)  work,  I must anticipate all denominators that 
might occur in the 
coefficients and multiply f by them to begin with, as shown in the 
following example.   But I'd rather have sage treat x as a polynomial 
variable and the others, like a, as rational variables.
Can that be done?

----------------------------------------------------------------------
| Sage Version 4.8, Release Date: 2012-01-20                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: R.<a,x> = PolynomialRing(QQ,2)
sage: f = x^2 + 1
sage: g = a*x
sage: f.quo_rem(g)
(0, x^2 + 1)
sage: f.parent()
Multivariate Polynomial Ring in a, x over Rational Field
sage: f = a*(x^2+1)
sage: f.quo_rem(g)
(x, a)
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to