# Tag Info

You could define a function that constructs the product of Pauli matrices as follows. I use KroneckerProduct here because you are planning to form the matrix product with a $2L\times2L$ matrix, so we have to have the Pauli matrices arranged in a corresponding block matrix: pauliProduct[n_] := Module[{l = Length[n]}, Total@MapIndexed[ KroneckerProduct[ ...