On Nov 2, 2006, at 11:11 PM, Robert Bradshaw wrote:
>> This is much harder. I agree it would be nice, but how would you >> handle something like >> >> sage: R.<x> = ZZ["x"] >> sage: S.<y> = ZZ["y"] >> sage: x*y >> >> ?? >> >> David > > Now you could return that as an element of ZZ['x', 'y'], but I'm not > sure that would be a good idea. (non-common parents could be good > runtime indicators that something could be wrong, and efficiency > could really drop...) Hmmm... it sounds like what you're asking for is the following. If x is in R, and y is in S, and there is a natural coercion from R to T and a natural coercion from S to T, then sage: x * y should be smart enough to coerce both into T, and perform the multiplication there. (I've left out complications involving scalar multiplications...) Also, I guess you want T to be minimal in some sense. One thing I definitely don't like about this is that the multiplication operator has to conjure up a whole new ring. But I guess this already happens for things like this: sage: R.<x> = PolynomialRing(ZZ) sage: (x/2).parent() Fraction Field of Univariate Polynomial Ring in x over Integer Ring Must sleep now. David --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---