From Matrix Mechanics to Quantum Circuits: Computational Reproduction of Two Spin- 1 2 Angular-Momentum Coupling Using MATLAB and PennyLane
Sayed Mohammad Badiezadegan
Abstract
The coupling of two spin-1/2 systems is a canonical example of composite-state construction, angular-momentum addition, exchange symmetry, and quantum entanglement. This article develops a reproducible computational treatment of the problem using two complementary frameworks. MATLAB is used to implement the conventional matrix-mechanics description through vectors, Kronecker products, Hermitian operators, eigendecomposition, density matrices, and partial traces. PennyLane is used to implement the same states using quantum gates, QNodes, state-vector simulation, observable expectation values, finite-shot sampling, and reduced-density-matrix measurements. The singlet and triplet sectors are derived analytically and verified numerically to be eigenstates of the total-spin operators S^2 and Sz. Fidelity is used to compare the state vectors of MATLAB and PennyLane while accounting for the physically irrelevant global phase. Single-particle Bloch vectors and reduced density matrices are employed to show that the entangled states have maximally mixed local states, so their individual Bloch vectors vanish even though the global two-qubit states are pure. A basis-change circuit is further introduced to distinguish the relative phase of the singlet and m = 0 triplet states, which cannot be resolved by computational-basis populations alone. The study provides a bridge between textbook angular-momentum theory, classical scientific computing, and modern gate-based quantum programming.