<!-- prettier-ignore-start -->

## Phase 122: Kalika Defects, Surfaces & Interfaces — Point Defects, Dislocations, Grain Boundaries, Surface Science, Catalysis & Transition States

Covers defect physics and surface science — essential for understanding real
materials (not perfect crystals). Real crystals contain vacancies,
interstitials, dislocations, grain boundaries, and surfaces; catalysis happens
at surfaces and interfaces. This phase builds the full stack from point defect
thermodynamics through extended defects, surface construction and adsorption,
catalytic activity prediction, interface physics, transition state search, and
alloy ordering. Aims for parity with PyCDT, PyDEF, DASP, Catkit, and the
defect/surface modules of pymatgen.

Tech stack: Rust (~25% — NEB solvers, KMC engines, cluster expansion MC, Voronoi
tessellation), TypeScript (~65% — defect builders, surface constructors,
thermodynamic analysis, plotting data), Python (~10% — VASP/QE I/O adapters,
validation against existing tools).

---

### 122.1 Scaffolding & Core Types (`@kalika/defects`)

#### 122.1.1 Project Setup

- [x] **122.1.1.1** Create `libs/kalika/defects/` directory with `project.json`,
      `package.json` (name `@kalika/defects`), `tsconfig.json`, and
      `tsconfig.lib.json` — add path mapping `@kalika/defects` to
      `tsconfig.base.json`
- [x] **122.1.1.2** Create Rust workspace at `libs/kalika/defects/rust/` with
      `Cargo.toml` for the `kalika-defects-core` crate — configure
      `wasm-pack`/`napi-rs` dual build targets and add `nx:run-commands`
      executor entries in `project.json` for `build:rust`, `test:rust`
- [x] **122.1.1.3** Create `src/index.ts` barrel export file with placeholder
      module re-exports for all nine subsystems (point-defects, dislocations,
      grain-boundaries, surfaces, adsorption, interfaces, transition-states,
      alloy-thermo, core-types)
- [x] **122.1.1.4** Set up Vitest configuration (`vitest.config.ts`) with
      coverage thresholds (statements 90%, branches 85%, functions 90%) and test
      file patterns

#### 122.1.2 Core Type Definitions

- [x] **122.1.2.1** Define `Defect` base interface: `type` (vacancy,
      interstitial, substitutional, antisite, complex), `site` (fractional
      coordinates), `charge` (integer), `multiplicity`, `pointGroup`, `label`
      (Kroger-Vink notation), `supercellSize` (3x3 matrix), `hostStructure`
      reference
- [x] **122.1.2.2** Define `PointDefect` interface extending `Defect`: `species`
      (removed/added element), `wyckoffLabel`, `siteSymmetry`, `neighborShells`
      (list of {distance, count, element} for nearest-neighbor analysis)
- [x] **122.1.2.3** Define `Vacancy` type extending `PointDefect` with
      `removedSpecies`, `relaxedNeighborDisplacements` (per-atom displacement
      vectors after relaxation)
- [x] **122.1.2.4** Define `Interstitial` type extending `PointDefect` with
      `insertedSpecies`, `siteType` (tetrahedral | octahedral | voronoi |
      custom), `voronoiVolume`, `distanceToNearestHost`
- [x] **122.1.2.5** Define `Substitutional` type extending `PointDefect` with
      `originalSpecies`, `substituteSpecies`, `sizeFactorMismatch` (Hume-Rothery
      ratio)
- [x] **122.1.2.6** Define `Antisite` type extending `PointDefect` with `siteA`,
      `siteB`, `sublatticeA`, `sublatticeB`
- [x] **122.1.2.7** Define `FrenkelPair` type: `vacancy` (Vacancy),
      `interstitial` (Interstitial), `separation` (distance between V and I),
      `bindingEnergy`
- [x] **122.1.2.8** Define `SchottkyDefect` type: `vacancies` (array of Vacancy
      — one per sublattice to maintain stoichiometry), `formationEnergy`
- [x] **122.1.2.9** Define `ComplexDefect` type: `constituents` (array of
      PointDefect), `bindingEnergy` (energy gain vs. isolated constituents),
      `overallCharge`, `overallSymmetry`
- [x] **122.1.2.10** Define `DefectEntry` interface: `defect` (Defect), `charge`
      (number), `totalEnergy` (eV), `corrections` (record of correction name to
      value), `correctedEnergy`, `chemicalPotentials` (map element to mu),
      `bandEdgeShifts` (VBM and CBM shifts), `metadata` (DFT parameters)
- [x] **122.1.2.11** Define `DefectThermodynamics` interface: `entries` (array
      of DefectEntry), `bulkEnergy`, `vbm`, `cbm`, `bandGap`, `dielectricTensor`
      (3x3), `supercellLattice`, methods: `formationEnergy(charge, fermiLevel)`,
      `transitionLevel(q1, q2)`, `equilibriumFermiLevel(T, chemPots)`,
      `concentration(T, fermiLevel)`, `defectPhaseDiagram(muRange)`
- [x] **122.1.2.12** Define `Surface` interface: `millerIndex` ([h, k, l]),
      `slabThickness` (number of layers), `vacuumThickness` (angstroms),
      `termination` (string label), `area` (A^2), `taskerType` (I | II | III),
      `isPolar`, `surfaceEnergy` (J/m^2), `structure` (slab atomic structure)
- [x] **122.1.2.13** Define `Slab` interface extending `Surface`: `topSurface`,
      `bottomSurface`, `fixedLayers` (indices of frozen layers), `dipoleMoment`
      (along surface normal), `workFunction`, `surfaceAtomIndices`
- [x] **122.1.2.14** Define `Adsorbate` interface: `species` (molecular
      formula), `structure` (atomic positions), `bindingSite` (atop | bridge |
      hollow | custom), `bindingEnergy` (eV), `height` (distance above surface),
      `orientation` (Euler angles), `coverage` (fraction of monolayer)
- [x] **122.1.2.15** Define `GrainBoundary` interface: `type` (tilt | twist |
      mixed), `axis` ([u, v, w]), `angle` (degrees), `sigmaValue` (CSL Sigma),
      `plane1` ([h, k, l]), `plane2` ([h, k, l]), `energy` (J/m^2), `structure`
      (atomic model), `excessVolume` (per unit area)
- [x] **122.1.2.16** Define `Dislocation` interface: `burgersVector` ([b1, b2,
      b3]), `lineDirection` ([l1, l2, l3]), `type` (edge | screw | mixed),
      `characterAngle` (degrees between b and l), `slipPlane` ([h, k, l]),
      `coreEnergy` (eV/angstrom), `peierlsStress` (GPa)
- [x] **122.1.2.17** Define `KrogerVinkNotation` utility:
      `parse(notation:     string)` returning {species, site, chargeSymbol,
      effectiveCharge}, `format(defect: PointDefect)` returning Kroger-Vink
      string — support standard symbols: `V` for vacancy, `'` for negative, `*`
      (or `•`) for positive, `x` for neutral
- [x] **122.1.2.18** Define `ChemicalPotentialSpace` type: `elements`
      (string[]), `constraints` (array of {phase, energy, composition}),
      `vertices` (convex hull vertices in mu-space),
      `isStable(mu: Record<string, number>): boolean`
- [x] **122.1.2.19** Define `TransitionState` interface: `reactant` (structure),
      `product` (structure), `saddlePoint` (structure), `activationBarrier`
      (forward and reverse, eV), `imaginaryFrequency` (cm^-1), `reactionPath`
      (array of {image, energy, distance})
- [x] **122.1.2.20** Define `ClusterExpansion` interface: `clusters` (array of
      {sites, diameter, multiplicity}), `eci` (effective cluster interactions,
      Float64Array), `maxBodySize`, `maxDiameter`, `crossValidationScore`,
      `predict(configuration: OccupationArray): number`

#### 122.1.3 Shared Utilities

- [x] **122.1.3.1** Implement `findInequivalentSites(structure, symmetryOps)`:
      given an atomic structure and its space group symmetry operations, return
      the list of symmetrically inequivalent atomic sites (Wyckoff positions),
      each with its multiplicity and site symmetry group
- [x] **122.1.3.2** Implement `buildSupercell(structure, transformation)`: given
      a unit cell and a 3x3 integer transformation matrix, construct the
      supercell with correctly mapped atomic positions, wrap into cell, and
      return with mapping from supercell atom indices to unit cell atom indices
- [x] **122.1.3.3** Implement `computeVoronoiTessellation(points, lattice)` in
      Rust: 3D Voronoi tessellation under periodic boundary conditions (using
      Voro++ algorithm or equivalent), returning vertices, faces, volumes, and
      neighbor lists — expose via WASM
- [x] **122.1.3.4** Implement
      `dielectricTensorFromComponents(ionicPart,     electronicPart)`: combine
      ionic and electronic contributions to dielectric tensor, compute isotropic
      average, and validate positive-definiteness

---

### 122.2 Point Defects (`@kalika/defects`)

#### 122.2.1 Vacancy Generation

- [x] **122.2.1.1** Implement `generateVacancies(structure, supercellSize)`:
      enumerate all symmetrically inequivalent vacancy sites by removing one
      atom at a time from each Wyckoff position, constructing the defect
      supercell, and returning the list of unique Vacancy objects with
      multiplicities
- [x] **122.2.1.2** Implement symmetry-reduction filter: for each candidate
      vacancy, check equivalence under the supercell space group operations to
      avoid generating symmetry-duplicate defects — use a tolerance parameter
      for position matching (default 0.01 angstrom)
- [x] **122.2.1.3** Implement vacancy naming convention: auto-generate labels
      like `V_O_1`, `V_O_2` for inequivalent oxygen vacancy sites, and
      corresponding Kroger-Vink notation `V_O^{**}` for doubly-positive oxygen
      vacancy
- [x] **122.2.1.4** Write tests: generate vacancies in NaCl (1 Na, 1 Cl
      inequivalent site), in rutile TiO2 (1 Ti, 1 O), in perovskite SrTiO3 (1
      Sr, 1 Ti, 1 O for the 3c site, 1 O for the other) — verify correct count
      of inequivalent sites against known crystallographic data

#### 122.2.2 Interstitial Site Finding

- [x] **122.2.2.1** Implement `findInterstitialSites(structure, method)` with
      method = 'voronoi': compute Voronoi tessellation of host atoms, identify
      vertices as candidate interstitial positions, merge vertices closer than a
      tolerance, reduce by symmetry
- [x] **122.2.2.2** Implement tetrahedral/octahedral site finder: for common
      structure types (FCC, BCC, HCP, rocksalt, fluorite, perovskite), identify
      standard interstitial sites — tetrahedral and octahedral holes — from
      crystallographic knowledge plus geometric computation
- [x] **122.2.2.3** Implement InFiT (Interstitial Finding Tool) algorithm:
      iterative Voronoi-based approach that inserts a test atom at each Voronoi
      vertex, re-tessellates, and finds the relaxed interstitial position that
      maximizes the distance to nearest host atoms — repeat until convergence
- [x] **122.2.2.4** Implement interstitial site filtering: reject candidate
      sites that are too close to host atoms (configurable minimum distance,
      default 0.5x nearest-neighbor distance), and rank remaining sites by
      available volume (Voronoi cell volume)
- [x] **122.2.2.5** Implement
      `generateInterstitials(structure, element,     supercellSize)`: for a
      given interstitial species, place it at each inequivalent interstitial
      site found by the chosen method, construct supercells, and return the list
      of Interstitial objects
- [x] **122.2.2.6** Write tests: find interstitial sites in FCC Cu (1
      octahedral, 1 tetrahedral per atom), BCC Fe (3 octahedral, 6 tetrahedral
      per atom), fluorite CeO2 (known interstitial channels) — verify positions
      and counts against literature

#### 122.2.3 Substitutional & Antisite Defects

- [x] **122.2.3.1** Implement
      `generateSubstitutionals(structure, substituent,     supercellSize)`:
      replace each inequivalent host atom with the substituent element,
      construct supercells, compute size factor mismatch using Shannon ionic
      radii or metallic radii
- [x] **122.2.3.2** Implement `generateAntisites(structure, supercellSize)`: for
      binary and higher compounds, generate all possible antisite defects (A on
      B site, B on A site), identify inequivalent ones by symmetry
- [x] **122.2.3.3** Implement
      `generateFrenkelPairs(structure, element,     supercellSize, maxSeparation)`:
      combine a vacancy on an element's sublattice with an interstitial of the
      same element, enumerate all pairs within the max separation cutoff,
      compute pair binding energy as E_pair - E_V - E_I
- [x] **122.2.3.4** Implement
      `generateSchottkyDefects(structure, supercellSize)`: create charge-neutral
      vacancy sets maintaining stoichiometry (e.g., one V_Na + one V_Cl in NaCl,
      one V_Sr + one V_Ti + three V_O in SrTiO3)
- [x] **122.2.3.5** Write tests: substitutionals in Si (Al, P, B dopants — 1
      inequivalent site each), antisites in GaAs (Ga_As and As_Ga), Frenkel
      pairs in CaF2 (F vacancy + F interstitial), Schottky in MgO

#### 122.2.4 Complex Defects

- [x] **122.2.4.1** Implement
      `generateDefectClusters(structure, constituents,     supercellSize, maxClusterRadius)`:
      given a list of point defect types, enumerate all possible spatial
      arrangements within a cluster radius, reduce by symmetry, and return
      unique ComplexDefect configurations
- [x] **122.2.4.2** Implement divacancy generation: enumerate all inequivalent
      nearest-neighbor, second-nearest-neighbor, etc. divacancy configurations
      up to a cutoff distance
- [x] **122.2.4.3** Implement defect-impurity complex generation: given a
      substitutional impurity and a native defect (e.g., vacancy), enumerate all
      possible relative positions within a cutoff, compute binding energies
- [x] **122.2.4.4** Implement vacancy-interstitial (close Frenkel) pair
      recombination analysis: identify which Frenkel pair configurations are
      unstable (will spontaneously recombine) based on separation distance
      relative to critical radius
- [x] **122.2.4.5** Write tests: divacancies in Si (5 inequivalent
      nearest-through- fifth-neighbor configs), nitrogen-vacancy center in
      diamond (NV^- complex), Mg-vacancy complex in GaN

#### 122.2.5 Charged Defects & Supercells

- [x] **122.2.5.1** Implement `chargeDefectSupercell(defectStructure, charge)`:
      add/remove electrons from a defect supercell by modifying the total
      electron count (NELECT-like parameter), set compensating uniform
      background charge, and return the modified structure with charge metadata
- [x] **122.2.5.2** Implement charge state range determination: for a given
      defect, determine the physically reasonable charge state range from the
      element's accessible oxidation states and the host band gap (e.g., O
      vacancy in MgO: q = 0, +1, +2)
- [x] **122.2.5.3** Implement `generateAllChargeStates(defect, chargeRange)`:
      produce one DefectEntry skeleton per charge state, ready for DFT total
      energy insertion
- [x] **122.2.5.4** Write tests: charge states for O vacancy in ZnO (0, +1, +2),
      Zn vacancy in ZnO (0, -1, -2), N substituting O in TiO2 (0, -1)

#### 122.2.6 Defect Formation Energy

- [x] **122.2.6.1** Implement
      `defectFormationEnergy(entry: DefectEntry, fermiLevel,     chemPots, vbm)`:
      compute E_f[X^q] = E_tot[X^q] - E_tot[bulk] + sum(n_i _ mu_i) + q _
      (E_VBM + E_Fermi) + E_corr — the fundamental equation of defect
      thermodynamics, including all correction terms
- [x] **122.2.6.2** Implement chemical potential term: sum over added/removed
      atoms, each weighted by its chemical potential mu_i — handle arbitrary
      number of species, validate stoichiometry consistency
- [x] **122.2.6.3** Implement Fermi level dependence: the q \* (E_VBM + E_Fermi)
      term, where E_Fermi ranges from 0 (VBM) to E_gap (CBM), producing the
      characteristic linear-in-Fermi-level formation energy plots
- [x] **122.2.6.4** Implement formation energy diagram plotter data generator:
      for a set of DefectEntry objects, compute formation energy vs. Fermi level
      for each defect/charge state, identify the lowest-energy charge state at
      each Fermi level, and return the data for plotting (line segments with
      transition level markers)
- [x] **122.2.6.5** Write tests: reproduce published formation energy diagrams
      for O vacancy in ZnO (compare transition levels to Janotti & Van de Walle,
      PRB 2007: epsilon(0/+2) near midgap), Ga vacancy in GaN

#### 122.2.7 Chemical Potential Diagrams

- [x] **122.2.7.1** Implement
      `computeChemicalPotentialLimits(elements,     competingPhases)`: given the
      host composition and all competing phases with their formation enthalpies,
      compute the thermodynamic stability region in chemical potential space as
      a convex polytope defined by the intersection of half-planes (each
      competing phase contributes a constraint)
- [x] **122.2.7.2** Implement chemical potential diagram renderer data: for
      binary compounds, produce a 1D line segment (mu_A vs. mu_B); for ternary,
      produce a 2D polygon; for quaternary, produce a 3D polyhedron — all as
      plottable vertex/edge data
- [x] **122.2.7.3** Implement
      `chemicalPotentialAtCondition(element, condition)`: for standard
      conditions — 'metal-rich', 'anion-rich', 'O2-gas(T,p)' — compute the
      corresponding chemical potential value (for O2 gas: mu_O(T,p) = 1/2 \*
      [E_O2 + mu_O2(T,p0) + kT ln(p/p0)])
- [x] **122.2.7.4** Write tests: chemical potential limits for ZnO (binary: one
      constraint from Zn metal, one from ZnO stability), SrTiO3 (ternary:
      multiple competing phases including SrO, TiO2, Sr2TiO4, etc.)

#### 122.2.8 Finite-Size Corrections

- [x] **122.2.8.1** Implement Makov-Payne correction: E_MP = q^2 _ alpha_M / (2
      _ epsilon * L) + 2*pi _ q _ Q / (3 _ epsilon _ L^3) where alpha_M is the
      Madelung constant of the supercell shape, epsilon is the dielectric
      constant, L is the supercell dimension, Q is the second moment of the
      defect charge
- [x] **122.2.8.2** Implement Lany-Zunger correction: scaled Makov-Payne with
      empirical factor — E_LZ = (1 + f(1/3)) _ (1 - 1/epsilon) _ E_lat/epsilon
      where E_lat is the lattice energy of a point charge in the supercell and f
      = -0.35 is the empirical screening factor
- [x] **122.2.8.3** Implement Freysoldt-Neugebauer-Van de Walle (FNV)
      correction: model the defect charge as a Gaussian, compute the long-range
      electrostatic interaction via Ewald summation, subtract it from the DFT
      energy, and add a potential alignment correction determined by aligning
      the DFT potential far from the defect to the model potential — handle
      anisotropic dielectric tensors
- [x] **122.2.8.4** Implement potential alignment correction: from the planar-
      averaged electrostatic potential along each Cartesian direction, compute
      the offset between the defect supercell and the bulk supercell far from
      the defect, and add q \* Delta_V to the formation energy
- [x] **122.2.8.5** Implement band filling correction: for shallow defects that
      partially fill the conduction band (or empty the valence band) in finite
      supercells, compute the correction from the spurious band dispersion using
      the effective mass and supercell k-point sampling
- [x] **122.2.8.6** Implement Moss-Burstein correction: for degenerate doping
      levels, correct for the Burstein shift of the band edge due to band
      filling by computing the Fermi level relative to the band edge from the
      parabolic band approximation
- [x] **122.2.8.7** Write tests: reproduce FNV correction values for O vacancy
      in MgO from Freysoldt et al. (PRL 2009) — verify convergence with
      supercell size (2x2x2, 3x3x3, 4x4x4)

#### 122.2.9 Charge Transition Levels

- [x] **122.2.9.1** Implement `chargeTransitionLevel(defectThermo, q1, q2)`:
      compute epsilon(q1/q2) = [E_f(q1; E_F=0) - E_f(q2; E_F=0)] / (q2 - q1) —
      the Fermi level at which charge states q1 and q2 have equal formation
      energy
- [x] **122.2.9.2** Implement thermodynamic vs. optical transition level
      distinction: thermodynamic level allows ionic relaxation (both charge
      states at their equilibrium geometry), optical level uses the geometry of
      the initial charge state for both — compute both from DefectEntry data
      that includes relaxed and unrelaxed energies
- [x] **122.2.9.3** Implement transition level diagram data generator: collect
      all transition levels for all defect types, classify as shallow (within
      ~0.1 eV of band edge) or deep (within gap), and produce plottable data
      with band edges and transition level markers
- [x] **122.2.9.4** Write tests: transition levels for O vacancy in ZnO — verify
      epsilon(0/+2) is deep (near midgap), reproduce known values from
      literature

#### 122.2.10 Defect Concentrations & Fermi Level

- [x] **122.2.10.1** Implement
      `defectConcentration(formationEnergy, temperature,     nSites, degeneracy)`:
      c = g _ N_sites _ exp(-E_f / k_BT) where g includes spin degeneracy and
      configurational degeneracy
- [x] **122.2.10.2** Implement
      `selfConsistentFermiLevel(defectThermo, temperature,     chemPots, dopantConcentrations)`:
      solve the charge neutrality equation sum_d(q_d \* c_d(E_F)) + p(E_F) -
      n(E_F) + sum(fixed charges) = 0 for E_F using Brent's method — include
      free carrier concentrations from effective density of states
- [x] **122.2.10.3** Implement carrier concentration computation: n(E*F) =
      N_C \* F*{1/2}((E*F - E_CBM) / kT) and p(E_F) = N_V \* F*{1/2}((E*VBM -
      E_F) / kT) using the Fermi-Dirac integral F*{1/2} with complete numerical
      evaluation (not Boltzmann approximation)
- [x] **122.2.10.4** Implement defect phase diagram: compute the dominant defect
      (highest concentration) as a function of two chemical potentials (or one
      chemical potential and temperature), producing a 2D map with phase
      boundaries
- [x] **122.2.10.5** Write tests: self-consistent Fermi level in ZnO at 300K and
      1000K under Zn-rich and O-rich conditions — verify that Fermi level is
      near CBM (n-type) under Zn-rich and near midgap under O-rich

#### 122.2.11 Configuration Coordinate Diagrams & Optical Properties

- [x] **122.2.11.1** Implement
      `configurationCoordinateDiagram(groundState,     excitedState)`: from the
      total energies and atomic positions of a defect in two charge states (each
      at both relaxed geometries), construct the 1D configuration coordinate
      diagram with parabolic fits — compute Delta_Q (mass- weighted
      displacement), zero-phonon line (ZPL), absorption and emission energies,
      Stokes shift
- [x] **122.2.11.2** Implement Huang-Rhys factor computation: S = Delta_E_relax
      / (hbar \* omega_eff) where Delta_E_relax is the relaxation energy and
      omega_eff is the effective phonon frequency — determines the strength of
      phonon coupling and the spectral shape (Poisson distribution of phonon
      sidebands)
- [x] **122.2.11.3** Implement luminescence lineshape from CC diagram: compute
      the photoluminescence spectrum as a function of temperature using the
      generating function approach — I(E) = sum_n exp(-S) _ S^n / n! _ delta(E -
      ZPL + n*hbar*omega) convolved with Gaussian broadening
- [x] **122.2.11.4** Write tests: CC diagram for NV center in diamond — verify
      ZPL near 1.945 eV (637 nm), Huang-Rhys factor S ~ 3.5-4.0

#### 122.2.12 Defect Migration & Diffusion

- [x] **122.2.12.1** Implement `defectMigrationBarrier(defect, pathEndpoints)`:
      set up an NEB calculation between two equivalent defect sites (e.g.,
      vacancy hopping from one lattice site to a neighbor), return the migration
      path and barrier height — delegates to the NEB solver in section 122.8
- [x] **122.2.12.2** Implement
      `defectDiffusionCoefficient(migrationBarrier,     attemptFrequency, temperature)`:
      D = D_0 _ exp(-E_m / kT) where D_0 = (nu_0 _ a^2) / Z with a = hop
      distance, Z = coordination number for the hop, nu_0 = attempt frequency
      from phonon calculation or typical value
- [x] **122.2.12.3** Implement Arrhenius plot data generator: compute D(T) over
      a temperature range, fit to D = D_0 \* exp(-E_a / kT) and extract
      activation energy and pre-exponential factor
- [x] **122.2.12.4** Write tests: vacancy migration in FCC Cu — barrier ~0.7 eV,
      D_0 ~ 10^-5 m^2/s from literature; verify Arrhenius plot linearity

#### 122.2.13 Defect Symmetry Analysis

- [x] **122.2.13.1** Implement `defectSiteSymmetry(bulkStructure, defectSite)`:
      compute the site symmetry group (point group) of the defect site by
      finding all space group operations that leave the defect site invariant —
      return the point group label and symmetry operations
- [x] **122.2.13.2** Implement
      `defectInducedSymmetryBreaking(bulkSymmetry,     defectSymmetry)`:
      determine which symmetry operations are broken by the defect, compute the
      number of equivalent orientations of the defect (from index of defect site
      group in the bulk space group), and Jahn-Teller distortion analysis if
      applicable
- [x] **122.2.13.3** Write tests: site symmetry of cation vacancy in rocksalt
      (O_h), O vacancy in rutile (C_2v), N vacancy in wurtzite GaN (C_3v)

---

### 122.3 Extended Defects — Dislocations (`@kalika/defects`)

#### 122.3.1 Burgers Vector & Dislocation Type

- [x] **122.3.1.1** Implement
      `identifyBurgersVector(crystalStructure, slipSystem)`: given a crystal
      structure and slip system, determine the Burgers vector as the shortest
      lattice translation vector in the slip direction — return in both
      Cartesian and Miller index notation
- [x] **122.3.1.2** Implement
      `classifyDislocation(burgersVector, lineDirection)`: compute character
      angle theta = arccos(b.l / |b||l|), classify as edge (theta = 90), screw
      (theta = 0), or mixed (0 < theta < 90), and compute edge and screw
      components
- [x] **122.3.1.3** Implement `enumerateSlipSystems(crystalStructure)`: for FCC
      ({111}<110>, 12 systems), BCC ({110}<111>, {112}<111>, {123}<111>), HCP
      (basal, prismatic, pyramidal), enumerate all independent slip systems with
      Schmid factor computation for a given stress state
- [x] **122.3.1.4** Write tests: Burgers vectors in FCC Cu (a/2<110>), BCC Fe
      (a/2<111>), HCP Mg (a/3<1-210>), verify slip system counts

#### 122.3.2 Dislocation Construction

- [x] **122.3.2.1** Implement
      `constructVolterraDislocation(structure, burgersVector,     lineDirection, corePosition, radius)`:
      build an atomistic model of a dislocation using the Volterra elastic
      solution — apply the displacement field u(r) to a cylindrical region of
      atoms, with separate formulas for edge (u_x = b/(2*pi) * [arctan(y/x) +
      xy/(2(1-nu)(x^2+y^2))]) and screw (u_z = b/(2*pi) * arctan(y/x))
      components
- [x] **122.3.2.2** Implement anisotropic elastic dislocation displacement
      field: using the Stroh sextic formalism, compute the displacement field
      for a straight dislocation in an anisotropic medium — solve the eigenvalue
      problem for the Stroh matrix to get the anisotropic Green's function
- [x] **122.3.2.3** Implement periodic dislocation dipole construction: for DFT
      calculations, create a supercell containing a dislocation dipole (two
      dislocations of opposite sign) to cancel the long-range strain field, with
      quadrupolar arrangement to minimize dipole-dipole interactions
- [x] **122.3.2.4** Implement dislocation core relaxation setup: fix atoms
      outside a relaxation radius to the elastic solution, allow atoms within
      the core region to relax — output structure ready for atomistic (MD/MS)
      relaxation
- [x] **122.3.2.5** Write tests: Volterra edge dislocation in FCC Al — verify
      displacement field matches analytic solution far from core (within 1% at
      r > 10b), screw dislocation in BCC W

#### 122.3.3 Peierls-Nabarro Model

- [x] **122.3.3.1** Implement
      `peierlsNabarroModel(slipPlane, burgersVector,     gammaSurface)`: solve
      the Peierls-Nabarro integro-differential equation for the dislocation core
      profile — discretize the misfit density rho(x) on the slip plane and
      minimize the total energy (elastic + misfit from gamma-surface) using
      iterative methods
- [x] **122.3.3.2** Implement Peierls stress computation: from the PN model
      solution, compute the Peierls stress sigma_P = max(dE/dx) as the maximum
      restoring force when rigidly translating the dislocation profile across
      the lattice — or use the Nabarro estimate sigma_P ~ (2G/(1-nu)) *
      exp(-2*pi*d/(b*(1-nu))) where d is the interplanar spacing
- [x] **122.3.3.3** Implement dislocation width from PN model: compute the
      half-width zeta where the disregistry reaches b/4, or equivalently where
      the misfit density drops to half its maximum — wider cores have lower
      Peierls stress
- [x] **122.3.3.4** Write tests: Peierls stress for screw dislocation in BCC W
      (high, ~GPa range) vs. edge in FCC Al (low, ~MPa range) — verify
      qualitative trends match known metal behavior

#### 122.3.4 Core Structure Analysis

- [x] **122.3.4.1** Implement
      `differentialDisplacementMap(dislocationStructure,     burgersVector)`:
      compute the differential displacement (DD) vectors between neighboring
      atom columns projected along the Burgers vector direction — the standard
      visualization for dislocation core structure (Vitek arrows)
- [x] **122.3.4.2** Implement
      `coreStructureAnalysis(relaxedStructure, burgersVector,     corePosition)`:
      compute disregistry profile, Nye tensor (local lattice curvature), and
      excess energy density as a function of distance from core center —
      identify core spreading, dissociation into partials
- [x] **122.3.4.3** Implement Nye tensor computation: alpha_ij = -e_jkl \*
      partial(G_il) / partial(x_k) where G is the lattice correspondence tensor,
      computed from local atomic neighborhoods — the Nye tensor identifies
      dislocation content in any region of a crystal
- [x] **122.3.4.4** Write tests: DD map of a/2<111> screw dislocation in BCC Fe
      — verify three-fold core symmetry (non-degenerate vs. degenerate core),
      Nye tensor integral recovers Burgers vector

#### 122.3.5 Stacking Fault Energy

- [x] **122.3.5.1** Implement `computeGammaSurface(structure, slipPlane)`:
      generate a grid of rigidly-shifted slab structures across the slip plane
      (typically 10x10 grid of displacement vectors), compute the energy of each
      as a function of shift vector, and return the 2D gamma-surface E(u_x, u_y)
- [x] **122.3.5.2** Implement GSFE curve extraction: from the gamma-surface,
      extract the generalized stacking fault energy (GSFE) profile along
      specific crystallographic directions (e.g., <112> in FCC for intrinsic
      stacking fault path) — identify the unstable stacking fault energy
      (gamma_us) and the stable stacking fault energy (gamma_sf)
- [x] **122.3.5.3** Implement
      `stackingFaultWidth(gammaSurface, burgersVector,     elasticConstants)`:
      from the balance between elastic repulsion of partial dislocations and the
      stacking fault energy, compute the equilibrium separation d = G*b_p^2 /
      (4*pi\*gamma_sf) for edge character
- [x] **122.3.5.4** Write tests: gamma-surface of FCC Cu {111} plane — verify
      gamma_sf ~ 40-50 mJ/m^2 (from literature), gamma_us ~ 160-180 mJ/m^2

#### 122.3.6 Dislocation Interactions & Dynamics

- [x] **122.3.6.1** Implement
      `dislocationInteractionForce(disl1, disl2, distance)`: compute the
      Peach-Koehler force between two parallel dislocations using F/L = (mu /
      (2*pi)) * (b1 x xi) . sigma(r) where sigma is the stress field of the
      other dislocation — handle edge-edge, screw-screw, and mixed cases
- [x] **122.3.6.2** Implement Frank-Read source modeling: simulate the operation
      of a Frank-Read source by computing the critical stress for bow-out of a
      pinned dislocation segment — tau_FR = mu\*b / L where L is the source
      length, track the expanding loop geometry
- [x] **122.3.6.3** Implement line tension model: compute the energy per unit
      length of a curved dislocation E(theta) = (mu*b^2 / (4*pi)) * (1 -
      nu*cos^2 (theta)) / (1-nu) as a function of character angle, and the line
      tension T(theta) = E(theta) + d^2E/d(theta)^2
- [x] **122.3.6.4** Implement
      `dislocationCoreEnergy(coreRadius, elasticConstants,     burgersVector)`:
      compute the core energy by subtracting the elastic energy (computed from
      linear elasticity outside the core radius r_c) from the total energy —
      E_core = E_total - (mu*b^2 / (4*pi*K)) * ln(R/r_c) where K depends on
      character
- [x] **122.3.6.5** Implement dislocation network construction: build a network
      of intersecting dislocations (e.g., a low-angle grain boundary as an array
      of edge dislocations with spacing D = b/theta) — construct atomistic
      models with multiple dislocations
- [x] **122.3.6.6** Write tests: Peach-Koehler force between two parallel edge
      dislocations in Cu — verify attractive on {110} plane (glide force) and
      repulsive when same sign on same plane, Frank-Read critical stress

---

### 122.4 Extended Defects — Grain Boundaries & Stacking Faults (`@kalika/defects`)

#### 122.4.1 Grain Boundary Construction

- [x] **122.4.1.1** Implement
      `constructTiltGrainBoundary(structure, axis, angle,     expand)`: build a
      symmetric tilt grain boundary by rotating two crystal halves about a
      common axis by +/- angle/2, finding the coincidence site lattice (if it
      exists), constructing the bicrystal supercell, and optionally expanding
      the boundary region for rigid body translations
- [x] **122.4.1.2** Implement
      `constructTwistGrainBoundary(structure, plane, angle)`: build a twist
      grain boundary by rotating two crystal halves about the plane normal,
      identify the CSL, and construct the bicrystal
- [x] **122.4.1.3** Implement mixed grain boundary construction: combine tilt
      and twist components, specify the boundary plane and misorientation
      axis/angle independently
- [x] **122.4.1.4** Implement rigid body translation (RBT) search: for each GB
      construction, perform a systematic search over in-plane translations
      (gamma-surface-style) to find the minimum-energy boundary structure — also
      search over one translation perpendicular to the boundary (boundary
      expansion)
- [x] **122.4.1.5** Implement atom deletion criteria: at the GB, remove atoms
      that are closer than a minimum distance threshold (typically 0.5-0.8 x
      nearest- neighbor distance) — systematically test multiple deletion
      distances and select the configuration with lowest energy
- [x] **122.4.1.6** Write tests: construct Sigma-5 (310)[001] tilt GB in FCC Cu,
      verify CSL periodicity and atom count, construct Sigma-3 twin boundary in
      FCC (verify zero excess volume)

#### 122.4.2 Coincidence Site Lattice Theory

- [x] **122.4.2.1** Implement `computeCSL(lattice, axis, angle)`: given a
      lattice and rotation, compute the coincidence site lattice (CSL) using the
      Smith normal form algorithm — find the transformation matrices for both
      grains that generate the CSL, and the Sigma value (ratio of CSL volume to
      lattice volume)
- [x] **122.4.2.2** Implement `enumerateSigmaValues(lattice, maxSigma, axis)`:
      find all rotations about a given axis that produce CSL relationships with
      Sigma <= maxSigma — use the Ranganathan formula for cubic: tan(theta/2) =
      sqrt(m/n) \* <hkl> to enumerate angles
- [x] **122.4.2.3** Implement O-lattice computation: compute the O-lattice (the
      set of points that are equivalent in both crystal frames) for a given
      misorientation — the O-lattice determines the dislocation content of the
      interface
- [x] **122.4.2.4** Implement DSC lattice computation: compute the DSC
      (displacement shift complete) lattice — the coarsest lattice that contains
      both crystal lattices — whose vectors are the possible Burgers vectors of
      grain boundary dislocations
- [x] **122.4.2.5** Write tests: CSL for Sigma-3 (60 degree rotation about <111>
      in cubic — twin), Sigma-5 (36.87 degree about <100>), Sigma-7 in hexagonal
      lattice — verify Sigma values and CSL lattice vectors

#### 122.4.3 Grain Boundary Properties

- [x] **122.4.3.1** Implement
      `grainBoundaryEnergy(bicrystalEnergy, bulkEnergyPerAtom,     nAtoms, area)`:
      gamma_GB = (E_bicrystal - n _ E_bulk) / (2 _ A) — factor of 2 because the
      supercell contains two grain boundaries (or 1 for open surface boundary
      conditions)
- [x] **122.4.3.2** Implement GB energy vs. misorientation angle plot data:
      compute GB energy for a series of angles along a given rotation axis,
      produce the characteristic Read-Shockley curve for low-angle GBs: gamma =
      gamma_0 _ theta _ (A - ln(theta)) where A and gamma_0 are
      material-dependent
- [x] **122.4.3.3** Implement
      `grainBoundarySegregationEnergy(soluteAtGB,     soluteInBulk)`: E_seg =
      E_GB^solute - E_bulk^solute — the driving force for solute segregation to
      the grain boundary, compute for each inequivalent GB site
- [x] **122.4.3.4** Implement McLean isotherm for GB segregation: X_GB / (1 -
      X_GB) = (X_bulk / (1 - X_bulk)) \* exp(-E_seg / kT) — compute equilibrium
      GB solute concentration as a function of bulk concentration and
      temperature
- [x] **122.4.3.5** Implement GB excess volume computation: Delta_V =
      (V_bicrystal - n \* V_bulk) / A — the excess volume per unit area, an
      important structural descriptor
- [x] **122.4.3.6** Write tests: GB energy of Sigma-5 (310) tilt in Cu (~0.9
      J/m^2 from literature), Read-Shockley fit for low-angle tilt GBs in Al,
      segregation energy of P at Sigma-3 twin in Fe

#### 122.4.4 Twin Boundaries & Stacking Faults

- [x] **122.4.4.1** Implement `constructTwinBoundary(structure, twinPlane)`:
      specialized construction for coherent twin boundaries — construct by
      mirroring the crystal across the twin plane, with correct handling of
      basis atoms and minimal supercell
- [x] **122.4.4.2** Implement
      `generateStackingFault(structure, slipPlane,     shiftVector, faultType)`:
      create intrinsic stacking fault (ISF: remove one layer from stacking
      sequence, e.g., ABCABC -> ABCBC) or extrinsic stacking fault (ESF: insert
      one extra layer, e.g., ABCABC -> ABCBABC) in the slab model
- [x] **122.4.4.3** Implement stacking fault energy from supercell: gamma_SF =
      (E_faulted - E_perfect) / A where A is the fault plane area — include
      convergence with slab thickness
- [x] **122.4.4.4** Write tests: twin boundary energy in FCC Cu (should equal
      gamma_sf ~ 40-50 mJ/m^2), intrinsic vs. extrinsic SF energy in FCC Ni

#### 122.4.5 Grain Boundary Kinetics

- [x] **122.4.5.1** Implement
      `grainBoundaryDiffusionCoefficient(gbStructure,     diffusingSpecies, temperature)`:
      compute the effective GB diffusion coefficient using the Hart equation:
      D_eff = D_lattice _ (1 + delta/d _ D_GB/D_lattice) where delta is the GB
      width and d is the grain size — determine D_GB from NEB barriers along the
      GB plane
- [x] **122.4.5.2** Implement grain boundary migration modeling: compute the
      driving force for GB migration (curvature-driven: P = gamma _ kappa, or
      stress-driven) and the GB mobility M from the activation energy for atomic
      rearrangement at the boundary — v = M _ P
- [x] **122.4.5.3** Write tests: verify D_GB >> D_lattice for self-diffusion in
      Cu (typical ratio 10^4-10^6 at moderate temperatures), verify qualitative
      temperature dependence

---

### 122.5 Surface Science (`@kalika/defects`)

#### 122.5.1 Slab Model Construction

- [x] **122.5.1.1** Implement
      `constructSlab(structure, millerIndex, minThickness,     minVacuum)`: from
      a bulk crystal and Miller indices (h,k,l), generate the slab model — find
      the surface unit cell, stack layers to achieve minimum thickness (in
      angstroms or number of layers), add vacuum region, and return a Slab
      object with identified surface and bulk-like atoms
- [x] **122.5.1.2** Implement `enumerateTerminations(structure, millerIndex)`:
      for a given Miller index, determine all possible surface terminations
      (different atomic layers that can form the surface), classify each as
      Tasker Type I (charge-neutral, non-polar), Type II (charge-neutral by
      combining layers), or Type III (polar, requires reconstruction)
- [x] **122.5.1.3** Implement `identifyPolarSurface(slab)`: check whether the
      slab has a net dipole moment perpendicular to the surface — if so, flag as
      polar and suggest stabilization methods (symmetric slab, pseudo-hydrogen
      passivation, surface reconstruction)
- [x] **122.5.1.4** Implement symmetric slab construction: for surface energy
      calculations, build slabs that are symmetric about the center (same
      termination on top and bottom) to eliminate the dipole — determine when
      this requires an odd or even number of layers
- [x] **122.5.1.5** Implement `setFixedLayers(slab, nFixed, fromSurface)`: fix
      the central layers of the slab to bulk positions and allow the surface
      layers to relax — specify by count from each surface or by distance
      threshold
- [x] **122.5.1.6** Write tests: construct (100), (110), (111) slabs of FCC Cu —
      verify layer counts, surface areas, terminations; construct (001) slab of
      SrTiO3 — verify TiO2 and SrO terminations

#### 122.5.2 Surface Reconstruction

- [x] **122.5.2.1** Implement `enumerateSurfaceReconstructions(slab, maxSize)`:
      generate candidate surface reconstructions by testing supercell expansions
      of the surface unit cell (2x1, 1x2, 2x2, c(2x2), sqrt(3)xsqrt(3)R30, etc.)
      with systematic atom removal/addition — up to maxSize supercell
- [x] **122.5.2.2** Implement Wood notation parser and generator: parse surface
      reconstruction labels like "Si(111)-(7x7)" or "GaAs(001)-c(4x4)" into
      surface supercell matrices, and generate the notation from a given
      reconstruction matrix
- [x] **122.5.2.3** Implement polar surface stabilization: for Tasker Type III
      surfaces, automatically generate stabilized configurations — remove half
      the surface charge (e.g., half the ions on a polar (111) rocksalt
      surface), or add compensating adsorbates (OH, H)
- [x] **122.5.2.4** Write tests: enumerate reconstructions of Si(100) — verify
      (2x1) dimer reconstruction is generated, polar (111) NiO surface
      stabilization

#### 122.5.3 Surface Energy

- [x] **122.5.3.1** Implement
      `surfaceEnergy(slabEnergy, bulkEnergyPerAtom, nAtoms,     area)`: gamma =
      (E_slab - n \* E_bulk) / (2A) for symmetric slabs — handle the factor of 2
      correctly (two surfaces per slab)
- [x] **122.5.3.2** Implement surface energy for asymmetric slabs: when top and
      bottom terminations differ, use the cleavage energy approach or reference
      one surface to a known value — E_cleave = (E_slab - n \* E_bulk) / A =
      gamma_top + gamma_bottom
- [x] **122.5.3.3** Implement surface energy convergence tester: compute surface
      energy as a function of slab thickness (number of layers) and vacuum
      thickness, identify the converged values, and report convergence plots
      data
- [x] **122.5.3.4** Write tests: surface energies of FCC Cu — gamma(111) <
      gamma(100) < gamma(110) (close-packed surface has lowest energy), absolute
      values near 1.3, 1.5, 1.6 J/m^2 respectively

#### 122.5.4 Work Function

- [x] **122.5.4.1** Implement `workFunction(slabPotential, fermiEnergy)`: Phi =
      V_vacuum - E_Fermi where V_vacuum is the electrostatic potential in the
      vacuum region (plateau value) and E_Fermi is the Fermi energy of the slab
      calculation
- [x] **122.5.4.2** Implement planar-averaged potential extraction: from the 3D
      electrostatic potential V(x,y,z), compute the planar average V_avg(z) by
      averaging over the surface plane — used for both work function and
      potential alignment in defect calculations
- [x] **122.5.4.3** Implement macroscopic average of potential: apply a double
      averaging (Baldereschi average) to V_avg(z) with averaging window = one
      interplanar spacing — smooths out atomic-scale oscillations, gives clean
      vacuum level
- [x] **122.5.4.4** Write tests: work function of Al(111) ~ 4.2 eV, Cu(111) ~
      4.9 eV, W(110) ~ 5.3 eV — verify against experimental values (within DFT
      accuracy, ~0.2 eV)

#### 122.5.5 Wulff Construction

- [x] **122.5.5.1** Implement `wulffConstruction(surfaceEnergies)`: given
      surface energies for multiple Miller indices, compute the equilibrium
      crystal shape using the Wulff theorem — gamma(hkl) / d(hkl) = constant —
      return the set of bounding planes and their distances from the center,
      plus the total surface area and volume
- [x] **122.5.5.2** Implement Winterbottom construction: for a crystal on a
      substrate, modify the Wulff shape by replacing the adhesion interface with
      an effective surface energy gamma_eff = gamma_crystal - W_ad where W_ad is
      the work of adhesion — determines the contact angle and shape of supported
      nanoparticles
- [x] **122.5.5.3** Implement Wulff shape analysis: from the computed shape,
      determine the fraction of each facet type, the surface-area-weighted
      average surface energy, and the effective particle diameter for a given
      volume
- [x] **122.5.5.4** Write tests: Wulff shape of FCC metal (should be truncated
      octahedron dominated by {111} and {100}), BCC metal (rhombic dodecahedron
      from {110}), Winterbottom shape with strong adhesion (flat on substrate)

#### 122.5.6 Surface Relaxation & Electronic Structure

- [x] **122.5.6.1** Implement `surfaceRelaxation(bulkSlab, relaxedSlab)`:
      compute the layer-by-layer relaxation (change in interlayer spacing) and
      rumpling (differential displacement of anion and cation sublattices within
      a layer) from the difference between bulk-terminated and relaxed slab
      structures
- [x] **122.5.6.2** Implement `surfaceBandStructure(slab)`: project the bulk
      band structure onto the surface Brillouin zone, identify surface states
      (bands that exist only in the slab calculation, not in the projected
      bulk), and surface resonances
- [x] **122.5.6.3** Write tests: surface relaxation of Al(110) — verify first
      interlayer contraction ~8-10%, second layer expansion ~2-5% (oscillatory
      relaxation pattern)

---

### 122.6 Adsorption & Catalysis (`@kalika/defects`)

#### 122.6.1 Adsorption Site Identification

- [x] **122.6.1.1** Implement `identifyAdsorptionSites(slab)`: from the surface
      geometry, automatically enumerate all symmetrically inequivalent
      adsorption sites — atop (directly above a surface atom), bridge (midpoint
      between two surface atoms), hollow (center of three or four surface atoms:
      fcc-hollow, hcp-hollow, four-fold hollow) — return positions and site
      symmetries
- [x] **122.6.1.2** Implement Delaunay triangulation of surface atoms:
      triangulate the top-layer atoms to systematically find bridge (edge
      midpoints) and hollow (triangle/polygon centers) sites — handle periodic
      boundary conditions
- [x] **122.6.1.3** Implement
      `placeAdsorbate(slab, site, molecule, height,     orientation)`: place a
      molecular adsorbate at a specified site with given height above the
      surface and orientation (azimuthal angle, tilt) — handle common molecules
      (CO, H, O, OH, H2O, NH3, CH4, CO2, N2) with appropriate default
      orientations (e.g., CO upright with C down on transition metals)
- [x] **122.6.1.4** Implement
      `generateAdsorptionConfigurations(slab, molecule,     sites, orientations)`:
      systematically generate all candidate adsorption geometries (site x
      orientation combinations), reduced by surface symmetry, ready for DFT
      relaxation
- [x] **122.6.1.5** Write tests: adsorption sites on FCC(111) surface — verify 1
      atop, 1 bridge, 2 hollow (fcc and hcp) inequivalent sites; on FCC(100) — 1
      atop, 1 bridge, 1 hollow; CO on Pt(111) — verify atop is preferred

#### 122.6.2 Adsorption Energy

- [x] **122.6.2.1** Implement
      `adsorptionEnergy(slabMolEnergy, slabEnergy,     molEnergy)`: E_ads =
      E(slab+mol) - E(slab) - E(mol) — negative means exothermic (favorable),
      handle both per-molecule and per-area normalization
- [x] **122.6.2.2** Implement coverage-dependent adsorption: track E_ads as a
      function of coverage theta (fraction of surface sites occupied), account
      for lateral interactions between adsorbates — repulsive at high coverage
      typically, model with E_ads(theta) = E_ads(0) + alpha _ theta + beta _
      theta^2
- [x] **122.6.2.3** Implement co-adsorption energy: for multiple adsorbate
      species, compute the co-adsorption energy including the interaction energy
      between different species — E_int = E(A+B/slab) - E(A/slab) - E(B/slab) +
      E(slab)
- [x] **122.6.2.4** Implement dissociative adsorption analysis: for molecules
      that dissociate upon adsorption (e.g., H2, O2, N2 on some surfaces),
      compute the dissociation barrier and the energy of the dissociated state
      vs. molecularly adsorbed state
- [x] **122.6.2.5** Write tests: H adsorption on Pt(111) fcc-hollow ~ -0.5 eV,
      CO on Pt(111) atop ~ -1.5 eV, O2 dissociative adsorption on Pt(111)

#### 122.6.3 d-Band Theory & Scaling Relations

- [x] **122.6.3.1** Implement `dBandCenter(dosData, element)`: compute the
      d-band center epsilon_d = integral(E \* rho_d(E) dE) / integral(rho_d(E)
      dE) from the projected density of states (PDOS) of surface metal atoms —
      the primary descriptor in the Hammer-Norskov model for adsorption strength
- [x] **122.6.3.2** Implement `dBandWidth(dosData, element)`: compute the d-band
      width W_d = sqrt(integral((E - epsilon_d)^2 \* rho_d(E) dE) / integral(
      rho_d(E) dE)) and upper/lower d-band edges
- [x] **122.6.3.3** Implement `dBandModel(epsilon_d, V_ad, epsilon_a)`: compute
      the adsorption energy from the Newns-Anderson-Hammer-Norskov model —
      delta_E = delta_E_ortho + delta_E_hyb where the hybridization contribution
      depends on the d-band center position relative to the adsorbate level
- [x] **122.6.3.4** Implement scaling relations: given adsorption energies of a
      set of intermediates (e.g., OH, OOH, O, H) on multiple surfaces, fit
      linear scaling relations delta_E(AH_x) = alpha \* delta_E(AH_y) + beta —
      use these to predict adsorption energies from a single descriptor
- [x] **122.6.3.5** Write tests: d-band center of Pt (~ -2.25 eV), Cu (~ -2.67
      eV), Au (~ -3.56 eV) — verify Pt is closest to Fermi level (strongest
      adsorbate binding), scaling relation slope for OH vs. O ~ 0.5 on
      transition metals

#### 122.6.4 Brønsted-Evans-Polanyi & Volcano Plots

- [x] **122.6.4.1** Implement
      `bepRelation(reactionEnergies, activationBarriers)`: fit the
      Brønsted-Evans-Polanyi linear relation E_a = alpha \* delta_E + beta
      between activation barriers and reaction energies across a set of surfaces
      — return slope (transfer coefficient), intercept, and R^2
- [x] **122.6.4.2** Implement `volcanoPlot(descriptor, activity)`: construct a
      volcano plot of catalytic activity (log TOF) vs. a descriptor (e.g.,
      delta_E of a key intermediate) — fit the two legs (too-weak binding and
      too-strong binding) and identify the optimal descriptor value at the
      volcano peak
- [x] **122.6.4.3** Implement Sabatier analysis: given binding energies of all
      relevant intermediates on a surface, determine the potential-determining
      step (the step with the largest free energy change) and the limiting
      potential (the minimum overpotential at which all steps become downhill)
- [x] **122.6.4.4** Write tests: BEP relation for N2 dissociation on transition
      metal surfaces (alpha ~ 0.9), volcano plot for ammonia synthesis — verify
      Ru near the top

#### 122.6.5 Microkinetic Modeling

- [x] **122.6.5.1** Implement
      `microkineticModel(mechanism, rateConstants,     conditions)`: given a
      reaction mechanism (list of elementary steps with rate constants), solve
      the steady-state equations d(theta_i)/dt = 0 for surface coverages of all
      intermediates using Newton-Raphson, then compute the overall reaction rate
- [x] **122.6.5.2** Implement rate constant from transition state theory: k =
      (k_B*T / h) * (q_TS / q_reactant) \* exp(-delta_E / k_BT) where q are
      partition functions — compute for surface reactions including frustrated
      translations and rotations of adsorbed species
- [x] **122.6.5.3** Implement turnover frequency computation: TOF = rate /
      (number of active sites per area) — the standard measure of catalytic
      activity, compute as a function of temperature and partial pressures
- [x] **122.6.5.4** Implement apparent activation energy: E_app = -d(ln(TOF)) /
      d(1/k_BT) — numerically differentiate the Arrhenius-like dependence, which
      differs from the intrinsic barrier due to coverage effects
- [x] **122.6.5.5** Implement selectivity prediction: for competing reaction
      pathways (e.g., CO2 reduction to CO vs. HCOOH vs. CH4), compute the
      selectivity as the ratio of rates for each product
- [x] **122.6.5.6** Implement transient microkinetic solver: instead of
      steady-state, integrate the full ODE system d(theta_i)/dt = f(theta, T, p)
      using an adaptive Runge-Kutta or BDF integrator — enables modeling of
      temperature-programmed experiments (TPD, TPR)
- [x] **122.6.5.7** Write tests: CO oxidation on Pt(111) — Langmuir-Hinshelwood
      mechanism with CO + O -> CO2, verify TOF peaks at intermediate CO
      coverage, reproduce qualitative volcano behavior

#### 122.6.6 Electrochemistry & Electrocatalysis

- [x] **122.6.6.1** Implement
      `computationalHydrogenElectrode(deltaE, deltaZPE,     deltaTdS, potential)`:
      compute the free energy of each electrochemical step using the CHE
      framework — delta_G = delta_E + delta_ZPE - T*delta_S + e*U where U is the
      electrode potential vs. RHE
- [x] **122.6.6.2** Implement `freeEnergyDiagram(steps, potential)`: construct
      the free energy diagram for a multi-step electrochemical reaction (e.g.,
      4-step OER: H2O -> OH* -> O* -> OOH\* -> O2) as a function of applied
      potential — identify the potential-determining step (PDS) and the
      theoretical overpotential eta = max(delta_G_i) / e - 1.23 V for OER
- [x] **122.6.6.3** Implement overpotential computation for common reactions:
      OER (oxygen evolution), ORR (oxygen reduction), HER (hydrogen evolution),
      CO2RR (CO2 reduction), N2RR (nitrogen reduction) — each with their
      standard reaction pathways and thermodynamic potentials
- [x] **122.6.6.4** Implement
      `pourbaixDiagram(species, energies, pH_range,     potential_range)`:
      construct a Pourbaix diagram (electrochemical phase stability as a
      function of pH and electrode potential) — compute the stable phase at each
      (pH, U) point from the free energies of all candidate phases including
      dissolved ions
- [x] **122.6.6.5** Implement solvent correction models: apply implicit
      solvation corrections (VASPsol-style or PCM) to adsorption energies —
      implement the correction as delta_G_solv = delta_G_vacuum +
      delta_G_solvation where the solvation contribution is parameterized for
      common solvents (water, organic)
- [x] **122.6.6.6** Implement pH-dependent electrochemistry: for proton-coupled
      electron transfer (PCET) steps, include the pH dependence delta_G =
      delta_G(pH=0) + kT _ ln(10) _ pH — distinguish between PCET and decoupled
      proton/electron transfer
- [x] **122.6.6.7** Write tests: OER overpotential on RuO2(110) ~ 0.4 V, IrO2 ~
      0.5 V (from Rossmeisl et al.); HER on Pt(111) ~ 0 V; ORR on Pt(111) ~ 0.4
      V; Pourbaix diagram of Fe reproduces known stability regions (Fe, Fe2+,
      Fe3+, Fe2O3, Fe3O4)

---

### 122.7 Interface Physics (`@kalika/defects`)

#### 122.7.1 Band Alignment

- [x] **122.7.1.1** Implement `andersonRuleBandAlignment(material1, material2)`:
      compute the band alignment using Anderson's rule (electron affinity rule)
      — delta_E_c = chi_1 - chi_2 and delta_E_v = (chi_1 + E_g1) - (chi_2 +
      E_g2) where chi is the electron affinity
- [x] **122.7.1.2** Implement
      `branchPointEnergyAlignment(material1, material2)`: compute the
      branch-point energy (charge neutrality level) E_BP from the bulk band
      structure — the energy at which the character changes from valence-like to
      conduction-like — use E_BP as the alignment reference instead of vacuum
      level
- [x] **122.7.1.3** Implement
      `dftBandOffset(interfaceCalculation, bulk1, bulk2)`: compute VBO and CBO
      from a DFT superlattice calculation using the potential lineup method —
      align the core level energies (or average electrostatic potential) in the
      bulk-like regions of each material to their respective bulk values
- [x] **122.7.1.4** Implement `schottkyBarrierHeight(metal, semiconductor)`:
      compute the Schottky barrier phi_B = phi_M - chi_S for n-type (using metal
      work function and semiconductor electron affinity), with corrections for
      Fermi level pinning from metal-induced gap states (MIGS)
- [x] **122.7.1.5** Write tests: band alignment of GaAs/AlAs (Type I, CBO ~ 0.35
      eV), InAs/GaSb (Type II broken gap), Si/SiO2 (CBO ~ 3.1 eV), Au/Si
      Schottky barrier

#### 122.7.2 Interface Construction & Properties

- [x] **122.7.2.1** Implement
      `constructHeterojunction(structure1, surface1,     structure2, surface2, strain)`:
      build an interface supercell from two materials with specified surface
      orientations, apply strain to match lattice parameters (to one material,
      or split equally), minimize interface distance
- [x] **122.7.2.2** Implement `interfaceDipole(interfaceStructure)`: compute the
      interface dipole from the macroscopic average of the electrostatic
      potential across the interface — the step in potential is related to the
      interface charge transfer
- [x] **122.7.2.3** Implement lattice mismatch and strain analysis: compute the
      lattice mismatch f = (a_1 - a_2) / a_2, determine coherent vs. incoherent
      interface threshold (typically f < 5% for coherent), compute the critical
      thickness for misfit dislocation introduction using the Matthews-Blakeslee
      model: h_c = (b / (8*pi*f*(1+nu))) * (ln(h_c/b) + 1)
- [x] **122.7.2.4** Implement
      `workOfAdhesion(interfaceEnergy, surfaceEnergy1,     surfaceEnergy2)`:
      W_ad = gamma_1 + gamma_2 - gamma_interface — the work required to separate
      the interface into two free surfaces
- [x] **122.7.2.5** Implement
      `chargeTransferAtInterface(interfaceStructure,     bulkStructures)`:
      compute the charge redistribution at the interface from the difference in
      charge density delta_rho = rho_interface - rho_1 - rho_2, integrate to get
      the transferred charge and the resulting dipole
- [x] **122.7.2.6** Write tests: GaAs/AlAs(100) interface — verify lattice
      mismatch < 0.1%, work of adhesion, charge transfer profile; Au/MgO
      interface — verify Schottky-like behavior

#### 122.7.3 Metal/Semiconductor Contacts

- [x] **122.7.3.1** Implement
      `fermiLevelPinning(metalWorkFunctions,     semiconductorBarriers)`: from
      experimental or computed Schottky barrier heights for multiple metals on a
      semiconductor, fit the pinning parameter S = d(phi_B) / d(phi_M) — S = 1
      is the Schottky limit (no pinning), S = 0 is the Bardeen limit (complete
      pinning)
- [x] **122.7.3.2** Implement metal-induced gap states (MIGS) model: compute the
      characteristic decay length of metal wave functions into the semiconductor
      gap, estimate the charge neutrality level (CNL), and predict the barrier
      height from phi_B = S \* (phi_M - phi_CNL) + (phi_CNL - chi_S)
- [x] **122.7.3.3** Write tests: Fermi level pinning on Si (S ~ 0.3, strong
      pinning), on GaN (S ~ 0.3-0.5), on ZnO (S ~ 0.7-0.9, weak pinning)

---

### 122.8 Transition State Search (`@kalika/defects`)

#### 122.8.1 Nudged Elastic Band

- [x] **122.8.1.1** Implement NEB core algorithm in Rust: given initial and
      final states and N intermediate images, minimize the total NEB objective
      function — for each image, the force is the sum of the spring force along
      the band (F*spring = k \* (|R*{i+1} - R*i| - |R_i - R*{i-1}|) _ tangent)
      and the true force perpendicular to the band (F_perp = F_true - (F_true .
      tangent) _ tangent) — implement with configurable spring constants
- [x] **122.8.1.2** Implement climbing-image NEB (CI-NEB) in Rust: modify the
      highest-energy image so that it climbs to the saddle point — replace its
      NEB force with F_CI = F_true - 2 _ (F_true . tangent) _ tangent (invert
      the component along the tangent) — this gives an exact saddle point
      without interpolation
- [x] **122.8.1.3** Implement variable-spring NEB: use stiffer springs near the
      saddle point and softer springs away from it — k*i = k_max - delta_k \*
      (E_max - max(E_i, E*{i+1})) / (E_max - E_ref) — improves image resolution
      near the transition state
- [x] **122.8.1.4** Implement NEB path initialization: linear interpolation of
      atomic positions (with care for periodic boundaries — choose the shortest
      path through periodic images), image-dependent pair potential (IDPP)
      interpolation for better initial paths
- [x] **122.8.1.5** Implement NEB convergence monitoring: track the maximum
      force on any image, the energy of the climbing image, and the path length
      — report convergence to user-specified tolerance (default max force < 0.05
      eV/A)
- [x] **122.8.1.6** Expose NEB solver to TypeScript via WASM bindings: create
      the TS wrapper
      `nudgedElasticBand(initial, final, nImages, calculator, options)` that
      calls the Rust NEB core, with options for CI-NEB, variable springs, IDPP
      initialization, and convergence criteria
- [x] **122.8.1.7** Write tests: NEB for vacancy migration in FCC Cu (barrier
      ~0.7 eV along <110> path), H diffusion on Pt(111) surface (barrier ~0.1
      eV), verify CI-NEB saddle point energy matches the maximum of a dense scan

#### 122.8.2 Alternative Saddle Point Methods

- [x] **122.8.2.1** Implement dimer method in Rust: find saddle points without
      knowing the final state — maintain a dimer (two images separated by a
      small distance delta_R), rotate the dimer to align with the lowest
      curvature mode (minimizing the energy of the rotated dimer), then
      translate the dimer uphill along the lowest mode and downhill in all other
      directions
- [x] **122.8.2.2** Implement growing string method: instead of fixed images,
      grow the string from both endpoints toward the transition state — add new
      images when the spacing between existing images exceeds a threshold,
      reparametrize the string by equal arc-length, and optimize perpendicular
      forces
- [x] **122.8.2.3** Implement solid-state NEB: for reactions involving cell
      shape changes (e.g., phase transformations), extend NEB to optimize both
      atomic positions and cell parameters at each image — use the generalized
      coordinate that combines strain and atomic coordinates
- [x] **122.8.2.4** Implement intrinsic reaction coordinate (IRC): from a
      transition state, follow the minimum energy path (MEP) downhill in both
      directions by taking steps along the gradient (mass-weighted steepest
      descent) — verify that the IRC connects to the expected reactant and
      product
- [x] **122.8.2.5** Expose alternative methods to TypeScript:
      `dimerMethod(initial,     direction, calculator)`,
      `growingString(initial, final, calculator)`,
      `solidStateNEB(initial, final, nImages, calculator)`
- [x] **122.8.2.6** Write tests: dimer method finds the same saddle point as
      CI-NEB for vacancy migration in Cu (within 0.01 eV), solid-state NEB for
      BCC-to- FCC Fe transformation (Bain path)

#### 122.8.3 Transition State Verification & Analysis

- [x] **122.8.3.1** Implement `verifyTransitionState(structure, hessian)`:
      confirm that a candidate TS has exactly one imaginary frequency (negative
      eigenvalue of the Hessian) — compute the vibrational frequencies and check
      that one is imaginary and the rest are real
- [x] **122.8.3.2** Implement `minimumEnergyPath(nebResult)`: from a converged
      NEB calculation, extract the MEP by cubic spline interpolation of energy
      vs. reaction coordinate — compute the forward and reverse barriers,
      reaction energy, and path length in mass-weighted coordinates
- [x] **122.8.3.3** Implement reaction path analysis: along the MEP, compute key
      structural parameters (bond lengths, angles, coordination numbers) as a
      function of reaction coordinate — identify bond breaking/forming events
- [x] **122.8.3.4** Write tests: verify TS for H2 dissociation on Cu(111) has
      one imaginary mode corresponding to H-H stretch, MEP shows barrier and
      dissociated products

#### 122.8.4 Kinetic Monte Carlo

- [x] **122.8.4.1** Implement KMC engine in Rust (BKL/n-fold way algorithm):
      given a catalog of possible events with rates, select the next event with
      probability proportional to its rate, advance time by dt = -ln(u) /
      R_total where u is uniform random and R_total = sum of all rates —
      rejection-free algorithm for efficiency
- [x] **122.8.4.2** Implement KMC event catalog builder: from a set of NEB
      barriers and attempt frequencies, construct the event catalog with rate
      k_i = nu_0 \* exp(-E_a_i / kT) — handle site-dependent barriers (e.g.,
      different barriers near surfaces vs. bulk)
- [x] **122.8.4.3** Implement KMC diffusion coefficient extractor: from a KMC
      trajectory (sequence of atom positions vs. time), compute the mean square
      displacement <r^2(t)> and extract D = <r^2> / (2*d*t) where d is the
      dimensionality — include error bars from multiple independent runs
- [x] **122.8.4.4** Implement KMC lattice model: define a lattice with
      occupation variables and neighbor lists, events are hops between sites —
      handle vacancies, interstitials, and surface diffusion with site-specific
      barriers
- [x] **122.8.4.5** Expose KMC engine to TypeScript:
      `kineticMonteCarlo(lattice,     events, temperature, nSteps)` returning
      trajectory data (time, configuration snapshots, event statistics)
- [x] **122.8.4.6** Write tests: KMC diffusion of vacancy in FCC Cu lattice —
      verify D(T) follows Arrhenius with correct activation energy (matching NEB
      barrier), compute diffusion coefficient at 300K and 1000K

#### 122.8.5 Radiation Damage

- [x] **122.8.5.1** Implement
      `thresholdDisplacementEnergy(structure, direction)`: for a given
      crystallographic direction, compute the minimum kinetic energy needed to
      permanently displace an atom from its lattice site (create a stable
      Frenkel pair) — systematically vary the knock-on energy and detect whether
      the atom returns or creates a stable defect
- [x] **122.8.5.2** Implement displacement cascade analysis: given a primary
      knock-on atom (PKA) energy, estimate the number of displaced atoms using
      the Kinchin-Pease model: N_d = 0.8 _ E_PKA / (2 _ E_d) for E_PKA > 2\*E_d,
      with the NRT (Norgett-Robinson-Torrens) modification and athermal
      recombination correction
- [x] **122.8.5.3** Write tests: threshold displacement energy in Cu ~ 25-30 eV,
      Si ~ 15-20 eV, NRT displacements for 1 keV PKA in Cu ~ 10 Frenkel pairs

---

### 122.9 Alloy Thermodynamics & Ordering (`@kalika/defects`)

#### 122.9.1 Special Quasirandom Structures (SQS)

- [x] **122.9.1.1** Implement SQS generation algorithm: for a given alloy
      composition (e.g., A*{0.5}B*{0.5}) and supercell size, find the atomic
      configuration that best mimics a random alloy by minimizing the difference
      between the correlation functions of the generated structure and those of
      a perfectly random alloy — match pair, triplet, and quadruplet
      correlations up to specified cluster diameters
- [x] **122.9.1.2** Implement correlation function computation: for each cluster
      type (pair at distance r, triplet, etc.), compute the correlation function
      Pi_f = <prod sigma_i> over all symmetry-equivalent clusters in the
      structure, where sigma_i = +1/-1 for A/B occupation — the target for a
      random alloy is Pi_f = 0 for all clusters
- [x] **122.9.1.3** Implement Monte Carlo SQS optimizer: use simulated annealing
      with atom-swap moves to minimize the objective function sum_f |Pi_f -
      Pi_f^random|^2 over all target cluster figures — accept moves that reduce
      the objective, and some that increase it with Metropolis probability
- [x] **122.9.1.4** Implement SQS quality assessment: compute the deviation from
      random for each cluster figure, overall quality score, and comparison with
      known SQS from the ATAT database for standard compositions and supercell
      sizes
- [x] **122.9.1.5** Write tests: generate SQS for FCC A*{0.5}B*{0.5} in a
      16-atom supercell — verify pair correlation at 1st, 2nd, 3rd neighbor
      distances are all zero (or within tolerance), match known ATAT SQS-16
      structure

#### 122.9.2 Cluster Expansion

- [x] **122.9.2.1** Implement cluster identification: given a crystal structure
      and maximum cluster size/diameter, enumerate all symmetry-distinct
      clusters (pairs, triplets, quadruplets, etc.) with their multiplicities
      and orbit sizes — use the space group to reduce the list
- [x] **122.9.2.2** Implement cluster correlation matrix computation: for a set
      of DFT-computed structures with different atomic configurations, compute
      the correlation matrix Pi\_{s,f} where s indexes structures and f indexes
      cluster figures — each row is the correlation vector of one structure
- [x] **122.9.2.3** Implement effective cluster interaction (ECI) fitting: solve
      E*s = sum_f m_f * J_f * Pi*{s,f} for the ECI values J_f using: (a)
      least-squares for overdetermined systems, (b) compressive sensing
      (LASSO/L1 regularization) for sparse solutions, (c) Bayesian approach with
      evidence-based hyperparameter optimization
- [x] **122.9.2.4** Implement leave-one-out cross-validation (LOOCV): for each
      structure in the training set, fit the CE without it and predict its
      energy, compute the LOOCV score = sqrt(mean squared prediction error) —
      use this to select the optimal set of clusters (model selection)
- [x] **122.9.2.5** Implement cluster expansion predictor: given a fitted CE
      (set of clusters and their ECIs), predict the energy of any atomic
      configuration by computing its correlation functions and dotting with the
      ECI vector — fast O(N) evaluation for use in Monte Carlo
- [x] **122.9.2.6** Implement ground state search: using the fitted CE,
      enumerate or search (via simulated annealing on the CE energy landscape)
      for the lowest-energy configurations at each composition — construct the
      T=0 convex hull of formation energies vs. composition
- [x] **122.9.2.7** Write tests: cluster expansion for Cu-Au FCC alloy — fit
      ECIs from a training set of ~20 structures, verify LOOCV < 5 meV/atom,
      predict L1_0 (CuAu) and L1_2 (Cu3Au, CuAu3) as ground states

#### 122.9.3 Monte Carlo for Alloy Thermodynamics

- [x] **122.9.3.1** Implement canonical Monte Carlo in Rust: at fixed
      composition and temperature, perform atom-swap moves (exchange A and B
      atoms), accept with Metropolis probability min(1, exp(-delta_E / kT))
      using the cluster expansion for fast energy evaluation — collect
      thermodynamic averages (energy, heat capacity, order parameters)
- [x] **122.9.3.2** Implement semi-grand-canonical Monte Carlo in Rust: at fixed
      chemical potential difference delta_mu and temperature, allow the
      composition to fluctuate — single-site identity changes accepted with
      probability based on delta_E - delta_mu — determines the equilibrium
      composition at each T and delta_mu
- [x] **122.9.3.3** Implement order parameter computation: Warren-Cowley
      short-range order (SRO) parameters alpha*lmn = 1 - P*{AB}(lmn) / x*B where
      P*{AB} is the conditional probability of finding B at shell (l,m,n) given
      A at origin, and x_B is the overall B fraction — alpha = 0 for random,
      negative for ordering, positive for clustering
- [x] **122.9.3.4** Implement long-range order (LRO) parameter: eta =
      (r_A^alpha - x_A) / (1 - x_A) where r_A^alpha is the fraction of
      alpha-sublattice sites occupied by A — eta = 1 for perfect order, 0 for
      disorder — detect order-disorder transitions
- [x] **122.9.3.5** Implement order-disorder transition temperature finder: run
      MC simulations at a series of temperatures, compute the order parameter
      and heat capacity at each, identify T_c from the peak in heat capacity
      (lambda transition) or the vanishing of the LRO parameter — use histogram
      reweighting for efficiency
- [x] **122.9.3.6** Implement phase diagram from CE + MC: at each composition,
      determine the stable phase (ordered or disordered) as a function of
      temperature from semi-grand-canonical MC — construct the binary phase
      diagram with phase boundaries, miscibility gaps, and ordered phases
- [x] **122.9.3.7** Expose MC engine to TypeScript:
      `alloyCanonicaMC(structure,     clusterExpansion, temperature, nSteps)`
      and
      `alloySGCMC(structure,     clusterExpansion, temperature, deltaMu, nSteps)`
      — return energy trajectory, order parameters, final configuration
- [x] **122.9.3.8** Write tests: Cu-Au system — verify order-disorder transition
      for L1_2 Cu3Au near T_c ~ 663K (from experimental value), SRO parameters
      show ordering tendency below T_c

#### 122.9.4 High-Entropy Alloys & Configurational Entropy

- [x] **122.9.4.1** Implement `configurationalEntropy(composition)`: S_config =
      -k_B _ sum(x_i _ ln(x_i)) for an ideal solution — for a 5-component
      equiatomic alloy, S_config = k_B \* ln(5) ~ 1.61 R
- [x] **122.9.4.2** Implement high-entropy alloy SQS generation: extend the
      binary SQS algorithm to multi-component systems (3, 4, 5+ components) —
      match correlation functions for all pair types (AB, AC, BC, AD, ...) — the
      number of pair clusters grows as n_species\*(n_species-1)/2
- [x] **122.9.4.3** Implement multi-component cluster expansion: extend the
      binary CE to n-component alloys using point functions (beyond +1/-1 Ising
      variables) — use orthogonal point functions for each site and define
      multi-body cluster functions as products — fit ECIs from DFT training
      structures
- [x] **122.9.4.4** Implement HEA stability predictor: compute the competition
      between configurational entropy (favoring single-phase solid solution) and
      enthalpy of formation (favoring ordered phases or phase separation) — the
      alloy is a stable HEA if T \* S_config > |delta_H| for all competing
      phases
- [x] **122.9.4.5** Write tests: configurational entropy of equiatomic
      CoCrFeMnNi Cantor alloy (5-component: S = 1.61R), SQS for ternary
      A*{1/3}B*{1/3}C\_{1/3} in 27-atom supercell, stability prediction against
      known HEA formability

<!-- prettier-ignore-end -->
