Quaternion

Author

Eric W. Weisstein
February 24, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Algebra/Quaternion.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Quaternion.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

(ℝ^2)

QuaternionU:={{1,0},{0,1}}
QuaternionI:=-{{I,0},{0,-I}}
QuaternionJ:={{0,1},{-1,0}}
QuaternionK:=-{{0,I},{I,0}}
q={QuaternionU,QuaternionI,QuaternionJ,QuaternionK};

MatrixForm[#.#]&/@Rest[q]

MatrixForm[Dot@@Rest[q]]

Outer[Dot,Sequence@@Table[q,{2}],1]/.Thread[q->{1,i,j,k}]/.Thread[(-q)->(-{1,i,j,k})]//TableForm//TraditionalForm

(ℝ^4)

QuaternionI:={{0,1,0,0},{-1,0,0,0},{0,0,0,1},{0,0,-1,0}}
QuaternionJ:={{0,0,0,-1},{0,0,-1,0},{0,1,0,0},{1,0,0,0}}
QuaternionK:={{0,0,-1,0},{0,0,0,1},{1,0,0,0},{0,-1,0,0}}
QuaternionU:=IdentityMatrix[4]

q={QuaternionU,QuaternionI,QuaternionJ,QuaternionK};

MatrixForm[#.#]&/@Rest[q]

MatrixForm[Dot@@Rest[q]]

Outer[Dot,Sequence@@Table[q,{2}],1]/.Thread[q->{1,i,j,k}]/.Thread[(-q)->(-{1,i,j,k})]//TableForm//TraditionalForm

Add-On Package

<<Quaternions`

Tests

QuaternionQ[Quaternion[a,b,c,d]]

QuaternionQ[Quaternion[1,1,0,3]]

Typesetting

FromQuaternion[Quaternion[a,b,c,d]]

FromQuaternion[Quaternion[1,2,3,4]]

Identities

#**#&/@Quaternion@@@IdentityMatrix[4]

NonCommutativeMultiply@@Quaternion@@@(Prepend[#,0]&/@IdentityMatrix[3])

v1={v11,v12,v13};
v2={v21,v22,v23};

q1=Quaternion[s1,Sequence@@v1]**Quaternion[s2,Sequence@@v2]

q2=Quaternion[s1 s2-v1.v2,Sequence@@(s1 v2+s2 v1+Cross[v1,v2])]

q1===q2

q3=Quaternion[s1 s2-v1.v2,Sequence@@(s1 v2+s2 v1-Cross[v1,v2])]

q3===q1

Multiplication Table

Outer[NonCommutativeMultiply,Sequence@@Table[Quaternion@@@IdentityMatrix[4],{2}],1]/.{Quaternion[a_,0,0,0]:>a,Quaternion[0,a_,0,0]:>a i,
Quaternion[0,0,a_,0]:>a j,Quaternion[0,0,0,a_]:>a k}//TableForm//TraditionalForm