Within the past few weeks, I have been encountering and coding into my Python programs scripts for handling Quaternion Mathematics. Quaternion Algebra and Calculus is still a relatively new concept to me, so I'm still doing research on how Quaternions interact with various other values, such as Scalars, Tensors, and other Quaternions.

My question today has to do with Addition. Addition involving two quaternions is done on a 'per element' basis: if $q_0 = A + Bi + Cj + Dk$ and $q_1 = W + Xi + Yj + Zk$, with ${A, B, C, D, W, X, Y, Z} \in \mathbb R$ then

$$q_0 + q_1 = (A + W) + (B + X)i + (C + Y)j + (D + Z)k$$

My question now involves Quaternion Addition with a Scalar. Is a Scalar in this case to be represented as a Quaternion with $Bi + Cj + Dk = 0$? Is it even possible to add these two things directly? Or is there no such way or reason to perform this operation? I merely ask so as to determine whether or not to implement such functionality within my Python class...

  • $\begingroup$ In short, is Addition a defined operation for a Quaternion and a Scalar? $\endgroup$ – S. Gamgee Sep 7 '16 at 20:39
  • $\begingroup$ We embed the reals into the quaternions, by which the addition is indeed just such that the $i,j,k$ components are left untouched. $\endgroup$ – Hagen von Eitzen Sep 7 '16 at 20:40
  • $\begingroup$ Ahh, so in this particular example, if s = 12, then the sum s + q0 would be (a + s) + bi + cj + dk? $\endgroup$ – S. Gamgee Sep 7 '16 at 20:42
  • $\begingroup$ I wonder if that unesplained downvote was the result of a misunderstanding of what you meant by "Python class" $\ddot{\frown}$. $\endgroup$ – Rob Arthan Sep 7 '16 at 21:07

By "scalar", I believe you mean a real number. It is normal to identify the real numbers $\Bbb{R}$ as a subalgebra of the quaternions $\Bbb{H}$, by identifying $x \in \Bbb{R}$ with $x + 0i + 0j + 0k$. So you work as if $\Bbb{R} \subseteq \Bbb{H}$. Operations between "scalars" and quaternions are then just special cases of the quaternion operations. In the usual mathematical notation, this is virtually invisible: the sum $x + (a + bi+cj+dk)$ of the real number $x$ and the quaternion $a +bi+cj+dk$ is $(x + a) + bi + cj+dk$: if you drop the brackets (because "addition is associative") you can't tell the difference. Of course, this is likely to look a bit more clunky in a programming language that doesn't allow you the freedom to overload operators that we enjoy in traditional mathematical notations.

As an aside: you can similarly identify the complex numbers $\Bbb{C}$ with a subalgebra of $\Bbb{H}$ by identifying $x + yi$ with $x + yi + 0j + 0k$, but that is not the only possibility: given any purely imaginary quaternion $u = bi + cj + dk$ with $b^2 + c^2 + d^2 = 1$, you can identify $ x + yi$ with $x + yu$. The quaternions have only one subalgebra isomorphic to the real numbers, but they have an abundance of subalgebras isomorphic to the complex numbers, one for each point $(b, c, d)$ on the unit sphere in $\Bbb{R}^3$.

  • $\begingroup$ Ok, so I also guess that the respective rules then apply as well to performing addition using a Quaternion and a Tensor. If given a vector written as a complex number (like v = pi + qj + rk), then the results of adding v + q0 would be a + (b + p)i + (c + q)j + (d + r)k, right? $\endgroup$ – S. Gamgee Sep 7 '16 at 21:27
  • $\begingroup$ That sounds good for adding quaternions to vectors in $\Bbb{R}^3$ (identified with the purely imaginary quaternions). I don't know what you mean by "tensor" in this contet. $\endgroup$ – Rob Arthan Sep 7 '16 at 22:01
  • $\begingroup$ When I use the term Tensor, I've been referring to the family of geometric entities that includes Scalars (1st Order Tensor), Vectors/Dyads (2nd Order Tensor), Triads (3rd), etc. In my particular application, I'm only concerned with the context of "Tensor" as it applies to Scalars and Vectors, therefore, we do not need to concern ourselves with a proper definition of them outside of these two mathematical entities. $\endgroup$ – S. Gamgee Sep 8 '16 at 14:33
  • $\begingroup$ Thanks for the explanation. $\endgroup$ – Rob Arthan Sep 8 '16 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.