<jupyter_start><jupyter_text>Chapter 7 - Angular Momentum and Rotation<jupyter_code>from numpy import sqrt, pi, exp, angle
from qutip import *<jupyter_output><empty_output><jupyter_text>Our usual spin operators (spin-1/2)<jupyter_code>pz = basis(2,0)
mz = basis(2,1)
px = 1/sqrt(2)*(pz + mz)
mx = 1/sqrt(2)*(pz - mz)
py = 1/sqrt(2)*(pz + 1j*mz)
my = 1/sqrt(2)*(pz - 1j*mz)
Sx = 1/2.0*sigmax()
Sy = 1/2.0*sigmay()
Sz = 1/2.0*sigmaz()
Splus = Sx + 1j*Sy
Sminus = Sx - 1j*Sy
Splus*pz
Splus*mz<jupyter_output><empty_output><jupyter_text>Define the spin-1 operators. We use J just to keep them apart. Could be S instead.<jupyter_code>Jx = 1/sqrt(2)*Qobj([[0,1,0],[1,0,1],[0,1,0]])
Jy = 1/sqrt(2)*Qobj([[0,-1j,0],[1j,0,-1j],[0,1j,0]])
Jz = Qobj([[1,0,0],[0,0,0],[0,0,-1]])
Jplus = Jx + 1j*Jy
Jminus = Jx - 1j*Jy<jupyter_output><empty_output><jupyter_text>Rotations of spin-1/2<jupyter_code>Rz90 = (-1j*pi/2*Sz).expm()
Rz90
Rz90*px<jupyter_output><empty_output><jupyter_text>Doesn't look like example 7.4 because it's not simplified. How to check:<jupyter_code>exp(-1j*pi/4)*py<jupyter_output><empty_output><jupyter_text>Yes, this agrees. Can also use inner product:<jupyter_code>mx.dag()*Rz90*px
angle(0.707 - 0.707j) == -pi/4<jupyter_output><empty_output><jupyter_text>Find the spin-1 states (the eigenstates of the corresponding matrix)According to the postulates, the allowed values of an observable are the eigenvalues with corresponding eigenstates.We know the matrix representation of Jx, Jy, Jz in the Z-basis so we can find all 9 states (in the Z basis). Why nine? There are three possible values $\hbar$, 0, $-\hbar$ for each of three directions.<jupyter_code>yevals, (yd,y0,yu) = Jy.eigenstates()
zevals, (zd,z0,zu) = Jz.eigenstates()
xevals, (xd,x0,xu) = Jx.eigenstates()
xd = -xd  # fix the signs to match book
yu = -yu  # fix the signs to match book
y0
Rz90 = (-1j*pi/2*Jz).expm()
Rz90*x0
y0
xu<jupyter_output><empty_output><jupyter_text>7.10 A spin-1 particle is measured to have $S_y=\hbar$. What is the probability that a subsequent measurement will yield $S_z=0$? $S_z=\hbar$? $S_z=-\hbar$?<jupyter_code>(z0.dag()*yu).norm()**2
(zu.dag()*yu).norm()**2
(zd.dag()*yu).norm()**2<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17283393501805056, 'fraction_numerical': 0.050090252707581225, 'mean_word_length': 5.842592592592593, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '87686', 'license': 'MIT', 'n_tokens_mistral': 1023, 'n_tokens_neox': 954, 'n_words': 215, 'path': '.ipynb_checkpoints/Chapter 7 - Angular Momentum and Rotation-checkpoint.ipynb', 'repo_name': 'Ashardalon125/Quantum-Resources', 'size': '2216'}