Chapter 6 - Spin

A few new operators (or new names for the same ones!) The three axes, x, y, z spin components can be measured with $SA_x$, $SA_y$, and $SA_z$ devices.

We'll use $\hbar=1$ for numerical results, this is fairly standard practice, but can be tricky to remember.


In [1]:
from numpy import sin,cos,pi,sqrt
from qutip import *

In [2]:
pz = Qobj([[1],[0]])
mz = Qobj([[0],[1]])
px = Qobj([[1/sqrt(2)],[1/sqrt(2)]])
mx = Qobj([[1/sqrt(2)],[-1/sqrt(2)]])
py = Qobj([[1/sqrt(2)],[1j/sqrt(2)]])
my = Qobj([[1/sqrt(2)],[-1j/sqrt(2)]])
Sx = 1/2.0*sigmax()
Sy = 1/2.0*sigmay()
Sz = 1/2.0*sigmaz()

In [8]:
py


Out[8]:
Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\begin{equation*}\left(\begin{array}{*{11}c}0.707\\0.707j\\\end{array}\right)\end{equation*}

Example: determine $P(S_x = \frac{\hbar}{2} ||-y\rangle)$


In [3]:
((px.dag()*my).norm())**2


Out[3]:
0.4999999999999998

Example: verify the commutation relation: $\left[\hat{S}_x,\hat{S}_z\right] = -i\hbar\hat{S}_y$


In [4]:
Sx*Sz - Sz*Sx == -1j*Sy  # remember, h = 1


Out[4]:
True

Ex: find $\langle \hat{S}_x\rangle$ for the state $|\psi\rangle=|+Z\rangle$.


In [5]:
pz.dag()*Sx*pz


Out[5]:
Quantum object: dims = [[1], [1]], shape = (1, 1), type = bra\begin{equation*}\left(\begin{array}{*{11}c}0.0\\\end{array}\right)\end{equation*}

This makes sense given that $S_x$ can be either $\frac{+\hbar}{2}$ or $\frac{-\hbar}{2}$ with equal probability. Similarly, if the state is $|\psi\rangle=|+x\rangle$.


In [6]:
px.dag()*Sx*px


Out[6]:
Quantum object: dims = [[1], [1]], shape = (1, 1), type = bra\begin{equation*}\left(\begin{array}{*{11}c}0.500\\\end{array}\right)\end{equation*}

Again, in units of $\hbar$.


In [ ]: