Let’s say you want to compute the spin angular momentum operators along the three Cartesian axes for single-spin Hilbert space

    \[ \hat{I}_x = \frac{1}{2}\left( \begin{matrix}0 & 1 \\ 1 & 0 \end{matrix}\right),  \hat{I}_y = \frac{1}{2}\left( \begin{matrix}0 & -1 \\ +1 & 0 \end{matrix}\right),  \hat{I}_z = \frac{1}{2}\left( \begin{matrix}+1 & 0 \\ 0 & -1 \end{matrix}\right).\]

 The codes to generate them is

 

Ix=I(N,1,'x');
Iy=I(N,1,'y');
Iz=I(N,1,'z');

 Equivalently, one may write

 

where the second argument specifies that the operator corresponds to Spin 1. As there’s only a single spin in the Hilbert space, the argument is not necessary.

Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.

x=1;
y=2;

Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.