Lanczos + Continued Fractions for Circuit Model-Order Reduction
Circuits
Modern chips have millions to billions of parasitic R, L, and C nodes from the metal-interconnect layout. To run AC analysis or transient simulation, you'd want the frequency response of the network — but the matrix is too big to factor at every frequency, or even once. This is the classic setting for model-order reduction: replace the giant network with a small rational approximation of its transfer function that's accurate over the band of interest. The standard industrial algorithms — AWE, PVL, PRIMA — all rest on the same mathematical correspondence we demonstrated on the Lanczos iteration page: a Krylov chain on a sparse symmetric matrix produces a continued-fraction expansion of any resolvent matrix element. This page applies that correspondence to a concrete circuit and shows where the easy version works, where it fails, and what industrial codes do about it.
The math: MNA as a resolvent
Modified Nodal Analysis (MNA) writes the Kirchhoff equations of a linear circuit at frequency as
where is the conductance matrix (from resistors and other algebraic constraints), is the capacitance matrix, is the vector of node voltages, and is the source vector. For a purely passive RC network, and are symmetric positive-semidefinite — they're quadratic forms coming from dissipated power and stored energy respectively.
Pick an input port (driven by ) and an output port (read out by some projection vector ). The transfer function from input to output is
This is a matrix element of a resolvent. Same structural form as the dynamic polarizability in TDDFT or the impurity Green's function in DMFT — a giant sparse symmetric pencil and you want one element of its inverse as a function of .
Symmetrizing the pencil
The Lanczos-based continued fraction we built on the Lanczos page needs a single symmetric operator and a single starting vector. The pencil isn't immediately in that form. Fix: Cholesky-factor the capacitance matrix as (for diagonal , is just ). Then
where is sparse, symmetric, and positive-definite. The transfer function becomes
for a single-port impedance (input = output) with . The impedance is a single diagonal element of the resolvent of . Lanczos on starting from gives the tridiagonal projection; the continued fraction in the Lanczos coefficients gives at every .
Demo: an RC ladder
Concrete example. An RC ladder is a 1D chain: nodes, a series resistor between each neighboring pair, a shunt capacitor from each node to ground.
Drive a current source at node 0 and read the voltage at the same node. Their ratio is the driving-point impedance , which is exactly the resolvent matrix element we just wrote down. The "ground" symbols at the bottom of every capacitor are physically the chip's ground plane (one big shared zero-volt reference); mathematically they're the constraint that fixes one node of the network so the equations have a unique solution.
Here's the calculation done both ways:
# Lanczos + continued-fraction model-order reduction of an RC ladder.
# Compute Z(s) at one node, two ways:
# (1) Direct sparse solve at every frequency.
# (2) Single Lanczos chain on the symmetrized pencil + continued fraction.
import numpy as np
import scipy.sparse as sp
import scipy.sparse.linalg as spla
# 1D RC ladder: N nodes, series resistors between neighbors,
# capacitor to ground at each node, tiny leak for positive-definiteness.
N = 500
R_val = 1.0
C_val = 1.0e-9
g = 1.0 / R_val
diag = np.full(N, 2.0 * g); diag[0] = g; diag[-1] = g; diag += 1e-9
off = np.full(N - 1, -g)
G = sp.diags([off, diag, off], [-1, 0, 1], format='csr')
C_m = sp.diags([C_val] * N, format='csr')
# Driving-point port at node 0.
b = np.zeros(N); b[0] = 1.0
# Symmetrize: G + sC = L (K + sI) L^T with L = sqrt(C).
# For diagonal C, L is diagonal too.
Linv = sp.diags(1.0 / np.sqrt(C_val * np.ones(N)))
K = (Linv @ G @ Linv).tocsr() # sparse, symmetric, positive-definite
bp = Linv @ b
norm_bp = np.linalg.norm(bp)
v0 = bp / norm_bp
# Lanczos with full reorthogonalization.
def lanczos(A, v0, n_iter):
alphas, betas, Q = [], [], [v0.copy()]
q_prev = np.zeros_like(v0); q = v0.copy(); beta_prev = 0.0
for j in range(n_iter):
w = A @ q
alpha = float(q @ w)
w = w - alpha * q - beta_prev * q_prev
for qk in Q[:-1]:
w -= float(qk @ w) * qk
beta = float(np.linalg.norm(w))
alphas.append(alpha)
if beta < 1e-14: break
if j < n_iter - 1:
betas.append(beta)
q_prev = q; q = w / beta
Q.append(q.copy())
return np.array(alphas), np.array(betas)
def cf_eval(alphas, betas, z):
"""1 / ((alpha_0 - z) - beta_0^2 / ((alpha_1 - z) - ...))."""
f = alphas[-1] - z
for j in range(len(alphas) - 2, -1, -1):
f = (alphas[j] - z) - betas[j] ** 2 / f
return 1.0 / f
# Direct sweep
omegas = np.logspace(0, 10, 120)
Z_direct = np.array([
np.dot(b, spla.spsolve((G + 1j * w * C_m).tocsc(), b))
for w in omegas
])
# Single Lanczos chain — gives Z(s) at every frequency from the same coefficients.
alphas, betas = lanczos(K, v0, N)
def Z_lanczos(s, n):
return norm_bp ** 2 * cf_eval(alphas[:n], betas[:n - 1], -s)
# Compare
for n in [10, 40, 160, N]:
Z = np.array([Z_lanczos(1j * w, n) for w in omegas])
rel_err = np.max(np.abs(Z - Z_direct)) / np.max(np.abs(Z_direct))
print(f"chain length {n:>4}: max relative error = {rel_err:.3e}") chain length 10: max relative error = 1.000e+00
chain length 40: max relative error = 1.000e+00
chain length 160: max relative error = 9.999e-01
chain length 500: max relative error = 1.231e-07
What this tells us
Two clean facts and one inconvenient one. Fact 1: the full chain () reproduces direct sparse solve to a relative accuracy of . The correspondence isn't approximate — Lanczos + continued fraction IS the resolvent matrix element when the chain runs to completion. Fact 2: the same chain gives at every frequency, with no re-factorization. That's the speedup story when it works.
The inconvenient fact: the truncated chains are useless on this problem. chain has 100% relative error; even only gets to 99.99%. The next two subsections explain what's going on.
How the Padé approximant is actually formed
Time to derive it instead of name-dropping it. Work in terms of 's spectral decomposition. Eigenvalues with orthonormal eigenvectors , and decompose the (unit) starting vector as with . The resolvent matrix element is, by direct insertion,
A sum of simple poles at the eigenvalues, weighted by the overlap of with each eigenmode. This function is the Stieltjes transform of the discrete measure . Define its moments
Two facts to notice. First, . Second, every moment is computable as an inner product — you don't need eigenvalues or eigenvectors to get them.
The asymptotic expansion of at infinity
Factor out of each pole and expand the resulting geometric series, valid for :
So at infinity,
This is exact, term by term. Every coefficient is a moment of the underlying measure, and is directly computable from and .
What "Padé approximant" precisely means
The Padé approximant of at infinity is the unique rational function
whose own asymptotic expansion at agrees with 's through as many terms as possible. Counting degrees of freedom: contributes coefficients, contributes more, overall normalization removes one, leaving free coefficients. So the best you can do is match the first series coefficients of :
So a Padé approximant isn't an arbitrary construction. It's the rational function that's correct on the first moments of the underlying measure. Doubling doubles how many moments you get right.
Multiply out the continued fraction explicitly
Now look at the truncated continued fraction with levels:
Do by hand:
Numerator is degree 1 in , denominator is degree 2. A rational function . Expand the denominator:
Now compute the characteristic polynomial of the Lanczos tridiagonal
Identical to . So the denominator of is times the characteristic polynomial of . Its two roots — the Ritz values of — are exactly the two poles of in .
The same algebra works at every order. Apply Cramer's rule for inverses of tridiagonal matrices to , expand the determinant along the first row, and the recursion collapses to the continued fraction. The result:
where is the submatrix of obtained by deleting the first row and column. So the poles of are the Ritz values — the eigenvalues of .
Why this rational function is the Padé approximant of
The deep step. The Lanczos coefficients aren't arbitrary numbers — they're the three-term-recurrence coefficients of the orthogonal polynomials with respect to the spectral measure of under :
This three-term recurrence IS the Lanczos recurrence rewritten in polynomial language. Consequently the characteristic polynomial of equals times the -th orthogonal polynomial of the measure. Its roots — the Ritz values — are therefore the Gauss-quadrature nodes for .
The classical fact (Gauss, Christoffel, Stieltjes, Markov, 19th century, beautifully exposed in Trefethen & Bau's Numerical Linear Algebra Lecture 37 and Stahl-Totik's General Orthogonal Polynomials): an -point Gauss-quadrature rule for a measure on the real line matches the first moments of the measure exactly. Reading that statement through the Stieltjes-transform identity: the rational function whose poles are the Gauss-quadrature nodes and whose residues are the Gauss-quadrature weights agrees with on the first coefficients of the asymptotic series at infinity. That's exactly the definition of the Padé approximant.
So three statements are the same statement:
- Multiply out the -level Lanczos continued fraction; you get a rational function with poles at the Ritz values.
- Build the -point Gauss-quadrature rule for the measure ; the nodes and weights produce a rational function approximating .
- Match the first coefficients of the asymptotic series of at infinity with a rational function of type ; the result is uniquely determined.
All three give the same rational function. That's Heine, Markov, and Stieltjes's theorem from the 1880s-90s, predating Lanczos by half a century, and it's the reason "Padé approximant" and "Lanczos continued fraction" name the same object.
Practical consequence for our problem: the -th truncated continued fraction has poles. They sit at the Ritz values — the eigenvalues of . These poles are placed by the Gauss-quadrature theory: they pick out representative points of the spectrum, weighted in a way that makes the truncated rational function correct on the first moments.
Visualizing the failure
Now look at where those Ritz values actually sit on this problem. The plot below shows the true eigenvalues of at the top, and below them the Ritz values produced by Lanczos at chain lengths 4, 8, 16, 32, 64, and 100 (full chain for a smaller 100-node version of the ladder, kept smaller so the eigenvalues are individually visible).
Two things to see. First, the true eigenvalues of (top row) are spread across roughly nine orders of magnitude: one isolated eigenvalue sits near , and a dense band of the other 99 fills the range . That's what "the spectrum spans many decades" actually means — the eigenvalues are scattered across factors of in size, reflecting the physical fact that an RC ladder has time constants ranging from the smallest (fastest local response, nanoseconds) to (slowest collective response, milliseconds for an N=100 ladder).
Second, the failure mode. Lanczos at places its Padé poles entirely in the upper band — none of them sit near the isolated low-eigenvalue mode at . Same at , , , even . Only at (when the chain has nowhere left to go) does a Ritz value finally appear near the isolated low eigenvalue.
The impedance at low frequency () is dominated by the contribution of that isolated small eigenvalue — , and at low this term is huge. If the chain has no Ritz value near , the approximation has no pole there, and the approximation gets the low-frequency impedance catastrophically wrong. That's why the relative error plot from the previous demo stayed at 100% until got near : short chains miss the low-eigenvalue mode that dominates the low-frequency physics.
Why does Lanczos preferentially park its Ritz values in the upper band? Because the starting vector is concentrated at one node, and its eigenmode decomposition has its overlap weighted toward the high-frequency end of the spectrum for this particular geometry. Lanczos converges fastest where the starting vector has the most overlap — which here happens to be the wrong end of the spectrum for low-frequency impedance.
For a 500-node ladder this is annoying but not fatal — you can afford to run the full chain. For a real chip parasitic network with nodes, running the full chain is the same operation as a full direct solve. You can't.
What industry actually does: shift-invert Lanczos
The fix is to focus the Krylov subspace on the frequency range you care about. Instead of Lanczos on , run Lanczos on for a chosen expansion point in the operating band. The chain now preferentially picks up eigenvalues of near , and the continued fraction becomes a Padé approximant of centered at .
This is the heart of PVL (Padé via Lanczos), Feldmann & Freund 1995. Earlier work — AWE, Pillage & Rohrer 1990 — used asymptotic moment matching directly, which is numerically equivalent but much less stable. PVL re-derived the same Padé approximant via Lanczos, which produces it as a continued fraction in the Lanczos coefficients (the correspondence proven on the Lanczos page). A 30th-order Padé approximant around a well-chosen typically reproduces a 107-node interconnect's frequency response across the operating band to 0.1% accuracy.
PRIMA (Odabasioglu, Celik, Pileggi 1998) is the further refinement that preserves passivity — the property that the reduced model still dissipates energy correctly, which AWE and plain PVL don't guarantee. It uses block Krylov projection followed by careful symmetrization. Underneath, the math is the same: Krylov subspace + Padé approximation = continued fraction in the projection coefficients.
Cost analysis (the part that decides the comparison). For a single shift-invert chain of length at one expansion point: one sparse Cholesky factorization of , then sparse triangular solves to apply . For an interconnect mesh with nodes and a well-chosen , gives band-of-interest accuracy below 1%. Compare with re-factoring at every one of (say) 1000 frequency points — you'd be looking at a factor of ~30× the cost. For multi-point expansions covering a wider band, you'd run several shifted chains and stitch the Padé panels together; still a small multiple of one factorization, versus the 1000 factorizations of the naive approach.
Same math, four communities
The Lanczos-continued-fraction correspondence does the same job everywhere a giant sparse symmetric resolvent matrix element appears, but each community gives it a different name:
- Quantum chemistry / TDDFT: Liouville-Lanczos for optical absorption spectra of solids.
- Condensed matter / many-body lattice models: exact-diagonalization (ED) computation of spectral functions , dynamical response, ED-DMFT impurity solvers.
- Nuclear physics: shell-model Lanczos for strength functions and transition spectra in codes like NuShellX, BIGSTICK.
- VLSI circuit analysis: AWE, PVL, PRIMA — the industrial workhorses for interconnect model-order reduction. Every commercial SPICE simulator (HSPICE, Spectre, etc.) ships this machinery.
Same underlying mathematics — tridiagonal-inverse-is-a-continued-fraction plus matrix-free-Lanczos-builds-a-tridiagonal — applied to four different operators in four different communities, with four different sets of nomenclature. The numerical-linear-algebra community (Lanczos, Saad, Trefethen) sits in the middle as the common language. The Padé-table side and the orthogonal-polynomial side are the same theory viewed from network synthesis vs. spectral measure theory; see Akhiezer's Hamburger moment problem or Stahl-Totik's General Orthogonal Polynomials for the full mathematical structure.
Related on this site
- Lanczos iteration — the underlying algorithm, with the explicit tridiagonal→continued-fraction derivation and the numerical check that motivated this page.
- Bi-orthogonal Lanczos — the non-Hermitian variant needed when the circuit has active elements (transistors, voltage sources) that break the symmetry.
- Liouville-Lanczos — the physics analog: same Krylov+continued-fraction machinery applied to TDDFT linear response in solids.
- RC circuit and RLC circuit — the single-element building blocks that make up the giant interconnect networks this page is about.