“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.

  1. base
    • Linear algebraconcept
  2. L1
  3. you are here

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 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.

read it as

Everything on the left-hand side is as nice as matrices get: and real symmetric, the big block matrix symmetric too. The trouble is the metric on the right. To make this an ordinary eigenvalue problem you multiply through by (which is just again), and the product

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 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.

The 2×2 case, with numbers

One size up from scalars, small enough to hold in your head. Take

The diagonal of alone — the "no coupling" guess — says the two frequencies are and . The Hermitian route gives and ; the full nonsymmetric solve returns the same two numbers and their negatives, and , 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 . The natural inner product is the one the metric defines, and for a vector split as it reads

A difference, not a sum — so it can be negative, and it is: positive-frequency eigenvectors normalize to , their partners (which swap and , flipping the sign of the difference) to . The validation run prints exactly six s and six s for . 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 , the two partners coalesce and — 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 nonsymmetric eig. The second is the Hermitian rewrite: two eigh calls at size , with the square root built from the spectral decomposition the same way the SVD page builds matrix functions.

import numpy as np

def 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, V

def 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 until 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 = 6
A, B = random_stable_ab(n, rng)
w_full, V = full_solve(A, B)
w_full = np.sort(w_full.real)                  # all real -- checked
pos, 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 > 0
pairing:   max |omega_+ - (-omega_-)| = 1.24e-14
rewrite:   max |full 2nx2n - Hermitian nxn| = 1.15e-14

metric 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 , and a step of around it flips the smallest pair from (real) to (imaginary) — same magnitude, rotated a quarter turn in the complex plane. That is the collision at zero, caught in the act. And the behavior is visible too: moved by one part in five thousand while moved to — the pair approaches the origin like , 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 in full_solve but keep the metric. Predict the eigenvalues and the metric norms of the eigenvectors before running it.

why does this work

The bisection found by watching cross zero — but the eigenvalue collision happens in the full spectrum at the same . Why must occur exactly when goes singular?

what if

In the case, set . Solve the two coupled scalar equations by hand. What are , the eigenvector, and its metric norm?

Where this goes

This page is the load-bearing linear algebra under a family of physics pages. Casida's equation is this problem with and 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 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.