“Know how to solve every problem that has been solved.”“What I cannot create, I do not understand.”— Richard Feynman
Casida's Equation
Perturbation Methods
⛓
What you need to know first
17 concepts, 7 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 of these are concepts without a dedicated page yet —
the grey chips. Following the linked ones first makes the rest land.
Casida's equation gives you a way to calculate the excitation energies and oscillator strengths from a DFT calculation. You know how when you push a swing, you have to push at the right frequency or the amplitude doesn't build? Instead of pushing a swing or a pendulum, Casida's equation gives you a way to push the electron cloud of the system. The twist is that the cloud is a quantum system — there are only certain photon frequencies at which it responds at all, and when one of those hits, the response isn't a gradual buildup like a swing; the cloud jumps discretely to an excited state. Those photon frequencies are the excitation energies.1 How strongly the field couples to each one is the oscillator strength. Casida's equation is the matrix problem that takes the ground-state Kohn-Sham orbitals as input and computes both.
Setup: linear response of a closed-shell reference
Setup: a molecule in its ground state, solved by the standard SCF machinery (Kohn-Sham for DFT, Hartree-Fock for HF). You get a stack of orbitals. The bottom N/2 are occupied by paired electrons (ψi, energy εi); the rest are empty (virtuals ψa, energy εa). That's the static ground state — what a normal DFT calculation gives you.
Quick aside on virtual orbitals: they're real orbitals — don't let the occupied orbitals hear that, but yeah, they are. When you solve an SCF problem you get a set of orbitals; some get filled with electrons, some don't, and the empty ones are called "virtual." Think of them as extra seats in a room: they exist, they're available, no one's sitting there right now. Why nobody's in them: promoting an electron from occupied i into virtual a costs energy εa−εi, and in the ground state there's nothing to pay that bill — no field, no thermal kick, nothing. So the electrons fill the bottom of the stack and the rest stay empty. Exciting the molecule means supplying exactly that bill from outside — which is what the oscillating field is going to do in the next paragraph.
Now turn on a weak oscillating field — a laser shining on the molecule, say. The electrons respond. To first order in the field strength, the response at each driving frequency ω splits into two pieces. Xia tells you how strongly the field is mixing occupied orbital i with virtual orbital a — that's an electron getting promoted. Yia tells you the time-reverse: how strongly the same i↔a coupling shows up in the opposite direction, an electron coming back down. Both appear together at every frequency; linear-response quantum mechanics is symmetric under time reversal, so you can't have one without the other.
Plug this into the time-dependent Kohn-Sham equation and keep only first-order terms in the field. The algebra — worked out in the deep dive at the bottom of the page — gives a coupled matrix equation for X and Y. In block form:
(AB∗BA∗)(XY)=ω(100−1)(XY).
What in the name of Charles Hermite is going on here? Why is this matrix non-Hermitian? Look closely. The matrix on the left is actually Hermitian. The culprit is one entry, hiding in plain sight: the -1 in the lower-right of the metric on the right-hand side. Without that minus sign the equation would be an ordinary Hermitian eigenvalue problem. With it, the metric is indefinite (eigenvalues +1 and −1 rather than both +1), and folding it into the left-hand matrix to turn this into an ordinary eigenvalue problem produces something non-Hermitian. The minus sign isn't an accident; it encodes time-reversal symmetry. Every positive-frequency root ω comes with a −ω partner representing the same transition run backwards. For real orbitals (the usual case) A and B are real symmetric, and:
Two pieces to unpack. The diagonal of A is the orbital-energy gap — what it would cost to promote an electron from i to a if you ignored interactions. Everything else, the (ia∥jb) terms, is the interaction part: how the i→a transition density Coulomb-repels and exchanges with the j→b transition density. TDHF uses Coulomb minus exchange; TDDFT uses Coulomb plus the XC kernel fxc. The two blocks differ in what they couple. A couples excitations to other excitations. B couples excitations to de-excitations — the time-reversal partner of the same physics — and the Tamm-Dancoff approximation just throws that block away.
Spin adaptation: singlets and triplets
A closed-shell molecule has equal numbers of α and β electrons paired in every orbital — full spin symmetry. That symmetry makes the Casida matrix split into independent blocks. The blocks correspond to singlet excitations (spin-symmetric: same amplitude for α→α and β→β transitions) and triplet excitations (antisymmetric: opposite-sign amplitudes for α→α and β→β, plus two more components that flip spin). The three triplets are degenerate by symmetry, so you solve them all by solving one. Net: two independent problems of size NoccNvir each, instead of one giant problem four times the size:
The factor of 2 in front of (ia∣jb) on the singlet side comes from the spin-symmetric combination; the triplet has no Coulomb piece in A at all (the symmetric Coulomb interaction cancels between the α→α and β→β components of a triplet). What's left of the triplet is purely exchange — this is the origin of Hund's rule in the orbital language: triplets sit lower than singlets because they lose Coulomb repulsion.
Why it's a pseudo-eigenvalue problem
The minus sign in the metric is awkward, but when A−B is positive-definite — which it is whenever the ground state is a stable minimum and not a saddle — you can fold the equation into an ordinary Hermitian eigenvalue problem half the size. Here is the algebra.
Write the block equation out as two coupled vector equations. With A and B real symmetric:
AX+BY=ωX,BX+AY=−ωY.
Add the two equations and subtract them. The sum gives one equation in X+Y and X−Y, the difference gives the other:
(A+B)(X+Y)=ω(X−Y),(A−B)(X−Y)=ω(X+Y).
Solve the second for X+Y (using that A−B is invertible) and substitute into the first. The cross-coupling drops out and what's left is an ordinary eigenvalue problem for X−Y alone, with eigenvalues ω2:
(A+B)(A−B)(X−Y)=ω2(X−Y).
The operator (A+B)(A−B) is not Hermitian — products of Hermitian operators usually aren't. But it is similar to a Hermitian operator. Take the symmetric square root (A−B)1/2 (which exists and is real because A−B is positive-definite), define a rescaled eigenvector
Z=(A−B)1/2(X−Y),
and conjugate the eigenvalue problem by (A−B)1/2. The result is Hermitian:
(A−B)1/2(A+B)(A−B)1/2Z=ω2Z.
The eigenvalues are ω2, so excitation energies come out as square roots. The eigenvector Z recovers the physical amplitudes via X−Y=(A−B)−1/2Z and X+Y=ω−1(A−B)1/2Z. A triplet instability — an eigenvalue of A−B going negative — is the signature that the closed-shell reference is unstable against a spin-symmetry-breaking deformation, and Casida loudly tells you so by failing to take a real square root.
The Tamm-Dancoff approximation
Drop B and the whole problem collapses to ordinary Hermitian diagonalization of A:
AX=ωTDAX.
This is the Tamm-Dancoff approximation (TDA), or "configuration-interaction singles with the DFT orbital basis" depending on who's talking. Cheaper, more numerically stable (no square-root of a possibly-near-singular matrix), and immune to the triplet-instability failure mode. The price: TDA excitation energies are systematically too high, because the de-excitation coupling B would have lowered the levels through a second-order-like correction and that correction is gone. For valence singlets the TDA error is a few tenths of an eV; for charge-transfer states and Rydberg-like states it can be larger.
Oscillator strengths and transition densities
Once you've got a Casida root (ωn,Xn,Yn), the transition density — the spatial pattern of where the electron sloshes during this excitation — is a weighted sum over occupied-virtual orbital products:
ρnT(r)=ia∑(Xia(n)+Yia(n))ψi(r)ψa(r),
Multiply this by r and integrate to get the transition dipole — that's what couples to photons. The oscillator strength fn=32ωn∣⟨0∣r∣n⟩∣2 packages it into a dimensionless intensity. The absorption spectrum is then one delta function per root, weighted by fn and parked at ωn; broaden them into Lorentzians and you've got something to lay over a measured spectrum.
H2 in a minimal basis: closed form
Before turning on PySCF, it's worth doing the smallest possible case
by hand. H2 in a minimal basis — one s-function
per atom, two basis functions total — collapses the entire Casida
equation to one number per spin block. The result is closed form, and
it makes explicit where the singlet-triplet splitting comes from.
This is the case Casida worked through in the original 1995 paper.
Symmetry forces the molecular orbitals to be the bonding and antibonding
combinations of the two s-functions:
One occupied orbital (ψg, bonding), one virtual orbital
(ψu, antibonding). The Casida problem dimension per
spin sector is Nocc⋅Nvir=1 — every
matrix in the equation is a single number. Plugging into the
spin-adapted formulas with the only allowed transition index
(i,a)=(g,u):
Two integrals appear and they mean different things physically:
(gu∣gu) is the Coulomb self-repulsion of the
transition densityψgψu. This is the
term that fires when the excitation creates a non-zero charge
distribution that interacts with itself.
(gg∣uu) is the Coulomb interaction between the
occupied density ψg2 and the
virtual density ψu2. Physically this is
the electron-hole attraction — the exciton binding — that pulls the
excitation energy below the bare orbital gap.
Tamm-Dancoff (TDA)
Drop B and the singlet/triplet excitation energies are
just the A values:
The singlet-triplet splitting at the TDA level is therefore:
ωSTDA−ωTTDA=2(gu∣gu).
Twice the Coulomb self-repulsion of the transition density.
That's Hund's rule made explicit in the algebra: the triplet pays no
Coulomb cost for the excitation because its two electrons have parallel
spins and the Coulomb interaction between same-spin transition density
components cancels in the spin-adapted combination. The singlet doesn't
get that cancellation and pays the full 2(gu∣gu) penalty.
Triplet wins, singlet loses.
Full Casida (TDHF)
Including B and using the Hermitian rewrite
ω2=(A−B)(A+B) from the section above:
Two observations. First, both expressions sit at or below their TDA
counterparts — the de-excitation coupling B always lowers
positive-frequency roots (this is the perturbative argument from the
Try First probe below, now visible directly in the algebra). Second,
the triplet expression's first factor goes negative when
(gu∣gu)+(gg∣uu)>(εu−εg) — at
that point ωT2 goes negative,
ωT becomes imaginary, and you have a triplet
instability. In the minimal basis you can see it happen as an
inequality between three numbers.
From here to 6-31G
Everything below — the 6-31G PySCF demonstration, the singlet-triplet
splitting, the TDA overshoot — is this same calculation done with three
virtual orbitals instead of one. The Casida block becomes 3 × 3 instead
of 1 × 1, and there's no closed form. But the structure is identical:
diagonal of A = orbital gap, plus Coulomb of the transition
density, minus electron-hole attraction. The minimal-basis case is
just every term reduced to a single integral.
H2 in 6-31G: working through it by hand
H2 in a minimal-ish basis is the perfect testbed: one occupied orbital (σg), a handful of virtuals, the whole Casida problem is a 3×3 in each spin block. Below: do an RHF SCF, build the four Casida tensors directly from the molecular ERIs, diagonalize, and check against PySCF's library TDHF. The two implementations should agree to machine precision because they are literally the same equation; the point of writing it out is that the equation is no longer a black box.
"""Casida's equation for H2 (TDHF flavor).We build the linear-response problem from scratch from a restrictedHartree-Fock reference: form the Casida A and B matrices in theoccupied-virtual MO basis, project into the singlet and tripletspin-adapted blocks, solve the pseudo-eigenvalue problem, and verifyagainst PySCF's built-in TDHF. [ A B ][X] [ 1 0 ][X] [ B A ][Y] = w [ 0 -1 ][Y]When A - B is positive-definite (true at the HF minimum for stableclosed-shell molecules), this is equivalent to the Hermitian problem (A - B)^{1/2} (A + B) (A - B)^{1/2} Z = w^2 Z.The Tamm-Dancoff approximation drops B and diagonalizes A directly.TDDFT differs only in the two-electron kernel: replace -K_exchange bythe XC kernel f_xc. The matrix structure is identical, so the code isidentical down to the slot where you fill in the kernel."""import numpy as npfrom pyscf import gto, scf, tdscf, ao2mo# ---- 1. Reference: restricted HF on H2 at R = 0.74 A --------------------mol = gto.M(atom='H 0 0 0; H 0 0 0.74', basis='6-31g', verbose=0)mf = scf.RHF(mol).run()nocc = mol.nelectron // 2nmo = mf.mo_coeff.shape[1]nvir = nmo - nocceps = mf.mo_energyprint(f"H2 / 6-31G nocc = {nocc}, nvir = {nvir}, E_HF = {mf.e_tot:.6f} Ha")print(f"HOMO-LUMO gap = {eps[nocc] - eps[nocc-1]:.6f} Ha " f"({(eps[nocc] - eps[nocc-1]) * 27.211386:.3f} eV)")# ---- 2. Two-electron integrals (chemist notation) in the MO basis --------eri_ao = mol.intor('int2e')eri_mo = ao2mo.incore.full(eri_ao, mf.mo_coeff)o = slice(0, nocc)v = slice(nocc, nmo)# All four-index tensors are stored with index order (i, a, j, b).iajb = eri_mo[o, v, o, v]ijab = eri_mo[o, o, v, v].transpose(0, 2, 1, 3)ibja = eri_mo[o, v, o, v].transpose(0, 3, 2, 1)# Orbital-energy gap on the diagonal of A: (eps_a - eps_i) delta_ij delta_abdelta = np.zeros((nocc, nvir, nocc, nvir))for i in range(nocc): for a in range(nvir): delta[i, a, i, a] = eps[nocc + a] - eps[i]# ---- 3. Spin-adapted Casida A and B --------------------------------------A_singlet = delta + 2.0 * iajb - ijabB_singlet = 2.0 * iajb - ibjaA_triplet = delta - ijabB_triplet = - ibjadef casida_omega(A, B): """Solve [[A,B],[B,A]] [X;Y] = w [[1,0],[0,-1]] [X;Y]. Returns the sorted positive excitation energies.""" n = A.shape[0] * A.shape[1] A2 = 0.5 * (A.reshape(n, n) + A.reshape(n, n).T) B2 = 0.5 * (B.reshape(n, n) + B.reshape(n, n).T) ApB = A2 + B2 AmB = A2 - B2 w, U = np.linalg.eigh(AmB) sqrt_AmB = (U * np.sqrt(np.maximum(w, 0))) @ U.T M = sqrt_AmB @ ApB @ sqrt_AmB M = 0.5 * (M + M.T) omega2 = np.linalg.eigvalsh(M) return np.sort(np.sqrt(np.maximum(omega2, 0)))def tda_omega(A): """Tamm-Dancoff: just diagonalize A.""" n = A.shape[0] * A.shape[1] A2 = 0.5 * (A.reshape(n, n) + A.reshape(n, n).T) return np.sort(np.linalg.eigvalsh(A2))om_S = casida_omega(A_singlet, B_singlet)om_T = casida_omega(A_triplet, B_triplet)om_S_tda = tda_omega(A_singlet)om_T_tda = tda_omega(A_triplet)# ---- 4. PySCF reference (full TDHF) --------------------------------------nstates = nocc * nvirtdhf_S = tdscf.TDHF(mf); tdhf_S.singlet = True; tdhf_S.nstates = nstates; tdhf_S.kernel()tdhf_T = tdscf.TDHF(mf); tdhf_T.singlet = False; tdhf_T.nstates = nstates; tdhf_T.kernel()ref_S = np.sort(tdhf_S.e)ref_T = np.sort(tdhf_T.e)print(f"\nMax abs error vs PySCF TDHF: singlet {np.max(np.abs(om_S - ref_S)):.2e}, " f"triplet {np.max(np.abs(om_T - ref_T)):.2e}")# ---- 5. Singlet-triplet splitting and TDA error --------------------------Ha_eV = 27.211386print("\nLowest excitations of H2 / 6-31G:")print(f" S0 -> T1 {om_T[0]:.4f} Ha = {om_T[0]*Ha_eV:6.3f} eV (TDA: {om_T_tda[0]*Ha_eV:6.3f} eV)")print(f" S0 -> S1 {om_S[0]:.4f} Ha = {om_S[0]*Ha_eV:6.3f} eV (TDA: {om_S_tda[0]*Ha_eV:6.3f} eV)")print(f" singlet - triplet splitting: {(om_S[0]-om_T[0])*Ha_eV:.3f} eV")print(f" TDA overshoots S1 by {(om_S_tda[0]-om_S[0])*Ha_eV:.3f} eV " f"(de-excitation coupling that TDA discards)")
Output:
H2 / 6-31G nocc = 1, nvir = 3, E_HF = -1.126755 HaHOMO-LUMO gap = 0.834290 Ha (22.702 eV)Max abs error vs PySCF TDHF: singlet 2.89e-15, triplet 2.22e-15Lowest excitations of H2 / 6-31G: S0 -> T1 0.3599 Ha = 9.793 eV (TDA: 10.316 eV) S0 -> S1 0.5520 Ha = 15.020 eV (TDA: 15.248 eV) singlet - triplet splitting: 5.226 eV TDA overshoots S1 by 0.228 eV (de-excitation coupling that TDA discards)
Agreement with PySCF is at the level of 10−15 Hartree across all three roots in each spin block — floating-point noise, as it should be. The triplet sits 5.2 eV below the singlet (Hund's rule in action), and the TDA bumps the singlet up by 0.23 eV.
Two things to flag about these numbers. First, they are HF-quality — TDHF, not TDDFT. The experimental H2 S0→T1 excitation is about 10.6 eV and S0→S1 (B¹Σu+) is about 12.6 eV; we're overshooting badly because HF ignores correlation and 6-31G has no diffuse functions for the diffuse excited states. Switching to TDDFT with a hybrid functional and a basis with diffuse augmentation (aug-cc-pVDZ or larger) brings it into experimental range. Second, this is the entire spectrum at this level — three singlet roots and three triplet roots, exhausting the NoccNvir=3 dimension of the problem. There is no information past that without enlarging the basis.
Under the Hood
The same way a mechanic opens the hood and points at the radiator, the
alternator, the timing belt — here is an annotated tour of what's
actually going on in the working code or math above. No questions, no
reveals. Just labels on the parts.
(X, Y) — the response amplitudes
At each driving frequency ω, the electron cloud
responds with two pieces. Xia is the amplitude for
the field mixing occupied orbital i with virtual orbital
a — a forward excitation contribution.
Yia is the time-reverse — the same
i↔a coupling running backward. Both
have to appear together at every ω because
linear-response QM is symmetric under time reversal. In the code,
X and Y are recovered from the rescaled
eigenvector Z=(A−B)1/2(X−Y) after the Hermitian
rewrite.
A block — excitation × excitation
Pairs an excitation to another excitation. The diagonal is the bare
orbital-energy gap (εa−εi) —
what it would cost to promote an electron i→a if
there were no electron-electron interaction. The off-diagonal
2(ia∣jb)−(ij∣ab) for singlets adds Coulomb-and-exchange
coupling between transition densities. In the code:
A_singlet = delta + 2.0 * iajb - ijab. The pattern is
identical for the triplet, just without the Coulomb piece — that's
Hund's rule encoded in the matrix structure.
B block — excitation × de-excitation
Pairs an excitation to a de-excitation — the time-reversal partner
of A. No orbital-energy diagonal contribution here (the orbital
pairings on left and right don't line up the way they do in A); only
the two-electron coupling. In the code:
B_singlet = 2.0 * iajb - ibja. The Tamm-Dancoff
approximation drops this block entirely, which is why TDA only sees
"forward" transitions and never the de-excitation partners that
lower the spectrum.
diag(1, -1) — the metric's minus sign
The single most important entry in the entire equation. Without that
minus sign in the lower-right block of the right-hand-side metric,
this would be a vanilla Hermitian generalized eigenproblem and there
would be no (A−B)1/2 trick to learn. With it,
eigenvalues come in ±ω pairs (positive
frequencies and their time-reversal partners), folding the metric
into the left-hand side produces a non-Hermitian operator, and the
algebra needs the Hermitian rewrite. The minus sign isn't a
bookkeeping quirk; it's the time-reversal structure of linear
response made manifest.
(A-B)^(1/2) (A+B) (A-B)^(1/2) — the Hermitian rewrite
The trick that turns the non-Hermitian pseudo-eigenvalue problem
into an ordinary Hermitian one half the size. Valid when
A−B is positive-definite, which holds whenever the
ground state is a stable minimum. Eigenvalues come out as
ω2, so excitation energies are square roots.
In the code: implemented inside casida_omega() via
spectral decomposition — np.linalg.eigh(AmB) gives
the eigenvalues and eigenvectors of A−B, and
(U * np.sqrt(np.maximum(w, 0))) @ U.T reconstructs the
symmetric matrix square root. The np.maximum(w, 0) is
a defensive clamp for the moment A−B picks up a
slightly-negative eigenvalue from numerical noise; if a real
negative eigenvalue shows up, that's a triplet instability and the
clamp is silently lying.
tda_omega(A) — the Tamm-Dancoff approximation
Drop B entirely, diagonalize A as a
standard Hermitian eigenproblem. Cheap (no square root), robust
(no near-singular A−B to worry about), and immune to
the triplet-instability failure mode that crashes full Casida. The
cost: TDA excitation energies are systematically too high by a few
tenths of an eV for valence states. The de-excitation correction
from B would have lowered every positive-frequency
root through a second-order-like coupling; throwing it away
preserves the qualitative spectrum but loses that downward shift.
At the HF level, TDA is identical to Configuration Interaction
Singles (CIS) — same eigenproblem, different historical name.
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
The output reports nocc = 1, nvir = 3 for H2 in 6-31G, so
the Casida problem in each spin block is 3×3 and you get exactly three
singlet and three triplet roots. Could you have predicted "three roots
per spin block" from the molecule and basis alone, without running
SCF? Now: for HeH+ in 6-31G, how many roots? For LiH in
6-31G? Predict before you would run.
answer
The Casida block dimension is NoccNvir.
Count the basis functions, divide the electrons among them.
H2 / 6-31G: 6-31G on H contributes 2 functions
per atom → 4 functions total. 2 electrons in RHF → 1 occupied,
3 virtual. 1·3 = 3 roots per spin block. ✓ matches output.
HeH+ / 6-31G: same 4 basis
functions (He has 2, H has 2). 2 electrons → 1 occ, 3 vir →
again 3 roots. Same Casida block dimension as H2 despite the
different physics.
LiH / 6-31G: Li/6-31G contributes 9 functions
(3s + 2 sets of p) and H/6-31G contributes 2 → 11 functions.
4 electrons → 2 occ, 9 vir → 18 roots per spin block.
Two takeaways. First, the spectrum's dimension is fixed by
the basis the moment you choose it — not by the molecule's actual
physics. If you want a richer spectrum you have to enlarge the
basis. Second, this gives an immediate upper bound on memory and
cost: dense LAPACK on an
(NoccNvir)2 matrix. For modest
molecules with a thousand basis functions and ~50 occupied
orbitals, the matrix is roughly 50,000×50,000.
Storage is in the gigabyte range; diagonalization is in the
hour-or-day range; and that's the limit of textbook Casida before
you need the matrix-free Liouville-Lanczos detour.
why does this work
The same output: HOMO-LUMO gap is 22.702 eV, but the lowest singlet
excitation is 15.020 eV. The orbital gap is the dominant (diagonal)
entry of A, so naively the smallest eigenvalue of A ought to be near
22.7 eV. Yet the answer is 7.7 eV below that — a huge reduction.
Which terms in the singlet A and B are responsible, and what's the
physical picture?
answer
For one-occupied / one-virtual systems, the only relevant Casida
index is (HOMO, LUMO). The singlet A diagonal is
AHL,HLS=(εL−εH)+2(HL∣HL)−(HH∣LL).
Both Coulomb integrals are positive, but
(HH∣LL) — the Coulomb repulsion between the HOMO
electron density and the LUMO electron density — is much larger
than (HL∣HL) — the self-repulsion of the transition
density, which oscillates sign and partially cancels. So
(HH∣LL)≫2(HL∣HL) and the diagonal of A sits well
below the orbital gap.
The physical picture: the orbital gap measures "lift one electron
from H to L while keeping every other electron frozen." But the
excited electron and the hole it left behind attract each
other Coulombically — the excitation is an exciton, not a free
electron-hole pair. That attraction is the −(HH∣LL)
term in the matrix. For tightly-bound molecular excitons like H2
the attraction is several eV; for delocalized solid-state excitons
it's millielectronvolts. Same algebra, vastly different scales.
On top of this diagonal correction, the B matrix and the
off-diagonal A terms (when there are multiple virtuals) provide
further coupling, but the dominant correction to the orbital gap
is right there in the diagonal.
predict
Without looking at the output, predict whether the lowest singlet is
higher or lower than the lowest triplet for H2 — argue from the
structure of the singlet and triplet A matrices given in the text.
Now check: is the singlet-above-triplet ordering universal, or are
there molecules where it inverts?
answer
Singlet A: δijδab(εa−εi)+2(ia∣jb)−(ij∣ab).
Triplet A: δijδab(εa−εi)−(ij∣ab).
The difference is the 2(ia∣jb) Coulomb term, present in
the singlet, absent in the triplet. Coulomb integrals
(ia∣ia) are positive — they're self-repulsions of
transition densities. So the singlet A is element-wise larger than
the triplet A on the diagonal, and the lowest singlet eigenvalue
sits above the lowest triplet eigenvalue. This is Hund's rule in
the orbital language: aligning electron spins (triplet) reduces
the Coulomb cost of two electrons being in the same region.
Exceptions exist but are rare:
Charge-transfer states where the electron and
hole sit on different fragments. The transition density
ψiψa is then small (orbitals don't
overlap), so 2(ia∣jb) is small, and the singlet
sits right on top of the triplet. Triplet stays slightly below
but the splitting is tiny.
Some excited states of certain organic dyes
where exchange is anomalously small. Inverted singlet-triplet
gaps (called "Hund's rule violators") have been observed
experimentally in molecules like cycl[3.3.3]azine and are an
active topic in OLED design.
For H2 in its closed-shell ground state the textbook ordering
holds with a 5-eV splitting, matching the output.
why does this work
The output says "TDA overshoots S1 by 0.228 eV (de-excitation
coupling that TDA discards)." Argue from perturbation theory why
discarding B always raises excitation energies — never lowers them
— for stable closed-shell references. Connect this to the Schur
complement of the block matrix.
answer
Treat the off-diagonal block B as a perturbation on top of the
block-diagonal problem with B = 0. The block-diagonal problem is
TDA: A acts on the X block, A acts on the Y block, and the X-Y
coupling vanishes. The unperturbed positive-frequency spectrum is
exactly the spectrum of A.
Switching B on couples each X state to Y states. Because the
metric on the right-hand side has a minus sign in the Y block, the
Y states sit at negative frequencies. So an X state at
positive ωn gets coupled, by B, to Y states at
−ωm for all m. Standard
second-order perturbation theory gives a shift
Δωn∼−∑m∣Bnm∣2/(ωn+ωm).
Every denominator is positive (both frequencies positive); every
numerator is non-negative. So the shift is non-positive — adding
B always lowers the positive-frequency roots.
Equivalently, in Schur-complement language: solving the full block
equation for the X block alone gives a frequency-dependent
effective Hamiltonian
A−B(ω+A)−1B whose negative-definite
correction term is exactly the de-excitation coupling. TDA
approximates this by setting B=0 and loses that
downward shift. The size of the shift scales with the size of
the B matrix relative to the A matrix; for valence excitations
the ratio is small (a few percent), so TDA error is ~0.1-0.3 eV.
For Rydberg or charge-transfer states the B block grows relative
to A and the TDA error grows with it.
invariant
The text claims (A+B)(A−B) is "similar to a Hermitian
operator." Write down the similarity transform precisely — what
matrix S makes
S−1(A+B)(A−B)S Hermitian? Then: similarity preserves
eigenvalues but transforms eigenvectors. When is this transform
numerically dangerous?
answer
Let S=(A−B)1/2 — the symmetric positive square
root of A−B, which exists because A−B
is symmetric positive-definite by assumption. Then
S−1(A+B)(A−B)S=S−1(A+B)S2S−1⋅S=S−1(A+B)S⋅S=S−1(A+B)S⋅S.
Carefully:
(A+B)(A−B)=(A+B)S⋅S and
S−1(A+B)(A−B)S=S−1(A+B)S⋅S−1S⋅S=S−1(A+B)S⋅S.
Cleaner: the conjugation
S⋅(eigenproblem)⋅S−1 converts
(A+B)(A−B)v=ω2v into
S(A+B)S⋅(S−1v)=ω2(S−1v),
and S(A+B)S=(A−B)1/2(A+B)(A−B)1/2 is
manifestly Hermitian. So S=(A−B)1/2 is the
transform, and the eigenvector relation is
Z=(A−B)1/2(X−Y).
Numerical danger: when A−B has eigenvalues close to
zero (approaching a triplet instability), (A−B)1/2
is well-defined but (A−B)−1/2 — needed to recover
X−Y from Z — blows up. The eigenvalue
problem is still well-conditioned for the eigenvalues themselves,
but the eigenvectors become ill-determined and the oscillator
strengths derived from them lose accuracy. Once any eigenvalue of
A−B goes through zero, the square root becomes
imaginary and the whole approach breaks: that is exactly the
triplet-instability signal. The code above handles this defensively
with np.maximum(w, 0), which silences the failure but
also silently lies — at that point the closed-shell reference is
physically wrong and you need an UHF or post-HF method, not a
better Casida solver.
Hack This
The code above works. Don't reinvent it — pull it into an editor, run it, and
try the modifications below. Each one is small. Each one will change the behavior
in a specific way; the question is which way.
trivial
Stretch the H–H bond. Replace the geometry line with
atom=f'H 0 0 0; H 0 0 {R}' and sweep R
from 0.5 to 5.0 Å in steps of 0.25. At each step, record (a) the
RHF total energy, (b) the lowest singlet excitation, (c) the lowest
triplet excitation, (d) the smallest eigenvalue of
A−B (compute it with np.linalg.eigvalsh).
Plot all four. At what bond length does the smallest eigenvalue of
A−B go through zero? Match that to a known feature
of RHF: where does the singlet–triplet gap close? Where does the
Restricted HF approximation start to lie about the dissociation
limit? Try to articulate why the breakdown of the closed-shell
reference shows up specifically as
λmin(A−B)→0.
hint
Around R ≈ 1.2-1.3 Å the smallest eigenvalue of A−B crosses zero.
That's the Coulson-Fischer point — the RHF wavefunction becomes
unstable against breaking spin symmetry. Past that point the
closed-shell reference is qualitatively wrong (it forces equal
occupation of an electron and its partner on each H, even though
at large R the correct ground state has one electron on each H).
The Casida triplet instability is the linear-response signal of
this. A UHF calculation past Coulson-Fischer would give a different
(lower) ground state.
small
The TDHF code above is built on Hartree-Fock orbitals with the
Coulomb-minus-exchange kernel. Switch it to TDDFT. The mechanical
change is: (a) replace scf.RHF(mol) with
scf.RKS(mol) and set mf.xc = 'b3lyp';
(b) replace tdscf.TDHF with tdscf.TDDFT
for the reference check. The conceptual question: experimental H2
S0→S1 is about 12.6 eV. TDHF gives 15.02 eV. Where does TDDFT/B3LYP
land? Why is the typical TDDFT improvement over TDHF for valence
excitations on the order of an eV, and why does it usually go in
the right direction even though both are approximations to
the same underlying linear response problem?
hint
TDDFT's improvement comes from the underlying ground-state
orbitals being better than HF orbitals — DFT recovers some
dynamical correlation that HF entirely misses. The TDDFT kernel
is also closer to the exact kernel for valence states. Both
effects push the excitation energy down toward experiment for
H2. Where TDDFT goes wrong systematically: Rydberg states (too
low), charge-transfer states (way too low, often by several eV),
and any state with substantial double-excitation character (the
adiabatic approximation can't describe these at all).
small
Change the basis from '6-31g' to 'aug-cc-pVDZ'.
The number of virtuals jumps and a family of new excitations appears.
Look at the lowest few singlet roots. Identify which roots existed
in 6-31G (compact, valence-like) and which are entirely new
(extended, diffuse). One way to tell: examine the transition density
— diffuse states will have transition densities that extend far
beyond the nuclei. Plot one of the new transition densities along
the bond axis and one of the original ones; the spatial extent will
be visibly different. Articulate what specifically about
"augmented" basis sets enables them to represent these states.
hint
"Augmented" basis sets add diffuse primitive Gaussians — Gaussians
with very small exponents (large spatial extent). Rydberg
excitations promote an electron into a hydrogenic-like orbital that
extends many Bohr radii from the nuclei. 6-31G has no such
functions, so it cannot represent those states at all; you'll see
them appear as soon as you add diffuse functions. For H2 the
physical S2 and S3 in experiment are Rydberg-like; you'll find
them missing from 6-31G and present in aug-cc-pVDZ.
small
The Tamm-Dancoff approximation at the HF level is exactly
Configuration Interaction Singles (CIS). Verify this empirically:
add a call to tdscf.TDA(mf).kernel() (PySCF's TDA-HF,
which IS CIS) and compare to your tda_omega output.
They should agree to machine precision in both spin blocks. Now the
conceptual probe: for TDDFT, "TDA-DFT" is widely used but is NOT
configuration interaction singles in any meaningful sense (there is
no underlying Slater determinant being correlated). What does
TDA-DFT actually approximate, and why is it nonetheless often more
reliable than full TDDFT for triplet states near instabilities?
hint
TDA-HF: diagonalize A, where A is the matrix of singly-excited
determinant Hamiltonian matrix elements. That IS CIS — the same
matrix, the same eigenvalue problem, derived from a wavefunction
ansatz. TDA-DFT: diagonalize a structurally identical A built
from KS orbitals and the DFT kernel. There's no underlying CI
wavefunction; what you're computing is the dominant
Casida response truncated to forward-time-only. Practical bonus:
TDA-DFT cannot trigger the (A−B)^(1/2) failure mode because B
is gone, so it survives triplet instabilities that crash full
TDDFT. The downside is the systematic positive bias of a few
tenths of an eV; the upside is robustness.
medium
Replace the Hermitian-square-root rewrite with a direct solve of
the non-Hermitian eigenvalue problem
(A+B)(A−B)Z′=ω2Z′
using np.linalg.eig (not eigh).
Compare the eigenvalues to the original output — they should agree
to floating-point precision for H2. Now examine the eigenvectors of
both solvers. The Hermitian rewrite produces orthonormal
eigenvectors; the direct eig call produces biorthogonal
left/right eigenvectors. Verify numerically that the right
eigenvectors of eig are not orthogonal under
the standard inner product. What inner product DO they obey, and
why does that inner product look like a generalization of the
Hermitian one? Bonus: time both solvers on a larger system (say
H2O / cc-pVDZ) and note the practical performance gap.
hint
The biorthogonality is under the indefinite metric
σz=diag(1,−1) in
the full (X,Y) space, restricted to one block. In the
reduced space spanned by X−Y, the eigenvectors of
(A+B)(A−B) are orthogonal under the inner product
defined by (A−B) itself — that is,
vT(A−B)w=0 for distinct-eigenvalue pairs. This
is the natural inner product that the Hermitian rewrite "absorbs"
into the eigenvector definition Z=(A−B)1/2(X−Y).
Performance: np.linalg.eig uses LAPACK
geev (QR iteration on a Hessenberg form); eigh
uses syevr (divide-and-conquer on a tridiagonal form).
The Hermitian path is about 3× faster and substantially more
accurate near degeneracies.
medium
The canonical TDDFT failure mode. Modify the geometry to put two
H2 molecules at variable separation along the z-axis:
atom=f'H 0 0 0; H 0 0 0.74; H 0 0 {R+0.74}; H 0 0 {R+1.48}'
with R ranging from 2 to 10 Å. At each R
compute the lowest singlet excitation with two methods: (a) the
existing TDHF code, (b) TDDFT/LDA by swapping
scf.RHF for scf.RKS(mol).set(xc='lda')
and tdscf.TDHF for tdscf.TDDFT. Plot both
against R.
The exact inter-fragment charge-transfer (CT) excitation energy
asymptotes to ID−AA−1/R at large R — donor's
ionization potential, minus acceptor's electron affinity, minus
the Coulomb attraction between the resulting cation and anion.
TDHF reproduces the 1/R falloff. TDDFT with LDA (or any pure
semi-local functional) does not: its CT energy
approaches a constant instead, badly underestimating the correct
asymptote. The CT energy in adiabatic TDDFT collapses to roughly
the orbital-energy gap εa−εi,
which has the wrong R-dependence.
This single observation explains why charge-transfer states are
the canonical TDDFT bug, why range-separated hybrids (CAM-B3LYP,
ωB97X, LC-ωPBE) exist, and why hybrid functionals (B3LYP, PBE0)
do better than pure DFT for CT — they all restore long-range HF
exchange in some form.
hint
The asymptote of vxc for semi-local functionals
decays like exp(−r) instead of the exact
−1/r. HF exchange has the right
−1/r tail by construction, which is what provides
the missing donor-acceptor Coulomb attraction. Range-separated
hybrids split 1/r12=erf(μr12)/r12+erfc(μr12)/r12
and treat short-range with DFT, long-range with HF exchange.
Why it doesn't scale to solids
For a molecule with a few hundred basis functions you get an NoccNvir Casida matrix of size ∼104, which dense LAPACK handles in seconds. For a solid in a plane-wave basis with a dense k-mesh the dimension blows up to 106 and beyond, and worse, the spectrum becomes a continuum — there is no point resolving a million individual roots when what you want is the smooth function Imχ(ω). That is the regime where Liouville-Lanczos takes over: never form the Liouvillian, never diagonalize it, get the whole spectrum from one matrix-free Krylov chain plus a continued-fraction terminator.
Deep dive: where A and B come from
Before diving into the algebra, an aside on the single-particle business that grinds my gears. Every single-particle model — Hartree-Fock, Kohn-Sham, the nuclear shell model — works by calculating a stack of single-particle levels and then filling them using some occupation rule (RHF, UHF, even shell, odd shell). You are approximating a many-body Hamiltonian by populating a single-particle level diagram. Single particle + spin rules is the formula. The fascinating part is that as soon as you get into "many-body" quantum mechanics you start learning how to make single-particle models in mean fields with spin rules.
Step 0: Strategy — linear response of the ground state
First, like most DFT calculations, you need the ground state. The DFT calculation returns with a set of orbitals which you fill from lowest to highest. In practice that means that the first n/2 orbitals are filled with two electrons each. Now we need to annoy, or as they say in the physics community perturb, the ground state. You know how when you annoy someone with just the right frequency they react? The same principle applies here. We use an external field and from there we test which frequencies annoy the ground state the most. Each frequency that gets a reaction is an excitation energy ωn, and the size of the reaction is the oscillator strength fn.
Time to put that in math. The Greek letter δ just means "a small change in," so δvext is a small change in the external potential — that's our laser. We make it oscillate at frequency ω:
δvext(r,t)=δvext(r,ω)e−iωt+c.c.
The "c.c." at the end is shorthand for "complex conjugate of the previous term." We need it because the field has to be real, but e−iωt on its own is complex; adding its conjugate cleans that up. The electron density reacts to the field by wobbling — call that wobble δρ, oscillating at the same frequency ω.
How big a wobble depends on the frequency. To turn "how big" into a number, we use the dynamic polarizability α(ω) — basically, how much the molecule's dipole moment shifts when you shake it with a field at frequency ω:
α(ω)=−∫rδρ(r,ω)dr.
Why bother writing it this way? Because α(ω) blows up — has poles — at exactly the excitation energies. So if we can write down the equation that governs δρ(ω), the eigenvalues of that equation are the ωn. That is the entire strategy.
Step 1: The TDKS equation
The starting point is the time-dependent Kohn-Sham equation for the one-particle density matrix:
i∂tγ^(t)=[H^KS[γ,t],γ^(t)].
Step 2: HKS under a small perturbation
The Hamiltonian on the right is the instantaneous one, and it itself depends on the density. To first order in the perturbation, it splits into three pieces:
The first piece is the static KS Hamiltonian — its eigenstates are the ψi and ψa, eigenvalues εi and εa. The second is the external perturbation (the laser). The third is the self-consistent response: when the density wobbles by δρ, the Hartree-XC potential wobbles with it, and the wobble acts back on the orbitals. The kernel KHXC is the static response function — Coulomb minus exchange in TDHF, Coulomb plus the XC kernel fxc in TDDFT.
Step 3: Linear response of the density matrix → X and Y
Now expand the density matrix to first order: γ^(t)=γ^0+γ^1(t), where γ^0 is the ground-state projector and γ^1 is the wobble. The wobble has to live in the off-diagonal occupied-virtual block of the density matrix (the diagonal blocks can't change at first order — particle number is fixed). There are two independent corners: virtual-occupied (call its amplitude X) and occupied-virtual (amplitude Y):
The self-consistent piece [V^HXC′[γ^1],γ^0] contributes the two-electron matrix elements — the kernel KHXC sandwiched between orbital products. For a monochromatic field at frequency ω, equate coefficients of e−iωt on both sides of i∂tγ^1=[⋅,⋅] and project onto orbital pairs (ψa,ψj). What drops out is exactly the Casida block equation, with matrix elements:
The bracket notation ⟨ψaψj∣KHXC∣ψiψb⟩ means the spatial integral ∫ψa∗(r)ψj∗(r′)KHXC(r,r′)ψi(r)ψb(r′)drdr′ — the kernel acting on a product of two transition densities. That's the (ia∥jb) notation used above. The difference between A and B is which orbital pair you put on each side of the kernel: A pairs (a,j) on the left with (i,b) on the right; B pairs (a,b) with (i,j). That's the only difference between excitation-excitation coupling and excitation-de-excitation coupling.
Step 5: TDDFT and TDHF — a structural difference in the coupling matrix
The derivation above applies to both TDDFT and TDHF — the only difference is the kernel KHXC. But the two cases have a hidden structural asymmetry worth surfacing. Because DFT's self-consistent potential is local (acts on the density at a single point), the TDDFT coupling matrix has the full set of orbital-index symmetries:
The practical consequence: adiabatic TDDFT matrices have fewer independent entries than TDHF ones, so they're cheaper to assemble and faster to diagonalize. Counterintuitive — you might expect TDHF to be simpler because it has no XC kernel to worry about — but locality buys symmetry, and symmetry buys speed. The same locality property is what makes the auxiliary-function (resolution-of-identity / density-fitting) factorization Casida introduced in his 1995 paper possible for TDDFT but harder for TDHF.
Step 6: Hermitian rewrite (covered in the body)
Having the block equation in hand, the next move is to fold its indefinite metric into the operator and end up with a standard Hermitian eigenvalue problem half the size:
(A−B)1/2(A+B)(A−B)1/2Z=ω2Z. The derivation
— adding and subtracting the two block rows, using positive-definiteness of A−B at a stable minimum to define the symmetric square root, then conjugating — is written out in the Why it's a pseudo-eigenvalue problem section above. No need to repeat it here.
Step 7: Spin adaptation (covered in the body)
For a closed-shell reference the full Casida problem factors into independent singlet and triplet blocks of half the size. The block-by-block A and B formulas — singlet picks up the 2(ia∣jb) Coulomb piece that the triplet drops — appear in the Spin adaptation section above. The minimal-basis H2 walk-through then shows the singlet-triplet splitting collapsing to a single integral.
Step 8: From derivation to code
Every step above has a one-to-one image in the H2 Python program. Hovering the annotations on the code block lays this out line-by-line; the summary view:
Steps 0–1 (reference state):scf.RHF(mol).run() produces the converged ψi, εi, and density matrix. Everything downstream feeds off these.
Step 2 (the kernel KHXC):
In TDHF the kernel is the Coulomb-minus-exchange piece — computed from the two-electron integrals. mol.intor('int2e') + ao2mo.incore.full(eri_ao, mf.mo_coeff) assemble those integrals in the MO basis.
Step 3 (X, Y amplitudes):
Don't appear explicitly as variables in the program — they're implicit in the structure of the eigenvalue problem. The Casida matrix acts on a vector of length NoccNvir which represents the combined X-Y degree of freedom in the spin-adapted block.
Step 4 (assembling A and B):
The four lines
A_singlet = delta + 2.0 * iajb - ijab,
B_singlet = 2.0 * iajb - ibja,
A_triplet = delta - ijab,
B_triplet = -ibja
are this step, written out for both spin sectors.
Step 5 (coupling-matrix symmetry):
Doesn't appear directly in the code — it's why we get away with storing iajb, ijab, ibja as three small tensors rather than enumerating all asymmetric variants.
Step 6 (Hermitian rewrite):
The body of casida_omega. np.linalg.eigh(AmB) diagonalizes A−B; (U * np.sqrt(np.maximum(w, 0))) @ U.T builds the symmetric square root; sqrt_AmB @ ApB @ sqrt_AmB conjugates; np.linalg.eigvalsh(M) gives ω2; the final np.sqrt recovers ω.
Step 7 (spin adaptation):
The reason there are two calls to casida_omega, one for each of (A_singlet, B_singlet) and (A_triplet, B_triplet). The blocks don't talk to each other; we just solve each independently.
Read the code once with this map in mind and the whole program is just the derivation, executed.
Q&A
Study notes in question-and-answer form. The questions are the ones a
reader would actually ask at each point — framing first, then
drill-down, then a final compression. Pair them with the deep dive
above when you want to test recall.
What problem does Casida solve, and why was it hard before?
Computing electronic excitation energies and oscillator strengths.
The hard way is to build excited-state many-body wavefunctions
directly (CIS, CISD, CASSCF, coupled cluster) and compute transitions
between them. Those methods scale steeply — O(N4) at
the cheapest, O(N7) for chemically accurate ones.
Casida sidesteps it: instead of building excited states, perturb
the ground state with a small external field and look at the
response. The poles of the response function are the
excitation energies, and they come out of a single eigenvalue
problem of dimension Nocc⋅Nvirt —
much smaller than the full many-body Hilbert space.
What's the core idea?
Linearize the time-dependent Kohn-Sham (or Hartree-Fock) equation
around the converged ground state. The first-order density-matrix
perturbation γ^1 has only off-diagonal entries
in the occupied-virtual basis — two amplitudes per particle-hole
pair, called X and Y. In frequency domain
they obey a coupled block equation:
(AB∗BA∗)(XY)=ω(100−1)(XY).
Find the eigenvalues ω; those are the excitation
energies.
Why does the dimension come out to N_occ × N_virt?
X and Y are indexed by particle-hole pairs
(i,a) — i over occupied orbitals,
a over virtual orbitals. There are
Nocc⋅Nvirt such pairs. For H2
in 6-31G with one occupied and three virtuals, that's 3. For a
medium molecule in cc-pVDZ with 100 occupied and 200 virtual,
that's 20,000 — solvable by dense LAPACK in seconds. For a solid
with thousands of bands and a dense k-mesh the dimension explodes
past 106. That's where Casida breaks down and
Liouville-Lanczos takes over.
What are X and Y physically?
Xia is the amplitude for an electron to leave
occupied orbital i and end up in virtual orbital
a at frequency ω.
Yia is the amplitude for the time-reversed process —
an electron returning from a to i. Linear
response includes both because the density's wobble at
ω has a forward and a backward component. They
live in the two off-diagonal corners of γ^1;
the diagonal blocks are forbidden by particle-number conservation
and idempotency.
Why does the block equation have a minus sign on the right?
X and Y are time-reversed partners. An
excitation at +ω is the same physical state as a
de-excitation at −ω. The minus sign in the
right-hand metric tracks this. Positive eigenvalues are physical
excitations; negative eigenvalues are their de-excitation partners
(same states, opposite sign of ω). The indefinite
metric is what keeps Casida from being a standard eigenvalue
problem until you do the Hermitian rewrite.
How does the Hermitian rewrite work?
Add the two block rows: (A+B)(X+Y)=ω(X−Y).
Subtract: (A−B)(X−Y)=ω(X+Y). Combine:
(A+B)(A−B)(X−Y)=ω2(X−Y). The operator
(A+B)(A−B) isn't Hermitian, but if A−B is
positive-definite (which it is at a stable minimum), take its
symmetric square root and conjugate:
(A−B)1/2(A+B)(A−B)1/2Z=ω2Z,Z=(A−B)1/2(X−Y).
Hermitian, positive-definite, half the size of the original.
Eigenvalues are ω2; physical excitation energies
are the square roots.
What's the difference between TDA and full Casida?
TDA drops B entirely. The Casida equation collapses to
AX=ωX — a standard Hermitian eigenvalue
problem of half the size, no rewrite needed. The cost is a
systematic upward bias on positive-frequency roots, because adding
B always lowers them. The benefit: TDA is immune to
triplet instabilities (no A−B to go non-positive-definite),
and the eigenvectors are orthonormal under the standard inner
product. Most molecular excitation-energy work uses TDA by
default; full Casida is what you reach for when oscillator
strengths or specific frequency regions matter.
What does spin adaptation give you for closed-shell?
The full spin-orbital problem factors into independent singlet
and triplet blocks, each half the size. Matrix elements:
The singlet picks up the 2(ia∣jb)
Coulomb-of-transition-density piece that the triplet drops. Both
keep the orbital gap and the electron-hole attraction
−(ij∣ab). Solve each block independently; they don't
mix.
Why is the singlet-triplet splitting exactly 2(gu|gu) in minimal-basis H2?
Minimal basis gives one occupied (ψg) and one
virtual (ψu). The only allowed index is
(g,u), so the spin-adapted A matrices are
single numbers: AS=(εu−εg)+2(gu∣gu)−(gg∣uu),
AT=(εu−εg)−(gg∣uu).
Difference: 2(gu∣gu). Physically: the singlet pays a
Coulomb cost the triplet avoids by aligning spins (exchange hole).
Hund's rule, written out in algebra.
What's a triplet instability?
A point where the lowest eigenvalue of A−B in the
triplet block crosses zero. Past it, ω2<0 and
the lowest triplet excitation energy goes imaginary. Physically:
the closed-shell RHF reference becomes unstable to spin-symmetry
breaking — a small density wobble in that direction lowers the
total energy. Classic example: H2 stretched past the
Coulson-Fischer point, where the RHF reference no longer
correctly describes the dissociating bond. The fix is to relax
the closed-shell constraint and use a UHF (or broken-symmetry)
reference.
How do oscillator strengths come out of the eigenvectors?
After the Hermitian rewrite gives eigenvalues
ωn2 and eigenvectors Zn, undo
the rewrite to recover
(X+Y)n∝(A−B)−1/2Zn. The transition
density is
ρn(r)=∑ia(X+Y)n,iaψi∗(r)ψa(r).
The oscillator strength is
fn=32ωn∫rρn(r)dr2.
Dipole-integrate the transition density, square, multiply by
2ωn/3. Dimensionless number that says how
brightly state n absorbs.
Why does pure DFT-TDDFT badly underestimate charge-transfer energies?
At long range, the xc potential vxc of LDA and GGA
decays exponentially instead of the correct −1/r. For
a charge-transfer excitation between well-separated donor and
acceptor, the right asymptote is ID−AA−1/R:
donor ionization potential, minus acceptor electron affinity,
minus the Coulomb attraction of the resulting ion pair. Adiabatic
TDDFT collapses the CT energy to roughly
εa−εi, which has no
1/R piece — the missing long-range exchange was
supposed to provide it. HF exchange is nonlocal and has the
correct −1/r tail by construction, which is why TDHF
gets CT right and why range-separated hybrids
(CAM-B3LYP, ωB97X, LC-ωPBE)
restore long-range exchange to fix this.
Why does Casida fail for solids?
Two reasons. First, dimension: in a plane-wave calculation with
thousands of bands and a dense k-mesh, the Casida matrix dimension
easily reaches 106 or more. Dense diagonalization is
impossible at that scale. Second, the spectrum: a solid has a
continuum, not a discrete set of poles. Resolving each eigenvalue
individually is meaningless — what you want is the smooth function
Imχ(ω).
Liouville-Lanczos
handles both: it computes the response function directly via a
matrix-free Krylov chain, without ever forming or diagonalizing
the Liouvillian.
What's the cleanest mental compression?
Two steps. (1) Linear response: perturb the converged ground
state with a small periodic field; the density wobbles; the poles
of the response function are the excitation energies. (2)
Eigenvalue problem: project the linearized TDKS equation onto
particle-hole orbital pairs; get a block matrix equation with an
indefinite metric; Hermitian-rewrite it to size
NoccNvirt; eigenvalues are
ω2. Everything else — spin adaptation, TDA,
oscillator strengths, triplet instabilities, charge-transfer
failure, the auxiliary-function trick — is a consequence of those
two steps.
Related on this site
Liouville-Lanczos is the matrix-free, frequency-sweep cousin of Casida for solids and large systems. Lanczos iteration is the underlying Krylov method; bi-orthogonal Lanczos is the non-Hermitian variant needed when the operator (the Liouvillian) is non-symmetric.
Unit conversion used throughout: 1Ha=27.211386eV
(CODATA 2018 recommended value).