Guest User

Untitled

a guest
Nov 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. σ0 = PauliMatrix[0]; (*{{1, 0}, {0, 1}}*)
  2. σ1 = PauliMatrix[1]; (*{{0, 1}, {1, 0}}*)
  3. σ2 = PauliMatrix[2]; (*{{0, -I}, {I, 0}}*)
  4. σ3 = PauliMatrix[3]; (*{{1, 0}, {0, -1}}*)
  5.  
  6. O2 = {{0, 0}, {0, 0}};
  7.  
  8. γ0 = ArrayFlatten[{{σ0, O2}, {O2, σ0}}];
  9. γ1 = ArrayFlatten[{{O2, σ1}, {-σ1, O2}}];
  10. γ2 = ArrayFlatten[{{O2, σ2}, {-σ2, O2}}];
  11. γ3 = ArrayFlatten[{{O2, σ3}, {-σ3, O2}}];
  12.  
  13. MatrixForm[{{O2, σ1}, {-σ1, O2}}]
  14.  
  15. sigma[M__] := Module[{submat, basis, fb, nrm, cf},
  16. submat = Partition[M, {2, 2}, 2]; (*2x2 submatrices*)
  17. basis = {σ0, σ1, σ2, σ3};
  18. fb = Flatten[basis, {{1}, {2, 3}}];
  19. nrm = Diagonal[fb.ConjugateTranspose[fb]]; (*norm of basis*)
  20. cf[m_] := Flatten[m].ConjugateTranspose[fb]/nrm; (*coeff for σ*)
  21. Map[{"I", "σ1", "σ2", "σ3"}.cf[#] &, submat, {2}]]
  22.  
  23. sigma[γ2] // MatrixForm
  24.  
  25. sigma[γ1.γ2] // MatrixForm
  26.  
  27. M = ArrayFlatten@Outer[Times, σ2, σ3];
  28. MatrixForm[M]
  29. sigma[M] // MatrixForm
Add Comment
Please, Sign In to add comment