Working with Quaternions

Although Mathematica provides a package for working with quaternions the Group Theory Package includes some basic functions for working with quaternions represented as a list.

{w,{x,y,z}}w + i x + j y + k z
Let's get started by loading the Group Theory Package
In[1]:=
Click for copyable input
We obtain the quaternion representation of the symmetry element C3z (three-fold rotation about the z-axis) by using GTGetQuaternion.
In[2]:=
Click for copyable input
Out[2]=
GTQuaternionQ[q]gives True if q is a quaternion.
In[40]:=
Click for copyable input
Out[40]=
abmultiplication of two quaternions a and b.
GTQInverse[quaternion]gives the inverse quaternion of a quaternion.
GTQConjugate[quaternion]gives the conjugate quaternion of a quaternion.
The multiplication of two quaternions can be calculated with
In[3]:=
Click for copyable input
Out[3]=
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=
Quaternions form a division ring hence for every quaternion there exists a multiplicative inverse element. Use GTQInverse...
In[6]:=
Click for copyable input
Out[6]=
Out[6]=
In[7]:=
Click for copyable input
Out[7]=
In[8]:=
Click for copyable input
Out[8]=
Obtain the conjugate quaternion by GTQConjugate...
In[9]:=
Click for copyable input
Out[9]=
In[10]:=
Click for copyable input
Out[10]=
In[11]:=
Click for copyable input
Out[11]=
GTQAbs[quaternion]gives the absolute value of a quaternion.
GTQPolar[quaternion]gives the polar angle of a quaternion.
The absolute value of a quaternion can be calculated by GTQAbs...
In[12]:=
Click for copyable input
Out[12]=
The polar angle of a quaternion can be calculated by GTQPolar...
In[13]:=
Click for copyable input
Out[13]=