spinmatrixX

◼ spinmatrixX[S] returns the matrix of the X component of the spin operator for arbitrary spin S. 
◼ spinmatrixY[S] returns the matrix of the Y component of the spin operator.
◼ spinmatrixZ[S] returns the matrix of the Z component of the spin operator.
◼ spinmatrixP[S] returns the matrix of the spin-raising operator.
◼ spinmatrixM[S] returns the matrix of the spin-lowering operator.

◼ See also: spinx, spiny, spinz, spinplus, spinminus, PauliX, PauliY, PauliZ, PauliPlus, PauliMinus.

Further examples

Load sneg

<< sneg`sneg`;

Spin matrixes for S=1/2

MatrixForm /@ (#[1/2] &) /@ {spinmatrixX, spinmatrixY, 
          spinmatrixZ, spinmatrixP, spinmatrixM}

They are equal to the Pauli matrices multiplied by 1/2.

(#[1/2] &) /@ {spinmatrixX, spinmatrixY, spinmatrixZ, spinmatrixP, 
          spinmatrixM} == 
      1/2 {PauliX, PauliY, PauliZ, PauliPlus, PauliMinus}

Spin matrixes for S=1

MatrixForm /@ (#[1] &) /@ {spinmatrixX, spinmatrixY, spinmatrixZ, 
          spinmatrixP, spinmatrixM}

Spin matrixes for S=3/2

MatrixForm /@ (#[3/2] &) /@ {spinmatrixX, spinmatrixY, 
          spinmatrixZ, spinmatrixP, spinmatrixM}

Spin matrixes for S=2

MatrixForm /@ (#[2] &) /@ {spinmatrixX, spinmatrixY, spinmatrixZ, 
          spinmatrixP, spinmatrixM}

Verify SU(2) anti-commutation relations for S=2 representation

{sx, sy, 
          sz} = #[2] & /@ {spinmatrixX, spinmatrixY, 
            spinmatrixZ};
sx . sy - sy . sx == I sz
sy . sz - sz . sy == I sx
sz . sx - sx . sz == I sy