Consider the following Sage run, from Sage 3.0.3: sage: x1 = PolynomialRing(ZZ, 'x').gen() sage: x2 = PolynomialRing(ZZ, 'x', sparse=True).gen() sage: (x1+x2).parent() Univariate Polynomial Ring in x over Integer Ring sage: (x2+x1).parent() Univariate Polynomial Ring in x over Integer Ring
where we see that the sum of a sparse and a dense polynomial is dense. Then consider this run, which is the same except for exchanging the last two lines: sage: x1 = PolynomialRing(ZZ, 'x').gen() sage: x2 = PolynomialRing(ZZ, 'x', sparse=True).gen() sage: (x2+x1).parent() Sparse Univariate Polynomial Ring in x over Integer Ring sage: (x1+x2).parent() Sparse Univariate Polynomial Ring in x over Integer Ring where we see that the sum of a sparse and a dense polynomial is sparse. This is because: sage: x1.parent() == x2.parent() True and the coercion code believes that if the parents are equal, it doesn't matter which one it picks. First: do people think it's a problem that the results in one Sage run are different from results in another run, depending on which command you happen to type first? If it is a problem, the only way I can think of to fix it is to separate the concepts of mathematical equality and implementation equality for parents, so that users can use mathematical equality if they want, but coercion only looks at implementation equality. Can anybody think of a better way to fix the issue? If we fix the issue by splitting mathematical equality from implementation equality, which concept should get "==", and what name should the other concept get? By the way, this behaves exactly the same in the current coercion branch. Carl --~--~---------~--~----~------------~-------~--~----~ 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://www.sagemath.org -~----------~----~----~----~------~----~------~--~---