I think you slightly missunderstood what I want to implement. The result would still be an algebra over the real numbers, so the problem with the coefficients you mention will not occur. The quaternionification of a real algebra (commutative or not) is still a real algebra, with an additional structure of a bi-module over the quaternions. There isn't much to change in the code; we just have to be careful in the definition of the product of two quaternions, as now the order of operation on the coefficients matters.
On Tuesday, September 3, 2019 at 10:42:46 AM UTC-4, Kalevi Suominen wrote: > > There is a reason why the coefficient ring of an algebra should be > commutative: multiplication is bilinear. > This implies that (ax)y = a(xy) and x(by) = b(xy) for all scalars a, b and > algebra elements x, y. It follows > that we must have (ax)(by) = a(x(by)) = a(b(xy)) = (ab)(xy) and also > (ax)(by) = b((ax)y) = b(a(xy)) = (ba)(xy). > That is hard to arrange if the coefficients a and b do not commute. > > Instead of defining quaternions with non-commutative arguments, I would > try to implement the tensor > product of two algebras. That would not be hard for finite-dimensional > free algebras such as quaternions > and (finite dimensional) Lie algebras. > > Kalevi Suominen > > On Tuesday, September 3, 2019 at 3:33:14 PM UTC+3, Maxence Mayrand wrote: >> >> The current implementation of quaternions (sympy/algebras/quaternion) >> requires that the arguments are commutative expressions. But I can't see a >> good reason for this limitation; quaternions with non-commutative arguments >> make perfect sense and do arise in some areas of mathematics. For example, >> given any non-commutative real algebra, we can consider its >> "quaternionification", i.e. its tensor product with the quaternions over >> the real numbers, which can be viewed as quaternions with non-commutative >> arguments. For instance, quaternionifications of Lie algebras come up >> naturally (at least in my field), and it would be good to be able to >> implement this in SymPy. >> >> I would be happy to make the necessary changes to the quaternion module >> to allow for quaternions with non-commutative arguments. But before I start >> coding, I wanted to see with the SymPy community if this change would be >> likely to be accepted. >> >> Thank you. >> > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/0578bba3-e34a-4d0d-a0a3-bd153ed01321%40googlegroups.com.
