Ask Your Question

On function quo_rem

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

GK gravatar image

Hi, I write the following code:

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

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-12-30 05:48:55 -0500

rburing gravatar image

updated 2018-12-30 07:04:25 -0500

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

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().

edit flag offensive delete link more


Thank you a lot!!!

GK gravatar imageGK ( 2018-12-30 17:06:22 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


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

Seen: 150 times

Last updated: Dec 30 '18