Ask Your Question
2

On function quo_rem

asked 2018-12-29 15:53:54 +0100

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

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-12-30 12:48:55 +0100

rburing gravatar image

updated 2018-12-30 14:04:25 +0100

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

edit flag offensive delete link more

Comments

Thank you a lot!!!

GK gravatar imageGK ( 2018-12-31 00:06:22 +0100 )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

Stats

Asked: 2018-12-29 15:53:54 +0100

Seen: 1,563 times

Last updated: Dec 30 '18