Open a9bc4e33-7b98-4180-affc-8dfcef89e22b opened 12 years ago
I have a patch to address some of this that I will post as soon as I can, but there are two issues here, which are identified above.
Issue 1 is a "feature" of QuotientRing_generic that I am still getting to the bottom of, but notice, here
This appears to be related to the following error:
sage: ZZ['x'].quotient(2 * ZZ)
...
TypeError: polynomial must have unit leading coefficient
i.e., polynomial rings seem to expect that, if you mod out by an ideal, it should be a polynomial, which isn't the case if you are trying to mod out by an ideal in the base ring.
This seems to raise other issues with integer ideals interacting with polynomials rings, e.g.,
sage: ZZ['x'].quotient(ZZ['x'].ideal([x^4 + 1, 2])).quotient(2)
Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (2, x^4 + 1, 2)
sage: ZZ['x'].quotient(ZZ['x'].ideal([x^4 + 1, 2])).quotient(2)(2)
2
:(
Issue 2 raised above has to do with ideal.reduce(): the default implementation is being called, which just gives a pass-through, i.e.,
sage: Integers(2).ideal().reduce(2)
2
At the very least, this should be coercing its argument into its base ring.
Sorry -- didn't mean to steal this from AlexGhitza
I think that, at least for now, we should just throw an error if you try to quotient out a polynomial ring by an ideal of the base ring since you get a "broken" object.
Stopgaps: todo
The following output is generated by the code below using sage-4.7.2:
Here is the code:
Component: basic arithmetic
Stopgaps: todo
Issue created by migration from https://trac.sagemath.org/ticket/12236