Ask Your Question

Replacing Polynomials with another Polynomial

asked 2020-07-17 00:46:45 +0200

whatupmatt gravatar image

So I am working with quotient rings so I want to be able to replace terms as there can be many representatives. Let's say I have a polynomial ring of four variables quotiented off by some ideal. Futhermore, we have

x*w "=" x*y+y*z

in the quotient. Is there some replace function that will let me replace polynomial expressions with one another? For example, if I had 3xw+x*y, is there something like

replace(3*x*w+x*y, x*w for x*y+y*z)

which should output

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-07-17 22:10:06 +0200

slelievre gravatar image

One way is to use a polynomial ring and to reduce modulo an ideal.

Define a polynomial ring:

sage: R.<w, x, y, z> = QQ[]

Define an ideal:

sage: I = R.ideal([x*y + y*z - x*w])

Define a polynomial:

sage: P = 3*x*w+x*y

Reduce the polynomial modulo the ideal:

sage: P.reduce(I)
4*x*y + 3*y*z
edit flag offensive delete link more


How does Sage choose what it replaces? For example, in the thing you gave above, P=3xw + xy, it can choose to replace xw or choose to replace x*y. Does it go with the first one?

whatupmatt gravatar imagewhatupmatt ( 2020-07-18 19:44:08 +0200 )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: 2020-07-17 00:46:45 +0200

Seen: 487 times

Last updated: Jul 17 '20