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/2abe1db5-85e6-423a-9241-a2c56006a6ec%40googlegroups.com.
