Skip to content

Sparse Many-Body Hamiltonians

A local Hamiltonian connects each occupation configuration to relatively few others. Sparse assembly exploits this connectivity, while matrix-free action avoids storing the matrix entirely. Both approaches depend on correct local transition rules and a consistent basis map.

Helpful background. Spin, fermion, and boson bases supply operator actions.

Write H=∑αgαOαH=\sum_\alpha g_\alpha O_\alpha. For each input basis state ∣b⟩|b\rangle, apply each operator product from right to left. If it produces v∣a⟩v|a\rangle, accumulate

Hab+=gαv.H_{ab}\mathrel{+}=g_\alpha v.

The input state labels the column. Accumulation matters because distinct terms can connect the same pair of states. A coordinate-format sparse constructor should sum duplicate entries before compression.

Diagonal terms can be computed directly from occupations. Off-diagonal terms should reuse tested ladder or spin actions. Discard only transitions forbidden by the model or outside a deliberately chosen basis; an unexpected transition outside a conserved sector is an error to investigate.

Coordinate storage is convenient while appending transitions. Compressed sparse row storage is suited to repeated matrix-vector products; compressed sparse column storage can suit factorization workflows. Choose formats after defining the operation rather than repeatedly converting in the solver loop.

A matrix-free application uses the same transitions:

ya=∑b,α: Oα∣b⟩=v∣a⟩gαv xb.y_a=\sum_{b,\alpha:\,O_\alpha|b\rangle=v|a\rangle} g_\alpha v\,x_b.

For DD basis states and O(L)O(L) local transitions per state, the action typically costs O(LD)O(LD); actual connectivity can be reduced by constraints or increased by long-range terms. Storage can be O(D)O(D) plus the basis and work vectors, but repeated decoding and index lookup may dominate runtime.

Parallel column-based action writes to overlapping output entries. Use thread-local accumulation, safe reduction, or a row-oriented scheme; unsynchronized writes can generate nondeterministic numerical errors.

For one particle on two sites with onsite energies ϵ0,ϵ1\epsilon_0,\epsilon_1,

H=(ϵ0−t−t∗ϵ1).H=\begin{pmatrix}\epsilon_0&-t\\-t^*&\epsilon_1\end{pmatrix}.

Build it once from explicit operators and once from transitions. A complex hopping tt tests adjoints that real benchmarks miss. The eigenvalues are

E±=ϵ0+ϵ12±(ϵ0−ϵ12)2+∣t∣2.E_\pm=\frac{\epsilon_0+\epsilon_1}{2} \pm\sqrt{\left(\frac{\epsilon_0-\epsilon_1}{2}\right)^2+|t|^2}.

Check that reversing a directed hopping uses the conjugate. If the input term list already contains both directions, automatically adding a Hermitian conjugate doubles the hopping.

Set ϵ0=ϵ1=0\epsilon_0=\epsilon_1=0, t=it=i, and use units ℏ=1\hbar=1 with the hopping magnitude as the energy unit. Then H=σyH=\sigma_y, and evolution for duration τ\tau from (1,0)T(1,0)^T gives (cos⁡τ,sin⁡τ)T(\cos\tau,\sin\tau)^T. Accidentally assembling HT=−HH^T=-H gives (cos⁡τ,−sin⁡τ)T(\cos\tau,-\sin\tau)^T. At τ=π/4\tau=\pi/4 both implementations have identical site probabilities and eigenvalues, but ⟨σx⟩\langle\sigma_x\rangle is respectively +1+1 and −1-1. A phase-sensitive observable therefore supplies a stronger assembly test than the spectrum and norm together.

For duplicate accumulation, split one hopping coefficient into two contributions whose sum is the intended tt, and add a pair of canceling diagonal terms. The assembled action must remain identical before and after this algebraic rewriting. This checks the summation semantics without depending on a particular sparse library.

Test ∥H−H†∥\|H-H^\dagger\| for a stored matrix. For matrix-free action, compare ⟨x,Hy⟩\langle x,Hy\rangle with ⟨Hx,y⟩\langle Hx,y\rangle for several independent complex vectors, and compare against a small explicit reference.

Check known conserved quantities via commutator action and compare diagonal traces where analytic counts are available. These tests do not establish every matrix element, so retain a small basis-by-basis comparison as well. A single matching ground-state energy is too weak to certify assembly.

Matrix entries can cancel exactly. Sum duplicates before deciding sparsity or dropping tiny values. An arbitrary magnitude threshold can remove small but physically relevant couplings and should be treated as an additional controlled approximation.

Why can a Hamiltonian assembled with transposed row and column indices have the right eigenvalues and still produce wrong dynamics?

Solution

A matrix and its transpose have the same characteristic polynomial. For a Hermitian matrix with complex hopping, transposition complex-conjugates the physical phases and can reverse current-related observables. Testing complex-vector action or a flux-sensitive observable detects an error that a spectrum comparison misses.

  • SciPy developers, “Sparse arrays”, SciPy documentation — sparse formats, duplicate entries, and linear operators.
  • Weinberg, P., and Bukov, M., “QuSpin. Part II: bosons, fermions and higher spins,” SciPost Physics 7, 020 (2019), arXiv:1804.06782.