Ask Your Question

# On function quo_rem

Hi, I write the following code:

R.<x,y,z> = PolynomialRing(GF(29), order='degrevlex');
f = x*y + z;
g = x + y;
f.quo_rem(g)


and the result is

(x, -x^2 + z).


Is it a really correct result of the function quo_rem? Because of the 'degrevlex' (x > y > z and y^2 < x*y < x^2), I expect something like this

(y, -y^2 + z).


Thank you very much in advance for your help.

edit retag close merge delete

## 1 answer

Sort by » oldest newest most voted For multivariate division with remainder that takes the monomial ordering into account, you want to do

sage: f.reduce([g])
-y^2 + z


and you can obtain the quotient by

sage: (f - f.reduce([g])) // g
y


See the documentation of reduce().

Edit: Actually this is inefficient because both can be computed simultaneously. The algorithm is simple. I don't know if it is included in Sage.

Also, the documentation of quo_rem() should refer to reduce().

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2018-12-29 08:53:54 -0500

Seen: 102 times

Last updated: Dec 30 '18