Quantum matrix diagonalization visualized
We show how to visualize the process of diagonalizing the Hamiltonian matrix to find the energy eigenvalues and eigenvectors of a generic one-dimensional quantum system. Starting in the familiar sine-wave basis of an embedding infinite square well, we display the Hamiltonian matrix graphically with the basis functions alongside. Each step in the diagonalization process consists of selecting a nonzero off-diagonal matrix element, then rotating the two corresponding basis vectors in their own subspace until this element is zero. We provide Mathematica code to display the effects of these rotations on both the matrix and the basis functions. As an electronic supplement we also provide a JavaScript web app to interactively carry out this process.