FCMatrixProduct
FCMatrixProduct[mat1, mat2, ...]
can be used to obtain products of matrices with entries containing noncommutative symbols. Using the usual Dot
on such matrices would otherwise destroy the original ordering.
The resulting expression can be then further simplified using DotSimplify
.
See also
Overview, DataType, DeclareNonCommutative, UnDeclareNonCommutative.
Examples
Generic matrices
Consider two generic 2×2-matrices containing noncommutative heads
DeclareNonCommutative[opA, opB, opC, opD]
mat[1] = {{opA[1], opB[1]}, {opC[1], opD[1]}}
mat[2] = {{opA[2], opB[2]}, {opC[2], opD[2]}}
(opA(1)opC(1)opB(1)opD(1))
(opA(2)opC(2)opB(2)opD(2))
Using the usual Dot
product the elements of the resulting matrix are now multiplied with each other commutatively. Hence, the result is incorrect.
(opA(1)opA(2)+opB(1)opC(2)opA(2)opC(1)+opC(2)opD(1)opA(1)opB(2)+opB(1)opD(2)opB(2)opC(1)+opD(1)opD(2))
With FCMatrixProduct
the proper ordering is preserved
FCMatrixProduct[mat[1], mat[2]]
(opA(1).opA(2)+opB(1).opC(2)opC(1).opA(2)+opD(1).opC(2)opA(1).opB(2)+opB(1).opD(2)opC(1).opB(2)+opD(1).opD(2))
We can also multiply more than two matrices at once
mat[3] = {{opA[3], opB[3]}, {opC[3], opD[3]}}
(opA(3)opC(3)opB(3)opD(3))
out = FCMatrixProduct[mat[1], mat[2], mat[3]]
(opB(1).(opC(2).opA(3)+opD(2).opC(3))+opA(1).(opA(2).opA(3)+opB(2).opC(3))opC(1).(opA(2).opA(3)+opB(2).opC(3))+opD(1).(opC(2).opA(3)+opD(2).opC(3))opA(1).(opA(2).opB(3)+opB(2).opD(3))+opB(1).(opC(2).opB(3)+opD(2).opD(3))opC(1).(opA(2).opB(3)+opB(2).opD(3))+opD(1).(opC(2).opB(3)+opD(2).opD(3)))
Now use DotSimplify
to expand noncommutative products
(opA(1).opB(2).opC(3)+opB(1).opC(2).opA(3)+opA(1).opA(2).opA(3)+opB(1).opD(2).opC(3)opD(1).opC(2).opA(3)+opC(1).opA(2).opA(3)+opC(1).opB(2).opC(3)+opD(1).opD(2).opC(3)opA(1).opB(2).opD(3)+opA(1).opA(2).opB(3)+opB(1).opC(2).opB(3)+opB(1).opD(2).opD(3)opC(1).opA(2).opB(3)+opC(1).opB(2).opD(3)+opD(1).opC(2).opB(3)+opD(1).opD(2).opD(3))
Dirac matrices in terms of Pauli matrices
Let us define Dirac matrices in the Dirac basis in terms of Pauli matrices
gamma[0] = {{1, 0}, {0, -1}};
gamma[i_] := {{0, CSI[i]}, {-CSI[i], 0}};
and express γiγjγi as a 2×2-matrix
FCMatrixProduct[gamma[i], gamma[j], gamma[i]]
DotSimplify[%]
(0.(σj.(−σi)+0.0)+σi.(0.(−σi)+(−σj).0)0.(0.(−σi)+(−σj).0)+(−σi).(σj.(−σi)+0.0)0.(0.σi+σj.0)+σi.((−σj).σi+0.0)0.((−σj).σi+0.0)+(−σi).(0.σi+σj.0))
(0σi.σj.σi−σi.σj.σi0)