I broadened the purpose of the ticket: Implementing quotients of multivariate polynomial rings via Singular should be just as easy as implementing quotients of g-algebras via Plural.
There is a design problem for the elements, though. I see three approaches:
- Have a single class of elements for quotients and non-quotients. Do a reduction with respect to the modulus (if there is any) when comparing, hashing or printing elements.
- Have two separate classes, essentially copying the old MPolynomial_libsingular class for creating a NCPolynomial_plural class. The change would mainly amount to replacing the strings MP and _libsingular by NCP and _plural, respectively.
- Have two separate classes, but avoid code-duplication. For this to work, one needs to modify the arithmetic methods of MPolynomial_libsingular, such that for example left._add_(right) does not return a new instance of MPolynomial_libsingular, but a new instance of left.__class__.
All three approaches have disadvantages: The first approach may slow down the arithmetic of polynomials, since any call to hash, repr and cmp would involve a test whether the parent is a quotient ring. The second would imply a massive code duplication. The third may, again, slow down arithmetic, since (as in the first approach) arithmetic is spoiled by additional tests.
Modern editors are capable to copy-and-paste, and I prefer speed. Thus, I'll go for the second approach, unless one of you objects.