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 basis, use acting on column states. The input should acquire Bloch vector . A quarter-turn therefore ends at .
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 / 2U = np.cos(theta / 2) * identity - 1j * np.sin(theta / 2) * szpsi = U @ psi0bloch = 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 by still passes unitarity and norm checks, but sends this input toward . That is why a signed observable benchmark is necessary. For an isolated qubit, has no effect on its measurement probabilities; applying the rotation to only one interferometer branch can reveal the relative sign. See Spin Problems.
Coupled Bases and Angular Functions
Section titled “Coupled Bases and Angular Functions”| Project | Compute | Independent check |
|---|---|---|
| Two spin-half systems | Build in the ordered product basis | The singlet has and the triplet has |
| Clebsch–Gordan coefficients | Construct highest-weight vectors and lower them | Check normalization, , and a coefficient with the stated Condon–Shortley sign |
| Spherical harmonics | Integrate products on an angular grid | Include in the measure, refine the grid, and check both normalization and |
| Zeeman splitting | Diagonalize | Signed slopes are ; a sorted eigenvalue list can exchange labels at crossings |
| Time reversal | Apply | Verify 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.
Berry Phase from Eigenvector Overlaps
Section titled “Berry Phase from Eigenvector Overlaps”For , , the lower eigenstate is aligned with . On a latitude , its phase around increasing azimuth is modulo .
On a closed mesh with normalized states and , use
The minus sign matches . 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.8target = -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 and verify invariance: the link phases telescope around the closed product. Comparing phases through 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.
Flux and Boundary Conditions
Section titled “Flux and Boundary Conditions”For a particle of charge on a ring of radius , periodic wavefunctions give
Shifting the flux by returns the spectrum as a set after relabeling . It does not return each fixed- branch to itself. On a finite numerical basis, include enough positive and negative 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.
References
Section titled “References”- 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).