Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Sparse Hermitian Eigenproblems

    A double-well Hamiltonian can have two energies close to one while their difference is only one part in a million. Which accuracy should an eigensolver deliver: six digits in each energy, or a reliable tunneling splitting? These are different requirements. An accurate solution of a finite matrix is also not yet an accurate solution of the differential operator from which that matrix was made.

    We derive the projection and residual estimates behind sparse Hermitian eigensolvers, then calculate low double-well levels in a spatial grid and an oscillator basis. The calculation separates iteration, finite spacing, finite domain and basis truncation. It retains cases where a successful library return does not meet a separately recomputed residual test.

    Preparation: The finite-difference article introduces sparse matrices and residuals; spectral collocation distinguishes a finite-box problem from a whole-line problem. The physical interpretation of the doublet is developed in tunnel splitting.

    Specify the Hamiltonian and its domain

    Use the established dimensionless quartic Hamiltonian

    Hg=−g2d2dx2+(x2−1)22g,g>0.H_g=-\frac g2\frac{d^2}{dx^2}+\frac{(x^2-1)^2}{2g},\qquad g>0.

    Its full-line realization is the self-adjoint operator associated with the closed form

    hg[ψ]=g2∫R∣ψ′∣2dx+12g∫R(x2−1)2∣ψ∣2dx,\mathfrak h_g[\psi]=\frac g2\int_{\mathbb R}|\psi'|^2dx +\frac1{2g}\int_{\mathbb R}(x^2-1)^2|\psi|^2dx,

    on functions for which these terms and the L2L^2 norm are finite. The confining potential gives a discrete spectrum. Reflection commutes with HgH_g, so the eigenfunctions can be chosen even or odd. In this one-dimensional problem their ordered parities alternate; the ground state is even. We seek three states in each sector and the splitting

    Δ=Eodd,0−Eeven,0>0.\Delta=E_{\mathrm{odd},0}-E_{\mathrm{even},0}>0.

    The opening double-well spectrum uses HϵH_\epsilon with g=2ϵg=2\epsilon. To compare its table with ours multiply the energies by 2/ϵ2/\epsilon. The instanton article uses HgH_g directly. Here g=0.2g=0.2 is the primary case and g=0.08g=0.08 tests the smaller splitting. These are quantum-mechanical examples of spectral resolution, not a calculation of a field-theory mass gap.

    Two approximations will be used. A spatial grid first imposes walls at x=±Rx=\pm R and then discretizes the interior. An oscillator basis lives on the full line but retains finitely many functions. Their error controls are consequently different.

    Rayleigh–Ritz separates the space from the solver

    Let the columns of VV be orthonormal trial vectors and write u=Vyu=Vy. Orthogonality of the residual to the trial space gives

    V†(AVy−θVy)=0,Ty=θy,T=V†AV.V^\dagger(AVy-\theta Vy)=0, \qquad T y=\theta y, \qquad T=V^\dagger A V.

    For a Hermitian AA, TT is Hermitian. This is Rayleigh–Ritz: diagonalize the restriction of the quadratic form to the trial space. The same construction applies to trial functions in the form domain of HgH_g. For ordered low levels, the minimum–maximum principle makes their Ritz values upper bounds; enlarging a nested trial space cannot increase them in exact arithmetic. Saad, §4.3.2, Proposition 4.4 (PDF) develops the finite-dimensional projection principle.

    There are two distinct spaces in our oscillator calculation. First select the finite oscillator space, producing AA. Then an iterative eigensolver searches a smaller Krylov space inside that matrix problem. Tightening its tolerance changes the second approximation. It does not add oscillator functions or move a spatial wall. Changing the oscillator length also changes the trial spaces, so a monotonicity argument between different lengths is not automatic. Centered finite differences are not the same conforming Ritz construction and need their own refinement study.

    For a normalized approximate eigenvector vv, recompute

    r=Av−θv.r=Av-\theta v.

    Expanding vv in an orthonormal eigenbasis proves

    min⁡j∣λj−θ∣≤∥r∥2.\min_j|\lambda_j-\theta|\leq\lVert r\rVert_2.

    The bound identifies some nearby eigenvalue of this matrix. It does not count missing modes, identify a particular level, or bound the error from the matrix to the continuum operator. Parity, ordered reference levels and convergence provide that additional information. A small spectral gap also makes an individual eigenvector less well determined, even when its eigenvalue is accurate. The relevant gap-dependent estimate is derived in Exercise 1. See Saad, §3.2.2, Corollary 3.3 and Theorem 3.9 (PDF).

    Lanczos builds a small spectral problem

    Starting from a normalized v1v_1, the Krylov space is

    Km(A,v1)=span⁡{v1,Av1,…,Am−1v1}.\mathcal K_m(A,v_1)=\operatorname{span}\{v_1,Av_1,\ldots,A^{m-1}v_1\}.

    For Hermitian AA, orthogonalization reduces in exact arithmetic to a three-term recurrence. Set v0=0v_0=0 and β0=0\beta_0=0; at step jj form

    w=Avj−βj−1vj−1,αj=vj†w,w=Av_j-\beta_{j-1}v_{j-1},\qquad \alpha_j=v_j^\dagger w, w←w−αjvj,βj=∥w∥2,vj+1=w/βj.w\leftarrow w-\alpha_jv_j,\qquad \beta_j=\lVert w\rVert_2,\qquad v_{j+1}=w/\beta_j.

    If βj=0\beta_j=0, the generated space is invariant and this recurrence terminates. Otherwise the projected matrix TmT_m is real symmetric and tridiagonal, with diagonal αj\alpha_j and off-diagonal βj\beta_j. The matrix identity is

    AVm=VmTm+βmvm+1emT.A V_m=V_mT_m+\beta_m v_{m+1}e_m^T.

    For a normalized eigenvector Tmy=θyT_m y=\theta y, the Ritz vector u=Vmyu=V_m y therefore has

    Au−θu=βmvm+1emTy,∥Au−θu∥2=βm∣emTy∣.Au-\theta u=\beta_m v_{m+1}e_m^Ty, \qquad \lVert Au-\theta u\rVert_2=\beta_m|e_m^Ty|.

    This cheap residual estimate explains why one need not diagonalize the large matrix at every step. The recurrence and residual relation appear in Saad, Algorithm 6.5 and Proposition 6.8, pp. 130–131 and 137–138 (PDF).

    Finite precision weakens the global orthogonality promised by the three-term recurrence. Reorthogonalization and restart strategies control storage and repeated directions; an apparent repeated Ritz value need not represent a physical degeneracy. Our production calculation uses SciPy's implicitly restarted Lanczos interface, rather than claiming that the bare recurrence is a robust replacement for it. We check orthogonality of the returned eigenvectors. The public interface does not expose every internal Lanczos vector, so this check is not a measurement of its complete internal basis.

    A start vector confined to one exact symmetry sector cannot generate the other sector in exact arithmetic. We solve the even and odd matrices separately and use two specified starts within each. Accidental floating-point symmetry leakage is not a reliable mode-search strategy.

    Shift-invert changes what is easy to find

    Small eigenvalues can be slow to isolate by repeated multiplication with AA. For a real shift σ\sigma outside its spectrum, use

    B=(A−σI)−1,Bv=μv,μ=1λ−σ.B=(A-\sigma I)^{-1},\qquad Bv=\mu v,\qquad \mu=\frac1{\lambda-\sigma}.

    Eigenvalues close to σ\sigma become large in magnitude. Implementation means factoring A−σIA-\sigma I once and solving a linear system for each application of BB; it does not mean storing a dense inverse. We take σ=0\sigma=0, below the positive double-well spectrum. The which='LM' selection then concerns the transformed eigenvalues. Without this transformation, which='SA' requests the smallest algebraic eigenvalues of AA. These meanings are specified by the SciPy 1.13.1 eigsh documentation.

    A residual for the transformed problem is not the original residual. If rB=Bv−μvr_B=Bv-\mu v and θ=σ+1/μ\theta=\sigma+1/\mu, then

    rA=(A−θI)v=−1μ(A−σI)rB.r_A=(A-\theta I)v=-\frac1\mu(A-\sigma I)r_B.

    We always recompute rAr_A. The tradeoff is also computational: a triangular solve and a sparse multiplication are different operations, and a factorization has a setup cost. Saad, §8.1.1, pp. 193–194 (PDF) explains this tradeoff. Iteration counts alone are not a universal speed comparison.

    Construct two representations of the double well

    A parity fold of the Dirichlet grid

    Let h=R/nh=R/n and retain the full-grid points xj=jhx_j=jh, with j=−n+1,…,n−1j=-n+1,\ldots,n-1. The endpoints ±R\pm R are fixed to zero. Its real symmetric matrix has

    Ajj=gh2+(xj2−1)22g,Aj,j+1=−g2h2.A_{jj}=\frac g{h^2}+\frac{(x_j^2-1)^2}{2g},\qquad A_{j,j+1}=-\frac g{2h^2}.

    For j>0j>0, the normalized even and odd basis vectors are

    ∣j,±⟩=∣j⟩±∣−j⟩2.|j,\pm\rangle=\frac{|j\rangle\pm|-j\rangle}{\sqrt2}.

    The even sector also contains ∣0⟩|0\rangle. Thus its first hopping is −2g/(2h2)-\sqrt2 g/(2h^2), while the odd sector begins at j=1j=1. This is an exact isometric reduction of the full grid. It preserves symmetry without imposing an unsymmetric one-sided approximation at the center. With unit Euclidean norm for a full-grid coefficient vector cc, the corresponding samples are ψj=cj/h\psi_j=c_j/\sqrt h.

    The retained grid sequence is R=3R=3 with h=0.02h=0.02, 0.010.01, 0.0050.005 and 0.00250.0025. A separate g=0.2g=0.2 scan holds h=0.005h=0.005 while changing RR through 22, 2.52.5, 33 and 3.53.5. A direct tridiagonal solve of each finite matrix supplies a comparison for the iterative calculation; it is not called a continuum answer.

    An oscillator basis on the full line

    For a positive oscillator length ll, write

    x=l2(a+a†),p=−i2l(a−a†),[a,a†]=1.x=\frac l{\sqrt2}(a+a^\dagger),\qquad p=-\frac{i}{\sqrt2l}(a-a^\dagger),\qquad [a,a^\dagger]=1.

    With PNP_N projecting onto the first NN oscillator functions, the matrix is

    AN=PN[g2p2+x4−2x2+12g]PN.A_N=P_N\left[\frac g2p^2+ \frac{x^4-2x^2+1}{2g}\right]P_N.

    The polynomial powers must be formed before projection. For example, PNx4PNP_Nx^4P_N contains paths through intermediate oscillator states outside the retained space; (PNxPN)4(P_NxP_N)^4 generally misses them. The companion forms powers with four auxiliary states and then restricts. Its independent small-matrix check integrates the oscillator functions and their derivatives with Gauss–Hermite quadrature.

    We use l=0.4l=0.4 and N=40N=40, 6464, 100100 and 160160. The existing instanton companion already retains N=160N=160 reference levels and evidence from a changed-length N=200N=200 comparison. Those results are reused without rerunning its suite. New matched direct solves also check all six levels of the sparse matrices.

    A separate harmonic control replaces the potential by x2/(2g)x^2/(2g). At l=gl=\sqrt g its matrix is diagonal with entries n+1/2n+1/2. The maximum matrix error is 3.6×10−153.6\times10^{-15}. The quartic matrix agrees with independent oscillator-function integrals within 6.3×10−146.3\times10^{-14}; changing the quadrature order changes that check by 1.3×10−131.3\times10^{-13}.

    What the calculation resolves

    The following six levels are from the N=160N=160, l=0.4l=0.4 sparse oscillator calculation. Digits are rounded to the scale supported by the comparisons, rather than printed to the full precision of the stored numbers.

    Parity and sector levelg=0.2g=0.2g=0.08g=0.08
    Even, 000.93456414410.93456414410.97899504200.9789950420
    Odd, 000.94965192540.94965192540.97899626540.9789962654
    Even, 112.35424628062.35424628062.84367828602.8436782860
    Odd, 112.71212590622.71212590622.84386348932.8438634893
    Even, 223.67147512553.67147512554.53104000034.5310400003
    Odd, 224.63126311354.63126311354.54129232054.5412923205

    The splittings are approximately 0.015087781320.01508778132 and 1.22349031×10−61.22349031\times10^{-6}. For the smaller gap, the distinction between iteration and representation is especially visible:

    Grid spacing hhRelative gap difference, FDOscillator dimension NNRelative gap difference, oscillator
    0.020.021.84×10−21.84\times10^{-2}40401.06×10−11.06\times10^{-1}
    0.010.014.59×10−34.59\times10^{-3}64645.41×10−55.41\times10^{-5}
    0.0050.0051.15×10−31.15\times10^{-3}1001001.81×10−91.81\times10^{-9}
    0.00250.00252.87×10−42.87\times10^{-4}1601601.09×10−91.09\times10^{-9}

    Both columns compare with the actually retained oscillator reference, and the rows are not matched computational budgets. The last oscillator differences reflect arithmetic and reference sensitivity, not evidence for another convergence order. The FD error decreases approximately quadratically even though its individual matrix eigenpairs have much smaller iterative errors. Removing the leading h2h^2 term with the two finest gaps gives a relative difference of about 5.9×10−85.9\times10^{-8} in this run; extrapolation and reference agreement are diagnostics, not certified error bounds.

    At fixed g=0.2g=0.2 and h=0.005h=0.005, moving the wall from R=2R=2 to 2.52.5 changes the sixth level by about 2.09×10−42.09\times10^{-4}. Moving it from 2.52.5 to 33 changes that level by about 10−1210^{-12}. This controls the domain for these six states at that spacing; it does not remove their remaining grid error.

    The small double-well splitting converges quadratically with grid spacing and rapidly with oscillator dimension, while tighter solver tolerances eventually encounter original-residual floors.

    For g=0.08g=0.08, representation error in the splitting remains after the finite matrix is accurately solved. The residual panel holds the grid fixed at R=3R=3, h=0.005h=0.005, uses the even sector and the first declared start, and reports the maximum original-operator residual over three returned states. The lower tolerance parameter does not force residuals below the arithmetic floor.

    For a concrete cost comparison, at g=0.2g=0.2, R=3R=3, h=0.005h=0.005, the even-sector calculation with the first start gives:

    Method and requested toleranceMatrix productsFactorizationsSolve pairsLargest ∥rA∥2\lVert r_A\rVert_2
    Smallest algebraic, 10−610^{-6}1594159400003.60×10−63.60\times10^{-6}
    Smallest algebraic, 10−1010^{-10}2411241100002.28×10−102.28\times10^{-10}
    Smallest algebraic, 10−1310^{-13}3019301900002.93×10−112.93\times10^{-11}
    Shift-invert, 10−1010^{-10}001124243.37×10−123.37\times10^{-12}

    A solve pair means the forward and backward triangular solves for one inverse application. Diagnostic residual products and matched direct reference solves are excluded from these counts. The matrix is tridiagonal, making this a favorable example for factorization; a higher-dimensional sparse problem can have much greater fill-in.

    All 144 declared sector solves returned three converged eigenpairs. Nevertheless, 146 of the 432 returned pairs failed our separate test

    ∥rA∥2max⁡(1,∣θ∣)≤requested tolerance.\frac{\lVert r_A\rVert_2}{\max(1,|\theta|)}\leq\text{requested tolerance}.

    This is not SciPy's complete internal stopping rule. It is a transparent original-operator diagnostic which the return status cannot replace. The returned-vector Gram defect never exceeded 4.9×10−144.9\times10^{-14}. Increasing the restart space from 24 to 48 vectors reduced direct matrix products in the finest-grid test, but doubled the inverse applications in its shift-invert counterpart and did not remove the residual floor.

    The companion examples/computational-qft/spectral-problems/sparse_double_well.py retains both starts, all requested tolerances, solver status, partial-result handling, costs, residuals and matched direct comparisons. Its previous reference paths and selected values are explicit. The SciPy ARPACK tutorial provides the API background; the numerical statements here are from this declared calculation.

    Summary

    Sparse eigensolvers reduce a large Hermitian problem to repeated operator applications and small projected spectra. Solving symmetry sectors separately helps avoid missing states, shift-invert targets low or interior levels, and recomputed residuals test the actual matrix equation. Basis size, domain and spacing remain separate physical approximations. A small tunneling gap demands an absolute error scale that cannot be read from the relative accuracy of either energy alone.

    Exercises

    1. From a residual to a splitting requirement

    For Hermitian AA, let vv have norm one, approximate energy θ\theta and residual rr. Derive the nearby-eigenvalue bound. If a target eigenvalue λ∗\lambda_* is identified and every other eigenvalue is at least δ>0\delta>0 from θ\theta, bound the component of vv outside its eigenspace. What absolute error condition is sufficient for relative splitting error at most ε\varepsilon?

    Solution

    Expand v=∑jcjujv=\sum_j c_j u_j in orthonormal eigenvectors. Then

    ∥r∥22=∑j∣cj∣2∣λj−θ∣2≥min⁡j∣λj−θ∣2,\lVert r\rVert_2^2=\sum_j|c_j|^2|\lambda_j-\theta|^2 \geq\min_j|\lambda_j-\theta|^2,

    because ∑j∣cj∣2=1\sum_j|c_j|^2=1. This proves the nearby-eigenvalue bound. Restricting the sum to eigenvectors outside the target eigenspace gives

    ∥(1−P∗)v∥2≤∥r∥2δ.\lVert (1-P_*)v\rVert_2\leq\frac{\lVert r\rVert_2}{\delta}.

    The statement concerns an eigenspace if the target is degenerate. Without identification or separation, it cannot label an individual state.

    Let ∣E^o−Eo∣≤ηo|\widehat E_o-E_o|\leq\eta_o and ∣E^e−Ee∣≤ηe|\widehat E_e-E_e|\leq\eta_e for the correctly matched states. Then

    ∣Δ^−Δ∣≤ηo+ηe.|\widehat\Delta-\Delta|\leq\eta_o+\eta_e.

    It suffices to require ηo+ηe≤εΔ\eta_o+\eta_e\leq\varepsilon\Delta. For Δ≃1.2235×10−6\Delta\simeq1.2235\times10^{-6} and ε=10−3\varepsilon=10^{-3}, equal per-level bounds must be about 6.1×10−106.1\times10^{-10} or smaller. A residual bound for a finite matrix addresses only its iterative error; domain, grid and basis differences must still be included before applying this statement to the full-line splitting.

    2. Symmetry and the transformed problem

    Derive the even grid's first hopping and explain why an exactly even Krylov start cannot find the odd ground state. Then derive the relation between original and shift-invert residuals and explain what fails if the shift equals an eigenvalue.

    Solution

    Writing the full-grid nearest-neighbor hopping as t=−g/(2h2)t=-g/(2h^2),

    ⟨0∣A∣1,+⟩=⟨0∣A∣1⟩+⟨0∣A∣−1⟩2=2 t.\langle0|A|1,+\rangle =\frac{\langle0|A|1\rangle+\langle0|A|-1\rangle}{\sqrt2} =\sqrt2\,t.

    If Rv=v\mathcal Rv=v and [A,R]=0[A,\mathcal R]=0, then RAjv=Ajv\mathcal R A^jv=A^jv for every jj. Hence its entire Krylov space is even. Roundoff-induced odd components do not replace an explicitly targeted odd-sector calculation.

    From (A−σI)v=(λ−σ)v(A-\sigma I)v=(\lambda-\sigma)v, inversion gives the same eigenvector with μ=(λ−σ)−1\mu=(\lambda-\sigma)^{-1}. For an approximate pair, multiply rB=Bv−μvr_B=Bv-\mu v by A−σIA-\sigma I:

    (A−σI)rB=v−μ(A−σI)v=−μ[A−(σ+1μ)I]v.(A-\sigma I)r_B=v-\mu(A-\sigma I)v =-\mu\left[A-\left(\sigma+\frac1\mu\right)I\right]v.

    Thus rA=−(A−σI)rB/μr_A=-(A-\sigma I)r_B/\mu. If σ\sigma equals an eigenvalue, the inverse does not exist. Near a target eigenvalue the transformed separation may be useful, but the linear solve becomes ill-conditioned; this is a tradeoff, not permission to ignore the original residual.

    References

    • Saad, Yousef. Numerical Methods for Large Eigenvalue Problems. Revised edition, SIAM, 2011. Author's second-edition PDF. §3.2.2, pp. 61–63; §4.3.2, pp. 100–101; Proposition 6.8, pp. 130–131; §6.3.1, pp. 137–138; §8.1.1, pp. 193–194.
    • SciPy developers. SciPy 1.13.1 Manual: ARPACK tutorial, eigsh, and eigh_tridiagonal. Consulted selection, shift, inverse-operator, tolerance, starting-vector, partial-convergence and direct-driver definitions.

    Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

    Scrollable table. Use Left and Right arrow keys to reveal hidden columns.

    Scrollable figure. Use Left and Right arrow keys to reveal hidden content.