Skip to content

Notebooks for Spin and Geometric Phase

Small matrix calculations make symmetry testable. The projects below start with exact spin rotations and then move to coupled bases, angular functions, and geometric phase. Use the Notebook Index for available downloads and How to Use Computational Notebooks for running a notebook.

Spin Rotations: Check the Direction as Well as the Norm

Section titled “Spin Rotations: Check the Direction as Well as the Norm”

In the SzS_z basis, use Uz(θ)=exp⁡(−iθσz/2)U_z(\theta)=\exp(-i\theta\sigma_z/2) acting on column states. The input ∣+x⟩|+x\rangle should acquire Bloch vector (cos⁡θ,sin⁡θ,0)(\cos\theta,\sin\theta,0). A quarter-turn therefore ends at +y+y.

import numpy as np
sx = np.array([[0, 1], [1, 0]], dtype=complex)
sy = np.array([[0, -1j], [1j, 0]], dtype=complex)
sz = np.diag([1, -1]).astype(complex)
identity = np.eye(2)
psi0 = np.array([1, 1], dtype=complex) / np.sqrt(2)
theta = np.pi / 2
U = np.cos(theta / 2) * identity - 1j * np.sin(theta / 2) * sz
psi = U @ psi0
bloch = np.array([np.vdot(psi, s @ psi).real for s in (sx, sy, sz)])
assert np.allclose(U.conj().T @ U, identity, atol=1e-12)
assert np.allclose(bloch, [0, 1, 0], atol=1e-12)

Replacing UU by U†U^\dagger still passes unitarity and norm checks, but sends this input toward −y-y. That is why a signed observable benchmark is necessary. For an isolated qubit, U(2π)=−IU(2\pi)=-I has no effect on its measurement probabilities; applying the rotation to only one interferometer branch can reveal the relative sign. See Spin Problems.

Project Compute Independent check
Two spin-half systems Build Ji=S1i+S2iJ_i=S_{1i}+S_{2i} in the ordered product basis The singlet has J2=0J^2=0 and the triplet has J2=2ℏ2J^2=2\hbar^2
Clebsch–Gordan coefficients Construct highest-weight vectors and lower them Check normalization, M=m1+m2M=m_1+m_2, and a coefficient with the stated Condon–Shortley sign
Spherical harmonics Integrate products on an angular grid Include sin⁡θ\sin\theta in the measure, refine the grid, and check both normalization and Y11=−3/(8π)sin⁡θeiϕY_1^1=-\sqrt{3/(8\pi)}\sin\theta e^{i\phi}
Zeeman splitting Diagonalize H=−γBSzH=-\gamma B S_z Signed slopes are dEm/dB=−γℏmdE_m/dB=-\gamma\hbar m; a sorted eigenvalue list can exchange labels at crossings
Time reversal Apply Θψ=−iσyψ∗\Theta\psi=-i\sigma_y\psi^* Verify Θ2ψ=−ψ\Theta^2\psi=-\psi and spin expectation reversal for a complex input

A unitary basis-change matrix does not fix its column phases. Likewise, normalized spherical harmonics can still have the wrong phase convention. Compare an explicit coefficient or function as well as structural identities. The conventions are in Clebsch–Gordan Quick Reference and Spherical Harmonics Quick Reference.

For H(n^)=−Δn^⋅σ/2H(\hat{\mathbf n})=-\Delta\hat{\mathbf n}\cdot\boldsymbol\sigma/2, Δ>0\Delta>0, the lower eigenstate is aligned with n^\hat{\mathbf n}. On a latitude θ0\theta_0, its phase around increasing azimuth is −π(1−cos⁡θ0)-\pi(1-\cos\theta_0) modulo 2π2\pi.

On a closed mesh with normalized states uju_j and uN=u0u_N=u_0, use

γN=−arg⁡∏j=0N−1⟨uj∣uj+1⟩.\gamma_N=-\arg\prod_{j=0}^{N-1}\langle u_j|u_{j+1}\rangle.

The minus sign matches A=i⟨u∣du⟩A=i\langle u|du\rangle. Compute the phase through a sum of link arguments to avoid multiplying many small magnitudes:

def berry_latitude(theta0, points, phases=None):
phi = 2 * np.pi * np.arange(points) / points
u = np.column_stack((np.full(points, np.cos(theta0 / 2)),
np.exp(1j * phi) * np.sin(theta0 / 2)))
if phases is not None:
u *= np.exp(1j * phases)[:, None]
links = np.sum(u.conj() * np.roll(u, -1, axis=0), axis=1)
if np.min(np.abs(links)) < 1e-8:
raise ValueError("Refine the mesh: neighboring states are nearly orthogonal")
return np.angle(np.exp(-1j * np.sum(np.angle(links))))
theta0 = 0.8
target = -np.pi * (1 - np.cos(theta0))
for points in (32, 64, 128, 256):
value = berry_latitude(theta0, points)
error = abs(np.angle(np.exp(1j * (value - target))))
print(points, error)

Refine the mesh until the phase error stabilizes below the desired tolerance. Independently rephase each uju_j and verify invariance: the link phases telescope around the closed product. Comparing phases through arg⁡ei(γ−γtarget)\arg e^{i(\gamma-\gamma_{\rm target})} avoids a false error at the principal-argument branch cut.

This overlap calculation uses no time evolution and needs no dynamical-phase subtraction. A separate Schrödinger-evolution experiment must resolve the time step, slow the parameter motion relative to the gap, monitor transitions out of the chosen eigenstate, and remove the dynamical phase. These are different convergence questions.

For a particle of charge qq on a ring of radius RR, periodic wavefunctions give

En(Φ)=ℏ22mR2(n−qΦ2πℏ)2,n∈Z.E_n(\Phi)=\frac{\hbar^2}{2mR^2} \left(n-\frac{q\Phi}{2\pi\hbar}\right)^2,\qquad n\in\mathbb Z.

Shifting the flux by h/∣q∣h/|q| returns the spectrum as a set after relabeling nn. It does not return each fixed-nn branch to itself. On a finite numerical basis, include enough positive and negative nn values that the relevant low-energy levels are unaffected by the cutoff. The Aharonov–Bohm Effect explains the phase interpretation.

For Landau levels, state the geometry before counting degeneracy. A torus requires an integer number of flux quanta, while edges in a finite sample introduce additional dispersing states. A plot alone cannot distinguish those physical changes from a basis cutoff.

  • M. V. Berry, “Quantal phase factors accompanying adiabatic changes,” Proceedings of the Royal Society A 392, 45–57 (1984).
  • C. R. Harris et al., “Array programming with NumPy,” Nature 585, 357–362 (2020).
  • J. J. Sakurai and J. Napolitano, Modern Quantum Mechanics, 3rd ed., Cambridge University Press (2020).
  • L. N. Trefethen and D. Bau III, Numerical Linear Algebra, SIAM (1997).