Ask Your Question

Quotient of Polynomial rings reduction not working

asked 2015-06-09 15:44:26 +0200

Wizq gravatar image

updated 2015-06-09 16:45:17 +0200


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 16:58:59 +0200

tmonteil gravatar image

updated 2015-06-09 17:03:15 +0200

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 18:37:33 +0200 )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 19:13:40 +0200 )edit

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

Wizq gravatar imageWizq ( 2015-06-09 19:57:59 +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



Asked: 2015-06-09 15:44:26 +0200

Seen: 513 times

Last updated: Jun 09 '15