“Know how to solve every problem that has been solved.” “What I cannot create, I do not understand.” — Richard Feynman

The Kernel Polynomial Method

Spectral Methods

What you need to know first 15 concepts, 6 layers

The requisite-knowledge inventory for this page, bottom-up: the primitives at the base, combined upward until you reach what this page assumes. Skim the layers you already own; start wherever the ground gets unfamiliar.

  1. base
    • Linear algebraconcept
  2. L1
  3. L2
  4. L3
  5. L4
  6. L5
  7. you are here

8 of these are concepts without a dedicated page yet — the grey chips. Following the linked ones first makes the rest land.

You have a huge sparse Hamiltonian and you want its density of states — how many quantum states sit at each energy. Diagonalizing for every eigenvalue is hopeless at scale, and wasteful: you only want a smooth curve. The Kernel Polynomial Method gets it from a few hundred sparse matrix–vector products, by expanding the spectrum in Chebyshev polynomials. It is the same moment-and-recurrence machinery as Lanczos, wearing Chebyshev's clothes. Five ways in.

read it as

The density of states is built from every eigenvalue of . For a lattice model with millions or billions of sites, computing all of them is out of the question — and pointless, because the answer you want is a smooth curve, not a list of numbers.

So don't ask for the eigenvalues. Ask for the shape of their distribution directly. KPM computes to whatever resolution you pay for, using only the one thing a sparse matrix is good at: multiplying a vector. No eigensolver, no dense storage.

Watch the spectrum resolve

Two tight-binding lattices, their density of states reconstructed live from precomputed Chebyshev moments. Drag and the curve sharpens toward the exact answer (dashed); the 1D chain reveals its square-root van Hove edges, the 2D square its logarithmic peak at the band center. Then turn the Jackson kernel off and watch Gibbs ringing take over — the red line is zero, and an honest density never crosses it.

KPM, N = 32 momentsanalytic 1/(π√(4−E²))

The Jackson kernel turns truncation into a smooth ~0.13-wide broadening — sharper as N grows, no ringing.

The moments, in code

The entire method is the Chebyshev recurrence on a few random vectors. There is no eigensolver anywhere — only sparse matrix–vector products and inner products. Reconstruction (summing the series with the Jackson kernel) is a few lines more; the demo above does it in your browser on every slider tick.

import numpy as np, scipy.sparse as sp

def kpm_moments(H, Emin, Emax, Nmax, R, eps=0.04):
    """Chebyshev moments mu_n = (1/D) Tr T_n(H~), never forming T_n(H)."""
    D = H.shape[0]
    a = (Emax - Emin) / (2 - eps)          # rescale spectrum into (-1, 1)
    b = (Emax + Emin) / 2
    Ht = (H - b * sp.identity(D)) / a
    mu = np.zeros(Nmax)
    for _ in range(R):                      # R random probe vectors
        v  = np.random.standard_normal(D)   # E[v v^T] = I  =>  E[v^T A v] = Tr A
        t0, t1 = v, Ht @ v                  # T_0|v> = |v>,  T_1|v> = H~|v>
        mu[0] += v @ t0
        mu[1] += v @ t1
        for n in range(2, Nmax):
            t2 = 2 * (Ht @ t1) - t0          # T_{n+1} = 2 H~ T_n - T_{n-1}
            mu[n] += v @ t2                  # accumulate <v|T_n(H~)|v>
            t0, t1 = t1, t2
    return mu / (R * D), a, b
# Validated: KPM density of states vs the known answer
#                          mu_0     N=256, Jackson      integral
  1D chain     -> exact   0.9995   matches 1/(π√(4−E²))  ∫ρ = 1.00
  2D square    -> exact   0.9992   matches diagonalization (log peak at 0)
# 3000-site chain: 256 matvecs × 24 probes — never a 3000×3000 dense solve.
# the same Chebyshev recurrence is the engine; only the basis differs from Lanczos.

Where this fits

KPM is the fourth costume of a single idea that runs through this site: encode an operator's spectrum in a few moments and read physics off them. Lanczos does it in the Krylov basis and gives a continued fraction; KPM does it in the Chebyshev basis and gives a density. The same machinery computes optical spectra in Liouville–Lanczos TDDFT, network response in spiking networks, and strength functions in the nuclear shell model. Next steps: the spectral function of a chosen state (local DOS), KPM for Green's functions and conductivity, and the kernel-vs-resolution trade pushed to the band-edge singularities where it bites hardest.