Quaternions with non-commutative arguments

30 views
Skip to first unread message

Maxence Mayrand

unread,
Sep 3, 2019, 8:33:14 AM9/3/19
to sympy
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.

Kalevi Suominen

unread,
Sep 3, 2019, 10:42:46 AM9/3/19
to sympy
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

Maxence Mayrand

unread,
Sep 3, 2019, 10:56:33 AM9/3/19
to sympy
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.
Reply all
Reply to author
Forward
0 new messages