On Jan 26, 2013, at 11:31 PM, Florent Hivert wrote: > Dear all, > > In some circumstance polynomial ring quotients returns wrong results: the > following quotient by a single polynomial works correctly: > > sage: R.<x> = PolynomialRing(ZZ) > sage: > sage: S.<xbar> = R.quotient(x^2+x+1) > sage: xbar^2 > -xbar - 1 > sage: xbar^2 + x + 1 == 0 > True > > whereas quotient by several polynomial is wrong: > > sage: S.<xbar> = R.quotient((x^2+x+1, x^2)) > sage: xbar^2 > xbar^2 > sage: xbar^2 + x + 1 == 0 > False > > The reason is that the default implementation of reduce in ideal.py is > > def reduce(self, f): > return f # default > > and is *not* overloaded for those kinds of polynomials. I'd rather replace > that with > > raise NotImplementedError > > leading > > sage: R.<x> = PolynomialRing(ZZ) > sage: S.<xbar> = R.quotient((x^2+x+1, x^2)) > > to raise a NotImplementedError. Do you all agree with this behavior ? Is there > a simple way to fix that, knowing that "multivariate" polynomials in one > variable correctly implement the feature: > > sage: R.<x> = PolynomialRing(ZZ, 1) > sage: S.<xbar> = R.quotient((x^2+x+1, x^2)) > sage: xbar^2 + x + 1 == 0 > True
If I am not mistaken, any ideal I = <f_1, …, f_r> of R[x] is spanned by a **single** polynomial (which is the gcd of the f_i). So, in your examples, the ideal spanned by x^2 and x^2+x+1 is in fact R[x], because their gcd is one. Then reduction should just be the remainder of the division by the single generator of the ideal... (this is of course only true with polynomial in one variables) Charles > Thanks for any advice. > > Cheers, > > Florent > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To post to this group, send email to sage-devel@googlegroups.com. > To unsubscribe from this group, send email to > sage-devel+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-devel?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To post to this group, send email to sage-devel@googlegroups.com. To unsubscribe from this group, send email to sage-devel+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en.