Introduction to the Pauli package

© Heiko Feldmann 2000

The package "Pauli" is designed to represent square matrices in the basis of Pauli matrices and their higher-rank generalizations.
Its basic function is to translate between normal representations of matrices and the representation as linear combinations of Pauli matrices.
Pauli matrices play an important role in physics, especially in quantum mechanics, but also in the description of rotating solids or in optics etc.

The purpose of this notebook is to give an overview over the functions in Pauli give simple examples for their use.

Needs["Pauli`"]

The Pauli matrices and the outer product

Everything is built up by the 1 + 3  "σ"-matrices

(σ[#]  //  MatrixForm)& /@ {0, 1, 2, 3}

The usual matrix product is the dot product

σ[1] . σ[2] // MatrixForm

The outer product produces larger matrices

σ[0]⊗σ[3]⊗σ[2] // 
      MatrixForm

Every 2x2 matrix can be composed of σ matrices

((a + d)/2) σ[0]  +  ((b + c)/2) σ[1] + 
          (1/2) (I b - I c) σ[2] + 
          ((a - d)/2) σ[3] // Simplify // MatrixForm

Represent a matrix in terms of Pauli matrices: the function σDecomposition

How we got the coefficients in the above example?

σDecomposition[(({{a, b}, {c, d}}))]

σDecomposition also works for larger matrices

m=(({{1, 0, 26, 0}, {0, 1, 0, 0}, {0, 0, -1, 0}, {0, 26, 0, -1}}));
coeffs  =  σDecomposition[m]

?σDecomposition

There is also a function to get a single coefficient in the σ representation

σExtract[m, {3, 0}]

Obtain the standard representation of the matrix from the coefficients: the function σComposition

The inverse of σDecomposition is σComposition

σComposition[coeffs] // MatrixForm

Simple example: Prove the commutator relation of the Pauli matrices

This calculation is done in every quantum mechanics course:
represent the commutator of the Pauli matrices again in terms of Pauli matrices.

commutator[m1_, m2_] := m1 . m2 - m2 . m1;

\(\(Table[
	
      Print["[σ["<>ToString[i]<>"],σ["<>ToString[j]<>
          "]] = ", 
        σDecomposition[commutator[σ[i], σ[j]]] . {
            "σ[0]", "σ[1]", "σ[2]", 
            "σ[3]"}
	], {i, 1, 3}, {j, 1, 3}]; \)\)

Example for higher rank matrices: The Dirac matrices

The Dirac matrices, occuring in quantum field theory, can be seen as a generalization of the Pauli matrices 
(See any textbook on quantum field theory)
In the Weyl representation, they are

\(a = 1; 
b = 2; \)

\(γ[0] = σ[a]⊗\ σ[0]; 

    Table[γ[i] = I\ σ[b]⊗σ[i], {i, 1, 3}]; 
    
γ[5] = I\ γ[0] . γ[1] . γ[2] . γ[3]; 
    
MatrixForm\ /@
      \ {γ[0], γ[1], γ[2], γ[3], γ[5]}\)

Other representations of the Dirac matrices can be obtained by changing a and b, for example the Dirac representation by a=3, b=2.
γ[0]-γ[5] form a Clifford algebra, and together with the commutators (I/2)[γ[μ], γ[⋁]] and γ[μ]γ[5] with μ,⋁ =0...3 they give a basis for the 4x4-matrices, which is in fact only a relabeling of the basis given by the outer products of the Pauli matrices:

γCom[i_, j_] := (I/2) commutator[γ[i], γ[j]];

These are the sixteen elements for the Dirac algebra in four dimensions:

\(\(diracAlgebra = 

      		{IdentityMatrix[4], 
		γ[0], γ[1], γ[2], 
        γ[3], 
		γCom[0, 1], 	γCom[0, 2], 	
        γCom[0, 3], 	γCom[1, 2], 	γCom[1, 3], 	
        γCom[2, 3], 
		γ[0] . γ[5], 
        γ[1] . γ[5], γ[2] . γ[5], 
        γ[3] . γ[5], 
		γ[5]}; \)\)

The function σDecompText2 displays a given (4x4) matrix in terms of Pauli matrices:

\(σText1\  = 
      \ {"σ[0]", "σ[1]", "σ[2]", 
        "σ[3]"}; 

    σText2\  = \ 
      Table[σText1[\([i]\)]<>\ "⊗"<>
          σText1[\([j]\)], {i, 1, 4}, {j, 1, 4}]; 

    σDecompText2[m_] := 
      Flatten[σDecomposition[m]] . Flatten[σText2]; \)

We see directly that the Dirac algebra is a relabeling of the generalized Pauli matrices:

σDecompText2 /@ diracAlgebra  // TableForm