Verification that the algebra of 4x4 matrices is the tensor product of H with H (where H is the algebra of quaternions).
| > | with(LinearAlgebra): |
First some auxiliary 2x2 matrices. These will be used to construct 4x4 matrices:
| > | J:=Matrix([[0,-1],[1,0]]);
JD:=Matrix([[-1,0],[0,1]]); I2:=IdentityMatrix(2); JJ:=Matrix([[0,1],[1,0]]); Z2:=Matrix(2,2,0); |
The matrices I4, IL,JL,KL given below generate one copy of the quaternions
and the matrices I4, IR,JR,KR generate another copy of the quaternions.
(Note that if one replaces IR by -IR, JR by -JR and KR by -KR then I4, IR,JR,KR will generate
an algebra isomorphic to the opposite algebra of H (actually the same as H but with a different basis.)
| > | IL:=Matrix([[J,Z2],[Z2,J]]);
JL:=Matrix([[Z2,JD],[-JD,Z2]]); KL:=Matrix([[Z2,-JJ],[JJ,Z2]]); IR:=Matrix([[-J,Z2],[Z2,J]]); JR:=Matrix([[Z2,I2],[-I2,Z2]]); KR:=Matrix([[Z2,-J],[-J,Z2]]); I4:=IdentityMatrix(4); |
Verification that the matrices I4, IL,JL,KL generate the quaternions and the matrices I4, IR,JR,KR generate another copy of the quaternions.
It suffices to show that IL^2 = -I4, JL^2 = -I4, KL^2 = -I4 and IL.JL.KL = -I4. And similarly for R replacing L. This is verified below.
| > | IL^2 +I4, JL^2 +I4, KL^2 +I4,IL.JL.KL + I4;
IR^2 +I4, JR^2 +I4, KR^2 +I4,IR.JR.KR + I4; |
We now verify that the following 16 matrices are linearly independent and hence form a basis for the 4x4 matrices. Since the 4x4 matrices has dimension 16 they must therefore be a basis for the algebra of 4x4 matrices.
| > | B:=[I4,IL,JL,KL,IR,JR,KR,
IL.IR,IL.JR,IL.KR, JL.IR,JL.JR,JL.KR, KL.IR,KL.JR,KL.KR] : |
| > | A:=simplify(add(a[i]*B[i],i=1..16));
|

![]()
![]()
![]()
![]()
| > | solve({seq(seq(A[i,j]=0,i=1..4),j=1..4)}); |
![]()
We can write an arbitrary 4x4 matrix C as a linear combination of the basis B as follows:
| > | C:=matrix(4,4,(i,j)->c[i,j]); |
Note that the coefficient of I4 is the trace of the matrix C. And it is known for example that trace(AB) = trace(BA).
| > | sol:=op(solve({seq(seq(A[i,j]=C[i,j],i=1..4),j=1..4)},[seq(a[i],i=1..16)])):
for i from 1 to 16 do print(sol[i], "=coefficient of", B[i]); od; |
| > |
| > |