On Tue, Mar 17, 2009 at 5:14 AM, Simon King <k...@mathematik.uni-jena.de> wrote: > > Dear William, > > On Mar 17, 12:03 pm, William Stein <wst...@gmail.com> wrote: > ... >> > Nevertheless, out of curiosity: Why is there this restriction to the >> > commutative case? >> >> There isn't. Seriously -- the file ideal.py has only one use of >> is_CommutativeRing and that is in the Ideal function. > > See below how I came to my question. > >> But you can >> perfectly well derive from the Ideal_generic class without the ring >> being commutative. You just can't use the ideal function, and you >> have to overload the ideal method in your ring. > > Could you elaborate a bit more on it? Would you be able to produce > left or right ideals by > sage: R*(x,y) > respectively > sage: (x,y)*R > and two-sided ideals by > sage: R*(x,y)*R > ? > This would be nice.
No, not yet. > > The default ideal method does this: > C = self._ideal_class_() > if len(x) == 1 and isinstance(x[0], (list, tuple)): > x = x[0] > return C(self, x, **kwds) > > I implemented a class SymmetricIdeal inheriting from Ideal_generic. My > class SymmetricPolynomialRing provides a method _ideal_class_ that > returns the class SymmetricIdeal (by default, it would return the > Ideal function). > > If SymmetricIdeal inherits from CommutativeRing, it works. > > If it just inherits from Ring, then the attempt to construct an ideal > fails: > sage: X.<x,y> = SymmetricPolynomialRing(QQ) > sage: X*(x[1]*y[2],y[3]) > ERROR: An unexpected error occurred while tokenizing input > The following traceback may be corrupted or invalid > ... > AttributeError: 'SymmetricPolynomialRing_class' object has no > attribute 'ideal_monoid' > > Looking at ZZ.ideal_monoid, I find that there is IdealMonoid, which > merely does the same as IdealMonoid_c. And the latter requires a > commutative ring. > > This is how I came to the conjecture that there is a restriction to > the commutative case. > > So, from the above I would guess that one needs to overload > _ideal_class_() and provide ideal_monoid(), rather than overloading > ideal(). > Could you elaborate more on what you did? > > Cheers, > Simon > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ 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 For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---