## Phase 118: Kalika Many-Body Electronic Structure — GW Approximation, Bethe-Salpeter Equation, DMFT, Quantum Monte Carlo & Coupled Cluster for Solids

Beyond-DFT methods essential for accurate band gaps, optical spectra, and
strongly correlated materials. Covers the full hierarchy from perturbative GW
through BSE excitonics, DMFT for strong correlations, QMC stochastic methods,
and wavefunction-based coupled cluster for solids. Every library targets parity
with the leading codes in each domain: BerkeleyGW and VASP for GW/BSE, ABINIT GW
for space-time methods, w2dynamics and TRIQS for DMFT, QMCPACK for QMC, and
PySCF/CC4S for periodic coupled cluster. Rust (~55%) handles compute-heavy
many-body kernels (matrix operations, Monte Carlo sampling, tensor
contractions), TypeScript (~35%) provides orchestration, I/O, and user-facing
APIs, Python (~10%) bridges to existing electronic structure ecosystem (PySCF,
ASE, GPAW).

---

### 118.1 Scaffolding & Core Types (`@kalika/many-body`)

#### 118.1.1 Green's Function Infrastructure

- [x] **118.1.1.1** Implement `GreenFunction` type: frequency-dependent
      single-particle Green's function G(k,ω) stored on either a Matsubara
      frequency grid (iω_n = i(2n+1)πT for fermions) or real-frequency grid,
      with spin indices (σ,σ'), band indices (n,m), and k-point labels —
      supporting both retarded G^R(ω) and Matsubara G(iω_n) representations with
      conversion between them
- [x] **118.1.1.2** Implement `SelfEnergy` type: Σ(k,ω) with the same index
      structure as GreenFunction, plus methods for extracting quasiparticle
      properties — Z-factor Z*nk = (1 - ∂ReΣ/∂ω|*{ε_nk})⁻¹, quasiparticle energy
      E_nk = ε_nk + Z_nk · ReΣ(k,ε_nk), and quasiparticle lifetime τ_nk =
      ℏ/(2|ImΣ(k,E_nk)|)
- [x] **118.1.1.3** Implement `Polarizability` type: irreducible polarizability
      χ₀(G,G',q,ω) as a matrix in reciprocal lattice vectors G,G' for each (q,ω)
      point, with methods for computing from KS orbitals via the Adler-Wiser
      formula: χ₀(G,G',q,ω) = (2/Ω) Σ*{v,c,k} ⟨v,k|e^{-i(q+G)·r}|c,k+q⟩
      ⟨c,k+q|e^{i(q+G')·r}|v,k⟩ × [1/(ω - ε*{ck+q} + ε*{vk} + iη) - 1/(ω +
      ε*{ck+q} - ε\_{vk} - iη)]
- [x] **118.1.1.4** Implement `DielectricFunction` type: ε(G,G',q,ω) = δ*{GG'} -
      v(q+G) χ₀(G,G',q,ω) where v(q+G) = 4πe²/|q+G|² is the bare Coulomb
      interaction, with methods for computing the macroscopic dielectric
      function ε_M(q,ω) = 1/ε⁻¹*{G=0,G'=0}(q,ω) including local field effects
- [x] **118.1.1.5** Implement `ScreenedInteraction` type: W(G,G',q,ω) =
      ε⁻¹(G,G',q,ω) · v(q+G'), computed by inverting the dielectric matrix at
      each (q,ω) point, with methods for extracting the screened Coulomb
      interaction W_c = W - v (correlation part only)
- [x] **118.1.1.6** Implement `SpectralFunction` type: A(k,ω) = -(1/π) Im
      G^R(k,ω) for single-particle spectral functions, with methods for
      computing momentum-resolved A(k,ω) and momentum-integrated DOS N(ω) = Σ_k
      A(k,ω), plus Fermi surface extraction at ω=0
- [x] **118.1.1.7** Implement `Vertex` type: three-point vertex function
      Γ(k,k',q;ω,ω',ν) in the particle-hole channel, with the bare vertex Γ₀ = 1
      and the dressed vertex satisfying the Bethe-Salpeter equation in the
      vertex channel — stored as a rank-3 tensor over (k,k',q) and three
      frequency arguments

#### 118.1.2 Frequency & Momentum Grids

- [x] **118.1.2.1** Implement Matsubara frequency grid: uniform grid iω_n =
      i(2n+1)πT for fermions and iν_m = i·2mπT for bosons at temperature T, with
      high-frequency tail fitting G(iω_n) ~ 1/iω_n + c₁/(iω_n)² + c₂/(iω_n)³ for
      accurate Fourier transforms to imaginary time
- [x] **118.1.2.2** Implement real-frequency grid: non-uniform grid with dense
      sampling near the Fermi level (Gauss-Legendre or tangent-mesh), broadening
      parameter η management, and Hilbert transform for converting between
      spectral function A(ω) and retarded Green's function G^R(ω)
- [x] **118.1.2.3** Implement imaginary-time grid: τ ∈ [0,β] with optimized
      non-uniform mesh (IR basis or DLR — discrete Lehmann representation),
      supporting fast Fourier transforms between τ and iω_n via the intermediate
      representation (IR) basis of Shinaoka et al.
- [x] **118.1.2.4** Implement k-point grid infrastructure: Monkhorst-Pack grids
      with time-reversal symmetry reduction, symmetry-inequivalent k-point
      selection, tetrahedron method for BZ integration (Bloechl improved
      tetrahedron), and interpolation between k-grids via Wannier functions
- [x] **118.1.2.5** Implement frequency-momentum interpolation: Wannier
      interpolation for band energies ε_nk and matrix elements ⟨nk|O|mk+q⟩ onto
      arbitrary fine k-grids from a coarse DFT grid, using maximally localized
      Wannier functions (MLWF) from Wannier90-compatible data

#### 118.1.3 I/O & Interoperability

- [x] **118.1.3.1** Implement DFT input readers: parse KS eigenvalues, orbitals,
      and wavefunctions from VASP (WAVECAR, EIGENVAL, vasprun.xml), Quantum
      ESPRESSO (data-file-schema.xml, UPF pseudopotentials), ABINIT (WFK files),
      and GPAW (gpw files) — extracting band energies, occupation numbers,
      k-point weights, and plane-wave coefficients
- [x] **118.1.3.2** Implement Wannier90 interface: read/write wannier90.win,
      wannier90.amn (projection matrix), wannier90.mmn (overlap matrix),
      wannier90.eig (eigenvalues), and the resulting \_hr.dat (Hamiltonian in
      Wannier basis) — enabling Wannier interpolation of all many-body
      quantities
- [x] **118.1.3.3** Implement HDF5-based checkpoint format: save and restore
      intermediate quantities (χ₀, ε, W, Σ) to HDF5 files with standardized
      group structure, enabling restart of interrupted calculations and reuse of
      expensive intermediates (e.g., reuse W for multiple BSE calculations)
- [x] **118.1.3.4** Implement BerkeleyGW compatibility layer: read/write
      BerkeleyGW binary formats (epsmat, eps0mat for dielectric matrices; sigma
      for self-energy; bsedmat/bsexmat for BSE kernel) for cross-validation

#### 118.1.4 Parallelism & Memory Management

- [x] **118.1.4.1** Implement distributed-memory data layout for large matrices:
      block-cyclic distribution of ε(G,G',q,ω) across MPI ranks using ScaLAPACK
      conventions, with 2D process grid mapping and efficient redistribution
      between different parallel decompositions (q-parallelism for χ₀ vs.
      G-parallelism for matrix inversion)
- [x] **118.1.4.2** Implement memory-efficient frequency treatment: out-of-core
      storage for full-frequency quantities, with on-demand loading of frequency
      slices, LRU caching of recently accessed (q,ω) blocks, and streaming
      computation patterns that process one frequency at a time
- [x] **118.1.4.3** Implement GPU acceleration stubs with WASM/napi-rs bridge:
      define GPU kernel interfaces for matrix-matrix multiplication (ZGEMM),
      batched matrix inversion, and FFT — with Rust implementations via
      `wgpu`/`cublas` bindings and fallback to CPU BLAS (OpenBLAS/MKL via
      `ndarray-linalg`)

#### 118.1.5 Symmetry Infrastructure

- [x] **118.1.5.1** Implement crystal symmetry operations for many-body
      quantities: apply space group symmetries to reduce BZ sums in χ₀, Σ, and W
      — for each symmetry operation S in the little group of q, relate matrix
      elements at Sk to those at k via rotation of plane-wave coefficients,
      reducing the number of independent k-points by a factor of |G_q| (little
      group order)
- [x] **118.1.5.2** Implement time-reversal symmetry exploitation: use G(k,ω) =
      G\*(-k,ω) and W(q,ω) = W(-q,ω) to halve the BZ sampling, with proper
      handling of systems where time-reversal is broken (magnetic systems,
      systems with SOC and broken inversion)
- [x] **118.1.5.3** Implement symmetry-reduced k-point unfolding: given
      quantities computed on the irreducible BZ, unfold to the full BZ using
      symmetry operations for band-structure plotting and spectral function
      visualization along arbitrary k-paths
- [x] **118.1.5.4** Implement q-point symmetry for the dielectric matrix: use
      the relation ε(Sq,ω) = S · ε(q,ω) · S⁻¹ to reduce the number of
      independent q-points for W and χ₀ computations, with proper treatment of
      the q→0 limit under symmetry operations

#### 118.1.6 Unit & Conversion Infrastructure

- [x] **118.1.6.1** Implement energy unit system: automatic conversion between
      Hartree (atomic units), eV, Ry, cm⁻¹, K, and THz — with all internal
      calculations in atomic units and user-facing output in configurable units,
      including physical constants (Bohr radius, fine structure constant, etc.)
      at CODATA 2018 precision
- [x] **118.1.6.2** Implement Fourier transform utilities: FFT between
      real-space and reciprocal-space representations for wavefunctions,
      densities, and potentials, with proper normalization conventions (1/√Ω for
      plane waves), zero-padding for interpolation, and support for non-cubic
      cells via the cell-adapted FFT grid
- [x] **118.1.6.3** Implement Coulomb matrix element utilities: compute bare
      Coulomb matrix elements ⟨nk|v|mk+q⟩ in the plane-wave basis, with proper
      treatment of the G=0 divergence (auxiliary function method or
      Gygi-Baldereschi method) and head/wing/body decomposition for the q→0
      limit

---

### 118.2 GW Approximation (`@kalika/gw`)

#### 118.2.1 RPA Polarizability & Dielectric Function

- [x] **118.2.1.1** Implement Adler-Wiser sum-over-states for χ₀(G,G',q,ω):
      compute the irreducible polarizability from KS orbitals and eigenvalues,
      with proper treatment of the q→0 limit (head, wing, body elements of χ₀
      matrix), occupation factors for metallic systems, and symmetry reduction
      of the BZ sum using crystal symmetries that leave q invariant (little
      group)
- [x] **118.2.1.2** Implement static COHSEX approximation: Coulomb-hole plus
      screened-exchange (COHSEX) as a computationally cheap starting point —
      Σ_SEX(r,r') = -Σ_n f_n ψ_n(r) ψ\*\_n(r') W(r,r',ω=0) and Σ_COH(r,r') = ½
      δ(r-r') [W(r,r',ω=0) - v(r,r')] — useful for generating better starting
      wavefunctions for subsequent G₀W₀
- [x] **118.2.1.3** Implement dielectric matrix construction and inversion:
      ε(G,G',q,ω) = δ\_{GG'} - v(q+G) χ₀(G,G',q,ω), then compute ε⁻¹ via dense
      matrix inversion (ZGETRF/ZGETRI) for each (q,ω) point, with proper
      treatment of the G=0, G'=0 element (head of ε) which determines the
      macroscopic dielectric constant
- [x] **118.2.1.4** Implement screened Coulomb interaction W: W(G,G',q,ω) =
      Σ\_{G''} ε⁻¹(G,G'',q,ω) v(q+G''), and the correlation part W_c = W - v,
      with symmetry W(G,G',q,ω) = W\*(G',G,q,-ω) for Hermiticity verification

#### 118.2.2 Plasmon-Pole Models

- [x] **118.2.2.1** Implement Hybertsen-Louie plasmon-pole model (PPM): fit
      ε⁻¹(G,G',q,ω) = δ*{GG'} + Ω²*{GG'}(q) / (ω² - ω̃²\_{GG'}(q)) using two
      constraints — static ε⁻¹(ω=0) from RPA and the f-sum rule ∫₀^∞ ω
      Im[ε⁻¹(G,G',q,ω)] dω = -π/2 · ω²_p · (q+G)·(q+G')/|q+G|² — to determine Ω²
      and ω̃² parameters
- [x] **118.2.2.2** Implement Godby-Needs plasmon-pole model: fit ε⁻¹ at two
      frequencies (ω=0 and an imaginary frequency iω_1, typically iω_1 ≈ 1 Ry)
      to the single-pole form, which avoids the f-sum rule and is better suited
      for systems where the sum rule is poorly satisfied
- [x] **118.2.2.3** Implement Engel-Farid generalized plasmon-pole model: use
      multiple poles to better represent the frequency dependence of ε⁻¹, with
      constraints from higher-order sum rules — bridging the gap between
      single-pole PPMs and full-frequency integration

#### 118.2.3 Full-Frequency GW

- [x] **118.2.3.1** Implement contour deformation (CD) method for Σ(ω): deform
      the frequency integral in Σ = iGW from the real axis to the imaginary axis
      plus residue contributions: Σ(ω) = (i/2π) ∫\_{-∞}^{∞}
      G(ω+iω')W_c(iω')dω' + Σ_j R_j(ω), where R_j are residues from poles of G
      enclosed by the contour deformation, with adaptive frequency quadrature on
      the imaginary axis
- [x] **118.2.3.2** Implement analytic continuation (AC) method: compute Σ on
      the imaginary frequency axis Σ(iω_n) (where quantities are smooth), then
      analytically continue to real frequencies using Padé approximants
      (Thiele's continued fraction) or multipole fitting — with validation of
      pole structure and comparison against CD results
- [x] **118.2.3.3** Implement full-frequency integration on the real axis:
      direct numerical integration of Σ(ω) = (i/2π) ∫ G(ω+ω')W_c(ω')dω' on a
      dense real-frequency grid with broadening η, using adaptive Gauss-Kronrod
      quadrature — as reference for validating CD and AC methods

#### 118.2.4 One-Shot G₀W₀

- [x] **118.2.4.1** Implement G₀W₀ self-energy calculation: compute
      Σ^{G₀W₀}(k,ω) from DFT orbitals and eigenvalues, constructing G₀ from KS
      eigenvalues ε_nk and W₀ from the RPA dielectric function built with KS
      orbitals — the standard perturbative GW correction on top of DFT
- [x] **118.2.4.2** Implement quasiparticle equation solver: solve E_nk = ε_nk +
      Z_nk · [ReΣ(k,ε_nk) - V_xc(k)] where V_xc is the DFT exchange-correlation
      potential, using either the linearized solution (Z-factor approximation)
      or the graphical/iterative solution of the full nonlinear equation ω =
      ε_nk + ReΣ(k,ω) - V_xc(k)
- [x] **118.2.4.3** Implement spectral function output: compute A(k,ω) = -(1/π)
      ImΣ(k,ω) / [(ω - ε_nk - ReΣ(k,ω) + V_xc)² + (ImΣ(k,ω))²] on a
      real-frequency grid, showing satellite structures beyond the quasiparticle
      peak (plasmon satellites at ω ≈ E_nk ± ω_p)
- [x] **118.2.4.4** Implement starting-point dependence analysis: run G₀W₀ from
      different DFT functionals (LDA, PBE, HSE, PBE0) and quantify the spread in
      predicted band gaps, identifying the optimal starting point via comparison
      with experiment or higher-level theory

#### 118.2.5 Partial Self-Consistency

- [x] **118.2.5.1** Implement GW₀ (eigenvalue self-consistency in G only):
      iterate G with updated quasiparticle energies while keeping W₀ fixed at
      the RPA level — update ε_nk → E_nk in G, recompute Σ = iGW₀, solve QP
      equation, repeat until quasiparticle energies converge (typically 3-5
      iterations), with convergence threshold |ΔE_nk| < 1 meV
- [x] **118.2.5.2** Implement scGW (full eigenvalue self-consistency in both G
      and W): iterate both G and W — update ε_nk → E_nk in both G and χ₀
      (recalculate polarizability with GW energies), recompute W, recompute Σ,
      until convergence — with damping/mixing to stabilize the self-consistency
      loop (Pulay DIIS or linear mixing)
- [x] **118.2.5.3** Implement scGW with off-diagonal self-energy: go beyond
      diagonal approximation by including off-diagonal matrix elements
      Σ*{nm}(k,ω) with n≠m, requiring rotation of the single-particle basis at
      each iteration to diagonalize the QP Hamiltonian H^QP*{nm}(k) = ε*nk
      δ*{nm} + ⟨nk|Σ(E_nk) - V_xc|mk⟩

#### 118.2.6 Quasiparticle Self-Consistent GW (QSGW)

- [x] **118.2.6.1** Implement QSGW self-consistency loop: construct an optimal
      non-interacting Hamiltonian H₀ = T + V*ext + V_H + Σ_xc^{QSGW} where
      Σ_xc^{QSGW} is a static, Hermitian approximation to the GW self-energy:
      Σ_xc^{QSGW}*{nm}(k) = ½ Re[Σ_{nm}(k,E_nk) + Σ_{nm}(k,E_mk)], then solve H₀
      for new orbitals and eigenvalues, and iterate to self-consistency
- [x] **118.2.6.2** Implement QSGW orbital update: diagonalize the QSGW
      Hamiltonian to obtain new orbitals {ψ_nk^{QSGW}} that differ from KS
      orbitals, requiring plane-wave coefficient updates and re-evaluation of
      all matrix elements at each iteration
- [x] **118.2.6.3** Implement QSGW+BSE workflow: use converged QSGW orbitals and
      eigenvalues as input for BSE optical spectra calculations, with proper
      computation of the screened interaction W within the QSGW framework

#### 118.2.7 Space-Time Method & Scaling Reduction

- [x] **118.2.7.1** Implement GW space-time method (Rojas-Godby-Needs): compute
      the GW self-energy in imaginary time and real space: Σ(r,r',iτ) =
      -G(r,r',iτ) · W_c(r,r',iτ), avoiding the expensive frequency convolution —
      transform quantities between (r,τ) ↔ (G,iω) representations using FFT,
      achieving O(N³) scaling instead of O(N⁴)
- [x] **118.2.7.2** Implement minimax time-frequency grids: use the minimax
      grids of Kaltak-Klimes-Kresse for optimal quadrature on the imaginary
      time/frequency axes with minimal number of grid points (typically 16-32
      points suffice for meV accuracy), including the transformation matrices
      between τ and iω representations
- [x] **118.2.7.3** Implement low-rank decomposition of dielectric matrix:
      interpolative decomposition (ID) or randomized SVD of ε(G,G',q,ω) to
      reduce the auxiliary basis size from N_G to N_aux ≪ N_G, using the fact
      that ε is often numerically low-rank — reducing memory from O(N_G²) to
      O(N_G · N_aux) per (q,ω) point

#### 118.2.8 Coulomb Truncation & Reduced Dimensionality

- [x] **118.2.8.1** Implement slab Coulomb truncation for 2D systems: replace
      the 3D Coulomb kernel v(q+G) = 4π/|q+G|² with a truncated kernel that
      vanishes beyond a cutoff length L*z/2 in the non-periodic direction,
      v_trunc(q*∥,G*z) = (4π/|q+G|²)[1 - e^{-|q+G*∥|L_z/2} cos(G_z L_z/2)],
      eliminating spurious interlayer interactions in slab supercells
- [x] **118.2.8.2** Implement wire Coulomb truncation for 1D systems:
      cylindrical truncation with radius R_c, and spherical truncation for 0D
      (molecular) systems with radius R_s, both derived from the
      Beigi-Ismail-Louie truncation scheme
- [x] **118.2.8.3** Implement Wigner-Seitz truncation: general truncation scheme
      that restricts the Coulomb interaction to the Wigner-Seitz cell of the
      superlattice, applicable to any dimensionality — computed via auxiliary
      real-space integration with FFT acceleration

#### 118.2.9 Spin-Orbit & Vertex Corrections

- [x] **118.2.9.1** Implement GW+SOC: include spin-orbit coupling in the GW
      calculation by working with spinor wavefunctions (two-component),
      requiring 2×2 spin blocks in G, Σ, χ₀, and W — with proper treatment of
      time-reversal symmetry breaking in the spin-orbit case and Kramers
      degeneracy at time-reversal invariant momenta
- [x] **118.2.9.2** Implement vertex corrections (GWΓ): compute the first-order
      vertex correction Γ = 1 + δΣ/δG · G · G · Γ in the local vertex
      approximation (Ward identity preserving), improving the self-energy beyond
      the GW level — particularly important for d- and f-electron systems where
      GW alone underestimates correlations
- [x] **118.2.9.3** Implement GW total energy via RPA correlation energy:
      E_c^{RPA} = (1/2π) ∫₀^∞ Tr[ln(1 - vχ₀(iω)) + vχ₀(iω)] dω + exact exchange
      E_x, providing a total energy consistent with the GW approximation for
      equation-of-state and structural optimization

#### 118.2.10 GW Convergence & Workflow

- [x] **118.2.10.1** Implement band-count convergence analysis: systematically
      increase the number of unoccupied bands N_bands in χ₀ and Σ summations,
      track quasiparticle energies vs. N_bands, and apply the extrapolar
      correction (Bruneval-Gonze) to accelerate convergence by approximating
      high-lying states with free-electron-like energies
- [x] **118.2.10.2** Implement G-vector cutoff convergence: vary the reciprocal
      lattice vector cutoff |G|\_max for the dielectric matrix dimension,
      tracking convergence of band gaps — with the Hybertsen-Louie static
      remainder technique to reduce the required cutoff by analytically summing
      contributions from G-vectors beyond the cutoff
- [x] **118.2.10.3** Implement k-point convergence analysis: run GW at
      increasing k-grid densities (4×4×4, 6×6×6, 8×8×8, ...) and extrapolate
      band gaps to the infinite k-grid limit using 1/N_k fits, identifying
      materials where dense k-grids are essential (small-gap semiconductors, 2D
      materials)
- [x] **118.2.10.4** Implement GW workflow orchestrator: automated pipeline that
      chains DFT → Wannier90 → χ₀ → ε → W → Σ → QP energies, with
      checkpoint/restart at each stage, convergence parameter validation, and
      automatic fallback from full-frequency to PPM when memory is insufficient
- [x] **118.2.10.5** Implement GW band structure interpolation: interpolate
      quasiparticle corrections Σ_nk - V_xc(k) from the coarse GW k-grid onto a
      fine k-path using Wannier interpolation, enabling smooth GW band structure
      plots along high-symmetry paths without running GW at every k-point
- [x] **118.2.10.6** Implement GW density of states: compute the quasiparticle
      DOS from the spectral function A(k,ω) using tetrahedron integration on the
      fine k-grid, with proper treatment of the energy-dependent broadening from
      Im[Σ(k,ω)] — comparing QP-DOS with the DFT DOS to visualize the GW
      correction effect
- [x] **118.2.10.7** Implement core-level GW: extend GW to compute core-level
      binding energies (XPS) by including core states in the self-energy
      evaluation, with proper treatment of the deep core-hole screening and the
      core-valence exchange interaction — targeting agreement with experimental
      XPS binding energies within 0.3 eV

---

### 118.3 Bethe-Salpeter Equation (`@kalika/bse`)

#### 118.3.1 BSE Kernel Construction

- [x] **118.3.1.1** Implement the electron-hole interaction kernel: construct
      the BSE Hamiltonian matrix H^{BSE}_{(vck),(v'c'k')} = (E_ck -
      E_vk)δ_{vv'}δ*{cc'}δ*{kk'} + (2V^x*{(vck),(v'c'k')} -
      W^d*{(vck),(v'c'k')}) where V^x is the bare exchange (repulsive
      electron-hole exchange) and W^d is the screened direct (attractive
      electron-hole Coulomb) interaction
- [x] **118.3.1.2** Implement bare exchange kernel V^x: V^x*{(vck),(v'c'k')} =
      ∫∫ ψ\*\_ck(r) ψ_c'k'(r) v(r,r') ψ*{vk}(r') ψ\*\_{v'k'}(r') dr dr',
      computed in reciprocal space as a sum over G vectors using plane-wave
      matrix elements ⟨ck|e^{iG·r}|c'k'⟩
- [x] **118.3.1.3** Implement screened direct kernel W^d: W^d*{(vck),(v'c'k')} =
      ∫∫ ψ\*\_ck(r) ψ*{v'k'}(r) W(r,r',ω=0) ψ\*{vk}(r') ψ\*\*{c'k'}(r') dr dr',
      using the statically screened interaction W(ω=0) from the GW calculation,
      with proper interpolation of W from the coarse q-grid to the fine k-grid
      via Wannier or Fourier interpolation
- [x] **118.3.1.4** Implement kernel symmetries and storage optimization:
      exploit time-reversal symmetry H^{BSE}_{(vck),(v'c'k')} =
      [H^{BSE}_{(v'c'k'),(vck)}]\* for Hermiticity, crystal symmetry to relate
      kernel elements at symmetry-equivalent k-points, and band truncation
      (include only valence/conduction bands within an energy window of the gap)

#### 118.3.2 Tamm-Dancoff Approximation (TDA)

- [x] **118.3.2.1** Implement TDA-BSE eigenvalue problem: solve H^{res} A*S =
      Ω_S A_S where H^{res} is the resonant (positive-frequency) block of the
      BSE Hamiltonian, yielding exciton energies Ω_S and excitonic wavefunctions
      Ψ_S(r_e,r_h) = Σ*{vck} A^S\*{vck} ψ_ck(r_e) ψ\*\*{vk}(r_h) — the standard
      approximation used in most BSE codes
- [x] **118.3.2.2** Implement direct diagonalization for small systems: full
      ZHEEV/ZHEEVR diagonalization of H^{res} when the matrix dimension (N_v ×
      N_c × N_k) is manageable (< 10,000), yielding all exciton states
- [x] **118.3.2.3** Implement iterative Lanczos solver: Lanczos recursion for
      computing the optical absorption spectrum Im[ε(ω)] = Σ_S |d_S|² δ(ω-Ω_S)
      without full diagonalization — only the Lanczos coefficients (α_n, β_n)
      are needed, and the spectrum is obtained from the continued fraction ε(ω)
      ~ d† (ω - H^{res})⁻¹ d where d is the dipole vector
- [x] **118.3.2.4** Implement Haydock recursion method: three-term recursion for
      the resolvent (ω - H)⁻¹ projected onto the dipole direction, generating
      continued-fraction coefficients with typically 500-2000 iterations for
      converged spectra, plus kernel polynomial method (KPM) as alternative with
      Chebyshev expansion and Jackson damping

#### 118.3.3 Full BSE (Beyond TDA)

- [x] **118.3.3.1** Implement full BSE Hamiltonian including coupling: construct
      the 2×2 block structure [[H^{res}, K^{coup}], [-K^{coup*}, -H^{res*}]]
      coupling resonant and anti-resonant excitations, where
      K^{coup}\_{(vck),(v'c'k')} has the same kernel elements as H^{res} but
      with different band index ordering
- [x] **118.3.3.2** Implement full BSE solver: solve the non-Hermitian
      eigenvalue problem via Casida-style transformation to a Hermitian problem
      (H^{res} - K^{coup})(H^{res} + K^{coup}) F = Ω² F, or via direct
      diagonalization of the full 2N×2N matrix — with proper normalization of
      eigenvectors under the bosonic metric
- [x] **118.3.3.3** Implement beyond-TDA corrections to spectra: compute the
      difference between full BSE and TDA spectra, quantifying the effect of
      coupling (typically small for absorption but significant for CD spectra,
      second-harmonic generation, and near band-edge features in low-dimensional
      systems)

#### 118.3.4 Optical Properties from BSE

- [x] **118.3.4.1** Implement optical absorption spectrum: compute Im[ε_M(ω)] =
      (8π²e²)/(Ωω²) Σ_S |⟨0|v̂|S⟩|² δ(ω-Ω_S) where v̂ is the velocity operator and
      |S⟩ are BSE eigenstates, with Lorentzian broadening δ(ω) → η/π/(ω²+η²) and
      proper treatment of the q→0 limit using the velocity gauge (avoiding the
      dipole-matrix-element divergence)
- [x] **118.3.4.2** Implement exciton binding energies: E_b = E_gap^{QP} - Ω₁
      where Ω₁ is the lowest bright exciton energy, with convergence analysis
      w.r.t. k-grid density (exciton binding energies converge slowly with
      k-points, requiring interpolation schemes or extrapolation)
- [x] **118.3.4.3** Implement exciton wavefunctions and spatial analysis:
      compute the exciton envelope function |Ψ_S(r_e - r_h)|² by fixing the hole
      position r_h and plotting the electron probability distribution, extract
      the exciton radius r_exc = √(⟨|r_e-r_h|²⟩), and classify excitons as
      Wannier-Mott (r_exc ≫ a₀), Frenkel (r_exc ~ a₀), or charge-transfer type
- [x] **118.3.4.4** Implement oscillator strengths: f_S = (2m_e Ω_S)/(ℏ²) ·
      |⟨0|r̂|S⟩|² for each exciton state, summing over polarization directions
      for cubic systems or reporting tensor components for anisotropic crystals
- [x] **118.3.4.5** Implement radiative lifetimes: τ_S = (3πε₀ℏ⁴c³)/(e²Ω_S³ n_r
      f_S) where n_r is the refractive index — incorporating both the oscillator
      strength and the photonic density of states, with temperature-dependent
      averaging over thermally populated exciton states
- [x] **118.3.4.6** Implement exciton band structure: solve BSE at finite
      momentum transfer q to obtain the exciton dispersion Ω_S(q), requiring the
      q-dependent BSE kernel W^d(q) and proper treatment of the exchange kernel
      at finite q (which splits longitudinal and transverse excitons at q→0)

#### 118.3.5 Advanced BSE Features

- [x] **118.3.5.1** Implement dynamical BSE: replace the static screened
      interaction W(ω=0) with the frequency-dependent W(ω) in the BSE kernel,
      requiring self-consistent solution of the BSE with energy-dependent
      screening — important for systems where dynamical screening significantly
      renormalizes excitonic effects (e.g., metals, doped semiconductors)
- [x] **118.3.5.2** Implement electron energy loss spectrum (EELS) from BSE:
      compute the loss function -Im[1/ε_M(q,ω)] at finite q from the BSE,
      capturing plasmon excitations and their coupling to interband transitions,
      with proper inclusion of local field effects for the loss function
- [x] **118.3.5.3** Implement BSE for 2D materials: combine Coulomb truncation
      (118.2.8.1) with the BSE kernel, using the truncated W for the direct
      kernel, with proper treatment of the non-hydrogenic Rydberg series of
      excitons in 2D (Keldysh potential screening) and convergence acceleration
      via the Rohlfing-Louie interpolation scheme
- [x] **118.3.5.4** Implement spin-triplet excitons: solve the BSE with only the
      direct kernel (no exchange) to obtain triplet exciton energies, compute
      the singlet-triplet splitting ΔE\_{ST} = 2V^x, and analyze the
      implications for phosphorescence lifetimes and intersystem crossing rates
- [x] **118.3.5.5** Implement BSE with spin-orbit coupling: extend the BSE
      kernel to spinor wavefunctions, mixing singlet and triplet exciton
      channels via SOC, enabling computation of fine structure of excitons in
      heavy-element semiconductors and topological materials

#### 118.3.6 BSE Interpolation & Convergence

- [x] **118.3.6.1** Implement BSE kernel interpolation (Rohlfing-Louie): compute
      the BSE kernel W^d and V^x on a coarse k-grid, then interpolate to a fine
      k-grid using Fourier interpolation in real space — W^d(k,k') = Σ_R
      e^{ik·R} W^d(R,R') e^{-ik'·R'} — reducing the cost of the expensive
      dielectric matrix calculation while achieving converged exciton energies
- [x] **118.3.6.2** Implement Wannier-based BSE interpolation: express the BSE
      Hamiltonian in a Wannier basis, interpolate to arbitrary k-grids via
      Wannier90-style interpolation, enabling ultra-dense k-grid BSE
      calculations (100×100×100) from coarse-grid kernel data — following the
      methodology of Marsili et al.
- [x] **118.3.6.3** Implement BSE k-point convergence extrapolation: track
      exciton binding energies and peak positions as a function of k-grid
      density, fit convergence curves, and extrapolate to the infinite-k limit —
      particularly critical for 2D materials where convergence is extremely slow
      (requiring ~100×100 k-grids for meV accuracy)
- [x] **118.3.6.4** Implement BSE with velocity operator: use the commutator v̂ =
      i[H,r̂]/ℏ to compute optical matrix elements in the velocity gauge, which
      is numerically more stable than the length gauge for periodic systems and
      avoids the position-operator ambiguity in periodic boundary conditions
- [x] **118.3.6.5** Implement BSE circular dichroism spectrum: compute the
      rotatory strength R_S = Im[⟨0|μ̂|S⟩ · ⟨S|m̂|0⟩] where μ̂ is the electric
      dipole and m̂ is the magnetic dipole operator, enabling prediction of
      circular dichroism (CD) spectra for chiral materials and molecules
- [x] **118.3.6.6** Implement BSE nonlinear optical response: compute
      second-order susceptibility χ^(2)(ω₁,ω₂) from BSE eigenstates using the
      sum-over-states expression, enabling prediction of second-harmonic
      generation (SHG) coefficients for nonlinear optical materials

---

### 118.4 Dynamical Mean-Field Theory (`@kalika/dmft`)

#### 118.4.1 DMFT Self-Consistency Loop

- [x] **118.4.1.1** Implement the DMFT self-consistency cycle: (1) start with
      initial self-energy Σ(iω_n), (2) compute local Green's function
      G_loc(iω_n) = (1/N_k) Σ_k [iω_n + μ - H_k - Σ(iω_n)]⁻¹ via BZ integration,
      (3) extract Weiss field G₀⁻¹(iω_n) = G_loc⁻¹(iω_n) + Σ(iω_n), (4) solve
      the impurity problem to get new Σ_imp(iω_n), (5) update Σ(iω_n) =
      Σ_imp(iω_n) and repeat until ||Σ^{new} - Σ^{old}|| < tolerance
- [x] **118.4.1.2** Implement chemical potential adjustment: at each DMFT
      iteration, adjust μ to satisfy the electron count constraint n = -2T Σ*n
      G_loc(iω_n) e^{iω_n 0⁺} + n*∞ (where n_∞ accounts for the high-frequency
      tail), using bisection or Brent's method with the density as a function of
      μ
- [x] **118.4.1.3** Implement convergence acceleration: Broyden mixing of
      self-energy between iterations Σ^{new} = αΣ^{out} + (1-α)Σ^{in} with
      adaptive α, and DIIS (direct inversion of iterative subspace) for faster
      convergence — typically 10-30 DMFT iterations for convergence
- [x] **118.4.1.4** Implement multi-orbital DMFT: extend the self-consistency
      loop to multi-orbital impurity problems with d-orbital subspace (5
      orbitals) or f-orbital subspace (7 orbitals), including crystal-field
      splitting, and the rotationally invariant Slater-Kanamori interaction
      parametrized by U (Hubbard), J (Hund's coupling), and optionally U' = U-2J

#### 118.4.2 Impurity Solvers — Continuous-Time QMC

- [x] **118.4.2.1** Implement CT-HYB (hybridization expansion) solver: expand
      the partition function in powers of the hybridization function Δ(τ), with
      Monte Carlo sampling of configurations {(τ₁,a₁), ..., (τ*k,a_k)} where τ_i
      are imaginary time points and a_i are orbital indices — the weight of each
      configuration involves a determinant of the hybridization matrix det[Δ(τ_i
      - τ'_j)] and the local trace Tr[e^{-βH_loc} d*{a₁}(τ₁) d†\_{a'₁}(τ'₁)...],
      using segment representation for density-density interactions or matrix
      representation for general interactions
- [x] **118.4.2.2** Implement CT-HYB Monte Carlo moves: insertion/removal of
      hybridization events (pairs of creation/annihilation operators), segment
      moves (shift, split, merge) for density-density interactions, global moves
      (spin flip, orbital swap) for ergodicity in multi-orbital problems, with
      Metropolis-Hastings acceptance ratios computed from determinant ratios
      (Sherman-Morrison-Woodbury formula for rank-1 updates)
- [x] **118.4.2.3** Implement CT-HYB measurement of Green's function: accumulate
      G_imp(τ) = -⟨Tτ d(τ) d†(0)⟩ from the Monte Carlo sampling by removing one
      hybridization line (improved estimator) or by direct measurement on the
      segment picture, then Fourier transform to G_imp(iω_n) with proper
      high-frequency tail treatment
- [x] **118.4.2.4** Implement CT-INT (interaction expansion) solver: expand in
      powers of the interaction U, sampling configurations of interaction
      vertices at random imaginary times — the weight involves a determinant of
      the non-interacting Green's function matrix, advantageous for weakly
      correlated multi-orbital problems where the hybridization expansion
      converges slowly
- [x] **118.4.2.5** Implement CT-AUX (auxiliary field) solver: Hirsch-Fye-like
      decomposition of the interaction via discrete Hubbard-Stratonovich
      transformation, with continuous-time formulation — sampling auxiliary
      Ising spin configurations with determinantal weights, offering an
      alternative to CT-HYB that avoids the local trace calculation

#### 118.4.3 Impurity Solvers — Non-QMC

- [x] **118.4.3.1** Implement exact diagonalization (ED) solver: represent the
      impurity problem with a finite bath of N*b sites (typically 4-8),
      discretize the hybridization function Δ(iω_n) ≈ Σ*{l=1}^{N_b}
      |V_l|²/(iω_n - ε_l) by fitting bath parameters {V_l, ε_l}, exactly
      diagonalize the resulting (N_b+1)-site Hamiltonian using Lanczos or
      Davidson, and compute G_imp from the Lehmann representation
- [x] **118.4.3.2** Implement NRG (numerical renormalization group) solver:
      Wilson's NRG with logarithmic discretization of the hybridization
      function, iterative diagonalization of the Wilson chain, truncation to
      lowest N_s states at each step, and Anders-Schiller basis for computing
      spectral functions — particularly accurate for low-energy properties and
      Kondo physics
- [x] **118.4.3.3** Implement bath fitting for ED/NRG: optimize bath parameters
      {V_l, ε_l} to minimize the distance between the model hybridization
      Δ_model(iω_n) and the DMFT hybridization Δ(iω_n) = iω_n + μ - ε_d -
      Σ(iω_n) - G_loc⁻¹(iω_n), using conjugate gradient or simulated annealing
      optimization

#### 118.4.4 DFT+DMFT

- [x] **118.4.4.1** Implement DFT+DMFT charge self-consistency: full charge loop
      where the DMFT density matrix ρ_DMFT is fed back into the DFT Kohn-Sham
      potential, requiring: (1) compute ρ_DMFT from the DMFT Green's function
      via Matsubara sum, (2) recompute V_H[ρ_DMFT] + V_xc[ρ_DMFT], (3) re-solve
      KS equations, (4) update projectors and hybridization function, iterate
      until both DFT and DMFT are self-consistent
- [x] **118.4.4.2** Implement projector construction: compute projectors
      P*{mσ}(k) from Bloch states |ψ*{nk}⟩ to correlated orbitals |φ*m⟩ (Wannier
      functions or atomic-like orbitals) — using projective Wannier functions,
      maximally localized Wannier functions, or PAW projectors — defining the
      correlated subspace Hamiltonian H^{corr}*{mm'}(k) = Σ\*n P\**{mn}(k) ε*nk
      P\*{m'n}(k)
- [x] **118.4.4.3** Implement double-counting corrections: (1) fully localized
      limit (FLL): E_dc = U·n(n-1)/2 - J·[n↑(n↑-1) + n↓(n↓-1)]/2, (2)
      around-mean-field (AMF): E_dc = U·n²/4 - J·(n↑² + n↓²)/2, (3) exact double
      counting (Haule): self-consistently determined from the requirement that
      the DFT+DMFT total energy is stationary — with analysis of how each choice
      affects band gaps and spectral weight transfer
- [x] **118.4.4.4** Implement DFT+DMFT total energy: E_tot = E_DFT[ρ_DMFT] +
      ⟨H_int⟩\_DMFT - E_dc, where ⟨H_int⟩\_DMFT is the interaction energy from
      the impurity solver (computed via Galitskii-Migdal formula or directly
      from the impurity partition function) — enabling structural optimization
      and equation-of-state calculations with DMFT

#### 118.4.5 Analytic Continuation

- [x] **118.4.5.1** Implement Maximum Entropy (MaxEnt) analytic continuation:
      continue G(iω_n) or Σ(iω_n) from Matsubara to real frequencies using
      Bayesian inference — maximize the posterior P[A|G] ∝ P[G|A] · P_prior[A]
      where the entropy S[A] = -∫ A(ω) ln[A(ω)/D(ω)] dω serves as the prior
      (D(ω) is the default model, typically flat), with Bryan's algorithm for
      the optimal regularization parameter α
- [x] **118.4.5.2** Implement Padé analytic continuation: fit G(iω_n) to a ratio
      of polynomials P_M(z)/Q_N(z) using Thiele's continued fraction algorithm,
      then evaluate on the real axis G^R(ω) = G(iω_n → ω+iη) — fast but
      numerically unstable for noisy QMC data, requiring careful selection of
      Matsubara points (Beach-Gooding-Marsiglio prescription)
- [x] **118.4.5.3** Implement Nevanlinna analytic continuation: the Nevanlinna
      interpolation method that guarantees the analytically continued function
      satisfies the Herglotz property (positive spectral weight), providing more
      stable results than Padé for noisy data while being computationally
      simpler than MaxEnt
- [x] **118.4.5.4** Implement stochastic analytic continuation (SAC): sample
      spectral functions A(ω) from the posterior distribution P[A|G] using Monte
      Carlo, averaging over many samples to reduce noise — particularly useful
      for resolving sharp features (e.g., quasiparticle peaks) that MaxEnt tends
      to broaden

#### 118.4.6 Extended DMFT

- [x] **118.4.6.1** Implement DMFT+GW (GW+DMFT): combine local correlations from
      DMFT with nonlocal correlations from GW — use DMFT self-energy Σ_DMFT(ω)
      for the local part and GW self-energy Σ_GW(k,ω) - Σ_GW^{loc}(ω) for the
      nonlocal part, with proper subtraction to avoid double counting of local
      correlations: Σ_tot(k,ω) = Σ_DMFT(ω) + [Σ_GW(k,ω) - Σ_GW^{loc}(ω)]
- [x] **118.4.6.2** Implement DCA (dynamical cluster approximation): embed a
      cluster of N*c sites (typically 2×2, 4×4 in 2D) in a self-consistent bath,
      preserving translational invariance within the cluster — the
      coarse-grained Green's function G(K,iω_n) = (N_c/N_k) Σ*{k∈patch(K)} [iω_n
      + μ - ε_k - Σ(K,iω_n)]⁻¹ with K = cluster momenta, enabling
      momentum-dependent self-energy
- [x] **118.4.6.3** Implement CDMFT (cellular DMFT): embed a real-space cluster
      in a self-consistent bath, breaking translational invariance (unlike DCA),
      with the cluster self-energy Σ\_{ij}(iω_n) depending on intra-cluster site
      indices i,j — better for capturing short-range spatial correlations and
      symmetry-broken phases
- [x] **118.4.6.4** Implement non-equilibrium DMFT basics: Keldysh contour
      formulation with lesser/greater/retarded Green's functions on the
      Kadanoff-Baym contour, time-stepping propagation for quench dynamics and
      pump-probe responses, with a simple non-equilibrium impurity solver
      (non-crossing approximation or iterated perturbation theory)

#### 118.4.7 DMFT Physical Observables

- [x] **118.4.7.1** Implement DMFT spectral functions: compute A(k,ω) = -(1/π)
      Im[(ω + μ - ε_k - Σ(k,ω) + iη)⁻¹] on a fine k-path through the BZ, using
      the analytically continued self-energy Σ(ω), and the momentum-integrated
      DOS N(ω) = Σ_k A(k,ω)
- [x] **118.4.7.2** Implement DMFT phase diagram computation: track the
      quasiparticle weight Z = (1 - ∂ImΣ/∂ω*n|*{ω_n→0})⁻¹ as a function of U/W
      (interaction/bandwidth ratio) and temperature, identifying the Mott
      metal-insulator transition (Z→0), with hysteresis detection for the
      first-order transition
- [x] **118.4.7.3** Implement orbital-selective Mott transition (OSMT)
      detection: for multi-orbital systems, track Z_m per orbital m, identifying
      regimes where some orbitals are metallic (Z_m > 0) while others are
      insulating (Z_m → 0) — characterizing the orbital-selective Mott phase
      driven by crystal-field splitting and Hund's coupling
- [x] **118.4.7.4** Implement DMFT susceptibilities: compute spin susceptibility
      χ_spin(q,ω), charge susceptibility χ_charge(q,ω), and orbital
      susceptibility from the two-particle Green's function using the
      Bethe-Salpeter equation in the particle-hole channel with the DMFT vertex
      — detecting magnetic ordering tendencies, charge density wave
      instabilities, and orbital ordering
- [x] **118.4.7.5** Implement DMFT optical conductivity: compute σ(ω) from the
      current-current correlation function using the DMFT self-energy and vertex
      corrections (important for sum-rule satisfaction), with Drude weight
      extraction D = πe²n/m\* for metals and optical gap identification for
      insulators

#### 118.4.8 DMFT Interaction Parameters & Workflow

- [x] **118.4.8.1** Implement constrained RPA (cRPA) for U and J: compute the
      partially screened Coulomb interaction U(ω) = W_r(ω) by excluding
      transitions within the correlated subspace from the polarizability — χ₀^r
      = χ₀ - χ₀^{dd} where χ₀^{dd} includes only d-d (or f-f) transitions —
      yielding first-principles values of U, U', and J without adjustable
      parameters
- [x] **118.4.8.2** Implement constrained LDA (cLDA) for U: compute U from the
      total energy difference E(n+1) + E(n-1) - 2E(n) of the correlated subspace
      under constrained occupations, using the linear-response approach of
      Cococcioni-de Gironcoli — simpler than cRPA but less accurate for
      frequency-dependent interactions
- [x] **118.4.8.3** Implement Hubbard-Kanamori interaction Hamiltonian:
      construct the full rotationally invariant interaction in the d-orbital
      subspace H*int = U Σ_m n*{m↑}n*{m↓} + U' Σ*{m≠m'} n*{m↑}n*{m'↓} + (U'-J)
      Σ*{m<m',σ} n*{mσ}n*{m'σ} - J Σ*{m≠m'} d†_{m↑}d_{m↓}d†_{m'↓}d_{m'↑} + J
      Σ*{m≠m'} d†*{m↑}d†_{m↓}d_{m'↓}d\_{m'↑} with spin-flip and pair-hopping
      terms, parametrized by Slater integrals F⁰, F², F⁴ (for d-electrons)
- [x] **118.4.8.4** Implement DMFT workflow orchestrator: automated pipeline DFT
      → Wannier/projectors → hybridization → impurity solver → self-energy →
      convergence check → analytic continuation → observables, with
      checkpoint/restart, convergence monitoring, and parameter validation
- [x] **118.4.8.5** Implement DMFT entropy and free energy: compute the impurity
      entropy S_imp from the partition function Z_imp or via thermodynamic
      integration, and the DMFT free energy F = E - TS using the
      Galitskii-Migdal formula for the internal energy — enabling thermodynamic
      analysis of phase transitions at finite temperature
- [x] **118.4.8.6** Implement QMC sign problem diagnostic: monitor the average
      sign ⟨sign⟩ in CT-QMC calculations as a function of temperature and
      interaction strength, warn when ⟨sign⟩ < 0.1 (results unreliable), and
      suggest mitigation strategies (basis rotation, interaction truncation,
      alternative solver)

---

### 118.5 Quantum Monte Carlo (`@kalika/qmc`)

#### 118.5.1 Variational Monte Carlo (VMC)

- [x] **118.5.1.1** Implement Slater-Jastrow trial wavefunction: Ψ_T(R) = J(R) ·
      det[φ_i(r_j↑)] · det[φ_i(r_j↓)] where det[φ_i(r_j)] is a Slater
      determinant of single-particle orbitals (from DFT or HF) and J(R) is the
      Jastrow correlation factor — with efficient evaluation using
      Sherman-Morrison updates for single-electron moves in the determinant
- [x] **118.5.1.2** Implement Jastrow factor: J(R) = exp[Σ_{i<j} u(r_ij) +
      Σ_{iI} χ(r_iI) + Σ_{i<j,I} f(r_iI, r_jI, r_ij)] with electron-electron
      u(r), electron-nucleus χ(r), and three-body f(r₁,r₂,r₃) terms,
      parametrized using Drummond-Towler-Needs functions with cusp conditions
      u'(0) = -1/(2(1+br)) for like-spin and u'(0) = -1/((1+br)) for unlike-spin
      (satisfying the Kato cusp condition)
- [x] **118.5.1.3** Implement VMC energy evaluation: E*VMC =
      ⟨Ψ_T|H|Ψ_T⟩/⟨Ψ_T|Ψ_T⟩ = (1/N_s) Σ*{i=1}^{N_s} E_L(R_i) where E_L(R) =
      Ψ_T(R)⁻¹ H Ψ_T(R) is the local energy and R_i are sampled from |Ψ_T|²
      using Metropolis-Hastings with electron-by-electron moves, drift-diffusion
      proposals, and acceptance ratio targeting ~50%
- [x] **118.5.1.4** Implement wavefunction optimization — linear method
      (Umrigar): minimize E*VMC w.r.t. Jastrow parameters {p} using the
      linearized wavefunction |Ψ(p+δp)⟩ ≈ (1 + Σ_i δp_i O_i)|Ψ(p)⟩ where O_i =
      ∂ln Ψ/∂p_i, leading to a generalized eigenvalue problem H*{ij} c*j = E
      S*{ij} c*j with H*{ij} = ⟨O*i H O_j⟩ and S*{ij} = ⟨O_i O_j⟩ — with
      regularization of S for numerical stability
- [x] **118.5.1.5** Implement stochastic reconfiguration (SR) optimization: δp*i
      = -Δτ Σ_j S⁻¹*{ij} ⟨O*j (E_L - ⟨E_L⟩)⟩ where S*{ij} is the overlap matrix
      of log-derivatives, equivalent to imaginary-time evolution in the
      variational subspace — with diagonal shift regularization of S and
      step-size control via energy variance monitoring

#### 118.5.2 Diffusion Monte Carlo (DMC)

- [x] **118.5.2.1** Implement DMC algorithm with importance sampling: evolve
      walkers R(τ) according to the drift-diffusion equation R(τ+δτ) = R(τ) +
      δτ·v_D(R) + ξ√δτ where v_D = ∇ln|Ψ_T|² is the drift velocity and ξ is a
      Gaussian random vector, with branching weights w = exp[-δτ(E_L(R) +
      E_L(R'))/2 + δτ·E_ref] controlling population growth/death
- [x] **118.5.2.2** Implement fixed-node approximation: constrain walkers to
      remain within the nodal region defined by Ψ_T(R) > 0 (or < 0), enforcing
      the node by rejecting moves that cross the nodal surface — the resulting
      DMC energy E_DMC is a variational upper bound to the true ground state
      energy, with the fixed-node error depending on the quality of the trial
      wavefunction nodes
- [x] **118.5.2.3** Implement population control: maintain a target walker
      population N_w through branching (integer replication based on weight w),
      with feedback in E_ref to stabilize the population — E_ref = E_est - γ
      ln(N_w/N_target) where γ is a damping parameter, plus comb/pair algorithm
      for weight redistribution to reduce population fluctuations
- [x] **118.5.2.4** Implement time-step extrapolation: run DMC at multiple time
      steps δτ (e.g., 0.01, 0.005, 0.002 Ha⁻¹) and extrapolate to δτ→0 using
      linear or quadratic fitting to remove the O(δτ) time-step bias arising
      from the short-time approximation to the Green's function
- [x] **118.5.2.5** Implement size-consistent corrections: compute the
      size-consistency error of fixed-node DMC for supercells and apply
      corrections based on the multi-reference character of the wavefunction,
      using Zen-Sorella-Alfè prescription or the reptation QMC approach for
      improved estimators
- [x] **118.5.2.6** Implement pseudopotential handling: locality approximation
      for non-local pseudopotentials in DMC (Mitáš-Shirley-Ceperley), and the
      improved T-moves scheme (Casula) that restores variationality by treating
      the non-local pseudopotential via a stochastic projection — with
      size-consistent T-moves (CASINO-style) for accurate molecular and
      solid-state calculations

#### 118.5.3 Auxiliary-Field QMC (AFQMC)

- [x] **118.5.3.1** Implement Hubbard-Stratonovich (HS) transformation: decouple
      the two-body interaction V = Σ*{pqrs} V*{pqrs} a†\_p a†\_r a_s a_q into a
      sum over one-body operators coupled to auxiliary fields σ via e^{-δτ V} =
      ∫ dσ P(σ) e^{σ·B(σ)} where B(σ) is a one-body operator and P(σ) is a
      Gaussian weight — using either discrete (Hirsch) or continuous (continuous
      HS) decomposition
- [x] **118.5.3.2** Implement phaseless AFQMC (Zhang-Krakauer): constrain the
      auxiliary-field random walk to eliminate the sign/phase problem by
      imposing the phaseless constraint — walkers with Re[⟨Ψ_T|φ_i⟩ · w_i] < 0
      are killed, where w_i is the walker weight, introducing a controlled
      approximation that depends on the trial wavefunction quality
- [x] **118.5.3.3** Implement AFQMC propagation: propagate Slater determinant
      walkers |φ(τ+δτ)⟩ = e^{-δτ(H₁+σ·B)} |φ(τ)⟩ where H₁ is the one-body part,
      using Trotterization and stochastic sampling of σ — with orthogonalization
      (modified Gram-Schmidt) every N_ortho steps to maintain numerical
      stability of the determinant representation
- [x] **118.5.3.4** Implement back-propagation for observables: compute
      expectation values ⟨O⟩ = ⟨Ψ_T|e^{-τ_BP H} O e^{-τ_BP H}|φ⟩ /
      ⟨Ψ_T|e^{-2τ_BP H}|φ⟩ by propagating backward from the measurement point,
      providing improved estimators for non-diagonal observables (pair
      correlation function, structure factor, momentum distribution)
- [x] **118.5.3.5** Implement AFQMC for periodic systems: use plane-wave basis
      with Bloch orbitals, Ewald summation for the Coulomb interaction with
      proper handling of the G=0 divergence via Madelung constant subtraction,
      and twist-averaged boundary conditions for finite-size error reduction

#### 118.5.4 Finite-Size Corrections

- [x] **118.5.4.1** Implement twist-averaged boundary conditions (TABC): average
      QMC energies over a grid of twist angles θ applied to boundary conditions
      ψ(r+L) = e^{iθ·L} ψ(r), reducing finite-size shell-filling errors by
      effectively averaging over k-point grids — using either uniform twist grid
      or optimal twist selection from Dagrada et al.
- [x] **118.5.4.2** Implement KZK (Kwee-Zhang-Krakauer) correction: estimate the
      finite-size error in the kinetic energy from the DFT kinetic energy
      difference between the supercell and the thermodynamic limit, and in the
      exchange-correlation energy from the structure factor, with the total
      correction ΔE_KZK = (E_DFT^{∞} - E_DFT^{N}) applied to QMC
- [x] **118.5.4.3** Implement MPC (model periodic Coulomb) correction: replace
      the Ewald Coulomb interaction with the MPC interaction that removes the
      spurious image interaction between the exchange-correlation hole and its
      periodic images, using the model exchange-correlation hole from the DFT
      charge density — ΔE_MPC = (1/2)∫∫ ρ_xc(r,r')[v_MPC(r-r') - v_Ewald(r-r')]
      dr dr'
- [x] **118.5.4.4** Implement supercell extrapolation: run QMC for multiple
      supercell sizes (e.g., N, 2N, 4N atoms) and extrapolate to the
      thermodynamic limit using E(N) = E(∞) + a/N + b/N^{5/3} (for 3D) or E(N) =
      E(∞) + a/N + b/N^{3/2} (for 2D), with proper error propagation from the
      stochastic QMC uncertainties

#### 118.5.5 QMC for Solids & Advanced Features

- [x] **118.5.5.1** Implement Bloch orbital input processing: read DFT orbitals
      in plane-wave or Gaussian basis, convert to real-space B-spline
      representation on a uniform grid for efficient evaluation during QMC
      random walks — using the einspline library conventions (cubic B-splines
      with periodic boundary conditions)
- [x] **118.5.5.2** Implement QMC forces: compute Hellmann-Feynman forces F_I =
      -∂E/∂R_I plus Pulay corrections arising from the basis-set dependence on
      atomic positions, using the space-warp transformation (Filippi-Umrigar)
      for variance reduction of force estimators
- [x] **118.5.5.3** Implement excited-state QMC: state-specific VMC/DMC for
      excited states using penalty-function method E*n = ⟨H⟩ + Σ*{i<n} λ_i
      |⟨Ψ_i|Ψ_n⟩|², or fixed-node DMC with excited-state nodal surfaces from CI
      or TDDFT calculations, with proper treatment of orthogonality constraints
- [x] **118.5.5.4** Implement multi-determinant trial wavefunctions: Ψ_T = J(R)
      · Σ_I c_I D^↑_I D^↓_I where the sum runs over selected determinants from
      CASSCF, CIPSI, or selected-CI — with efficient evaluation using the table
      method of Clark-Morales-McMinis for O(N_det · N²) scaling instead of
      O(N_det · N³)

#### 118.5.6 QMC Statistical Analysis & Workflow

- [x] **118.5.6.1** Implement QMC error analysis: compute statistical error bars
      from correlated Monte Carlo samples using the blocking method (Flyvbjerg-
      Petersen) — divide the sample into blocks of increasing size, compute the
      standard error of the block means, and identify the block size where the
      error plateaus (indicating decorrelation), reporting the autocorrelation
      time τ_corr
- [x] **118.5.6.2** Implement reblocking analysis: automated determination of
      optimal block size via the reblocking procedure, with convergence
      diagnostic plots showing error vs. block size, and flagging when
      insufficient samples prevent reliable error estimation (total samples < 10
      × τ_corr)
- [x] **118.5.6.3** Implement QMC observable accumulation: accumulate not only
      the total energy but also kinetic energy, potential energy
      (electron-electron, electron-ion, ion-ion), pair correlation function
      g(r), structure factor S(q), one-body density matrix n(r,r'), and momentum
      distribution n(k) — with proper error propagation for derived quantities
- [x] **118.5.6.4** Implement QMC workflow orchestrator: automated pipeline from
      DFT orbitals → Jastrow optimization (VMC) → DMC production runs →
      finite-size corrections → time-step extrapolation → final energy with
      error budget, with checkpoint/restart and parameter validation at each
      stage
- [x] **118.5.6.5** Implement DMC mixed estimator correction: for observables
      that don't commute with H, correct the mixed estimator ⟨Ψ_T|O|Ψ_DMC⟩ using
      the extrapolated estimator 2⟨O⟩\_DMC - ⟨O⟩\_VMC, or the more accurate
      forward-walking/reptation approach for pure estimators
- [x] **118.5.6.6** Implement QMC pseudopotential testing: validate
      pseudopotentials by comparing all-electron and pseudopotential QMC results
      for atoms and small molecules, quantifying the transferability error and
      identifying pseudopotentials with large localization errors in DMC
- [x] **118.5.6.7** Implement backflow transformation: enhance the trial
      wavefunction with backflow coordinates x*i = r_i + Σ*{j≠i}
      η(r_ij)(r_i-r_j) where η(r) is an optimizable function, improving the
      nodal surface beyond the Slater-Jastrow level — particularly important for
      reducing fixed-node error in strongly correlated systems and achieving
      ~90% of correlation energy

---

### 118.6 Coupled Cluster for Solids (`@kalika/cc-solids`)

#### 118.6.1 MP2 for Periodic Systems

- [x] **118.6.1.1** Implement canonical MP2 for periodic systems: E*MP2 =
      Σ*{ijab,k_i,k_j,k_a} |⟨ij||ab⟩|² / (ε_i + ε_j - ε_a - ε_b) where i,j are
      occupied Bloch orbitals and a,b are virtual Bloch orbitals, with crystal
      momentum conservation k_i + k_j = k_a + k_b + G, using the resolution of
      identity (RI/DF) approximation for two-electron integrals to reduce
      scaling
- [x] **118.6.1.2** Implement Laplace-transform MP2 (LT-MP2): transform the
      energy denominator to imaginary time via 1/(ε*a+ε_b-ε_i-ε_j) = ∫₀^∞
      e^{-(ε_a+ε_b-ε_i-ε_j)τ} dτ, discretized with N*τ quadrature points,
      enabling O(N⁴) scaling through factorization of the occupied and virtual
      orbital sums — with minimax quadrature grids for optimal τ-point selection
- [x] **118.6.1.3** Implement MP2 natural orbitals: diagonalize the MP2 density
      matrix to obtain natural orbitals and occupation numbers, truncating the
      virtual space to natural orbitals with occupation > threshold — providing
      a compact basis for subsequent CCSD calculations and reducing the
      virtual-space dimension by 50-70%

#### 118.6.2 CCSD for Periodic Systems

- [x] **118.6.2.1** Implement periodic CCSD amplitude equations: solve the
      coupled T₁ and T₂ amplitude equations with crystal momentum conservation,
      0 = ⟨Φ^a*i|H̄|Φ₀⟩ (singles) and 0 = ⟨Φ^{ab}*{ij}|H̄|Φ₀⟩ (doubles) where H̄ =
      e^{-T}He^T is the similarity-transformed Hamiltonian, using the
      spin-adapted formulation with restricted HF reference
- [x] **118.6.2.2** Implement CCSD tensor contraction engine: efficient
      evaluation of the 8 terms in the doubles equation and 4 terms in the
      singles equation, with proper index routing for momentum conservation —
      intermediates W*{mnij}, F*{ae}, F*{mi}, W*{abei}, W\_{mbej} following
      Stanton-Bartlett notation, stored with 3-index k-point dependence
- [x] **118.6.2.3** Implement CCSD convergence acceleration: DIIS (direct
      inversion of iterative subspace) extrapolation for T₁ and T₂ amplitudes,
      with separate DIIS for each k-point block, level shifting for difficult
      convergence cases, and amplitude damping in early iterations
- [x] **118.6.2.4** Implement CCSD correlation energy: E*CCSD = Σ*{ia,k}
      f*{ia}(k) t^a_i(k) + (1/4) Σ*{ijab,k*i,k_j,k_a} ⟨ij||ab⟩ τ^{ab}*{ij} where
      τ^{ab}_{ij} = t^{ab}_{ij} + t^a_i t^b_j - t^b_i t^a_j, with proper k-point
      summation weights

#### 118.6.3 CCSD(T) for Periodic Systems

- [x] **118.6.3.1** Implement perturbative triples correction (T): E*(T) =
      (1/36) Σ*{ijkabc} |W*{ijk}^{abc}|² / D*{ijk}^{abc} where W*{ijk}^{abc} =
      P(ijk)P(abc)[t^{bc}*{jk} ⟨ia||f⟩ + ...] and D\_{ijk}^{abc} =
      ε_i+ε_j+ε_k-ε_a-ε_b-ε_c, with the O(N⁷) scaling handled via batched
      evaluation over k-point sextuplets (k_i,k_j,k_k,k_a,k_b,k_c) satisfying
      momentum conservation
- [x] **118.6.3.2** Implement (T) memory management: the triples amplitudes
      t^{abc}\_{ijk} are never fully stored; instead, compute and contract
      batches of triples amplitudes on-the-fly, requiring O(N_occ³ · N_virt³)
      memory per k-point batch rather than the full O(N_occ³ · N_virt³ · N_k⁶)
      storage
- [x] **118.6.3.3** Implement distinguishable cluster approximation (DCSD): a
      simplified variant of CCSD that breaks the antisymmetry of the T₂
      amplitudes, achieving near-CCSD(T) accuracy at CCSD cost for many systems
      — particularly useful for periodic calculations where (T) is prohibitive

#### 118.6.4 EOM-CCSD for Excited States

- [x] **118.6.4.1** Implement EOM-CCSD eigenvalue problem: solve H̄R|Φ₀⟩ = ωR|Φ₀⟩
      where R = r₀ + Σ*{ia} r^a_i a†\_a a_i + (1/4)Σ*{ijab} r^{ab}\_{ij} a†\_a
      a†\_b a_j a_i is the excitation operator, using Davidson iterative
      diagonalization for the lowest N_roots eigenvalues of the
      similarity-transformed Hamiltonian H̄
- [x] **118.6.4.2** Implement EOM-CCSD sigma vector: efficient computation of σ
      = H̄R for each trial vector R, reusing the CCSD intermediates (W*{mnij},
      F*{ae}, etc.) and implementing the 12+ terms in the sigma equations with
      proper k-point routing
- [x] **118.6.4.3** Implement EOM-CCSD properties: transition dipole moments
      ⟨Ψ₀|μ̂|Ψ_n⟩ = ⟨Φ₀|L_n μ̄ R_n|Φ₀⟩ where L_n is the left eigenvector,
      oscillator strengths, and excited-state densities for characterization of
      excitation character (valence, charge-transfer, Rydberg)

#### 118.6.5 Local Correlation & Basis Set Methods

- [x] **118.6.5.1** Implement pair natural orbital (PNO) framework for periodic
      systems: for each occupied pair (i,j), construct the PNO space from the
      MP2 pair density matrix D^{ij}_{ab} = t^{ab}_{ij}/(ε_a+ε_b-ε_i-ε_j),
      truncate to PNOs with occupation > threshold (typically 10⁻⁷), and solve
      the CC equations in the truncated PNO space — achieving near-linear
      scaling with system size
- [x] **118.6.5.2** Implement domain-based local PNO-CCSD(T) (DLPNO-CCSD(T)):
      assign each occupied orbital i to a domain of atoms based on Mulliken or
      Löwdin population analysis, restrict pair interactions to spatially close
      domains (distance-based prescreening), and solve CCSD(T) in the local PNO
      basis — with three accuracy levels: LoosePNO, NormalPNO, TightPNO
      corresponding to different truncation thresholds
- [x] **118.6.5.3** Implement basis set extrapolation to CBS limit: two-point
      extrapolation E_CBS = (E_X · X³ - E_Y · Y³)/(X³ - Y³) using
      cc-pVXZ/cc-pVYZ (X<Y) correlation-consistent basis sets, or separate
      extrapolation of HF (exponential) and correlation (X⁻³) contributions
- [x] **118.6.5.4** Implement focal-point analysis: combine large-basis
      lower-level theory with small-basis higher-level theory: E_best ≈
      E_MP2/CBS + (E_CCSD/small - E_MP2/small) + (E_CCSD(T)/smaller -
      E_CCSD/smaller), exploiting the faster basis set convergence of the
      post-MP2 correlation corrections
- [x] **118.6.5.5** Implement finite-size corrections for periodic CC: correct
      for the slow convergence of CC energies with k-point grid density using
      the structure factor interpolation technique or the transition structure
      factor approach, analogous to QMC finite-size corrections but adapted to
      the deterministic CC framework

---

### 118.7 Time-Dependent DFT (`@kalika/tddft`)

#### 118.7.1 Linear-Response TDDFT

- [x] **118.7.1.1** Implement Casida equation: solve the eigenvalue problem
      [[A, B], [-B*, -A*]] [X, Y]^T = ω [X, Y]^T where A*{ia,jb} =
      δ*{ij}δ*{ab}(ε_a-ε_i) + (ia|f_Hxc|jb) and B*{ia,jb} = (ia|f_Hxc|bj), with
      the Hartree-exchange-correlation kernel f_Hxc(r,r',ω) = v(r,r') +
      f_xc(r,r',ω) — in the Tamm-Dancoff approximation (B=0) and full form
- [x] **118.7.1.2** Implement adiabatic LDA kernel: f*xc^{ALDA}(r,r') = δ(r-r')
      · d²e_xc^{LDA}/dn² |*{n=n(r)} where e_xc^{LDA} is the LDA
      exchange-correlation energy density — the simplest frequency-independent
      kernel, exact for the uniform electron gas
- [x] **118.7.1.3** Implement adiabatic GGA kernels: f_xc^{AGGA}(r,r') derived
      from PBE, BLYP, or other GGA functionals, including gradient terms
      ∂²e_xc/∂n², ∂²e_xc/∂n∂|∇n|, ∂²e_xc/∂|∇n|² with proper treatment of the
      second functional derivative of the gradient-dependent terms
- [x] **118.7.1.4** Implement hybrid TDDFT kernels: for hybrid functionals
      (B3LYP, PBE0, HSE), include the fraction of exact exchange in the kernel
      f_Hxc = (1-α)f_xc^{semi-local} + α·v(r,r') where α is the exact exchange
      fraction — critical for charge-transfer excitations where semi-local
      kernels fail qualitatively

#### 118.7.2 Long-Range & Improved Kernels

- [x] **118.7.2.1** Implement bootstrap kernel (Sharma et al.): a
      self-consistent xc kernel derived from the condition that the macroscopic
      dielectric function ε*M(ω=0) from TDDFT equals the RPA value — iterate
      f_xc(G,G') = ε⁻¹*{G=0,G'=0} · v(G) · [1 - ε⁻¹(G,G')]/[χ₀(G,G') · v(G')]
      until convergence, producing a long-range kernel that captures excitonic
      effects without BSE
- [x] **118.7.2.2** Implement long-range corrected (LRC) kernel: f_xc(q) = -α/q²
      where α is a material-dependent parameter fitted to reproduce BSE optical
      spectra or exciton binding energies — the simplest kernel that captures
      bound excitons in TDDFT, following Reining et al.
- [x] **118.7.2.3** Implement RPA+ kernel: f_xc = f_xc^{ALDA} + Δf_xc^{GW}
      combining the local ALDA kernel with a nonlocal correction derived from
      the GW self-energy via the Bethe-Salpeter equation, providing a
      systematically improvable TDDFT kernel hierarchy

#### 118.7.3 Real-Time TDDFT

- [x] **118.7.3.1** Implement real-time TDDFT propagation (RT-TDDFT): solve iℏ
      ∂ψ_n(r,t)/∂t = H_KS[n(r,t)] ψ_n(r,t) using time propagators — enforced
      time-reversal symmetry (ETRS): ψ(t+δt) = e^{-iH(t+δt/2)δt/ℏ} ψ(t) with
      predictor-corrector for the midpoint Hamiltonian, or Crank-Nicolson:
      ψ(t+δt) = (1 + iHδt/2ℏ)⁻¹(1 - iHδt/2ℏ) ψ(t)
- [x] **118.7.3.2** Implement delta-kick excitation: apply an instantaneous
      perturbation ψ_n(r,t=0⁺) = e^{iκ·r} ψ_n(r,t=0⁻) with small κ, then
      propagate and extract the optical absorption spectrum from the Fourier
      transform of the time-dependent dipole moment σ(ω) ∝ FT[d(t)]/κ where d(t)
      = ∫ r · n(r,t) dr — valid in the linear-response regime for small κ
- [x] **118.7.3.3** Implement RT-TDDFT for periodic systems: propagate Bloch
      orbitals ψ*{nk}(r,t) on a k-point grid, computing the time-dependent
      current j(t) = (e/m) Σ*{nk} f*{nk} ⟨ψ*{nk}(t)|p̂+ℏk|ψ\_{nk}(t)⟩ for optical
      response, with absorbing boundary conditions or mask functions for finite
      systems
- [x] **118.7.3.4** Implement Ehrenfest molecular dynamics from RT-TDDFT: couple
      the electronic RT-TDDFT propagation to classical nuclear dynamics via
      F_I(t) = -∂E[n(r,t)]/∂R_I, propagating ions with velocity Verlet and
      electrons with ETRS on the same time grid — for modeling photo-excited
      dynamics, charge transfer, and stopping power

#### 118.7.4 TDDFT vs. BSE Comparison Tools

- [x] **118.7.4.1** Implement automated TDDFT-BSE comparison pipeline: run both
      TDDFT (with various kernels: ALDA, bootstrap, LRC) and BSE on the same
      system, compare optical spectra (peak positions, oscillator strengths,
      lineshapes), and compute deviation metrics (peak position error, spectral
      overlap integral, exciton binding energy error)
- [x] **118.7.4.2** Implement kernel assessment tool: for a given material,
      evaluate which TDDFT kernel best reproduces BSE results, outputting a
      ranking of kernels by accuracy with statistical uncertainty — guiding
      kernel selection for large-scale TDDFT calculations where BSE is too
      expensive

---

### 118.8 Embedding Methods (`@kalika/embedding`)

#### 118.8.1 DFT Embedding

- [x] **118.8.1.1** Implement frozen density embedding (FDE): partition the
      total system into subsystems A and B, solve KS equations for subsystem A
      with an embedding potential v_emb(r) = v_H[n_B](r) + v_xc[n_A+n_B](r) -
      v_xc[n_A](r) + v_T^{nadd}[n_A,n_B](r) where v_T^{nadd} is the non-additive
      kinetic potential — iterate to self-consistency between subsystems using
      freeze-and-thaw cycles
- [x] **118.8.1.2** Implement kinetic energy functionals for embedding:
      Thomas-Fermi T_TF[n] = C_F ∫ n^{5/3} dr, von Weizsäcker T_vW[n] = (1/8)∫
      |∇n|²/n dr, and GGA kinetic functionals (LC94, revAPBEk) for the
      non-additive kinetic potential — with assessment of their accuracy for
      different embedding scenarios (covalent vs. non-covalent subsystem
      boundaries)
- [x] **118.8.1.3** Implement subsystem DFT for large systems: partition a
      periodic solid into molecular or atomic fragments, solve each fragment
      self-consistently with embedding potential from the frozen densities of
      all other fragments, achieving linear-scaling DFT for weakly interacting
      subsystems (molecular crystals, surfaces with adsorbates)

#### 118.8.2 QM/MM for Materials

- [x] **118.8.2.1** Implement QM/MM interface: define QM and MM regions in a
      periodic solid, compute forces from DFT in the QM region and from
      classical force fields (Lennard-Jones, Buckingham, Coulomb with Ewald) in
      the MM region, with electrostatic embedding (MM point charges enter the QM
      Hamiltonian) and mechanical embedding (QM-MM interaction via force field
      only)
- [x] **118.8.2.2** Implement QM/MM boundary treatment: hydrogen link atoms or
      generalized hybrid orbitals (GHO) for covalent bonds crossing the QM/MM
      boundary, charge shifting/redistribution to avoid overpolarization near
      the boundary, and adaptive QM/MM with dynamic resizing of the QM region
- [x] **118.8.2.3** Implement ONIOM-style multi-layer embedding: three-layer
      (high:medium:low) partitioning with DFT:DFTB:FF or CCSD(T):DFT:FF
      combinations, subtractive scheme E_ONIOM = E_high(model) + E_low(real) -
      E_low(model) for two layers, with proper link-atom corrections at each
      boundary

#### 118.8.3 Many-Body Embedding

- [x] **118.8.3.1** Implement GW embedding: solve the GW equations for a
      subsystem (defect site, surface adsorbate) with the screened Coulomb
      interaction W computed from the full periodic system — the defect
      self-energy Σ_GW includes screening from the bulk environment while the
      expensive GW calculation is restricted to a small active space
- [x] **118.8.3.2** Implement DMFT embedding: define a correlated impurity
      region embedded in a DFT bath, computing the hybridization function from
      the full periodic DFT band structure and solving the impurity problem only
      for the correlated atoms — standard DFT+DMFT is already a form of
      embedding, but here extended to cluster impurity problems for multi-site
      correlations
- [x] **118.8.3.3** Implement projection-based embedding (Manby-Miller): define
      the embedding by a projector P onto the active subsystem, with the
      embedding potential μ^{proj}(r,r') constructed to enforce orthogonality
      between subsystem orbitals — enabling WFT-in-DFT (e.g., CCSD(T)-in-DFT)
      where the active region is treated with coupled cluster and the
      environment with DFT, with exact embedding in the complete basis limit

#### 118.8.4 Defect Embedding

- [x] **118.8.4.1** Implement quantum defect embedding: embed a defect cluster
      (defect + nearest neighbors) in the periodic DFT host crystal, using
      Green's function embedding G_defect(ω) = [G₀⁻¹(ω) - V_pert]⁻¹ where G₀ is
      the bulk Green's function and V_pert is the defect perturbation potential
      — avoiding supercell artifacts for dilute defects
- [x] **118.8.4.2** Implement charged defect corrections:
      Freysoldt-Neugebauer-Van de Walle (FNV) correction for charged defects in
      periodic supercells, accounting for the spurious electrostatic interaction
      between periodic images: ΔE_corr = E_isolated^{Madelung} -
      E_periodic^{Madelung} + alignment term — with the Kumagai-Oba extension
      for anisotropic dielectric screening
- [x] **118.8.4.3** Implement defect formation energy workflow: E_f[X^q] =
      E_tot[X^q] - E_tot[bulk] - Σ_i n_i μ_i + q(ε_VBM + E_F) + E_corr,
      computing formation energies as a function of Fermi level and chemical
      potentials, with thermodynamic transition levels ε(q/q') where E_f[X^q] =
      E_f[X^{q'}]

---

### 118.9 Response Functions & Dielectric Properties (`@kalika/response`)

#### 118.9.1 Density-Density Response

- [x] **118.9.1.1** Implement density-density response function χ(q,ω): the full
      (interacting) response function satisfying the Dyson equation χ = χ₀ + χ₀
      · (v + f_xc) · χ, where χ₀ is the non-interacting KS response
      (Adler-Wiser), v is the Coulomb kernel, and f_xc is the
      exchange-correlation kernel — computed by matrix inversion at each (q,ω)
- [x] **118.9.1.2** Implement static response χ(q,ω=0): the static limit
      relevant for screening of point charges, with proper treatment of metallic
      systems (Lindhard function) including the Kohn anomaly at q = 2k_F, and
      insulating systems (finite dielectric constant)
- [x] **118.9.1.3** Implement charge susceptibility from response: compute the
      static charge susceptibility χ_c = ∂n/∂μ from the q→0 limit of χ(q,ω=0),
      identifying metallic (χ_c > 0) vs. insulating (χ_c = 0) behavior, and
      compressibility κ = (1/n²)χ_c

#### 118.9.2 Dielectric Properties

- [x] **118.9.2.1** Implement macroscopic dielectric function: ε*M(q→0,ω) =
      1/ε⁻¹*{G=0,G'=0}(q→0,ω) including local field effects (off-diagonal
      elements of the dielectric matrix), with distinction between optical
      (electronic only, clamped ions) and static (electronic + ionic) dielectric
      constants
- [x] **118.9.2.2** Implement local field effects analysis: compute the
      difference between ε with and without local field effects (LFE),
      quantifying the impact of microscopic charge redistribution — particularly
      important for systems with inhomogeneous electron density (surfaces,
      nanostructures, layered materials)
- [x] **118.9.2.3** Implement dielectric tensor for anisotropic systems: compute
      the full 3×3 dielectric tensor ε\_{αβ}(ω) for non-cubic crystals,
      identifying the ordinary and extraordinary dielectric constants, optical
      axes, and birefringence Δn = n_e - n_o

#### 118.9.3 Sum Rules & Consistency Checks

- [x] **118.9.3.1** Implement f-sum rule verification: check ∫₀^∞ ω Im[ε(ω)] dω
      = (π/2) ω_p² where ω_p = √(4πne²/m) is the plasma frequency — deviation
      from the exact sum rule quantifies basis set incompleteness, truncation
      errors, and numerical inaccuracies
- [x] **118.9.3.2** Implement Kramers-Kronig consistency check: verify that
      Re[ε(ω)] and Im[ε(ω)] satisfy the Kramers-Kronig relations Re[ε(ω)] - 1 =
      (2/π) P∫₀^∞ ω'Im[ε(ω')]/(ω'²-ω²) dω', with the deviation serving as a
      measure of frequency-grid completeness
- [x] **118.9.3.3** Implement conductivity sum rule: verify ∫₀^∞ Re[σ(ω)] dω =
      (π/2)(ne²/m) for the optical conductivity, and extract the Drude weight D
      = πe²n/m\* for metals from the zero-frequency peak

#### 118.9.4 Derived Optical Properties

- [x] **118.9.4.1** Implement electron energy loss function: compute
      -Im[1/ε_M(q,ω)] from the macroscopic dielectric function, identifying
      plasmon resonances (peaks in the loss function), their dispersion with q,
      and damping (width of plasmon peaks from Landau damping at large q)
- [x] **118.9.4.2** Implement reflectivity and optical constants: compute the
      complex refractive index ñ(ω) = n(ω) + ik(ω) = √ε(ω), reflectivity R(ω) =
      |(ñ-1)/(ñ+1)|², absorption coefficient α(ω) = 2ωk(ω)/c, and the optical
      conductivity σ(ω) = -iω[ε(ω)-1]/(4π) — all derived from the computed ε(ω)
- [x] **118.9.4.3** Implement joint density of states (JDOS): compute J(ω) =
      Σ*{v,c,k} δ(ε*{ck} - ε\_{vk} - ω) as the baseline for optical absorption
      (without matrix elements), identifying van Hove singularities and critical
      points in the band structure that produce features in optical spectra

---

### 118.10 Benchmarking & Validation (`@kalika/many-body-benchmarks`)

#### 118.10.1 GW Benchmarks

- [x] **118.10.1.1** Implement GW100 molecular benchmark: ionization potentials
      of 100 molecules (HOMO energies) from G₀W₀@PBE, compared against CCSD(T)
      reference values from the van Setten et al. GW100 dataset — compute mean
      absolute error (MAE), max error, and correlation plot, targeting MAE < 0.3
      eV matching BerkeleyGW/VASP results
- [x] **118.10.1.2** Implement semiconductor band gap benchmarks: compute
      quasiparticle band gaps for Si (1.17 eV), Ge (0.74 eV), GaAs (1.52 eV),
      GaN (3.50 eV), ZnO (3.44 eV), MgO (7.83 eV), diamond (5.48 eV), BN (6.36
      eV), and LiF (14.2 eV) at the G₀W₀@PBE level, comparing with experimental
      values and published GW results — with convergence analysis w.r.t. number
      of bands, energy cutoff, and k-point grid
- [x] **118.10.1.3** Implement GW self-consistency benchmark: compare G₀W₀, GW₀,
      scGW, and QSGW band gaps for the same set of semiconductors, quantifying
      the effect of self-consistency and identifying the optimal level for each
      material class (sp semiconductors, d-electron compounds, f-electron
      systems)
- [x] **118.10.1.4** Implement strongly correlated system GW benchmark: test GW
      for transition-metal oxides NiO, MnO, FeO, CoO (antiferromagnetic
      insulators where DFT fails), comparing GW band gaps with experiment and
      identifying cases where GW alone is insufficient (requiring DMFT)

#### 118.10.2 BSE Benchmarks

- [x] **118.10.2.1** Implement BSE optical spectra for prototypical
      semiconductors: compute absorption spectra of Si, GaAs, and GaN, comparing
      peak positions and oscillator strengths against experiment — verifying E₁
      and E₂ peak positions within 0.1 eV and correct line shapes
- [x] **118.10.2.2** Implement BSE exciton binding energy benchmarks: compute
      exciton binding energies for LiF (1.6 eV), MgO (0.6 eV), BN (0.7 eV), Si
      (15 meV), GaAs (4 meV), and monolayer MoS₂ (0.5 eV), comparing with
      experimental and published BSE values — testing both bulk 3D and 2D
      material cases
- [x] **118.10.2.3** Implement BSE convergence benchmark: systematic convergence
      study of BSE exciton energies w.r.t. k-point grid density, number of bands
      in the BSE kernel, and dielectric matrix size (G-vector cutoff), for Si
      and LiF as representative cases — documenting the convergence rates and
      establishing recommended parameters

#### 118.10.3 DMFT Benchmarks

- [x] **118.10.3.1** Implement Hubbard model Mott transition benchmark: compute
      the phase diagram of the single-band Hubbard model on the Bethe lattice
      (semi-circular DOS with half-bandwidth D) using DMFT+CT-HYB, reproducing
      the first-order Mott transition at U_c ≈ 1.5W, the coexistence region, and
      the critical endpoint temperature T_c ≈ 0.02W
- [x] **118.10.3.2** Implement SrVO₃ benchmark: compute the spectral function
      A(k,ω) for SrVO₃ (prototypical correlated metal) using DFT+DMFT with U ≈ 5
      eV and J ≈ 0.7 eV, reproducing the lower and upper Hubbard bands at ~-1.5
      eV and ~2.5 eV flanking the quasiparticle peak, comparing with ARPES data
- [x] **118.10.3.3** Implement NiO benchmark: compute the band gap of NiO
      (antiferromagnetic charge-transfer insulator, experimental gap ~4.3 eV)
      using DFT+DMFT, comparing with DFT (incorrect metallic), DFT+U (gap
      depends sensitively on U), and GW (underestimates gap) results
- [x] **118.10.3.4** Implement multi-orbital benchmark: compute the
      orbital-selective Mott transition in a two-orbital model with different
      bandwidths and Hund's coupling J, reproducing the phase diagram with
      metallic, orbital-selective Mott, and Mott insulating phases — validating
      the multi-orbital DMFT implementation

#### 118.10.4 QMC Benchmarks

- [x] **118.10.4.1** Implement homogeneous electron gas (HEG) benchmark: compute
      the total energy per electron of the 3D HEG at r_s = 1, 2, 3, 4, 5, 10,
      20, 50, 100 using VMC and DMC, comparing with the Ceperley-Alder
      parametrization — the fundamental benchmark for any QMC code, targeting
      agreement within 1 mHa/electron
- [x] **118.10.4.2** Implement solid benchmark: compute the cohesive energy,
      lattice constant, and bulk modulus of Si, diamond, and NaCl using DMC,
      comparing with experiment — targeting lattice constant within 0.5%,
      cohesive energy within 0.05 eV/atom, and bulk modulus within 5%
- [x] **118.10.4.3** Implement finite-size correction benchmark: for Si at
      multiple supercell sizes (8, 16, 32, 64 atoms), compare raw DMC energies
      with TABC-corrected, KZK-corrected, and MPC-corrected values, verifying
      that corrections reduce the finite-size error from ~50 meV/atom to < 5
      meV/atom

#### 118.10.5 Coupled Cluster Benchmarks

- [x] **118.10.5.1** Implement periodic MP2 benchmark: compute MP2 correlation
      energies for Si, diamond, and LiH in the thermodynamic limit (CBS
      extrapolated), comparing with published values from PySCF/CC4S and
      verifying O(N⁵) scaling behavior
- [x] **118.10.5.2** Implement periodic CCSD benchmark: compute CCSD correlation
      energies for diamond and BN, comparing with published values and verifying
      that CCSD corrects the MP2 overbinding, with convergence analysis w.r.t.
      basis set and k-point grid
- [x] **118.10.5.3** Implement CCSD(T) benchmark: compute the binding energy of
      diamond at the CCSD(T)/CBS level, comparing with the experimental cohesive
      energy of 7.37 eV/atom — the gold standard for weakly correlated
      solid-state systems

#### 118.10.6 Cross-Method Validation

- [x] **118.10.6.1** Implement DFT→G₀W₀→BSE pipeline validation: for Si, run the
      full pipeline from DFT ground state through G₀W₀ quasiparticle corrections
      to BSE optical spectrum, verifying that the indirect gap (1.17 eV), direct
      gap at Γ (3.4 eV), E₁ peak (3.4 eV), and E₂ peak (4.3 eV) are all
      reproduced within 0.1 eV of experiment
- [x] **118.10.6.2** Implement method comparison table: for a common set of 10
      materials (Si, Ge, GaAs, ZnO, MgO, NiO, SrVO₃, LiF, diamond, MoS₂),
      compute band gaps from DFT-PBE, DFT+U, G₀W₀, scGW, DMFT (where
      applicable), and DMC (where feasible), presenting a comprehensive
      comparison table with experimental references and method-specific error
      statistics
- [x] **118.10.6.3** Implement automated regression test suite: for each method
      (GW, BSE, DMFT, QMC, CC), define a set of small benchmark calculations (<
      5 min each) that run as part of the CI/CD pipeline, with reference values
      stored in the test fixtures and tolerance thresholds for pass/fail
      determination — catching regressions in numerical accuracy from code
      changes
- [x] **118.10.6.4** Implement performance benchmark suite: measure wall-clock
      time and peak memory for standard benchmark systems at increasing sizes
      (8, 16, 32, 64 atoms for QMC; 2×2×2, 4×4×4, 6×6×6 k-grids for GW/BSE),
      verifying the expected asymptotic scaling (O(N³) for GW space-time, O(N⁴)
      for canonical GW, O(N⁶) for CCSD, O(N⁷) for CCSD(T)) and identifying
      performance bottlenecks
