Ask Your Question

Quotient of Polynomial rings reduction not working

asked 2015-06-09 08:44:26 -0600

Wizq gravatar image

updated 2015-06-09 09:45:17 -0600


1 x^8 + 1

Why am I not getting the result 1 in both cases?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-06-09 09:58:59 -0600

tmonteil gravatar image

updated 2015-06-09 10:03:15 -0600

It seems that in the second case, the .reduce() method is the generic one which is just:

def reduce(self, f):
    Return the reduction of the element of `f` modulo ``self``.

    This is an element of `R` that is equivalent modulo `I` to `f` where
    `I` is ``self``.


        sage: ZZ.ideal(5).reduce(17)
        sage: parent(ZZ.ideal(5).reduce(17))
        Integer Ring
    return f       # default

If you want a better reduction in this particular case, you can put the polynomial in the quotient and lift it:

sage: R.<x>=PolynomialRing(ZZ)
sage: I = R.ideal(x^4)
sage: R.quotient(I)(x^8+1).lift()
edit flag offensive delete link more


Thank you very much for your answer. I googled the commented code and found the source code, and I now understand why it wasn't working as expected. Since I'm working with a slightly more complicated ring than this (Z[x]/poly1/poly2), I am now trying to use overriding and inheritance (of PolynomialQuotientRing and QuotientRing, I hope that "_domain_with_category" isn't significant for this) to obtain the behaviour that I want (reduce, quo_rem...). Thank you.

Wizq gravatar imageWizq ( 2015-06-09 11:37:33 -0600 )edit

Note that, you can access directly to the source code of a method with two question marks:

sage: I.reduce??
tmonteil gravatar imagetmonteil ( 2015-06-09 12:13:40 -0600 )edit

I didn't know that, and it's going to help me tremendously. Thank you!

Wizq gravatar imageWizq ( 2015-06-09 12:57:59 -0600 )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: 2015-06-09 08:44:26 -0600

Seen: 337 times

Last updated: Jun 09 '15