<jupyter_start><jupyter_text>Spin-Orbit Interaction  Imports<jupyter_code>from IPython.display import display
from sympy import init_printing
init_printing(use_latex=True)
from sympy import factor, pi, S, Sum, symbols
from sympy.physics.quantum.spin import (
    Jminus, Jx, Jz, J2, J2Op, JzKet, JzKetCoupled, Rotation, WignerD, couple, uncouple
)
from sympy.physics.quantum import (
    Dagger, hbar, qapply, represent, TensorProduct
)<jupyter_output><empty_output><jupyter_text>Symbolic calculation If we start with a hydrogen atom, i.e. a nucleus of charge $Ze$ orbited by a single electron of charge $e$ with reduced mass $\mu$, ignoring energy from center-of-mass motion, we can write the Hamiltonian in terms of the relative momentum, $p$, and position, $r$, as:$$H=\frac{p^2}{2\mu} - \frac{Ze^2}{r}$$The resulting eigenfunctions have a seperate radial and angular compents, $\psi=R_{n,l}(r)Y_{l,m}(\phi,\theta)$. While the radial component is a complicated function involving Laguere polynomials, the radial part is the familiar spherical harmonics with orbital angular momentum $\vec{L}$, where $l$ and $m$ give the orbital angular momentum quantum numbers. We represent this as a angular momentum state:<jupyter_code>l, ml = symbols('l m_l')
orbit = JzKet(l, ml)
orbit<jupyter_output><empty_output><jupyter_text>Now, the spin orbit interaction arises from the electron experiencing a magnetic field as it orbits the electrically charged nucleus. This magnetic field is:$$\vec{B} = \frac{1}{c}\frac{Ze\vec{v}\times\vec{r}}{r^3} = \frac{Ze\vec{p}\times\vec{r}}{mcr^3}=\frac{Ze\vec{L}}{mc\hbar r^3}$$Then the spin-orbit Hamiltonian can be written, using the electron's magnetic dipole moment $\mu$, as:$$H_{SO} = -\vec{\mu}\cdot\vec{B} = -\left(-\frac{g\mu_B \vec{S}}{\hbar}\right)\cdot\left(\frac{Ze\vec{L}}{mc\hbar r^3}\right)$$Ignoring the radial term:$$\propto \vec{L}\cdot\vec{S} = J^2 - L^2 - S^2$$for $\vec{J}$, the coupled angular momentum.The electron spin angular momentum is given as $\vec{S}$, where the spin wavefunction is:<jupyter_code>ms = symbols('m_s')
spin = JzKet(S(1)/2, ms)
spin<jupyter_output><empty_output><jupyter_text>From this we build our uncoupled state:<jupyter_code>state = TensorProduct(orbit, spin)
state<jupyter_output><empty_output><jupyter_text>For clarity we will define $L^2$ and $S^2$ operators. These behave the same as `J2`, they only display differently.<jupyter_code>L2 = J2Op('L')
S2 = J2Op('S')<jupyter_output><empty_output><jupyter_text>We also have the spin-orbit Hamiltonian:<jupyter_code>hso = J2 - TensorProduct(L2, 1) - TensorProduct(1, S2)
hso<jupyter_output><empty_output><jupyter_text>Now we apply this to our state:<jupyter_code>apply1 = qapply(hso*state)
apply1<jupyter_output><empty_output><jupyter_text>Note this has not applied the coupled $J^2$ operator to the states, so we couple the states and apply again:<jupyter_code>apply2 = qapply(couple(apply1))
apply2<jupyter_output><empty_output><jupyter_text>We now collect the terms of the sum, since they share the same limits, and factor the result:<jupyter_code>subs = []
for sum_term in apply2.atoms(Sum):
    subs.append((sum_term, sum_term.function))
    limits = sum_term.limits
final = Sum(factor(apply2.subs(subs)), limits)
final<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12953367875647667, 'fraction_numerical': 0.010667479427003962, 'mean_word_length': 6.391891891891892, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '441480', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1116, 'n_words': 323, 'path': 'notebooks/spin_orbit_interaction.ipynb', 'repo_name': 'gvvynplaine/quantum_notebooks', 'size': '3281'}