Hi Community,
I am working on a tutorial for matrix algebra, I cannot figure out how to make Mathematica identify and replace previously defined symbols in calculations. For example. I have defined
rules = {IdentityMatrix[2] -> Subscript[\[Sigma], 0],
PauliMatrix[1] -> Subscript[\[Sigma], 1],
PauliMatrix[2] -> Subscript[\[Sigma], 2],
PauliMatrix[3] -> Subscript[\[Sigma], 3]}
So when I make
Grid[Join[{Table[PauliMatrix[i] // MatrixForm, {i, 3}]},
Table[MatrixForm[PauliMatrix[i].PauliMatrix[j] /. rules], {i,
3}, {j, 3}]]]
I get Subscript[\[Sigma], 0]
in the diagonal, but cannot figure out how I make Mathematica to identify the other elements as simply products of +/- I
and the other Pauli matrices.
Or simpler put: how do I make Mathematica answer I PauliMatrix[3]
to the input
PauliMatrix[1].PauliMatrix[2]
Kind regards
Mogens
Ps. Is it true that Solve etc. does not work on matrices, or is it just me? (I have tried to specify Matrices[{2,2},Complexes]
as the domain but I get errors or nothing back)