“Know how to solve every problem that has been solved.”“What I cannot create, I do not understand.”— Richard Feynman
The RPA (A, B) Eigenproblem
Linear Algebra
⛓
What you need to know first
3 concepts, 2 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.
2 of these are concepts without a dedicated page yet —
the grey chips. Following the linked ones first makes the rest land.
Casida's equation, TDHF, the
random phase approximation, Bogoliubov quasiparticles — they all hand you
the same linear-algebra object: a 2n×2n matrix that
looks symmetric, set against a metric with a minus sign in it.
That one minus sign is the whole story. It breaks eigh, it
forces eigenvalues into ±ω pairs, it hides a Hermitian
problem half the size, and it turns the spectrum into a stability meter for
whatever reference state you linearized around. Five ways to see it; pick
your on-ramp.
(ABBA)(XY)=ω(100−1)(XY),A=AT,B=BT.
read it as
Everything on the left-hand side is as nice as matrices get:
A and B real symmetric, the big block matrix
symmetric too. The trouble is the metric
S=diag(1,−1) on the right.
To make this an ordinary eigenvalue problem you multiply through by
S−1 (which is just S again), and the product
SM=(A−BB−A)
is not symmetric. Not even close — the bottom row picked up a global
sign. So the workhorse guarantees you lean on everywhere else (real
eigenvalues, orthogonal eigenvectors, eigh) are all void.
The saving grace is that SM is not a generic
nonsymmetric matrix either: it has the block structure of a Hamiltonian
(symplectic) operator, and that structure is exactly what the other
four framings exploit. An indefinite metric doesn't destroy the
symmetry; it reorganizes it.
Write the block equation as two coupled equations:
AX+BY=ωX,BX+AY=−ωY.
Now swap the roles of the two halves: feed the vector
(Y,X) into the same equations. The first equation asks for
AY+BX, and the second original equation already says
that equals −ωY. The second asks for
BY+AX, which the first original equation says is
ωX. Both match the pattern of an eigenvector — with
eigenvalue −ω:
(X,Y) solves with ω⟹(Y,X) solves with −ω.
So the 2n eigenvalues are not 2n independent
numbers: they are n pairs ±ωk, mirror
images through zero, and the −ω partner carries the
same information with X and Y exchanged. In the
physics this is time reversal — every excitation has a de-excitation
running the same transition backward. In the linear algebra it is the
symplectic structure from framing 1, made visible one eigenvector at a
time. The validation below finds the pairing holds to
1.2×10−14 on a random stable
(A,B).
Add and subtract the two coupled equations and the variables
X+Y and X−Y decouple partway: two equations,
each mapping one combination onto the other. Eliminate one and you get
an n×n problem with eigenvalue
ω2. One more conjugation by the symmetric square root
of A−B (which exists whenever A−B is
positive-definite) makes it Hermitian:
(A−B)1/2(A+B)(A−B)1/2Z=ω2Z.
Every step of that algebra is walked through, move by move, in the
Casida Hermitian
rewrite derivation — here the point is what it buys. The smallest
case makes it concrete: at n=1 the matrices are scalars
a and b, and the rewrite says
ω2=(a−b)(a+b)=a2−b2. With
a=0.9, b=0.3:
ω=0.72=0.848528 — and the full
2×2 nonsymmetric solve returns exactly
±0.848528. The coupling b always
lowersω below the bare a: you
can read that straight off a2−b2<a2.
The payoff is practical, not just aesthetic: one
2n×2n nonsymmetric eig becomes two
n×n symmetric eigh calls plus matrix
products. At n=500 that is 7.55 s against 0.91 s below —
and eigh hands back guaranteed-real eigenvalues and an
orthonormal basis for free.
The rewrite in framing 3 quietly assumed A−B≻0.
That assumption is a physical statement, and the spectrum tells you
when it fails. When A+B and A−B are both
positive-definite, ω2>0 and every eigenvalue is
real. Let A−B lose definiteness — the validation below
scales B→tB and pushes — and an eigenvalue of
ω2 crosses zero: a ±ω pair slides
together, collides at the origin, and re-emerges as a purely
imaginary pair ±iγ. On real numbers, the
smallest pair goes ±0.054 real just before the crossing
and ±0.054i just after.
An imaginary frequency means the "ground state" you linearized around
is not a minimum at all — there is a direction along which the energy
goes down, and the linear response grows exponentially instead of
oscillating. In quantum chemistry this is the triplet instability that
makes Casida's equation fail
loudly at a bad closed-shell reference. So the eigenproblem is doing
double duty: its eigenvalues are the excitation spectrum and a
certificate that the reference deserves to be expanded around.
Set B=0 and the two coupled equations disconnect
completely: AX=ωX and
AY=−ωY. The positive branch is a plain symmetric
eigenproblem in A — eigh and done. This is the
Tamm-Dancoff approximation (TDA), and it is what most people run first,
because it cannot go unstable: no square root of
A−B exists to fail.
What you pay: B couples each excitation to the
de-excitations, and dropping it pushes every frequency up (in the
1×1 case, from a2−b2 to
a) and breaks the sum rules that make computed intensities
gauge-consistent. TDA is the right first move and a slightly wrong
final answer — the structured problem on this page is what "not
approximating" costs, and the Hermitian rewrite makes that cost small.
The 2×2 case, with numbers
One size up from scalars, small enough to hold in your head. Take
A=(0.90.10.11.1),B=(0.300.050.050.20).
The diagonal of A alone — the "no coupling" guess — says the
two frequencies are 0.9 and 1.1. The Hermitian
route gives ω=0.817410 and
ω=1.112134; the full 4×4
nonsymmetric solve returns the same two numbers and their negatives,
±0.817410 and ±1.112134, to fourteen
digits. Both roots moved off the diagonal guess, and the lower one moved
down — the de-excitation coupling at work, exactly as in the
scalar case.
Normalizing against the metric
One more habit the minus sign breaks: eigenvectors of this problem are not
normalized to ∥v∥=1. The natural inner product is the one
the metric defines, and for a vector split as (X,Y) it reads
⟨v,Sv⟩=XTX−YTY=±1.
A difference, not a sum — so it can be negative, and it is:
positive-frequency eigenvectors normalize to +1, their
−ω partners (which swap X and
Y, flipping the sign of the difference) to −1. The
validation run prints exactly six +1s and six
−1s for n=6. The sign is a label telling you
which branch a vector belongs to, and the normalization is what makes
downstream quantities (transition moments, sum rules) come out right. It
also degrades gracefully into a warning: as a pair approaches the
collision at ω=0, the two partners coalesce and
XTX−YTY→0 — the vector becomes
null in the metric just as the stability meter of framing 4 hits zero.
Every claim above, on real numbers
Two solvers, four experiments (the full script is
scripts/gen_rpa_eigenproblem.py). The first solver folds the
metric into the left-hand side and pays for it: a
2n×2nnonsymmetriceig. The
second is the Hermitian rewrite: two eigh calls at size
n, with the square root built from the
spectral decomposition the same
way the SVD page builds matrix functions.
import numpy as npdef full_solve(A, B): """Eigen-solve the 2n x 2n problem: fold the metric into the left side.""" n = A.shape[0] M = np.block([[A, B], [B, A]]) S = np.diag(np.concatenate([np.ones(n), -np.ones(n)])) w, V = np.linalg.eig(S @ M) # S^{-1} = S; S @ M is NOT symmetric return w, Vdef hermitian_solve(A, B): """omega via the half-size Hermitian rewrite (all eigh, no eig).""" w, U = np.linalg.eigh(A - B) sqrt_AmB = (U * np.sqrt(w)) @ U.T # symmetric square root M = sqrt_AmB @ (A + B) @ sqrt_AmB omega2 = np.linalg.eigvalsh((M + M.T) / 2) return np.sqrt(omega2)
Then: check the ± pairing, check the two solvers agree,
check the metric normalization, and push the system over the stability
edge by scaling B→tB until A−tB stops being
positive-definite.
# ---- 1 & 2: pairing + agreement, on a random stable (A, B) ------------# A, B symmetric; the diagonal of A shifted until A+B and A-B are both# positive-definite (a "stable reference").n = 6A, B = random_stable_ab(n, rng)w_full, V = full_solve(A, B)w_full = np.sort(w_full.real) # all real -- checkedpos, neg = w_full[n:], -w_full[:n][::-1]print(f"pairing: max |omega_+ - (-omega_-)| = {np.max(np.abs(pos - neg)):.2e}")w_herm = hermitian_solve(A, B)print(f"rewrite: max |full 2nx2n - Hermitian nxn| = {np.max(np.abs(pos - w_herm)):.2e}")# ---- 3: metric normalization X^T X - Y^T Y = +/- 1 --------------------for k in np.argsort(w_full.real): v = V[:, k].real X, Y = v[:n], v[n:] v /= np.sqrt(abs(X @ X - Y @ Y)) # normalize against diag(1, -1)# ---- 4: drive it unstable: B -> tB until A - tB loses definiteness -----t_star = bisect(lambda t: np.linalg.eigvalsh(A - t*B)[0], 1.0, 50.0)for t in (t_star - 0.05, t_star - 0.001, t_star + 0.001, t_star + 0.05): w, _ = full_solve(A, t * B) print(t, w[np.argsort(np.abs(w))][:2]) # watch the smallest pair# ---- 5: cost at n = 500 -------------------------------------------------# time full_solve (one 1000x1000 nonsymmetric eig) against# hermitian_solve (two 500x500 symmetric eigh + matmuls)
n = 6 random symmetric A, B with A+B, A-B > 0pairing: max |omega_+ - (-omega_-)| = 1.24e-14rewrite: max |full 2nx2n - Hermitian nxn| = 1.15e-14metric norm X^T X - Y^T Y after normalization: negative-omega roots: [-1. -1. -1. -1. -1. -1.] positive-omega roots: [ 1. 1. 1. 1. 1. 1.]instability: lambda_min(A - tB) crosses 0 at t* = 4.995299 t = 4.945299: smallest pair = [-0.38152, +0.38152 ] (real pair) t = 4.994299: smallest pair = [-0.054335, +0.054335] (real pair) t = 4.996299: smallest pair = [-0.054351j, +0.054351j] (IMAGINARY pair) t = 5.045299: smallest pair = [-0.387088j, +0.387088j] (IMAGINARY pair)n = 500: 2n x 2n nonsymmetric eig : 7.55 s n x n Hermitian route : 0.91 s (8x faster) agreement: 1.02e-12
Read the instability rows closely: the crossover sits at
t∗=4.995299, and a step of ±0.001 around it
flips the smallest pair from ±0.0543 (real) to
±0.0544i (imaginary) — same magnitude, rotated a quarter
turn in the complex plane. That is the collision at zero, caught in the
act. And the x behavior is visible too:
t moved by one part in five thousand while ω
moved to 0.054 — the pair approaches the origin like
t∗−t, steeply, which is why instabilities in
practice announce themselves suddenly.
Try First
Each prompt asks a checkable question about the working code or math
above — predict an output, derive a sign, state an invariant, find a
bug. Commit to an answer before clicking "reveal." That commitment is
the whole point: if your answer matched, you understand the piece you
were looking at; if it didn't, that's the part worth re-reading.
predict
Set B=0 in full_solve but keep the metric.
Predict the eigenvalues and the metric norms
XTX−YTY of the eigenvectors
before running it.
answer
The blocks decouple: AX=ωX with
Y=0, and AY=−ωY with
X=0. The eigenvalues are the eigenvalues of
A and their negatives — the ± pairing
survives, trivially. The metric norms are exactly
+1 (pure-X vectors) and −1
(pure-Y vectors) with nothing to normalize away:
B is what mixes the branches and makes
Y=0 on positive roots.
why does this work
The bisection found t∗ by watching
λmin(A−tB) cross zero — but the eigenvalue
collision happens in the full2n×2n
spectrum at the same t∗. Why must
ω=0 occur exactly when A−tB goes
singular?
answer
From the rewrite, ω2 are the eigenvalues of
(A−tB)1/2(A+tB)(A−tB)1/2, a congruence-scaled
product. Its determinant is
det(A−tB)det(A+tB), so some
ω2 hits zero exactly when one of the two factors
goes singular — here A−tB, since A+tB
stays positive-definite. A zero of ω2 is where a
±ω pair meets: ω=0 is the
only point the two mirror branches share.
what if
In the 1×1 case, set a=b. Solve the
two coupled scalar equations by hand. What are ω,
the eigenvector, and its metric norm?
hint
The equations are ax+by=ωx and
bx+ay=−ωy. Try ω=0
first and see what they force.
answer
ω2=a2−b2=0, so both roots sit at
ω=0 — the pair has already collided. The
equations reduce to a(x+y)=0, forcing
y=−x: eigenvector (1,−1) up to scale.
Its metric norm is x2−y2=0 — a null vector, which
cannot be normalized to ±1 at all. Exactly at the
instability the eigenproblem is defective: two eigenvalues, one
eigenvector, and the metric normalization breaks down with it.
Where this goes
This page is the load-bearing linear algebra under a family of physics
pages. Casida's equation is this
problem with A and B built from orbital-energy gaps
and two-electron integrals, and the
Hermitian rewrite
derivation walks the framing-3 algebra one move at a time.
Liouville-Lanczos
TDDFT solves the same structured problem without ever building the
matrix — Krylov iterations that respect the ± symmetry. And
the same (A,B) shape reappears wherever a stable reference
state gets shaken linearly: RPA in nuclear physics, Bogoliubov-de Gennes in
superconductivity, phonons around a lattice minimum. Learn the minus sign
once; it follows you everywhere.