I have a multivariate polynomial and want to keep only up to a certain degree. 
I already know how to do this for the univariate case.

For 1 variable, I'd do:

R.<x> = PolynomialRing(QQ)

f = x^4 + x^2 + x^3 + x + 1

f = f + O(x^3)

print f

#output would be 1 + x + x^2... which is what I want.

How do I do this for a multivariate polynomial? It says O(.) is not defined...

R.<x,y> = PolynomialRing(QQ)

f = x^3*y^3 + x^2 * y^4 + x*y + x + y + 1

How can I chop this polynomial up to a certain degree of x and y? I.e. I want 
to keep up until the second degree of x only (regardless of y).

I know one way I could go about this is to just redefine the polynomial by 
looping through the first few coefficients, but I'm looking for a more 
efficient/easier way.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to