On Sat, Oct 4, 2014 at 10:44 AM, Nathan Dunfield <[email protected]> wrote: > There's something wrong with comparison operators for elements of > QuaternionAlgebras defined over a number field. Here's a simple example, > where first it gives the wrong answer and then, after doing some arithmetic > with the elements, a mix of right and wrong answers: > > sage: K = NumberField(x**3 + x - 1, 'a') > sage: D.<i,j,k> = QuaternionAlgebra(K, -1, -3) > sage: x = (i + j)/K(2) > sage: z = (-1 + (i + j) + k)/K(2) - x > sage: w = i * x > sage: w, z > (-1/2 + 1/2*k, -1/2 + 1/2*k) > sage: w == z > False > sage: z == w > False > sage: z - w > 0 > sage: z == w, w == w, z-w == 0 > (True, True, False) > > I looked in trac, but I didn't see this. Is this issue already known, and, > if so, is there a simple work-around?
It's probably a flat out major bug. The code (by Jon Bober and me) for basic arithmetic with quaternion algebras is very optimized... and very "ugly" Cython. -- William > Thanks, > > Nathan > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
