# rgsaddle: Complete Documentation Corpus

> Generated from `docs/orgmode/*.org` by `docs/render_llms.py`. Edit the Org sources and rerun `python3 docs/render_llms.py`.

# rgsaddle (`docs/orgmode/index.org`)

> Overview, installation, and host-controlled stepping loop

The band and the minimum-mode search take one rgmin `Solver` step on a force this crate assembled. `Index1Session` takes a restricted-step partitioned RFO step and updates the Hessian with Powell or Bofill. There is no run-to-completion contract. `run` is a loop over `step`.

Force assembly ports eOn's NEB: Mills–Jónsson–Schenter and Henkelman–Jónsson tangents, uniform / energy-weighted / Onsager–Machlup springs, PEB / NEB / DNEB projections, climbing image with the eOn trigger. Positions are unwrapped Cartesian. A `Cell` supplies minimum-image differences.

## Install
```console
$ cargo add rgsaddle
$ cargo add rgsaddle --features capi   # C header and cdylib
```

## First minute
The analytic double well in `tests/double_well.rs`: minima at \((\pm 1, 0, 0)\), saddle at the origin, barrier 1. Nine images, host loop, endpoints stay put.

```rust
let mut session = BandSession::new(BandConfig::default(), initial_band(9))?;
let mut report = session.step(&DoubleWell)?;
while report.status != BandStatus::Converged {
    report = session.step(&DoubleWell)?;
}
```

# Getting started (`docs/orgmode/getting-started.org`)

> First band session on an analytic double-well surface

A host builds a band, steps until the projected force is under `force_tol`, and never lets this crate own the loop.

## 1. Depend on the published crate
```toml
[dependencies]
rgsaddle = "0.8.0"
ndarray = "0.17"
```

A host that also names rgmin types, such as `QuickMinOptions`, asks for the rgmin release and source in rgsaddle's `Cargo.toml`.
Cargo builds any other release or source as a second crate, and its types do not match the ones rgsaddle takes.

## 2. Implement `BandSurface`
One eval fills energies and gradients for the rows it receives: the whole band on the first call, the interior images afterwards (the endpoints never move, so their energies are cached). With `BandConfig::remove_rotation_and_translation` the product endpoint is placed on its neighbour and that cache is cleared.
The double well \(V = (x^2 - 1)^2 + 2y^2 + 2z^2\) has minima at \((\pm 1, 0, 0)\) and a saddle at the origin with energy 1:

```rust
/// Energy and gradient of the double well at (x, y, z).
fn double_well(x: f64, y: f64, z: f64) -> (f64, [f64; 3]) {
    let energy = (x * x - 1.0).powi(2) + 2.0 * y * y + 2.0 * z * z;
    (energy, [4.0 * x * (x * x - 1.0), 4.0 * y, 4.0 * z])
}

struct DoubleWell;

impl BandSurface for DoubleWell {
    fn eval(
        &self,
        positions: ArrayView2<f64>,
        energies: &mut Array1<f64>,
        gradients: &mut Array2<f64>,
    ) -> Result<(), SaddleError> {
        for (i, row) in positions.outer_iter().enumerate() {
            let (energy, gradient) = double_well(row[0], row[1], row[2]);
            energies[i] = energy;
            for (k, g) in gradient.into_iter().enumerate() {
                gradients[(i, k)] = g;
            }
        }
        Ok(())
    }
}

```

## 3. Step
Nine images run from one minimum to the other, bowed off the path so the band has work to do.
The host calls `step` until the band reports `Converged`:

```rust
    // Nine images from (-1, 0, 0) to (1, 0, 0), bowed off the path in y.
    let initial = Array2::from_shape_fn((9, 3), |(i, k)| {
        let t = i as f64 / 8.0;
        match k {
            0 => 2.0 * t - 1.0,
            1 => 0.3 * (std::f64::consts::PI * t).sin(),
            _ => 0.0,
        }
    });

    let config = BandConfig::default()
        .with_force_tol(1e-3)
        .with_max_move(0.1);
    let mut session = BandSession::new(config, initial)?;
    let report = loop {
        let report = session.step(&DoubleWell)?;
        if report.status == BandStatus::Converged {
            break report;
        }
    };

    let ci = report.ci_index.expect("a climbing image");
    let positions = session.positions();
```

Default stepper is FIRE, as in eOn's velocity NEB stepper.
L-BFGS runs under rgmin's `Accept::Step`: the projected band force is not conservative, so a step is taken without an energy test.

## 4. Run it
The code above is `examples/double_well.rs`.
From the repository root:

```console
$ cargo run --example double_well
```

```text
Converged after 8 steps, max force 2.6e-4
climbing image 4 at (0.0000, -0.0001, 0.0000), energy 1.000000
```

The climbing image is image 4, the middle of the nine.
It sits on the saddle at the origin, and its energy is the barrier.

## 5. Reset when the surface changes
`BandSession::reset` is the model-update boundary.
Quasi-Newton history taken on one surface epoch must not survive onto the next.

## Next

# How-to (`docs/orgmode/howto.org`)

> Task index for bands, minimum-mode searches, C ABI, and rates

## Step a band from C
Enable `capi`. The header is `rgsaddle.h`. ABI major 1. Every wire struct opens with `rgsaddle_version_t`. The host:

1. creates a session
2. calls `step` until the report says converged, or until host policy stops
3. reads `rgsaddle_band_evaluation` for the energies and forces at the new band instead of evaluating it again
4. calls `rgsaddle_band_restart` to restart the optimizer on the same surface, `rgsaddle_band_reset` at a surface-epoch boundary
5. frees

`rgsaddle_band_set_positions` with the band the host read back (even wrapped into its cell) costs no evaluation; only moved rows retire the cached values. `rgsaddle_report_t.evaluations` counts the image evaluations of each step.

There is no run-to-completion C entry point. Units are the caller's. Positions are unwrapped Cartesian, image-major, stride `3 * n_atoms`.

## Use the headers from meson
The top-level `meson.build` provides the headers as the dependency `rgsaddle-headers` (also `rgsaddle`), from a wrap or from an installed `rgsaddle-headers.pc`. It does not build the library. `howto/meson` has the wrap, the migration from a packagefiles overlay, and the run-time loading.

## Use the Fortran module
Enable meson's optional `fortran` feature (`-Dfortran=enabled`) to build the `rgsaddle` Fortran 2008 module, `librgsaddle_fortran`, `rgsaddle-fortran.pc`, and the `rgsaddleFortran` CMake package over ABI 1.72. See [the Fortran how-to](howto/fortran.html) for the move-only handle lifecycle, column-major coordinate layout, thread-safe and re-entrant callbacks, and runnable band, min-mode, PAFI, and OH-TST programs.

## Grow the band with AutoNEB
`howto/autoneb` is the AutoNEB loop: insert where the resolution is worst, relax a local window, and climb. The tuning sits on `BandConfig::autoneb`. A weighted spring supplied by the host is refused for now; zoom-NEB will recompute it.

## Fixed-energy tunnelling path (LI-NEB)
`howto/line-neb` is `LineNebSession`: the optimal JWKB tunnelling path at a fixed energy below the barrier, found by the line-integral extension of the nudged elastic band of Ásgeirsson, Arnaldsson, and Jónsson (2018). The action is the trapezoid over every image, and an endpoint below the fixed energy is refused. A running session defaults to the restrained endpoint update. `EndpointBelowEnergy::Strict` stops with `SaddleError::Invalid` and `LineNebEndpointViolation`, and the error enum is unchanged. `fixed_energy_mep_seed` builds the starting band from a saddle and its mode. `Converged` needs the transverse action force, the interior spring force, and the endpoint force within tolerance. `FixedEnergyTrajectory` integrates the motion along the converged path.

## Choose linear, IDPP, or TRICS initialization
`howto/path-initialization` compares the generic `PathInitializer` choices,
shows how TRICS refines a linear or IDPP seed, and gives the C entry point.

## Pick tangents, springs, projections
| Kind             | Variants                                                             |
| --- | --- |
| `TangentKind`    | `Simple` (Mills–Jónsson–Schenter), `Improved` (Henkelman–Jónsson) |
| `SpringKind`     | `Uniform { k }`, energy-weighted, Onsager–Machlup                   |
| `ProjectionKind` | plain elastic band, `Neb`, `Dneb`                                    |

Defaults: improved tangent, uniform spring `k = 5`, NEB projection, and
a climbing image that arms when the largest force component falls below
the absolute threshold 0.5 in the host's force units. The relative
trigger factor is 0.
`BandConfig::remove_rotation_and_translation` (off unless set) fits each image of a free, non-periodic band onto the previous one before tangents and springs are built. See [the band how-to](howto/band.html).
`BandConfig::with_string(StringConfig::default())` opts out of springs and tangent projection for the simplified string method of E, Ren, and Vanden-Eijnden (2007), evolving interior images under the full potential force and reparametrizing to equal arc length on the not-a-knot cubic spline or the polyline; see [the band how-to](howto/band.html).

## Interpolate a geodesic initial path
`howto/geodesic` minimizes the redundant coordinate length of Zhu, Thompson, and Martinez, J. Chem. Phys. 150, 164103 (2019), doi:10.1063/1.5090303. The chart is caller supplied. `MorsePairChart` is their Eq. (7). The endpoints stay fixed. This is an initial path, not a band step: it does not evaluate a potential.

## Leave a minimum with ART nouveau
`howto/art` is the phased search: a host seed and mask, perpendicular relaxation, Lanczos, a lowest-mode climb, an index-1 certificate, a push both ways off the saddle, and the two quenches. `ArtStatus::Reverted` is not a completed exit.

## Choose search directions from a minimum
`howto/direction-cover` is `DirectionCover`: a signed cover of unit vectors on every active atom's sphere, an optional Gaussian kick on its neighbours, and a picker that orders the arms by angular gap or by expected improvement of the barrier. Each arm is one `ArtSession`. The coverage readout has the covering radius per atom, a record per arm, and the distinct saddles against draws.

## Step one point with a stencil
`howto/stencil` builds `Stencil::point` for a minimiser, the dimer, Lanczos, ART, or eigen following. `Stencil::band` validates its array but band presets are not implemented. The C names are `rgsaddle_stencil_*` and `rgsaddle_last_error`. Python is `rgsaddle.Stencil.point` and `rgsaddle.ase.Point`.

## Solid-state dimer
`howto/solid-dimer` is the minimum-mode search on atoms plus cell strain, the dimer analogue of the generalized solid-state band. A frozen cell is the fixed-cell dimer. The saddle stress is `V σ`, the elastic dipole.

## Solid-state NEB on the dimer chart
`howto/ssneb` is the climbing-image band on that same chart. A frozen cell is the ordinary band. A free cell uses `E + V0 σ_ext : ε`.

## NPT lattice parameter
`howto/npt-lattice` is `npt_lattice`: Langevin dynamics with a Berendsen barostat that samples the zero-pressure lattice of a crystal. The report carries the mean lattice parameter and pressure with blocking standard errors, and `pressure_converged` is an indicative screen, not a proof of equilibrium. `NptConfig` is non-exhaustive and the seed expands through SplitMix64.

## Rates and free energies
PAFI, OH-TST, Bennett-Chandler shooting and the defect-pair rate catalogue live in rgflux, which drives the `PointSurface`, `Hyperplane` and `HyperplaneSampler` types of this crate. Their guides are in the rgflux documentation, https://github.com/OmniPotentRPC/rgflux.

The guides that moved there from this documentation:

- PAFI tutorial: a free-energy profile and a rate on an analytic surface: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/tutorials/pafi.org
- OH-TST tutorial: plane optimisation to a rate: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/tutorials/oh-tst.org
- Free-energy profile along a path (PAFI): https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/howto/pafi.org
- Optimal hyperplanar transition state theory: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/howto/oh-tst.org
- Defect-pair hop rates: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/howto/defect-pair-rates.org
- Use an rgpot potential: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/howto/rgpot.org
- Restart a PAFI or OH-TST run: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/howto/pafi-ohtst-restarting.org
- Parallel sampling for PAFI and OH-TST: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/howto/pafi-ohtst-parallel-sampling.org
- Check convergence of a PAFI or OH-TST run: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/howto/pafi-ohtst-checking-convergence.org

## Sample hyperplanes with LAMMPS
`howto/lammps-hyperplane` configures `LammpsHyperplaneSampler` through rgpot's pinned `PotentialConfig` profile. lammpc keeps one in-process LAMMPS instance for the ensemble and applies the plane to position, velocity, and force on every BAOAB step. The `lammps` Cargo feature is opt-in.

## Optimal tunneling paths
`howto/lineb` is the line integral nudged elastic band: the fixed-energy JWKB path in mass-weighted coordinates, its half period and instanton temperature, a ladder of energies from a minimum energy path, and the ring-polymer harmonic quantum TST rate from Hessian-vector products at the distinct replicas.

## Strain response of a hop
`howto/strain-rate` is `StrainResponse`: the elastic dipoles of one minimum and one saddle, the symmetry images of that hop, and `barrier(ε)`. The line is trusted inside a radius, a quadratic error bound, or a curvature-softening bound. Past that bound `refine` runs a fixed-cell solid dimer and caches the explicit barrier. On the Mishin copper dumbbell that refine does not reproduce the explicit barrier, and the trusted line does not reproduce the rate. The measured calls are in the same page.

## Minimum-mode instead of a band
`MinModeSession` refreshes the lowest curvature mode (dimer rotation or Lanczos on finite-difference Hessian actions), inverts the force along it, and takes one solver step. Same host loop. `PointSurface` evals a single geometry.

A host that climbs with its own optimizer keeps one session for the whole search: `set_position` (`rgsaddle_minmode_set_position`) with the gradient it already has, then `estimate_mode` (`rgsaddle_minmode_estimate`). The previous mode seeds the next rotation, so a mode that still holds costs one evaluation. The dimer's Polak-Ribiere force and direction survive that move; `set_mode` and `reset` clear them, and a failed callback leaves them unchanged. Lanczos through the C estimate advances one Hessian action and keeps the Krylov basis until `set_position`, `set_mode`, or `reset`. The basis grows to the free dimension. After k actions the mode also takes its component on the residual direction, from the Lanczos polynomials at an extrapolated lowest eigenvalue, at no extra surface call; the reported curvature is the Ritz value of the k vectors. `MinModeSession::estimate_mode` and `step` still finish their own stop, the residual test or the torque window, before a translation. A dimer estimate is the full rotation.

## Index-k minimum mode
`indexk_step` and `IndexKSession` reflect the force in the k lowest modes and take one translator step. `k = 1` is the dimer or Lanczos step, bit for bit. The block solver is LOBPCG or block Lanczos. See `howto/indexk`. From C, ABI minor 37, the names are `rgsaddle_indexk_*` and `rgsaddle_reflect_force`.

## Solution landscape
`LandscapeSession` pushes a certified saddle along each unstable eigenvector and follows index-(k-1) minimum-mode dynamics down to minima. The result is a `PathwayMap`. See `howto/landscape`. From C, ABI minor 69, the names are `rgsaddle_landscape_*`. Python is `Landscape`.

## Index-1 Newton
`Index1Session` takes a restricted-step partitioned rational function optimization (RFO) step on a dense Hessian and updates it with Powell or Bofill. Pass an initial Hessian, or leave it empty and the first step builds one by central differences. `Index1Config` is non-exhaustive. `with_sparse_pattern` builds that seed from a distance-2 colouring instead. The flag stays off unless set. The trust radius is the Euclidean bound on the Cartesian step. See [the sparse Hessian how-to](howto/sparse-hessian.html).

From C, `rgsaddle_index1_create` / `rgsaddle_index1_step` follow the same loop. The vector length is `3 * n_atoms`; a bead polymer passes `n_atoms * n_beads`. A host that owns the Hessian calls `rgsaddle_prfo_step`. `rgsaddle_nichols_step` is the i-PI shift on a spectrum (`nmode` may be smaller than `n` when external modes were dropped). `rgsaddle_hessian_bofill` or `rgsaddle_hessian_powell` updates the Hessian. The gradient on the wire is dE/dx.

## Drive an ASE band with NEBOptimizer
`howto/neb-optimizer` is `rgsaddle.ase.NEBOptimizer`. It takes the band of ASE images and the ASE keywords `method`, `alpha`, `rtol`, `C1`, `C2`, and `verbose`. `method='ODE'` is the adaptive ODE12r step. `method='static'` is the fixed step. `run(fmax, steps)` stops on `NEB.get_residual`.

## Do not keep solver history across a potential change
Call `reset` after any model update. That is the documented boundary. A host that skips it mixes two surfaces in one L-BFGS memory. `restart` is the optimizer-only reset for the same surface; it keeps the cached endpoint energies and the last evaluation.

# Reference (`docs/orgmode/reference.org`)

> Exhaustive inventory of Rust modules, types, functions, configs, C ABI, and Python bindings

## Public Rust types
The hosted [Rust API reference](https://docs.rs/rgsaddle) includes the default solver, C ABI, OH-TST, and readcon interfaces.
`cargo doc --no-deps --features capi,ohtst,readcon-db --open` builds these pages from a checkout.
The `lammps` feature adds the LAMMPS adapter to a local documentation build.
Runnable examples open `BandSession`, `AutoNeb`, `OcinebSession`, `MinModeSession`, `Index1Session`, `IndexKSession`, `SolidDimer`, `SolidNeb` and `Stencil`, and, with `--features capi`, the C band, min-mode and stencil handles.
`meson -Dfortran=enabled` adds the Fortran 2008 `rgsaddle` module on the same C ABI.
`cargo test --doc` runs them.
Every public configuration struct is non-exhaustive.
Start from `Default` or the type's named constructor and chain the `with_*` setters, as in `BandConfig::default().with_force_tol(1e-3)`.
The table below lists the main types.

| Type                           | Role                                                                                                               |
| --- | --- |
| `BandSession`                  | Outer seam. `new`, `step`, `run`, `restart`, `reset`, `set_positions`, `positions`, `evaluation`                   |
| `OcinebSession`                | The band's refinement with the published controls (`OcinebConfig::refine`). `step` reports `Band`, `Align`, or `MinMode` |
| `AutoNeb`                      | Insert on the worst gap, relax a local window, and climb. The full band runs only when `full_band` is set. `run` is one shot. With `remove_rotation_and_translation` the stored path is the fitted window in the frame of its left endpoint, including the fitted right endpoint and the energies of those images |
| `AutoNebTuning`                | `n_simul`, `n_max`, local tolerance and step caps, `space_energy_ratio`, `climb`, `full_band`, `threads`, `record_samples`, `trics`. Stored on `BandConfig` |
| `BandConfig`                   | Tangent, spring, projection, climbing, cell, tolerances, method, optional AutoNEB tuning, `min_mode` refinement, `zoom`, `string`, `free_end`, optional `dynamic` (`DynamicNeb`, off unless set), `remove_rotation_and_translation` (off unless set) |
| `FreeEndConfig`, `FeaNebSession` | Free-end adaptive NEB of Zhang, Zhang, Ye, and Zheng (2016) and Zhu et al. (2007) on `BandConfig::free_end`. One terminal image (`FreeEndSide::First` or `FreeEndSide::Last`, default `Last`) moves on the target-energy level set with adaptive cut-and-remesh around the detected peak (`FreeEndReport`, `FeaNebReport`) |
| `StringConfig`                 | Simplified string method of E, Ren, and Vanden-Eijnden (2007) on `BandConfig::string`. Non-exhaustive, off unless set. Evolves interior images under the full potential force and reparametrizes to equal arc length on `Reparametrization::NotAKnot` (default, `StringConfig::spline()`) or `Linear` (`StringConfig::linear()`), anchoring an armed climbing image |
| `StringSession`                | Standalone simplified string session preserving per-image `ImageIds` and batched surface evaluations; target of `GrowingStringSession` hand-off |
| `GrowingStringSession`         | Growing string method of Peters, Heyden, Bell, and Chakraborty (2004). Reactant and product fragments with frontier tangent constraints, configurable node-add criterion (`GrowingStringConfig`), separate fragment relaxation, join detection, and hand-off to `StringSession` |
| `MinModeRefine`                | OCI-NEB refinement of the climbing image. Non-exhaustive. Trigger at any force, stability 1, start alignment 0.85, no alignment exit, retry under 0.5 of the starting force, refresh at 0.3 of the measured curvature or overlap 0.8 every 4 steps at most, budget 1000, Lanczos with twenty actions and relative tolerance 0.05 |
| `DynamicNeb`                  | Dynamic NEB on `BandConfig::dynamic`. Non-exhaustive, off unless set. `fmax` 0.05 and `scale_fmax` 0 match ASE 3.29 `DyNEB`: an interior image whose largest per-atom projected force is strictly below `fmax * (1 + distance * scale_fmax)` keeps its last energy and force. `distance` is the Euclidean norm from the highest-energy image, with no minimum image. That image stays in the spring and the tangent and is evaluated again when the projected force exceeds the threshold. The highest-energy image is never given a zero force. |
| `ZoomConfig`                   | The nudged elastic band (NEB) zoom, Zoom-NEB, on `BandConfig::zoom`. Non-exhaustive, off unless set. Recommended settings for a band that opts in are the defaults: `alpha` 0.5, `offset` 1, `stability` 5, cubic placement, and `after` 0. An `after` of 0 zooms once the largest per-image force, measured by the session's convergence norm, is below twice `force_tol`. The window always reaches both neighbours of the climbing image. The min-mode refinement waits for the zoom decision. Plain climbing image NEB (CI-NEB) on the 51 benchmark pairs of the 38-atom Lennard-Jones cluster (LJ38) converged 20 pairs with the zoom on and 21 without it. It used more force calls on 10 of the 17 pairs that converged both ways. With the default min-mode refinement on, one LJ38 pair ran to the 250000 call cap. On Müller-Brown at 13 images with FIRE and `max_move` 0.05, plain CI-NEB took 30593 force calls with the zoom and 31308 without it. With L-BFGS of memory 100 and climbing from half the first force, the zoom does not help on Müller-Brown: the band took 6503 force calls with it and 3280 without it. The zoom is an opt-in, not a general default. |
| `BandSurface`                  | Host potential on a band (energies + gradients per image)                                                          |
| `BandReport`                   | `status`, `max_force`, `ci_index`, `iteration`, `surface_rows`, `curvature` (refinement steps only), `saddle_index` (converged steps) |
| `SaddleIndexCheck`             | The saddle-index check of a converged band, min-mode or OCI-NEB search, on `BandConfig::saddle_check` and `MinModeConfig::saddle_check`, on by default. Non-exhaustive. Block 2, lowest 4, residual 1e-2, curvature threshold -1e-3, 100 forward actions of 1e-3. `escape` takes a `SaddleEscape` (push 0.1, two attempts) |
| `SaddleIndex`                  | `index`, ascending `curvatures` and their `residuals`, `converged`, `evaluations`. `saddle_index` certifies one point on a `PointSurface` |
| `MinModeSession`               | Dimer or Lanczos lowest-mode search, same stepping contract; `set_position`, `set_mode`, `estimate_mode` for reuse; `set_torque_window` sets the dimer and Lanczos torque window apart from `rotation_tol`; `set_rotation_stop_length` turns on the curvature-aware rotation stop; `set_artn` enables or disables the ART nouveau protocol |
| `SoftModeDirectionPlan`        | Soft-mode-subspace-first direction seeding (`soft_mode_then_full_directions`, `spectral_gap_rank`). Recovers a sparse Hessian at a minimum, selects the soft-subspace rank `k` from the largest spectral gap, and emits `2 * phase_count` unit directions |
| `ModeSweepDirectionPlan`       | Deterministic soft-to-stiff Hessian-mode sweep (`hessian_mode_sweep_directions`, `mode_sweep_schedule`). Recovers the Hessian by central differences, diagonalizes it in full, and emits one carrier-weighted, optionally localized unit direction for every non-rigid mode. `minimum_squared_mode_weight` is the proven overlap floor. `mode_sweep_schedule` picks a stratified list of band positions. Non-exhaustive |
| `ArtSession`                   | ART nouveau in eight persisted phases: masked host seed, perpendicular relaxation, Lanczos, lowest-mode climb, index-1 certificate, push both ways, unconstrained quench, reversibility. The climb checks curvature and consecutive-mode overlap, recovers the carried mode or restarts from the last accepted index-1 point. When recovery is exhausted it finishes as `ArtStatus::LostCurvature` if the rejected curvature is finite and non-negative and returns `SaddleError::ArtIndexOneLost` otherwise. `run_events` marks duplicate saddles. `ArtStatus::Reverted` is not a completed exit. `force_calls` is the bounded recent window; `force_call_count` is the total. Non-exhaustive `ArtConfig` and `ArtOutcome` |
| `DirectionCover`               | Signed per-atom direction cover and arm picker for saddle searches from one minimum. Each active atom is its own centre with an even signed cover of `cover_points` on its sphere and an optional Gaussian kick on neighbours within `kick_radius`. The climb is `ArtSession`. `run`, or `suggest`, `run_arm` and `record` for a host loop. `coverage` is the `CoverageReport`: exact covering radius per centre, per arm records, distinct saddles against draws, frequency counts, and the next arm with its score. No Hessian. Non-exhaustive `DirectionCoverConfig` and `CoverBudget` |
| `IndexKSession`                | Index-k minimum-mode step. `k = 1` is `MinModeSession`. `indexk_step` is one shot. `reflect_force` and `translated_force` are the subspace maps |
| `LandscapeSession`             | Downward pathway map. `PathwayMap` of `CriticalPoint` nodes and `LandscapeEdge` connections. `LandscapeConfig` bounds the nodes and the force evaluations. `LandscapeBoundKind` names the limit `SaddleError::LandscapeBound` reports |
| `SolidDimer`                   | That search on atoms plus Jacobian-scaled cell strain. `CellMask::frozen` is the fixed-cell dimer. `stress` and `elastic_dipole` are `σ` and `V σ`. `SolidDimerConfig`, `IndexCheck`, `StressCheck`, `SolidDimerReport` and `IndexReport` are non-exhaustive |
| `VineyardIndexReport`          | The `IndexReport` of a certified `minimum` and `saddle`, returned by `certify_vineyard_pair`. The function needs each point stationary to a force tolerance, a minimum with no projected negative mode, a saddle with exactly one, and `IndexCheck::lowest` of at least two. Non-exhaustive |
| `VineyardIndexError`           | Why a pair is not Vineyard-ready: `Evaluation`, `MinimumForce`, `SaddleForce`, `Minimum` or `Saddle`, the last two with the lowest projected spectrum. Non-exhaustive |
| `StrainResponse`               | One hop. `barrier(ε)` is the lowest symmetry image of `ΔE0 - (P_saddle - P_minimum):ε`, or `NeedsSearch` past the validity bound. `ElasticDipole::from_stress` is `-V (σ_defect - σ_bulk)`. `refine` caches an index-1 solid dimer. `with_prefactor`, `with_variants`, `with_point_group`, `with_policy`, and `with_multipoles` attach options. `to_json` and `from_json` are the event record |
| `npt_lattice`                  | Isotropic Langevin dynamics with a Berendsen barostat on a crystal, with the kinetic pressure in the drive. `NptConfig` is non-exhaustive: start from `Default` and chain the `with_*` setters, including `with_repeats`, `with_maximum_steps`, `with_extension_steps` and `with_block_steps`. `NptReport` carries the mean lattice parameter and pressure with blocking standard errors. `pressure_converged` is an indicative screen, not a proof. See [NPT lattice sampling](howto/npt-lattice.html) |
| `ArcPath`                      | Path through ordered frames, a cubic spline over chord length, with its curvature and jerk. The PAFI estimators of rgflux sample planes along it |
| `Hyperplane`                   | Dividing plane: a point and a unit normal toward the product in mass-weighted coordinates. `from_min_mode` seeds it from a converged dimer or Lanczos session, preferring the vector of a converged saddle-index certificate over the session mode; `packed` and `from_packed` are its `[p; ν]` layout, `from_cartesian` and `to_cartesian` convert; `orthogonal_to_mass_weighted_translations` drops rigid translations from the normal. The OH-TST estimators that move and climb it are in rgflux |
| `LammpsHyperplaneSampler`      | Opt-in lammpc backend for `HyperplaneSampler`. `LammpsSystem` owns the rgpot configuration and geometry; `LammpsSamplerConfig` owns the time step, friction, thermostat and excluded-mode count; records expose `lammps.thermostat` and `lammps.effective_degrees_of_freedom` |
| `MassWeighted`                 | `q = M^{1/2} x` through `MassMetric` over a Cartesian `PointSurface`; `mass_weighted_rigid_translations` returns the orthonormal rigid-translation rows in these coordinates; `FixedCell` holds the cell of a crystal fixed per temperature. `flux_mass` is `1 / Σ nᵢ²/mᵢ`, not the 2001 Eq. 24 |
| `Index1Session`                | Restricted-step partitioned RFO, Powell or Bofill update. `Index1Config` is non-exhaustive. `with_sparse_pattern` selects a CPR seed |
| `SparsityPattern`              | Atom-level symmetric CSR from a linkcell cutoff walk. Diagonal blocks are implied and not stored as loops          |
| `Colouring`                    | Smallest-last distance-2 colouring and the max-degree lower bound                                                  |
| `SparseHessian`                | Frozen recovered blocks. Implements `ApplyHessian`. `matvec` and `apply_hessian` panic on a length mismatch. `to_dense` and `lowest_eigenpairs` export the matrix. `LowestEigenpairs` is non-exhaustive |
| `SparseHessianOpts`            | Non-exhaustive. `Default` and `with_difference`, `with_step`, `with_memory_budget`, `with_skin`. Default step 1e-4. The step carries \(O(h^2)\), \(O(\varepsilon_g / h)\), and the optimum near \((3 \varepsilon_g / \lvert g''' \rvert)^{1/3}\) |
| `prefactor_hessian`            | Direct CPR seed. `one_atom_hessian` is the per-atom baseline eOn uses when a potential has no finite cutoff        |
| `nichols_step`                 | i-PI Nichols shift from a supplied spectrum                                                                        |
| `restricted_prfo_displacement` | Baker restricted-step partitioned RFO from `H` and `g`                                                             |
| `SellaSaddleConfig`            | Settings of the order-1 Sella session for partitioned rational function optimization |
| `Cell`                         | 3×3 lattice (rows are vectors), fractional minimum-image wrap                                                      |
| `SaddleError`                  | Shape, surface, non-finite, solver, invalid, stalled, ART index-1 loss, not-equilibrated, and insufficient-effective-samples errors. The enum is unchanged by fixed-energy LI-NEB: a strict endpoint below `E` is `SaddleError::Invalid`, and `LineNebEndpointViolation` carries the endpoint (`first` or `last`), `V - E`, and the one-based step |
| `Stencil`                      | Point builder. Dimer and Lanczos wrap `MinModeSession`. `Stencil::band` rejects band presets as not implemented. See [one stencil](explanation/one-stencil.html) |
| `Chain`                        | Positions, ids, and roles. `evaluate` uses a fixed block of one image. `Mesh` remeshes (linear, Hermite, or not-a-knot spline), inserts, or windows with no force call |
| `reparametrize`                | Equal arc-length placement of a band, `Reparametrization::Linear` on the polyline or `NotAKnot` on the not-a-knot cubic spline. `RtrConfig::reparametrization` selects it for the trust-region band |
| `Preset`                       | `Min`, `Dimer`, `Lanczos`, `Art`, `EigenFollow`, and the named band presets                                         |
| `ConnectConfig`                | IDPP Lanczos climb and the COMPASS fallback. `optbench` sets the LJ38 force tolerance, eight Lanczos actions, relative tolerance 0.05, and quenched split nodes |
| `sidpp_path`                   | Sequential IDPP (S-IDPP) initial path. `SidppConfig` holds the spring, the two force stops, and the quick-min step. `idpp_path` is the per-image IDPP start |
| `idpp_path_fixed`              | IDPP path with a frozen-atom mask. An empty mask is the same minimization as `idpp_path`: each interior image starts on the straight minimum-image line and relaxes toward linearly interpolated pair distances under `IdppConfig`. A true entry keeps that atom at the reactant coordinates on every interior image. A non-empty mask whose length is not the atom count is a shape error. A fixed atom that moves between the endpoints is rejected. The endpoints are copied through |
| `sidpp_alternating_path`       | Alternating IDPP path. This is not `sidpp_path`. `SidppAlternatingConfig` holds the gap fraction, the collective stops, and the optional pull. Images are inserted from both ends, starting at the reactant. A new image takes `alpha` of the minimum-image step from the current frontier toward the other side of the open gap. Frozen components of that step are cleared, so a frozen atom keeps the frontier coordinates, and the interior rows are then pinned to the reactant. Each insertion is followed by at most `short_iterations` quick-min steps, and a budget of no steps skips that stage. There is no further stage before the next insertion. The collective force on an interior image is the part of the IDPP force perpendicular to the simple tangent, plus `spring` times (the distance to the next image minus the distance to the previous image) along that tangent. The tangent is the unit minimum-image vector from the previous image to the next. The quick-min step is fixed, and it is not a field of `SidppAlternatingConfig`. A single velocity projection covers the whole interior, and `max_move` caps the per-atom displacement. A stage stops early when the largest absolute component of the free force is under `force_tol`. When every slot is filled and `reparametrize` is set, the band is placed at equal minimum-image arc length on the polyline, including a path with a single interior image. A final quick-min of at most `final_iterations` steps follows. A budget of no steps skips that final stage. When `pull_to_target` is set, each interior image is then minimized on the IDPP objective at its fraction of the finished path. `inverse_distance` selects the inverse-distance blend for every target, including that pull, and `pull` is the `IdppConfig` of the minimization. `n_images` counts the endpoints. An empty fixed mask moves every atom. The endpoints are copied through. The call is rejected when `alpha` is non-finite or outside the open unit interval, when `force_tol` or `spring` is non-finite or negative, when `max_move` is non-finite or not positive, when a fixed atom moves between the endpoints, or when `pull_to_target` is set and `pull` fails the `IdppConfig` checks. It also returns the shape and non-finite errors of `linear_path` |
| `sidpp_alternating_inverse_distance_path` | Inverse-distance form of `sidpp_alternating_path`. The call turns `inverse_distance` and `pull_to_target` on, then inserts, relaxes, and reparametrizes on that same loop, so neither flag can be left off for this entry point. Target pair distances at a path fraction are the reciprocal of the linear blend of the reciprocal endpoint distances. A short endpoint pair uses the IDPP floor in the denominators, and the distance is not left below that floor. The pull minimizes each interior image on its finished-path target and reads `pull`, which must be a usable `IdppConfig`. The errors are those of `sidpp_alternating_path`. This is not `geodesic_interpolate` |
| `geodesic_path`                | Geodesic interpolation on a caller supplied chart (Zhu, Thompson, and Martinez, J. Chem. Phys. 150, 164103 (2019)). `GeodesicConfig` and `MorsePairChart` are non-exhaustive. `geodesic_interpolate` builds the path from the two endpoints |
| `PathInitializer`              | Initial path selector (`Linear`, `Idpp`, `Sidpp`, `SidppAlternating`, `Trics`) for `initialize_path` and `ConnectConfig::path_initializer` (`None` keeps the built-in steepest-descent IDPP band; `Some` forwards the chosen initializer to `initialize_path`). `Sidpp` calls `sidpp_path`. `SidppAlternating` calls `sidpp_alternating_inverse_distance_path` when `inverse_distance` is set and `sidpp_alternating_path` otherwise, both with an empty frozen-atom mask. `TricsStartConfig` pairs a `TricsSeed` (`Linear` or `Idpp`) with `TricsConfig` |
| `trics_path`                   | Translation-rotation internal coordinates with splicing (TRICS). Builds per-image `TricSystem` charts (`tric_systems`) over `TricPrimitive` coordinates with `TricConfig`, scores the stability `diagnostic_matrix` (re-exported at the crate root as `tric_diagnostic_matrix`), selects overlapping `TricsSegment` intervals (`tric_segments`), inverts each segment (`interpolate_tric_segment` with `TricInversionConfig`), and splices to `TricsConfig::splice_tolerance` (`TRICS_SPLICE_TOLERANCE_ANGSTROM`), returning a `TricsReport` |
| `connect`                      | Double-ended search. The callback returns energy and the Cartesian gradient. `evaluations` counts finite differences that decide a step or an index. The Lanczos acceptance does not build a dense Hessian |

`SellaSaddleConfig` has options that follow Sella.
Each finite-difference diagonalization runs `symm=2` products in its residual test.
With `symmetrized_ritz` on, it takes its Ritz pairs from those products.
The option is off by default, and `SellaSaddleSession::set_symmetrized_ritz` sets it on a live session.
`small_system_atom_ceiling` bounds only the largest atom move, by Sella's `delta0` ceiling.
That bound applies from the first step of a Cartesian trust-region search with iterative diagonalization.
The search's radius `delta * n_free` must start at 1 or less.
The ceiling is on by default, and `SellaSaddleSession::set_small_system_atom_ceiling` sets it on a live session.

### Public Rust module index
Every public module exported by `src/lib.rs`, with its public types, free functions, and constants.

| Module | Public items |
| --- | --- |
| `afir` | Functions: `afir_force`, `try_afir_force` |
| `arc_path` | Types: `ArcPath`, `FixedEnergyTrajectory`, `PathFrame`, `PathGeometry`, `TrajectoryPoint`. Functions: `arc_at_time` |
| `art` | Types: `ArtBatch`, `ArtConfig`, `ArtDuplicate`, `ArtForceCall`, `ArtOutcome`, `ArtPhase`, `ArtReport`, `ArtReversibility`, `ArtSeed`, `ArtSession`, `ArtStatus`. Functions: `atom_mask`, `connection_verdict`, `full_mask`, `masked_direction`, `run_events`, `structure_distance`. `ArtSeed::direction` is `masked_direction` of its two arrays |
| `autoneb` | Types: `AutoNeb`, `AutoNebCut`, `AutoNebInterpolant`, `AutoNebReport`, `AutoNebSample`, `AutoNebStage`, `AutoNebStageLog`, `AutoNebStep`, `AutoNebTuning`. Functions: `worst_segment` |
| `band` | Types: `BandConfig`, `BandEvaluation`, `BandReport`, `BandSession`, `BandStatus`, `BandSurface`, `Cell`, `CiConfig`, `ExpBandPrecon`, `FeaNebReport`, `FeaNebSession`, `FreeEndConfig`, `FreeEndReport`, `FreeEndSide`, `GrowingStringConfig`, `GrowingStringPhase`, `GrowingStringReport`, `GrowingStringSession`, `MinModeRefine`, `SolidState`, `StringConfig`, `StringSession`, `ZoomConfig`. Functions: `climbing_image` |
| `block_cyclic` | Types: `BlockInertia`, `CyclicFactor`, `SolveReport`. Functions: `factor_cyclic`, `logdet_cyclic_blocks`, `logdet_cyclic_strict`. Constants: `SOLVE_REFINE_TOLERANCE`. Cyclic block-tridiagonal log absolute determinant and inertia. See [cyclic block factor](reference/block-cyclic.html) and [cyclic block factorization](explanation/cyclic-block.html) |
| `cell_log` | Types: `CellChart`, `CellState`, `M3`, `PackedHess`. Functions: `expm_3x3`, `expm_frechet`, `logm_3x3`, `m3_det`, `m3_from_row9`, `m3_inv`, `m3_mul`, `m3_to_row9`, `transform_cell_block` |
| `connect` | Types: `ConnectConfig`, `ConnectProfile`, `ConnectReport`. Functions: `connect` |
| `constraints` | Types: `Constraints`, `Equality`, `InternalCounts` |
| `covalent` | Functions: `atomic_number`, `covalent_radius`, `element_symbol`. Constants: `CORDERO_2008_PM`, `LAST_CORDERO_Z` |
| `direction_cover` | Types: `ArmFailure`, `ArmId`, `ArmOutcome`, `ArmPolicy`, `ArmRecord`, `ArmSuggestion`, `ArmTrial`, `AtomCoverage`, `CoverBudget`, `CoverageReport`, `DirectionCover`, `DirectionCoverConfig`, `ProductState`, `SaddleEntry`. Functions: `covering_radius_s2`, `sphere_cover` |
| `eigensolve` | Types: `EigenDevice`, `ExpandKind`, `RitzDecomposition`. Functions: `dense_logabsdet`, `eigh_on`, `exact_eigh`, `exact_eigvalsh`, `expand`, `faer_eigh`, `lowest_on`, `rayleigh_ritz`, `rayleigh_ritz_iter`, `relative_zero_tolerance`, `solve_dense`, `solve_dense_matrix`, `spd_logdet` |
| `elastic` | Types: `ElasticMultipole`, `LocalField`, `Octupole`, `Quadrupole`, `StrainGradient`. Functions: `quadrupole_energy` |
| `elastic_dipole` | Types: `AnisotropicGreen`, `AnisotropicGreenConfig`, `CorrectedEnergy`, `CorrectedRate`, `DefectDipole`, `ElasticConstants`, `ElasticCorrection`, `ElasticPairState`, `ElasticRate`, `GreenSecondDerivative`, `InteractionEstimate`, `PeriodicElastic`, `PeriodicElasticConfig`, `Tensor4` |
| `error` | Types: `SaddleError` |
| `field` | Types: `DefectSource`, `DirectSolver`, `FieldSolver`, `FmmSolver`, `Kelvin` |
| `force` | Types: `ForceGate` |
| `force_match` | Types: `ForceMatchOpts`, `ForceMatchReport`, `ForceMatchedHessian`, `PairKind`. Functions: `bond_hessian`, `covalent_pairs`, `covalent_radius`, `fit_bond_ks`, `force_match`, `force_match_hessian`, `force_match_on`, `project_force_match`, `retract_force_match`, `transport_force_match` |
| `geom` | Types: `SellaGeom`, `TrustSchedule`. Functions: `trust_update`, `u_t_h_u`, `u_t_vec`, `u_vec`, `update_trust` |
| `gpu` | Types: `GpuPolicy`. Functions: `clear_oom_floor`, `cuda_available`, `cuda_device`, `fail_next_cuda_claim`, `gpu_eigh`, `gpu_eigh_env`, `gpu_eigh_t`, `gpu_eigh_with`, `gpu_ok`, `gpu_ok_env`, `gpu_project`, `gpu_project_env`, `gpu_project_with`, `gpu_qr`, `gpu_qr_env`, `gpu_qr_with`, `lock_oom_for_test`, `oom_floor`, `record_oom`, `to_gpu`, `to_gpu_matrix`, `to_gpu_view`. Constants: `DEFAULT_MIN_DIM`, `GPU_MIN_DIM` |
| `hyperplane_ti` | With `ohtst`. Types: `ThermodynamicIntegrationConfig`, `ThermodynamicIntegrationEstimate`, `ThermodynamicIntegrationNode`. Functions: `restricted_thermodynamic_integration`, `thermodynamic_integration`. Constants: `THERMODYNAMIC_DERIVATIVE` |
| `idpp` | Types: `IdppConfig`, `PathInitializer`, `SidppAlternatingConfig`, `SidppConfig`, `TricsSeed`, `TricsStartConfig`. Functions: `idpp_path`, `idpp_path_fixed`, `initialize_path`, `linear_path`, `sidpp_alternating_inverse_distance_path`, `sidpp_alternating_path`, `sidpp_path` |
| `indexk` | Types: `BlockEigenKind`, `HessianProduct`, `IndexKConfig`, `IndexKReport`, `IndexKSession`, `WithHessian`. Functions: `indexk_step`, `reflect_force`, `translated_force` |
| `internal` | Types: `CartAxis`, `Displacement`, `InternalSlot`, `Rotation`, `Translation`. Functions: `pack_cart`, `seam_nrm2` |
| `io` | Types: `ConImage`, `ConSpecies`, `MolecularFrame`. Functions: `frame_from_con`, `frame_from_con_nth`, `frames_from_con`, `store_band`, `write_band`, `write_restart` |
| `irc` | Types: `IrcConfig`, `IrcDirection`, `IrcKind`, `IrcReport`, `IrcSession` |
| `json` | The JSON reader of the strain-response, LAMMPS thermostat and rgflux defect-pair records. Types: `Json`. Functions: `obj_get`, `parse_json`, `required_f64`, `required_matrix`, `required_str` |
| `kabsch` | Functions: `kabsch_f`, `kabsch_rmsd`, `kabsch_rotation`. Constants: `QUATERNION_TIE` |
| `kappa` | Types: `KappaDimerConfig`, `KappaDimerForce`. Functions: `kappa_dimer_force` |
| `lammps` | Types: `LammpsHyperplaneSampler`, `LammpsSamplerConfig`, `LammpsSystem`, `LammpsThermodynamicReference`, `LammpsThermostatKind`, `LammpsThermostatRecord` |
| `landscape` | Types: `CriticalPoint`, `LandscapeBoundKind`, `LandscapeConfig`, `LandscapeEdge`, `LandscapeSession`, `PathwayMap`. Constants: `DEFAULT_DUPLICATE_DISTANCE`, `DEFAULT_LANDSCAPE_MAX_EVALUATIONS`, `DEFAULT_LANDSCAPE_MAX_NODES`, `DEFAULT_LANDSCAPE_MAX_STEPS`, `DEFAULT_LANDSCAPE_PUSH` |
| `linalg` | Types: `NumericalHessian`. Functions: `hessian_vec_sign`, `lift_through`, `modified_gram_schmidt`, `numerical_hvp`, `numerical_hvp_on`, `numerical_hvp_proj`, `project_hvp`, `project_through`, `retract_hvp`, `symmetrize_vt_av`, `transport_hvp` |
| `line_neb` | Types: `EndpointBelowEnergy`, `FixedEnergySeed`, `LineNebConfig`, `LineNebEndpointViolation`, `LineNebReport`, `LineNebSession`, `LineNebStatus`. Functions: `fixed_energy_action`, `fixed_energy_action_force`, `fixed_energy_mep_seed` |
| `lineb` | Types: `Continuation`, `HqtstRate`, `LinebCalls`, `LinebConfig`, `LinebPath`, `LinebReport`, `LinebSession`, `LinebStatus`, `Masses`. Functions: `continue_from_mep`, `continue_from_mep_with_observer`, `continue_from_path_with_observer`, `hqtst_rate`, `hqtst_rate_interpolated_hessian` |
| `mass_metric` | Types: `MassMetric`, `MetricCovector`, `MetricPoint`, `MetricTangent` |
| `mass_weighted` | Types: `FixedCell`, `MassWeighted`. Functions: `mass_weighted_rigid_translations` |
| `mic` | Types: `Cell`. Functions: `wrap_difference` |
| `minmode` | Types: `ArtNConfig`, `FiniteDifference`, `KrylovBlock`, `MinModeConfig`, `MinModeKind`, `MinModeReport`, `MinModeSession`, `MinModeStatus`, `ModeEstimate`, `PointSurface`, `RaisedStep`. Functions: `halve_raised_energy`, `rotation_force_error`. Constants: `DEFAULT_ROTATION_ANGLE_TOL`, `MODE_RESET_ANGLE` |
| `nichols` | Types: `HessianUpdate`, `Index1Config`, `Index1Report`, `Index1Session`, `Index1Status`, `NicholsMode`. Functions: `bofill_update`, `cap_max_abs`, `nichols_displacement`, `nichols_step`, `powell_update`, `sym_eigh` |
| `npt` | Types: `NptConfig`, `NptReport`. Functions: `npt_lattice` |
| `occupancy` | Types: `SiteOccupancy`. Functions: `site_occupancy` |
| `ocineb` | Types: `OcinebConfig`, `OcinebPhase`, `OcinebReport`, `OcinebSession`, `OcinebStatus`. Functions: `backoff_threshold`, `initial_threshold`, `mode_alignment`, `should_trigger`, `success_threshold`, `walk_helped`. Constants: `MIN_ALIGNMENT` |
| `pes` | Types: `CartesianHessian`, `CartesianPes`, `HessUpdate` |
| `pes_internal` | Types: `CellCartesianPes`, `CellInternalPes`, `HessianCarry`, `InternalPes`, `RebuildReason`, `RebuildReport`, `SellaPes`. Functions: `niggli_reduce_cell`, `niggli_reduce_vectors`, `place_perp_dummy` |
| `placement` | Types: `SitePlacement`. Functions: `push_past`, `translate_onto_sites` |
| `prfo` | Types: `PartitionedRationalFunctionOptimization`, `PrfoKind`. Functions: `partitioned_rfo_eigen`, `prfo_get_s`, `prfo_stepper`, `prfo_trust_region`, `restricted_partitioned_rfo`, `restricted_prfo_displacement`. Constants: `SYNONYMS` |
| `prfo_restricted` | Types: `PrfoKind`. Functions: `partitioned_rfo_eigen`, `restricted_partitioned_rfo`, `restricted_prfo_displacement` |
| `projection` | Types: `ProjectionKind`. Functions: `climbing_image_force`, `dneb_component`, `force_perp` |
| `projector` | Types: `Hyperplane`, `HyperplaneCoordinates`, `HyperplaneEnsemble`, `HyperplaneModes`, `HyperplaneObservation`, `HyperplaneSampleBudget`, `HyperplaneSampler`, `ManifoldTangent`, `ProjectedConstraint`, `TangentProjector`, `UnitNormal`. Functions: `flux_mass`, `orthonormal_rows` |
| `qn` | Types: `HessUpdate`, `QuasiNewton`, `StepperKind`. Functions: `get_stepper`, `matches`, `qn_get_s`, `qn_restricted`, `qn_retract`, `qn_tangent`, `retract_qn`, `symmetrize_y`, `symmetrize_y_cols`, `symmetrize_y_pair`, `update_h`, `update_h_ms`, `update_hessian`, `update_hessian_cols`. Constants: `ALPHA0`, `ALPHA_MAX`, `ALPHA_MIN`, `NEWTON_SAFE`, `SLOPE`, `SYNONYMS` |
| `region` | Types: `AffineSymmetry`, `BoundaryViolation`, `CrystalSymmetryConfig`, `CrystalSymmetryOperation`, `CrystalSymmetryRegion`, `PathSlab`, `PeriodicSymmetryOperations`, `PlanarBoundary`, `Region`, `RegionIntersection`, `SymmetryOperations`, `SymmetrySource`, `SymmetryUniqueRegion`. Functions: `reflect_velocity` |
| `relax` | Types: `RelaxConfig`, `Relaxation`. Functions: `max_atom_force`, `relax_to_tolerance`. Constants: `DEFAULT_FORCE_TOL`, `DEFAULT_MAX_STEPS` |
| `reparam` | Types: `Reparametrization`, `Spline`, `SplineEnds`, `SplineSample`. Functions: `reparametrize`, `segment_lengths` |
| `restricted` | Types: `InternalWeights`, `MaxInternalStep`, `RestrictedAtomicStep`, `RestrictedKind`, `TrustRegion`. Functions: `cons_max`, `mis_clip`, `pack_weights`, `ras_cons`, `weights_for_equalities`, `weights_for_equalities_with`. Constants: `RAS_SYNONYMS`, `TRUST_SYNONYMS` |
| `rfo` | Types: `RationalFunctionOptimization`. Functions: `rfo_stepper`. Constants: `SYNONYMS` |
| `rtr` | Types: `BandForces`, `BandRtr`, `RtrConfig`, `RtrRadius`, `RtrReport`, `TcgResult`, `TcgStop`. Functions: `band_forces`, `reparametrize_equal_arc`, `reparametrize_equal_arc_in_cell`, `truncated_cg` |
| `saddle_index` | Types: `SaddleEscape`, `SaddleIndex`, `SaddleIndexCheck`. Functions: `saddle_index`. Constants: `NEGATIVE_CURVATURE_TOL` |
| `samd` | Types: `SamdConfig`, `SamdReport`, `SamdSession`, `VelocitySofteningConfig`, `VelocitySofteningReport`. Functions: `project_velocity`, `retract_samd`, `soften_velocity_on`, `t_exp`, `t_linear`, `transport_velocity`, `verlet_increment` |
| `seed_direction` | Types: `ModeSweepDirectionPlan`, `SoftModeDirectionPlan`. Functions: `hessian_mode_sweep_directions`, `mode_sweep_schedule`, `soft_mode_then_full_directions`, `spectral_gap_rank` |
| `sella_min` | Types: `SellaMinConfig`, `SellaMinReport`, `SellaMinSession` |
| `sella_saddle` | Types: `SellaSaddleConfig`, `SellaSaddleReport`, `SellaSaddleSession` |
| `solid_dimer` | Types: `CellMask`, `IndexCheck`, `IndexReport`, `JointChart`, `SolidDimer`, `SolidDimerConfig`, `SolidDimerReport`, `StressCheck`, `VineyardIndexError`, `VineyardIndexReport`. Functions: `certify_vineyard_pair`, `check_cauchy_stress`, `finite_difference_cauchy_stress`, `index_at`, `virial`. Constants: `STRAIN_VOIGT` |
| `solid_prefactor` | Types: `JointHessian`, `JointHessianConfig`, `JointVineyard`, `JointVineyardConfig`. Functions: `joint_hessian`, `joint_vineyard_prefactor` |
| `solid_state` | Functions: `cartesian_step`, `cell_neb_force`, `joint_displacement`, `orient_lower_triangular`, `solid_state_enthalpy`, `solid_state_jacobian` |
| `sparse_hessian` | Types: `Colouring`, `LowestEigenpairs`, `SparseHessian`, `SparseHessianOpts`, `SparsityPattern`. Functions: `distance2_colouring`, `eval_displacements`, `one_atom_hessian`, `prefactor_hessian`, `sparse_hessian` |
| `spline` | Types: `Spline`. Functions: `simpson_rule` |
| `spring` | Types: `EnergyReference`, `SpringForces`, `SpringKind`. Functions: `energy_weighted_constants`, `energy_weighted_constants_from`, `onsager_machlup_displacements`. Constants: `OM_RECIP_EPS` |
| `ssneb` | Types: `SolidImage`, `SolidNeb`. Functions: `joint_coordinate` |
| `stats` | Types: `EquilibrationReport`, `Rng`. Functions: `autocorr_time`, `batch_blocks`, `block_mean`, `equilibrate` |
| `stencil` | Types: `Action`, `ArtControl`, `BandBuilder`, `Chain`, `Climb`, `Controller`, `Coupling`, `CouplingForces`, `Delta`, `Euclidean`, `EvalPool`, `Fixed`, `FromBand`, `FromPoint`, `ImageId`, `Mesh`, `MeshEvent`, `Metric`, `Point`, `PointBuilder`, `Preset`, `Report`, `Role`, `Sides`, `Stencil`, `StencilReport`, `StencilStatus`, `StencilView`, `Surface`, `TangentRule`, `Triad`. Functions: `ascend`, `coupling_forces`, `coupling_forces_into`, `curvature_along`, `perp`, `perp_into`, `reflect`, `reflect_into`, `unit_tangent`, `unit_tangent_into`. Constants: `BAND_PRESET_SEAM`, `EVAL_BLOCK` |
| `strain_rate` | Types: `CurvatureBound`, `ElasticDipole`, `Estimate`, `HopVariant`, `SaddleSeed`, `SearchReason`, `Strain`, `StrainResponse`, `TranslationalSplit`, `Trust`, `TrustPolicy`. Functions: `activation_volume`, `angular_scale_rad_s`, `arrhenius`, `compliance_from_stiffness`, `cubic_rotations`, `double_dot`, `elastic_dipole`, `from_voigt`, `rotation_x`, `split_translational_modes`, `symmetrize`, `transform_tensor`, `vineyard_prefactor`, `voigt`. Constants: `BOLTZMANN_EV_PER_K`, `LINEAR_FOLD_EV`, `NEGATIVE_CURVATURE`, `VOIGT` |
| `tangent` | Types: `TangentKind`, `SplineTangents`. Functions: `compute_tangent`, `spline_tangents`, `spline_resample` |
| `topology` | Types: `AtomMap`, `DummyHost`, `InternalTopology`, `LinearBend`, `PlanarWatch`, `TopologyCheck`, `TopologyConfig`. Functions: `check_chart`. Constants: `PAPER_SV_TOL` |
| `trics` | Types: `TricConfig`, `TricInversionConfig`, `TricPrimitive`, `TricSystem`, `TricsConfig`, `TricsReport`, `TricsSegment`. Functions: `diagnostic_matrix`, `interpolate_tric_segment`, `tric_segments`, `tric_systems`, `trics_path`. Constants: `TRICS_SPLICE_TOLERANCE_ANGSTROM` |
| `trust` | Types: `RestrictedStep`, `TrustRegion` |
| `vocn` | Types: `Found`, `Primitive`, `VocnFound`, `VocnPrimitive` |

### Configuration fields and `with_*` builders
Every public configuration struct, its public fields, and the corresponding chainable `with_*` builder method.

| Configuration struct | Fields and builders |
| --- | --- |
| `AffineSymmetry` | `linear` (`with_linear`), `translation` (`with_translation`) |
| `AnisotropicGreenConfig` | `angular_points` (`with_angular_points`) |
| `ArtConfig` | `basin_rmsd` (`with_basin_rmsd`), `duplicate_rmsd` (`with_duplicate_rmsd`), `eigen_threshold` (`with_eigen_threshold`), `force_call_window` (`with_force_call_window`), `index_one_recovery_attempts` (`with_index_one_recovery_attempts`), `max_climbs` (`with_max_climbs`), `max_pushes` (`with_max_pushes`), `mode` (`with_mode`), `mode_overlap_tol` (`with_mode_overlap_tol`), `permute_identical` (`with_permute_identical`), `perpendicular` (`with_perpendicular`), `push_length` (`with_push_length`), `push_over` (`with_push_over`), `push_step` (`with_push_step`), `quench` (`with_quench`), `saddle` (`with_saddle`) |
| `ArtNConfig` | `activation_relaxations` (`with_activation_relaxations`), `basin_push` (`with_basin_push`), `basin_relaxations` (`with_basin_relaxations`), `curvature_floor` (`with_curvature_floor`), `eigenvalue_threshold` (`with_eigenvalue_threshold`), `lanczos_actions` (`with_lanczos_actions`), `lanczos_start` (`with_lanczos_start`), `relaxation_step` (`with_relaxation_step`) |
| `AutoNebTuning` | `climb` (`with_climb`), `climb_max_steps` (`with_climb_max_steps`), `full_band` (`with_full_band`), `interpolant` (`with_interpolant`), `local_force_tol` (`with_local_force_tol`), `local_max_steps` (`with_local_max_steps`), `n_max` (`with_n_max`), `n_simul` (`with_n_simul`), `record_samples` (`with_record_samples`), `space_energy_ratio` (`with_space_energy_ratio`), `threads` (`with_threads`), `trics` (`with_trics`) |
| `BandConfig` | `autoneb` (`with_autoneb`), `cell` (`with_cell`), `climbing` (`with_climbing`), `exp_precon` (`with_exp_precon`), `fixed_atoms` (`with_fixed_atoms`), `force_tol` (`with_force_tol`), `free_end` (`with_free_end`), `max_move` (`with_max_move`), `method` (`with_method`), `min_mode` (`with_min_mode`), `projection` (`with_projection`), `quickmin` (`with_quickmin`), `quickmin_options` (`with_quickmin_options`), `remove_rotation_and_translation` (`with_remove_rotation_and_translation`), `remove_translation` (`with_remove_translation`), `saddle_check` (`with_saddle_check`), `solid` (`with_solid`), `spring` (`with_spring`), `string` (`with_string`), `tangent` (`with_tangent`), `time_step` (`with_time_step`), `zoom` (`with_zoom`) |
| `CartesianPes` | `with_proj` (`CartesianPes::with_proj`, `set_proj`) |
| `CiConfig` | `trigger_factor` (`with_trigger_factor`), `trigger_force` (`with_trigger_force`) |
| `ConnectConfig` | `alpha0` (`with_alpha0`), `band_images` (`with_band_images`), `distance_step_max` (`with_distance_step_max`), `distance_step_min` (`with_distance_step_min`), `energy_difference_threshold` (`with_energy_difference_threshold`), `forcetol` (`with_forcetol`), `forcetol_per_distance` (`with_forcetol_per_distance`), `lanczos_iterations` (`with_lanczos_iterations`), `lanczos_rel_tol` (`with_lanczos_rel_tol`), `minimize_fmax` (`with_minimize_fmax`), `minimize_maxrise` (`with_minimize_maxrise`), `minimize_nsteps` (`with_minimize_nsteps`), `minmode_max_move` (`with_minmode_max_move`), `minmode_memory` (`with_minmode_memory`), `n_loops` (`with_n_loops`), `nhistx` (`with_nhistx`), `nsteps` (`with_nsteps`), `path_initializer` (`with_path_initializer`), `quench_nodes` (`with_quench_nodes`), `saddle_cosp` (`with_saddle_cosp`), `target_distance_other` (`with_target_distance_other`), `target_distance_saddle` (`with_target_distance_saddle`), `trusted_force_difference` (`with_trusted_force_difference`), `trustradius` (`with_trustradius`) |
| `Continuation` | `delta` (`with_delta`), `images` (`with_images`), `levels` (`with_levels`), `max_steps` (`with_max_steps`) |
| `CoverBudget` | `max_arms` (`with_max_arms`), `max_force_calls` (`with_max_force_calls`) |
| `CrystalSymmetryConfig` | `cell` (`with_cell`), `matching_tolerance` (`with_matching_tolerance`), `orbit_tolerance` (`with_orbit_tolerance`), `orthogonality_tolerance` (`with_orthogonality_tolerance`) |
| `CrystalSymmetryOperation` | `centre` (`with_centre`), `permutation` (`with_permutation`), `rotation` (`with_rotation`), `translation` (`with_translation`) |
| `CurvatureBound` | `fraction` (`with_fraction`), `lambda0` (`with_lambda0`), `slope` (`with_slope`) |
| `DirectionCoverConfig` | `art` (`with_art`), `art_max_steps` (`with_art_max_steps`), `batch` (`with_batch`), `cell` (`with_cell`), `cover_points` (`with_cover_points`), `cover_sweeps` (`with_cover_sweeps`), `ei_margin` (`with_ei_margin`), `kick_radius` (`with_kick_radius`), `kick_width` (`with_kick_width`), `length_scale` (`with_length_scale`), `minimum_energy_tol` (`with_minimum_energy_tol`), `minimum_rmsd_tol` (`with_minimum_rmsd_tol`), `policy` (`with_policy`), `saddle_energy_tol` (`with_saddle_energy_tol`), `saddle_rmsd_tol` (`with_saddle_rmsd_tol`) |
| `ExpBandPrecon` | `a` (`with_a`), `c_stab` (`with_c_stab`), `mu` (`with_mu`), `r_cut_factor` (`with_r_cut_factor`) |
| `FmmSolver` | `green` (`with_green`), `leaf` (`with_leaf`), `theta` (`with_theta`) |
| `FixedEnergySeed` | `images` (`with_images`), `max_evaluations` (`with_max_evaluations`), `saddle_energy` (`with_saddle_energy`), `target_energy` (`with_target_energy`) |
| `ForceMatchOpts` | `bond_scale` (`with_bond_scale`), `kinds` (`with_kinds`), `rcut_factor` (`with_rcut_factor`), `tvecs` (`with_tvecs`) |
| `FreeEndConfig` | `cubic` (`with_cubic`), `cut_force` (`with_cut_force`), `energy_tol` (`with_energy_tol`), `max_cuts` (`with_max_cuts`), `side` (`with_side`), `stability` (`with_stability`), `target_energy` (`with_target_energy`), `window_offset` (`with_window_offset`) |
| `GpuPolicy` | `enabled` (`with_enabled`), `min_dim` (`with_min_dim`) |
| `GrowingStringConfig` | `band` (`with_band`, `with_cell`, `with_climbing`, `with_fixed_atoms`, `with_force_tol`, `with_max_move`, `with_method`, `with_min_mode`, `with_quickmin`, `with_remove_translation`, `with_reparametrization`, `with_saddle_check`, `with_time_step`), `force_gate` (`with_force_gate`), `frontier_tol` (`with_frontier_tol`), `join_tol` (`with_join_tol`), `max_steps_per_node` (`with_max_steps_per_node`), `min_steps_per_node` (`with_min_steps_per_node`), `n_images` (`with_n_images`) |
| `HyperplaneObservation` | `constraint_force` (`with_constraint_force`), `jacobian` (`with_jacobian`), `observables` (`with_observable`), `pafi_gradient` (`with_pafi_gradient`), `position` (`with_position`), `projected_force` (`with_projected_force`), `projected_velocity` (`with_projected_velocity`) |
| `HyperplaneSampleBudget` | `coordinates` (`with_coordinates`), `lambda` (`with_lambda`), `observables` (`with_observable`), `positions` (`with_positions`), `region` (`with_region`), `samples` (`with_samples`), `seed` (`with_seed`), `stride` (`with_stride`), `thermal` (`with_thermal`), `thermalize` (`with_thermalize`) |
| `IdppConfig` | `grad_tol` (`with_grad_tol`), `max_iterations` (`with_max_iterations`), `max_move` (`with_max_move`), `memory` (`with_memory`) |
| `Index1Config` | `fd_dr` (`with_fd_dr`), `force_tol` (`with_force_tol`), `mode` (`with_mode`), `sparse_pattern` (`with_sparse_pattern`), `trust_radius` (`with_trust_radius`), `update` (`with_update`) |
| `IndexCheck` | `escape` (`with_escape`), `escapes` (`with_escapes`), `lowest` (`with_lowest`), `negative` (`with_negative`), `step` (`with_step`) |
| `IndexKConfig` | `block` (`with_block`), `k` (`with_k`), `max_block_iterations` (`with_max_block_iterations`), `residual_tol` (`with_residual_tol`), `search` (`with_search`) |
| `InternalPes` | `with_dummies` (`InternalPes::with_dummies`, `with_vocn`) |
| `InternalWeights` | `angle` (`with_angle`), `bond` (`with_bond`), `dihedral` (`with_dihedral`), `other` (`with_other`), `translation` (`with_translation`) |
| `IrcConfig` | `adaptive` (`with_adaptive`), `dr` (`with_dr`), `dx` (`with_dx`), `eigen_kind` (`with_eigen_kind`), `force_gate` (`with_force_gate`), `force_tol` (`with_force_tol`), `kick` (`with_kick`), `kind` (`with_kind`), `krylov_dim` (`with_krylov_dim`), `max_inner` (`with_max_inner`), `max_step` (`with_max_step`), `min_step` (`with_min_step`) |
| `JointHessianConfig` | `coordinate_step` (`with_coordinate_step`), `stationary_tolerance` (`with_stationary_tolerance`), `stress_step` (`with_stress_step`) |
| `JointVineyardConfig` | `mass_amu` (`with_mass_amu`), `mode_tolerance` (`with_mode_tolerance`) |
| `KappaDimerConfig` | `beta` (`with_beta`), `eigen` (`with_eigen`) |
| `LammpsSamplerConfig` | `excluded_modes` (`with_excluded_modes`), `friction_per_ps` (`with_friction_per_ps`), `library_path` (`with_library_path`), `thermodynamic_reference` (`with_thermodynamic_reference`), `thermostat` (`with_thermostat`), `time_step_ps` (`with_time_step_ps`) |
| `LammpsSystem` | `atomic_numbers` (`with_atomic_numbers`), `box_matrix` (`with_box_matrix`), `config_bytes` (`with_config_bytes`), `masses` (`with_masses`), `positions` (`with_positions`) |
| `LammpsThermodynamicReference` | `energy`, `gradient`, `hessian`, `point` (`LammpsThermodynamicReference::new`) |
| `LandscapeConfig` | `cell` (`with_cell`), `certificate` (`with_certificate`), `duplicate_distance` (`with_duplicate_distance`), `force_gate` (`with_force_gate`), `max_evaluations` (`with_max_evaluations`), `max_nodes` (`with_max_nodes`), `max_steps` (`with_max_steps`), `push` (`with_push`), `relax` (`with_relax`), `search` (`with_search`) |
| `LineNebConfig` | `endpoint_below_energy` (`with_endpoint_below_energy`), `endpoint_kappa` (`with_endpoint_kappa`), `energy` (`with_energy`), `force_tol` (`with_force_tol`), `masses` (`with_masses`), `reduced_planck` (`with_reduced_planck`), `spring_k` (`with_spring_k`), `time_step` (`with_time_step`) |
| `LinebConfig` | `boltzmann` (`with_boltzmann`), `endpoint_scale` (`with_endpoint_scale`), `gradient_end_tangents` (`with_gradient_end_tangents`), `hbar` (`with_hbar`), `max_move` (`with_max_move`), `method` (`with_method`), `opt_tol` (`with_opt_tol`), `perp_tol` (`with_perp_tol`), `quadrature_pairs` (`with_quadrature_pairs`), `spring` (`with_spring`), `time_step` (`with_time_step`), `turning_width` (`with_turning_width`) |
| `MinModeConfig` | `artn` (`with_artn`), `difference` (`with_difference`), `dr` (`with_dr`), `force_tol` (`with_force_tol`), `kind` (`with_kind`), `krylov_dim` (`with_krylov_dim`), `max_move` (`with_max_move`), `max_rotations` (`with_max_rotations`), `method` (`with_method`), `rotation_angle_tol` (`with_rotation_angle_tol`), `rotation_tol` (`with_rotation_tol`), `saddle_check` (`with_saddle_check`), `seed_curvature` (`with_seed_curvature`), `time_step` (`with_time_step`) |
| `MinModeRefine` | `alignment_tol` (`with_alignment_tol`), `climb_alignment` (`with_climb_alignment`), `curvature_retained` (`with_curvature_retained`), `difference` (`with_difference`), `dr` (`with_dr`), `kind` (`with_kind`), `krylov_dim` (`with_krylov_dim`), `lanczos_rel_tol` (`with_lanczos_rel_tol`), `max_rotations` (`with_max_rotations`), `max_steps` (`with_max_steps`), `min_overlap` (`with_min_overlap`), `refresh_interval` (`with_refresh_interval`), `restore_unhelpful` (`with_restore_unhelpful`), `retry_factor` (`with_retry_factor`), `rotation_angle_tol` (`with_rotation_angle_tol`), `rotation_tol` (`with_rotation_tol`), `stable_steps` (`with_stable_steps`), `trigger_factor` (`with_trigger_factor`), `trigger_force` (`with_trigger_force`) |
| `NptConfig` | `berendsen_tau_s` (`with_berendsen_tau_s`), `block_steps` (`with_block_steps`), `compressibility_per_ev_a3` (`with_compressibility_per_ev_a3`), `equilibration_steps` (`with_equilibration_steps`), `extension_steps` (`with_extension_steps`), `langevin_gamma_per_s` (`with_langevin_gamma_per_s`), `maximum_steps` (`with_maximum_steps`), `repeats` (`with_repeats`), `seed` (`with_seed`), `steps` (`with_steps`), `target_pressure_ev_a3` (`with_target_pressure_ev_a3`), `timestep_s` (`with_timestep_s`) |
| `OcinebConfig` | `angle_tol` (`with_angle_tol`), `band` (`with_band`), `max_mmf_steps` (`with_max_mmf_steps`), `minmode` (`with_minmode`), `restore_unhelpful` (`with_restore_unhelpful`), `stability_count` (`with_stability_count`), `trigger_factor` (`with_trigger_factor`), `trigger_force` (`with_trigger_force`) |
| `PeriodicElasticConfig` | `green` (`with_green`), `image_shells` (`with_image_shells`) |
| `RelaxConfig` | `force_tol` (`with_force_tol`), `initial_step` (`with_initial_step`), `max_atom_move` (`with_max_atom_move`), `max_steps` (`with_max_steps`), `method` (`with_method`) |
| `RtrConfig` | `fd_step` (`with_fd_step`), `kappa` (`with_kappa`), `max_cg` (`with_max_cg`), `radius_max` (`with_radius_max`), `reparametrization` (`with_reparametrization`), `theta` (`with_theta`) |
| `SaddleEscape` | `max_attempts` (`with_max_attempts`), `push` (`with_push`) |
| `SaddleIndexCheck` | `block` (`with_block`), `difference` (`with_difference`), `dr` (`with_dr`), `escape` (`with_escape`), `lowest` (`with_lowest`), `max_actions` (`with_max_actions`), `negative_tol` (`with_negative_tol`), `residual_tol` (`with_residual_tol`), `seed` (`with_seed`) |
| `SamdConfig` | `dt` (`with_dt`), `exponential` (`with_exponential`), `ngen` (`with_ngen`), `t0` (`with_t0`), `tau` (`with_tau`), `tf` (`with_tf`) |
| `SellaMinConfig` | `delta` (`with_delta`), `delta_min` (`with_delta_min`), `force_gate` (`with_force_gate`), `force_tol` (`with_force_tol`), `restricted` (`with_restricted`), `rho_dec` (`with_rho_dec`), `rho_inc` (`with_rho_inc`), `sigma_dec` (`with_sigma_dec`), `sigma_inc` (`with_sigma_inc`) |
| `SellaSaddleConfig` | `delta` (`with_delta`), `delta_min` (`with_delta_min`), `eig` (`with_eig`), `eigen_device` (`with_eigen_device`), `expand` (`with_expand`), `force_gate` (`with_force_gate`), `force_tol` (`with_force_tol`), `gamma` (`with_gamma`), `nsteps_per_diag` (`with_nsteps_per_diag`), `order` (`with_order`), `restricted` (`with_restricted`), `rho_dec` (`with_rho_dec`), `rho_inc` (`with_rho_inc`), `sigma_dec` (`with_sigma_dec`), `sigma_inc` (`with_sigma_inc`), `small_system_atom_ceiling` (`with_small_system_atom_ceiling`), `symmetrized_ritz` (`with_symmetrized_ritz`) |
| `SidppAlternatingConfig` | `alpha` (`with_alpha`), `final_iterations` (`with_final_iterations`), `force_tol` (`with_force_tol`), `inverse_distance` (`with_inverse_distance`), `max_move` (`with_max_move`), `pull` (`with_pull`), `pull_to_target` (`with_pull_to_target`), `reparametrize` (`with_reparametrize`), `short_iterations` (`with_short_iterations`), `spring` (`with_spring`) |
| `SidppConfig` | `force_tol` (`with_force_tol`), `max_iterations` (`with_max_iterations`), `max_move` (`with_max_move`), `rms_tol` (`with_rms_tol`), `spring` (`with_spring`), `time_step` (`with_time_step`) |
| `SolidDimerConfig` | `external_stress` (`with_external_stress`, `with_pressure`), `flat` (`with_flat`), `index` (`with_index`, `with_index_check`), `mask` (`with_mask`), `search` (`with_search`), `stress_check` (`with_stress_check`), `weight` (`with_weight`) |
| `SolidState` | `cells` (`with_cells`), `pressure` (`with_pressure`), `weight` (`with_weight`) |
| `SparseHessianOpts` | `difference` (`with_difference`), `memory_budget` (`with_memory_budget`), `skin` (`with_skin`), `step` (`with_step`) |
| `StrainResponse` | `with_multipoles`, `with_point_group`, `with_policy`, `with_prefactor`, `with_variants` |
| `StressCheck` | `absolute` (`with_absolute`, `with_tolerance`), `relative` (`with_relative`), `step` (`with_step`) |
| `StringConfig` | `reparametrization` (`with_reparametrization`) |
| `SymmetryOperations` | `operations` (`with_operations`) |
| `ThermodynamicIntegrationConfig` | `blocks` (`with_blocks`), `nodes` (`with_nodes`), `observable` (`with_observable`), `samples` (`with_samples`), `seed` (`with_seed`), `stride` (`with_stride`), `thermal` (`with_thermal`), `thermalize` (`with_thermalize`) |
| `TopologyConfig` | `back_transform_iterations` (`with_back_transform_iterations`), `back_transform_tol` (`with_back_transform_tol`), `bond_scale` (`with_bond_scale`), `dummy_distance` (`with_dummy_distance`), `linear_tol` (`with_linear_tol`), `max_weld_rounds` (`with_max_weld_rounds`), `planar_tol` (`with_planar_tol`), `require_complete` (`with_require_complete`), `sv_tol` (`with_sv_tol`), `weld_growth` (`with_weld_growth`) |
| `TricConfig` | `bond_factor` (`with_bond_factor`), `bonds` (`with_bonds`), `rank_tolerance` (`with_rank_tolerance`) |
| `TricInversionConfig` | `max_atom_move` (`with_max_atom_move`), `max_iterations` (`with_max_iterations`), `tolerance` (`with_tolerance`) |
| `TricsConfig` | `coordinates` (`with_coordinates`), `diagnostic_threshold` (`with_diagnostic_threshold`), `inversion` (`with_inversion`), `length_per_angstrom` (`with_length_per_angstrom`), `max_splice_iterations` (`with_max_splice_iterations`), `splice_tolerance` (`with_splice_tolerance`) |
| `TricsStartConfig` | `seed` (`with_seed`), `trics` (`with_trics`) |
| `TrustPolicy` | `curvature` (`with_curvature`), `error_tolerance` (`with_error_tolerance`), `floor` (`with_floor`), `quadratic` (`with_quadratic`), `radius` (`with_radius`) |
| `TrustSchedule` | `delta_min` (`with_delta_min`), `rho_dec` (`with_rho_dec`), `rho_inc` (`with_rho_inc`), `sigma_dec` (`with_sigma_dec`), `sigma_inc` (`with_sigma_inc`) |
| `VelocitySofteningConfig` | `displacement` (`with_displacement`), `mixing` (`with_mixing`), `steps` (`with_steps`) |
| `ZoomConfig` | `after` (`with_after`), `alpha` (`with_alpha`), `cubic` (`with_cubic`), `offset` (`with_offset`), `stability` (`with_stability`) |

## Rate-method types
The type references of the rate methods moved to rgflux with the methods:

- PAFI types: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/reference/pafi.org
- OH-TST types: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/reference/ohtst.org

## C ABI (feature `capi`)
This section lists the entry points, codes and flags of `include/rgsaddle.h`.
A C host reaches them through the application binary interface (ABI).
`RGSADDLE_ABI_MAJOR` is 1.
Status codes include `RGSADDLE_OK`, `RGSADDLE_SHAPE`, `RGSADDLE_SURFACE_FAILED`, `RGSADDLE_ABI_MISMATCH`, `RGSADDLE_NOT_EQUILIBRATED`, `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES` and, from minor 64, `RGSADDLE_NOT_CONVERGED`.
The methods on the wire are the fast inertial relaxation engine (FIRE) and quick-min.
Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) is also on the wire.
From minor 22 so is ODE12r (`RGSADDLE_METHOD_ODE12R`), the adaptive ordinary differential equation (ODE) step.
From minor 22, `rgsaddle_band_set_exp_precon` installs the per-image exponential metric on the band solver.
With ODE12r that gives ODE12r-Exp.
From minor 39, `rgsaddle_band_set_fixed_atoms` fixes atoms on a band and the exponential metric is then built on the free atoms; `rgsaddle_band_project_fixed` projects with the same mask.
From minor 40, a band, min-mode or OCI-NEB config stamped with that minor or newer certifies the saddle index of the converged point with the `rgsaddle_saddle_check_t` that `rgsaddle_saddle_check_default` fills.
`rgsaddle_band_set_saddle_check`, `rgsaddle_minmode_set_saddle_check` and `rgsaddle_ocineb_set_saddle_check` replace it, NULL for none, the matching `_saddle_index` calls read the certificate into an `rgsaddle_saddle_index_t`, and `rgsaddle_saddle_index` certifies one point.
Min-mode sessions estimate the mode by the dimer or by Lanczos.
For index-1 steps the header has `rgsaddle_nichols_step`, `rgsaddle_prfo_step` and `rgsaddle_index1_step`.
It also has `rgsaddle_hessian_powell`, `rgsaddle_hessian_bofill` and `rgsaddle_cap_max_abs` for those steps.
`rgsaddle_band_restart` and `rgsaddle_band_evaluation` use the band cache.
`rgsaddle_band_evaluation` returns `RGSADDLE_NO_EVALUATION` when nothing is cached at the band's positions.
A min-mode session is reused through three entry points.
They are `rgsaddle_minmode_set_position`, `rgsaddle_minmode_set_mode` and `rgsaddle_minmode_estimate`.
A Lanczos estimate advances one Hessian action and keeps the Krylov basis until `set_position`, `set_mode`, or `reset`.
That basis grows to the free dimension.
After k actions the mode lies in the k + 1 Lanczos vectors, with the Ritz value of the k as its curvature.
Each dimer estimate is the full rotation.
Dimer Polak-Ribiere history survives `set_position` and is cleared by `set_mode` and `reset`.
A failed callback leaves it unchanged.
`rgsaddle_minmode_config_t.difference` picks `RGSADDLE_DIFFERENCE_FORWARD` or `_CENTRAL`.
Its `rotation_angle_tol` field stops a dimer rotation once the optimal angle falls under this tolerance in radians.
For config minors 5 through 62 this field is read as given, so 0 disables the angle stop.
From minor 63, 0 keeps the Rust default unless flag bit 0, `RGSADDLE_MINMODE_EXPLICIT_ROTATION_ANGLE_TOL`, is set; then 0 disables it.
The Rust default is five degrees. With an explicit 0 (legacy minors, or minor 63 with the explicit flag) the stop is off.
Both fields are read only from a config whose version minor is 5 or newer.
`RGSADDLE_ABI_MINOR` is 72.
`rgsaddle_band_set_dynamic` (minor 65) sets or clears `DynamicNeb` on a band.
`rgsaddle_dyneb_mask` (minor 65) applies that mask to a projected band.
From minor 24, `rgsaddle_sella_saddle_set_symmetrized_ritz` sets `SellaSaddleConfig::symmetrized_ritz` from 0 or 1.
It returns `RGSADDLE_INVALID_PARAMETER` for any other value.
`rgsaddle_sella_saddle_set_small_system_atom_ceiling` (minor 25) sets `SellaSaddleConfig::small_system_atom_ceiling` from 0 or 1.
It returns `RGSADDLE_INVALID_PARAMETER` for any other value.
`rgsaddle_band_set_zoom` (minor 31) sets or clears Zoom-NEB on a band.
Recommended when enabled: `alpha` 0.5, `offset` 1, `after` 0 (twice `force_tol` on the largest per-image force), `stability` 5 and `cubic` 1.
Its window always reaches both neighbours of the climbing image, and the min-mode refinement waits for the zoom decision.
`rgsaddle_minmode_set_torque_window` (minor 32) calls `MinModeSession::set_torque_window` with -1, 0 or 1.
The value -1 infers the window as a new session does: on when `rotation_tol` is at least 1e-4 and the session is Lanczos or a dimer whose angle stop is off. 0 turns it off and 1 turns it on.
For config minors 5 through 62, `rotation_angle_tol` 0 keeps the angle stop off. From minor 63, `rotation_angle_tol` 0 keeps the Rust default unless `RGSADDLE_MINMODE_EXPLICIT_ROTATION_ANGLE_TOL` is set.
It returns `RGSADDLE_INVALID_PARAMETER` for any other value.
From minor 41 a Lanczos session reads it too.
From minor 46, -1 leaves the window off for an improved dimer with a positive `rotation_angle_tol`.
`rgsaddle_minmode_set_rotation_stop_length` (minor 38) calls `MinModeSession::set_rotation_stop_length`; 0 turns the stop off and a negative or non-finite length returns `RGSADDLE_INVALID_PARAMETER`.
From minor 43, `rgsaddle_artn_config_default` fills `rgsaddle_artn_config_t` with the published defaults and `rgsaddle_minmode_set_artn` enables them on a Lanczos session or disables them with NULL.
`rgsaddle_reparametrize` (minor 38) places a band at equal arc length with an `rgsaddle_reparametrization_t`, and band flag bit 4, `RGSADDLE_BAND_SPLINE_REPARAM`, puts the trust-region band on the not-a-knot spline.
From minor 44, band flag bit 5, `RGSADDLE_BAND_STRING`, runs the simplified string method of E, Ren, and Vanden-Eijnden (2007) (with `RGSADDLE_BAND_SPLINE_REPARAM` for the not-a-knot spline, or the polyline without it), and `rgsaddle_band_set_string` enables or clears it on a live band.
From minor 44, `rgsaddle_growing_string_config_default`, `rgsaddle_growing_string_create`, `rgsaddle_growing_string_step`, `rgsaddle_growing_string_n_images`, `rgsaddle_growing_string_nodes_added`, `rgsaddle_growing_string_phase`, `rgsaddle_growing_string_positions`, `rgsaddle_growing_string_ids`, `rgsaddle_growing_string_set_fixed_atoms`, `rgsaddle_growing_string_saddle_index`, and `rgsaddle_growing_string_free` expose the growing string method of Peters, Heyden, Bell, and Chakraborty (2004). The growing string `join_tol` uses -1.0 for no early join and treats zero as an inclusive zero-gap threshold.
From minor 45, `rgsaddle_band_set_free_end`, `rgsaddle_band_free_end_residual`, and `rgsaddle_band_free_end_cuts` expose the free-end adaptive NEB of Zhang, Zhang, Ye, and Zheng (2016). The call is a setter, not a flag. `rgsaddle_band_evaluation` returns that step's energies, gradients, and projected interior forces. A host checks `rgsaddle_abi_version()` for minor 45 or newer. The worked example is `tests/free_end_neb.rs`.
From minor 47, `rgsaddle_lineb_config_default` and `rgsaddle_lineb_solve` expose fixed-energy LI-NEB and harmonic quantum TST. `rgsaddle_lineb_config_t` holds `opt_tol`, `perp_tol`, `spring`, `endpoint_scale`, `time_step`, `max_move`, `turning_width`, `hbar`, `boltzmann` and `quadrature_pairs`. `rgsaddle_lineb_result_t` holds `action`, both half periods and temperatures, `log_rate_over_reactant`, and the optimizer, measure, dynamics and rate call counts. Positions are contiguous image, atom, xyz. `molecular` 0 expands atom masses onto Cartesian coordinates without alignment; `molecular` 1 uses molecule alignment. `beads` 0 is path-only with a NaN log rate. Unconverged searches return `RGSADDLE_STALLED`. A host checks `rgsaddle_abi_version()` for minor 47 or newer. The smoke test is `tests/c/lineb_abi.c`.
From minor 47, `RGSADDLE_LINEB_PROJECTED_VERLET` `(1u << 2)` on `rgsaddle_lineb_solve_options` selects the projected Verlet band integrator (`with_projected_verlet`).
The feature macro `RGSADDLE_HAS_LINEB_RATE_DIAGNOSTICS` advertises
`rgsaddle_lineb_solve_counted_diagnostics`. Its final two optional signed
64-bit outputs give the number of negative and total retained fluctuation
modes. Each reports `-1` for a path-only or failed solve.

From minor 60, `rgsaddle_band_set_refine` installs or clears the per-step L-BFGS refine stepper, and `rgsaddle_band_is_refining` reports whether the last first-order step used it. A host checks `rgsaddle_abi_version()` for minor 60 or newer. The worked example is `tests/band_refine.rs`.
From minor 68, `rgsaddle_autoneb_run` grows an AutoNEB band to completion. `rgsaddle_autoneb_config_t` and `rgsaddle_autoneb_report_t` are the inputs and the result. `RGSADDLE_AUTONEB_CLIMB`, `RGSADDLE_AUTONEB_IDPP`, and `RGSADDLE_AUTONEB_KEEP_TRANSLATION` are the flag bits. The callback stays on the calling thread.
The request flags are `RGSADDLE_REQ_ONE_IMAGE` (bit 0) and `RGSADDLE_REQ_CLIMBING_IMAGE` (bit 1).
From a band config at minor 22, the refinement's one-image requests also set bit 1.
Their `image` is then the climbing image's band index.
`rgsaddle_idpp_path` writes the image-dependent pair potential initial path with its endpoints.
It takes a row-major cell or NULL.
From minor 64, `rgsaddle_geodesic_config_default`, `rgsaddle_geodesic_path`, and `rgsaddle_geodesic_morse` interpolate a path in a redundant coordinate chart (Zhu, Thompson, and Martinez, J. Chem. Phys. 150, 164103 (2019), doi:10.1063/1.5090303). `rgsaddle_geodesic_path` takes a host chart. `rgsaddle_geodesic_morse` uses Eq. (7) with alpha 1.7 and beta 0.01. A NULL config selects the defaults, including an image cap of 32, so it requires `n_images` of at least 32. A supplied cap above `n_images` is `RGSADDLE_INVALID_PARAMETER`.
From minor 66, `rgsaddle_trics_path` refines an image-major unwrapped Cartesian path in translation-rotation internal coordinates with splicing and writes the refined path to `out` (which may alias `initial` for in-place refinement). Its length controls are in angstrom and `length_per_angstrom` converts the caller's coordinates.
From minor 69, `rgsaddle_landscape_config_default`, `rgsaddle_landscape_create`, `rgsaddle_landscape_run`, `rgsaddle_landscape_node`, `rgsaddle_landscape_modes`, `rgsaddle_landscape_edge`, and `rgsaddle_landscape_free` expose the downward pathway search. `RGSADDLE_LANDSCAPE_BOUND` reports a node or evaluation limit and does not return a pathway. `rgsaddle_landscape_run` takes the geometry-aware Hessian action `rgsaddle_hessian_at_fn`, which minor 69 also adds with `rgsaddle_indexk_step_at`. `rgsaddle_hessian_fn` keeps its original signature from minor 37. `rgsaddle_landscape_report_t` has `flags` after `version`. The worked example is `tests/landscape.rs`.
From minor 70, `RGSADDLE_TANGENT_SPLINE` on `rgsaddle_band_project` and `rgsaddle_band_step` assembles the cubic-spline tangent and curvature spring, and `rgsaddle_spline_resample` places the interior images at equal steps of the normalized chord length. A band session refuses that tangent together with the simplified string, a solid-state cell, free-end adaptive NEB, or the exponential metric.
`rgsaddle_ocineb_step` reports the hand-off phase (band, tangent alignment, or minimum-mode translation).
`rgsaddle_connect` runs the double-ended search of `connect` to completion on two endpoint arrays and a host surface.
The surface writes energy and the Cartesian gradient for one image.
`rgsaddle_connect_report_t` carries the energy and the Euclidean gradient norm of the search.
It also carries the kind (`s`, `u`, or `f`), the Hessian index and the evaluation count.
That count includes the finite differences that decide a step or an index.
The Lanczos acceptance does not build a dense Hessian.
`howto/fortran` wraps this ABI for Fortran with finalizer-backed handles for band, min-mode, PAFI, and OH-TST sessions (`rgsaddle_pafi_*` and `rgsaddle_ohtst_*`, ABI minor 72).
Band flag bit 2 is `RGSADDLE_BAND_CI_AFTER`.
It arms the climbing image under `ci_trigger_force` or `ci_trigger_factor` times the first force.
Either of the two may be 0.
From minor 21, band flag bit 3 is `RGSADDLE_BAND_NO_MIN_MODE`.
It turns off the min-mode refinement of the climbing image.
Otherwise the refinement runs and reports its curvature in `rgsaddle_report_t.curvature`.
`RGSADDLE_STALLED` reports a band step that left the band unchanged above `force_tol`.
From minor 42, `RGSADDLE_NOT_EQUILIBRATED` and `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES` report constrained-ensemble tails that fail the drift guard or the effective-sample floor.
On the band, `RGSADDLE_METHOD_QUICKMIN` runs quick-min, and a min-mode session returns null for that code.
`rgsaddle_band_set_quickmin_variant` selects `RGSADDLE_QUICKMIN_RGMIN`, `_EON` or `_PER_ATOM`.
`rgsaddle_band_create_solid` builds a solid-state band.
`rgsaddle_band_step_solid` steps it on an `rgsaddle_solid_surface_fn`.
Cells go in and Cauchy stresses come out through `rgsaddle_solid_surface_request_t`.
`rgsaddle_band_cells` and `rgsaddle_band_solid_jacobian` read the solid-state band back.
The report's `evaluations` field took the place of `reserved` at minor 5.
`cargo cinstall` installs `include/rgsaddle.h` as written.

## Fortran module (meson `-Dfortran=enabled`)
`fortran/rgsaddle.f90` defines the Fortran 2008 module `rgsaddle` on top of `include/rgsaddle.h` at ABI major 1, minor 72 (`RGSADDLE_ABI_MAJOR = 1`, `RGSADDLE_ABI_MINOR = 72`). Meson installs `librgsaddle_fortran.a`, `include/rgsaddle/fortran/rgsaddle.mod`, `rgsaddle-fortran.pc`, and the relocatable CMake package `rgsaddleFortran` (imported target `rgsaddle::fortran`). `librgsaddle` itself is built by cargo (`--features capi`). Narrative and runnable programs are in [howto/fortran](howto/fortran.html).

| Item | Role |
| --- | --- |
| `band_handle` | Owning NEB session. `create(config, n_images, n_atoms, positions)`, `step(callback[, user, out])`, `step_c(surface[, user, out])`, `positions(positions)`, `move_from(src)`, `release()`, scope-exit finalizer. Empty handle returns `RGSADDLE_NULL_BAND` |
| `minmode_handle` | Owning dimer or Lanczos session. `create(config, n_atoms, position, mode)`, `step(callback[, user, out])`, `step_c(surface[, user, out])`, `position(position)`, `mode(mode)`, `move_from(src)`, `release()`, scope-exit finalizer. Empty handle returns `RGSADDLE_NULL_SESSION` |
| `pafi_handle` | Owning PAFI session. `create(config, n_frames, n_dof, frames[, arcs])`, `set_config(config)`, `run(callback[, user])`, `run_c(surface[, user])`, `result(out)`, `profile(arcs, gradients, gradient_errors, free_energy, free_energy_errors[, written])`, `move_from(src)`, `release()`, scope-exit finalizer |
| `ohtst_handle` | Owning OH-TST session. `create(config, n_dof, point, normal)`, `set_config(config)`, `run(callback[, user])`, `run_c(surface[, user])`, `result(out)`, `curve(times, kappa_of_t[, written])`, `move_from(src)`, `release()`, scope-exit finalizer |
| `assignment(=)` | Overloaded on all four handle types; executes `error stop RGSADDLE_HANDLE_NOT_ASSIGNABLE` (17) so raw C session pointers are never copied |
| `init_band_config`, `init_minmode_config`, `init_pafi_config`, `init_ohtst_config` | Populate default settings and stamp `version` with `abi_stamp`. `init_minmode_config(config[, kind])` defaults to `RGSADDLE_MINMODE_DIMER` and sets the five-degree `rotation_angle_tol` |
| `abi_stamp`, `status_name`, `uint64_bits` | Stamp an `rgsaddle_version_t`, map a status code to an allocatable `character(len=:)` (`UNKNOWN` when unmapped), and pack two 32-bit halves `(high, low)` into a signed `c_int64_t` bit pattern for C `uint64_t` seeds |
| `surface_proc` | Abstract interface `(user, n_images, n_atoms, positions, energies, gradients, image) -> c_int`. `n_images` is the evaluated row count (`1` for `RGSADDLE_REQ_ONE_IMAGE`); `image` is the zero-based band index or `-1` for a batch |
| `point_surface_proc` | Abstract interface `(user, n_dof, position, energy, gradient) -> c_int`. Invoked from worker threads during PAFI and OH-TST runs; implementations must be thread-safe and `recursive` |
| `rgsaddle_version_t`, `rgsaddle_surface_request_t`, `rgsaddle_band_config_t`, `rgsaddle_minmode_config_t`, `rgsaddle_report_t`, `rgsaddle_pafi_config_t`, `rgsaddle_pafi_result_t`, `rgsaddle_ohtst_config_t`, `rgsaddle_ohtst_result_t` | `bind(C)` wire structs matching `include/rgsaddle.h` |
| Status and mode constants | `RGSADDLE_OK` through `RGSADDLE_STALLED`, `RGSADDLE_NOT_EQUILIBRATED` (-14), `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES` (-15), `RGSADDLE_STATUS_RUNNING`, `RGSADDLE_STATUS_CONVERGED`, `RGSADDLE_METHOD_FIRE`, `RGSADDLE_METHOD_LBFGS`, `RGSADDLE_MINMODE_DIMER`, `RGSADDLE_MINMODE_LANCZOS`, `RGSADDLE_OHTST_INTEGRATOR_BAOAB`, `RGSADDLE_OHTST_INTEGRATOR_GHMC`, `RGSADDLE_OHTST_COUNT_FINAL`, `RGSADDLE_OHTST_COUNT_FIRST_CROSSING`, `RGSADDLE_BAND_PER_IMAGE`, `RGSADDLE_REQ_ONE_IMAGE`, `RGSADDLE_HANDLE_NOT_ASSIGNABLE` |

Fortran arrays map onto the row-major C buffers without transposing when coordinate dimensions precede the image or frame dimension: `(3, n_atoms, n_images)` for bands and `(n_dof, n_frames)` for PAFI. `rgsaddle_report_t%ci_index` and `rgsaddle_pafi_result_t%dividing` are zero-based C indices. `pafi_handle%profile` and `ohtst_handle%curve` pass the minimum slice length as capacity; when shorter than the stored series, they return `RGSADDLE_INVALID_PARAMETER` and write the required length to `written`. Trampolines store the callback and `user` pointer per call with no module state, allowing nested sessions and concurrent worker callbacks.

## Python package
The importable package is `rgsaddle`. `rgsaddle._core` is the nanobind extension. `import rgsaddle` does not import ASE.

| Name | Role |
| --- | --- |
| `ForceGate`, `HessUpdate`, `IrcKind`, `MinModeKind`, `EigenDevice`, `ExpandKind`, `CellChart`, `RestrictedKind` | `enum.IntEnum` controls. Names and values match the previous module |
| `NumericalError` | `ArithmeticError` for `RGSADDLE_NON_FINITE` |
| `last_error` | Thread-local text reserved for the C ABI last-error call. Empty unless an error text was set. `raise_status` reads it and then clears the slot |
| `raise_status` | Map an `rgsaddle_status_t` value. The message is the stored text, or the status name when that text is empty. `RGSADDLE_OK` returns true |
| `rgsaddle.ase.SurfaceAdapter` | `list[Atoms]` evaluated as `(ids, x) -> (energies, gradients)` request rows (`claim`, `owners`, `reentrant`, `__call__`). Optional extra `ase` |
| `rgsaddle.Stencil` | Point search. `point`, `band`, `step`, `run`, `positions`, `mode`, `curvature`. `band` raises `ValueError` because band presets are not implemented. Step report is `StencilReport` (`status`, `max_force`, `curvature`, `iteration`, `evaluations`, `converged`) |
| `rgsaddle.__version__` | Package version string returned by `rgsaddle._core.version` |
| `rgsaddle.THERMODYNAMIC_DERIVATIVE` | Observable name `potential.full_minus_harmonic` used by `rgsaddle.hyperplane_thermodynamic_integration` |
| `rgsaddle.hyperplane_thermodynamic_integration` | Constrained hyperplane thermodynamic integration, BAR, MBAR, and PAFI profile estimation from hyperplane sample batches |
| `rgsaddle.saddle_index` | Standalone point saddle-index certification on a callback surface, returning `SaddleIndex` (`certified`, `index`, `converged`, `curvatures`, `evaluations`, `total_evaluations`, `escapes`) |
| `rgsaddle.reparametrize` | Equal-arc-length reparametrization of a path with `scheme="linear"` or `"not-a-knot"` (`"spline"`) |
| `rgsaddle.spline_resample` | Interior images at equal steps of the normalized cumulative chord length on the not-a-knot cubic (ABI minor 70) |
| `rgsaddle._core` | Extension symbols: `ClaimSlot` (`__enter__`, `__exit__`), `MinMode` (`estimate`, `step`, `set_position`, `position`, `mode`, `saddle_index`, `set_saddle_check`), `SellaSaddle` (`step`, `position`), `version`, `project_band`, `dyneb_mask`, `halve_raised_energy`, `trust_update`, `RGSADDLE_FORCE_L2`, `RGSADDLE_FORCE_LINF`, `RGSADDLE_FORCE_MAX_ATOM`, `RGSADDLE_MINMODE_DIMER`, `RGSADDLE_MINMODE_LANCZOS`, `RGSADDLE_IRC_GS2`, `RGSADDLE_IRC_MOROKUMA`, `RGSADDLE_IRC_SELLA_SPHERE` |
| `rgsaddle.ase.NEB`, `AutoNEB`, `MinModeAtoms`, `Sella`, `saddle_index` | ASE drop-in wrappers for nudged elastic band (`interpolate`, `get_positions`, `set_positions`, `get_potential_energy`, `get_forces`, `saddle_index`), AutoNEB (`run` returns `AutoNEBReport` (`status`, `max_force`, `ci_index`, `surface_rows`, `n_images`, `iteration`, `positions`, `images`)), minimum-mode effective forces (`get_forces`), order-1 Sella optimization (`attach`, `run`), and saddle-index certification |
| `rgsaddle.connect` | Run-to-completion double-ended search. `surface(x)` is the one-image `(energy, gradient)` callback. `ConnectReport` holds `position`, `energy`, `force_norm`, `kind`, `hessian_index`, and `evaluations` |
| `rgsaddle.lineb_solve` | Fixed-energy LI-NEB path and optional harmonic rate. `positions` is `(n_images, 3N)`, `atom_masses` one mass per atom, `molecular` selects coordinate expansion or molecule alignment, `beads=0` leaves `log_rate_over_reactant` as NaN. `LinebResult` holds `positions`, `action`, half periods, temperatures, call tallies, and the log rate |
| `rgsaddle.Band` | Stepping NEB, simplified-string (`string=True`, `reparametrization`), and free-end adaptive NEB session. `step`, `run`, `positions`, `set_positions`, `evaluation`, `set_string`, `set_free_end`, `target_energy_residual`, `free_end_cuts`, `set_fixed_atoms`, `saddle_index`, `set_saddle_check`, `restart`, `reset` |
| `rgsaddle.GrowingString` | Stepping growing-string session (Peters et al. 2004) with hand-off to `StringSession` upon join. `step`, `run`, `n_images`, `nodes_added`, `joined`, `positions`, `ids`, `set_fixed_atoms`, `saddle_index` |
| `rgsaddle.SessionReport` | Step report of `Band`, `GrowingString`, `MinMode`, and `SellaSaddle` (`status`, `max_force`, `curvature`, `iteration`, `evaluations`, `ci_index`, `rotations`, `saddle_index`) |
| `rgsaddle.ase.SimplifiedString` | ASE `Optimizer` driver and `Optimizable` for the simplified string method over `list[Atoms]` (`attach`, `interpolate`, `get_positions`, `set_positions`, `get_potential_energy`, `get_forces`, `run`, `saddle_index`), with `FixAtoms` and optional climbing image |
| `rgsaddle.ase.GrowingString` | ASE driver for the growing string method over `list[Atoms]` (`attach`, `run`, `saddle_index`), preserving image IDs and batched calculator evaluation |
| `rgsaddle.ase.Point` | ASE `Optimizer` driver for one point preset (`attach`, `run`). `run(fmax, steps)` is ASE's own loop |
| `rgsaddle.ase.NEB` | ASE's band call. `k` is a scalar or one value per spring. `method` is `improvedtangent`, `aseneb`, `eb`, `dneb`, `spline`, or `string`. `spline` is the cubic-spline tangent and curvature spring. `string` uses that tangent with no spring and redistributes interior images on `set_positions`. `precon` and the DyNEB keywords `dynamic_relaxation`, `fmax`, and `scale_fmax` raise `NotImplementedError`. `interpolate(method='idpp')` and `idpp_interpolate` run `idpp_path`. `get_residual` is the largest absolute force component on the interior images. `get_forces` stores the infinity norm, a call before that raises `RuntimeError`, and the climbing image is omitted only when one was chosen |
| `rgsaddle.ase.NEBOptimizer` | ASE's band optimizer. `method` is `ODE` (adaptive ODE12r), `static` (step `alpha`), or `krylov` (stored, and `run` raises `ValueError`). The constructor lowercases `method`. `run` does not. `run(fmax, steps)` stops on `NEB.get_residual`. The static loop returns false when `steps` is spent. The ODE path returns false only on `OptimizerConvergenceError` |
| `rgsaddle.ase.SingleCalculatorNEB` | ASE's deprecated shared-calculator band. Constructing it warns with ASE's `FutureWarning` and is `NEB(allow_shared_calculator=True)` |
| `rgsaddle.ase.DyNEB` | ASE 3.29 dynamic NEB. `dynamic_relaxation` (default true) leaves an image in place once its per-atom force is below `fmax`. `scale_fmax` scales that test by the distance from the highest-energy image. `dynamic_relaxation` false is the ordinary band |
| `rgsaddle.idpp_path` | Image-dependent pair-potential path, endpoints included, shape `(n_images, 3N)`. `cell` is the 3x3 row-major lattice |
| `rgsaddle.ase.DimerControl`, `MinModeAtoms`, `MinModeTranslate` | ASE's dimer. The mode and curvature come from `MinMode`. The trial step and conjugate gradient are ASE's. `order` other than 1 and a gauss displacement raise `NotImplementedError` |

`SurfaceAdapter` keeps `get_forces(apply_constraint=False)` on `raw_forces`. The returned gradient is minus `get_forces()` after constraints. The adapter evaluates the given rows in order on the calling thread. `owners()` and `reentrant()` are what a driver uses to group. A second call while the first holds the adapter raises `RuntimeError`.

## Tests that pin the contract
- `tests/ocineb.rs` — the hand-off waits for a stable climbing image, restores it when the curvature is positive, and reaches the same double-well saddle as a climbing-image band. `tests/ocineb_abi.rs` runs `tests/c/ocineb_abi.c`
- `tests/connect_driver.rs` — two-barrier toy, the C ABI, LJ38 pair 0 and pair 39, and ignored release samples of the 51-pair connect score and the CI-NEB templates on 20 pairs
- `tests/double_well.rs` — band finds the origin saddle, endpoints pinned
- `tests/simplified_string.rs` — simplified string method of E, Ren, and Vanden-Eijnden (2007) on Müller-Brown (spline vs linear MEP and both saddles against analytic Newton and CI-NEB), across `FIRE`, `L-BFGS`, `QuickMin`, `Bb`, and `ODE12r`, with fixed atoms, periodic cells, exponential preconditioning, image threads, and step guards
- `tests/growing_string.rs` — growing string method of Peters, Heyden, Bell, and Chakraborty (2004) on a 2D curved channel with a central obstacle and on Müller-Brown against CI-NEB, verifying frontier tangent constraints, configurable node-add criteria, separate fragment relaxation, join hand-off to `StringSession`, and preserved `ImageIds` and batching
- `tests/free_end_neb.rs`: free-end adaptive NEB of Zhang, Zhang, Ye, and Zheng (2016) and Zhu et al. (2007) on a narrow barrier along a long tilted valley (`FreeEndSide::Last` and `FreeEndSide::First`), recovering the fixed-end CI-NEB saddle and barrier height with a third as many images, plus C ABI and Python parity.
- `tests/band_refine.rs`: a FIRE band steps with L-BFGS when the convergence force is at or under the `StepRefine` threshold and keeps the primary stepper otherwise. `tests/band_refine_abi.rs` runs `tests/c/band_refine_abi.c`.
- `tests/softmode_seeding.rs`: soft-mode-subspace-first direction seeding (`soft_mode_then_full_directions`, `spectral_gap_rank`) against isotropic random starts on coupled wells and Müller-Brown.
- `tests/makri_vacancy.rs` — Makri, Ortner, and Kermode (2019) Table II 107-atom Morse Cu fcc vacancy counts for ODE12r and ODE12r-Exp, plus simplified string (spline, linear, and climbing spline) barrier parity with NEB
- `tests/autoneb.rs` — ASE AutoNEB decisions and the Müller-Brown insertion sequence. `tests/autoneb_gate.rs` hashes the insertion list and the trajectory at 1, 2, 3 and 8 threads, and an ignored release run compares AutoNEB with CI-NEB at one force-call budget. Strong scaling of a full AutoNEB run is an ignored test in the crate.
- `tests/autoneb_abi.rs` runs `tests/c/autoneb_abi.c`: `rgsaddle_autoneb_run` on a double well reports `status` 1 with `max_force` under the stop and a repeatable `iteration` count, reports `status` 0 and `iteration` equal to the step budget when the climb is cut short, and returns `RGSADDLE_INVALID_PARAMETER`, `RGSADDLE_NULL_SURFACE`, `RGSADDLE_SHAPE`, `RGSADDLE_NON_FINITE`, `RGSADDLE_ABI_MISMATCH`, and `RGSADDLE_SURFACE_FAILED` for the matching bad inputs.
- `tests/minmode_saddle.rs` — dimer / Lanczos
- `tests/band_workspace.rs`: a warm band step allocates as often at 13
  images as at 5, for five spring, projection and optimizer settings,
  and the trajectories keep the hashes of the allocating code.
- `tests/band_image_threads.rs`: trajectories and surface rows at 2, 3,
  8 and 16 image threads are bitwise those of one thread, each call is
  split into contiguous blocks, the first failing image is reported, and
  zero threads is refused.
- `tests/band_repeat_evaluations.rs`: no band reaches the surface twice
  under the trust-region stepper on coupled double wells or under ODE12r
  on LJ38 through its stall.
- `tests/minmode_workspace.rs`: outside the surface,
  a dimer estimate allocates as often at eight rotations as at two,
  and Lanczos as often at eight Krylov products as at two,
  and five searches keep the hashes of the allocating code.
- `tests/nichols_saddle.rs` — Nichols step against i-PI on the same Hessian and gradient, Muller-Brown saddles, quadratic saddle
- `tests/prfo_saddle.rs` — partitioned RFO against the augmented Hessian, trust sphere changes the mode ratio
- `tests/sella_symmetrized_ritz.rs`: the Sella saddle walk on a linear gradient field with an antisymmetric Jacobian part.
  With the atom ceiling off, the walk keeps its evaluation counts and positions bit for bit.
  `symmetrized_ritz` stops the first finite-difference diagonalization two evaluations sooner.
- `tests/sella_atom_ceiling.rs`: a six-coordinate Cartesian saddle search with `small_system_atom_ceiling` on.
  No atom moves past the ceiling from the first step, and the ceiling never passes its starting Euclidean radius.
  The search still reaches the saddle.
  A twelve-coordinate search and a search without iterative diagonalization step the same with the option on or off.
  The default takes the ceiling.
- `tests/c_abi.rs` — header and symbols with `capi`
- `tests/fortran/` and `ci/fortran_abi.sh` — Fortran 2008 module, relocatable pkg-config and CMake consumers, static archive link, handle move/release and non-assignability, NEB (batch and per-image), dimer, Lanczos, PAFI 1D and 2D widening barriers, OH-TST aligned and tilted planes under BAOAB and GHMC, optional and forwarded `user` pointers on `step`, `step_c`, `run`, and `run_c`, nested outer band, min-mode, PAFI, and OH-TST re-entrancy, and the documented runnable examples under `-std=f2008 -Wall -Wextra -Werror -fcheck=all`
- `tests/solid_bain_lj.rs` — `tests/c/solid_bain_lj.c` runs the solid-state band from bcc to fcc for switched LJ on the two-atom tetragonal cell through `rgsaddle_band_create_solid`; the climbing image matches the relaxed scan of `validation/bain_lj_reference.py` in c/a within 2.5e-4 and in barrier within 1.2e-6 eV/atom, and every image keeps a diagonal tetragonal cell and its fractional coordinates
- `tests/solid_dimer_barrier.rs` — the variable-cell dimer and the solid-state band meet on the shear-coupled double well; a frozen cell reproduces the one-dimensional barrier
- `tests/ssneb.rs` — a frozen `SolidNeb` matches the ordinary band and CI-NEB; the variable-cell double well barrier is 1
- `tests/ssneb_validate_cu.rs` — release CI-SS-NEB on the 109-atom Mishin cell against `benchmarks/solid_dimer_cu.csv`
- `validation/` — sympy and sollya checks of the dimer rotation, the Lanczos residual bound, and the finite-difference curvature; `bain_lj_reference.py` (numpy, scipy) scans the relaxed Bain path that `tests/c/solid_bain_lj.c` checks against, and `ssneb_bain_cell.py` (sympy) checks its strain parametrisation and Jacobian

# Explanation (`docs/orgmode/explanation.org`)

> Mathematical and numerical design of band, string, and minimum-mode methods

## Rates and free energies
The explanations of the rate methods moved to rgflux with the methods:

- PAFI, OH-TST and harmonic TST: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/explanation/pafi-ohtst.org
- Exact references for OH-TST and PAFI: https://github.com/OmniPotentRPC/rgflux/blob/develop/docs/orgmode/explanation/ohtst-pafi-exact.org

## Band and minimum-mode
The band and the minimum-mode search assemble a force and ask `rgmin::Solver` for one step. Hosts interleave trust regions, drift budgets, acquisition, or a hybrid minimum-mode following (MMF) between steps. `run` is a loop over `step`. The shared reflection, the point presets, and the chain are in [one stencil](explanation/one-stencil.html).

## Translation rotation internal coordinates with splicing
[TRICS](explanation/trics.html) builds a nonredundant coordinate
system at every initial image, selects overlapping stable charts, interpolates
inside each chart, and splices their endpoints.

## Crystal symmetry regions
The operation lifting, the split between path multiplicity and in-plane
region degeneracy, and the nearest-image convention are described in
[crystal operations and symmetry-unique regions](explanation/symmetry-regions.html).

## Index-1 Newton
`Index1Session` searches an index-1 saddle on a Cartesian energy Hessian. The displacement is Baker's restricted-step partitioned RFO: a 2 by 2 rational-function problem maximizes the lowest mode, a second rational-function problem minimizes the complement, and the Besalu-Bofill scaling is solved so the Cartesian step lies inside the trust sphere. Powell or Bofill updates the Hessian from the gradient difference. The trust radius shrinks when that model predicts the energy change poorly and grows when a step on the sphere agrees with it.

`nichols_step` is the separate i-PI level shift. A host that already holds a spectrum can call it. `rgsaddle_prfo_step` is the restricted-step partition. `rgsaddle_hessian_powell` and `rgsaddle_hessian_bofill` update the Hessian.

## Cyclic block factorization
`block_cyclic` factors a cyclic block-tridiagonal matrix whose neighbor coupling is a scalar spring.
The rotation fallback, the `SaddleError::Singular` criterion, the symmetric part of each diagonal block, and the residual norm are in [cyclic block factorization](explanation/cyclic-block.html).
Each public item is in [cyclic block factor](reference/block-cyclic.html).

## eOn branch structure
Tangents, springs, projections, and the climbing-image force follow eOn's `NEBTangent` / `NEBSpringForce` / `NEBForceProjection` with the same branches. The climbing image arms when the convergence force falls under `factor * baseline` or under an absolute trigger.

## Simplified string
E, Ren, and Vanden-Eijnden, J. Chem. Phys. 126, 164103 (2007), doi:10.1063/1.2720838 [eSimplifiedImprovedString2007], replace the tangent projection and spring forces of NEB with an operator split on the equal-arc-length curve manifold.
Each step evolves the interior images under the full potential force \(-\nabla V(x_i)\) and then reparametrizes the chain to equal arc length \(\mathcal{R}(x_{\mathrm{evol}})\), on the not-a-knot cubic spline (`Reparametrization::NotAKnot`) or on the polyline (`Reparametrization::Linear`).
Because moving along the tangent of a curve and reparametrizing back to equal arc length cancels the tangential component to first order in the step size, the fixed point \(\mathcal{R}(\mathcal{E}(x^*)) = x^*\) satisfies \(\nabla V(x)^\perp = 0\) up to the spline or polyline interpolation order without estimating tangents on non-climbing images.
At any finite image count the discrete fixed point has \(x^{n+1} - x^n = 0\) while a chord projection of \(\nabla V\) carries the interpolation residual, so convergence and `BandEvaluation.projected` measure the effective string velocity \((x^{n+1} - x^n) \lVert F_{\mathrm{evol}} \rVert_2 / \lVert \Delta x_{\mathrm{evol}} \rVert_2\) in force units.
`BandStatus::Converged` requires that velocity to meet `force_tol` on two consecutive accepted string steps. A single under-tolerance step can be a transient of the optimizer/reparametrization split; requiring the next step to confirm it prevents a report whose accepted path immediately returns above tolerance.
When `BandConfig::climbing` arms an interior image, that image reflects \(-\nabla V\) along the path tangent and stays anchored during \(\mathcal{R}\), so each side is spaced at equal arc length on its own while the climbing image converges to \(\nabla V = 0\).
For `L-BFGS` the secant pairs \((s_n, y_n)\) are taken across the reparametrized displacement \(s_n = x^{n+1} - x^n\), which keeps the initial inverse-Hessian scale \(s_n \cdot y_n / \lVert y_n \rVert^2\) on the transverse valley curvature; for `FIRE`, `QuickMin`, `Bb`, and `ODE12r` that same transverse Rayleigh step bounds the solver time step so `BandConfig::default()` settles without knowing the surface stiffness in advance.
When a linearly interpolated guess between reactant and product crosses a rugged region far from the minimum energy path, `GrowingStringSession` (Peters, Heyden, Bell, and Chakraborty, J. Chem. Phys. 120, 7877 (2004), doi:10.1063/1.1691018 [petersGrowingStringMethod2004]) grows reactant and product string fragments inward under frontier tangent constraints and separate fragment relaxation until the fragments meet, then hands off to `StringSession` with image IDs and batched evaluations preserved.

## Periodicity
Positions stay unwrapped Cartesian. `Cell` wraps per-atom differences for the band mechanics through fractional coordinates (rows are lattice vectors; a zero row is a non-periodic axis). Neighbor lists, when a surface wants them, are vesin's job.

The point-defect finite-cell correction is described in [elastic dipoles and periodic images](explanation/elastic-dipole.html).  It uses `linkcell::Cell` / minimage for the defect separation, Barnett's anisotropic Green function, and a spherical periodic-image order with an explicit error estimate.

## The solid-state reference cell
The solid-state band is checked against an answer computed without a band. The case is the Bain path from bcc to fcc of LJ (epsilon 1 eV, sigma 1 A), switched to zero over [2.0, 2.2] A. Both atoms of the body-centred tetragonal cell diag(a, a, c) sit on inversion centres, so the atomic force is zero at any cell. The relaxed energy at fixed c/a is then a one-dimensional minimum over the volume. `validation/bain_lj_reference.py` scans it on a 2.5e-4 grid. bcc and fcc are minima, and the saddle sits at c/a 1.09331985, 0.0590356373 eV/atom above bcc. Over the six cell strains that saddle has one negative eigenvalue.

The saddle is not stable against atomic motion. The phonon at k = (1/2, 0, 1/2) of the conventional cell has the eigenvalue -51.5 eV/A^2 there, and it shuffles alternate planes. The two-atom cell carries no wave vector but k = 0, so in that cell the scan's saddle is the band's saddle. A supercell does carry the shuffle. A 5x5x4 supercell (200 atoms) has k = (2/5, 0, 1/2), with eigenvalue -38.4 eV/A^2. Its band, run with the settings of the two-atom test and a tolerance of 1e-3, shows the instability:

| iteration | largest force component | climbing image                      |
| --- | --- | --- |
|       150 | 4.6e-3                  | c/a 1.0933, the scan saddle         |
|       200 | 3.19                    | cells shear, a and b part           |
|       947 | 8.9e-4 (converged)      | c/a 1.0523, 0.0266 eV/atom above bcc |

At convergence the cells carry a shear of 0.233 A, a and b differ by 0.065 A, and the atoms sit up to 0.031 (fractional) off their sites. Rounding seeds the shuffle. The band then follows it to a lower path, as an NEB should, and the scan is no reference for that cell. `tests/c/solid_bain_lj.c` therefore checks the two-atom cell. There the climbing image reaches c/a 1.09331984 and 0.0590356373 eV/atom. Run with arguments `5 5 4 7 1e-3 5000 0.1 0.5`, it reproduces the supercell run and fails its tetragonal-path check by design.

## Evaluations per step
A warm band step costs `n_images - 2` image evaluations, twice that when FIRE 2.0 backs up half a time step after an uphill move and takes the force at the corrected point. The endpoint energies are evaluated once. The session keeps its last evaluation, keyed on the interior positions, so a step that starts where the previous one ended is assembled from it: a host resync through `set_positions` (rows equal up to the minimum image keep the session's own copy), an optimizer `restart`, or a solver that dropped its own cache costs nothing. `BandReport.surface_rows` counts what the surface evaluated. The climbing image is chosen on the energies of the evaluation it climbs on, so the step that arms it already climbs. The converged step also counts the image evaluations of the saddle-index check.

## Saddle index
The climbing image of the OCI-NEB of Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063, and the min-mode search, the dimer that Goswami, Masterov, Kamath, Peña-Torres, and Jónsson, J. Chem. Theory Comput. 21, 7935 (2025), doi:10.1021/acs.jctc.5c00866, accelerate with a Gaussian process, each follow one mode.
Here both converge where the force vanishes and the curvature along that mode is negative.
That holds at a saddle of any index whose other negative modes the force never excites, as on a band that keeps a symmetry of its start.
The index-1 saddle that Gould, Ortner, and Packwood, Math. Comp. 85, 2939 (2016), doi:10.1090/mcom/3096, analyse is positive definite off its one negative mode, and eOn fails a process search whose prefactor Hessian at the saddle has any other count.
The check counts the negative curvatures at the converged point without a full Hessian.
Block Lanczos with full reorthogonalization grows a Krylov space from the search's mode and pseudo-random vectors, one finite-difference action per vector, and stops once the lowest few Ritz pairs and the first non-negative one past the negatives meet a residual.
The Ritz values bound the eigenvalues of the symmetrized operator from above, one by one, so the count of negative Ritz values never exceeds its index.
A small residual puts each listed Ritz value within that residual of an eigenvalue; the pseudo-random start makes a missed lower eigenvalue unlikely, not impossible.
The random vectors matter: a space grown from a symmetric mode alone stays symmetric and never sees the modes that break the symmetry.
On the 84 free coordinates of the slab in `howto/band`, the certificate of the index-3 point took 58 to 60 actions and that of the index-1 saddle 70, where a central-difference Hessian takes 168 gradients.
The escape follows Yin, Wang, Chen, Zhang, and Zhang, Phys. Rev. Lett. 124, 090601 (2020), doi:10.1103/PhysRevLett.124.090601: from an index-k saddle, a push along unstable directions leads to saddles of lower index, and the restarted search maximizes along the kept mode only, the index-1 case of Yin, Zhang, and Zhang, SIAM J. Sci. Comput. 41, A3576 (2019), doi:10.1137/19M1253356.

## Steppers
FIRE is the default, as in eOn's velocity NEB stepper. The projected NEB force is not the gradient of the summed image energy the oracle reports, so L-BFGS runs under rgmin's `Accept::Step`: the two-loop direction, capped per atom, with one evaluation and no energy test.

## Minimum mode
The dimer rotation is the modified Newton step of Heyden, Bell, and Keil (2005) and Kastner and Sherwood (2008): one trial gradient fixes the Fourier model of the curvature in the rotation plane, the optimal angle is closed form, and the gradient at the rotated dimer is the exact (on a quadratic) combination of the two measured ones, so each rotation costs one evaluation. Rotation planes are Polak-Ribiere conjugate, and the force and direction of a finished rotation are kept for the next centre. A repeated estimate at the same centre, `set_mode`, and `reset` start that sequence again. A failed surface callback leaves the retained pair unchanged. In Rust, a `MinModeConfig` with `rotation_tol < 1e-4` drops the default five-degree dimer angle stop unless `with_rotation_angle_tol` set it explicitly. Lanczos reads `rotation_tol` as a dimensionless tolerance, its lowest Ritz residual divided by the absolute Ritz value, and, when `set_lanczos_rel_tol` is unset, as its relative Ritz-value tolerance. A Ritz value whose magnitude is at most 1e-14 of the curvature scale, the largest Hessian action norm the estimate has formed, has no magnitude of its own, so the residual is divided by that scale and the quotient is never formed. Only in that unset case and with `rotation_tol >= 1e-4` does it infer the classic torque window, which stops once two vectors leave that same ratio under 1, dividing by the same scale when the Ritz value is that small. Those two span the plane of a steepest-descent dimer rotation, and their Ritz vector is the dimer turned to the lowest curvature in it (Zeng, Xiao, and Henkelman, J. Chem. Phys. 140, 044115 (2014), doi:10.1063/1.4862410). Both use the forward difference against the centre gradient by default; `validation/fd_curvature.py` gives its error, `dr |T| / 2 + 2 eps / dr`, and the `dr` that minimizes it for a given gradient noise. `FiniteDifference::Central` trades one more gradient per action for an `O(dr^2)` error.

The translation steps on the inverted force, whose value (the true energy) is not its potential, as the band's pseudo-energy is not the potential of the projected force. Both sessions accept only methods that step on the force alone (FIRE, L-BFGS under `Accept::Step`, Barzilai-Borwein) and refuse line-searched ones. Between steps the solver's cached force, inverted along the previous mode, is dropped (rgmin `forget_evaluation`) and the centre answers the re-read without a surface call. A turn inside `MODE_RESET_ANGLE` (45 degrees, the Householder cone of Goswami, Gunde, and Jónsson, Front. Chem. (2026), doi:10.3389/fchem.2026.1807063; `validation/mode_reset.py`) keeps the L-BFGS pairs and the FIRE velocity. Past that cone the memory is dropped and the FIRE velocity returns to zero. FIRE opens at timestep 1.0 with a ceiling of 2.5 (Bitzek, Koskinen, Gähler, Moseler, and Gumbsch, Phys. Rev. Lett. 97, 170201 (2006), doi:10.1103/PhysRevLett.97.170201). When the per-atom cap shortens a negative-curvature step and the arrival is no longer negative, the move is replaced from the last negative point by `0.01 F`. A capped step that stays negative is kept. A non-negative curvature takes one step along the mode on which the largest atom moves `max_move`, eOn's `maxAtomMotionAppliedV` in its FIRE and L-BFGS steppers. Under `set_cg_translate` that step has Euclidean norm `max_move`, the single step of eOn's conjugate gradients. When the parallel gradient is within half that step of the minimum of the parabola along the mode, the climb keeps the mode's orientation.

# In the seat (`docs/orgmode/seat.org`)

> Role of rgsaddle in the leidarljos and rgpot stack

This crate is saddle mechanics, not a memory habitat. The seat that sits on a ticket is [ljos](https://leidarljos.github.io/docs/sit/). rgmin is the minimizer. rgpot is the potential RPC. rgsaddle is the band, the inverted mode, and the index-1 Newton step.

## The name
[leiðarljós](https://leidarljos.github.io/docs/about/) is Icelandic for guiding light. `ljos` is the CLI.

# Find a saddle with a nudged elastic band (`docs/orgmode/tutorials/band.org`)

> Nudged elastic band and OCI-NEB on the Mueller-Brown surface

This tutorial finds the saddle between minima A and B of the Mueller-Brown surface, a two-dimensional model with three minima, with a nudged elastic band (NEB). It runs the search twice from the same start: once as a climbing-image NEB (CI-NEB), and once with this crate's default, which also refines the climbing image along the lowest curvature mode. That refinement is the off-path climbing image NEB (OCI-NEB) of Goswami, Gunde, and Jonsson, Front. Chem. 14 (2026), doi:10.3389/fchem.2026.1807063. The climbing image itself is Henkelman, Uberuaga, and Jonsson, J. Chem. Phys. 113, 9901 (2000). At the end you have the converged path, the saddle, and the force calls each method spent.

## What you need
A checkout of this repository and Rust 1.88 or newer. The figures also need [uv](https://docs.astral.sh/uv/).

## Run it
```console
$ cargo run --release --example muller_brown_band -- target/muller_brown
```

```text
ci-neb   Converged after 1712 steps, 16889 force calls, max force 9.8e-4, climbing image 3 at (-0.822002, 0.624313), energy -40.664844
oci-neb  Converged after 50 steps, 513 force calls, max force 3.0e-4, climbing image 3 at (-0.822001, 0.624313), energy -40.664844
```

Both runs stop on the same saddle. The rest of this page goes through the program, `examples/muller_brown_band.rs`, and then the two figures.

## The surface
The host owns the potential. A `BandSurface` receives a block of images, one per row, and fills their energies and gradients. The atom moves in the plane z = 0, so the z gradient is zero. The counter is there only to count force calls.

```rust
/// One atom in the plane z = 0. Each image evaluated is one force call.
#[derive(Default)]
struct MullerBrown {
    force_calls: AtomicUsize,
}

impl BandSurface for MullerBrown {
    fn eval(
        &self,
        positions: ArrayView2<f64>,
        energies: &mut Array1<f64>,
        gradients: &mut Array2<f64>,
    ) -> Result<(), SaddleError> {
        self.force_calls
            .fetch_add(positions.nrows(), Ordering::Relaxed);
        for (i, row) in positions.outer_iter().enumerate() {
            let (energy, gx, gy) = muller_brown(row[0], row[1]);
            energies[i] = energy;
            gradients[(i, 0)] = gx;
            gradients[(i, 1)] = gy;
            gradients[(i, 2)] = 0.0;
        }
        Ok(())
    }
}

```

## The start and the two configurations
`linear_path` puts 11 images on the straight line from A to B. The endpoints never move. `max_move` caps each image's step at 0.05. The two configurations differ in one field: `min_mode: None` turns the refinement off and leaves plain CI-NEB.

```rust
    let minimum_a = array![-0.558223634633, 1.44172584195, 0.0];
    let minimum_b = array![0.623499404931, 0.028037758529, 0.0];
    let initial = linear_path(minimum_a.view(), minimum_b.view(), 11, None)?;
    write_band(&out.join("initial_band.csv"), initial.view())?;

    let oci_neb = BandConfig::default().with_max_move(0.05);
    let ci_neb = oci_neb.clone().with_min_mode(None);
    run("ci-neb", ci_neb, &initial, out)?;
    run("oci-neb", oci_neb, &initial, out)?;
    Ok(())
}
```

## The host loop
The session never runs to completion by itself. Each `step` assembles the NEB force and takes one solver step on it, and the host decides whether to call it again. `BandReport::surface_rows` counts the images the surface evaluated during the step; the example checks it against its own counter after every step.

```rust
    let surface = MullerBrown::default();
    let mut session = BandSession::new(config, initial.clone())?;
    let mut trace = File::create(out.join(format!("{name}_trace.csv")))?;
    writeln!(
        trace,
        "iteration,force_calls,max_force,climbing_image,top_gradient"
    )?;
    let mut force_calls = 0;
    let report = loop {
        let report = session.step(&surface)?;
        force_calls += report.surface_rows;
        assert_eq!(force_calls, surface.force_calls.load(Ordering::Relaxed));
        let ci = report.ci_index.map_or(-1, |i| i as i64);
        let top = top_gradient(session.positions());
        writeln!(
            trace,
            "{},{force_calls},{:e},{ci},{top:e}",
            report.iteration, report.max_force
        )?;
        if report.status == BandStatus::Converged || report.iteration >= 5000 {
            break report;
        }
    };
    write_band(&out.join(format!("{name}_band.csv")), session.positions())?;
```

(../../source/figures/band-tutorial/host_loop.png)

## The path
(../../source/figures/band-tutorial/mep.png)

The climbing image is image 3 in both runs, at (-0.82200, 0.62431) with energy -40.664844. The Hessian there has eigenvalues -750.9 and 490.2, one negative, so the point is a first-order saddle. The band passes the intermediate minimum near image 6 and then crosses a lower barrier near images 7 and 8 on its way to B. One climbing image climbs only the highest barrier.

## Force calls
(../../source/figures/band-tutorial/force_calls.png)

The first step evaluates 20 images and every later step 9, the interior images. The two runs take identical steps until step 52; the climbing image arms at step 51, after 470 force calls. From there OCI-NEB estimates the lowest mode at the climbing image and climbs that image alone. Its gradient is under `force_tol` (0.001) after 483 force calls, and the run stops.

The CI-NEB climbing image is under 0.001 for good from step 147, after 1334 force calls. The run continues to 16418 calls because its stopping test is different: CI-NEB stops when the projected force on every image is under `force_tol`, and OCI-NEB stops when the climbing image's own gradient is. After step 52 the OCI-NEB surface calls carry the climbing image alone, so the other images stay where that band step left them. That is why the two energy profiles differ away from the climbing image. Use CI-NEB when the whole path matters, and the default when the saddle is what you need.

## Make the figures
```console
$ uv run --no-project --with matplotlib --with numpy \
    python docs/source/figures/band-tutorial/plot.py target/muller_brown
$ (cd docs/source/figures/band-tutorial && dot -Tpng -Gdpi=150 host_loop.dot -o host_loop.png)
```

`plot.py` prints the climbing image, its Hessian eigenvalues, and the force-call counts quoted above.

## Next

# Find a saddle with the dimer (`docs/orgmode/tutorials/dimer.org`)

> Dimer and Lanczos minimum-mode searches

A minimum-mode search estimates the lowest curvature direction, reflects the force along it, and takes one solver step. The host owns the loop. This page is the dimer. Lanczos is the same session with `MinModeKind::Lanczos`.

The double well \(V = (x^2 - 1)^2 + 2y^2 + 2z^2\) has a saddle at the origin. The runnable form is the example on `MinModeSession` in the crate docs, and `examples/double_well.rs` is the band on the same surface. From Python, `rgsaddle.ase.MinModeAtoms` is the ASE-shaped call:

```python
from ase import Atoms
from rgsaddle.ase import MinModeAtoms

atoms = Atoms("H", positions=[[0.4, 0.3, 0.0]])
atoms.calc = bowl  # energy 2 x^2 + 5 y^2
search = MinModeAtoms(atoms, mode=[1.0, 0.0, 0.0], kind="dimer")
forces = search.get_forces()
```

Above the well the curvature is positive, so the returned force lies along the mode and the perpendicular part is dropped. `tests/python/test_ase_dropin.py` checks that on this bowl. Once the curvature is negative the force along the mode is reflected and the perpendicular force stays, which is the translation Henkelman and Jónsson use to leave a minimum toward a saddle.

ASE's own call is `MinModeAtoms(atoms, DimerControl(...))`, then `displace`, then `MinModeTranslate.run(fmax)`. The mode is this dimer. The trial step is ASE's. `tests/python/ase_upstream` runs that test from ASE 3.29.0.

The stepper is an rgmin method on that effective force. FIRE is the default. L-BFGS takes one step per call because the reflected force is not the gradient of the energy the surface reports. `MinModeConfig.seed_curvature` scales only the first empty translation by \(1/|\lambda|\).

Lanczos builds a Krylov subspace of finite-difference Hessian actions and stops on the residual. Set `kind="lanczos"` on the Python object, or `MinModeKind::Lanczos` on the Rust config. The same `get_forces` contract holds.

# Optimize a saddle with Sella's step (`docs/orgmode/tutorials/sella.org`)

> Order-1 saddle optimization with Sella's P-RFO trust step

Sella's order-1 step is a partitioned rational-function optimization inside a trust radius: uphill along the lowest mode, downhill along the rest. It is not a dimer translation. The Rust type is `SellaSaddleSession`. The Python call matches Sella's optimizer loop.

```python
from rgsaddle.ase import Sella

opt = Sella(atoms, order=1, delta=0.1)
opt.run(fmax=0.05, steps=50)
```

`atoms` is an ASE `Atoms` with a calculator. Masses are `atoms.get_masses`. `delta` is the trust radius per free coordinate. `run` is ASE's loop: each step asks the calculator for the energy and the gradient, takes one trust step, and writes the accepted positions back. `tests/python/test_ase_dropin.py` runs two steps on a three-atom bowl and checks that the positions stay finite.

The default geometry for three or more atoms is the rigid quotient, so a translation or a rotation of the whole molecule is not a step. A smaller system, or a host that already has internal coordinates, uses the Rust constructors `SellaSaddleSession::on` and `on_internal`. Those are not on the Python class.

Order 0, a minimization, is `SellaMinSession`. It uses the quasi-Newton step rather than the partitioned one.

# Roll down from a first-order saddle (`docs/orgmode/tutorials/quickstart.org`)

> Intrinsic reaction coordinate (IRC) forward and reverse branches

## Roll down from a first-order saddle

A two-atom double well has a saddle at
the origin and minima at \(x = \pm 1\). `IrcSession` kicks along
the imaginary mode, then projects each inner step onto the
mass-weighted sphere from [rgmin](https://github.com/OmniPotentRPC/rgmin) (`IrcTrust`). Forward and
reverse leave the col in opposite directions.

### What you will need

A checkout of `rgsaddle` with its pinned `rgmin` dependency.

### The surface

```rust
use ndarray::{Array1, ArrayView1};
use rgsaddle::{PointSurface, SaddleError};

struct DoubleWell;

impl PointSurface for DoubleWell {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let t = x[0];
        let energy = (t * t - 1.0) * (t * t - 1.0);
        let mut g = Array1::zeros(x.len());
        g[0] = 4.0 * t * (t * t - 1.0);
        Ok((energy, g))
    }
}
```

### Both branches

```rust
use ndarray::Array1;
use rgsaddle::{IrcConfig, IrcDirection, IrcSession};

let saddle = Array1::zeros(6);
let masses = Array1::from(vec![1.0, 1.0]);
let seed = Array1::from(vec![1.0, 0.1, 0.0, 0.0, 0.0, 0.0]);
let mut session = IrcSession::from_surface(
    IrcConfig::default().with_dx(0.2),
    saddle,
    masses,
    seed,
    IrcDirection::Forward,
    &DoubleWell,
)
.unwrap();
let _fwd = session.step(&DoubleWell).unwrap();
let x_fwd = session.position()[0];
session.set_direction(IrcDirection::Reverse);
let _rev = session.step(&DoubleWell).unwrap();
let x_rev = session.position()[0];
assert!(x_fwd * x_rev < 0.0);
```

`from_surface` estimates the lowest mode of the mass-weighted
Hessian `M^{-1/2} H M^{-1/2}` with matrix-free Lanczos
(finite-difference `H v`). It does not form a dense Hessian or
invoke a dense eigensolver.

### The resulting path

1. Lanczos evaluates Hessian actions at the origin and
   returns the negative-curvature direction.
2. The first `step` kicked along that mode onto the mass-weighted sphere of
   radius `dx`.
3. `set_direction(Reverse)` restored the saddle and flipped the
   kick. The two accepted points sit on opposite sides of the col.

The host owns the loop after that. `run(surface, max_steps)` is
a convenience over `step` until `at_minimum`. `reset` drops quasi-Newton
history at a model-update boundary, as for
`BandSession`.

# Step a NEB band (`docs/orgmode/howto/band.org`)

> NEB, climbing image, OCI-NEB, simplified and growing string, free-end adaptive NEB, IDPP, AFIR, and connect

`BandSession::step` assembles the tangent, spring and projection forces and advances one host iteration. The fast inertial relaxation engine (`FIRE`) and limited-memory Broyden-Fletcher-Goldfarb-Shanno (`L-BFGS`) methods preserve the endpoints. `L-BFGS` computes its direction from the assembled force; summed image energy is not a descent criterion for that force. It also arms eOn's resets: a two-loop step that reaches the per-atom cap or faces away from the force drops the stored pairs and steps along the force, and an empty memory scales that step by 0.01.

Call `reset` when the surface changes. The session retains evaluated endpoints and the accepted band while the surface remains valid. A `Cell` (`mic::wrap_difference`) supplies minimum-image differences for periodic configurations.

## Runnable example: NEB, climbing image, OCI-NEB, and IDPP

Orchestration and best practices for nudged elastic band paths follow Goswami, MethodsX 16, 103899 (2026), doi:10.1016/j.mex.2026.103899, and the off-path climbing image refinement (OCI-NEB) follows Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063. Image-dependent pair potential (IDPP) path initialization follows Smidstrup, Pedersen, Stokbro, and Jónsson, J. Chem. Phys. 140, 214106 (2014), doi:10.1063/1.4878664, and the sequential S-IDPP variant of Schmerwitz, Ásgeirsson, and Jónsson, J. Chem. Theory Comput. 20, 155 (2024), doi:10.1021/acs.jctc.3c01111.

```rust
use ndarray::{Array1, Array2, ArrayView1, ArrayView2, array};
use rgsaddle::{
    BandConfig, BandSession, BandStatus, BandSurface, CiConfig, IdppConfig, OcinebConfig,
    OcinebPhase, OcinebSession, OcinebStatus, PointSurface, SaddleError, SidppConfig, idpp_path,
    linear_path, sidpp_path,
};

struct DoubleWell;

impl BandSurface for DoubleWell {
    fn eval(
        &self,
        positions: ArrayView2<f64>,
        energies: &mut Array1<f64>,
        gradients: &mut Array2<f64>,
    ) -> Result<(), SaddleError> {
        for (i, row) in positions.rows().into_iter().enumerate() {
            let (x, y, z) = (row[0], row[1], row[2]);
            energies[i] = (x * x - 1.0).powi(2) + 2.0 * y * y + 2.0 * z * z;
            gradients[(i, 0)] = 4.0 * x * (x * x - 1.0);
            gradients[(i, 1)] = 4.0 * y;
            gradients[(i, 2)] = 4.0 * z;
        }
        Ok(())
    }
}

impl PointSurface for DoubleWell {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let (px, py, pz) = (x[0], x[1], x[2]);
        let e = (px * px - 1.0).powi(2) + 2.0 * py * py + 2.0 * z_part(pz);
        Ok((e, array![4.0 * px * (px * px - 1.0), 4.0 * py, 4.0 * pz]))
    }
}

fn z_part(pz: f64) -> f64 {
    pz * pz
}

fn main() -> Result<(), SaddleError> {
    let reactant = array![-1.0, 0.0, 0.0, -1.0, 1.0, 0.0];
    let product = array![1.0, 0.0, 0.0, 1.0, 1.0, 0.0];
    let _line: Array2<f64> = linear_path(reactant.view(), product.view(), 5, None)?;
    let _sidpp: Array2<f64> =
        sidpp_path(reactant.view(), product.view(), 5, None, &SidppConfig::default())?;
    let start: Array2<f64> =
        idpp_path(reactant.view(), product.view(), 5, None, &IdppConfig::default())?;

    let single_ends = array![[-1.0, 0.2, 0.0], [0.0, 0.3, 0.0], [1.0, 0.2, 0.0]];
    let config = BandConfig::default()
        .with_climbing(CiConfig::after(0.5))
        .with_force_tol(1e-3);
    let mut band = BandSession::new(config, single_ends.clone())?;
    let report = band.run(&DoubleWell, 200)?;
    assert_eq!(report.status, BandStatus::Converged);

    let mut ocineb = OcinebSession::new(OcinebConfig::default(), single_ends)?;
    let oci_report = ocineb.step(&DoubleWell)?;
    assert!(matches!(
        oci_report.phase,
        OcinebPhase::Band | OcinebPhase::Align | OcinebPhase::MinMode
    ));
    let _ = (start, OcinebStatus::Running);
    Ok(())
}
```

The projected force of every image with two or more atoms loses its mean Cartesian part, as in eOn when every atom is free. `BandConfig::remove_translation` set to `false`, or `RGSADDLE_BAND_KEEP_TRANSLATION` in the C band config flags, keeps the mean. A band with any fixed atom keeps it without either. An image with one atom keeps its force.

`BandConfig::remove_rotation_and_translation` fits each image onto the previous one before the tangent and the spring are built. It is off unless a host sets it. The fit translates the centroid and applies the proper rotation of Kabsch, Acta Cryst. A 32, 922 (1976), doi:10.1107/S0567739476001873, the same proper rotation `minimize_rotation_and_translation` applies on a free, non-periodic band. A collinear cloud leaves rotation about its axis undetermined, and the fit keeps the residual minimizer closest to the identity. Image 0 stays. Each later image, including the last, is placed on its neighbour. A session writes the fit when the band is built, when `set_positions` replaces the images, and at the start of each step. A coordinate change at or below 1e-8 times the largest absolute coordinate in the band is left unwritten. A written fit clears the endpoint energies, the last evaluation and the dynamic answers, and drops the solver's cached evaluation. Trial geometries inside one step are not refitted. `set_positions` fits a candidate and stores it only after the fit succeeds, so an error leaves the stored geometry and its state unchanged. A surface error while the band step is still driving leaves the positions from before that step. The saddle certificate runs after that geometry is committed. `set_positions` and the fit at the start of a step drop quasi-Newton history when the fit moves an interior coordinate by more than 1e-3 times that same scale. A smaller written fit keeps that history. The product endpoint is not a solver coordinate, so a fit that moves only that image leaves the history. The first fit runs before the solver is built. `band_forces` fits a copy and rotates the force and the tangent back by the transpose of the placement rotation. The surface force rotated back by that transpose is the caller-frame force when the energy is invariant under rigid motion. The projected NEB band force built from it is expressed in the caller frame and is not the derivative of any energy. The energies are those of the fitted images. AutoNEB writes that fitted window back, including the right endpoint, in the frame of the stored left endpoint. The stored path, its energies and both endpoints are the band the session optimized. A cell, a solid-state block, a fixed atom, a free end, or fewer than three atoms is refused, including a `band_forces` call with fewer than three images. The C band config has no flag for this fit, so a C session leaves it off. `rgsaddle.ase.NEB` does not read the flag: it still calls ASE's `minimize_rotation_and_translation`.

The climbing image is the highest interior image.
That follows Henkelman, Uberuaga and Jónsson (2000).
It also follows the nudged elastic band (NEB) of the Atomic Simulation Environment (ASE).
It climbs also when an endpoint lies higher.
Two minima bound a peak of the path.
So an interior maximum below an endpoint puts the saddle between that image and the endpoint.
The climb moves the image up to it.
An endpoint that is not a minimum can instead sit at the top of a slope the band rises along, with no saddle in between.
An endpoint at or above the highest interior image blocks the climb when its force toward the next image exceeds `force_tol`.
The band then keeps the spring on every image and reports no climbing image, eOn's rule for a monotonic band.
An endpoint whose gradient the band never evaluated, as at the ends of an AutoNEB window, blocks nothing.
`CiConfig` decides when it arms.
The default `CiConfig::after(0.5)` arms once the band's largest force component falls under 0.5 in the host's force units.
That is eOn's `ci_after` in eV/A.
Climbing-image NEB is run on a roughly converged band.
That is the method of Henkelman, Uberuaga and Jonsson, J. Chem. Phys. 113, 9901 (2000), `doi:10.1063/1.1329672`.
`CiConfig::after_rel(f)` arms under `f` times the first evaluation's force (eOn `ci_after_rel`).
`CiConfig::always()` climbs from the first evaluation.
From C `RGSADDLE_BAND_CI_AFTER` (ABI minor 17) turns climbing on with `ci_trigger_force` and `ci_trigger_factor` as given.
Without it climbing needs a positive `ci_trigger_factor`.

An armed climbing image is refined by its lowest mode, the OCI-NEB of Goswami, Gunde and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063. `BandConfig::min_mode` holds the `MinModeRefine` controls and is on by default; `None` keeps the plain CI-NEB. Once the same image has been highest for `stable_steps` (1) band step and its largest per-atom force is under `trigger_factor` times the largest per-atom force of the first evaluation (infinite by default, so at any force), the first refinement step estimates the lowest mode at that image by Lanczos seeded with the band tangent, keeping up to `krylov_dim` (20) Hessian actions. A positive curvature, or a mode with `|v . tau|` under `alignment_tol` (0.85), hands the image back unmoved and keeps the band optimizer's history. Otherwise that image climbs alone while the other images stay. The climb is an order-1 P-RFO step (Baker, J. Comput. Chem. 7, 385 (1986)) on a dense TS-BFGS model (Bofill, Int. J. Quantum Chem. 94, 324 (2003)). The model is the pair-stretch Hessian of Lindh, Bernhardsson, Karlström and Malmqvist, Chem. Phys. Lett. 241, 423 (1995), over pairs closer than twice the nearest-neighbour distance `r_nn`, counted under a cell through every periodic image in that range and not only the minimum image, with the pair weight `exp(-3 (r/r_nn - 1))` and the diagonal stabilisation of Packwood et al., J. Chem. Phys. 144, 164109 (2016), scaled by the smallest ratio of measured to model curvature over the positive Lanczos directions so it is nowhere stiffer than the surface along them, and then made to match every Lanczos action exactly. With `remove_translation` the model and the step live off the rigid translations, and off the rotations too when there is no cell. Each step maximizes along the model eigenvector with the largest overlap with the mode followed a step before, not along the lowest. The trust radius bounds the largest per-atom move by `max_move`; a ratio of actual to predicted energy change outside `[1/4, 4]` halves it, and a ratio inside `(3/4, 4/3)` from a step at the radius doubles it. Lanczos runs again, its block imposed and its mode followed, once the followed model curvature is above `curvature_retained` (0.3) of the curvature last measured or the followed mode turned under `min_overlap` (0.8), at most every `refresh_interval` (4) climb steps. The climb hands the image back when the curvature turns positive, measured by Lanczos again before it ends the climb, or after `max_steps` (1000), at the aligned point of lowest force it visited. With `climb_alignment` (off) it also ends once the followed mode's overlap with the tangent falls under `alignment_tol`. The trigger re-arms by eqs. 13 to 15 of that paper (`initial_threshold`, `success_threshold` and `backoff_threshold`, shared with `OcinebSession`), and a refinement that did not lower the force waits also for `retry_factor` (0.5) times the force it started from, at least twice `force_tol`. The re-armed threshold belongs to the image that climbed; when the band's climbing image changes index the threshold returns to `initial_threshold`. The band then reports `Converged` once the climbing image's force is under `force_tol`; the other images keep their last band positions. Each refinement step reports the curvature in `BandReport::curvature` and counts its one-image evaluations in `surface_rows`. Every one-image evaluation goes through `BandSurface::eval_image` with the climbing image's band index; a surface that keys per-image state on that index overrides it. AutoNEB's windows keep the plain climb.

`set_rtr(Some(RtrConfig::default()))` selects the projected trust-region band method. Its model uses the complete displacement after equal-arc redistribution and the radius cap. The projected method is a heuristic for the nonconservative band force; the report does not certify an energy minimum. The min-mode refinement runs on this band as on the default stepper, and its climb steps take the place of RTR steps while it runs.

`RtrConfig::reparametrization` selects how each RTR trial is spread at equal arc length. `Reparametrization::Linear`, the default, places the interior images on the polyline. `Reparametrization::NotAKnot` fits the not-a-knot cubic spline through the images in their polyline arc length, the interpolation of the simplified string method (E, Ren, and Vanden-Eijnden, J. Chem. Phys. 126, 164103 (2007), doi:10.1063/1.2720838), and places the images at equal steps of the spline's own arc length, measured by Gauss-Legendre quadrature. The paper evaluates the spline at uniform polyline arc instead; both choices lie on the same curve, and measuring along the spline spaces an uneven band evenly in one pass. Three distinct images give the interpolating parabola and two the chord. Images whose arc lengths agree to 1e-12 of the total share one knot, so coincident images do not make the fit singular. In a periodic cell the chain is unwrapped by minimum-image chords before the fit and every placed image moves by the minimum image of its displacement. Endpoints and the climbing image keep their bits. The spline reproduces a cubic in arc length, keeps a straight band exactly on its line, and on images sampled from a smooth curve its off-curve error falls with the fourth power of the spacing where the polyline's falls with the second (`tests/reparam.rs`). On the RTR double-well band of `tests/rtr_capi.rs` (7 images) both placements reach the same climbing image; the spline took 3827 surface rows in 21 steps and the polyline 3367 rows in 16, so the polyline stays the default. `rgsaddle::reparametrize` applies either scheme to a band without a surface call, `Mesh::RemeshSpline` does it on a stencil chain, and from C `rgsaddle_reparametrize` and band flag `RGSADDLE_BAND_SPLINE_REPARAM` (ABI minor 38) do the same. The rgsaddle band has no geodesic coordinates of its own: the chords are Cartesian, minimum images in a cell, and a host that interpolates in other coordinates passes those as the rows.

`set_force_gate` chooses the force norm. `set_highs(true)` enables rgmin's feasible-step control when the library has the `highs` feature. The default `FIRE` and `L-BFGS` dispatch is unchanged by compiling that feature.

`OcinebSession` is the same band and the same refinement with the published hand-off controls. Goswami, Gunde, and Jónsson, Front. Chem. 14 (2026), doi:10.3389/fchem.2026.1807063. `OcinebConfig::refine` maps them onto `MinModeRefine`: `trigger_factor` (published value 0.31) and `trigger_force` to the trigger, `angle_tol` (at least `1/sqrt(2)`, published value 0.85) to the alignment, `stability_count` (the index must stay unchanged for more than this many steps, published value 5) to the stability latch, `max_mmf_steps` to the climb budget, and `restore_unhelpful` as it is. It turns `climb_alignment` on and the `retry_factor` off, so the climb ends when its mode leaves the tangent cone and re-arms by the published thresholds alone. `OcinebConfig::minmode` supplies the mode estimate (kind, finite difference, rotation and Krylov controls); the climb is the band's P-RFO step, so its `method`, `force_tol` and `max_move` are not read. `step` does one band step, one alignment, or one climb step, and the report names that phase. The alignment step estimates the lowest mode at the climbing image without moving it, and the climb starts only when that curvature is negative and the overlap with the tangent meets `angle_tol`. The threshold starts at `initial_threshold`, at least twice the force tolerance; a climb that lowers the force re-arms at `success_threshold`, `F_new (1/2 + 2/5 F_new/F_CI)`, and keeps the mode, and any other outcome at `backoff_threshold`, `F0 * trigger_factor * (1/2 + 1/2 α)` with `α = 0` after a positive curvature. The band converges when the climbing image meets the force tolerance. The band's `saddle_check` then certifies the climbing image as on a band session, and `OcinebReport::saddle_index`, `OcinebSession::saddle_index` and `set_saddle_check` carry it. The point surface answers the climbing image's evaluations. The solid-state block is refused. This session's band climbs with `CiConfig::after_rel(0.5)`, which is the relative arming rule and not `BandConfig::default`.

`BandConfig::quickmin` selects the quick-min step. The velocity is projected onto the force when that projection is non-negative and replaced by zero otherwise, then the Euler update is `v <- v + dt F` and `dx = dt v`, with `dt` the session step (1 by default). The per-atom cap shortens `dx` and rescales the velocity by the fraction kept. The projection is one vector over the interior coordinates. FIRE version 2 stays the default. `BandConfig::quickmin_options` picks the variant: `QuickMinOptions::rgmin()` (default) grows and shrinks `dt` with FIRE's factors and projects the whole band at once, `::eon()` keeps eOn's fixed `dt`, and `::per_atom()` projects each atom on its own force. `rgsaddle_band_set_quickmin_variant` sets the same from C. `BandConfig::time_step` is the initial time step, 1 by default; the eOn variant keeps it, and converges on the Al and Pt bands at 0.1 or 0.25 but not at 0.5 or 1. `rgsaddle_band_set_time_step` sets it from C.

`SpringKind::OnsagerMachlup { k, l_vecs }` is the Onsager-Machlup spring of Mandelli and Parrinello (2021), Eq. 13.
It is `k (R[i+1] + R[i-1] - 2 R[i] + L[i+1] - L[i])` along the tangent, with the displacements `l_vecs` held as the host gave them.
`SpringKind::OnsagerMachlupLive { k }` rebuilds them before each force assembly from the forces of that evaluation.
Each interior image gets `L = F / (2 k)` and each endpoint zero, as eOn's `buildSpringStrategy` does on every `updateForces`.
`spring::onsager_machlup_displacements` is that rule.
A `|2 k|` below 1e-300 gives zero displacements, as eOn's `safe_recip` does.
The C spring ordinal 2 is the live kind from ABI minor 33.
AutoNEB, the zoom, the exponential metric and the solid-state block refuse both kinds.

`BandConfig::zoom` (C `rgsaddle_band_set_zoom`, application binary interface (ABI) minor 31) is the nudged elastic band (NEB) zoom of eOn's `NEBZoom.cpp`, Zoom-NEB, and it is off by default. Once the climbing image has kept its index for `stability` (5) band steps, the zoom decides. It places the band when the largest per-image force is under `after`, where 0 takes twice `force_tol`. Each image force is measured by the session's convergence norm before the maximum is taken, as eOn's `convergenceForce` does. The images are then placed at equal arc length on a window around the climbing image, by cubic Hermite segments or linearly. The window takes the contiguous images above the lower endpoint plus `alpha` (0.5) of the barrier. An `alpha` of 0, or a window of the climbing image alone, takes `offset` (1) images on each side. Unlike eOn, the window then always reaches both neighbours of the climbing image, so a one-sided cut cannot turn the climbing image into a fixed endpoint. The window's end images become the fixed endpoints and keep their energies, and the climbing image stays armed; the optimizer history and the min-mode refinement start again. The min-mode refinement does not start before the zoom has decided, since its steps would bypass the zoom; eOn checks the zoom first in each iteration. The band zooms once, and `zoom_window` reports the window. `ZoomConfig::default()` gives the recommended settings for a band that opts in. With the zoom on, plain climbing image NEB (CI-NEB) on the 51 benchmark pairs of the 38-atom Lennard-Jones cluster (LJ38) converged 20 pairs, where it converged 21 without the zoom. It used more force calls on 10 of the 17 pairs that converged both ways. With the default min-mode refinement on, one LJ38 pair ran to the 250000 call cap. On Müller-Brown at 13 images with FIRE and `max_move` 0.05, plain CI-NEB took 30593 force calls with the zoom and 31308 without it. With L-BFGS of memory 100 and climbing from half the first force, the zoom does not help on Müller-Brown: the band took 6503 force calls with it and 3280 without it. The zoom is an opt-in, not a general default. The zoom needs a uniform spring on an atomic band. Equal arc length placement follows the reparameterization of Goswami, Gunde, and Jónsson (2026), section 2.3.6. Cutting the band to the barrier region is the adaptive NEB of Maragakis, Andreev, Brumer, Reichman, and Kaxiras, J. Chem. Phys. 117, 4651 (2002), doi:10.1063/1.1495401.

`AutoNeb` grows that band. The steps and the window are in `howto/autoneb`. The spring starts uniform and is rescaled inside the search. Host-supplied weighted, energy-weighted, or Onsager-Machlup springs are refused with `SaddleError::Invalid`.

`BandConfig::solid` adds the generalized solid-state block. The tangent and the spring act on one long vector: the minimum-image atomic displacement through the average of the two cells, then the averaged right strain of the Jacobian-scaled cell difference. The cell part of the force is minus the cell volume times the Cauchy stress plus a hydrostatic pressure times the identity, divided by the Jacobian, with the upper triangle cleared. The Jacobian is the cube root of the mean endpoint volume per atom times the square root of the atom count, times `weight`, and it stays fixed for the run. Build it with `SolidState::new(cells)` and the `with_pressure` and `with_weight` setters. A surface that supplies the block implements `BandSurface::eval_cells` and returns the Cauchy stress, `(1/V) dE/deps` for the right strain `h <- h (I + eps)` at fixed fractional coordinates. From C, `rgsaddle_band_create_solid` builds the band, `rgsaddle_band_step_solid` steps it on an `rgsaddle_solid_surface_fn` whose request carries the cells in and the stresses out with the energies and gradients, and `rgsaddle_band_cells` and `rgsaddle_band_solid_jacobian` read it back. `rgsaddle_band_step` refuses a solid-state band. An equal-cell path with zero stress and zero pressure matches the atomic band. The doubly nudged term stays on the climbing image.

## Simplified string method

`BandConfig::with_string(StringConfig::default())` (and `BandSession::set_string` between steps) selects the simplified string method of E, Ren, and Vanden-Eijnden, J. Chem. Phys. 126, 164103 (2007), doi:10.1063/1.2720838 [eSimplifiedImprovedString2007], in place of the nudged elastic band.
Each step evolves the interior images under the full potential force \(-\nabla V(x_i)\), with no spring and no tangent projection, through the session's `rgmin::Solver` stepper (`FIRE`, `L-BFGS`, `QuickMin`, `Bb`, or `ODE12r`), and then places the interior images at equal arc length with `reparametrize`.
`StringConfig::spline()` (`Reparametrization::NotAKnot`, the default) fits the not-a-knot cubic spline through the images in their polyline arc length and spaces them at equal arc length of the spline; `StringConfig::linear()` (`Reparametrization::Linear`) spaces them on the polyline.
With `BandConfig::climbing` set, an armed climbing image reflects the potential force along the path tangent and acts as an interior anchor during reparametrization so each side of it is spaced at equal arc length on its own, while `with_climbing(None)` runs the plain equal-arc string across the whole path.
The session keeps both endpoint images fixed. This differs from the endpoint evolution in the paper and matches the fixed-endpoint contract of the other band methods in this crate.
L-BFGS keeps reparametrized secant pairs explicitly. The non-L-BFGS steppers are rebuilt after every accepted string step to install the transverse-curvature time-step bound, so FIRE, QuickMin, Bb, and ODE12r do not carry momentum or other integrator state between string iterations.
Fixed-atom masks, periodic `Cell` minimum-image wrapping, `ExpBandPrecon`, `MinModeRefine`, `SaddleIndexCheck`, and `set_image_threads` apply as on an atomic NEB band; the solid-state cell block, `AutoNeb`, and `BandRtr` are refused.
From C (ABI minor 44), `RGSADDLE_BAND_STRING` in `rgsaddle_band_config_t.flags` (paired with `RGSADDLE_BAND_SPLINE_REPARAM` for the spline, or clear for the polyline) and `rgsaddle_band_set_string` select the method, `rgsaddle::Band::set_string` wraps it in C++, and Python exposes `rgsaddle.Band(..., string=True)`, `_core.project_band(..., projection="string")`, and `rgsaddle.ase.SimplifiedString`.

On the Müller-Brown surface (`tests/simplified_string.rs`, 25 images between minima A and B at force tolerance 0.001), self-measured regression pins from this implementation put the first under-tolerance spline step at 147 iterations and 6787 force rows; stable convergence is confirmed at 148 iterations and 6833 rows. Its maximum Euclidean deviation from the separately integrated steepest-descent path is 0.0111, while the polyline string regression gives 0.0144. A separately configured 25-image CI-NEB regression gives 0.0305 in 2190 force rows; because its climbing and optimizer settings differ, these figures are not a method-ranking comparison. These are regression measurements, not values reported by E, Ren, and Vanden-Eijnden.
With climbing enabled, the climbing string locates the primary saddle at \((-0.822001, 0.624313)\), energy \(-40.664844\), matching the analytic saddle and CI-NEB within 0.001, and on the C-to-B segment (13 images) locates the secondary saddle at \((0.212485, 0.292987)\), energy \(-72.248940\), both certified at Hessian index 1.
On the 107-atom Morse Cu fcc vacancy hop of Makri, Ortner, and Kermode [makriPreconditioningScheme2019] (`tests/makri_vacancy.rs`, 5 images, `L-BFGS` memory 20, tolerance 0.001 eV/Å), self-measured regressions put the spline simplified string at 37 steps (75.67 evaluations per interior image) and a barrier of 1.84369893 eV, the climbing spline string at 35 steps (71.67 evaluations per image) and 1.84369903 eV, and the linear string at 149 steps and 1.84370066 eV, against 1.84369917 eV for NEB (18 steps, 19.67 evaluations per image). The cited paper reports no simplified-string value for this Cu case.

`GrowingStringSession` (`GrowingStringConfig::default()`, C `rgsaddle_growing_string_create` at ABI minor 44, C++ `rgsaddle::GrowingString`, Python `rgsaddle.GrowingString` and `rgsaddle.ase.GrowingString`) implements the growing string method of Peters, Heyden, Bell, and Chakraborty, J. Chem. Phys. 120, 7877 (2004), doi:10.1063/1.1691018 [petersGrowingStringMethod2004].
Starting from only the reactant and product endpoints, it grows two separate string fragments inward with frontier tangent constraints (\(\Delta w_{\mathrm{frontier}} \cdot \hat{t}_{\mathrm{frontier}} = 0\)), separate per-fragment `rgmin::Solver` relaxation, and a configurable node-add criterion (`frontier_tol`, `min_steps_per_node`, `max_steps_per_node`, `join_tol`).
When the fragments meet, `GrowingStringSession` detects the join and hands off to `StringSession` while preserving every image's `ImageId` and batched surface evaluations.
On the 2D curved parabolic channel with a central obstacle (`tests/growing_string.rs`, 11 images), `GrowingStringSession` avoids the high-energy linear midpoint and converges in 68 steps (873 force evaluations) to the saddle \((0.0, 1.008371)\), energy \(1.010629\), matching CI-NEB (72 steps, 744 force evaluations). On Müller-Brown (15 images, `L-BFGS`), it locates the primary saddle \((-0.822001, 0.624313)\) in 86 steps (1832 force evaluations), matching CI-NEB at \((-0.822002, 0.624313)\) in 59 steps (785 force evaluations).

## Per-step refine stepper

`StepRefine` (`BandConfig::with_refine`, `BandSession::set_refine`, `BandSession::is_refining`) chooses the band stepper on each step. `StepRefine::default` is L-BFGS with memory 20 and `StepRefine::threshold` 0.5, in the host's force units. `with_method` and `with_threshold` replace those. `BandConfig::refine` is `None` by default, so a band steps with `BandConfig::method` alone.
On a step whose convergence force, the same value the `force_tol` stop reads, is at or under the threshold, the band steps with the refine method. Any other step uses the primary method. Both steppers keep their own state, so a force that rises back over the threshold returns the band to the primary stepper. The refine method must step on the force alone. A threshold that is not finite and positive is refused while a refine stepper is set.
The choice applies to the first-order step of an atomic band whose method is FIRE, including the band steps between OCI-NEB refinements (`MinModeRefine`). A solid-state, quick-min, trust-region, simplified string, growing string, or free-end band drives its own stepper and ignores `StepRefine`. `BandSession::restart` drops both steppers.
From C (ABI minor 60), `rgsaddle_band_set_refine` installs `RGSADDLE_REFINE_LBFGS` or clears it with `RGSADDLE_REFINE_NONE`, and `rgsaddle_band_is_refining` reports which stepper the last step used. A threshold of 0 selects 0.5. `rgsaddle::Band::set_refine` and `Band::is_refining` wrap those calls, and Python exposes `Band.set_refine` and `Band.is_refining`. The worked example is `tests/band_refine.rs`.

## Free-end adaptive NEB

`BandConfig::with_free_end(FreeEndConfig::default())` (`BandSession::set_free_end`, `FeaNebSession`, C `rgsaddle_band_set_free_end` at ABI minor 45, C++ `Band::set_free_end`, Python `Band.set_free_end`) implements the free-end adaptive nudged elastic band (FEA-NEB) of Jiayong Zhang, Hongwu Zhang, Hongfei Ye, and Yonggang Zheng, J. Chem. Phys. 145, 094104 (2016), doi:10.1063/1.4962019 [zhangFreeEndAdaptive2016], building on the free-end level-set endpoint formulation of Ting Zhu, Ju Li, Amit Samanta, Hyoung Gyu Kim, and Subra Suresh, Proc. Natl. Acad. Sci. U.S.A. 104, 3031 (2007), doi:10.1073/pnas.0611097104 [zhuInterfacialPlasticity2007]. Climbing on the final cut level reuses the climbing image, and with minimum-mode refinement left on, the off-path climb of Goswami, Gunde, and Jónsson, Front. Chem. 14 (2026), doi:10.3389/fchem.2026.1807063 [goswamiEnhancedClimbingImage2026]. A nonzero endpoint gradient is required and the endpoint residual is reported.
Fixed endpoints remain the default (`BandConfig::free_end` is `None`). The free-end band is not combined with `BandConfig::dynamic`: `BandSession::new`, `BandSession::set_free_end`, and `BandSession::set_dynamic` return `SaddleError::Invalid` when both would be on.
A free-end step asks the surface for the fixed terminal image once, and again only after a cut moves it to the window edge. The evaluation a step ends on is kept, so the next step starts from it instead of evaluating the band again, unless the host moved a row with `BandSession::set_positions` or called `BandSession::reset`. `FreeEndReport::surface_rows` counts the rows the surface saw.
When enabled, one terminal image (`FreeEndSide::Last` by default, or `FreeEndSide::First`) takes Zhang et al. Eq. (7), the potential force perpendicular to the one-neighbour tangent, \(F^p_{\mathrm{end},\perp}=-\nabla E+(\nabla E\cdot\hat{\tau}_{\mathrm{end}})\hat{\tau}_{\mathrm{end}}\). That force does not include a spring. Net translation is removed, when the band drops it, before the force is projected onto the tangent hyperplane of \(E(x_{\mathrm{end}}) = E_{\mathrm{target}}\). Each accepted endpoint geometry is then retracted onto that level set with `rgmin::Solver` and `rgmin::LevelSetConstraint`.
The terminal image requires a finite, nonzero potential gradient and reports the signed residual \(E(x_{\mathrm{end}}) - E_{\mathrm{target}}\) in `FreeEndReport::target_energy_residual` and `BandSession::target_energy_residual`. `BandSession::evaluation` returns the energies, gradients, and projected interior forces at the positions that step reported.
With `max_cuts > 0`, once the detected peak image holds its index for `stability` steps and the band force falls below the level threshold while rising above its neighbours by more than `energy_tol`, images outside the local window of `window_offset` images on each side of the peak are dropped. The band is remeshed at equal arc length along the window and, when the free terminal image lies outside that window, along the leg from the window to the free end, so the free end stays an endpoint and the spacing stays even. A window that would put the peak on an end, or that would remove no image, is not counted. A refused endpoint curvature pair is a stalled step and does not move the endpoint. `BandSession::step_free_end` and `FeaNebSession::step` run a latched minimum-mode refinement when climbing is on, the same way `BandSession::step` does.
On a narrow barrier on a long tilted 2D path (`tests/free_end_neb.rs`), 7-image FEA-NEB with two cut-and-remesh refinements converges in 95 steps (1326 force evaluations, target-energy residual \(5.10 \times 10^{-8}\)) to the saddle \((0.820770, 0.205179)\) and barrier \(1.553678\), matching 21-image fixed-end CI-NEB (\((0.820788, 0.205196)\), barrier \(1.553678\), 1982 force evaluations) with three times fewer images.

## Fixed atoms

`BandConfig::with_fixed_atoms` takes one `bool` per atom, shared by every image; `true` fixes the atom. From C, `rgsaddle_band_set_fixed_atoms` (ABI minor 39) takes the same mask as one byte per atom, 0 or 1, on a band made by `rgsaddle_band_create`, and `BandSession::set_fixed_atoms` is the Rust call between steps. The mask is for a slab with a frozen bottom layer, ASE's `FixAtoms`, eOn's fixed atoms or a LAMMPS `fix setforce 0` group.

A fixed atom never moves. The band reads its gradient as zero, so it carries no force in the FIRE, L-BFGS, quick-min, ODE12r or trust-region (RTR) step, in `BandReport::max_force`, or in `BandEvaluation`. Tangents, springs and the climbing direction are formed on the free coordinates, and the min-mode refinement estimates the mode and climbs on the free coordinates only. The session then copies the first image's fixed coordinates into every interior image after each move, so the frozen positions stay the same to the bit. With any atom fixed, the mean force stays.

The endpoints must place every fixed atom at the same point, up to the minimum image and 1e-10 per component. A mismatch is refused with `SaddleError::Invalid` naming the atom, as is a mask that fixes every atom, a mask on a solid-state band, and a mask on `SolidNeb::joint`. A mask of the wrong length is `SaddleError::Shape`. Interior images take the first image's fixed coordinates when the session is built and on each `set_positions`. A mask with no `true` entry leaves the band the same to the bit as one without a mask.

Before minor 39, a host zeroed the frozen forces itself and kept the mean with `RGSADDLE_BAND_KEEP_TRANSLATION`. That still works for the plain metric. It does not work with `rgsaddle_band_set_exp_precon`: the exponential matrix couples every atom to its neighbours, so `P^-1 g` moves a frozen atom whose own gradient is zero. With the mask the matrix is built on the free atoms alone, so `P^-1` acts on the free block and the frozen atoms stay.

## Preconditioning with fixed atoms

`BandConfig::exp_precon` (C `rgsaddle_band_set_exp_precon`, ABI minor 22) is the exponential metric of Packwood et al., J. Chem. Phys. 144, 164109 (2016), applied inside the band projection as Makri, Ortner and Kermode, J. Chem. Phys. 150, 094109 (2019), apply it. On a band with fixed atoms each image's matrix has one block row per free atom. Fixed atoms still count as neighbours: they enter the nearest-neighbour distance `r_nn`, and the pairs within `r_cut_factor * r_nn` are chosen over all atoms. A free atom's bond to a fixed atom adds its weight to that free atom's diagonal block only, and a bond between two fixed atoms drops out. That is the free block ASE's `Exp` preconditioner keeps under `FixAtoms`. The metric force is formed on the free block and scattered back, and the frozen rows stay zero.

On the Morse fcc(100) slab of `examples/fixed_slab_precon.rs`, with its bottom layer of nine atoms fixed and an adatom hopping between neighbouring hollow sites, every stepper converges with the frozen layer unchanged to the bit. ODE12r-Exp and FIRE-Exp reach the same stationary point as plain FIRE and L-BFGS, energy within 1e-6, at `force_tol` 1e-4; that point is a saddle of index 3, as the next section shows. `benchmarks/fixed_slab_precon.csv` has the force calls and wall time of plain CI-NEB at `force_tol` 1e-3, seven images, with the min-mode refinement and the saddle check off; `cargo run --release --example fixed_slab_precon -- benchmarks/fixed_slab_precon.csv` writes them again. On this 37-atom slab the metric does not pay for FIRE (342 force calls without it, 459 with it) or ODE12r (137 and 274), and saves little for L-BFGS (107 and 99). The force calls count every image row the band evaluated, endpoints and the two rows of the `mu` estimate included.

## Saddle index of the climbing image

The band converges once its climbing image is stationary, and the climb only maximizes along one direction.
Nothing in that test says the image has a single negative curvature.
A start that shares a symmetry with the surface keeps it, and a mode that the symmetry keeps out of the force never moves the image, so the climb can stop on a saddle of index two or more.
Zhang and Du, SIAM J. Numer. Anal. 50, 1899 (2012), doi:10.1137/110843149, Theorem 3.2, show that every critical point other than an index-1 saddle is a fixed point of the Euler scheme of shrinking dimer dynamics, though not a contractive one.
eOn fails a process search when the Hessian it builds at the saddle for the prefactor, on the atoms that moved and their neighbours, has other than one negative eigenvalue (`client/Prefactor.cpp`).

`BandConfig::saddle_check` holds a `SaddleIndexCheck`, on by default, and certifies the climbing image of a converged band.
The check estimates the lowest curvatures there by block Lanczos on forward-difference Hessian actions of displacement `dr` (1e-3), one image evaluation each, on the free coordinates: fixed atoms, the rigid translations the band drops and, without a cell, the rotations are left out.
One action costs one gradient, as a dimer rotation with an extrapolated gradient does (Heyden, Bell, and Keil, J. Chem. Phys. 123, 224101 (2005), doi:10.1063/1.2104507; Kästner and Sherwood, J. Chem. Phys. 128, 014106 (2008), doi:10.1063/1.2815812) and as a step of the Lanczos estimate of Olsen, Kroes, Henkelman, Arnaldsson, and Jónsson, J. Chem. Phys. 121, 9776 (2004), doi:10.1063/1.1809574.
The Krylov space starts from `block` (2) vectors, the band tangent or the refinement's mode and pseudo-random ones from `seed`, so a mode that a symmetric band never sees still enters it.
Each expansion adds the residuals of the lowest Ritz pairs, reorthogonalized in full, until the `lowest` (4) lowest curvatures and the first non-negative one past every negative one meet the Ritz residual `residual_tol` (1e-2), the space fills the free coordinates, or `max_actions` (100) run out.
The Ritz values are those of the symmetrized finite-difference Hessian on the space, so by Cauchy interlacing the count of those under `-negative_tol` (1e-3) never exceeds that operator's index.

`BandReport::saddle_index` carries the `SaddleIndex` of the converged step: `index`, the `curvatures` in ascending order with their `residuals`, `converged`, and `evaluations`.
Those evaluations count in the step's `surface_rows` as well, `BandSession::saddle_evaluations` sums them with the escape's over the session, and `BandSession::saddle_index` returns the certificate while the climbing image stays where it was certified.
The band takes the same steps to the same positions with the check on or off.
`with_saddle_check(None)` turns it off, and a band without a climbing image or with the solid-state block is not checked.

`SaddleIndexCheck::escape`, `None` by default, takes a `SaddleEscape` with the `with_push` and `with_max_attempts` setters.
At a climbing image of index two or more the negative Ritz vector with the largest overlap with the band tangent is the reaction mode.
The image moves along each other negative mode, to the side of lower energy that two evaluations find, by `push` (0.1) as the largest per-atom displacement of the whole move, and the refinement climbs again from there seeded with the reaction mode and with its alignment test off.
That is the downward search of Yin, Wang, Chen, Zhang, and Zhang, Phys. Rev. Lett. 124, 090601 (2020), doi:10.1103/PhysRevLett.124.090601, which leaves an index-k saddle along its unstable directions for saddles of lower index.
The climb maximizes along one mode and minimizes along the rest, the index-1 case of the high-index saddle dynamics of Yin, Zhang, and Zhang, SIAM J. Sci. Comput. 41, A3576 (2019), doi:10.1137/19M1253356.
A band with `min_mode` set to `None` climbs under the default `MinModeRefine` for that climb alone.
The step that pushes reports `Running` with the index it left, and the next convergence is certified again.
Each later attempt pushes twice as far as the one before, and after `max_attempts` (2) pushes the band reports the index it has.
The other images keep their band positions, as after any refinement.

On the slab of `tests/band_fixed_atoms.rs` the band and its start map onto themselves through the mirror plane of the adatom's row, and every stepper converges its climbing image on that mirror.
At `force_tol` 1e-4 FIRE with and without the refinement, L-BFGS, and FIRE and ODE12r with the exponential metric stop at -50.6503755.
A central-difference Hessian on the 84 free coordinates there has the eigenvalues -1.3788, -0.1643 and -0.0592, then 0.0379.
The lowest is even under the mirror and carries the hop; the other two are odd, so the symmetric band never feels them, and 82% and 62% of their weight sits on the top substrate layer.
At `force_tol` 1e-3 the check reports index 3 for FIRE, L-BFGS, quick-min, ODE12r and the trust-region band in 58 to 60 image evaluations, with the curvatures -1.3798, -0.1640, -0.0590 and 0.0379 for FIRE, which takes 141 force rows with the check and 81 without it.
With the escape, FIRE at `force_tol` 1e-4 pushes once and converges at -50.6761677129, index 1, curvature -0.9133, the image 0.559 Å off the mirror.
It takes 264 force rows: the 153 of the run without the escape, 5 for the push, 36 for the climb and 70 for the second certificate.
ODE12r with the exponential metric reaches -50.6761677247 the same way in 214 rows.
At `force_tol` 1e-3 the escape reaches the first-order saddle from FIRE, L-BFGS, quick-min, ODE12r, the trust-region band, FIRE with the metric and plain CI-NEB, in 198 to 510 force rows.

## Image threads and repeated evaluations
`BandSession::set_image_threads(threads)` evaluates the band on a pool
of `threads` workers that the session keeps.
Each surface call is split into `min(threads, rows)` contiguous image
blocks, one `BandSurface::eval` per block, and the answers are stored at
their image indices once every block has finished.
The tangent, spring, projection and optional preconditioned solve are
also split by image on that pool.  Each worker writes only its image's
fixed output slice, and errors are read back in image order.
One thread is the default and leaves the band as it was; zero threads is
refused.
When the surface's answer for a row depends on that row alone, the band,
its forces and its trajectory are bitwise those of one thread, and the
first failing image is the one reported.
A surface that tells the whole-band evaluation from an interior one by
the row count stays at one thread, as for `AutoNebTuning::threads` in
`howto/autoneb`.

The session keeps the buffers of the force assembly (the tangent, spring
and projection of every image and the energy-weighted spring constants)
from one evaluation to the next, so a warm step allocates as often at 13
images as at 5.
A band the session already holds does not go to the surface again: the
accepted band and the band before it answer a repeated request, so a
stepper that rejects a trial and returns to its start, as ODE12r does,
makes no surface call for it.
The assembled projected force is cached with that surface answer.  With
the exponential metric its preconditioned driving force is cached too,
so an ODE12r rejection does not repeat the per-image PCG solves.
Metric neighbour construction uses linkcell's nearest-neighbour and
cutoff walks, including minimum images in triclinic cells, rather than an
all-pairs scan.
The projected trust-region method (RTR) keeps the Hessian-vector
products around its current base until the base, the climbing image or
the force gate changes, so the step after a rejection reuses them.
None of this changes a step of the band methods of Goswami, Gunde and
Jonsson, Front. Chem. 14 (2026), doi:10.3389/fchem.2026.1807063, and
Henkelman, Uberuaga and Jonsson, J. Chem. Phys. 113, 9901 (2000),
doi:10.1063/1.1329672.

### Measured scaling
The not-a-knot reparametrization solves the spline's tridiagonal
second-moment equations in linear work per coordinate.  Its cost
therefore grows as the number of images times the number of Cartesian
coordinates, rather than cubically in the image count.
`cargo bench --bench band_scaling` is a small regression smoke check for
one preconditioned band step and a 64-image spline; campaign-scale timing
belongs to BenchBot.

`examples/band_scaling.rs` times a climbing-image band with FIRE on an
adatom hop of an all-pairs Lennard-Jones cluster (the sites of a
face-centred cubic lattice nearest the origin).
The runs below compare this code with its parent, which has no image
threads, so the parent always runs on one thread.
Each point is six blocks of four serial runs, parent, change, change,
parent, and every run of a point printed the same trajectory hash.
A pair is two neighbouring runs of one block; its ratio is the parent's
time over the change's time.
The tables give the median time per step with its interquartile range
(IQR) and the median of the twelve paired ratios.
The machine had 8 Intel Xeon cores, one thread per core, Linux 6.12 and
rustc 1.99.1.

(../../source/figures/band-scaling/strong.png)

Strong scaling keeps the band at 16 interior images:

| Atoms | Threads | Parent, ms | Change, ms | Speedup (IQR) | Wins |
| --- | --- | --- | --- | --- | --- |
|    64 |       1 |      0.213 |      0.202 | 1.05 (1.04-1.08) | 11/12 |
|    64 |       8 |      0.206 |      0.136 | 1.52 (1.44-1.75) | 12/12 |
|   512 |       1 |      9.71  |      9.59  | 1.01 (1.00-1.03) |  9/12 |
|   512 |       2 |      9.69  |      5.69  | 1.69 (1.55-1.74) | 12/12 |
|   512 |       4 |      9.40  |      3.79  | 2.48 (2.20-2.71) | 12/12 |
|   512 |       8 |      9.55  |      2.21  | 4.36 (4.12-4.45) | 12/12 |

At one thread the change gains only the buffers: 5% at 64 atoms, where
the surface takes 0.15 ms of a 0.21 ms step, and 1% at 512 atoms, where
it takes 8.5 of 9.1 ms.
Three things hold 512 atoms at 4.36 on 8 threads.
Timing every block over five runs gives medians, which need not add up,
of 2.09 ms per step: 0.67 ms outside the surface call, which stays
serial, and a surface window of 1.34 ms around blocks of 1.16 ms on
average.
The serial part was 0.52 ms on one thread: the FIRE update, the force
assembly and the band copies.
Splitting and joining the blocks adds 0.15 ms to it.
The blocks together spend 9.26 ms of CPU against 8.55 ms on one thread.
Eight serial runs at once did not slow one another (10.9 ms against 10.7
ms per step), so that 8% lies inside the threaded process; its cause is
not isolated.
With 0.67 ms serial, 8 threads cannot pass 5.2 times.
The image count bounds the rest: the longest block holds `ceil(16/T)`
images, which makes the plateaus at 4 and 5 threads and at 6 and 7 in
the figure.
At 64 atoms one image costs about 9 microseconds, and the split adds
0.05 ms outside the surface and 0.03 ms inside, most of the 0.13 ms that
8 threads could save.

(../../source/figures/band-scaling/weak.png)

Weak scaling grows the work with the threads.
With 256 atoms and 2T interior images, the change goes from 0.31 ms at
one thread to 0.96 ms at 8, an efficiency of 0.33, and runs 2.61
(2.51-2.71) times as fast as the parent at 8.
The serial assembly and FIRE update grow with the image count here.
With 8 interior images and 128 sqrt(T) atoms, the surface work per
thread of an all-pairs cluster stays fixed and the serial part grows
only with the coordinate count: 0.34 ms to 0.69 ms, an efficiency of
0.50, 3.49 (2.80-3.79) times the parent at 8, 12 of 12 pairs.

(../../source/figures/band-scaling/serial.png)

RTR runs 100 steps at one thread on 8 interior images.
The memo removes 46% of the surface rows at 128 atoms (13434 to 7258)
and runs 1.71 (1.69-1.72) times as fast.
At 38 and 256 atoms fewer products repeat after a rejection: 9% of the
rows go (16546 to 15018) and 5% (75642 to 71770).
At 256 atoms that is 1.03 (1.01-1.04), 12 of 12 pairs.
At 38 atoms a row costs about 5 microseconds, the saved rows would be
about 9% of the time, and the ratio is 1.005 (0.98-1.04), 7 of 12: at
that size the copies and comparisons of the memo cost about as much as
the rows they save.

### Reproduce
Build the example on both commits.
On a parent without `set_image_threads`, replace that call with
`assert_eq!(threads, 1);`.
Then, from the repository root:

```sh
cargo build --release --example band_scaling
python docs/source/figures/band-scaling/run.py \
    <parent-binary> target/release/examples/band_scaling target/scaling
uv run --no-project --with matplotlib --with numpy \
    python docs/source/figures/band-scaling/plot.py target/scaling
```

## Artificial force induced reaction (AFIR) fragment pull

The `afir` module supplies the fragment-pull force of the artificial force induced reaction (AFIR) method of Maeda and Morokuma, J. Chem. Phys. 132, 241102 (2010), doi:10.1063/1.3457903 [maedaAfir2010]. `afir_force` and the fallible `try_afir_force` pull two disjoint atom fragments together along the line connecting their centroids with total magnitude `alpha`; each atom in a fragment receives an equal share `alpha / len`, and atoms outside both fragments receive zero force. The host adds the returned array to its calculator force before stepping a minimizer or band.

```rust
use rgsaddle::afir::{afir_force, try_afir_force};

let positions = [[0.0, 0.0, 0.0], [2.0, 0.0, 0.0]];
let force = try_afir_force(&positions, &[0], &[1], 1.0)?;
assert_eq!(force, afir_force(&positions, &[0], &[1], 1.0));
assert_eq!(force, vec![[1.0, 0.0, 0.0], [-1.0, 0.0, 0.0]]);
```

## Double-ended connect and stabilized quasi-Newton (SQNM)

`connect` (`ConnectConfig`, `ConnectReport`, `ConnectProfile`) runs a double-ended saddle search between two endpoint geometries. It first relaxes an IDPP initial path (Smidstrup, Pedersen, Stokbro, and Jónsson, J. Chem. Phys. 140, 214106 (2014), doi:10.1063/1.4878664 [smidstrupImprovedInitialGuess2014]) and launches a Lanczos minimum-mode climb from the highest interior image along the improved tangent (Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063 [goswamiEnhancedClimbingImage2026]; Olsen, Kroes, Henkelman, Arnaldsson, and Jónsson, J. Chem. Phys. 121, 9776 (2004), doi:10.1063/1.1809574 [olsenComparisonMethodsFinding2004]). When that climb does not settle on an index-1 saddle, `connect` falls back to the COMPASS two-image constrained walk of Sommer-Jörgensen and Goedecker, J. Chem. Phys. 160, 064110 (2024), doi:10.1063/5.0186903 [sommerJorgensenCompass2024], driven by the stabilized quasi-Newton method (SQNM) of Schaefer, Ghasemi, Roy, and Goedecker, J. Chem. Phys. 142, 034112 (2015), doi:10.1063/1.4905665 [schaeferStabilizedQuasiNewton2015], with node quenching after splits as in Carr, Trygubenko, and Wales, J. Chem. Phys. 122, 234903 (2005), doi:10.1063/1.1931587 [carrFindingPathways2005].

```rust
use rgsaddle::{ConnectConfig, connect};

let left = [-1.0, 0.0, 0.0];
let right = [1.0, 0.0, 0.0];
let config = ConnectConfig::default().with_forcetol(1e-3).with_nsteps(200);
let report = connect(
    |x| {
        let (px, py, pz) = (x[0], x[1], x[2]);
        let e = (px * px - 1.0).powi(2) + 2.0 * py * py + 2.0 * pz * pz;
        Ok((e, vec![4.0 * px * (px * px - 1.0), 4.0 * py, 4.0 * pz]))
    },
    &left,
    &right,
    &config,
)?;
assert_eq!(report.kind, 's');
assert!(report.position[0].abs() < 1e-3);
```

## Dynamic NEB
`BandConfig::dynamic` is off unless set. `DynamicNeb::default()` is ASE 3.29 `DyNEB`: `fmax` 0.05 and `scale_fmax` 0. `with_fmax` and `with_scale_fmax` change them. `fmax` is the largest per-atom Euclidean norm of the projected force, the optimizer's `fmax`, which is a different number from the band's `force_tol` (the largest absolute component). This follows Lindgren, Kastlunger, and Peterson, J. Chem. Theory Comput. 15, 5787 (2019), doi:10.1021/acs.jctc.9b00633 [lindgrenScaledDynamicOptimizations2019].

An interior image whose norm is strictly below `fmax * (1 + distance * scale_fmax)` is left where it is. `distance` is the Euclidean norm of the coordinate difference from the highest-energy image, with no minimum image. That image keeps the energy and the Cartesian force from the last time it was evaluated. The spring and the tangent still include it. The highest-energy image is never given a zero force. When a neighbour moves far enough that the projected force exceeds the threshold, the image is evaluated again.

The climbing-image min-mode refinement is a separate phase and does not use this mask. The force the session reports is the projected force before that mask. The optimizer sees the masked force, and a step that leaves the band where it was stops when that masked force is under `force_tol`. An image whose force was not cleared stays free while its own convergence force is still above `force_tol`. An image the mask cleared stays pinned, so the reported force can remain above `force_tol` when the step stops. A solid-state band, the trust-region stepper, the simplified string method, and the free-end adaptive NEB refuse the option. `BandSession::set_dynamic` and `rgsaddle_band_set_dynamic` change it between steps. `rgsaddle_dyneb_mask` applies the same mask to a band the host has already projected. `rgsaddle.ase.DyNEB` is the ASE call; `rgsaddle.ase.NEB` still refuses `dynamic_relaxation`, `fmax`, and `scale_fmax`.

# Grow a band with AutoNEB (`docs/orgmode/howto/autoneb.org`)

> AutoNEB window insertion and spring scaling

AutoNEB starts from the endpoints, inserts an image where the band is coarsest, relaxes that neighbourhood, and climbs at the end. The climbing image and the dimer are one Householder reflection: Goswami, Gunde, and Jónsson, Front. Chem. (2026), doi:10.3389/fchem.2026.1807063. The band and this climb stage follow that step, then Chill et al., Modelling Simul. Mater. Sci. Eng. 22, 055002 (2014), doi:10.1088/0965-0393/22/5/055002, with eOn v2.9.0.1, doi:10.5281/zenodo.18529496, then Kolsbjerg, Groves, and Hammer, J. Chem. Phys. 145, 094107 (2016), doi:10.1063/1.4961868.

On the double well, AutoNEB used more force calls than one fixed CI-NEB: 1.42 times as many, median 71 against 52, with a 95% BCa interval of 1.33 to 1.52 over 32 paired seeds. Prefer CI-NEB for that single barrier. Müller-Brown from B to C has mean ratio 0.46 (median 268 against 762, interval 0.35 to 0.79) over 31 paired seeds. The two-barrier path from A to B through the intermediate minimum has mean ratio 0.95, interval 0.81 to 1.23, medians 643 and 740, over 32 paired seeds. A pair with a censored side is dropped. Zoom-NEB (`BandConfig::zoom`, `ZoomConfig`) is an opt-in adaptive windowing refinement on `BandSession`, not a growth method.

## Minimal example
`BandConfig::autoneb` carries the tuning. `None` is a fixed band. `AutoNeb::new` reads that tuning, or the defaults when it is `None`.

```rust
let config = BandConfig::default()
    .with_autoneb(AutoNebTuning::default().with_n_simul(3).with_n_max(7));
let mut search = AutoNeb::new(config, endpoints)?;
let report = search.run(&surface)?;
```

`run` is one shot. A second call is refused. The reactant stays where the host placed it. With `BandConfig::remove_rotation_and_translation` off, the product stays as well. With the fit on, the session places every later image of the window, including the right image, in the frame of the stored left image, and the search writes that fitted window back. The stored path is the path the session optimized. The energies are the energies of those fitted images, so the path, the energies and both endpoints are one band.

## What the knobs do
The knobs are the fields of `BandConfig::autoneb`.

| Field                | Default | ASE name             | Role                                                                                     |
| --- | --- | --- | --- |
| `n_simul`            | 3       | `n_simul`            | Free images in a local window. The window pins one image on each side.                  |
| `n_max`              | 7       | `n_max`              | Images at the end, endpoints included. At least `n_simul + 2`.                           |
| `local_force_tol`    | 0.1     | `fmax[0]`            | Force stop for every window before the climb.                                           |
| `local_max_steps`    | 100     | `maxsteps[0]`        | Step cap for those windows.                                                              |
| `climb_max_steps`    | 2000    | `maxsteps[1]`        | Step cap for the climbing window.                                                        |
| `space_energy_ratio` | 0.5     | `space_energy_ratio` | Threshold between the longest segment and the peak-weighted energy gap.                 |
| `climb`              | on      | `climb`              | Arm the climbing image after the last insertion.                                        |
| `full_band`          | off     |                      | Also relax the full band after the climbing window. ASE stops without this stage.       |
| `threads`            | 1       |                      | Image-evaluation threads. ASE's world size is the nearest name, and it is not this knob. |
| `record_samples`     | off     |                      | Store one `f64` per degree of freedom per force call. Off stores nothing and takes no lock. |
| `interpolant`        | linear  | `interpolate_method` | Placement of new images. `Idpp` uses pair distances and `Trics` uses internal coordinates. |

Construction fills the band to `n_simul + 2` by cutting the longest segment, one image at a time. Each image is the minimum-image midpoint. ASE's AutoNEB, given only the two endpoints, places `n_simul` images in one equal-spaced interpolate. The two fills meet on a unit segment when `n_simul` is 1 or 3, and they differ for 2.

`run` then relaxes a local window, inserts one image, and repeats until `n_max`. The window is ASE's `which_images_to_run_on`. `nneb` starts at `h - 1 - n_simul / 2`, where `h` is the highest-energy image, endpoints included. Ties keep the lower index. The four clamps are `max(nneb, 0)`, `min(nneb, n - n_simul - 2)`, `min(nneb, first_missing - 1)`, and `max(nneb + n_simul, last_missing) - n_simul`. `first_missing` and `last_missing` look only at interior images. The ends then walk outward until both hold an energy.

The peak-weighted gap of a segment is the absolute value of `(E[j+1] - E[j]) * (E[j+1] + E[j] - 2 E_min) / (2 (E_max - E_min))`. `f_R` is the longest length over the endpoint separation. `g_R` is the largest weight over `(E_max - E_min)`. The longest segment is cut when `g_R` is not positive or `f_R / g_R` exceeds `space_energy_ratio`. Otherwise the largest weight is cut. Ties keep the lower index, including `+0.0` against `-0.0`.

Climbing uses `BandConfig::climbing`: `BandConfig::default()` sets `CiConfig::after(0.5)`, with trigger factor 0 and trigger force 0.5, and `None` falls back to trigger factor 0.5 and trigger force 0 when `climb` is on. The climbing window and, when `full_band` is set, the full band stop at `BandConfig::force_tol`. Buildup leaves climbing off. The default leaves `full_band` off and stops after the climbing window, as ASE and the paper do. The extra stage costs calls: on the same budget comparison its median was 30 on the double well, 315 from B to C, and 285 from A to B, and it raised the two-barrier call ratio to 1.70 over 31 paired seeds. A pair with a censored side is dropped.

## How it differs from ASE
The inserted image is the minimum-image midpoint. The fill from two endpoints cuts one midpoint at a time, while ASE places `n_simul` images in one interpolate. The Müller-Brown comparison uses FIRE 1.0, ASE's original FIRE, with this crate's step cap of 2.5 times the starting step. Both codes then insert at index 2 and then at index 1.

`AutoNebInterpolant::Linear`, the default, places that midpoint. ASE's AutoNEB defaults to `interpolate_method='idpp'` and interpolates the three images `[left, copy, right]` of the cut segment. `AutoNebInterpolant::Idpp` does the same for every new image, the fill included: the target pair distances are the mean of the two segment ends, as in Smidstrup, Pedersen, Stokbro, and Jonsson, J. Chem. Phys. 140, 214106 (2014), doi:10.1063/1.4878664. The relaxation is this crate's L-BFGS with `IdppConfig`, not ASE's MDMin, and pair distances use the minimum image when `BandConfig::cell` is set. That cell must have three non-zero, independent rows. With two endpoints and one free image the fill is the interior row of `idpp_path` with three images. A single atom has no pairs, so both interpolants place the same image.

`AutoNebTuning::with_trics` constructs a seven-image TRICS path on the cut
segment and inserts its middle image.  It is an option of the tuning, not a
variant of `AutoNebInterpolant`, so `interpolant` must stay `Linear` while it
is set.  A local iterative-inversion failure or degenerate midpoint returns a
solver error.  It requires unwrapped nonperiodic coordinates.  See
`howto/path-initialization` for choosing the seed.

## One session per unchanged window
An unchanged window keeps its `BandSession`, so the L-BFGS pairs survive the moment climbing is armed on those same images. A new index set starts with empty memory. The optional full band is a new session when it is not the same index set as the local window.

## Force calls and threads
`AutoNebReport::surface_rows` counts force calls. One row of `BandSurface::eval` is one call. Known endpoint energies are seeded into a new window, so those two images are not evaluated again. A window that stops on its step cap clears only the free images.

`threads` changes speed only for a surface whose rows do not depend on the batch they arrive in. There is no SIMD path. Above 1, one thread pool lasts for the whole search. Each evaluation is split into contiguous blocks, one per rank, and the block is stored at its image index after every rank has finished. The inserted image does not depend on which block finished first. A warm step evaluates the free images of the window, so that step is capped by `n_simul`. A release timing runs AutoNEB to convergence with L-BFGS at the default step caps, on the double well and on Müller-Brown from B to C, with at least 1 ms of spin per row and the median of five interleaved repetitions. FIRE does not bring the `n_simul` 8 double well under the force tolerance inside the climb cap, so the timed runs use L-BFGS. The double well at `n_simul` 3 is 11 force calls and goes from 12.1 ms to 4.55 ms at 8 threads. At `n_simul` 8 it is 378 calls, with 46 batches of 8 free images, and goes from 416 ms to 56.7 ms (7.35 times, efficiency 0.92). Müller-Brown from B to C at `n_simul` 3 is 263 calls and goes from 291 ms to 108 ms. At `n_simul` 8 it is 1602 calls, with 199 batches of 8, and goes from 1765 ms to 231 ms (7.63 times, efficiency 0.95). A pool microbenchmark of 16 images is separate. Its spawn-and-join cost is 0.015 ms per call at 8 threads.

One thread evaluates the batch in a single call. The surface then sees one block per call when `threads` is above 1. A host that tells a whole-band evaluation from an interior evaluation by the row count should leave `threads` at 1.

## Springs
The search keeps a private per-segment spring list. A fill from two endpoints sets every segment to `k * (n_simul + 1)`. Each later insertion replaces the cut segment with two segments of twice that constant. A start that already holds more than two images doubles on every fill insert. A weighted or Onsager-Machlup spring supplied on `BandConfig` is refused. The refusal is temporary: zoom-NEB will recompute those springs on insertion. The solid-state block is not part of this loop.

# Optimize a fixed-energy tunnelling path (LI-NEB) (`docs/orgmode/howto/line-neb.org`)

> Fixed-energy line-integral NEB, endpoint policy, and motion along the path

## What is optimized
At a fixed energy `E` below the barrier, the optimal JWKB tunnelling path between two classical turning points minimizes the abbreviated action. Ásgeirsson, Arnaldsson, and Jónsson, J. Chem. Phys. 148, 102334 (2018), doi:10.1063/1.5007180 [asgeirssonEfficientEvaluationAtom2018], find that path with a line-integral extension of the nudged elastic band (LI-NEB). The band itself is the nudged elastic band as practised in Goswami, MethodsX 16, 103899 (2026), doi:10.1016/j.mex.2026.103899 [goswamiReproducibleOrchestration2026], and Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063 [goswamiEnhancedClimbingImage2026].

The module is `line_neb`. Coordinates are mass scaled by a `MassMetric`: a position is a `MetricPoint`, a displacement is a `MetricTangent`, and a force is a `MetricCovector`. The weight `xi_i` covers every image, both endpoints included, so `fixed_energy_action` is the trapezoid

```text
q_i  = sqrt(m) x_i
xi_i = sqrt(2 (E_i - E)) / hbar
S    = sum_i (xi_i + xi_{i+1}) |q_{i+1} - q_i| / 2
```

An endpoint at `E` is a turning point with zero weight. An endpoint above `E` keeps its weight. An endpoint below `E` is refused with `SaddleError::Invalid`, and so is an interior image that does not lie above `E`. On three images at unit spacing with energies 4, 2, and 4 and a fixed energy of 1 the action is `sqrt(6) + sqrt(2)`. `fixed_energy_action_force` is its negative gradient on the interior images; the endpoint weights enter those rows through the two end segments.

## Seed the band
`fixed_energy_mep_seed` starts from an index-one saddle and its unstable mode, for instance the climbing image of a band relaxed from an image dependent pair potential (IDPP) path (Smidstrup, Pedersen, Stokbro, and Jónsson, J. Chem. Phys. 140, 214106 (2014), doi:10.1063/1.4878664 [smidstrupImprovedInitialGuess2014]). Each branch follows the mass-scaled force down from the saddle, places images at equal energy drops by bracketing, and both branches are resampled to equal arc length. `FixedEnergySeed` is non-exhaustive: build it with `Default` and `with_saddle_energy`, `with_target_energy`, `with_images`, and `with_max_evaluations`. The default energies are equal and are refused until both are set. A spent budget is `SaddleError::Invalid` with a message that starts `work budget exhausted`. The opening step off the saddle, and the first bracket of each energy slice, is the square root of machine epsilon times a distance along the path. The opening step uses the distance from the saddle, along the mode of that branch, at which the energy has fallen by a tenth of the first energy drop. A slice uses the distance between the last two images already placed on its branch. Both are measured on the surface in mass-scaled coordinates, so translating the saddle and the surface together leaves the seed unchanged, and a change of length unit scales the step with the coordinates. A mode along which the energy never falls to that level is `SaddleError::Invalid`. The step is fixed for a given saddle, mode, masses, and `FixedEnergySeed`.

## Step the session
`LineNebSession::step` evaluates the band once through `BandSurface` and takes one global quick-min step with a fixed time step, the eOn variant (Goswami et al., eOn v2.9.0.1 (2026), doi:10.5281/zenodo.18529496 [eon2901]). There is no run loop and no force budget; the host decides when to stop.

```rust
let config = LineNebConfig::default()
    .with_energy(target)
    .with_masses(masses)
    .with_spring_k(0.4)
    .with_endpoint_kappa(1.5)
    .with_force_tol(2.0e-6)
    .with_time_step(0.03);
let mut session = LineNebSession::new(config, seed)?;
loop {
    let report = session.step(&surface)?;
    if report.status == LineNebStatus::Converged {
        break;
    }
}
let path = session.positions();
```

`LineNebConfig` is non-exhaustive. Its defaults are unit spring constant and restraint, force tolerance 1e-3, a fixed energy of 0, unit masses (`masses` is `None`), time step 0.1, unit reduced Planck constant (`with_reduced_planck`), and `EndpointBelowEnergy::Restrained`; a host in other units sets every field it relies on.

Each interior image moves under the action force perpendicular to the improved tangent of Henkelman and Jónsson, J. Chem. Phys. 113, 9978 (2000), doi:10.1063/1.1323224 [henkelmanImprovedTangentEstimate2000], plus a uniform spring along it. When the two neighbour energies are equal the weighted tangent points along the secant from the previous image to the next, so on a plateau of three equal energies that secant is used unscaled. Each endpoint moves under the spring perpendicular to its own force and a restraint `endpoint_kappa (E_end - E)` along that force.

`LineNebReport` carries three maxima: `max_interior_perpendicular`, `max_interior_spring`, and `max_endpoint_optimized`. `LineNebStatus::Converged` needs all three within `force_tol`. With one coordinate per image the transverse force is zero by construction and the endpoints can already sit on `E`, so the spring residual is what keeps an unevenly spaced band from stopping early.

## Choose the endpoint policy
Equations 19 to 22 of Ásgeirsson, Arnaldsson, and Jónsson [asgeirssonEfficientEvaluationAtom2018] define the endpoint steepest descent direction. The session works in mass-scaled coordinates, with `f_hat` the unit mass-scaled force and `g_sp` the spring:

```text
q       = sqrt(m) x
force_q = -grad V / sqrt(m)
f_hat   = force_q / |force_q|
g_sp    = k (q_neighbour - q_end)
g_opt   = g_sp - (g_sp . f_hat) f_hat
          + endpoint_kappa (V(q_end) - E) f_hat
```

The projection removes the spring component along the mass-scaled force, which is the direction normal to the isoenergy contour. The positive sign on the last term moves an endpoint above `E` along `f_hat`, which lowers its energy. Below `E` the negative energy difference reverses that direction and raises the energy. In both cases the endpoint returns to the contour `V = E`.

Set the session policy with `with_endpoint_below_energy`:

- `EndpointBelowEnergy::Restrained` is the default and follows the paper's scheme. The session gives an endpoint below `E` zero action weight, as at a turning point, while the restraint returns it to the contour. The session continues, and `LineNebReport::action` equals `fixed_energy_action` again when both endpoints are at or above `E`. A converged restrained session can still sit slightly below `E` when the band approaches the contour from below, because convergence tests the force residual rather than the energy. `fixed_energy_action` then still returns `SaddleError::Invalid`.
- `EndpointBelowEnergy::Strict` stops immediately and never substitutes a turning point weight. It returns `SaddleError::Invalid`, so the error enum is unchanged. The message names the endpoint (`first` or `last`), the signed difference `V - E`, and the one-based session step. `LineNebEndpointViolation` carries those three fields, and `LineNebSession::endpoint_violation` reads them. The failed step does not advance the session.

## Dynamics along the path
`FixedEnergyTrajectory` splines a converged path in mass-weighted coordinates from a `MassMetric` and integrates the motion on the inverted potential along it, the dynamics Ásgeirsson, Arnaldsson, and Jónsson use to find the temperature at which the path is an instanton. `FixedEnergyTrajectory::from_gradients` requires finite positions and gradients and positive finite masses, and returns `SaddleError::NonFinite` or `SaddleError::Invalid` rather than building a path from a bad input. `FixedEnergyTrajectory::from_images` runs the checks that need only positions and masses (shape, finiteness, positive masses, nonzero arc length) before its first surface call, so a surface is never evaluated on input it would refuse. Both splines are a `Spline` with `SplineEnds::Natural`, zero curvature at the end knots; string reparametrization keeps the not-a-knot spline. `Spline::new` with `SplineEnds::NotAKnot` uses the same knot, shape, and finiteness checks as `SplineEnds::Natural` and returns the same typed error. `Spline::sample` returns a `SplineSample` with the value and the first two derivatives. `half` runs from the left turning point until the path ends or the velocity turns back and returns one `TrajectoryPoint` per step, `period` is twice that time, and `arc_at_time` interpolates the arc between stored points. A spent step budget is `SaddleError::Invalid` with a message that starts `work budget exhausted`.

## Units
None are prescribed. Positions, energies, masses, `hbar`, the spring constant, the restraint, and the time step form one consistent system: `hbar` has units of energy times time, the spring maps a mass-scaled displacement to an action-gradient force, and `endpoint_kappa` times an energy has those same force units.

# Follow a minimum mode (`docs/orgmode/howto/minmode.org`)

> Dimer, Lanczos, soft-mode seeding, surrogate Hessian actions, saddle index, and ARTn protocol

## Runnable example: dimer, Lanczos, soft-mode seeding, and surrogate Hessian actions (GP methods)

The dimer and Lanczos minimum-mode searches share one Householder reflection of the force: Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063, Eq. 9, and Goswami, arXiv:2603.10992 (2026), doi:10.48550/arXiv.2603.10992, Eqs. 2.14-2.16. Gaussian process (GP) accelerated saddle searches and adaptive pruning of the GP training set follow Goswami, Masterov, Kamath, Peña-Torres, and Jónsson, J. Chem. Theory Comput. 21, 7935 (2025), doi:10.1021/acs.jctc.5c00866, and Goswami and Jónsson, ChemPhysChem 27, e202500730 (2026), doi:10.1002/cphc.202500730, with performance and force-call accounting from Goswami, AIP Advances 15, 085210 (2025), doi:10.1063/5.0283639. The dimer rotation follows Henkelman and Jónsson, J. Chem. Phys. 111, 7010 (1999), doi:10.1063/1.480097, Heyden, Bell, and Keil, J. Chem. Phys. 123, 224101 (2005), doi:10.1063/1.2104507, and Kästner and Sherwood, J. Chem. Phys. 128, 014106 (2008), doi:10.1063/1.2815812; the Lanczos mode estimate follows Olsen, Kroes, Henkelman, Arnaldsson, and Jónsson, J. Chem. Phys. 121, 9776 (2004), doi:10.1063/1.1809574. `soft_mode_then_full_directions` (`SoftModeDirectionPlan`, `spectral_gap_rank`) recovers a sparse Hessian at a minimum, picks the soft-subspace rank from the largest spectral gap, and emits unit initial directions.

A Gaussian-process surrogate or analytic potential implements `PointSurface` and can supply exact directional Hessian actions through `PointSurface::hessian_vector` (or `WithHessian` in `indexk`) so Lanczos and block-Lanczos mode estimates run on the surrogate without finite-difference probes, while `MinModeSession::reset` drops optimizer history at each surrogate model-update boundary.

```rust
use ndarray::{Array1, ArrayView1, array};
use rgsaddle::{
    MinModeConfig, MinModeKind, MinModeSession, MinModeStatus, PointSurface, SaddleError,
};

struct SurrogateDoubleWell;

impl PointSurface for SurrogateDoubleWell {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let (px, py, pz) = (x[0], x[1], x[2]);
        let e = (px * px - 1.0).powi(2) + 2.0 * py * py + 2.0 * pz * pz;
        Ok((e, array![4.0 * px * (px * px - 1.0), 4.0 * py, 4.0 * pz]))
    }

    fn hessian_vector(
        &self,
        x: ArrayView1<f64>,
        v: ArrayView1<f64>,
    ) -> Result<Option<Array1<f64>>, SaddleError> {
        let hxx = 12.0 * x[0] * x[0] - 4.0;
        Ok(Some(array![hxx * v[0], 4.0 * v[1], 4.0 * v[2]]))
    }
}

fn main() -> Result<(), SaddleError> {
    let start = array![0.3, 0.2, 0.0];
    let seed = array![1.0, 0.0, 0.0];

    let mut dimer = MinModeSession::new(
        MinModeConfig::default().with_kind(MinModeKind::Dimer),
        start.clone(),
        seed.clone(),
    )?;
    let d_rep = dimer.run(&SurrogateDoubleWell, 200)?;
    assert_eq!(d_rep.status, MinModeStatus::Converged);

    let mut lanczos = MinModeSession::new(
        MinModeConfig::default().with_kind(MinModeKind::Lanczos),
        start,
        seed,
    )?;
    let l_rep = lanczos.run(&SurrogateDoubleWell, 200)?;
    assert_eq!(l_rep.status, MinModeStatus::Converged);
    Ok(())
}
```

`MinModeSession` estimates a low-curvature direction by dimer rotation or Lanczos, then advances on the min-mode force. L-BFGS takes `Accept::Step` and rgmin's NEB guards: the reflected force is not a potential gradient (Goswami, Gunde, and Jónsson, Front. Chem. (2026), doi:10.3389/fchem.2026.1807063, Eq. 9), an empty memory scales the step by 0.01, and a two-loop step that reaches the per-atom cap or faces away from the force drops its pairs. In Rust, a `MinModeConfig` with `rotation_tol < 1e-4` drops the default five-degree dimer angle stop unless `with_rotation_angle_tol` set it explicitly. Lanczos reads `rotation_tol` as a dimensionless tolerance on the lowest Ritz residual divided by the absolute Ritz value and, while `set_lanczos_rel_tol` is unset, as its relative Ritz-value tolerance. A Ritz value whose magnitude is at most 1e-14 of the curvature scale, the largest Hessian action norm the estimate has formed, divides the residual by that scale. Only in that unset case and with `rotation_tol >= 1e-4` does Lanczos infer the classic torque window, which stops once two vectors leave that ratio under 1, dividing by the same scale when the Ritz value is that small. A repeat visit whose Rayleigh quotient still agrees with the retained curvature returns after one product (Olsen, Kroes, Henkelman, Arnaldsson, and Jónsson, J. Chem. Phys. 121, 9776 (2004), doi:10.1063/1.1809574; eOn `quit_early`). While the curvature along that mode is not negative the step moves the largest atom by `max_move` along the mode, as eOn's FIRE and L-BFGS do, and the perpendicular force is dropped. Under `set_cg_translate` that step has Euclidean norm `max_move`, as in eOn's conjugate gradients. A parallel gradient within half that step of the minimum of the parabola along the mode keeps the mode's orientation. Once the curvature is negative the perpendicular force stays and the parallel part is reflected, and the L-BFGS pairs and the FIRE velocity survive a mode turn inside 45 degrees. A turn past that cone drops the memory and zeros the FIRE velocity. FIRE opens at timestep 1.0 and has a ceiling of 2.5. When the per-atom cap shortens a negative-curvature step and the arrival is no longer negative, the move is replaced from the last negative point by 0.01 times the reflected force, the empty-memory scale of the L-BFGS guard. A capped step that stays negative is kept. L-BFGS is unchanged, and no C field was added. Lanczos uses the same translation. `FiniteDifference` selects forward or central Hessian actions. A surface can supply analytic actions and excluded directions through `PointSurface`.

The reported force norm must satisfy the selected `ForceGate`, and the estimated curvature must be negative. If a translation reaches a stationary point, the session measures curvature at that accepted position before reporting convergence. This directional test does not certify the full Hessian index; the saddle check below does.

`set_kappa` selects the basin constraint. `set_highs` selects the optional feasible-step control. Call `reset` at a surface change and use `set_force_gate` to select the physical stopping norm.

### Certify the saddle index

`MinModeConfig::saddle_check` holds a `SaddleIndexCheck`, on by default.
At the first converged step at a position the session estimates the lowest curvatures there by block Lanczos on forward-difference Hessian actions, one gradient each, seeded with its own mode and pseudo-random vectors, off the directions that `PointSurface::excluded_modes` names; `index` counts those under `-negative_tol` (1e-3).
The controls and the method are those of the band's check in `howto/band`.
A coordinate that is zero in the gradient and stays zero under one forward action along all such coordinates is left out as well, so a host that zeroes the force on the atoms it holds needs no exclusion for them.
`MinModeReport::saddle_index` carries the result and its evaluations count in `MinModeReport::evaluations`; `MinModeSession::saddle_index` returns it while the session stays at that position, and `saddle_evaluations` and `saddle_escapes` sum the session's.
The search takes the same steps with the check on or off, and `with_saddle_check(None)` or `set_saddle_check(None)` turns it off.
A first-order saddle has one negative Hessian eigenvalue, the count eOn requires of the saddle Hessian it builds for a prefactor.
A start that shares a symmetry with the surface can stop the search on a saddle of higher index, since a mode the symmetry keeps out of the force never moves the point; Zhang and Du, SIAM J. Numer. Anal. 50, 1899 (2012), doi:10.1137/110843149, Theorem 3.2, show that such a point is a fixed point of the Euler scheme of shrinking dimer dynamics, though not a contractive one.

With `SaddleIndexCheck::escape` set to a `SaddleEscape`, a converged point of index two or more keeps the negative Ritz vector closest to the session's mode as the reaction mode, moves by `push` (0.1, the largest per-atom displacement) along the other negative modes, each to the side of lower energy that two evaluations find, and searches again from there along the reaction mode.
That is the downward search of Yin, Wang, Chen, Zhang, and Zhang, Phys. Rev. Lett. 124, 090601 (2020), doi:10.1103/PhysRevLett.124.090601, at index one.
The step that pushes reports `Running` with the index it left; a later attempt pushes twice as far, and after `max_attempts` (2) the session reports the index it has.
`set_position` to a new point, `reset` and `set_saddle_check` start the attempts again.

On the frozen-layer Morse slab of `tests/band_fixed_atoms.rs`, Lanczos started on the stationary point of index 3 that the symmetric band converges to, with the band tangent as its mode and `force_tol` 1e-4, certifies index 3, pushes once, and converges on the first-order saddle at -50.6761672669 with index 1, in 1292 evaluations, 126 of them for the two certificates and the push.
At `force_tol` 1e-3 the dimer and Lanczos both stop after two pushes at index 2, near -50.67580, with curvatures -1.147 and -0.0076: the force falls under the tolerance on that soft second mode before the search leaves it.
The band's escape, whose climb steps on a quasi-Newton model, reaches the first-order saddle at 1e-3 from the same band (`howto/band`).

### Sweep every Hessian mode of a minimum

`hessian_mode_sweep_directions` seeds a saddle search from the Hessian modes of a minimum, soft to stiff, where `soft_mode_then_full_directions` draws random vectors. It recovers the Hessian by central differences over an all-pairs sparsity pattern and diagonalizes it in full, so it costs `6 N` gradient evaluations, `O((3N)^3)` time and `O((3N)^2)` memory for `N` atoms. Above 128 degrees of freedom the diagonalization needs the `faer` feature, and without it the call returns `SaddleError::Solver`.

`rigid_modes` is the number of lowest eigenpairs left out, and it assumes they are the rigid modes of a stable minimum. Each eigenvector takes the sign that makes its first largest-magnitude component positive, so the directions do not follow the sign the eigensolver chose. A direction is the mode plus `carrier` times itself, with the first copy optionally scaled atom by atom by one row of `localization_weights` (entries in `[0, 1]`, rows assigned to modes cyclically), then normalized. Its squared overlap with the mode is at least `(carrier / (1 + carrier))^2`, for every finite positive carrier: the combination is formed at a scale that cannot overflow or underflow, so a carrier of 1e160 or a carrier of 1e-13 on an all-zero weight row still gives the mode direction. A direction that cannot be formed, because the Hessian is not finite, is an error and never a stand-in coordinate axis. The Hessian is recovered with one colour per atom, which is the colouring of the all-pairs pattern, so the call skips the colouring search.

The call returns a `ModeSweepDirectionPlan`. `eigenvalues` is the whole spectrum, ascending. `mode_indices` and `directions` list one entry for every mode that was not skipped, and `minimum_squared_mode_weight` is the overlap bound above.

`mode_sweep_schedule(total_modes, draws)` picks which of those modes to try. The values it returns are positions inside the band `0..total_modes`, not eigenvector columns. A schedule shorter than the band takes the midpoint of each equal-width stratum, so the longest run of modes that nobody visits, ends included, is at most `ceil(total_modes / draws)`. A schedule at least as long as the band visits every mode once before it cycles. The arithmetic is integer, so the schedule is the same on every platform. Neither function draws random numbers, so a sweep is reproducible without a seed.

### Run the ART nouveau push, then relax protocol

`ArtNConfig` is an opt-in protocol around the Lanczos session. The `mode` passed to `MinModeSession::new` is the random basin-exit direction. Before activation, one outer step pushes along that fixed direction and takes a bounded number of steepest-descent steps with the gradient projected perpendicular to it. Lanczos starts only after `lanczos_start` pushes. When its lowest Ritz value is below `eigenvalue_threshold`, activation starts: each outer step warm-starts Lanczos from the previous mode, takes the bounded \( |F_\parallel|/\max(|\lambda|,\lambda_{\rm floor}) \) displacement toward the saddle, and relaxes perpendicular to that mode. `MinModeConfig::default()` has `artn = None`, so dimer and ordinary Lanczos searches do not enter this code.

These are the primary-source protocol statements, quoted rather than inferred from the later efficiency comparisons.

- Malek and Mousseau write that the configuration is "first pushed along a random direction until a negative eigenvalue appears" and "at each step ... relaxed in the hyperplane perpendicular to it"; after the lowest eigenvalue passes their threshold, it is pushed along that eigenvector while the other directions are minimized (Phys. Rev. E 62, 7723 (2000), doi:10.1103/PhysRevE.62.7723, Sec. II, p. 7724). The same paragraph on Lanczos says its iterative scheme "can use the direction of the previous step as a seed".
- Marinica, Willaime, and Mousseau use ARTn for the iron interstitial landscape and introduce efficiency modifications in that application (Phys. Rev. B 83, 094119 (2011), doi:10.1103/PhysRevB.83.094119). The implementation-level account by Cancès, Legoll, Marinica, Minoukadeh, and Willaime describes basin relaxation in the hyperplane orthogonal to the fixed random deformation and activation as alternating an eigenvector move with projected steepest descent. It reports 15 Lanczos iterations for each eigenpair calculation (J. Chem. Phys. 130, 114711 (2009), doi:10.1063/1.3088532, Sec. III, pp. 114711-6–8).
- Jay et al. describe the standard workflow as random increments followed by hyperplane relaxation, with Lanczos delayed for "a few iterations"; activation follows the lowest eigenvector and each push is again followed by perpendicular relaxation (J. Chem. Theory Comput. 16, 6726 (2020), doi:10.1021/acs.jctc.0c00541, "Previous ARTn workflow"). The "ARTn parameters" section reports "6 steps of perpendicular relaxations, after each push", the first eigenpair evaluation "after the third pushing step", an activation count "increased from 5 to 25", and 16 Lanczos iterations (Jay et al. 2020, "ARTn parameters"). Equation 2 gives the 0.5 eV/Angstrom squared denominator floor and says the push cap is "set to 0.2 Angstrom". These reported values set the unit-bearing defaults here. `eigenvalue_threshold` defaults to -0.01 eV/Angstrom squared, at the conservative end of the commonly used -0.01 to -0.05 range; it remains a setter because the papers use system- and unit-dependent thresholds (Malek and Mousseau use a magnitude of \(10^{-3}\) in Lennard-Jones units, while Cancès et al. tabulate -2 for their iron tests). `relaxation_step` is likewise explicit because a steepest-descent scale is unit dependent.

```rust
use rgsaddle::{ArtNConfig, MinModeConfig, MinModeKind, MinModeSession};

let config = MinModeConfig::default()
    .with_kind(MinModeKind::Lanczos)
    .with_artn(ArtNConfig::default());
let mut search = MinModeSession::new(config, displaced_minimum, random_direction)?;
```

The point builder selects the same path with `Stencil::point(x).preset(Preset::Art)`; adding `.artn(ArtNConfig::default().with_eigenvalue_threshold(...))` directly enables it with changed controls. A benchmarking checkout whose optbench template maps the `[ini.SaddleSearch.artn]` table to this builder can reproduce a bounded smoke campaign with:

```sh
OPTBENCH_ROOT=/path/to/optbench RGSADDLE_LIB=target/release/librgsaddle.so RGSADDLE_SRC=$PWD \
  python3 validation/benchmark/pt_island/campaign.py rgsaddle/saddle-artn-lanczos artn-lanczos.json 50
```

The command keeps the campaign's repetition 1, seed 20261016 and displacement sequence. This repository does not record a result from that smoke run.

### Keep one session across a host search

A host that climbs with its own optimizer keeps one session for the whole search. At each new centre it calls `set_position` (`rgsaddle_minmode_set_position`) with the gradient it already has, so the session does not evaluate the centre, then `estimate_mode` (`rgsaddle_minmode_estimate`). The previous mode seeds the next rotation. Dimer rotations also retain their Polak--Ribiere force and direction across a translation; a repeated estimate at exactly one centre restarts that rotational history. A failed surface evaluation leaves the retained rotation history unchanged, so a recoverable callback error does not silently turn the next estimate into a fresh rotation. `set_mode` (`rgsaddle_minmode_set_mode`) replaces the seed and clears both rotational history and the carried curvature. `reset` clears them at a surface-epoch boundary. All three need ABI minor 5 and do not extend the minimum-mode configuration layout.

Lanczos through `rgsaddle_minmode_estimate` advances one Hessian action and keeps the Krylov basis until `set_position`, `set_mode`, or `reset`. Repeat the call until the host's own test on the mode passes. The basis grows to the free dimension rather than stopping at `krylov_dim`. After k actions the returned mode lies in the k + 1 Lanczos vectors: the last is the residual direction the k-th action already produced. In the Lanczos basis an eigenvector's components are the Lanczos polynomials at its eigenvalue (Parlett, The Symmetric Eigenvalue Problem, SIAM (1998), doi:10.1137/1.9781611971163, Ch. 7), and only the known k rows of the tridiagonal enter. The session evaluates them at an estimate of the lowest eigenvalue: the next Ritz value predicted with the last Lanczos diagonal, extrapolated with the two previous Ritz values by Aitken's delta-squared (Aitken, Proc. R. Soc. Edinburgh 46, 289 (1927), doi:10.1017/S0370164600022070) when those fall with shrinking steps. At the Ritz value the same formula is the plain Ritz vector. No surface call is added, and the reported curvature is still the Ritz value of the k vectors, an upper bound on the lowest eigenvalue. Sella 0.1.1 (Hermes, Sargsyan, Najm, and Zádor, J. Chem. Theory Comput. 15, 6536 (2019), doi:10.1021/acs.jctc.9b00869) expands by the same residual at this stage, where it has no Hessian yet to precondition with, and tests the Ritz vector of the vectors it has applied the Hessian to. On `lowest-eigenvector/lj38` that iteration and the plain Ritz vector both take about 16.8 actions per start. `MinModeSession::estimate_mode` and `step` still finish their own stop, the residual test or the torque window, before a translation (Olsen, Kroes, Henkelman, Arnaldsson, and Jónsson, J. Chem. Phys. 121, 9776 (2004), doi:10.1063/1.1809574). A dimer estimate is the full rotation.

These `MinModeConfig` fields set the cost of an estimate and of the translation:

| Field | Effect | Default |
| --- | --- | --- |
| `difference` | `Forward`: one gradient per Hessian action, error \(O(dr)\). `Central`: two, error \(O(dr^2)\) | `Forward` |
| `rotation_angle_tol` | The dimer stops rotating when an iteration's trial or fitted optimal angle falls under this many radians; 0 turns the test off | five degrees |
| `rotation_tol` | Dimer rotational force, in curvature units. At 1e-4 and any looser value a dimer with `rotation_angle_tol` set to 0 also stops after one rotation once that force is under 1. An improved dimer with positive `rotation_angle_tol` leaves the classic window off unless `set_torque_window(Some(true))` enables it. A tighter value drops the default angle stop unless `with_rotation_angle_tol` set it explicitly. Lanczos reads this value as a dimensionless residual, the lowest Ritz residual divided by the absolute Ritz value, and, with `set_lanczos_rel_tol` unset, as the relative change of the lowest Ritz value; a Ritz value whose magnitude is at most 1e-14 of the curvature scale, the largest Hessian action norm the estimate has formed, divides the residual by that scale. Only then and at 1e-4 or looser does it infer the window that stops once two vectors leave that ratio under 1, dividing by the same scale when the Ritz value is that small | 1e-4 |
| `max_rotations` | Rotation cap for one dimer estimate | 20 |
| `max_move` | Largest per-atom translation. A curvature that is not negative takes one step along the mode that moves the largest atom by this length, or one of this Euclidean norm under `set_cg_translate`. The L-BFGS pairs and the FIRE velocity are kept while the mode turns by at most 45 degrees, and dropped past that cone | 0.2 |
| `seed_curvature` | The first empty L-BFGS step uses \(H_0 = 1/\lvert\lambda\rvert\), and the first FIRE displacement uses that scale, when the step fits in `max_move`. Later steps are the stepper's own. `set_seed_curvature` sets the same switch on a live session | off |

From C, `difference` and `rotation_angle_tol` sit in `rgsaddle_minmode_config_t` and are read only when the config's `version.minor` is 5 or more. For config minors 5 through 62, `rotation_angle_tol` is read as given and a zeroed C struct keeps the angle test off. From minor 63, `rotation_angle_tol` set to 0 keeps the default five-degree angle stop at every `rotation_tol` unless flag bit 0, `RGSADDLE_MINMODE_EXPLICIT_ROTATION_ANGLE_TOL`, is set. The C++ helper `minmode_config` leaves that flag clear and `rotation_angle_tol` at 0, so at minor 63 it resolves to the five-degree stop and at older minors it keeps the stop off. Its `rotation_tol` value of 1e-3 is a rotational force in curvature units for the dimer, with the resolved angle stop keeping the inferred dimer torque window off. If the caller changes the helper's kind to Lanczos and leaves `set_lanczos_rel_tol` unset, that value is also the dimensionless Ritz tolerance and infers the Lanczos torque window. The Python point stencil does not take `rotation_angle_tol`; its dimer builder explicitly keeps the default five-degree stop at every `rotation_tol`. `rotation_tol` on that stencil defaults to 1e-4.

`set_torque_window` sets the torque window apart from `rotation_tol`.
From C ABI minor 32 `rgsaddle_minmode_set_torque_window` does the same.
`Some(false)` keeps a loose residual without the window.
eOn's improved dimer does that with its `torque_min` of 0.1.
`Some(true)` adds the window to a tighter residual or to an improved dimer.
`None`, the default, infers the window from `rotation_tol` for Lanczos and for a dimer whose angle stop is off.
Lanczos reads the same window, from C ABI minor 41 as well.
Its first two vectors span the plane of a steepest-descent dimer rotation, and their Ritz vector is that dimer turned to the lowest curvature in the plane (Zeng, Xiao, and Henkelman, J. Chem. Phys. 140, 044115 (2014), doi:10.1063/1.4862410), so the window ends both estimates on the same rotational force.
`Some(false)` runs a Lanczos estimate to its residual, as before minor 41.
Under a host relative tolerance (`set_lanczos_rel_tol`, which the climbing image of a band and the connection driver set), `None` leaves the window off and `Some(true)` adds it.

`examples/minmode_calls.rs` with `RGSADDLE_BENCH_LANCZOS_WINDOW=1` runs Lanczos from the twelve seeded starts of that benchmark with the window off and at the default, into `validation/minmode_lanczos_window.csv`.
The window-off searches are those of the estimate before minor 41, call for call.
Calls are the median and interquartile range over the starts that converge in both arms, and steps and Hessian actions are summed over the same starts.

| System | Translator | Converged off / on | Same saddle | Calls off → on | Steps off → on | Actions off → on |
| --- | --- | --- | --- | --- | --- | --- |
| LJ13 | FIRE | 4 / 3 | 0 | 26726 → 15489 | 2149 → 1267 | 24513 → 14179 |
| LJ13 | L-BFGS | 12 / 12 | 3 | 454 [411, 485] → 422 [358, 476] | 850 → 938 | 5453 → 4597 |
| LJ38 | FIRE | 12 / 12 | 7 | 3316 [2860, 3680] → 3106 [2614, 3380] | 5196 → 6164 | 35313 → 32857 |
| LJ38 | L-BFGS | 12 / 12 | 10 | 628 [607, 680] → 534 [506, 588] | 967 → 1004 | 7157 → 5564 |
| vacancy, 255 atoms | FIRE | 12 / 12 | 5 | 992 [892, 1137] → 1190 [871, 1464] | 1631 → 2178 | 10894 → 17236 |
| vacancy, 255 atoms | L-BFGS | 12 / 12 | 3 | 238 [129, 385] → 340 [150, 549] | 522 → 679 | 3153 → 4529 |
| Müller-Brown | FIRE | 12 / 12 | 12 | 348 [322, 381] → 347 [321, 380] | 1584 → 1584 | 2349 → 2334 |
| Müller-Brown | L-BFGS | 12 / 12 | 12 | 42 [39, 43] → 41 [38, 42] | 151 → 151 | 329 → 314 |

One LJ13 FIRE start converges in both arms.
Where both arms converge, the window takes fewer calls on the two clusters, though LJ13 FIRE converges from one start fewer, and about the same on Müller-Brown.
On the vacancy it takes more, with more steps and more actions.
The climbs follow a different mode, and most LJ13 and vacancy starts reach another saddle, against five of twelve on LJ38 with FIRE and two with L-BFGS.
The window's constants are the dimer's, eOn's `dimer_torque_max` after one rotation; nothing is fitted to these systems or to the pt-island campaign below.

### Stop the rotation on the force error it leaves
`set_rotation_stop_length` turns on the curvature-aware stop of Kästner and Sherwood (J. Chem. Phys. 128, 014106 (2008), doi:10.1063/1.2815812).
From the rotational force \(F\) and the curvature \(C\) the dimer estimates the rotation still to come as \(\omega = \tfrac12 \arctan(F / \lvert C\rvert)\), the trial angle it already uses.
A translation of length \(L\) along a mode that is \(\omega\) off leaves a force error of about \(\lvert C\rvert L \lvert\sin\omega\rvert\), and the rotation stops once that is at most `force_tol`.
The curvature magnitude taken is the larger of \(\lvert C\rvert\) and the two-mode estimate after the rotation, \(C - F\tan\omega\): halfway between a negative and a positive mode the dimer reads \(C \approx 0\) with 45 degrees still to turn (`validation/rotation_force_stop.py`).
The stop adds to `rotation_tol`, the angle test, the torque window and `max_rotations`; whichever fires first ends the rotation.

Lanczos stops on the same bound.
After \(j\) actions the residual of the lowest Ritz pair, \(\lVert H y - \theta y\rVert\), is the rotational force of the Ritz vector \(y\) and \(\theta\) is its curvature, so a positive length also accepts a Ritz pair whose residual satisfies the bound, beside the dimensionless `rotation_tol` residual and the relative Ritz-value test.

The length is the host's translation scale; 0, the default, turns the stop off, and a negative or non-finite length is an error.
From C ABI minor 38 `rgsaddle_minmode_set_rotation_stop_length` does the same, the C++ `MinMode` wrapper has `set_rotation_stop_length`, and Python's `MinMode` takes `rotation_stop_length`.

`examples/minmode_calls.rs` with `RGSADDLE_BENCH_ROTATION_STOP=max_move` runs every system and translator of that benchmark from 12 seeded starts with the stop off and on at \(L\) equal to `max_move` (0.2) and `force_tol` 1e-3.
The sums below are over the starts where both arms reach the same saddle (energy within 1e-6, aligned RMSD within 1e-3).
Their Lanczos rows predate the torque window of minor 41.

| System | Estimator | Translator | Same saddle | Force calls off → on | Rotations off → on |
| --- | --- | --- | --- | --- | --- |
| Müller-Brown | dimer | FIRE | 12/12 | 10415 → 10182 | 3929 → 3828 |
| Müller-Brown | dimer | L-BFGS | 12/12 | 748 → 748 | 326 → 326 |
| Müller-Brown | Lanczos | FIRE | 12/12 | 4013 → 4001 | 2369 → 2357 |
| Müller-Brown | Lanczos | L-BFGS | 12/12 | 492 → 480 | 329 → 317 |
| LJ13 | dimer | FIRE | 10/12 | 4211 → 4056 | 1639 → 1514 |
| LJ13 | dimer | L-BFGS | 12/12 | 1143 → 1143 | 381 → 381 |
| LJ13 | Lanczos | FIRE | 12/12 | 9003 → 9003 | 7241 → 7241 |
| LJ13 | Lanczos | L-BFGS | 12/12 | 6315 → 6315 | 5453 → 5453 |
| LJ38 | dimer | FIRE | 9/12 | 19159 → 19399 | 7063 → 7035 |
| LJ38 | dimer | L-BFGS | 8/12 | 3335 → 3334 | 1731 → 1730 |
| LJ38 | Lanczos | FIRE | 12/12 | 12824 → 12824 | 10456 → 10456 |
| LJ38 | Lanczos | L-BFGS | 12/12 | 8136 → 8136 | 7157 → 7157 |
| vacancy, 255 atoms | dimer | FIRE | 6/12 | 12907 → 12771 | 5881 → 5745 |
| vacancy, 255 atoms | dimer | L-BFGS | 12/12 | 2685 → 2683 | 1395 → 1393 |
| vacancy, 255 atoms | Lanczos | L-BFGS | 12/12 | 3687 → 3687 | 3153 → 3153 |

The vacancy Lanczos FIRE row converges from no start in either arm.
The starts that differ are dimer FIRE and LJ38 dimer L-BFGS runs where both arms converge, to different saddles, or where neither converges; the stop changes the trajectory, and FIRE amplifies the change.
At \(L\) equal to the finite-difference `dr` (1e-3, `RGSADDLE_BENCH_ROTATION_STOP=dr`) the stop fires far earlier.
It cuts the calls on every matched row, but fewer starts reach the same saddle, and three LJ38 dimer L-BFGS starts and one LJ38 dimer FIRE start that converge with the stop off do not converge with it on.

| System | Estimator | Translator | Same saddle | Force calls off → on | Rotations off → on |
| --- | --- | --- | --- | --- | --- |
| Müller-Brown | dimer | FIRE | 12/12 | 10415 → 5206 | 3929 → 1158 |
| Müller-Brown | dimer | L-BFGS | 12/12 | 748 → 659 | 326 → 241 |
| Müller-Brown | Lanczos | FIRE | 12/12 | 4013 → 3639 | 2369 → 1957 |
| Müller-Brown | Lanczos | L-BFGS | 12/12 | 492 → 401 | 329 → 238 |
| LJ13 | dimer | FIRE | 11/12 | 4615 → 3389 | 1795 → 779 |
| LJ13 | dimer | L-BFGS | 12/12 | 1143 → 972 | 381 → 176 |
| LJ13 | Lanczos | FIRE | 10/12 | 7147 → 4153 | 5733 → 2676 |
| LJ13 | Lanczos | L-BFGS | 1/12 | 447 → 362 | 383 → 286 |
| LJ38 | dimer | FIRE | 3/12 | 4095 → 2797 | 1497 → 571 |
| LJ38 | dimer | L-BFGS | 8/12 | 3335 → 3096 | 1731 → 1462 |
| LJ38 | Lanczos | FIRE | 12/12 | 12824 → 8158 | 10456 → 5706 |
| LJ38 | Lanczos | L-BFGS | 8/12 | 4904 → 3592 | 4303 → 2913 |
| vacancy, 255 atoms | dimer | FIRE | 2/12 | 2246 → 602 | 868 → 74 |
| vacancy, 255 atoms | dimer | L-BFGS | 9/12 | 863 → 677 | 319 → 133 |
| vacancy, 255 atoms | Lanczos | L-BFGS | 4/12 | 505 → 396 | 389 → 279 |

Neither length is better on every row, so the stop stays off unless a host asks for it.

### Seed the first translation from the mode curvature

`MinModeConfig::seed_curvature` is off unless a host sets it, and `MinModeSession::set_seed_curvature` does the same on a session that already exists. The C configuration and the point stencil leave it off, so those searches step as before. While the curvature `λ` along the mode is negative, no basin constraint is set, and the displacement `F/|λ|` fits in `max_move`, one translation uses that scale. L-BFGS does it when its memory is still empty, and stores the secant of that step. FIRE does it on its first move. Every later step is the stepper's own update, still capped by `max_move`. A step that would only hit the cap is left to the stepper: that capped move does not depend on `|λ|`. `reset` arms the seed again.

eOn 3.6.0 is the source of the L-BFGS half. `MinModeObjectiveFunction::knownCurvature` returns `-λ` once the mode curvature is negative, and `LBFGS::getStep` sets `H0 = 1/known` on the optimizer's first iteration (https://github.com/TheochemUI/eOn/blob/v3.6.0/client/MinModeSaddleSearch.cpp and `client/LBFGS.cpp`). The record doi:10.5281/zenodo.18529496 is TheochemUI/eOn v2.9.0.1. In that release, and at tag v2.17.0, the opening scale is still a finite difference along the force, so that record is not this seed. After the first step the scale is `s·y / y·y` (Liu and Nocedal, Math. Program. 45, 503 (1989), doi:10.1007/BF01589116). The reflected force those steps follow is Equation 3 of Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063. FIRE's later steps are its own integrator (Bitzek, Koskinen, Gähler, Moseler, and Gumbsch, Phys. Rev. Lett. 97, 170201 (2006), doi:10.1103/PhysRevLett.97.170201).

The comparison below is the median of seven serial release runs after one warmup. Force calls are the cost counted by Goswami, AIP Advances 15, 085210 (2025), doi:10.1063/5.0283639. `examples/minmode_trust.rs` is the run. Both columns use the dimer. Calls count every gradient, the centre and the rotations included. The step cap is 400 on the quadratic, 800 on the double well and the 12-dimensional diagonals, and 1500 on Müller-Brown. Every search converged.

| System | Translator | Calls off | ms off | Calls on | ms on |
| --- | --- | --- | --- | --- | --- |
| quadratic | FIRE | 35 | 0.023 | 35 | 0.023 |
| quadratic | L-BFGS | 11 | 0.006 | 11 | 0.006 |
| double well | FIRE | 42 | 0.027 | 42 | 0.028 |
| double well | L-BFGS | 18 | 0.010 | 18 | 0.010 |
| Müller-Brown | FIRE | 543 | 0.322 | 491 | 0.290 |
| Müller-Brown | L-BFGS | 46 | 0.032 | 84 | 0.058 |
| 12-D, curvature 2 | FIRE | 27 | 0.017 | 27 | 0.018 |
| 12-D, curvature 2 | L-BFGS | 9 | 0.005 | 9 | 0.006 |
| 12-D, curvature 40 | FIRE | 131 | 0.082 | 131 | 0.088 |
| 12-D, curvature 40 | L-BFGS | 11 | 0.007 | 11 | 0.007 |

Müller-Brown with FIRE is the row that improves. Müller-Brown with L-BFGS takes 84 calls instead of 46, because that one secant is a poor scale for the rest of the surface. The curvature-40 searches take the same number of calls either way. The switch stays off.

### A stalled FIRE step on a stiff mode

FIRE 2.0 keeps its opening timestep through the initial delay (Guénolé, Nöhring, Vaid, Houllé, Xie, Prakash, and Bitzek, Comput. Mater. Sci. 175, 109584 (2020), doi:10.1016/j.commatsci.2020.109584). Minimum mode FIRE opens at 1.0 with a ceiling of 2.5, matching eOn. On a stiff mode the harmonic length `|F|/|λ|` can still be far under the atom cap. `set_fire_curvature`, on by default, waits until neither the force nor the energy has dropped for 2000 steps and `|λ|` is past 4, then takes one step of length `|F|/slope` along the reflected force of Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063, at most 0.05, provided the energy does not rise by more than 1e-3. A shorter trial is tried when that step would. The probe then stays in place while the curvature remains that steep, so the integrator cannot rebuild the cycle. A search that is still descending is unchanged. `set_fire_curvature(false)` is the previous integrator. L-BFGS does not read the switch. No C field was added. `RGSADDLE_ABI_MINOR` is 34.

`set_cg_translate` replaces the translator with a Polak-Ribiere step perpendicular to the mode and a Newton step along it (Kästner and Sherwood, J. Chem. Phys. 128, 014106 (2008), doi:10.1063/1.2815812; Baker, J. Comput. Chem. 7, 385 (1986), doi:10.1002/jcc.540070402). `set_lbfgs_project` drops the component of each stored L-BFGS pair along the mode after a turn inside the 45 degree cone. Both are off.

`set_lbfgs_rotate` chooses the dimer rotation plane by L-BFGS in the tangent space of the axis (Kästner and Sherwood, J. Chem. Phys. 128, 014106 (2008), doi:10.1063/1.2815812). The angle in that plane and the extrapolated trial gradient stay the modified Newton step, the memory restarts at each estimate, and the switch is off unless a host sets it. Lanczos does not read it.

The table is twelve seeds from base 20261111, release, cap 0.2, from `examples/minmode_calls.rs`. Force calls are counted as in Goswami, AIP Advances 15, 085210 (2025), doi:10.1063/5.0283639, without the energy read after the search. A pair is the same saddle when both searches converge, the energies agree to 1e-6, and the aligned root-mean-square distance is under 1e-3. The calls and the milliseconds are the median of the matched pairs, and the bracket is the interquartile range. `validation/minmode_translator.csv` is every seed. Its Lanczos rows predate the torque window of minor 41.

| System | Kind | Method | Matched | Calls off | Calls on |
| --- | --- | --- | --- | --- | --- |
| LJ13 | dimer | FIRE | 12/12 | 409 [365, 458] | 409 [365, 458] |
| LJ13 | dimer | L-BFGS | 12/12 | 94 [93, 96] | 94 [93, 96] |
| LJ13 | Lanczos | FIRE | 12/12 | 726 [677, 764] | 726 [677, 764] |
| LJ13 | Lanczos | L-BFGS | 12/12 | 454 [411, 485] | 454 [411, 485] |
| LJ38 | dimer | FIRE | 12/12 | 2038 [1746, 2449] | 2038 [1746, 2449] |
| LJ38 | dimer | L-BFGS | 12/12 | 408 [374, 784] | 408 [374, 784] |
| LJ38 | Lanczos | FIRE | 12/12 | 1070 [1062, 1086] | 1070 [1062, 1086] |
| LJ38 | Lanczos | L-BFGS | 12/12 | 628 [607, 680] | 628 [607, 680] |
| vacancy-255 | dimer | FIRE | 11/12 | 3319 [1536, 5447] | 3319 [1536, 5447] |
| vacancy-255 | dimer | L-BFGS | 12/12 | 98 [94, 104] | 98 [94, 104] |
| vacancy-255 | Lanczos | FIRE | 0/12 | - | - |
| vacancy-255 | Lanczos | L-BFGS | 12/12 | 238 [129, 385] | 238 [129, 385] |
| Müller-Brown | dimer | FIRE | 12/12 | 860 [662, 921] | 860 [662, 921] |
| Müller-Brown | dimer | L-BFGS | 12/12 | 59 [49, 64] | 59 [49, 64] |
| Müller-Brown | Lanczos | FIRE | 12/12 | 342 [315, 346] | 342 [315, 346] |
| Müller-Brown | Lanczos | L-BFGS | 12/12 | 42 [39, 43] | 42 [39, 43] |

Vacancy Lanczos FIRE with the probe off converges on 0 of 12 seeds. With the probe on it converges on 12 of 12, so the matched column is empty. Those twelve searches take 25820 [25310, 27241] calls and 9396.760 [8944.507, 9878.244] ms. The unmatched vacancy dimer seed, 10372713005381289396, converges on neither side. LJ38 dimer L-BFGS uses 408 calls where FIRE uses 2038, but on LJ13 dimer only 4 of 12 L-BFGS searches land on the FIRE saddle. Conjugate gradients match 0/12 there, projected L-BFGS 4/12, Barzilai-Borwein 2/12, and quick-min 1/12. The default translator stays FIRE. The Gaussian-process surrogate in Goswami, Masterov, Kamath, Peña-Torres, and Jónsson, J. Chem. Theory Comput. 21, 7935 (2025), doi:10.1021/acs.jctc.5c00866, is a different method and is not used here.

### Buffers
A dimer estimate keeps one set of buffers for all its rotations: the
rotational force, its conjugate direction, and the trial and rotated
dimers.
Lanczos keeps its Krylov vectors, residual, coefficients and the tables
of its Ritz solve in the session, and moves each Hessian action into the
Krylov block it hands back.
A finite-difference action shifts the point in a buffer of its call and
forms the difference in the gradient the surface returned.
Outside the surface, a longer rotation or a larger Krylov space
allocates nothing more, and every estimate and step is bitwise what it
was.
The dimer is the reflection of Goswami, Gunde and Jonsson,
Front. Chem. 14 (2026), doi:10.3389/fchem.2026.1807063, Eq. 9,
and Goswami (2026), arXiv:2603.10992, Eqs. 2.14-2.16, on the rotation
of Henkelman and Jonsson, J. Chem. Phys. 111, 7010 (1999),
doi:10.1063/1.480097.
The Lanczos estimate is that of Olsen, Kroes, Henkelman, Arnaldsson
and Jonsson, J. Chem. Phys. 121, 9776 (2004), doi:10.1063/1.1809574.

`examples/band_scaling.rs` runs up to 300 steps of each search from
the midpoint of its adatom hop, seeded with the hop direction, in the
paired runs of `howto/band`.
The time saved per surface call is fixed, so it shows only where the
surface is cheap: Lanczos runs 1.11 (1.07-1.13) times as fast as the
parent at 38 atoms, 1.04 (1.03-1.04) at 128 and 1.01 (1.00-1.02) at 256,
and the dimer 1.03, 1.02 and 1.02, with 8 to 11 of 12 pairs won.
At 256 atoms both searches converge at step 108, as they do on the
parent.
These runs predate the torque window of minor 41, which changes the
Lanczos searches.

### Read a pt-island campaign miss

The optbench pt-island campaign displaces the Pt island from its
minimum, climbs, pushes off the saddle 0.2 along the mode on either
side and minimizes both, as eOn's client does (Chill, Welborn,
Terrell, Zhang, Berthet, Pedersen, Jónsson, and Henkelman, Modelling
Simul. Mater. Sci. Eng. 22, 055002 (2014),
doi:10.1088/0965-0393/22/5/055002; Goswami, Gunde, and Jónsson,
Front. Chem. 14 (2026), doi:10.3389/fchem.2026.1807063; Goswami,
arXiv:2510.21368 (2025)).
Its goal is 27 distinct saddles under 1.5 eV that connect to the
reactant.
The driver files every other converged index-1 saddle under
`divergence`: one whose endpoints both leave the reactant
(disconnected), one 1.5 eV or more up, and a repeat (duplicate).
None of these is a climb that ran away.
`validation/benchmark/pt_island/export.py` gives each search the first
of disconnected, over 1.5 eV and duplicate that applies, and
`wrong_stationary` for a converged point of another index.

A disconnected search is a saddle that does not border the reactant,
not a bad push-off.
`pushoff.py` replays the first 100 catalog searches of each method and
compares the mode the driver pushes off along with the lowest
eigenvector of its central-difference Hessian.
On develop f5eb736 the mode is a unit vector within 0.971 of that
eigenvector on all 400, and pushing off along the eigenvector instead
gives the same verdict on all 400.
On 8fa0eb15 the verdicts of FIRE and rotation-skip agree on 198 of 199
index-1 points, and the one that differs connects only along the
session mode.
For the dimer methods the largest atom displacement of a disconnected
saddle from the reactant has median 2.6 to 3.6 A, against 1.8 to 1.9 A
for a connected one.

What changed the disconnected count is the dimer rotation history
that 116b92e keeps across translations (`explanation`, the dimer of
Henkelman and Jónsson, J. Chem. Phys. 111, 7010 (1999),
doi:10.1063/1.480097).
0.2.2 (2db34b42) and 8fa0eb15 lack it; develop has it from
ef1fd64, a merge that main fast-forwards to.
Over the first 40 searches rotation-skip leaves 31 disconnected on
06c55c5, 16 with 116b92e on that base, 29 on 8fa0eb15 and 9 from
ef1fd64 on (`validation/benchmark/pt_island/results/bisect.csv`).
`pinned.py` replays dimer FIRE searches 1, 2, 5 and 18 and
rotation-skip search 62. It fails on 2db34b42 and 8fa0eb15, where FIRE
1 reaches a 1.2 eV saddle between two other states and rotation-skip
62 an index-3 point 16 A out, and passes on develop, where FIRE 1 is
the 0.60 eV hop, FIRE 2 repeats it and rotation-skip 62 is an index-1
saddle at 3.4 eV.
FIRE 18 is disconnected on 8fa0eb15, on develop and in eOn.

The table is the first 200 catalog searches (seed 20261016) on
8fa0eb15 and then 2000 on develop f5eb736, from `results/main` and
`results/develop` under `validation/benchmark/pt_island`, with eOn 3.5.0's classic
dimer and L-BFGS (conda-forge build 7ec1840) on the same starts,
judged on optbench's surface by `eon_catalog.py`.
Connected counts the saddles toward the goal and unique the
distinct connected saddles of any barrier.
eOn's aborts are climbs past its 5 eV `max_energy`.

| Code | Method | Searches | Connected | Disconnected | Over 1.5 eV | Duplicate | Wrong stationary | eOn abort | Unique | Force calls per search |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 8fa0eb15 | dimer FIRE | 200 | 15 | 84 | 36 | 65 | 0 | | 33 | 1020 |
| 8fa0eb15 | dimer L-BFGS | 200 | 14 | 92 | 40 | 54 | 0 | | 31 | 472 |
| 8fa0eb15 | rotation-skip | 200 | 11 | 134 | 30 | 23 | 2 | | 29 | 548 |
| 8fa0eb15 | Lanczos L-BFGS | 200 | 10 | 8 | 19 | 163 | 0 | | 23 | 637 |
| eOn | classic dimer | 200 | 13 | 65 | 29 | 59 | 0 | 34 | 26 | 482 |
| f5eb736 | dimer FIRE | 2000 | 20 | 618 | 316 | 1045 | 0 | | 72 | 1049 |
| f5eb736 | dimer L-BFGS | 2000 | 22 | 729 | 359 | 888 | 2 | | 86 | 460 |
| f5eb736 | rotation-skip | 2000 | 23 | 721 | 388 | 868 | 0 | | 86 | 445 |
| f5eb736 | Lanczos L-BFGS | 2000 | 17 | 63 | 177 | 1743 | 0 | | 56 | 620 |
| eOn | classic dimer | 2000 | 23 | 622 | 286 | 659 | 0 | 410 | 62 | 463 |

One FIRE search on f5eb736 stops short of an index-1 point.
The first 200 of f5eb736 leave 56, 67, 65 and 8 disconnected for the
four methods, against eOn's 65.
eOn reaches the goal at search 5678, with 23 at search 1467 and 24 at
3426.
Force calls per search include both endpoint minimizations and not the
Hessian of the index check.
The wall seconds in `summary.csv` are the driver's whole search,
Hessian included, on eight shared cores, and eOn's are its client
alone.

The Lanczos estimate (Olsen, Kroes, Henkelman, Arnaldsson, and
Jónsson, J. Chem. Phys. 121, 9776 (2004), doi:10.1063/1.1809574)
follows the lowest mode out of the basin to the nearest saddles:
1729 of its 1743 duplicates are the 0.60, 0.62 and 0.99 eV hops, from
epicentres spread 273 to 302 over the seven island atoms.
The displacement is the host's and is eOn's: a random atom of the
island and its neighbours within 3.3 A, each search drawing in turn
from one generator seeded with the campaign seed.
On the first 200 starts eOn's Lanczos repeats the 0.60 and 0.62 eV hops
in 157 of its 171 connected repeats (`searches_eon_lanczos.csv`).

The repeats came from where the estimate stopped, not from the mode it
reached.
`results/torque_window` runs the campaign again on 8bb8f88, before the
torque window of minor 41, and on 3b67101, with it.
`modes.py` replays the first 300 climbs of a method through
`rgsaddle_minmode_step` and follows the session mode, here for stock
Lanczos and the dimer on 8bb8f88 and for Lanczos in the window and a
dimer without it on 3b67101.
In all four every climb converges to a point of Hessian index 1, where
the session mode overlaps the lowest eigenvector by 0.98 or more but
for one saddle of the dimer without the window, at 0.92.
After the first estimate the modes of stock Lanczos and of the dimer
overlap the lowest eigenvector at the start by a median 0.60 and 0.59.
Stock Lanczos then runs every estimate to its residual, a median 7.2
surface calls per translation against the dimer's 3.3.
Converged afresh at each step, the mode leads its climbs to negative
curvature sooner and lower: at a median step 3, 1.37 eV over the
reactant with no atom more than 0.53 A from it, against step 4, 1.85 eV
and 0.75 A for the dimer.
They end on the nearest saddles, with a median barrier of 0.62 eV
against 1.20 eV.
The dimer with `rotation_tol` 1e-6 (`dimer-lbfgs-tight.toml`), which
leaves the window off and rotates up to its `max_rotations` of 20 at
almost every step, climbs as stock Lanczos does: 22 calls per
translation, step 3, 1.30 eV, 0.52 A and a 0.60 eV barrier.
From 196 of 300 starts it reaches the saddle stock Lanczos reaches,
where the stock dimer does from 94 (`same_saddle.py`).
Lanczos in the window climbs as the dimer does: 3.2 calls per
translation, step 4, 1.94 eV, 0.76 A and a 1.48 eV barrier, and it
reaches the dimer's saddle from 134 of 300 starts.
The translator, the start, the frozen atoms and the judging are the same
in all four, so the climbs part where the estimates stop.

| Code | Method | Searches | Connected | Disconnected | Over 1.5 eV | Duplicate | Wrong stationary | Unique | Force calls per search |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 8bb8f88 | dimer L-BFGS | 300 | 16 | 106 | 50 | 128 | 0 | 42 | 461 |
| 3b67101 | dimer L-BFGS, `rotation_tol` 1e-6 | 300 | 15 | 8 | 18 | 259 | 0 | 30 | 1762 |
| 8bb8f88 | Lanczos L-BFGS | 300 | 11 | 12 | 22 | 255 | 0 | 25 | 621 |
| 3b67101 | Lanczos L-BFGS | 300 | 16 | 140 | 50 | 94 | 0 | 36 | 465 |
| both | dimer FIRE | 2000 | 21 | 615 | 326 | 1035 | 0 | 70 | 1018 |
| both | dimer L-BFGS | 2000 | 22 | 729 | 359 | 888 | 2 | 86 | 459 |
| both | rotation-skip | 2000 | 23 | 721 | 388 | 868 | 0 | 86 | 445 |
| 8bb8f88 | Lanczos L-BFGS | 2000 | 17 | 63 | 177 | 1743 | 0 | 56 | 620 |
| 3b67101 | Lanczos L-BFGS | 2000 | 21 | 944 | 364 | 671 | 0 | 74 | 463 |
| 3b67101 | Lanczos L-BFGS | 18171 | 27 | 8430 | 3663 | 6046 | 3 | 145 | 465 |

In the window Lanczos misses as the dimers do, on disconnected and
over-barrier saddles, and in 2000 searches it finds 21 connected saddles
where it found 17 and 74 distinct ones where it found 56, at 463 force
calls a search instead of 620.
Run on to the catalog's stop of 27 connected saddles or 20000
searches, it finds its 26th at search 3776 and the 27th, a sixth
1.49 eV saddle, at search 18171 (`saddles_lanczos_3b67101.csv`), in
8445282 force calls.
The dimer rows are those of both commits: their searches agree one for
one (`searches_sha256` in `summary.csv`).
Three dimer FIRE searches and two of the long Lanczos run stop at the
1000-step cap short of an index-1 point.
Wall seconds in `summary.csv` are on one core each of a shared
eight-core machine and are not compared.

`validation/benchmark/pt_island/campaign.py` runs a method;
`OPTBENCH_ROOT` names an optbench checkout (18fa13dca), `RGSADDLE_LIB`
the library and `RGSADDLE_SRC` its source.
For `results/torque_window`, `proxy.py` wrote `summary.csv` at 300 and
2000 searches and at the end of each run, and the saddles both Lanczos
runs found, and `same_saddle.py` numbered the saddles of the four
`modes.py` replays (`same_saddle.csv`).

# Leave a minimum with ART nouveau (`docs/orgmode/howto/art.org`)

> Phased Activation-Relaxation Technique nouveau (ArtSession)

`ArtSession` is the activation-relaxation technique nouveau of Malek and Mousseau, Phys. Rev. E 62, 7723 (2000), doi:10.1103/PhysRevE.62.7723. The host supplies the reactant, a seed vector, and a displacement mask. The library does not draw either array. A mask entry of zero drops that coordinate, which is the localized push; a mask of ones keeps the whole seed.

The phase is stored on the session. `step` runs one phase and leaves the next one in `ArtReport::phase`:

1. `Push` displaces along the masked seed, and later along that same direction.
2. `Perpendicular` minimizes the force in the hyperplane with `relax_to_tolerance`.
3. `Lanczos` reads the lowest curvature from `MinModeSession::estimate_mode`.
4. `Climb` takes one `MinModeSession::step`, then returns to the hyperplane relaxation.
5. `Certify` calls `saddle_index`.
6. `PushOver` steps both ways along the unstable mode.
7. `Quench` minimizes both images with no constraint.
8. `Report` decides reversibility.

`run_events` repeats that for many seeds and records a later landing on the same saddle in `ArtBatch::duplicates`. `ArtSession::force_calls` lists the most recent `ArtConfig::force_call_window` evaluations (64 by default), with the phase that requested each one; `force_call_count()` is the unbounded total.

During `Lanczos` on the climb, negative curvature and `mode_overlap_tol` keep the search on the accepted index-1 direction. A rejected estimate first gets a direct curvature check along the carried mode. If that direction is no longer negative, ART restarts from the last accepted point with a halved translation cap, up to `index_one_recovery_attempts` times. After that, a finite non-negative rejected curvature finishes the event as `ArtStatus::LostCurvature`, and a negative one (the mode switched) or a non-finite one returns `SaddleError::ArtIndexOneLost`.

`ArtStatus::Connected` requires a converged index-1 certificate, both quench energies below the saddle, one quenched image on the reactant, and the other image a different minimum. Either sign of the push-over may be the return: the mode at the saddle is not required to point back along the path that arrived. `ArtStatus::Reverted` is the other case of one basin, and it is not a completed exit. The structural distance is Euclidean for one atom. For several atoms it is the Kabsch RMSD, or the RMSD of the sorted pair distances when `permute_identical` is set, which is the identical-atom comparison used for the LJ clusters in the paper.

`ArtConfig::mode` is the Lanczos block. Its `artn` shortcut and its `saddle_check` are cleared: those steps are the phases above. `MinModeConfig::with_artn` remains the shorter opt-in inside one minimum-mode iteration. The point stencil's `Preset::Art` is still the push followed by a minimum-mode climb.

`ArtConfig::default` is the host unit configuration: one host length for
the pushes and the published defaults of the nested blocks. It is not a
Lennard-Jones preset. The named `ArtConfig::lj_art()` preset is only for
Lennard-Jones reduced units, where \(\epsilon = 1\) and
\(\sigma = 1\). For a potential
whose characteristic energy and length are not one in the host units, use
`ArtConfig::for_units(energy_scale, length_scale)`. It scales lengths,
forces, and curvatures separately. A FIRE or quick-min time step, including
the climb's `MinModeConfig::time_step`, scales as length over the square root
of energy, because the opening move is the force times the square of that
step. The opening step of steepest descent, L-BFGS, nonlinear CG, DIIS and
Barzilai-Borwein multiplies the force, so it scales as length squared over
energy, and Adam's scales as a length. The angle stop `rotation_angle_tol`
keeps its value. `rotation_tol` is dimensionless for Lanczos, the residual
of the lowest Ritz pair divided by the absolute Ritz value and the relative
change of that value, so it keeps its value. A dimer reads `rotation_tol`
as a rotational force in curvature units, and unit conversion multiplies it
by energy over length squared. Any other relaxation method is an
error from `for_units`. `mode_overlap_tol` is a cosine, and
`force_call_window` and `index_one_recovery_attempts` are counts, so
`for_units` keeps their values. `ArtConfig::validate()`
returns an invalid parameter error when the perpendicular relaxation force
tolerance is looser than the mode force tolerance, and when the mode force
tolerance is not finite and positive. It also holds `ArtConfig::mode` to the
checks of `MinModeSession::new`, so a zero Krylov or rotation budget, a step
or time step that is not finite and positive, or a stepper that tests the
oracle value is an `ART mode:` error rather than a value adjusted during the
search. Sessions and batches call it before consuming a configuration.

The runnable example is the doctest on `ArtSession`: a one-dimensional double well in three coordinates, a host seed, and a connected index-1 exit. `tests/art_session.rs` repeats the paper's census on LJ7, starting from the pentagonal bipyramid.

## Runnable example: phased ART nouveau session

```rust
use ndarray::{Array1, ArrayView1, array};
use rgsaddle::{
    ArtConfig, ArtPhase, ArtSeed, ArtSession, ArtStatus, PointSurface, SaddleError, full_mask,
    run_events,
};

struct DoubleWell;

impl PointSurface for DoubleWell {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let (px, py, pz) = (x[0], x[1], x[2]);
        let e = (px * px - 1.0).powi(2) + 2.0 * py * py + 2.0 * pz * pz;
        Ok((e, array![4.0 * px * (px * px - 1.0), 4.0 * py, 4.0 * pz]))
    }
}

fn main() -> Result<(), SaddleError> {
    let reactant = array![-1.0, 0.0, 0.0];
    let direction = array![1.0, 0.1, 0.0];
    let mask = full_mask(3);
    let mode = rgsaddle::MinModeConfig::default()
        .with_kind(rgsaddle::MinModeKind::Lanczos)
        .with_saddle_check(None)
        .with_force_tol(0.02)
        .with_max_move(0.1)
        .with_krylov_dim(4)
        .with_max_rotations(6);
    let config = ArtConfig::default()
        .with_mode(mode)
        .with_push_length(0.8)
        .with_max_pushes(3)
        .with_max_climbs(25)
        .with_push_over(0.25);
    let session = ArtSession::new(
        config.clone(),
        reactant.clone(),
        direction.clone(),
        mask.clone(),
    )?;
    assert_eq!(session.phase(), ArtPhase::Push);
    let batch = run_events(
        &config,
        &reactant,
        &[ArtSeed {
            seed: direction,
            mask,
        }],
        &DoubleWell,
        200,
    )?;
    assert_eq!(batch.outcomes[0].status, ArtStatus::Connected);
    Ok(())
}
```

# Choose saddle search directions from a minimum (`docs/orgmode/howto/direction-cover.org`)

> Signed per-atom direction cover and arm picker for saddle searches from a minimum (DirectionCover)

`DirectionCover` decides where the saddle searches out of one minimum start, and in which order. It is written for adaptive kinetic Monte Carlo, where every visited minimum needs its low saddles and a measure of how much of the search space has been tried (Xu and Henkelman, J. Chem. Phys. 129, 114104 (2008), doi:10.1063/1.2976010). It supplies the starts and the order only. Each start runs as one `ArtSession`, the phased ART nouveau of `howto/art`, so the push, perpendicular relaxation, Lanczos climb, index-1 certificate and both quenches are the ones documented there.

Nothing here builds a Hessian. The inputs are the minimum, an optional per-atom active mask, a `u64` seed, a `DirectionCoverConfig` and a `CoverBudget`. Bad input returns `SaddleError`; nothing is clamped or replaced.

## Run a budget of arms
Build the chooser on the surface and the relaxed minimum, then spend a budget. A budget sets `max_arms`, `max_force_calls`, or both; an empty budget is refused.

```rust
use ndarray::{Array1, ArrayView1, array};
use rgsaddle::{
    ArmOutcome, ArtConfig, CoverBudget, DirectionCover, DirectionCoverConfig, MinModeConfig,
    MinModeKind, PointSurface, SaddleError,
};

struct DoubleWell;

impl PointSurface for DoubleWell {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let (px, py, pz) = (x[0], x[1], x[2]);
        let e = (px * px - 1.0).powi(2) + 0.25 * (py * py + pz * pz);
        Ok((e, array![4.0 * px * (px * px - 1.0), 0.5 * py, 0.5 * pz]))
    }
}

fn main() -> Result<(), SaddleError> {
    let mode = MinModeConfig::default()
        .with_kind(MinModeKind::Lanczos)
        .with_saddle_check(None)
        .with_force_tol(0.02)
        .with_max_move(0.1)
        .with_krylov_dim(4)
        .with_max_rotations(6);
    let art = ArtConfig::default()
        .with_mode(mode)
        .with_push_length(0.5)
        .with_push_step(0.3)
        .with_max_pushes(12)
        .with_max_climbs(25)
        .with_push_over(0.25);
    let config = DirectionCoverConfig::default().with_art(art);
    let mut cover = DirectionCover::new(&DoubleWell, array![-1.0, 0.0, 0.0], None, 7, config)?;
    let report = cover.run(&DoubleWell, CoverBudget::default().with_max_arms(12))?;
    assert_eq!(report.saddles.len(), 1);
    assert!(report
        .records
        .iter()
        .any(|r| r.outcome == ArmOutcome::DuplicateSaddle(0)));
    Ok(())
}
```

The same example is the doctest on `DirectionCover`. Arms whose push points away from the barrier end as `NonConverged` (ART spent its pushes without negative curvature). Once one product is known the picker turns to the untried directions next to it.

## Drive the arms from the host
`run` is the loop `suggest_batch`, `run_arm` for each pick on rayon's pool, then `record` in pick order. A host that schedules its own workers can split it:

1. `suggest` or `suggest_batch(k)` returns `ArmSuggestion` values: the `ArmId` (centre atom and cover point), its score, and the policy that produced it.
2. `seed(arm)` is the `ArtSeed` for that arm, if the host runs ART itself; `run_arm(surface, arm)` runs it and returns an `ArmTrial`.
3. `record(trial)` files the verdict. A host that runs another climb builds the trial with `ArmTrial::connected`, `returned`, `failed` or `non_converged`.
4. `set_prefactor(arm, ν)` attaches a prefactor the host computed later.
5. `coverage()` is the readout.

Recording the same arm twice is an error. The picker is a function of the recorded trials, so a host that records in a fixed order gets the same picks whatever its thread count.

## Confine the search to a region
Pass `Some(&active)` with one `bool` per atom. Only active atoms are centres, and only they move in their own seeds: the ART mask is one on the centre and on each kicked neighbour, zero elsewhere. Neighbour kicks reach atoms within `kick_radius` of the centre, inactive ones included, so set the radius to zero to keep every push on the active atoms alone. A mask of the wrong length is `SaddleError::Shape`; a mask with no active atom is `SaddleError::Invalid`.

## Reference
### Cover
Every active atom carries the same cover: `cover_points` signed unit vectors on its own sphere (64 by default, at least 4). A direction and its opposite are separate arms. The points are spread by the geodesic repulsion of Plasencia Gutiérrez, Argáez and Jónsson (J. Chem. Theory Comput. 13, 125 (2017), doi:10.1021/acs.jctc.5b01216), relaxed for `cover_sweeps` Gauss-Seidel sweeps from a start drawn from the seed, then ordered farthest point first. `sphere_cover(n, sweeps, seed)` returns that set.

An arm's seed is its cover vector on the centre plus, when `kick_radius` is positive, independent Gaussian components of standard deviation `kick_width` on every atom within the radius. Pedersen, Hafstein and Jónsson (SIAM J. Sci. Comput. 33, 633 (2011), doi:10.1137/100792743) show that this centre, radius and width set which saddles a minimum-mode search reaches and how often. Distances use the minimum image when `cell` is set; ART itself runs on open coordinates.

### Arm verdicts
| `ArtStatus`               | `ArmOutcome`                                                        |
| --- | --- |
| `Connected`               | `NewSaddle`, or `DuplicateSaddle(id)` for a saddle already recorded |
| `Reverted`                | `ReturnedToStart`: both quenches came back                          |
| `Irreversible`            | `Failed(ArmFailure::Disconnected)`                                  |
| `NotIndexOne`             | `Failed(ArmFailure::NotIndexOne)`                                   |
| `NotDownhill`             | `Failed(ArmFailure::NotDownhill)`                                   |
| `LostCurvature`           | `Failed(ArmFailure::LostCurvature)`: curvature recovery was exhausted |
| `Exhausted`               | `NonConverged`                                                      |
| `SaddleError::ArtIndexOneLost` | `Failed(ArmFailure::IndexOneLost { ... })`: mode recovery was exhausted |
| an error from the session | `Failed(ArmFailure::Error(message))`                                |

During a climb, consecutive lowest modes must retain an absolute overlap of `ArtConfig::mode_overlap_tol` (1/√2 by default) and negative curvature. If the estimate loses either condition, ART first measures the carried mode's Rayleigh curvature directly. A still-negative carried mode continues the climb. Otherwise ART restarts from its last accepted index-1 point with a halved translation cap, at most `index_one_recovery_attempts` times (6 by default). When the restarts are spent and the rejected curvature is finite and non-negative, the surface has no unstable mode there: the event finishes as `ArtStatus::LostCurvature`, which `DirectionCover` records as `ArmFailure::LostCurvature`. When the rejected curvature is still negative, the mode switched rather than vanished, and ART returns the typed `SaddleError::ArtIndexOneLost`. A rejected curvature that is not finite returns that same error. `DirectionCover` preserves its attempts, curvature, and overlap in `ArmFailure::IndexOneLost`; it does not turn the failure into a soft-mode result.

Two saddles are one when their energies differ by less than `saddle_energy_tol` and their per-atom RMSD is below `saddle_rmsd_tol`. Product minima use `minimum_energy_tol` and `minimum_rmsd_tol` the same way. The RMSD is per atom and Cartesian, under the minimum image when `cell` is set; it does not match permuted identical atoms, so symmetry copies of one saddle on different atoms count as different saddles.

### Pick policies
| Policy                | Score of an untried arm                                                                                                     |
| --- | --- |
| `Gap` (default)       | angle to the nearest tried direction on the same centre, times the distinct states of the start and the three nearest tried |
| `ExpectedImprovement` | expected improvement on the barrier from a Gaussian process on the centre's sphere, times the gap over π                    |
| `Auto`                | `ExpectedImprovement` once two different barriers are known, `Gap` before                                                   |

The states of a gap are the start together with the products of its three nearest tried directions, and the start always counts. A hole whose nearest arms reached products A and B scores three times its angle, one that reached only A scores twice its angle, and one whose edges all came back or failed scores its angle. Failed, non-converged and still pending arms add no state, and a centre with nothing tried scores π. So a hole bounded by arms that led to different minima is tried before one whose edges all came back. The expected improvement is that of Jones, Schonlau and Welch (J. Global Optim. 13, 455 (1998), doi:10.1023/A:1008306431147) with the Gaussian kernel `exp(-‖u - v‖²/2ℓ²)` of the chordal distance between the unit directions `u` and `v`, length scale `length_scale` (0.6, which is in radians for small angles), the mean and variance of all known barriers, and target `best barrier - ei_margin`. The chordal kernel is the Gaussian of three-dimensional space restricted to the sphere, so its matrix on distinct directions is positive definite for every positive `length_scale`; a Gaussian of the geodesic angle is not (Feragen, Lauze and Hauberg, CVPR 2015). The matrix carries a nugget of 1e-8 times the barrier variance on its diagonal, which keeps the Cholesky factorization in double precision valid for fewer than 9000 tried directions on a centre (Demmel's condition, Higham, Accuracy and Stability of Numerical Algorithms, Theorem 10.7). A pivot that is still not positive returns `SaddleError::Singular`; it is never clamped. `ExpectedImprovement` alone refuses to score before two different barriers are known. Ties go to the centre with fewer tried arms, then the lower atom, then the lower cover point, so the first pass touches every centre once. `batch` arms (1 by default) are picked greedily, each scored as if the earlier picks of the batch were already tried.

### Coverage readout
`CoverageReport` has:

- `subspace_dim`: three times the number of active atoms
- `covering_radius`: the largest, over centres, of the exact covering radius of that centre's tried signed directions on the sphere (`covering_radius_s2`); π before any arm
- `atoms`: per centre, the tried count, the covering radius and the distinct states among the start and the products reached, so one before any product
- `records`: one `ArmRecord` per arm, in record order, with the direction, outcome, saddle and product ids, barrier, optional prefactor and force calls
- `saddles`, `products`: the distinct saddles with their hit counts, and the distinct product minima
- `discovery`: distinct saddles after each arm; `saddle_draws` and `frequency_counts` are the connected draws and the number of saddles seen once, twice, and so on, for a Good-Turing (Good, Biometrika 40, 237 (1953), doi:10.1093/biomet/40.3-4.237) or capture-recapture estimate of what is left
- `force_calls`: the total over all arms
- `next`: the next suggestion and its score, or `None` when every arm is tried

### Determinism
Every random draw comes from the `u64` seed. A batch is chosen before it runs, its arms run on rayon's pool, and their trials are recorded in pick order, so the records are the same at one thread and at four; `tests/direction_cover.rs` checks that bitwise.

### Force-call history
`ArtSession` stores at most the most recent `ArtConfig::force_call_window` force calls with their positions (64 by default). `force_call_count()` and `ArtOutcome::force_call_count` retain the total even after old positions leave the window. Set the window to zero when only counts are needed. Thus the position-history memory of each arm is bounded by the configured window times the Cartesian dimension rather than by all calls spent.

Quick timing observations belong in `NOTES.md`, not in this reference.

# Follow k lowest modes (`docs/orgmode/howto/indexk.org`)

> Index-k minimum-mode searches with LOBPCG and block Lanczos

`IndexKSession` and `indexk_step` take one minimum-mode step in a k-dimensional unstable subspace. `k = 1` is `MinModeSession`: the same dimer or Lanczos estimate, the same translated force, and the same translator step. A Gaussian-process surrogate supplies the Hessian action through `PointSurface::hessian_vector`, or through `WithHessian` when the product is a separate callback. With no action, the session uses the finite difference on `MinModeConfig`.

The translated force is `F - 2 Σ_i v_i (v_i · F)` once every one of the k curvatures is negative (Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063, Equation 3, for one mode). While any of those curvatures is not negative the step climbs inside the subspace and drops the orthogonal force, the one-mode rule of Henkelman and Jónsson, J. Chem. Phys. 111, 7010 (1999), doi:10.1063/1.480097. `reflect_force` is the Householder product alone. `translated_force` applies the sign rule. By default `IndexKConfig::negative_tol` is `0.0`, so convergence requires every requested curvature to be strictly negative (`curvature < 0.0`) and the force to be within tolerance. Chain `IndexKConfig::with_negative_tol` with a finite non-negative threshold so every requested curvature lies strictly below `-negative_tol`. `SaddleIndexCheck::negative_tol` defaults to `NEGATIVE_CURVATURE_TOL` (1e-3), and that positive value is a valid argument. `IndexKSession::new` rejects a negative threshold.

The k lowest pairs are a local block iteration behind `LowestEigenpairs`. LOBPCG keeps the previous block and its conjugate direction (Knyazev, SIAM J. Sci. Comput. 23, 517 (2001), doi:10.1137/S1064827500366124). Lanczos selects a reorthogonalized block Lanczos. Either slot can later call rgmin's `lowest_eigenpairs`. The step does not loop the one-vector eigenpair.

Gould, Ortner, and Packwood, Math. Comp. 85, 2939 (2016), doi:10.1090/mcom/3096, analyse the dimer; the third author is Packwood, not Zhang. The shrinking-dimer convergence they use is Zhang and Du, SIAM J. Numer. Anal. 50, 1899 (2012), doi:10.1137/110843149. The index-k dimer is Yin, Zhang, and Zhang, SIAM J. Sci. Comput. 41, A3576 (2019), doi:10.1137/19M1253356. The surrogate that owns the Hessian product is the one in Goswami, Masterov, Kamath, Peña-Torres, and Jónsson, J. Chem. Theory Comput. 21, 7935 (2025), doi:10.1021/acs.jctc.5c00866.

From C, ABI minor 37 adds `rgsaddle_indexk_create`, `rgsaddle_indexk_step`, `rgsaddle_indexk_modes`, `rgsaddle_indexk_translated`, `rgsaddle_indexk_position`, `rgsaddle_indexk_set_position`, `rgsaddle_indexk_free`, and `rgsaddle_reflect_force`. `modes` is row-major n-by-k with `n = 3 * n_atoms`, and may be NULL. A null Hessian callback estimates the action from the surface. The report's `curvature` is the lowest of the k values. The translator is FIRE. `k = 1` with `RGSADDLE_MINMODE_LOBPCG` uses Lanczos. `k < 1` or `k` larger than the dimension makes `rgsaddle_indexk_create` return NULL. `rgsaddle_hessian_fn` receives the vector only. A host that needs the geometry calls `rgsaddle_indexk_step_at` (ABI minor 69), which takes a `rgsaddle_hessian_at_fn` that also receives the position. The C++ owner is `rgsaddle::IndexK` in `include/rgsaddle/session.hpp`, with `step` and `step_at`. There is no Python session name.

The runnable example is the doctest on `IndexKSession`: an index-2 quadratic, an analytic Hessian action, and a search that finishes at the origin. `cargo test --doc indexk` runs it.

## Runnable example: index-k minimum-mode search

```rust
use ndarray::{Array1, Array2, ArrayView1, array};
use rgsaddle::{
    BlockEigenKind, HessianProduct, IndexKConfig, IndexKSession, MinModeConfig, MinModeStatus,
    PointSurface, SaddleError, WithHessian, indexk_step, reflect_force, translated_force,
};

struct Index2Quad;

impl PointSurface for Index2Quad {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let e = -0.5 * x[0] * x[0] - x[1] * x[1] + 2.0 * x[2] * x[2];
        Ok((e, array![-x[0], -2.0 * x[1], 4.0 * x[2]]))
    }
}

struct AnalyticHessian;

impl HessianProduct for AnalyticHessian {
    fn product(
        &self,
        _x: ArrayView1<f64>,
        v: ArrayView1<f64>,
    ) -> Result<Array1<f64>, SaddleError> {
        Ok(array![-v[0], -2.0 * v[1], 4.0 * v[2]])
    }
}

fn main() -> Result<(), SaddleError> {
    let start = array![0.3, 0.2, 0.4];
    let (_, g0) = Index2Quad.eval(start.view())?;
    let modes = Array2::from_shape_vec((3, 2), vec![1.0, 0.0, 0.0, 1.0, 0.0, 0.0]).unwrap();
    let search = MinModeConfig::default().with_force_tol(1e-5).with_max_move(0.1);
    let config = IndexKConfig::new(2, search.clone()).with_block(BlockEigenKind::Lobpcg);
    let surface = WithHessian {
        surface: &Index2Quad,
        hessian: &AnalyticHessian,
    };
    let one = indexk_step(start.clone(), g0, &surface, 2, Some(modes.clone()), &search)?;
    let _reflected = reflect_force(one.translated_force.view(), one.modes.view())?;
    let _trans =
        translated_force(one.translated_force.view(), one.modes.view(), one.curvatures.view())?;
    let mut session = IndexKSession::new(config, start, Some(modes))?;
    let report = session.run(&surface, 200)?;
    assert_eq!(report.status, MinModeStatus::Converged);
    Ok(())
}
```

# Map a pathway down from a saddle (`docs/orgmode/howto/landscape.org`)

> Downward pathway maps from a certified saddle to minima

`LandscapeSession` builds a pathway map downward from one certified critical point. The parent is a saddle of index k, either the position and unstable block of a converged `IndexKSession` or a point `saddle_index` certifies. The search pushes a Euclidean step of length `LandscapeConfig::push` (`DEFAULT_LANDSCAPE_PUSH`, 0.1) along each unit unstable eigenvector, both ways, and follows index-(k-1) minimum-mode dynamics until that leg converges. The point is certified again. A new critical point is stored only when its index is one less than the parent, and the search repeats on it. Any other index is `SaddleError::Solver`. A repeated point, closer than `LandscapeConfig::duplicate_distance` (`DEFAULT_DUPLICATE_DISTANCE`, 1e-3), adds an edge and is not searched again. Index 0 is a minimum: that leg is an rgmin solve on the true gradient, the same stepper `RelaxConfig` uses, not a reflected force.

The index-k leg is `IndexKSession`. It reflects the force in the k lowest modes once their curvatures are negative, the dimer translation of Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063, Equation 3, applied to the block, which is the high-index saddle dynamics of Yin, Zhang, and Zhang, SIAM J. Sci. Comput. 41, A3576 (2019), doi:10.1137/19M1253356. Each child leg inherits `LandscapeConfig::certificate.negative_tol` (defaulting to `NEGATIVE_CURVATURE_TOL`, 1e-3, or set for both through `LandscapeConfig::with_negative_tol`), so leg convergence and certification always agree on which curvatures count as negative. The pathway itself is the construction of Yin, Wang, Chen, Zhang, and Zhang, Phys. Rev. Lett. 124, 090601 (2020), doi:10.1103/PhysRevLett.124.090601: critical points whose indices differ by one are joined by the unstable direction that was pushed. The certificate is the block Lanczos saddle index of Goswami, Masterov, Kamath, Peña-Torres, and Jónsson, J. Chem. Theory Comput. 21, 7935 (2025), doi:10.1021/acs.jctc.5c00866. Each child copy of `LandscapeConfig::search` clears `saddle_check` and `artn` before the index-k leg. `artn` is the ART nouveau activation. `IndexKSession::new` already clears `saddle_check` on the one-mode session. `LandscapeSession::new` still rejects an invalid `saddle_check`, an invalid `artn`, and an invalid `escape`. `LandscapeConfig::certificate` certifies every accepted point after `escape` is set to none.

`PathwayMap::nodes` starts with the parent. A `CriticalPoint` holds the coordinates, the energy, the saddle index, the lowest curvatures, the unstable modes (shape `(n, index)`, lowest curvature first), and the force evaluations spent accepting it. A `LandscapeEdge` records the parent, the child, the column of the parent's unstable block, the sign of the push, and the evaluations of that leg. `PathwayMap::evaluations` counts every `PointSurface::eval`. An analytic `PointSurface::hessian_vector` is not a force evaluation. The parent's `evaluations` plus the sum of the edge evaluations equals the map total: a later arrival at a stored node is charged to the edge only.

The push has to leave the neighbourhood in which the perturbed curvature is still among the k-1 lowest, or the index-(k-1) dynamics return to the parent and the search returns `SaddleError::Solver`. On the separable well of `tests/saddle_index.rs`, that crossing along the most negative mode is at `1/sqrt(6)`, so a push of 0.5 is past it and a push of 0.1 is not. `LandscapeConfig::max_nodes` (`DEFAULT_LANDSCAPE_MAX_NODES`, 64, including the parent) and `LandscapeConfig::max_evaluations` (`DEFAULT_LANDSCAPE_MAX_EVALUATIONS`, 100000) are hard stops. Reaching either is `SaddleError::LandscapeBound` with `LandscapeBoundKind::Nodes` or `LandscapeBoundKind::Evaluations`, the accepted node count, and the evaluations already performed. The partial pathway is not returned. `LandscapeConfig::max_steps` (`DEFAULT_LANDSCAPE_MAX_STEPS`, 2000) caps one saddle leg and one minimum; exhausting it is `SaddleError::Solver`, not a shorter map. `LandscapeConfig::force_gate` is the infinity norm by default. The parent, each index-k leg, and each minimum measure the force with that one gate. A minimum compares it with `RelaxConfig::force_tol`. A saddle leg and the parent compare it with `MinModeConfig::force_tol`. `LandscapeConfig::cell` is a `Cell` or none. With a cell the duplicate test is the Euclidean norm of `Cell::minimum_image`, and the coordinate length must be a multiple of three.

`LandscapeConfig` is non-exhaustive. Start from `LandscapeConfig::default` and chain `with_duplicate_distance`, `with_push`, `with_max_nodes`, `with_max_evaluations`, `with_max_steps`, `with_search`, `with_relax`, `with_certificate`, `with_negative_tol`, `with_force_gate`, and `with_cell`.

From C, ABI minor 69 adds `rgsaddle_landscape_config_default`, `rgsaddle_landscape_create`, `rgsaddle_landscape_run`, `rgsaddle_landscape_node`, `rgsaddle_landscape_modes`, `rgsaddle_landscape_edge`, and `rgsaddle_landscape_free`. The coordinate length is `3 * n_atoms`. A null Hessian callback estimates the action from the surface. A supplied callback is a `rgsaddle_hessian_at_fn` and receives the geometry and the vector. `RGSADDLE_LANDSCAPE_BOUND` is the limit, and the report's `bound` is 1 for nodes or 2 for evaluations. Node and edge queries then return `RGSADDLE_NO_EVALUATION` because no pathway was stored. The C++ owner is `rgsaddle::Landscape` in `include/rgsaddle/session.hpp`, and its constructor requires ABI 1.69. Python exposes `Landscape`, `PathwayMap`, `CriticalPoint`, and `LandscapeEdge`. `Landscape.run` takes the same one-image callback as `saddle_index`. A limit raises `ValueError` in Python and `std::runtime_error` from `rgsaddle::Landscape::run`, and returns no map.

The runnable Rust example is the doctest on `LandscapeSession`. `cargo test --doc landscape` runs it.

## A two-dimensional surface

The Müller-Brown potential (Müller and Brown, Theoretica Chimica Acta 53, 75 (1979), doi:10.1007/BF00547608) is a surface of two coordinates. It has no index-2 point in the window used by `tests/simplified_string.rs`. The downward maps start at the two published index-1 saddles. `PointSurface` has length 2. The C and Python sessions stay on a multiple of three because the ABI packs atoms; the Rust session does not.

With an analytic Hessian action, push 0.2, force tolerance 1e-6, duplicate distance 0.05, and per-atom minimizer cap 0.05, the map from S1 at (-0.822001558733, 0.624312802815) stored that saddle and the minima A and C. The parent cost 1 force evaluation, A cost 131, and C cost 87, 219 in all. The map from S2 at (0.212486582001, 0.292988325107) stored that saddle and the minima C and B. The parent cost 1, C cost 114, and B cost 86, 201 in all. The two maps together called the surface 420 times. Positions matched the published stationary points to 1e-2 and energies to 1e-3, with the indices 1 and 0.

The same search on the separable well of `tests/landscape.rs`, three coordinates and an analytic action, push 0.5 and force tolerance 1e-8, stored 9 nodes and 12 edges in 865 force evaluations. The origin cost 1. The index-1 saddles at `(+-1, 0, 0)` cost 7 each to discover, the index-1 saddles at `(0, +-1/sqrt(2), 0)` cost 43 each, and each of the four minima cost 79. The other 448 evaluations are later edges that arrive at a node already stored. Direction 0 at the origin, the most negative curvature, connects to the saddles on the x axis. Each minimum has two parents.

```rust
use ndarray::array;
use rgsaddle::{IndexKConfig, LandscapeConfig, LandscapeSession, MinModeConfig, RelaxConfig};

let search = MinModeConfig::default()
    .with_force_tol(1.0e-6)
    .with_max_move(0.05)
    .with_saddle_check(None);
let config = LandscapeConfig::default()
    .with_push(0.2)
    .with_duplicate_distance(5.0e-2)
    .with_search(IndexKConfig::new(1, search))
    .with_relax(
        RelaxConfig::default()
            .with_force_tol(1.0e-6)
            .with_max_atom_move(0.05)
            .with_initial_step(0.02),
    );
let session = LandscapeSession::new(
    config,
    array![-0.822_001_558_733, 0.624_312_802_815],
    None,
)?;
let map = session.run(&surface)?;
assert_eq!(map.nodes[0].index, 1);
assert_eq!(map.nodes.len(), 3);
assert_eq!(map.edges.len(), 2);
# Ok::<(), rgsaddle::SaddleError>(())
```

`surface` is the `PointSurface` in `tests/landscape.rs`. That test also checks the node and evaluation limits and the minimum-image duplicate test on a periodic cell.

# Solid-state dimer (`docs/orgmode/howto/solid-dimer.org`)

> Variable-cell solid-state dimer on atoms and strain

`SolidDimer` is a minimum-mode saddle search on the joint space of atom positions and cell strain. The translation is the dimer or Lanczos step of `MinModeSession`: estimate the lowest mode, invert the force along it, and take one rgmin step. That reflected force is Equation 3 of Goswami, Gunde, and Jónsson, Front. Chem. 14, 1807063 (2026), doi:10.3389/fchem.2026.1807063. The same dimer, in eOn, is the search of Goswami, Masterov, Kamath, Peña-Torres, and Jónsson, J. Chem. Theory Comput. 21, 7935 (2025), doi:10.1021/acs.jctc.5c00866. Force calls are counted as in Goswami, AIP Advances 15, 085210 (2025), doi:10.1063/5.0283639.

The coordinate those steppers see is the solid-state dimer of Xiao, Sheppard, Rogal, and Henkelman, J. Chem. Phys. 140, 174104 (2014), doi:10.1063/1.4873437. Strain sits next to the atomic displacement with the Jacobian of the generalized solid-state nudged elastic band, Sheppard, Xiao, Chemelewski, Johnson, and Henkelman, J. Chem. Phys. 136, 074103 (2012), doi:10.1063/1.3684549,

\[ J = V^{1/3} N^{1/6}. \]

`J` is fixed from the cell at the start. The chart is the right strain `h = h_0 (I + ε)` with the atoms `r = r_0 (I + ε)`, so a pure strain keeps fractional coordinates fixed and `r_0` is the non-affine displacement. The free strains are the lower triangle, Voigt order xx, yy, zz, yz, xz, xy, stored as `J ε`. The upper triangle is the rotation and stays zero, as on the solid-state band. The cell block of the gradient is `M^{-T} (V σ) / J` plus the external load, with `M = I + ε`. At zero strain and zero load that block is `(V / J) σ`. `σ` is the Cauchy stress, `(1/V) ∂E/∂ε` for an infinitesimal right strain at fixed fractional coordinates.

`CellMask::frozen` drops the strain block. `step` then calls `PointSurface::eval` on the atomic coordinates, and the position, mode, curvature, and evaluation count match `MinModeSession` bit for bit. Any free strain calls `eval_in_cell` and `cauchy_stress`. A surface that returns `None` from `cauchy_stress` is finite-differenced by `finite_difference_cauchy_stress`. The virial is `V σ`. `elastic_dipole` is that product. The interaction dipole used by `StrainResponse` is the opposite excess, `P = -V (σ_defect - σ_bulk)`, after the homogeneous-stress correction of Varvenne and Clouet, Phys. Rev. B 96, 224103 (2017), doi:10.1103/PhysRevB.96.224103.

`SolidDimerConfig` is non-exhaustive. Build it with `new` or `frozen`, then `with_mask`, `with_external_stress`, `with_pressure`, `with_weight`, and `with_stress_check`. A positive pressure is `P I` added to the stress before the cell force, the sign of `SolidState::pressure`. External stress has that sign too, positive inward, so it is minus an applied Cauchy stress, and it is folded onto the lower triangle. `weight` scales `J`; 1 is the 2012 value. `step` and `run` return a `SolidDimerReport`, and `index` and `index_at` an `IndexReport`. Both are non-exhaustive: read their fields.

No C field was added. A host that already drives `MinModeSession` keeps that path for a frozen cell and constructs `SolidDimer` when the cell is free.

## Runnable example: variable-cell solid-state dimer

```rust
use ndarray::{Array1, ArrayView1, array};
use rgsaddle::{
    CellMask, IndexCheck, MinModeConfig, MinModeStatus, PointSurface, SaddleError, SolidDimer,
    SolidDimerConfig, StressCheck, check_cauchy_stress, finite_difference_cauchy_stress, index_at,
    virial,
};

struct ShearWell;

impl PointSurface for ShearWell {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let u = x[0];
        Ok(((u * u - 1.0).powi(2), array![4.0 * u * (u * u - 1.0), 0.0, 0.0]))
    }

    fn eval_in_cell(
        &self,
        x: ArrayView1<f64>,
        cell: &[f64; 9],
    ) -> Result<(f64, Array1<f64>), SaddleError> {
        let u = x[0];
        let gamma = cell[3];
        let e = (u * u - 1.0).powi(2) + 6.0 * (gamma - 0.2 * u).powi(2);
        let gu = 4.0 * u * (u * u - 1.0) - 2.4 * (gamma - 0.2 * u);
        Ok((e, array![gu, 0.0, 0.0]))
    }
}

fn main() -> Result<(), SaddleError> {
    let cell = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]];
    let pos = array![0.2, 0.0, 0.0];
    let mode = array![1.0, 0.0, 0.0];
    let _fd_stress = finite_difference_cauchy_stress(&ShearWell, pos.view(), cell, 1e-6)?;
    let _vir = virial(1.0, _fd_stress);
    let _ = check_cauchy_stress(&ShearWell, pos.view(), cell, StressCheck::new())?;
    let config = SolidDimerConfig::new(MinModeConfig::default().with_force_tol(1e-3))
        .with_mask(CellMask::frozen())
        .with_index_check(IndexCheck::first_order());
    let mut dimer = SolidDimer::new(config, pos.clone(), cell, mode)?;
    let report = dimer.run(&ShearWell, 200)?;
    assert_eq!(report.status, MinModeStatus::Converged);
    let _idx = index_at(&ShearWell, dimer.positions(), IndexCheck::first_order())?;
    Ok(())
}
```

`with_index_check` counts the lowest eigenvalues of the projected Hessian when the force tolerance is met. The count is a Lanczos run with full reorthogonalisation. A chain that closes is restarted from a direction orthogonal to it, so a repeated eigenvalue is not dropped. Directions from `excluded_modes` are removed from each Hessian action, so a rigid translation named there is not a negative mode. The default names none. `IndexCheck::first_order` asks for eight eigenvalues, treats a value below -1e-4 as negative, and uses a central step of 1e-4. One negative eigenvalue accepts the point. More than one is left by a walk along the softest of them, on the downhill side, until that direction's Rayleigh quotient is no longer below -1e-4. The lowest mode stays the seed. Six walks are allowed. The report then sets `rejected` and the barrier is not that point. `IndexCheck` is non-exhaustive. `first_order` is also its `Default`, and `with_lowest`, `with_negative`, `with_step`, `with_escapes` and `with_escape` change one setting each. `with_flat` keeps a negative curvature λ running until the largest force component is at most `flat * |λ|`, and still at most the search tolerance. The copper rows use `flat = 0.005`, so the harmonic residual along the mode is about 0.005 Å.

### The stress a surface returns

`cauchy_stress` is `(1/V) ∂E/∂ε` in the energy and length units of `eval_in_cell`. It is positive in tension, so a stretched cell has a positive trace and a pressure tensor is `-σ`. LAMMPS reports a pressure: under `units metal` its `pxx pyy pzz pxy pxz pyz` are in bar, so `σ_ab = -p_ab / nktv2p` with `nktv2p = 1.6021765e6`, and its off-diagonal order is not the Voigt order of `CellMask`. The cell block of the gradient is `(V / J) σ`, so a pressure in place of the stress sends every free strain uphill. The largest force then grows instead of falling and the cell keeps shearing, while the same atoms converge in a frozen cell, which never reads the stress.

The energy and the stress must follow every entry of the cell. Held diagonals with free shears change the cell only through its tilts, at a fixed diagonal and volume, and their cell force reads only `σ_yx`, `σ_zx` and `σ_zy`, so diagonal entries that match finite differences say nothing about that search. A box refreshed only when lx, ly, lz or the volume change hands it the energy and stress of the starting tilt while the atoms shear, and the cell shears away under that mask alone: a frozen cell never moves the box, and a fully free search changes a diagonal entry at every step, which refreshes it.

`with_stress_check(StressCheck::new())` compares the tensor with `finite_difference_cauchy_stress` before the first step and stops with `SaddleError::Surface` when an entry differs by more than 1e-6 plus 1% of that entry. Each entry has its own scale: the tension of a hot cell would otherwise hide a wrong shear stress, and a search with held diagonals reads nothing but the shears. The message names the worst entry and the factor between the two tensors: -1 is a pressure, 1.602e6 a stress in bar, -1.602e6 a LAMMPS `metal` pressure passed through, and no single factor a permutation or a rotated frame. When every diagonal entry agrees it says so, which leaves the shear convention or an energy that misses tilts. It costs eighteen energies once. A surface that returns `None` is differenced already and is not checked. `check_cauchy_stress` is the same comparison at any geometry.

### A defect saddle at fixed volume

A saddle in a cell taken from a constant-pressure run is usually wanted at that volume. Two masks hold it exactly.

- `SolidDimerConfig::frozen` holds the cell. Nothing reads the stress, and the barrier belongs to that cell shape.
- `CellMask::voigt([false, false, false, true, true, true])` holds the three diagonal strains and frees the three shears. The search cell is lower triangular, so `M = I + ε` is unit lower triangular: every `h_ii` stays as it was, and so does `V = h_xx h_yy h_zz`. A hydrostatic `with_pressure` does no work here, because it pairs only with the diagonal strains.

```rust
let config = SolidDimerConfig::new(MinModeConfig::default())
    .with_mask(CellMask::voigt([false, false, false, true, true, true]))
    .with_weight(1.0)
    .with_index_check(IndexCheck::first_order())
    .with_stress_check(StressCheck::new());
```

Free shears matter when the shape of the cell is not part of the state being asked about. A single snapshot of a constant-pressure run carries tilt and anisotropy from thermal fluctuations, and a frozen cell turns that tilt into a shear load on the saddle. A defect whose elastic dipole has off-diagonal entries, such as a vacancy hop along <110> in cubic axes, relaxes the shear stress it makes only through the shears. Relaxing a shear stress `σ` lowers the energy by about `V σ^2 / (2 C_44)`, which falls off as 1/V for the defect's own stress. Hold the shears, or freeze the cell, when the shear is the load under study, as in the copper rows below, or when the cell is already an average whose shape should stay.

Keep `with_weight(1.0)`. The stiffness of a strain in the generalized coordinate is `V C / J^2`, so a weight `w` divides it by `w^2`. The force tolerance accepts a stress of `force_tol J / V`, which grows with `w`, and `max_move` allows a strain of `max_move / J` per step. On rgpot's copper EAM, with the diagonals held and the stress right, weights of 0.25, 0.5, 1, 2 and 4 converge in 16, 29, 49, 47 and 103 steps, to saddle energies within 13 µeV. At 4 the cell modes are soft and the tilt stops about 3% short. At 0.25 the first step shears the cell by 0.25 Å, nearly four times its converged tilt, and a smaller weight overshoots further. No weight rescues a stress of the wrong sign: at 0.25 the cell shears by 12 Å in 40 steps, and at 4 it is still shearing after 160.

`tests/mishin_cu.rs` runs that configuration on a Mishin copper vacancy hop in a 4×4×4 cell stretched 1.2% and tilted by 0.4, -0.3 and 0.2% of a side, started from the fixed-cell saddle. It converges in 40 steps with the volume and every `h_ii` unchanged to the last bit. The tilts move by -0.0653, 0.0438 and -0.0292 Å and the saddle energy falls by 0.02194 eV. Holding the shears and freeing the diagonals also converges in 40 steps, once the cell has contracted by 3.7%.

Held diagonals are the one mask that moves the cell at a fixed diagonal and volume, so they are the run that finds a surface that misses tilts. On rgpot's copper EAM at the hop saddle in an untilted cell stretched 1.2%, a box refreshed only when lx, ly or lz change matches the diagonal of the finite-difference stress to 2e-10 eV/Å³. Frozen, fully free and with the shears held it takes the same steps, calls and final energies as the surface that follows every entry: the frozen cell never moves the box, and the other two change a diagonal entry at every evaluation. Those are 43 steps fully free, with the tilt moved by 0.007 Å, and 43 with the shears held. With the diagonals held the right surface converges in 18 steps and moves the tilt by 0.0074 Å, while this box runs it to -0.034, -0.275 and -0.480 Å after 40, 80 and 160 steps and the largest force in the true cell grows from 0.06 to 1.2 eV/Å. Its shear entry is 1.97e-4 eV/Å³ where the derivative of its energy is -2.8e-5. That gap is under the 3.1e-4 a tolerance on the largest entry allowed, and the per-entry check stops the box before the first step. `tests/mishin_cu.rs` stops the same box at the Mishin saddle, where the shear stress is 2.01e-4 eV/Å³ under a tension of 0.0306.

### Certify a minimum and a saddle before Vineyard rates

A Hessian index classifies a stationary point only. A point on the slope of a well has no negative mode and a point off a ridge still has one, so an index count alone would pass them as a minimum and a saddle. `certify_vineyard_pair` checks both points first and returns a `VineyardIndexReport` holding the `IndexReport` of the `minimum` and of the `saddle` when the pair is ready for a Vineyard prefactor.

Each point must be stationary: the largest absolute component of its projected gradient is at most `force_tol`, which must be positive and finite. The minimum must then have no projected eigenvalue below `IndexCheck::negative` and the saddle exactly one. Exactly one needs the second eigenvalue as well as the first, so `IndexCheck::lowest` must be at least two. With a single resolved eigenvalue every index-two point and every maximum would count one negative mode, so a smaller value returns `VineyardIndexError::Evaluation` wrapping `SaddleError::Invalid`, as do an empty or non-finite coordinate and an unusable check, all before either surface is evaluated. `VineyardIndexReport` and `VineyardIndexError` are non-exhaustive, so match the error with a wildcard arm. An eigenvalue between that cutoff and zero is not counted, so the cutoff is the resolution of the certificate. The two points may live on different surfaces, for example the full system and an active region, and each surface names its own constrained or rigid directions through `PointSurface::excluded_modes`. Nothing else is projected, so an open cluster has to name its rotations as well as its translations.

A pair that fails returns a `VineyardIndexError`, one variant for each reason:

| Variant | Meaning |
| --- | --- |
| `Evaluation` | A gradient, Hessian action or excluded-mode query failed, or an argument was invalid. Wraps the `SaddleError`. |
| `MinimumForce` | The reactant is not stationary. Carries `max_force` and `tolerance`. |
| `SaddleForce` | The transition state is not stationary. Carries `max_force` and `tolerance`. |
| `Minimum` | The reactant has projected negative modes. Carries `negative` and the full `report`. |
| `Saddle` | The transition state does not have exactly one. Carries `negative` and the full `report`. |

`SolidDimerConfig::frozen_first_order` builds a fixed-cell dimer that certifies the projected index when it converges. A point that is still not index one after the escapes are spent comes back with `SolidDimerReport::rejected` set while its status stays converged, so a caller reads that flag before it passes the point on.

### A barrier that moves with the cell

`tests/solid_dimer_barrier.rs` couples a double well to the shear. The model is `(u^2 - 1)^2 + 6 (γ - 0.2 u)^2` plus penalties that are zero on the path. At the saddle `u = 0` and `γ = 0`, so the energy is exactly 1. Both minima sit at energy 0, and the barrier is exactly 1. The variable-cell dimer takes 88 generalized evaluations and stops at energy 1. The solid-state band on the same surface takes 92 rows and its climbing image is at energy 1. Freezing the cell at zero shear leaves the one-dimensional barrier at 0.7744, and that dimer takes 42 evaluations. An imposed shear of 0.1 moves the frozen barrier off 0.7744 by the amount of the one-dimensional scan.

### Copper under shear

Zhang, Wheatley, Chen, Qian, and Demkowicz, Phys. Rev. Materials 6, 053605 (2022), doi:10.1103/PhysRevMaterials.6.053605, find that a few percent of shear switches a copper <100> dumbbell toward <110> and drops the barrier to about a millielectronvolt. `tests/mishin_cu.rs` builds EAM1 from the functional form and Table I of Mishin, Mehl, Papaconstantopoulos, Voter, and Kress, Phys. Rev. B 63, 224106 (2001), doi:10.1103/PhysRevB.63.224106. A four-atom cube at 3.615 Å has energy -3.5402183104868774 eV per atom. The published parameters are rounded, so that is 0.0002183104868774 eV below -3.54. The virial matches a right-strain finite difference.

The defect is the split interstitial on one lattice site of a 3×3×3 cell (109 atoms). That site is vacant and the extra atom makes the dumbbell. Each search starts at the <100> minimum relaxed at that shear. The lowest mode is two-sided, so the start is moved 0.02 Å toward the relaxed <110> orientation; the energy of that nudge is under 0.001 eV. The fixed cell holds the shear. The variable cell frees every lower-triangular strain and sets the external stress to minus the stress of the minimum, so the start is a stationary point of the enthalpy. The barrier is the saddle energy minus the minimum. For the variable cell the enthalpy barrier is that difference of `E + V0 σ_ext : ε`. A switch means the converged saddle is the shear-aligned <110> dumbbell. The translation is FIRE 2.0 with a 0.004 Å cap. With a 0.008 Å cap on rgmin 0.6.0 the 5% fixed-cell search steps past the switch, 7.8 meV above the minimum, and converges on an index-1 saddle 0.097 eV up that is not the switch; at 0.016 Å the 3% search does the same. Release build. The rows are `benchmarks/solid_dimer_cu.csv`.

| shear | cell | calls | barrier (eV) | enthalpy barrier (eV) | curvature | stress xy (eV/Å³) | negative modes | switch |
| 0 | fixed | 1238 | 0.473923553294469 | 0.473923553294469 | -0.9853209802173571 | -0.010076037370901233 | 1 | yes |
| 0 | variable | 818 | 0.33255761943240714 | 0.34700116860756225 | -0.5610497728503526 | 0.00000869281411476286 | 1 | yes |
| 0.02 | fixed | 748 | 0.24355187208260531 | 0.24355187208260531 | -0.5631953615905473 | 0.00013434009525319944 | 1 | yes |
| 0.02 | variable | 828 | 0.3132135232119708 | 0.16276484378391842 | -0.2746287816969879 | 0.008144299682520546 | 1 | yes |
| 0.03 | fixed | 743 | 0.14828663803587006 | 0.14828663803587006 | -0.3748629187556624 | 0.005229790430296432 | 1 | yes |
| 0.03 | variable | 958 | 0.286042584261736 | 0.08811246942076423 | -0.14464084405498187 | 0.012136787794593347 | 1 | yes |
| 0.04 | fixed | 795 | 0.06783472088164899 | 0.06783472088164899 | -0.19890988772577067 | 0.010332137118764803 | 1 | yes |
| 0.04 | variable | 2291 | 0.2433784024096326 | 0.027289676167981725 | -0.025428115136747722 | 0.01599529855217751 | 1 | yes |
| 0.05 | fixed | 3981 | 0.007772911164806828 | 0.007772911164806828 | -0.034127148165562324 | 0.015469235712521899 | 1 | yes |
| 0.05 | variable | 2314 | 0.2815321237455919 | 0.9152325828545145 | -1.2530621806837767 | 0.018904004459858143 | 1 | no |

The fixed barrier falls from 0.473923553294469 eV at zero shear to 0.007772911164806828 eV at 5%. On this 109-atom cell the collapse sits near 5%, later than the 3–4% of the larger cell in that paper.

At zero shear the fixed cell stops at 0.473923553294469 eV with one negative projected eigenvalue. Its second eigenvalue is +3.7604e-4 at a finite-difference step of 1e-4, and steps 1e-3, 1e-4, 1e-5 and 1e-6 give +3.7568e-4, +3.7604e-4, +3.7605e-4 and +3.7605e-4. The overlap of that mode with a uniform translation is below 1.3e-14, so it is not a rigid mode and not a step artefact. The call count is 1238, of which 512 are index-check evaluations. The unchecked row of the previous commit, 0.4741823644375245 eV, stopped at the 2e-3 force without this test.

At 4% variable the curvature is -0.025428115136747722. The largest force component first falls under 2e-3 at call 855 and the flat tolerance continues to call 2291, where the largest component is 1.196e-4. At 5% fixed the curvature is -0.034127148165562324. The 2e-3 force is first met at call 2182 and the run continues to call 3981, where the largest component is 1.702e-4.

At 5% variable the reactant, with the external stress equal to minus its own stress, has no negative projected eigenvalue. The lowest is +0.018114765351867675, so the reactant is a minimum. The search stops on an index-1 saddle of the opposite <110>, enthalpy barrier 0.9152325828545145 eV, final shear 0.024405841859849658, 2314 calls, of which 640 are index-check evaluations.

# Solid-state NEB (`docs/orgmode/howto/ssneb.org`)

> Generalized solid-state NEB on the joint atom-strain chart

`SolidNeb` is a climbing-image nudged elastic band on the coordinate already used by `SolidDimer`. Sheppard, Xiao, Chemelewski, Johnson, and Henkelman, J. Chem. Phys. 136, 074103 (2012), doi:10.1063/1.3684549, put the strain next to the atoms and spring the band in that joint vector. The chart is the solid-state dimer of Xiao, Sheppard, Rogal, and Henkelman, J. Chem. Phys. 140, 174104 (2014), doi:10.1063/1.4873437:

\[ h = h_0 (I + \varepsilon), \quad r = r_0 (I + \varepsilon), \quad J = V^{1/3} N^{1/6}. \]

`J` is fixed from `h_0`. The free strains are the lower triangle, stored as `J ε`. The enthalpy is `E + V_0 σ_ext : ε`, the same sign as `JointChart`: a positive diagonal entry of `σ_ext` pushes the cell inward. The tangent, the spring and the climbing image are the ordinary band's, applied to the joint vector. The improved tangent reads the enthalpy. A surface supplies the Cauchy stress; `None` is finite-differenced.

`SolidNeb::frozen` is a `BandSession`. The same configuration and the same surface produce the same positions, including the climbing image. `SolidNeb::joint` rejects `BandConfig` settings with `BandConfig::solid`, `BandConfig::min_mode` (atomic min-mode refinement), `BandConfig::zoom` (Zoom-NEB), `BandConfig::exp_precon` (exponential metric), `BandConfig::autoneb` (AutoNEB), `BandConfig::cell` (periodic minimum-image cell), or any `true` entry in `BandConfig::fixed_atoms`; `SpringKind::OnsagerMachlup` or `SpringKind::OnsagerMachlupLive` springs, or `SpringKind::Weighted` whose `ks` length is not `n_images - 1`; a non-positive or non-finite `BandConfig::time_step`; and, when `BandConfig::quickmin` is `false`, any `BandConfig::method` other than `Method::Fire`, `Method::Lbfgs`, `Method::Bb`, `Method::QuickMin`, or `Method::Ode12r`. It also rejects `positions` with fewer than 3 images, zero columns, or a column count not divisible by 3, or a `cells` slice whose length differs from `positions.nrows()`; in `JointChart::new`, a `reference` cell that is not lower triangular (upper-triangle entries above 1e-8 in magnitude) or has non-positive or non-finite volume `|det(reference)|`, a non-positive or non-finite `weight`, or non-finite entries in the folded lower triangle of `external`; and, in `joint_coordinate` for each image, a singular `reference` or `reference^-1 * cell`, an image `cell` whose strain `ε = reference^-1 * cell - I` has upper-triangle entries above 1e-8 in magnitude or a strain component above 1e-8 in magnitude on an entry held fixed (`false`) by `mask`, a deformed cell with volume `|det(h)| <= 1e-18`, non-finite coordinates, or positions or cell entries that do not round-trip through `chart.geometry` within 1e-6. `joint_coordinate` maps a Cartesian geometry onto the chart. `SolidDimer::set_generalized` moves a search that was built on `h_0` onto a point of that same chart, so a dimer started at a climbing image keeps the enthalpy the band climbed. After a step, `images` returns one `SolidImage` per image with its positions, cell, joint coordinate, energy, enthalpy and stress. It is non-exhaustive: read its fields.

No C field was added.

## Runnable example: solid-state NEB on the joint chart

```rust
use ndarray::{Array1, ArrayView1, array, s};
use rgsaddle::{
    BandConfig, BandStatus, CellMask, JointChart, PointSurface, SaddleError, SolidNeb,
    joint_coordinate, linear_path,
};

const CUBE: [f64; 9] = [4.0, 0.0, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0, 4.0];

struct WellInCell;

impl PointSurface for WellInCell {
    fn eval(&self, r: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        self.eval_in_cell(r, &CUBE)
    }

    fn eval_in_cell(
        &self,
        r: ArrayView1<f64>,
        cell: &[f64; 9],
    ) -> Result<(f64, Array1<f64>), SaddleError> {
        let (x, y, z) = (r[0], r[1], r[2]);
        let elastic: f64 = cell.iter().zip(CUBE).map(|(h, h0)| (h - h0).powi(2)).sum();
        let energy = (x * x - 1.0).powi(2) + 2.0 * y * y + 2.0 * z * z + elastic;
        Ok((energy, array![4.0 * x * (x * x - 1.0), 4.0 * y, 4.0 * z]))
    }
}

fn main() -> Result<(), SaddleError> {
    let cube = [[4.0, 0.0, 0.0], [0.0, 4.0, 0.0], [0.0, 0.0, 4.0]];
    let chart = JointChart::new(cube, 1, CellMask::all(), [[0.0; 3]; 3], 1.0)?;
    let _q0 = joint_coordinate(&chart, CellMask::all(), array![-1.0, 0.0, 0.0].view(), cube)?;
    let mut positions = linear_path(array![-1.0, 0.0, 0.0].view(), array![1.0, 0.0, 0.0].view(), 5, None)?;
    positions.slice_mut(s![1..4, 1]).fill(0.2);
    let config = BandConfig::default()
        .with_force_tol(1e-3)
        .with_max_move(0.1)
        .with_min_mode(None);
    let mut neb = SolidNeb::joint(config, cube, positions, &[cube; 5], CellMask::all(), [[0.0; 3]; 3], 1.0)?;
    let mut report = neb.step(&WellInCell)?;
    while report.status == BandStatus::Running && report.iteration < 400 {
        report = neb.step(&WellInCell)?;
    }
    assert_eq!(report.status, BandStatus::Converged);
    Ok(())
}
```

### The shear-coupled double well

`tests/ssneb.rs` uses `(u^2 - 1)^2 + 6 (γ - 0.2 u)^2` plus penalties that vanish on the path. The minima have energy 0. The saddle `u = 0`, `γ = 0` has energy 1, so the barrier is 1. The variable-cell climbing image converges to that barrier. The frozen cell on the plain double well matches the ordinary CI-NEB at every step.

### Copper under shear

The check against the index-checked dimer is `tests/ssneb_validate_cu.rs`, release, `--ignored`. The system is the same 109-atom Mishin EAM1 cell. The <100> reactant and the shear-aligned <110> are relaxed at the imposed shear. A variable-cell product is then relaxed on the enthalpy `E + V0 σ_ext : ε` with `σ_ext` equal to minus the stress of the <100> minimum, and at 5% the opposite <110> is treated the same way. Eleven images start linear in the joint coordinate. The spring constant is 1. Climbing starts on the first evaluation. The largest force component is driven to 5e-4, or to `0.005 |λ|` when the dimer curvature is softer than that and still at least 5e-5. The negative-mode count projects out the rigid translations and uses a central step of 1e-5. A negative mode is an eigenvalue below -1e-4. The distance removes the mean minimum-image atomic displacement and takes the larger of that maximum and the maximum cell-matrix element. The dimer column is the index-checked search, not the earlier table. Raw rows are `benchmarks/ssneb_validate_cu.csv`.

| shear | cell | product | E dimer | E CI | H dimer | H CI | geometry (Å) | n_neg | result |
| 0 | fixed | aligned | 0.47392355 | 0.47420776 | 0.47392355 | 0.47420776 | 0.087922 | 2 | fail |
| 0 | variable | aligned | 0.33255762 | 0.33256222 | 0.34700117 | 0.34701664 | 0.004087 | 1 | pass |
| 0.02 | fixed | aligned | 0.24355187 | 0.24356221 | 0.24355187 | 0.24356221 | 0.003215 | 1 | pass |
| 0.02 | variable | aligned | 0.31321352 | 0.31313601 | 0.16276484 | 0.16277097 | 0.004157 | 1 | pass |
| 0.03 | fixed | aligned | 0.14828664 | 0.14829576 | 0.14828664 | 0.14829576 | 0.001921 | 1 | fail |
| 0.03 | variable | aligned | 0.28604258 | 0.28597114 | 0.08811247 | 0.08811325 | 0.000435 | 1 | pass |
| 0.04 | fixed | aligned | 0.06783472 | 0.06784900 | 0.06783472 | 0.06784900 | 0.006941 | 1 | pass |
| 0.04 | variable | aligned | 0.24337840 | 0.24328451 | 0.02728968 | 0.02729164 | 0.007535 | 1 | pass |
| 0.05 | fixed | aligned | 0.00777291 | 0.00776732 | 0.00777291 | 0.00776732 | 0.009611 | 1 | pass |
| 0.05 | variable | aligned | 0.28153212 | 69.40842902 | 0.91523258 | 129.51686918 | 20.417387 | 7 | band runs away |
| 0.05 | variable | opposite | 0.28153212 | 293.10519184 | 0.91523258 | 359.42770067 | 21.622133 | 8 | band runs away |

Seven of the ten published comparisons pass. A dimer started at each passing climbing image does not move.

At zero shear the fixed-cell band stops at the 800-step limit with a largest force of 0.009468. Its climbing image is index 2: the projected spectrum, central step 1e-5, starts -0.98787712, -0.01541131. The index-checked dimer saddle at 0.473923553294469 eV has one negative eigenvalue, -0.98724793, and is 0.087922 Å from the climbing image. The energies differ by 2.842e-4 eV. The row fails the force, geometry and index tests. At 3% fixed the band also stops at 800 steps, at 0.001267; the energy matches to 9.1e-6 eV and the geometry to 0.001921 Å on an index-1 point, so only the force target fails.

At 4% variable the flat tolerance runs from call 855, where the force is first under 2e-3, to call 2291. The largest force component is then 1.196e-4 on a curvature of -0.02542812. The enthalpy differs from the climbing image by 1.96e-6 eV and the atoms by 0.007535 Å. At 5% fixed the same tolerance runs from call 2182 to call 3981. The largest component is 1.702e-4 on a curvature of -0.03412715. The energy differs by 5.59e-6 eV and the atoms by 0.009611 Å.

At 5% variable the reactant has no negative projected eigenvalue. The lowest is +0.018114765351867675, so it is a shallow minimum, not a saddle. The shear-aligned <110>, relaxed on the enthalpy, lies 0.00809061 eV below the reactant, and the opposite orientation relaxed on the same enthalpy stops 23.4° from <100> and 21.6° from <110>, 0.00062033 eV below it. Neither band stays on its path. The L-BFGS band climbs from its first step, holds a largest force between 1e-3 and 6e-3 for about 150 steps, and then runs away: at 800 steps the climbing images are 69.4 eV and 293.1 eV above the minimum. On rgmin 0.5.2 the same bands stayed bounded and did not rise; on rgmin 0.6.0 these rows carry no barrier. The index check accepts an index-1 saddle of the opposite <110>, enthalpy 0.9152325828545145 eV, lowest eigenvalue -1.26503090. It is not on either band and is not the barrier of either path.

The 4% variable band passes through 0.02159001 eV with a true force of 0.01048197, and its climbing image is at 0.02729164 eV. That 0.021 eV point is on the slope.

# Strain response of a hop (`docs/orgmode/howto/strain-rate.org`)

> Elastic dipoles, multipoles, FMM fields, and strain response of a hop

## What this is
`StrainResponse` is one migration event. It holds the zero-strain barrier, the elastic dipoles of the minimum and the saddle, an optional Vineyard prefactor and its strain slope, and the symmetry images of that hop. It does not store a strain grid. The strain at which a rate is needed is an argument of `barrier`.

## The dipole
Varvenne and Clouet, Phys. Rev. B 96, 224103 (2017), doi:10.1103/PhysRevB.96.224103, define the interaction of a point defect with an applied strain as `-P : ε` (their Eq. (5)). On a fixed cell their Eq. (8) is `P = -V σ`. The paragraph after that equation removes a nonzero homogeneous stress of the perfect cell. `ElasticDipole::from_stress` is that correction:

    P = -V (σ_defect - σ_bulk)

and the result is symmetrized, because the defect has no net torque (their Eq. (1)). `from_forces` is the same tensor as the first moment of a set of Kanzaki forces with zero resultant and zero torque. Any potential and any cell can supply the stress or the forces. Nothing in the library is specific to copper.

The barrier of one hop is the difference of the two interaction energies:

    ΔE(ε) = ΔE0 - (P_saddle - P_minimum) : ε

Dederichs and Schroeder, Phys. Rev. B 17, 2524 (1978), doi:10.1103/PhysRevB.17.2524, show that a homogeneous strain changes the jump rate through the saddle dipole relative to the equilibrium site. The activation volume `Ω = ∂ΔG/∂τ` is `activation_volume`.

## Higher moments
`ElasticMultipole::about` expands the atomic forces about one centre, the same single-centre idea as Wikfeldt, Batista, Vila, and Jónsson, Phys. Chem. Chem. Phys. 15, 16542 (2013), doi:10.1039/C3CP52097H. The dipole is the first moment. The quadrupole is `Q_ijk = Σ F_i X_j X_k` and the octupole is the next moment. `barrier_in` adds `-(1/2) (Q_saddle - Q_minimum)_ijk ∂_k ε_ij` when the caller supplies a strain gradient. A homogeneous `barrier` leaves that term out.

## Symmetry images
`with_point_group` rotates both dipoles by each supplied matrix, `P' = R P R^T`, and drops images that repeat a dipole. `cubic_rotations` is the 24 proper rotations of the cube. A caller that already knows the distinct hops can pass them to `with_variants` instead. `barrier` returns the image with the lowest barrier, and names it in `Estimate::variant`.

## Trust
`TrustPolicy` is the validity bound.

- `radius` is a cap on the Frobenius norm of `ε`.
- `quadratic` is a second-order error estimate, `quadratic * |ε|²`, compared with `error_tolerance` (0.01 eV by default, `LINEAR_FOLD_EV`).
- `curvature` is the unstable-mode curvature `λ0` and its strain slope. The line is trusted while `λ(ε) = λ0 + slope : ε` stays negative and at least as negative as `fraction * λ0`.
- `floor` is a barrier floor. A prediction at or below it needs a search, which is how a barrier that has collapsed is reported.

`Estimate::trust` is `Linear`, `Explicit` after a cached search, or `NeedsSearch` with the reason. `rate_hz` returns the Arrhenius rate only for `Linear` and `Explicit`.

## Refine
`refine` affine-strains a `SaddleSeed`, runs a fixed-cell `SolidDimer` with an index-1 check, and caches the explicit barrier. The surface is evaluated in Cartesian coordinates, so bind it to the strained cell first. `minimum_energy` is the reactant energy in that cell. A later `barrier` at the same strain returns `Trust::Explicit`.

## Serialization
`to_json` / `from_json` round-trip the event, including the policy, the images, and the explicit cache. The document name is `rgsaddle.strain_response`. An AKMC store can keep one document per event.

## The field of the other defects
The strain in `barrier` is the applied strain plus the strain produced by every other defect. `Kelvin` is the isotropic Green's function. `DirectSolver` sums it. `FmmSolver` walks an octree: neighboring leaves are direct, and a well-separated cell is translated into a local expansion, the multipole-to-local step of Greengard and Rokhlin, J. Comput. Phys. 73, 325 (1987), doi:10.1016/0021-9991(87)90140-9. `examples/elastic_field_bench.rs` times both on 100 to 100000 defects and writes `benchmarks/elastic_field_scaling.csv`.

## A sweep
`examples/akmc_strain.rs` places four copies of one hop along a shear that grows with the site coordinate, takes the trusted Arrhenius rate, and refines the sites past the radius.

## Copper check
`benchmarks/strain_response_cu.json` is the zero-strain dipole of the 109-atom Mishin copper `[100]` dumbbell and its `[110]` saddle, plus the quadratic error coefficient fitted at 0.5 percent shear. It is a validation record, not a rate table. It was recorded on rgmin 0.5.2, so its `barrier0_eV`, 0.473916239370908, is the zero-shear fixed-cell saddle of that run; the rgmin 0.6.0 rerun in `benchmarks/solid_dimer_cu.csv` is 0.473923553294469 eV. At `ε_yx = 0.005` the line is inside 0.01 eV. At `ε_yx = 0.02` the quadratic estimate is past 0.01 eV, so `barrier` returns `NeedsSearch`. The same barrier is returned for `ε_zx = 0.02` from the rotated image of the hop.

## It does not save calls at equal accuracy
`benchmarks/strain_response_head_to_head.csv` is a release run of the ignored test `strain_response_head_to_head`. The test system is the same 109-atom Mishin EAM1 dumbbell. The numbers below are that file. Nothing here is estimated.

The eOn values 0.47381310, 0.24354609, 0.14829202, 0.06786217 and 0.00779374 eV, and the variable-cell values 0.34700694, 0.16255572, 0.08805194 and 0.02792458 eV, are the xy simple shear of that dumbbell, not a vacancy hop. On TheochemUI/eOn branch `feat/solid-state-dimer` at e96b0881 the test is "copper dumbbell saddle follows the shear-aligned switch" in `client/unit_tests/SolidStateDimerTest.cpp`, and `docs/source/user_guide/solid_state.md` ("Copper interstitial") describes it. The cell map is `h = L * [[1, 0, 0], [γ, 1, 0], [0, 0, 1]]`, so `x' = x + γ y`, on a 3×3×3 cell with one <100> dumbbell (109 atoms). Fixed barriers are at 0, 2, 3, 4 and 5%. Variable-cell enthalpy barriers are at 0, 2, 3 and 4%. At 5% variable that test's reactant is a minimum and the index-1 point is not the shear-aligned <110> switch, so it is not a barrier. The full digits are that branch's `benchmarks/solid_dimer_cu.csv`.

The explicit fixed-cell search here, minus those eOn barriers, is +0.0001104559736973, +0.0000057825280919, -0.0000053800793580, -0.0000274446736626 and -0.0000208262501360 eV at 0, 2, 3, 4 and 5%. The variable-cell enthalpy minus the eOn enthalpy is -0.0000057668697195, +0.0002091265311606, +0.0000605272978760 and -0.0006349075244430 eV at 0, 2, 3 and 4%. At 5% variable this search is also not the switch (`explicit_is_barrier` 0, reactant lowest eigenvalue +0.0181147653518677). The enthalpy it did stop on is 0.9152325828545145 eV, which is a different index-1 point from eOn's and is not the barrier either. These rows are the rgmin 0.6.0 run with the 0.004 Å dimer cap of `howto/solid-dimer`.

`StrainResponse::barrier` with the quadratic bound fitted at 0.5% xy shear (coefficient 70.3686534924141682, tolerance 0.01 eV) does not reproduce those barriers once the line leaves that neighborhood, and the refine hook does not repair it. The one-time build is 2975 force calls: 2 for the bulk stress, 1494 for the zero-strain saddle, 1479 for the 0.5% calibration search. A force multipole about the relaxed atoms was refused, because the residual forces are not torque-free, so the build is the stress dipole only. Both rates use one prefactor. The relative rate error is `exp(-(E_method - E_explicit) / kT) - 1` with `k` = `BOLTZMANN_EV_PER_K`. The prefactor cancels. The response object carries 1 Hz only so a rate can be formed.

On the 25 fixed-cell points (xy, xz, uniaxial x, hydrostatic, at 0, 0.5, 1, 2, 3, 4 and 5%, with 0% stored once) the explicit searches cost 40627 calls. The method costs 59338, the build plus every refine attempt. Eight of the seventeen points that `NeedsSearch` were still `Running` after 2500 steps, so the reported barrier is the dipole line. Nine refine calls did stop on an index-1 cache entry. Three of those match the explicit barrier: hydrostatic 2%, 4% and 5%, to -0.0000430058427696, -0.0002751516212811 and -0.0002487851893989 eV, for 3376, 2346 and 2365 calls against explicit searches of 1058, 1527 and 2248. The other six do not match. xy 2% and xz 2% return 0.0658510203606397 and 0.0658510203593892 eV against 0.2435518720826053 and 0.2435622382795373 eV. xy 4% and xz 4% are low by 0.0417736394587109 and 0.0417755757029568 eV. xy 5% and xz 5% return 0.0974351674951208 and 0.0974351674948934 eV against explicit barriers of 0.0077729111648068 and 0.0077711936276046 eV.

Where the line is trusted and no refine runs, the largest absolute barrier error outside the calibration point is 0.0067642793531877 eV, on xy at 1%. The relative rate error there is 0.2990769941275599 at 300 K and 0.1397705883762574 at 600 K. A barrier inside the 0.01 eV fold is not the same rate.

The 200-event batch is the field in `examples/akmc_strain.rs`: four sites, a saddle dipole with `P_xy = 8`, Kelvin modulus 40 and Poisson ratio 0.3, spacing 6, plus `Strain::shear_yx(0.01)`, then symmetrized. All four stay on the line, so the queries add 0 calls. With the build, the method costs 2975. The four sites are two strains. One explicit search at each costs 1612 and 1600 calls, sum 3212. Fifty events at each site, each event searching again, cost 321200. The barrier errors are -0.0069949937062344 eV and -0.0071769982823058 eV. The 300 K relative rate errors are 0.3107224023749027 and 0.3199827769541861. The 600 K ones are 0.1448678536734722 and 0.1489050339145468. Repeating a trusted query skips the search. It does not return the explicit rate. One search at each of the two strains costs 3212 calls, against 2975 for the build.

Variable-cell rows are the two shears, including 0%. Uniaxial and hydrostatic are imposed strains, so only the fixed cell is the ensemble the dipole line claims. The 13 variable searches cost 20439 calls. The method does not answer those enthalpies.

# NPT lattice sampling (`docs/orgmode/howto/npt-lattice.org`)

> Isotropic NPT lattice sampling with blocking standard errors

`npt_lattice` samples the lattice parameter of a cubic crystal under isotropic Langevin dynamics. The default barostat is stochastic cell rescaling, which samples the isotropic NPT ensemble. `NptBarostat::Berendsen` is opt-in and is for equilibration only: its volume distribution depends on the coupling time and is not the NPT ensemble, and the report then carries no fluctuation statistics. The sampled lattice is what a finite-temperature calculation needs before it builds a cell, such as the copper validation in `howto/defect-pair-rates`. The module is `npt`. It holds `NptConfig`, `NptBarostat`, `NptReport` and `npt_lattice`, and all four are re-exported at the crate root.

## What the run does
The caller passes the Cartesian `positions`, the row-major `Cell`, a temperature, a mass and an evaluator. The evaluator returns `(energy, gradient, stress)` for a position and a cell, with the stress a tension-positive Cauchy stress. Energy is accepted for compatibility and unused. Units follow `BOLTZMANN_EV_PER_K` and `angular_scale_rad_s`: eV, Å and amu, with times in seconds in the configuration.

Each step evaluates the surface twice, once at the start for the first half step and once after the thermostat for the second, so a run of `S` steps makes `2 S` evaluations. The rescaling at the end of a step changes the positions and the cell, which is why the first evaluation of the next step cannot reuse the previous one. Each step is a velocity-Verlet half step, an Ornstein-Uhlenbeck thermostat step with the centre-of-mass momentum removed, the second half step, and a barostat rescaling of the cell and the positions. Stochastic cell rescaling (Bernetti and Bussi, J. Chem. Phys. 153, 114107 (2020), doi:10.1063/5.0020514) takes their equation 5: the Berendsen drift of the log volume, plus a noise whose variance is fixed by the compressibility and the coupling time. The positions and the cell are multiplied by the exponential of one third of that increment, and the velocities are divided by the same factor, because the pressure uses the instantaneous kinetic energy. The sampled volume variance does not depend on the coupling time. `NptBarostat::Berendsen` instead multiplies the volume by a factor limited to 0.5 per cent and does not scale the velocities. The pressure that drives the barostat and that the report carries is the kinetic pressure `2 K / (3 V)` minus a third of the trace of the stress. Leaving the kinetic term out would sample the cell where the configurational stress vanishes instead of the zero-pressure cell. `tests/npt_lattice.rs` checks the kinetic term against an ideal gas, which reads `(N - 1) k T / V` once the centre-of-mass momentum is removed, against atoms tethered to cell-scaled sites, whose total pressure is zero at every volume, and against a Lennard-Jones fluid, whose volume variance is the same at two coupling times and whose compressibility matches the volume-fluctuation formula.

## Configuration
`NptConfig` is non-exhaustive. Start from `NptConfig::default()` and chain the `with_*` setters.

| Field | Setter | Default |
| --- | --- | --- |
| `repeats` | `with_repeats` | 6, conventional cells per lattice vector, so the reported lattice parameter is the cube root of the volume over this |
| `steps` | `with_steps` | 4000, the first run length |
| `maximum_steps` | `with_maximum_steps` | 4000, the longest run after extensions |
| `extension_steps` | `with_extension_steps` | 1000, added when the pressure screen is not met |
| `equilibration_steps` | `with_equilibration_steps` | 2000, discarded before statistics |
| `block_steps` | `with_block_steps` | 250, the length of one reported block |
| `timestep_s` | `with_timestep_s` | 2e-15 |
| `langevin_gamma_per_s` | `with_langevin_gamma_per_s` | 1e12 |
| `barostat` | `with_barostat` | `NptBarostat::StochasticCellRescaling` |
| `berendsen_tau_s` | `with_berendsen_tau_s` | 0.5e-12, the pressure coupling time of whichever `barostat` is selected |
| `compressibility_per_ev_a3` | `with_compressibility_per_ev_a3` | 1 / 0.87 |
| `target_pressure_ev_a3` | `with_target_pressure_ev_a3` | 0 |
| `seed` | `with_seed` | 11 |

The call needs at least two blocks of `block_steps` in the production part of `steps`, finite positive controls (the target pressure only has to be finite, and may be negative), and `steps <= maximum_steps`; otherwise it returns `SaddleError::Invalid`. `block_steps` sets `NptReport::blocks`, the number of complete blocks, and that floor. It does not set the standard errors.

## What the call refuses
Every refusal happens before the first evaluation, and leaves `positions` and `cell` as they were.

- A single atom returns `SaddleError::Invalid`. The thermostat removes the centre-of-mass momentum, which leaves `3 (N - 1)` thermal degrees of freedom, so one atom would sit at rest at any temperature and report a converged zero pressure. This holds at zero temperature as well.
- A control that is NaN or infinite, or whose value in internal units overflows or underflows, returns `SaddleError::Invalid`.
- A NaN or infinity in `positions` or in the cell returns `SaddleError::NonFinite`, and a cell whose volume is zero returns `SaddleError::Invalid`, since the kinetic pressure divides by the volume.
- A cell that is not cubic returns `SaddleError::Invalid`. The edges must be equal and orthogonal to a relative tolerance of 1e-8. Outside that tolerance the call is refused. It does not report `cbrt(volume) / repeats` for a cell that is not a cube. A rotated cube, with equal orthogonal edges, is accepted.
- An `extension_steps` that cannot be added to the step counter without overflow returns `SaddleError::Invalid` before the first evaluation. A wrapped counter would skip the final checkpoint and return an earlier report.

A value that turns non-finite during the run is an error too: the evaluator's gradient or stress, the volume, the pressure, the barostat factor and the lattice sample are each checked at every step, and the standard errors are computed only from finite series. A gradient whose length differs from `positions` returns `SaddleError::Shape`. No partial report is returned.

## The random stream
The thermostat noise is xoshiro256** (Blackman and Vigna) with its state expanded from the seed by SplitMix64, as the authors prescribe. Every seed, including consecutive ones, therefore starts an unrelated stream, and seed 0 is valid. A stream is a function of the seed alone, so a run is reproducible.

## Standard errors
Successive steps of a barostatted run are correlated over many hundreds of steps, so the plain standard error of the steps, or of block means shorter than the correlation time, is too small. `npt_lattice` blocks the per-step series instead (Flyvbjerg and Petersen, J. Chem. Phys. 91, 461 (1989), doi:10.1063/1.457480). Neighbouring pairs are averaged to double the block length, the standard error of the block means is computed at every level, and the reported value is the largest over the levels that keep at least sixteen blocks. That choice errs high: on 24 uncorrelated series of 16384 values it averaged 1.14 times the plain standard error. The estimator is tested in `src/npt.rs` on autoregressive series whose standard error is known in closed form. At a correlation parameter of 0.995 over 131072 steps the estimate averaged 1.01 times the exact value over 24 seeds, where 250-step block means averaged 0.65 times it.

A standard error is only as good as the run is long against the correlation. `lattice_error_resolved` and `pressure_error_resolved` are true when the last doubling of the block length raised the estimate by no more than its own sampling error, which is the plateau of the blocking curve, and for a series with no spread. When a flag is false the estimate was still rising at the longest block length the run allows, and the standard error is a lower bound. A run of 2000 production steps of the copper cell in `howto/defect-pair-rates` shows it: its lattice standard errors of 0.00004 to 0.00013 Å are unresolved, and eight seeds of that run scatter by 0.0006 Å. Those standard errors are ensemble fluctuations only when `ensemble_fluctuations` is true, which it is for stochastic cell rescaling. For `NptBarostat::Berendsen` the standard errors are zero, both resolved flags are false, and `pressure_converged` is false: the zeros are not a measured variance, and the run continues to `maximum_steps` because the pressure screen needs ensemble errors that this barostat does not produce.

## Reading `pressure_converged`
`NptReport::pressure_converged` is true when the pressure error is resolved and the mean pressure is within two standard errors of the target, with a series that has no spread passing only at exactly zero residual. It is indicative. It is a screen, not a proof of equilibrium: it cannot see a drift slower than the run, and a two standard error window passes a real bias about one time in twenty. Read a true as "no evidence of bias at this run length", and read a false as "run longer or look at the spread", not as a failed calculation. The lattice standard error has its own flag and is not part of the screen.

A run that fails the screen extends by `extension_steps` until it passes or reaches `maximum_steps`. The screen is applied again at every extension to a series that has grown, so over a whole run it passes a real bias somewhat more often than the one time in twenty of a single test, another reason to read it as indicative. With the defaults, `maximum_steps` equals `steps`, so no extension happens unless the caller raises the cap.

## Runnable example: the pressure of an ideal gas
The example is `examples/npt_lattice.rs`.

```rust
use ndarray::Array1;
use rgsaddle::{BOLTZMANN_EV_PER_K, Cell, NptConfig, SaddleError, npt_lattice};

fn main() -> Result<(), SaddleError> {
    let per_side = 5;
    let spacing = 4.0;
    let mut positions = Vec::new();
    for i in 0..per_side {
        for j in 0..per_side {
            for k in 0..per_side {
                positions.extend([i, j, k].map(|index| index as f64 * spacing));
            }
        }
    }
    let atoms = positions.len() / 3;
    let mut positions = Array1::from_vec(positions);
    let edge = per_side as f64 * spacing;
    let mut cell = Cell([[edge, 0.0, 0.0], [0.0, edge, 0.0], [0.0, 0.0, edge]]);

    let temperature_k = 300.0;
    let config = NptConfig::default()
        .with_repeats(per_side)
        .with_steps(4_000)
        .with_maximum_steps(8_000)
        .with_extension_steps(2_000)
        .with_equilibration_steps(1_000)
        .with_compressibility_per_ev_a3(1.0e-12)
        .with_seed(3);
    let report = npt_lattice(
        &mut positions,
        &mut cell,
        temperature_k,
        63.546,
        config,
        |x, _| Ok((0.0, Array1::zeros(x.len()), [[0.0; 3]; 3])),
    )?;

    let ideal = (atoms - 1) as f64 * BOLTZMANN_EV_PER_K * temperature_k / edge.powi(3);
    println!(
        "{} steps, pressure {:.4e} +- {:.1e} eV/A^3 (resolved {}), ideal gas {ideal:.4e}",
        report.steps,
        report.mean_pressure,
        report.pressure_standard_error,
        report.pressure_error_resolved
    );
    Ok(())
}
```

It prints the pressure of 125 non-interacting atoms against `(N - 1) k T / V`. Run it with `cargo run --release --example npt_lattice`.

# Sample a hyperplane with LAMMPS (`docs/orgmode/howto/lammps-hyperplane.org`)

> Plane-constrained BAOAB sampling with LAMMPS through lammpc

## Build the optional stack

Enable the `lammps` feature. It also enables `ohtst`, the hyperplane
thermodynamic integration and its C entry points. Default builds do not
compile rgpot or load LAMMPS.

The supported native stack is:

- `OmniPotentRPC/lammpc` at `dc443997` plus the constrained MD API patch
- `OmniPotentRPC/rgpot` at `97ebba0b`
- LAMMPS `stable_22Jul2025_update2`, built as a serial shared library

Build lammpc with its `with_lammps` Meson option. Set `LAMMPC_LIBRARY` to the
resulting `liblammpc.so`, or set an explicit path with
`LammpsSamplerConfig::with_library_path`.

```console
$ cargo test --features lammps --test lammps_sampler
```

The test uses `RGSADDLE_CU_EAM` for the optional `eam/alloy` copper smoke
case. The value is the path to a LAMMPS alloy table containing Cu.

## Describe the system

`LammpsSystem` takes flat rgpot `PotentialConfig` bytes with the `lammps`
arm, Cartesian positions in angstrom, atomic numbers, masses in amu, and an
optional row-major cell. The masses must match the `LammpsParams.masses`
entries selected by the atomic numbers.

```rust
let system = LammpsSystem::default()
    .with_config_bytes(config_bytes)
    .with_positions(positions)
    .with_atomic_numbers(atomic_numbers)
    .with_masses(masses)
    .with_box_matrix(cell);

let mut sampler = LammpsHyperplaneSampler::new(
    system,
    LammpsSamplerConfig::default()
        .with_library_path("liblammpc.so")
        .with_time_step_ps(0.001)
        .with_friction_per_ps(1.0)
        .with_thermostat(LammpsThermostatKind::BaoabLangevin)
        .with_excluded_modes(3),
);
```

The interaction model remains inside the rgpot configuration. The sampler
does not name a pair style, element, or crystal.

## Sample a plane

`LammpsHyperplaneSampler` implements `HyperplaneSampler`: `sample_hyperplane`
takes a `Hyperplane` and a `HyperplaneSampleBudget` and returns the
`HyperplaneEnsemble` of records. The PAFI and OH-TST estimators that consume
those records are in rgflux (https://github.com/OmniPotentRPC/rgflux), whose
`pafi::cartesian::average_hyperplane_with_sampler` and
`ohtst::sample_plane_with_sampler` take this sampler.

The budget's warm-up is only a minimum floor. The estimators apply their
equilibration test to the returned constraint-force series. The backend adds
no hidden burn-in.

lammpc advances one projected BAOAB step at a time. Each step projects the
force and velocity, restores the position to the plane after each drift,
and thermostats tangent velocity with Langevin noise. LAMMPS hard-region
sampling is pending a lammpc capability that invokes its registered boundary
callback on every constrained MD step. Current lammpc main has the callback
registration entry points but not that constrained-step behavior, so the
adapter must reject a region until the capability is available. The force
evaluation is the live in-process LAMMPS session. No penalty restraint is
used.

Mass-weighted sampling returns \(q=M^{1/2}x\), its tangent force, and its
removed velocity. Cartesian sampling leaves the vectors Cartesian and uses
the mass metric for projection. PAFI and OH-TST statistics are computed by
rgflux after lammpc returns the records.

Each record exposes two thermostat metadata observables:
`lammps.thermostat` and `lammps.effective_degrees_of_freedom`. The thermostat
field is a stable enum code (currently BAOAB Langevin). The effective degrees
of freedom are \(3N - 1 - n_{\mathrm{excluded}}\), with
`n_{\mathrm{excluded}}` supplied through
`LammpsSamplerConfig::with_excluded_modes`.

# Recover a sparse Hessian (`docs/orgmode/howto/sparse-hessian.org`)

> Direct Curtis-Powell-Reid sparse Hessian recovery by distance-2 colouring

A cutoff potential has a zero Hessian block between atoms that do not interact. `sparse_hessian` recovers those blocks directly. Build an atom-level `SparsityPattern`, colour it at distance 2, and read `SparseHessian`. The same value implements `rgmin::ApplyHessian`. `to_dense` is the dense export.

The colouring is greedy in smallest-last order. Two atoms share a colour only when they are not neighbours and share no neighbour, so one gradient difference recovers every block touched by that colour. Colours are independent. A block of them is one call to `eval_displacements`, and the rows of that call run together. After the batch returns, each colour is written back in colour index order. The block holds as many colours as `SparseHessianOpts::memory_budget` can store as geometry plus gradient buffers (256 MiB by default), and every colour when the whole problem fits. The budget is not the thread count. Central differences use both sides. Forward differences use one side and a single centre evaluation. The reported evaluation count is `n_colours * 3 * sides`, plus one for a forward centre. The displacement `h` is `SparseHessianOpts::step`. A central difference truncates as \(O(h^2)\). A gradient accurate to \(\varepsilon_g\) adds roundoff \(O(\varepsilon_g / h)\). Those terms meet near \((3 \varepsilon_g / \lvert g''' \rvert)^{1/3}\). On noise-free f64 gradients the Lennard-Jones and Gupta sweeps are smallest at 1e-6, and at 1e-4 they are 9.05e-7 and 8.13e-8. The default 1e-4 matches Index1Config's fd_dr. An ECnoise estimate plugs in through the same field. Each geometry is its own chunk.

After recovery the blocks are replaced by `(H + H^T) / 2`. Powell and Toint (1979) cover both this symmetric direct read and the substitution. Star colouring (Coleman and Moré 1984) is the direct method that uses symmetry and stays a later option.

The pattern is symmetric and off-diagonal. The diagonal block is implied. `from_positions` queries `linkcell::pairs_within` on a periodic cell and `linkcell::pairs_open` on an open cluster, and keeps every pair whose squared distance is positive and at most the cutoff squared. A thin cell, whose partner stencil would allocate a multi-gigabyte buffer, is enumerated by an image walk bounded by the cutoff over each width. A search that linkcell refuses is returned as an error rather than an empty pattern. An absent cell is an open cluster and the distance is Euclidean. Pass `r_c` for a pair potential, `2 r_c` for an atom-centred model, and `r_c` times the layer count for a message-passing model, plus `SparseHessianOpts::search_skin`, which is `max(2 * step, skin)`. That pad keeps an unmoved neighbour from entering the interaction range during a probe. A cell smaller than the cutoff does not store a self loop: a periodic image of an atom is that atom.

`lowest_eigenpairs` runs a thick-restart Lanczos on `matvec`. It does not call the surface. A Ritz pair is kept when `||H y - theta y||` is at most `1e-8` times an estimate of `||H||`, and the residuals are returned with the pairs. The iteration cap is an error, not an unconverged vector. Inner products are a fixed-order dot: serial below 65,536 elements, and above that a parallel sum of 4,096-element chunks added back in chunk index order. Axpy updates go through `rgmin::vecops`. At dimension 96 or below the basis is the whole space. `project_excluded` removes the rows returned by `PointSurface::excluded_modes`. The recovered matrix is frozen at that geometry. `apply_hessian` and `matvec` panic if the vector length does not match. `SparseHessianOpts` and `LowestEigenpairs` are non-exhaustive. Build the opts with `Default` and `with_difference`, `with_step`, `with_memory_budget`, and `with_skin`.

`action_pair_blocks` reads chosen atom pairs from an exact Hessian action instead. Block `(i, j)` holds the three products of atom `i`'s Cartesian axes restricted to atom `j`: index `axis * 3 + component` stores `(H e_{i,axis})[j, component]`. It needs `PointSurface::hessian_vector` and refuses a surface without one; it makes no finite difference. The pairs are checked with `SparsityPattern::from_adjacency`, and a self-pair is returned in the caller's order.

`one_atom_hessian` is the per-atom baseline that eOn uses when a potential has no finite cutoff. eOn colours a finite cutoff itself. `prefactor_hessian` is the compressed seed. `Index1Config` is non-exhaustive. `with_sparse_pattern` passes that seed to `Index1Session` on the first step when no Hessian was supplied. The field defaults to none, so an index-1 search that does not set it still builds a dense central-difference Hessian. `Index1Config::default()` is unchanged.

The partition is Curtis, Powell, and Reid, IMA J. Appl. Math. 13, 117 (1974), https://doi.org/10.1093/imamat/13.1.117. The distance-2 rule is Gebremedhin, Manne, and Pothen, SIAM Rev. 47, 629 (2005), https://doi.org/10.1137/S0036144504444711. Powell and Toint, SIAM J. Numer. Anal. 16, 1060 (1979), https://doi.org/10.1137/0716078, cover the symmetric direct read and the substitution. Star colouring is Coleman and Moré, Math. Program. 28, 243 (1984), https://doi.org/10.1007/BF02612334.

```rust
let opts = SparseHessianOpts::default();
let pattern = SparsityPattern::from_positions(x.view(), Some(&cell), cutoff, opts.search_skin())?;
let hessian = sparse_hessian(&surface, x.view(), &pattern, opts)?;
let dense = hessian.to_dense();
let pairs = hessian.lowest_eigenpairs(1)?;
let _ = (dense, pairs.values, pairs.vectors, pairs.residuals);
```

# Use Sella steppers and sessions (`docs/orgmode/howto/sella.org`)

> P-RFO, restricted P-RFO, Index1Session, Sella sessions, internal coordinates, cell charts, and SAMD

`SellaMinSession` uses order-zero quasi-Newton steps. `SellaSaddleSession` partitions a rational function optimization (RFO) step into uphill and downhill subspaces. Both retain a Hessian model and a trust radius, and expose one outer step at a time.

## Runnable example: P-RFO, restricted P-RFO, Index1Session, Sella, internal coordinates, cell charts, and SAMD

Partitioned rational function optimization (P-RFO) follows Baker, J. Comput. Chem. 7, 385 (1986), doi:10.1002/jcc.540070402 [bakerAlgorithmLocationTransition1986], on the rational-function form of Banerjee, Adams, Simons, and Shepard, J. Phys. Chem. 89, 52 (1985), doi:10.1021/j100247a015 [banerjeeSearchStationaryPoints1985]. Restricted-step P-RFO scales the augmented Hessian so the Cartesian step stays within the Euclidean trust sphere, following Besalú and Bofill, Theor. Chem. Acc. 100, 265 (1998), doi:10.1007/s002140050387 [besaluRestrictedStepRfo1998], and Bofill's Hessian update mixes Powell and SR1 as in Bofill, J. Comput. Chem. 15, 1 (1994), doi:10.1002/jcc.540150102 [bofillUpdatedHessian1994]. The i-PI level shift in `nichols_step` and `nichols_displacement` is the step of Nichols, Taylor, Schmidt, and Simons, J. Chem. Phys. 92, 340 (1990), doi:10.1063/1.458435 [nicholsWalkingPotentialSurfaces1990], with the local quadratic strategies of Simons and Nichols, Int. J. Quantum Chem. 38 (S24), 263 (1990), doi:10.1002/qua.560382427 [simonsWalkingPotentialSurfaces1990]. Sella's order-1 and order-0 sessions, equality `Constraints` and `InternalPes` charts, cell log-deformation chart (`CellChart::LogDeform`), and surface-adapted molecular dynamics (`SamdSession`) follow Hermes, Sargsyan, Najm, and Zádor, J. Chem. Theory Comput. 18, 6974 (2022), doi:10.1021/acs.jctc.2c00395 [hermesSellaOpensourceAutomationfriendly2022], with the canonical velocity-rescaling thermostat of Bussi, Donadio, and Parrinello, J. Chem. Phys. 126, 014101 (2007), doi:10.1063/1.2408420 [bussiCanonicalSampling2007]; the Cartesian GP dimer comparison against Sella internal coordinates is Goswami, Masterov, Kamath, Peña-Torres, and Jónsson, J. Chem. Theory Comput. 21, 7935 (2025), doi:10.1021/acs.jctc.5c00866 [goswamiGaussianProcessSaddle2025].

```rust
use ndarray::{Array1, Array2, ArrayView1, array};
use rgsaddle::{
    CellCartesianPes, CellChart, Constraints, HessianUpdate, Index1Config, Index1Session,
    Index1Status, InternalPes, NicholsMode, PartitionedRationalFunctionOptimization, PointSurface,
    PrfoKind, RationalFunctionOptimization, SaddleError, SamdConfig, SamdSession, SellaMinConfig,
    SellaMinSession, SellaSaddleConfig, SellaSaddleSession, VelocitySofteningConfig, VocnFound,
    bofill_update, cap_max_abs, expm_3x3, logm_3x3, nichols_displacement, nichols_step,
    niggli_reduce_cell, partitioned_rfo_eigen, place_perp_dummy, powell_update, prfo_get_s,
    prfo_stepper, prfo_trust_region, restricted_prfo_displacement, rfo_stepper,
    soften_velocity_on,
};

struct QuadraticSaddle;

impl PointSurface for QuadraticSaddle {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let mut e = -0.5 * x[0] * x[0];
        let mut g = Array1::zeros(x.len());
        g[0] = -x[0];
        for i in 1..x.len() {
            e += x[i] * x[i];
            g[i] = 2.0 * x[i];
        }
        Ok((e, g))
    }
}

fn main() -> Result<(), SaddleError> {
    // 1. P-RFO, RFO, restricted P-RFO, and Nichols steps on a 2x2 spectrum
    let evals = array![-1.0, 2.0];
    let evecs = Array2::<f64>::eye(2);
    let grad = array![0.4, 0.6];
    let _eig_step = partitioned_rfo_eigen(evals.view(), grad.view(), 1.0, PrfoKind::Index1)?;
    let _sella_prfo = prfo_get_s(&evals, &evecs, &grad, 1, 1.0);
    let _sella_tr = prfo_trust_region(&evals, &evecs, &grad, 1, 0.2);
    let _prfo_opt = prfo_stepper("prfo", 1).unwrap_or(PartitionedRationalFunctionOptimization::new(1));
    let _rfo_opt = rfo_stepper("rfo", 0).unwrap_or(RationalFunctionOptimization::new(0));

    let mut h = array![[-1.0, 0.0], [0.0, 2.0]];
    let mut dx = restricted_prfo_displacement(h.view(), grad.view(), None, 0.2, PrfoKind::Index1)?;
    cap_max_abs(&mut dx, 0.15)?;
    let _nichols_eig = nichols_step(grad.view(), evals.view(), evecs.view(), None, 0.2, NicholsMode::Index1)?;
    let _nichols_cart = nichols_displacement(h.view(), grad.view(), None, 0.2, NicholsMode::Index1)?;
    powell_update(&mut h, dx.view(), grad.view())?;
    bofill_update(&mut h, dx.view(), grad.view())?;

    // 2. Index1Session on QuadraticSaddle
    let mut index1 = Index1Session::new(
        Index1Config::default().with_update(HessianUpdate::Bofill),
        array![0.2, 0.3, -0.1],
        None,
        None,
    )?;
    let rep1 = index1.run(&QuadraticSaddle, 20)?;
    assert_eq!(rep1.status, Index1Status::Converged);

    // 3. SellaSaddleSession and SellaMinSession
    let x0 = array![0.0, 0.0, 0.0, 0.96, 0.0, 0.0, -0.24, 0.93, 0.0];
    let masses = array![16.0, 1.0, 1.0];
    let mut sella_sad = SellaSaddleSession::new(SellaSaddleConfig::default(), x0.clone(), masses.clone())?;
    let _sad_step = sella_sad.step(&QuadraticSaddle)?;
    let mut sella_min = SellaMinSession::new(SellaMinConfig::default(), x0.clone(), masses.clone())?;
    let _min_step = sella_min.step(&QuadraticSaddle)?;

    // 4. Internal coordinates (vocn + Constraints + InternalPes) and CellChart::LogDeform
    let found = VocnFound::from_parts([[0, 1], [0, 2]], [[1, 0, 2]], []);
    let mut ipes = InternalPes::from_find(x0.clone(), masses.clone(), &found)?;
    let _ = ipes.kick(&QuadraticSaddle, array![0.01, -0.01, 0.02].view())?;
    let _dummy = place_perp_dummy(x0.view(), 0, 1)?;
    let mut cons = Constraints::new(3)?;
    cons.fix_com(x0.view())?;

    let cell = rgsaddle::mic::Cell::ortho(10.0, 10.0, 10.0).unwrap();
    let mut cpes = CellCartesianPes::new(x0.clone(), masses, cell)?;
    cpes.set_chart(CellChart::LogDeform);
    let mut raw_cell = cpes.cell9();
    let _ = niggli_reduce_cell(&mut raw_cell, 20.0)?;
    let _ = logm_3x3(expm_3x3([[0.01, 0.0, 0.0], [0.0, -0.01, 0.0], [0.0, 0.0, 0.0]]))?;

    // 5. SAMD and velocity softening
    let soft = soften_velocity_on(
        &cons,
        x0.view(),
        array![0.2, -0.1, 0.0, -0.1, 0.2, 0.0, -0.1, -0.1, 0.0].view(),
        &QuadraticSaddle,
        VelocitySofteningConfig::default().with_steps(2),
    )?;
    let mut samd = SamdSession::with_chart(SamdConfig::default(), x0, soft.direction, &QuadraticSaddle, cons)?;
    let draw = Array1::from_elem(9, 0.1);
    let samd_rep = samd.step(&QuadraticSaddle, draw.view())?;
    assert!(samd_rep.energy.is_finite());
    Ok(())
}
```

`SellaGeom` selects a named geometry or an equality `Constraints` chart. The steppers project onto the tangent space, retract the displacement, and transport vectors. Cartesian sessions use the rigid quotient when internal molecular modes are available. `InternalPes` maps host-supplied bonds, angles and dihedrals through the Wilson matrix. `CellCartesianPes` and `CellInternalPes` include the active cell entries; their energy and gradients are evaluated in the displaced cell.

`TrustRegion` limits the Euclidean step norm. `RestrictedAtomicStep` limits the largest atom displacement and uses that same quantity when updating its radius. `MaxInternalStep` limits weighted internal coordinates. The restricted atomic step (RAS) refuses an internal-coordinate packing.

An order-1 Cartesian search takes that atomic step if it diagonalizes the Hessian.
Its Euclidean radius must also be above one distance unit.
That step's ceiling is `max(delta, 0.1)`.
The last section of this page shows how a smaller search takes it in place of the radius.
The alpha search follows the derivative of the partitioned rational function optimization step.
The uphill and downhill blocks are therefore not a uniform scale of the full step.
Rho grows and shrinks the atomic ceiling.
The stored Euclidean radius stays where `delta * n_free` put it.
The first finite-difference diagonalization may accept a negative root past the uphill mode once its residual is under `gamma` and its curvature is below one.
A later diagonalization keeps the relative residual.
A free block larger than 128 is diagonalized with faer's self-adjoint eigensolver.
A block of 128 or fewer stays on cyclic Jacobi.

`update_h_ms` applies a simultaneous multi-secant Hessian update. `update_hessian_cols` applies individual updates in column order. `HessUpdate::TsBfgs` supports an indefinite Hessian. The retained Sella trajectories are checked by `tests/sella_gold.rs`.

`SamdSession::new` uses Euclidean dynamics. `on` and `with_chart` retain a geometry for every step; `step_on` selects a geometry for one step. The velocity-Verlet displacement, transported velocity and stochastic rescaling remain in its tangent space.

`force_match_hessian` fits pair contributions from Buckingham, Morse, Lennard-Jones and harmonic bond terms. `EigenDevice::Dlpk` observes the size, disable and allocation-failure policy. The available eigensolver, QR and projection implementations use the host fallback; selecting that policy does not imply GPU acceleration.

## Take the Ritz pairs from the symmetrized products

Use `symmetrized_ritz` to make a Cartesian `SellaSaddleSession` take its Ritz pairs as Sella does.
On noisy gradients this can shorten its diagonalizations.
The session diagonalizes its free Hessian by Rayleigh-Ritz on one-sided finite-difference Hessian-vector products.
Gradients from a self-consistent field (SCF) carry noise, so those products are not exactly symmetric.
The residual test reads the products symmetrized as Sella's `symmetrize_Y` does with `symm=2`.
By default the Ritz pairs come from the mean of `V^T AV` and its transpose instead.
That mean differs from the symmetrized products inside the subspace.
Each residual therefore keeps a part in the subspace.
The subspace can then grow to the free dimension before the residual test passes.
Sella's `rayleigh_ritz` takes its Ritz pairs from those symmetrized products, and `symmetrized_ritz` does the same here.

Turn it on in the config, or on a live session before its next diagonalization:

```rust
let config = SellaSaddleConfig::default().with_symmetrized_ritz(true);
let mut session = SellaSaddleSession::new(config, x, masses)?;
// or, on a session that already exists
session.set_symmetrized_ritz(true);
```

From minor 24, a C host sets the option through the application binary interface (ABI).

```c
if (rgsaddle_sella_saddle_set_symmetrized_ritz(session, 1) != RGSADDLE_OK) {
  /* NULL session, or a value other than 0 and 1 */
}
```

With exact symmetric products the two choices agree up to rounding.
The default is off and steps as before, bit for bit.
`tests/sella_symmetrized_ritz.rs` pins that walk and the shorter first diagonalization with the option on.

A 2025 study compared two saddle searches on 500 molecular reactions.
Its dimer search used Gaussian process regression in Cartesian coordinates, while Sella used internal coordinates.
Both searches needed similar numbers of electronic structure calculations.
That study is Goswami, Masterov, Kamath, Peña-Torres and Jónsson.
Its paper is J. Chem. Theory Comput. 21, 7935 (2025), digital object identifier (DOI) 10.1021/acs.jctc.5c00866.
This session takes the partitioned rational function optimization (P-RFO) step of Baker.
That paper is J. Comput. Chem. 7, 385 (1986), doi:10.1002/jcc.540070402.
Hermes, Sargsyan, Najm and Zádor describe Sella's iterative diagonalization and its `symm=2` products.
Their paper is J. Chem. Theory Comput. 18, 6974 (2022), doi:10.1021/acs.jctc.2c00395.

The option helps most where gradients are noisy.
The Baker transition-state set is the 25 starts of Baker and Chan.
Their paper is J. Comput. Chem. 17, 888 (1996), `doi:10.1002/(SICI)1096-987X(199605)17:7<888::AID-JCC12>3.0.CO;2-7`.
The runs below take tblite GFN2-xTB gradients in Cartesian coordinates.
GFN2-xTB is version 2 of the geometry, frequency, noncovalent, extended tight binding method.
Each search stops at a Euclidean gradient norm of 0.05 eV/Å and has a cap of 400 evaluations.
In these runs the atom ceiling of the next section is off.
With this option off too, the session reached a saddle of index one from 19 starts in 1450 evaluations in all.
The index is the count of significant imaginary frequencies that xtb 6.6.1 reports at the final geometry.
A frequency is significant past 5 cm-1.
With this option on, the session reached such a saddle from 21 starts in 907 evaluations.
Sella 2.6.0 in Cartesian coordinates did so from 22 starts in 770 evaluations.
The option adds the starts `07_bicyclobutane` and `22_hconhoh`.
One start got slower: `09_parentdieslalder` took 225 evaluations in place of 146.

## Keep or drop the atom ceiling in a small Cartesian search

Sella defaults to the restricted atomic step in a Cartesian search.
The step bounds the largest move of any one atom by `delta0`, 0.1 Angstrom, whatever the size of the system.
That is `RestrictedAtomicStep` in `sella/optimize/restricted_step.py` of Sella 2.6.0.
`sella/optimize/optimize.py` sets its radius to `delta0` without the free-dimension factor that its Euclidean trust region takes.
`SellaSaddleSession` starts a Euclidean trust radius at `delta * n_free` instead.
Above one distance unit an atom ceiling sits under that radius, as the start of this page says.
At ten free coordinates or fewer, with the default `delta` of 0.1, the radius alone would let one atom take most of it.
The Baker set has a formyl chloride (HCOCl) start, `15_hocl`, with four atoms and six free coordinates.
There the radius starts at 0.6 Angstrom.
Without the ceiling the first two steps move one atom 0.45 Angstrom and 0.44 Angstrom.
The tblite self-consistent field (SCF) then fails to converge.

`small_system_atom_ceiling`, on by default, makes such a search take Sella's restricted atomic step from its first step.
The step is the partitioned rational function optimization (P-RFO) step at unit alpha when no atom moves past the ceiling.
Otherwise it is the step at the alpha whose largest atom move equals the ceiling.
The ceiling starts at `max(delta, 0.1)` and never passes the starting Euclidean radius.
So a host `delta` small enough to keep `delta * n_free` under 0.1 is not loosened.
On the saddle schedule the trust ratio grows and shrinks the ceiling.
Sella does the same with its atomic radius.
`SellaSaddleReport::delta` reports the ceiling.
The option changes nothing with `eig: false` or under another `RestrictedKind`.
It also changes nothing in internal or cell coordinates, or above ten free coordinates at the default `delta`.

The ceiling costs steps where large steps would have been safe.
That happens on a smooth surface whose saddle is tenths of an Angstrom away.
On the exact quadratic of `tests/sella_atom_ceiling.rs`, four atoms start far from its saddle.
There the search takes 15 steps with the ceiling and 9 without it.
The ceiling grows by at most a factor of 1.15 a step.
To keep the Euclidean radius alone, turn the ceiling off in the config or on a live session.
A live session takes the change from its next step.

```rust
let config = SellaSaddleConfig::default().with_small_system_atom_ceiling(false);
let mut session = SellaSaddleSession::new(config, x, masses)?;
// or, on a session that already exists
session.set_small_system_atom_ceiling(false);
```

Through the C ABI, from minor 25, where 1 is the default:

```c
if (rgsaddle_sella_saddle_set_small_system_atom_ceiling(session, 0) != RGSADDLE_OK) {
  /* NULL session, or a value other than 0 and 1 */
}
```

A C host on an older header gets the ceiling too, since the create entry starts from the Rust defaults.
Such a host reaches the setter only through the minor 25 symbol.

Hermes, Sargsyan, Najm and Zador introduced Sella in 2019.
That paper is J. Chem. Theory Comput. 15, 6536 (2019), doi:10.1021/acs.jctc.9b00869.
Their 2022 paper above describes Sella as a package.
The radius convention above is read from the Sella 2.6.0 source.
The Baker runs of this section use the same surface, stop and count as the previous section.
The ceiling changes the nine starts with five atoms or fewer and no other.
With symmetrized Ritz pairs off, the session reached a saddle of index one from 20 starts in 1367 evaluations.
Without the ceiling it reached 19 in 1450.
`15_hocl` converges in 24 evaluations, where the self-consistent field failed after 22.
`01_hcn`, `04_ch3o` and `25_hcnh2` take 13, 13 and 29 evaluations in place of 15, 59 and 41.
`19_hnccs` still stops at index two, after 37 in place of 62.
No converged start takes more evaluations.
With both options on, the session reached such a saddle from 22 starts in 861 evaluations.
Those are the starts Sella 2.6.0 reaches in Cartesian coordinates.
`tests/sella_atom_ceiling.rs` checks that every atom move stays under the ceiling from the first step.
It checks that the ceiling never passes the starting radius and that the search still reaches the saddle.
It also checks that a twelve-coordinate search and a search with `eig: false` step the same with the option on or off.
A last case confirms that the default takes the ceiling.

## Let the session build its own internals

Use `SellaSaddleSession::on_auto_internal` or `SellaMinSession::on_auto_internal` when you have atomic numbers and a geometry but no list of bonds, angles and dihedrals.
`InternalPes::auto` is the same chart without a session.

```rust
let topology = TopologyConfig::default();
let mut session = SellaSaddleSession::on_auto_internal(
    config, x, masses, &elements, None, &topology,
)?;
session.set_update(HessUpdate::TsBfgs);
while !session.step(&surface)?.at_saddle {}
println!("rebuilt {} times", session.topology_restarts());
```

`InternalTopology::from_geometry` does the construction alone and returns the `Constraints`, the real and dummy atom map, the dummy pins and a `TopologyCheck`.
It follows section 2.1 of Hermes, Sargsyan, Najm and Zador, J. Chem. Theory Comput. 18, 6974 (2022), doi:10.1021/acs.jctc.2c00395, and the Sella 2.6.0 source:

- Two atoms are bonded under 1.25 times the sum of their Cordero radii (Dalton Trans. 2008, 2832, digital object identifier (DOI) 10.1039/B801115J).
  Fragments that stay apart are welded by growing that factor 5 % on pairs between fragments.
- Two bonds that share an atom make an angle. Two angles that chain through a shared edge make a proper dihedral.
- A bend within 15 degrees of 0 or 180 is left out. A vertex with three or more bonds takes the improper dihedral `a-b-d-c` with `d` the nearest other bonded atom.
  A vertex with two bonds takes a dummy atom 1 length unit away along the cross product of its arms, pinned by one bond and two right angles, and the improper `a-b-x-c`.
- Singular values of the Wilson matrix under one millionth count as zero.

A cell makes every one of these periodic: `Some(&cell)` finds bonds across the boundary, stores a lattice image on each primitive, and measures them on the positions you pass without wrapping.
A bond network that wraps the cell leaves only translations free, and the check expects that.
`CellInternalPes` keeps the primitives you give it. A periodic chart's lattice follows the living cell, and a Niggli reduction retargets that chart's images onto the reduced basis.

`TopologyCheck` compares the rank of the Wilson matrix with what the rigid quotient leaves, `3N - 6` (`3N - 5` on a line, `3N - 3` on a wrapped network), and measures how far the internals are from invariant under rigid motion.
`TopologyConfig::require_complete`, on by default, refuses a chart that falls short.
A dummy atom adds its pins: at an exactly linear geometry the two right-angle pins are not both first-order handles, so CO2 has a pinned rank of 3 against 4 real degrees of freedom, and the check knows it.

Two things are this crate's own.
A centre with three neighbours and no torsion through it folds the bond and angle chart when it goes planar, as ammonia does.
Its three bends come within `planar_tol` (15 degrees) of a full turn, and the build adds the improper dihedral then.
Sella 2.6 adds an improper at every such centre, so NH3 and CH4 have one and two more dihedrals there than here; the other 13 molecules of `tests/fixtures/sella_topology.txt` match it in bonds, angles, dihedrals and dummies.
The second is that the dummy atoms follow the real atoms along their pins.
The step and the gradient live on the real atoms, and the Jacobian the chart uses is `B_r + B_d D` with `D = -J_d^+ J_r`.

The chart is rebuilt at the accepted geometry, before the next gradient is read, when:

| Reason | Trigger |
|---|---|
| `SingularJacobian` | the Wilson matrix is short of rank, or a value cannot be evaluated |
| `NearLinearBend` | a bend in the chart enters the window, or a replaced bend leaves it |
| `NearPlanar` | a centre with no improper comes within `planar_tol` of planar |
| `BackTransform` | a back-transformation does not converge, or the dummy atoms cannot be put back on their pins, even with the step halved five times |

The Hessian crosses a rebuild as `H_x = J_old^T H_q J_old` on the real atoms, read back as `(J_new^+)^T H_x J_new^+`. The Sella guess curvature goes on `ker(J_new^T)`. Cartesian directions the new chart spans and the old one does not get zero curvature.
It is reseeded from the guess when the old Jacobian cannot be evaluated.
The trust radius restarts at `delta * n_int` and the pair-update history is cleared.
`InternalPes::stale_reason` and `rebuild_if_stale` let a host drive the same rule by hand.
A chart you build with `InternalPes::new` or `VocnFound` is never rebuilt, so those stay the override: `is_auto()` is false and `rebuild_topology` refuses.

A TS search in internals needs `HessUpdate::TsBfgs`; a plain BFGS update cannot learn the negative curvature.
`tests/auto_internals.rs` finds the same first-order saddle with an automatic and a hand-written chart on ethane, hydrogen peroxide, methanol, methanethiol and ammonia (energies within 1e-6, RMSD under 1e-3, one negative finite-difference mode), through the linear window of an OCO bend with a rebuild and a dummy, and across the boundary of a 10 length-unit cell.

# Drive an IRC session (`docs/orgmode/howto/irc.org`)

> Intrinsic reaction coordinate (IRC) integration with SellaSphere, GS2, and Morokuma steps

`IrcSession` traces the intrinsic reaction coordinate (IRC) on either side of a supplied saddle.
The saddle and the mode it leaves along can come from the climbing image aligned with the Hessian eigenmode (Goswami, Gunde, and Jonsson, Front. Chem. 14 (2026), doi:10.3389/fchem.2026.1807063), and two-dimensional root-mean-square deviation (RMSD) projections compare a branch with a band (Goswami, MethodsX 16, 103851 (2026), doi:10.1016/j.mex.2026.103851).
Each call to `step` performs one outer IRC move, of one of three kinds.

- `IrcKind::SellaSphere`, the default, takes the energy minimum on the mass-weighted sphere of radius `dx` about the last point, the first about the saddle. Mueller and Brown constrain the step to that sphere (Theor. Chim. Acta 53, 75 (1979), doi:10.1007/BF00547608). Sella's `IRCTrustRegion` takes the same step (Hermes, Sargsyan, Najm, and Zador, J. Chem. Theory Comput. 18, 6974 (2022), doi:10.1021/acs.jctc.2c00395). Its path error is first order in `dx`.
- `IrcKind::Gs2` is the step of Gonzalez and Schlegel, J. Chem. Phys. 90, 2154 (1989), doi:10.1063/1.456010. Its pivot sits `dx/2` down the mass-weighted gradient from the last point, or `dx/2` along the launch mode from the saddle for the first step. The next point is the energy minimum on the sphere of radius `dx/2` about that pivot. Both points lie on one circular arc tangent to the gradient at each of them. The path error is therefore second order in `dx`. Radial projection maps a model minimum between the last point and the pivot back onto the last point. Until the model is positive definite and the arc exceeds eight radii, a model minimum inside the sphere therefore carries the step on along its line to the far side. The report's `arc` adds the mass-weighted chord of each step.
- `IrcKind::Morokuma` selects the predictor-corrector path.

`tests/irc_mueller_brown.rs` fits both orders on the Mueller-Brown surface.

`new` accepts a molecular Cartesian packing and atom masses. `new_euclidean` accepts an arbitrary nonzero dimension with unit coordinate weights. Those weights are a `MassMetric`. A `MetricPoint` and a `MetricTangent` are multiplied by the square root of the mass, and a `MetricCovector` (a force or a gradient) is divided by it. `from_surface` estimates the launch mode through Hessian actions as the lowest eigenvector of the mass-weighted Hessian. A host can instead pass a measured mode to `new`.

## Runnable example: forward and reverse IRC branches

```rust
use ndarray::{Array1, ArrayView1, array};
use rgsaddle::{IrcConfig, IrcDirection, IrcKind, IrcSession, PointSurface, SaddleError};

struct DoubleWell;

impl PointSurface for DoubleWell {
    fn eval(&self, x: ArrayView1<f64>) -> Result<(f64, Array1<f64>), SaddleError> {
        let t = x[0];
        let e = (t * t - 1.0).powi(2);
        let mut g = Array1::zeros(x.len());
        g[0] = 4.0 * t * (t * t - 1.0);
        Ok((e, g))
    }
}

fn main() -> Result<(), SaddleError> {
    let saddle = Array1::zeros(6);
    let masses = array![1.0, 1.0];
    let mode = array![1.0, 0.0, 0.0, 0.0, 0.0, 0.0];
    let config = IrcConfig::default()
        .with_dx(0.2)
        .with_kind(IrcKind::SellaSphere);
    let mut irc = IrcSession::new(config, saddle, masses, mode, IrcDirection::Forward)?;
    let fwd = irc.step(&DoubleWell)?;
    assert!(fwd.arc > 0.0);
    irc.set_direction(IrcDirection::Reverse);
    let rev = irc.step(&DoubleWell)?;
    assert!(rev.arc > 0.0);
    Ok(())
}
```

`set_direction` restores the saddle and reverses the launch. `reset` clears the approximation at a surface change. A sphere step rejects an energy increase above its specified numerical threshold and reduces the radius.
Each later step without a rejection doubles the radius back up to the requested one.
`set_direction` starts each branch at the requested radius.

Step until the report sets `at_minimum`.
A sphere-step report sets it once the step is past the kick and the largest force is at or below `force_tol`.
One Hessian action at that point must also give positive curvature along the launch mode.
That action is the only extra surface call, and it is made only once the force is at or below `force_tol`.
The sphere radius does not enter, so a branch whose radius was halved still stops on its force.
A point beside the saddle, where the curvature along the mode is still negative, does not stop.
Through the C interface, `rgsaddle_irc_step` writes `RGSADDLE_STATUS_CONVERGED` to the report's `status` on that step.

`tests/irc_termination.rs` checks that stop on both branches from two saddles that eOn hands over.
These are the 13-atom Lennard-Jones cluster (LJ13) and the Morse Pt adatom.
The default run checks the LJ13 reverse branch at `force_tol` 0.005 and eight Pt adatom branches.
The full LJ13 set, both branches at 0.05, 0.01 and 0.005, is ignored in a debug build:

```sh
cargo test --release --test irc_termination -- --include-ignored
```

```text
test pt_adatom_point_beside_the_saddle_is_not_a_minimum ... ok
test lj13_reverse_branch_under_the_force_threshold_reports_a_minimum ... ok
test lj13_branches_under_the_force_threshold_report_a_minimum ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.72s
```

Select `L2Norm` or `LinfNorm` for a generic vector packing. `MaxForceOnAtom` groups Cartesian triples. The C interface exposes construction, stepping, position access, direction changes, reset and destruction; `tests/c/irc_abi.c` exercises both directions of both sphere kinds and the Morokuma path. `RGSADDLE_IRC_SELLA_SPHERE` needs ABI minor 35. A config whose version minor is 34 or older runs the Sella sphere for every kind but `RGSADDLE_IRC_MOROKUMA`, and from minor 35 an unknown kind makes create return NULL. Minor 34 is the curvature probe and leaves IRC kinds unchanged.

# Geodesic initial paths (`docs/orgmode/howto/geodesic.org`)

> Shorten an initial path in a redundant coordinate chart before any potential call

`geodesic_path` shortens an initial path in a redundant coordinate chart before any potential evaluation.
Zhu, Thompson, and Martinez, J. Chem. Phys. 150, 164103 (2019), doi:10.1063/1.5090303, define the length of one Cartesian segment by the two point midpoint formula (their Eq. 17): the redundant coordinate distance from each end to the image of the Cartesian midpoint.
On a flat chart that length is the polyline length, and the geodesic is the straight line (Appendix A).
The lower bound is the sum of the coordinate chords between segment ends (Eq. B5).
The upper bound subdivides each Cartesian segment into `bound_samples` equal pieces (Eq. B18). The paper uses ten.
`bound_samples` is even and at least 2, so one sample is the Cartesian midpoint and the chord sum is at least the midpoint length. An odd count is rejected.

The chart implements `GeodesicChart`. `eval` writes `q(x)` and the Wilson B matrix `dq/dx`, one row per redundant coordinate.
`MorsePairChart` is Eq. (7): \(q = \exp(-\alpha (r - r_e) / r_e) + \beta r_e / r\), with `alpha` 1.7, `beta` 0.01, and `r_e` the sum of covalent radii.
`MORSE_ALPHA` and `MORSE_BETA` hold those two values, and `with_radii` replaces the radii of an existing chart.
It returns an error when the list is empty or a radius is non-finite or not positive. The field itself is not public.
A finite alpha, beta, or radius that makes a coordinate or a Wilson entry overflow is `SaddleError::NonFinite`, and the output buffers are left unchanged for that pair.
Pairs are lexicographic. A periodic `cell` (a `minimage::Cell`) takes every pair displacement through `Cell::displacement`. A pair distance at or below the distance floor is rejected rather than shifted.

`GeodesicConfig` and `MorsePairChart` are non-exhaustive.
Start from `GeodesicConfig::default` or `MorsePairChart::new` and chain the `with_*` setters.
The default stop is a pass displacement of 1e-6, a length gradient norm of 1e-6, and an L-BFGS step of 0.5 in the path's unit.
The default bounds are 0.95 and 1.1, the paper's insertion thresholds.
`with_lower_ratio` and `with_upper_ratio` change them, and `with_max_sweeps` caps the passes.

`geodesic_path` keeps the first and last images fixed.
Each interior image is one L-BFGS minimization of the total length, using the analytic gradient of their Algorithm 1.
Images are swept forward and then back until the largest displacement of a pass is at or below `step_tol`.
A round of sweeps that uses all of `max_sweeps` with an image still moving by more than `step_tol` ends the run with `GeodesicReport::converged` false, and the path is the last iterate.
If the bounds are still loose, Cartesian midpoints are inserted on the loose segments, up to `max_images`, and the sweeps start again.
A trial the chart refuses is discarded. That image keeps its last accepted point.
The pass counts as converged only when an accepted step meets the stop. A refused trial that leaves the image where it was does not.
A chart that returns a `cell` from `GeodesicChart::cell` marks the rows as one 3-vector per atom in a periodic box.
The Cartesian midpoint of Eq. (17), the subdivision samples of Eq. (B18), and the images inserted between two images all move along `Cell::displacement` of their two ends, so a segment that crosses the box takes the short way.
The cell should be tilt-reduced, the engine convention of minimage.

`geodesic_interpolate` builds the first path from the reactant and the product by their Algorithm 3.
With three or more images the target is the average of the redundant coordinates, \(q_{\mathrm{mid}} = (q(A) + q(B)) / 2\), and not the coordinates of the Cartesian average.
Ten starts alternate between the reactant (odd starts) and the product (even starts), each with Gaussian noise of scale 0.1 in the path's unit from a generator seeded by `GeodesicConfig::seed` (`with_seed`).
Each start minimizes \(|q(x) - q_{\mathrm{mid}}|^2\), and the shortest three point path \([A, x, B]\) wins.
The geodesic procedure then adjusts that middle image on the three point path with no insertion, and the result is copied onto the thirds of the images.
The same seed repeats the path.
`geodesic_path` then minimizes the length.
`geodesic_lengths` reports the length and both bounds without moving the path, as `GeodesicLengths`.
`geodesic_path` and `geodesic_interpolate` return the path with a `GeodesicReport`: the length, both bounds, the image count, and the passes run.

On the Morse pair chart a dissociation whose distance only increases has length `|q(end) - q(start)|`, the equality case of Eq. (B5).
`tests/geodesic_path.rs` checks that length for `r_e = 2` from `r = 2` to `r = 6`, and the straight segment of length 5 on a flat chart (Appendix A).

From C, ABI minor 64, `rgsaddle_geodesic_config_default` fills `rgsaddle_geodesic_config_t`, `rgsaddle_geodesic_path` takes a host chart and an optional row-major cell, and `rgsaddle_geodesic_morse` uses Eq. (7).
A host chart given a cell applies the same minimum image to its own distances.
A run that exhausts `max_sweeps` without settling returns `RGSADDLE_NOT_CONVERGED` with `out`, `length`, `lower`, and `upper` holding the last iterate.
A NULL config selects the defaults, including an image cap of 32, so it requires `n_images` of at least 32. `length`, `lower`, and `upper` may be NULL.
A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 64 before resolving these symbols.

# Find an optimal tunneling path with LI-NEB (`docs/orgmode/howto/lineb.org`)

> Fixed-energy tunneling paths, imaginary-time replicas, fluctuation spectra, and thermal rates

## What is computed
At a fixed energy `E` below a barrier, the optimal tunneling path minimizes the JWKB action between two points on the surface `V = E`. Ásgeirsson, Arnaldsson and Jónsson, J. Chem. Phys. 148, 102334 (2018), doi:10.1063/1.5007180, find it with a line integral extension of the nudged elastic band (LI-NEB). In mass-weighted coordinates `q = M^{1/2} x` the discretized action of `n` images is

    W = sum_j (sigma_j + sigma_{j+1}) |q_{j+1} - q_j| / 2,   sigma = sqrt(2 (V - E))

Interior images move along the perpendicular gradient of `W`, springs keep them evenly spaced, and each end moves along the force until it sits on `V = E`. The half period of the periodic orbit on the inverted potential then sets the temperature `hbar / (2 k_B half_period)` at which the path is an instanton, and the ring polymer built on it gives the harmonic quantum TST rate.

The module takes any `PointSurface`. Energies, lengths and masses are in the surface's own units, and `LinebConfig::hbar` and `LinebConfig::boltzmann` are given in the same units. Both default to one.

`LinebConfig::gradient_end_tangents` is false by default. `with_gradient_end_tangents(true)` evaluates the two endpoint gradients, converts them to unit mass-weighted directions oriented along increasing path parameter, and supplies them as the endpoint tangents of the measured path spline.

## One energy
```rust
let config = LinebConfig::new(opt_tol, perp_tol);
let masses = Masses::coordinates(mass.view())?;
let mut session = LinebSession::new(config, masses, images, energy)?;
let report = session.run(&surface, 1000)?;
assert_eq!(report.status, LinebStatus::Converged);
let path = session.path(&surface)?;
```

`images` is one row per image in Cartesian coordinates, endpoints included. For a full path between two minima, use `LinebSession::from_seed(&surface, config, masses, images, energy)`. When both ends lie below the requested energy, it interpolates the two turning points around the highest seed image. The C and Python solvers support the same input. The two tolerances have no default. `opt_tol` stops the nudged force on every image and `perp_tol` the perpendicular action gradient on the interior ones. Both are norms in mass-weighted coordinates, so they carry units of the square root of an energy. A tolerance stated on the dimensionless action `W / hbar` per Cartesian length converts by `tol = g hbar / sqrt(m)`; the paper's 1e-2 per Angstrom for H, in eV, Angstrom and amu, is 6.44e-4.

For the paper’s convergence test, set `with_endpoint_convergence(true)`. The optimizer compares `opt_tol` with the larger endpoint force and `perp_tol` with the largest perpendicular action gradient among the interior images. The spring still redistributes interior images. The report gives the full-band, endpoint, and perpendicular maxima separately.

To interpret an interior image's perpendicular action gradient in force
units, use its two adjacent mass-weighted chord lengths, `d_prev` and
`d_next`. Write `sigma` for the momentum used in the discrete action and
`c = (d_prev + d_next) * (d sigma / dV) / 2`. This is the coefficient
of the mass-weighted physical force in the image's action gradient.
For a perpendicular drive component `g_perp[k]`, the equivalent Cartesian
force imbalance is `sqrt(m[k]) * g_perp[k] / c`. Thus the same `perp_tol`
can admit different force imbalances across images or atoms. This
conversion applies to interior images. Check the physical residual on
the equal-time orbit separately, including at both turns.

The default endpoint restraint has magnitude `endpoint_scale |V − E| / |∇V|` in mass-weighted coordinates. To use a constant coefficient as in Eqs. (19) and (21), set `with_endpoint_kappa(kappa)` in Rust, pass `endpoint_kappa` to Python, or call `rgsaddle_lineb_solve_with_kappa` from C. Its force magnitude is `kappa |V − E|`. Express the coefficient and the spring constant in the units of the action and coordinates used by the solver.

`Masses::coordinates` takes one mass per coordinate and leaves rigid motions alone. Use it for atoms in an external field, such as adsorbates over a fixed slab. `Masses::molecule` takes one mass per atom for a free molecule. It centers each image and fits it to the first image by a mass-weighted quaternion rotation. `Masses::with_adjacent_alignment(true)` fits each image to the preceding aligned image instead. Each chord then has the minimum length over relative rigid motions, so reversing the band preserves its discrete action. `Masses` stores a `MassMetric`. Both constructors refuse a mass that is not finite and positive. The metric multiplies a `MetricPoint` and a `MetricTangent` by the square root of the mass and divides a `MetricCovector` by it.

`time_step` is the initial FIRE step. From rest a step moves an image by about `time_step^2 |F|`. The default 0.1 converges the Müller-Brown continuation at every other default; a surface with a stiffer action needs a smaller step. `max_move` caps the step of one atom with molecular masses and the whole band step otherwise. An interior image may not fall below `E + w`, where `w` is `turning_width` times the height of the highest starting image above `E`; a step that would put one there is retried at a shorter length. Any other error from the surface ends the step and is returned.

The optimizer uses a smooth momentum near a turning point. For an image with energy gap `d = V - E`, its momentum in mass-weighted coordinates is `sqrt(d + hypot(d, w))`. At the turning surface this gives `sqrt(w)`. Equation (12) of Ásgeirsson, Arnaldsson and Jónsson gives zero there. The default `turning_width` is 0.001 and the accepted range is strictly between zero and one. For a width sensitivity check, rerun the same starting band and energy with a smaller positive `turning_width` and compare the optimized coordinates, period and rate. The endpoint convergence option selects which force norms stop optimization. The momentum still uses the configured width.

`LinebPath` holds the action, the half period from the quadrature of the action's energy derivative (`half_period`) and from constrained dynamics along the path (`half_period_dynamics`), both temperatures, and `calls`: the force calls of the optimizer, of the period quadrature and time table, and of the dynamics, counted apart.

Set `with_interpolated_force_clock(true)` in Rust or
`interpolated_force_clock=True` in Python to use the signed force in
Eq. (27) of Ásgeirsson, Arnaldsson and Jónsson (2018). At each prepared
image the solver projects the inverted potential gradient onto the
normalized derivative of the mass-weighted cubic coordinate spline at
that image. The band optimizer uses the higher-energy neighboring chord
on monotonic energy segments, following Eqs. (15) and (16). These two
tangent estimates can differ for a curved path at finite image spacing.
The clock interpolates the projected forces with a cubic
spline in arc length and integrates the resulting one-dimensional
motion by velocity Verlet. The period, temperature, equally spaced
replicas and rate all use this orbit. Both reported periods agree by
construction when the independent dynamics fields are requested.

The spline force can integrate to nonzero work between the two
optimized turning images. The solver launches at rest from the end
whose trajectory turns inside the measured interval, locates the first
velocity reversal, and orders the replicas in increasing path coordinate
on the outgoing half. The opposite turning replica can therefore be
displaced from its nominal endpoint. The `LinebTurning` value in `turning` records the launch image, the return arc coordinate,
the full spline length, the largest Cartesian component of the
displacement from the opposite image, and two energy differences
measured on the supplied surface. The first is relative to the target
energy and the second is relative to the opposite prepared image. A
short orbit can turn away from its nominal endpoint. Report
`max_cartesian_displacement` in the input length units. To measure the
fraction of the mass-weighted path missed at the return, set
`L = path_arc_length` and `s = return_arc`. The fraction is `(L - s) / L`
for a launch at image zero and `s / L` for a launch at the last image.
Compare the energy residual with the barrier height above the target.
At fixed `E`, repeat the path optimization with more images and compare
the return geometry, energy residual and half period. Increasing
the number of replicas on a fixed path leaves the Verlet return turn
and its energy unchanged.

For path length `L`, maximum absolute image force `F` and
`Q` quadrature pairs per chord, the integration step is
`sqrt(L/F)/(64 Q)`. The cubic coordinate spline is parameterized by
mass-weighted chord length. Its arc-length map uses `8 Q` Simpson
panels per chord. The dynamics counter includes one energy-gradient
request for each image plus one at the return point for the energy
check. Verlet integration adds no potential requests.
The measure counter includes the Simpson samples for the action.

In Rust, `LinebConfig::with_gradient_end_tangents(true)` aligns the
coordinate spline tangents with the surface gradients at both turning
images, using two extra surface evaluations. Compare the force residual
at the turn and at its neighbouring replicas to check how well the
band resolves the turning region. The default uses not-a-knot tangents.

## An energy ladder from a minimum energy path
```rust
let ladder = Continuation::new(delta, images, levels);
let paths = continue_from_mep(&surface, mep.view(), &masses, &config, &ladder)?;
```

The first energy is the highest MEP energy minus `delta`, seeded by the MEP segment between its two crossings of that energy. With `with_linear_seed(true)`, the first path follows the straight line joining the two crossings, as in the Cu(110) example in section II. Each lower energy is `delta` further down and starts from the previous path with both ends walked downhill to the new energy. The MEP has to fall below the lowest energy on both sides of the barrier. A level still running after `max_steps` (1000 by default) is an error. `path.calls.total_with_seed()` includes the seed for that energy. To measure backend work, use `continue_from_mep_with_observer` with the same arguments and a final closure `|level, path|` returning `Result<(), SaddleError>`. The closure runs after the path converges and before the next energy is seeded. Take a snapshot before the ladder and at each callback to include the work of preparing each seed in its level.

A saved turning-to-turning band can supply another energy ladder. Pass its
Cartesian images and tunneling energy to `continue_from_path_with_observer`.
A first target equal to the saved energy refines the image resolution.
A lower target walks both endpoints along the mass-weighted force before
resampling the band. The new ladder counts these seed evaluations.

## The rate
```rust
let rate = hqtst_rate(&surface, &path, beads)?;
```

`beads` replicas are placed at equal imaginary times along the path. The ring-polymer Hessian is applied block by block from Hessian-vector products at the `beads / 2 + 1` distinct replicas, and its log-determinant comes from Lanczos with the zero mode and any rigid modes deflated. Without an analytic `hessian_vector` each product is a central difference, so the rate costs `(beads / 2 + 1) (1 + 2 dof)` force calls. `log_rate_over_reactant` is `ln(k Z_r)` on the surface's own energy zero. On a total energy far from zero `rate_over_reactant` overflows or underflows while the log stays finite.

For the interpolated rate, the solver eliminates successive bead blocks from the ring Hessian. It retains the closing bead, the permutation direction and any whole-ring rigid directions in a border. The gauge Gram determinant removes the dependence on gauge-vector normalization. Summing the signed pivot inertias gives the number of unstable modes in the projected space. For a fixed molecular size the cost grows linearly with the bead count. An ill-conditioned bead pivot selects a dense Householder projection and symmetric eigensolve.

Select `interpolated_hessian=True` in Python or
`RGSADDLE_LINEB_INTERPOLATED_HESSIAN` in the C solve to interpolate image
Hessians onto the ring. In Rust, `hqtst_rate_interpolated_hessian_observed`
takes an optional Cartesian displacement and a flag to retain the measured
orbit. The `lineb-interpolated-hessian` feature provides this rate. Building
the C interface with `--features capi` includes it, as does the
`lineb-oracle` compatibility feature.

For `N` path images with `D` Cartesian degrees of freedom and `P` replicas,
image interpolation requests `2 N D` displaced gradients for curvature and
`P` replica energies and gradients. The returned `curvature_evaluations`
and `bead_evaluations` sum to the rate count. The optional observed orbit
uses those same measured replica positions and gradients. In Python,
`image_hessian_step` selects the displacement in the surface's length
units, and the result reports the applied value. C callers can discover
`rgsaddle_lineb_solve_counted_rate` at link time and read the same fields
from `rgsaddle_lineb_rate_diagnostics_t`.

To check the image-Hessian approximation, evaluate `hqtst_rate` and
`hqtst_rate_interpolated_hessian` on the same `LinebPath` with the same
surface and bead count. Subtract the direct result's `log_rate_over_reactant`
from the interpolated result's value. Exponentiating this difference gives
the ratio of the two fluxes because their common energy zero cancels. Check the
mode counts for both results. Increasing the bead count samples the
interpolant more densely. Increasing the number of path images supplies
additional curvature measurements and also lets the optimized path change.

For an electronic-structure potential, `hqtst_rate_interpolated_hessian_with_step(surface, path, beads, step)` uses the same Cartesian displacement for every atom. Halving the displacement tests the sensitivity of the fluctuation spectrum to gradient noise. The result records `image_hessian_displacement` in the surface's length units and `negative_modes` on the gauge-deflated ring. A first-order instanton has one unstable mode.

With the `lineb-oracle` feature, `cartesian_image_hessian(surface, cartesian, step)` measures one Cartesian energy Hessian. It evaluates the positive and negative displacement along each coordinate in one ordered batch. The matrix contains the raw gradient differences before symmetrization or mass weighting.

`hqtst_rate_from_image_hessians(surface, path, beads, blocks)` takes one Cartesian energy Hessian per path image in path order. Evaluate each block at the corresponding row of `path.cartesian`, using the same Cartesian axes and atom order. For a free molecule these rows contain the aligned geometries. If an external calculator rotates a molecule to its own axes, rotate the Hessian back to the axes of that row before supplying it. The library mass weights the blocks and interpolates them onto the ring. It issues `beads` additional geometry requests for the replica energies. Measure the cost of the supplied blocks at their provider. For finite differences the cost is `2 * dof * images + beads` geometry requests. A surface implementing `PointSurface::eval_batch` can evaluate the independent displacements for each image and the replica energies in parallel. Return the results in input row order.

## Python
`LinebResult.surface_calls` gives integer configuration evaluations for `seed`, `optimization`, `path_preparation`, `quadrature`, `dynamics` and `rate`. Their sum is `total`. The rate entry is zero on a path-only run. In C, pass a `rgsaddle_lineb_counts_t` to `rgsaddle_lineb_solve_counted` (ABI minor 47). The combined `optimizer_calls` and `measure_calls` on the original result remain available.

`rgsaddle.lineb_solve(surface, positions, atom_masses, energy, opt_tol, perp_tol, molecular=False, max_steps=1000, beads=0, ...)` is the run-to-completion binding (`howto/python`). `positions` is `(n_images, 3N)`, `atom_masses` is one mass per atom, and `surface(x)` is the one-image `(energy, gradient)` callback used by `connect`. `molecular=False` expands each atom mass to three coordinates; `molecular=True` aligns the free molecule. `beads=0` returns the path only with `log_rate_over_reactant` set to NaN. `LinebResult` exposes the optimized `positions`, the quadrature temperature `temperature` and the constrained-dynamics estimate `temperature_dynamics`, their half periods, the log rate, and the per-phase call counts. A calculator exception propagates; an unconverged search raises with the C status.

Pass `batch_surface=True` when `surface` can evaluate a matrix of Cartesian
geometries. A callback receives an array of shape `(rows, 3N)` and returns
energies of shape `(rows,)` and gradients of shape `(rows, 3N)`, in input
order. Independent band, quadrature and curvature evaluations can use
multiple rows. Adaptive queries can still use a single row. The reported
call counts count geometries. The corresponding option in C is
`RGSADDLE_LINEB_BATCH_SURFACE` (ABI minor 48).

For a rate calculation, `LinebResult.modes` gives the number of retained
fluctuation eigenvalues and `LinebResult.negative_modes` counts those below
zero. A first-order instanton has one retained negative eigenvalue. Both
properties are `None` for a path-only solve. C consumers can check for
`RGSADDLE_HAS_LINEB_RATE_DIAGNOSTICS` and pass the two optional `int64_t`
outputs to `rgsaddle_lineb_solve_counted_diagnostics`. Each receives `-1`
when the rate is unavailable.

For the Cu example in the 2018 paper, pass `linear_seed=True` and `endpoint_convergence=True` to `lineb_solve` with a full MEP and the converted `spring` and `endpoint_kappa`. The first flag selects a straight path between the two energy crossings. The second applies the endpoint and perpendicular force tolerances separately. Pass `projected_verlet=True` (Rust `with_projected_verlet(true)`, C `RGSADDLE_LINEB_PROJECTED_VERLET`) to select the projected Verlet band integrator.

The following dimensionless Eckart barrier has turning points at
`x = ±arccosh(2)` when `E = 0.25`. The two transverse coordinates are
independent unit-mass harmonic oscillators. The callback returns an energy for each input row and the
Cartesian energy gradient with the same shape as the coordinates.

```python
import numpy as np
from rgsaddle import lineb_solve

def barrier(x, omega=1.0):
    energy = 1.0 / np.cosh(x[:, 0])**2
    gradient = omega**2 * x.copy()
    gradient[:, 0] = -2.0 * energy * np.tanh(x[:, 0])
    return energy + 0.5 * omega**2 * (x[:, 1:]**2).sum(axis=1), gradient

seed = np.zeros((9, 3))
seed[:, 0] = np.linspace(-2.0, 2.0, len(seed))
path = lineb_solve(
    barrier, seed, np.ones(1), energy=0.25, opt_tol=1e-5, perp_tol=1e-5,
    endpoint_kappa=0.2, linear_seed=True, endpoint_convergence=True,
)
np.testing.assert_allclose(
    np.asarray(path.positions)[[0, -1], 0], np.array([-1, 1]) * np.arccosh(2)
)
print(path.action, path.temperature)
```

The exact action is `pi / sqrt(2)` and the exact temperature is
`1 / (2 pi sqrt(2))` in these units. The nine-image example gives
2.221443 and 0.1125395 respectively.

The same seed provides a check of the fluctuation factor. Doubling both
transverse frequencies leaves the longitudinal path and period unchanged.
Each oscillator contributes its finite-bead partition function to the
flux. This makes the change in `log_rate_over_reactant` calculable
without a reactant reference.

```python
from functools import partial

P = 32
def flux(omega):
    return lineb_solve(
        partial(barrier, omega=omega), seed, np.ones(1), 0.25, 1e-5, 1e-5,
        endpoint_kappa=0.2, linear_seed=True, endpoint_convergence=True,
        beads=P, return_orbit=True, interpolated_hessian=True,
        image_hessian_step=0.001,
    )

low, high = flux(1.0), flux(2.0)
def log_partition(omega):
    a = P * np.arcsinh(low.half_period * omega / P)
    return -np.log(2 * np.sinh(a))

shift = high.log_rate_over_reactant - low.log_rate_over_reactant
np.testing.assert_allclose(shift, 2 * (log_partition(2) - log_partition(1)))
print(low.negative_modes, low.modes, low.surface_calls["rate"], round(shift, 5))
```

This prints `1 95 86 -8.69356`. The 86 rate requests comprise two
displacements for each of three coordinates at nine images, plus
32 orbit observations. A cache can serve repeated geometries among
these requests.

## C ABI
```c
rgsaddle_lineb_config_t cfg;
rgsaddle_lineb_config_default(opt_tol, perp_tol, &cfg);
rgsaddle_lineb_result_t out;
rgsaddle_status_t st = rgsaddle_lineb_solve(
    &cfg, n_images, n_atoms, positions, atom_masses, molecular,
    energy, max_steps, beads, surface, user, optimized, &out);
```

`rgsaddle_lineb_config_default` writes the same defaults as `LinebConfig::new`. Positions are contiguous image, atom, xyz. `molecular` 0 expands each of the `n_atoms` masses onto the three Cartesian coordinates without rigid alignment (`Masses::coordinates`); `molecular` 1 uses quaternion alignment to the first image (`Masses::molecule`) and `molecular` 2 aligns each image to its neighbour (`Masses::with_adjacent_alignment`). `beads` 0 returns the path only and leaves `log_rate_over_reactant` as NaN; otherwise `beads` must be at least 2. An unconverged search returns `RGSADDLE_STALLED` after writing the last images. Read `rgsaddle_last_error()` on the calling thread for the force residuals and their tolerances when the iteration budget is exhausted. See `howto/c-abi` and `tests/c/lineb_abi.c`.

## Comparing surfaces and rates
For a surface with fixed substrate atoms, pass the coordinates and masses of the mobile atoms to the solver and reconstruct the full geometry in the surface callback. Use identical substrate coordinates, mass conventions and energy zeros when comparing barriers or rates. Record the image and bead counts, both force tolerances, and the temperature estimator with each result.

## Checking the orbit and reporting a rate
Repeat the calculation at fixed tunneling energy with more path images and
more ring replicas independently. The images determine the spatial path,
whereas the replicas sample that path in imaginary time. Record the
quadrature temperature at each image resolution. Compare different
replica counts at the same path and period to isolate the ring
discretization.

The inverse time map uses monotone cubic Hermite interpolation. The
spline speed comes from the tunneling energy at each quadrature knot
and vanishes at both turning points. The reflected orbit therefore
has a continuous velocity at each turn. For comparisons,
`with_linear_replica_clock(true)` selects piecewise-linear interpolation
on the same time knots. Vary `with_quadrature_pairs` independently of
the bead count to check the resolution of the time integral.

For a ring of `P` Cartesian configurations over a full period `tau`, let
`dt = tau / P`. With energies, masses, lengths and times in a consistent
unit system, the discrete stationarity residual at atom `i` and bead `j`
is

    R[j,i] = grad_V(x[j])[i] + m[i] * (2*x[j,i] - x[j-1,i] - x[j+1,i]) / dt**2

Request `return_orbit=True` when calling `lineb_solve` with a positive
`beads` value. The optional `LinebOrbit` returned as `result.orbit` contains `positions` and
`gradients`, both shaped `(beads, 3 * n_atoms)`. Each returning bead has
the exact coordinates of its outbound partner. With bead Hessians the
solver reuses the outbound measurement. With interpolated image Hessians
it requests the full ring in one batch, so an exact-coordinate cache
can serve the repeated geometries.
`orbit.max_abs_residual` and `orbit.rms_residual` are in energy per
length. `orbit.max_bead` and `orbit.max_coordinate` are zero-based.
A path-only solve returns `None`. The rate evaluation count is the
same with or without the observations.

The C entry point `rgsaddle_lineb_solve_counted_orbit` accepts a nullable
`rgsaddle_lineb_orbit_t`; each supplied coordinate or gradient buffer
must hold `beads * 3 * n_atoms` doubles. A caller requesting only the
summary may leave both buffer pointers null. In Rust, use
`hqtst_rate_with_orbit` to obtain the rate and its `LinebRateOrbit`.

Wrap both neighbor indices around the ring. Use the physical Cartesian
energy gradient at each stored bead and restrict the check to mobile
coordinates. Report the maximum absolute component and the RMS residual
in force units. Inspect the turning-point beads individually. A stable
logarithmic prefactor and one unstable mode can coexist with a large
turning-point residual.

The rate uses adjacent beads to normalize translation around the
periodic orbit. For mass-weighted coordinates `q`, the squared length
in the prefactor is the sum of `|q[j] - q[j-1]|^2` over the full ring.
The same differences define the direction removed from the fluctuation
determinant. When comparing with Eq. (8) of Ásgeirsson et al., record
the indexing convention. The printed expression uses the displacement
from bead `j-1` to bead `j+1`. This spans two time intervals, so a
centered estimate of displacement per interval includes a factor of
one half before squaring.

For an absolute thermal rate, subtract the logarithm of the reactant
partition function from `log_rate_over_reactant` using the same energy
zero, period and unit convention. Account for molecular rotation,
translation and the number of equivalent reaction paths consistently on
both sides of the comparison. Convert the inverse time unit to inverse
seconds before comparing with a published rate.

# Choose a path initializer (`docs/orgmode/howto/path-initialization.org`)

> Choosing linear, IDPP, or TRICS path initializers across NEB, AutoNEB, and C

Use `PathInitializer` when a driver needs the same choice as NEB or Gaussian
process NEB.  It accepts two endpoint geometries and returns an image-major
Cartesian path.

## Choose the method
| Initializer | Choose it when | Important limit |
| --- | --- | --- |
| `Linear` | The endpoint mapping is already good and no atom collision or large group rotation lies between the endpoints. | It does not preserve molecular geometry. |
| `Idpp` | Pair-distance interpolation is enough to remove collisions. | Each image is relaxed independently. |
| `Trics` | Bonds, bends, torsions, or fragment rotations should change in molecular internal coordinates, especially when one coordinate chart becomes singular. | Coordinates must be unwrapped and nonperiodic. |

TRICS refines a seed path.  `TricsSeed::Linear` is the default.
`TricsSeed::Idpp` first creates an IDPP path and then applies the TRICS
diagnostic, segmented interpolation, and splicing.

```rust
use rgsaddle::{
    IdppConfig, PathInitializer, TricsSeed, TricsStartConfig,
    initialize_path,
};

let start = TricsStartConfig::default()
    .with_seed(TricsSeed::Idpp(IdppConfig::default()));
let path = initialize_path(
    reactant.view(),
    product.view(),
    9,
    None,
    &PathInitializer::Trics(start),
)?;
```

Pass `path` to `BandSession::new` or to a Gaussian process NEB host.  The
initializer has no potential energy callback and does not evaluate a surface.
The direct `trics_path` function accepts an existing path from any source.

## AutoNEB
Select TRICS for every inserted AutoNEB image with
`AutoNebTuning::default().with_trics(TricsStartConfig::default())`, leaving
`interpolant` at its default.  AutoNEB samples a
seven-image TRICS segment and takes its midpoint.  If iterative inversion of
that local segment fails or produces a degenerate midpoint, insertion returns a
solver error.  Periodic AutoNEB rejects TRICS because rotations and the
diagnostic require unwrapped free-space coordinates.

## C
ABI minor 66 adds `rgsaddle_trics_path`.  The caller supplies an initial path
from linear interpolation, `rgsaddle_idpp_path`, or another source.  Input and
output each hold `n_images * 3 * n_atoms` doubles in image-major order.

```c
rgsaddle_status_t status = rgsaddle_trics_path(
    n_images, n_atoms, initial,
    50, 1.0e-8, 0.1,
    1, 0.0018, 1000,
    1.0, output);
```

The tolerances and the move cap are in angstrom.  Pass the length of one
angstrom in the caller's coordinates as the argument before `output`, here
1.0 for a path in angstrom and 0.1 for nanometres.  In Rust the same value is
`TricsConfig::length_per_angstrom`.

The C function uses geometry-only bond inference.  Rust callers that know the
topology can set `TricConfig::bonds` explicitly.  Python does not expose an
IDPP path initializer, so there is no separate Python TRICS wrapper.

# Read a molecular frame (`docs/orgmode/howto/io.org`)

> Reading and writing CON frames and restart bands

Enable the `readcon` feature and call `frame_from_con` to obtain Cartesian positions, masses and an optional periodic cell. Parsing is provided by readcon-core.

An explicit `lattice_vectors` matrix in the frame metadata takes precedence. Otherwise the cell is reconstructed from all three lengths and all three angles. A zero length triplet denotes a nonperiodic frame. Partial or invalid periodic cells return an error.

The `chemfiles` feature enables the readcon-core format adapters. `readcon-db` supplies the corpus dependency for hosts that store traces and restarts. Surface implementations own their neighbour-list choice.

The triclinic metric and exact-lattice precedence are exercised by `tests/io_cells.rs`.

## Build the optional native reader

The `chemfiles` feature builds a native dependency with CMake. For CMake 4, set [the minimum policy version](https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html) to 3.5 for that dependency:

```sh
CMAKE_POLICY_VERSION_MINIMUM=3.5 cargo build --locked --features chemfiles
```

# Use the C and C++ interfaces (`docs/orgmode/howto/c-abi.org`)

> Stepping bands, minimum-mode sessions, Sella, IRC, and strings from C and C++

`include/rgsaddle.h` declares the C application binary interface (ABI), major 1, minor 74. It preserves the main band, minimum-mode and index-1 layouts and adds intrinsic reaction coordinate (IRC), Sella, constraint and geometry controls. Include this header rather than duplicating its structures. Check `rgsaddle_abi_stamp` before constructing a session. A meson project takes the headers from the top-level `meson.build`; see [the meson how-to](meson.html).

A surface callback returns `rgsaddle_status_t` and receives one `rgsaddle_surface_request_t`. Positions and gradients are image-major Cartesian triples. The host supplies the energy and gradient arrays for every requested image; the library performs no Message Passing Interface (MPI) communication.
From ABI minor 42, `RGSADDLE_NOT_EQUILIBRATED` and `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES` report constrained-ensemble tails that fail the drift or effective-sample guards.

`rgsaddle_halve_raised_energy` and `rgsaddle_trust_update` (ABI minor 36) are the two decisions a host can take from energies it already holds. The first compares a trial energy with the energy before the step and returns the step length, halved when the trial is more than 1e-4 higher. The second updates a trust radius from a predicted energy change and the change that occurred, using the Sella schedule; a prediction below 1e-14 in absolute value leaves the radius as it was. Neither call evaluates a surface.

`rgsaddle_band_project` (ABI minor 35) projects a band the host has already evaluated. It does not take an optimizer step and it does not wait for the climbing image to arm. When the config asks for a climb, the endpoint-slope rule selects the image on that call. `forces` uses the force convention, and the endpoint rows are zero. The function index lists every declared name; this page is the session loop.

Create an opaque session, call its `step` entry, inspect `rgsaddle_report_t`, and free it. Check each function status before reading outputs. The host owns search limits and the surface lifetime. A reset marks a surface change. The report's `evaluations` field counts the surface rows consumed by the step.

Band and minimum-mode force norms are selected by `rgsaddle_band_set_force_gate` and `rgsaddle_minmode_set_force_gate`. Their configuration layouts have no member for that norm. The optional feasible-step controls are `rgsaddle_band_set_highs` and `rgsaddle_minmode_set_highs`, with 0 or 1 as the flag.

`rgsaddle_ocineb_create` (ABI minor 20) builds the climbing-image band that hands the climbing image to a minimum-mode search. `rgsaddle_ocineb_step` is one band move, one alignment of the band tangent with the lowest mode, or one minimum-mode translation, and `rgsaddle_ocineb_report_t` names that phase. `n_images` is at least 3. The alignment tolerance must be at least 1/sqrt(2). A solid-state band is refused. `rgsaddle_ocineb_positions` copies the band, `rgsaddle_ocineb_reset` drops the hand-off state, and `rgsaddle_ocineb_free` releases the session. From minor 21 the hand-off is the band's own refinement with these controls: the trigger is on the climbing image's largest per-atom force, `rgsaddle_minmode_config_t` supplies only the mode estimate, including the same version-gated `rotation_angle_tol` interpretation as `rgsaddle_minmode_create`, and a `RGSADDLE_OCINEB_MINMODE` step is one P-RFO climb step. `RGSADDLE_BAND_NO_MIN_MODE` is not read here. The climbing image's requests reach the point surface as one geometry with `image = -1` and without `RGSADDLE_REQ_CLIMBING_IMAGE`.

`rgsaddle_idpp_path` (ABI minor 19) writes an initial path. `n_images` counts the endpoints and must be at least 3. `reactant` and `product` each hold `3 * n_atoms` doubles. `out` holds `n_images * 3 * n_atoms` doubles, image-major. `cell` is a row-major 3x3 lattice, or NULL in free space. A singular cell returns `RGSADDLE_INVALID_PARAMETER`. Interior images are relaxed toward interpolated minimum-image pair distances. `max_iterations`, `grad_tol`, and `max_move` are the per-image L-BFGS stop. The call does not evaluate a surface.

`rgsaddle_trics_path` (ABI minor 66) refines an initial free-space path.
`initial` and `out` each hold `n_images * 3 * n_atoms` doubles.
The inversion, diagnostic, and splice arguments correspond to
`TricsConfig`, and every length among them is in angstrom.
`length_per_angstrom` is the length of one angstrom in the caller's
coordinates, 1.0 for angstrom and 0.1 for nanometres; a path in other units
is converted before the work and back before it is written.  A non-positive
or non-finite value returns `RGSADDLE_INVALID_PARAMETER`.  The call does not
evaluate a surface.  `n_images < 2`, `n_atoms < 1`, or dimension overflow
returns `RGSADDLE_SHAPE`.  A two-image path (no interior image), a
multi-segment split whose segments contain no interior image, a diagnostic
maze with no stable route, a coordinate singularity that damped inversion
cannot pass, or an inversion or splice that does not converge returns
`RGSADDLE_SOLVER`.  Non-finite input or derived geometry returns
`RGSADDLE_NON_FINITE`.  See
`howto/path-initialization` for the Rust selector and the published splice
tolerance.

`rgsaddle_connect` (ABI minor 18) is the run-to-completion double-ended search. Stamp `rgsaddle_connect_config_t` with the ABI version. `max_calls` is a positive iteration cap and `force_tol` is the Euclidean stop. A nonzero `quench_nodes` minimizes a node created by a split before the next segment. `left` and `right` each hold `3 * n_atoms` positions, and `position` receives the returned geometry. The surface is called with one image and writes the energy and the Cartesian gradient. `rgsaddle_connect_report_t` carries the energy, the Euclidean gradient norm, the kind (`s`, `u`, or `f`), the Hessian index, and the evaluation count. The count includes finite differences that decide a step or an index. The Lanczos acceptance estimates the next curvature with two actions and does not build a dense Hessian. The COMPASS fallback does, and that Hessian is counted.

From ABI minor 21 a climbing band refines its climbing image by the lowest mode (see the band how-to). While that runs, each surface request carries the climbing image alone: a per-image host gets `RGSADDLE_REQ_ONE_IMAGE` with that image's band index, and a batched host gets one geometry with `n_images = 1` and `image = -1`. From a band config at minor 22 those requests also set `RGSADDLE_REQ_CLIMBING_IMAGE` (request flags bit 1), and a batched one then carries the climbing image's band index in `image`, so a host that keeps per-image state, or that gives the one image every MPI rank, knows which image it is. A config below minor 22 gets the minor 21 request. The step report carries the curvature along the mode in `curvature` and 0 on a band step. Set `RGSADDLE_BAND_NO_MIN_MODE` (band config flag bit 3) for the plain CI-NEB of minor 20.

From ABI minor 24, `rgsaddle_sella_saddle_set_symmetrized_ritz` takes 0 for the default or 1.
The value 1 makes a Sella saddle session take the Ritz pairs of its finite-difference diagonalizations from Sella's symmetrized products.
Any other value returns `RGSADDLE_INVALID_PARAMETER` and leaves the session unchanged.
A library below minor 24 does not export the symbol.
When the host loads the library at run time, check `rgsaddle_abi_version()` first.
The Sella how-to says when the option helps.

`rgsaddle_sella_saddle_set_small_system_atom_ceiling` (ABI minor 25) takes 1 or 0.
The value 1 makes a Cartesian Sella saddle session bound only its largest atom move from the first step.
That applies when its Euclidean radius `delta * n_free` starts at 1 or less.
The value 0 keeps that radius alone.
1 is the default.
Any other value returns `RGSADDLE_INVALID_PARAMETER` and leaves the session unchanged.
A library below minor 25 does not export the symbol; the Sella how-to describes the ceiling.

From ABI minor 37, `rgsaddle_indexk_create` opens an index-k minimum-mode session. `rgsaddle_indexk_step` takes the surface and an optional `rgsaddle_hessian_fn`; a null Hessian estimates the action from the surface. `rgsaddle_indexk_modes` writes the n-by-k row-major block and the k curvatures. `rgsaddle_indexk_translated` writes the effective gradient of the last step. `rgsaddle_reflect_force` is the Householder product `F - 2 V V^T F`; for k = 1 that is `force - v * dot(force, v) * 2`, and the output must not alias the force. k = 1 follows the one-mode dimer or Lanczos step. `RGSADDLE_MINMODE_LOBPCG` at k = 1 uses Lanczos. A non-positive k makes create return NULL. `include/rgsaddle/session.hpp` wraps the session as `IndexK`. A library below minor 37 does not export the symbols.

`rgsaddle_minmode_set_torque_window` (ABI minor 32) takes -1, 0 or 1.
The value 1 turns on the classic dimer torque window.
A rotation then also stops after one iteration once the rotational force is under 1.
The value 0 turns that window off, so the rotation runs to `rotation_tol`, the angle test or `max_rotations`.
The value -1 is the state of a new session. It turns the window on when `rotation_tol` is at least 1e-4 and the session is Lanczos or a dimer whose angle stop is off. A dimer with a positive `rotation_angle_tol`, the improved dimer, keeps the window off unless the value is 1.
For config minors 5 through 62, `rotation_angle_tol` is read as given and 0 keeps the angle stop off.
From minor 63, `rotation_angle_tol` = 0 keeps the Rust default angle stop unless flag bit 0, `RGSADDLE_MINMODE_EXPLICIT_ROTATION_ANGLE_TOL`, is set; with that bit and 0 the old stop-off behaviour remains.
Any other value returns `RGSADDLE_INVALID_PARAMETER` and leaves the session unchanged.
A library below minor 32 does not export the symbol.
From minor 41 a Lanczos session reads the window too: a step's estimate stops once two Krylov vectors leave the Ritz residual divided by the absolute Ritz value under 1. A Ritz value whose magnitude is at most 1e-14 of the estimate's curvature scale, the largest Hessian action norm it has formed, uses that scale as the divisor. The value 0 runs the estimate to its dimensionless residual as before.

ABI minor 43 adds the opt-in ART nouveau controls.
`rgsaddle_artn_config_default` initializes an `rgsaddle_artn_config_t` with the published defaults, and `rgsaddle_minmode_set_artn` enables those controls on a Lanczos session.
A NULL config disables the protocol.
The setter rejects a dimer, nonzero reserved flags, negative counts and invalid floating-point controls without changing the session.
Enabling or disabling restarts search history at the current position and mode; creating and stepping a session without this call is unchanged.

From ABI minor 33 a band config with `RGSADDLE_SPRING_ONSAGER_MACHLUP` (spring 2) builds the Onsager-Machlup springs of Mandelli and Parrinello.
At every evaluation each interior image gets the displacement `F / (2 spring_k)` of its current force, as eOn's `buildSpringStrategy` does.
The endpoints get zero.
Below minor 33 every displacement was zero.
The spring then kept only the second difference of the path.
A non-finite `spring_k` makes `rgsaddle_band_create` return NULL.
No layout or symbol changes.
When the host loads the library at run time, check `rgsaddle_abi_version()` for at least minor 33 before relying on the displacements.

From ABI minor 35, `rgsaddle_irc_config_t` `kind` 0 (`RGSADDLE_IRC_GS2`) is the Gonzalez and Schlegel pivot step and 2 (`RGSADDLE_IRC_SELLA_SPHERE`) the sphere about the last point.
A config whose version minor is 34 or older runs the sphere about the last point for every kind but Morokuma, as those versions did.
Minor 34 is the curvature probe and leaves IRC kinds unchanged.
From minor 35, create returns NULL on a kind other than 0, 1 and 2.
The C++ helper `irc_config` selects `RGSADDLE_IRC_SELLA_SPHERE`.

From ABI minor 74, `rgsaddle_irc_config_t` grows after `direction`. A caller that stamps an older minor keeps the prefix and the library does not read the new fields. `kick` is the launch length (`<= 0` means `dx`). `RGSADDLE_IRC_ADAPTIVE` grows the next Morokuma length by 1.2 only when the model ratio is above 0.75 and halves it only when the ratio is below 0.25. A ratio from 0.25 through 0.75 leaves the length unchanged, and the updated length stays between `min_step` and `max_step`. `rgsaddle_irc_set_lengths` sets the same controls on a live session and rebuilds the kick while the session is still on its first step. `RGSADDLE_FORCE_MW_L2` is `||M^{-1/2} g||_2` for an IRC session. `dr`, `krylov_dim` and `eigen_kind` are the Lanczos controls of `rgsaddle_irc_create_from_surface` (`dr <= 0` keeps 1e-3, `krylov_dim <= 0` keeps 12, `eigen_kind` 0 is Lanczos). An unknown `eigen_kind` makes create return NULL. The launch mode is still the lowest mode.

`include/rgsaddle/session.hpp` provides the C++ owning wrappers. `Band`, `MinMode` and `Irc` release their opaque handles automatically and translate failing statuses into exceptions. `tests/c/main_abi_contract.h` checks the retained main layouts and signatures; the C and C++ smoke executables exercise the official header and library together.

`rgsaddle_minmode_set_rotation_stop_length` (ABI minor 38) takes a length in the host's unit.
A positive length stops a dimer rotation once the curvature times that length times the sine of the estimated remaining rotation angle is at most `force_tol`, and stops Lanczos on the same bound for its Ritz residual and Ritz value.
0, the state of a new session, turns the stop off; a negative or non-finite length returns `RGSADDLE_INVALID_PARAMETER` and leaves the session unchanged.
The C++ `MinMode` wrapper calls it as `set_rotation_stop_length`, and Python takes it as the `rotation_stop_length` keyword of `MinMode`.

`rgsaddle_reparametrize` (ABI minor 38) places the interior images of a band at equal arc length, in place, with no surface call.
`RGSADDLE_REPARAM_LINEAR` places them on the polyline and `RGSADDLE_REPARAM_NOT_A_KNOT` on the not-a-knot cubic spline through the images.
A non-negative `anchor` names an interior image that stays, and a non-null `cell` makes the chords minimum images.
Band config bit 4, `RGSADDLE_BAND_SPLINE_REPARAM`, read from a config at minor 38 or newer, puts the trust-region band (`RGSADDLE_METHOD_RTR`) on the spline; `rgsaddle_band_create` and `rgsaddle_ocineb_create` read it.
Python exposes the function as `rgsaddle.reparametrize(positions, scheme, anchor, cell)`.

`rgsaddle_band_set_fixed_atoms` (ABI minor 39) takes `n_atoms` bytes, 1 for a fixed atom and 0 for a free one, shared by every image.
Call it after `rgsaddle_band_create` and between steps; it drops the optimizer history and the last evaluation and keeps the endpoint energies.
A null band returns `RGSADDLE_NULL_BAND`, a null mask or an `n_atoms` other than the band's returns `RGSADDLE_SHAPE`, and a byte other than 0 or 1, a mask that fixes every atom, endpoints that place a fixed atom differently, or a solid-state band returns `RGSADDLE_INVALID_PARAMETER` with the band unchanged.
Fixed atoms never move, carry no force in the report, and leave the mean force in place whether or not `RGSADDLE_BAND_KEEP_TRANSLATION` is set.
`rgsaddle_band_set_exp_precon` then builds its matrices on the free atoms, so the exponential metric runs with fixed atoms.
`rgsaddle_band_project_fixed` is `rgsaddle_band_project` with the same mask, or `NULL` for none.
A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 39 before resolving either symbol.
The C++ `Band` wrapper calls it as `set_fixed_atoms`, from a pointer to the band's `n_atoms` bytes or from a `std::vector<std::uint8_t>` whose size is passed as `n_atoms`, and throws on a failing status.
Python's `project_band` takes the mask as `fixed`, and `rgsaddle.ase.NEB` reads it from `FixAtoms`.

ABI minor 40 adds the saddle-index check of `howto/band` and `howto/minmode`.
A band, min-mode or OCI-NEB config stamped with minor 40 or newer certifies the converged point by default, with the settings `rgsaddle_saddle_check_default` writes into an `rgsaddle_saddle_check_t`; a config stamped below minor 40 runs without the check, as before.
The check's surface calls count in the step's `evaluations`.
`rgsaddle_band_set_saddle_check`, `rgsaddle_minmode_set_saddle_check` and `rgsaddle_ocineb_set_saddle_check` replace the check between steps, and NULL turns it off.
A positive `escape_attempts` with a positive `escape_push` turns the escape on; the step that pushes reports `RGSADDLE_STATUS_RUNNING`.
`rgsaddle_band_saddle_index`, `rgsaddle_minmode_saddle_index` and `rgsaddle_ocineb_saddle_index` fill an `rgsaddle_saddle_index_t` and write up to `capacity` curvatures in ascending order.
Its `certified` is 1 while a certificate holds for the current point, the climbing image for a band; `index`, `converged`, `n_curvatures` and `evaluations` then describe it, and `total_evaluations` and `escapes` sum the session's checks and pushes either way.
`rgsaddle_saddle_index` certifies one point through the surface callback of `rgsaddle_minmode_step`, with an optional gradient, seed mode and fixed-atom mask.
A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 40 before resolving these symbols.
The C++ `Band`, `MinMode` and `Ocineb` wrappers have `set_saddle_check` and `saddle_index`, `rgsaddle::saddle_check()` returns the defaults and `rgsaddle::saddle_index` certifies one point.
Python's `MinMode` reports the index in `SessionReport.saddle_index` and has `saddle_index` and `set_saddle_check`, `rgsaddle.saddle_index` certifies one point, and `rgsaddle.ase.saddle_index` and `rgsaddle.ase.NEB.saddle_index` certify ASE atoms and the climbing image of an ASE band.

ABI minor 44 adds the simplified string method of E, Ren, and Vanden-Eijnden, J. Chem. Phys. 126, 164103 (2007), doi:10.1063/1.2720838 [eSimplifiedImprovedString2007].
Band config bit 5, `RGSADDLE_BAND_STRING`, read from a config stamped with minor 44 or newer, evolves interior images under the full potential force (no spring, no tangent projection) and places them at equal arc length after each step: on the not-a-knot cubic spline when `RGSADDLE_BAND_SPLINE_REPARAM` is also set, and on the polyline otherwise.
An armed climbing image reflects the potential force along the tangent and stays anchored during reparametrization.
`rgsaddle_band_set_string` enables or clears the method on a live `RgsaddleBand` with an `rgsaddle_reparametrization_t` (`RGSADDLE_REPARAM_LINEAR` or `RGSADDLE_REPARAM_NOT_A_KNOT`); `enabled = 0` returns the band to NEB.
`rgsaddle_band_project` and `rgsaddle_band_project_fixed` also read `RGSADDLE_BAND_STRING`.
A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 44 before resolving `rgsaddle_band_set_string`.
`include/rgsaddle/session.hpp` wraps it as `Band::set_string`, and Python exposes `rgsaddle.Band(..., string=True)`, `_core.project_band(..., projection="string")`, and `rgsaddle.ase.SimplifiedString`.

ABI minor 44 adds the growing string method of Peters, Heyden, Bell, and Chakraborty, J. Chem. Phys. 120, 7877 (2004), doi:10.1063/1.1691018 [petersGrowingStringMethod2004]. Its `join_tol` uses -1.0 for no early join and accepts zero as an inclusive zero-gap threshold.
`rgsaddle_growing_string_config_default` initializes an `rgsaddle_growing_string_config_t`, `rgsaddle_growing_string_create` opens an `RgsaddleGrowingString` from the reactant and product endpoints, and `rgsaddle_growing_string_step` advances the separate fragments until they join and hand off to `StringSession`.
`rgsaddle_growing_string_create` returns NULL for a `frontier_tol` that is not finite and positive, a `min_steps_per_node` below 1, a negative `max_steps_per_node` (0 means no cap), a negative `join_tol` other than -1.0, or a non-finite `join_tol` (-1.0 means no early join). The step report's `rotations` field is 0; `rgsaddle_growing_string_nodes_added` gives the nodes the last step grew.
`rgsaddle_growing_string_n_images`, `rgsaddle_growing_string_nodes_added`, `rgsaddle_growing_string_phase`, `rgsaddle_growing_string_positions`, `rgsaddle_growing_string_ids`, `rgsaddle_growing_string_set_fixed_atoms`, `rgsaddle_growing_string_saddle_index`, and `rgsaddle_growing_string_free` inspect and manage the session.
`include/rgsaddle/session.hpp` wraps it as `rgsaddle::GrowingString`, and Python exposes `rgsaddle.GrowingString` and `rgsaddle.ase.GrowingString`.

ABI minor 45 adds the free-end adaptive NEB of Zhang, Zhang, Ye, and Zheng, J. Chem. Phys. 145, 094104 (2016), doi:10.1063/1.4962019 [zhangFreeEndAdaptive2016]. It is a setter, not a band flag. `rgsaddle_band_set_free_end` enables, replaces, or clears it on a live `RgsaddleBand`: `side` is `RGSADDLE_FREE_END_FIRST` or `RGSADDLE_FREE_END_LAST`, `has_target_energy` selects `target_energy` or the endpoint's initial energy, and `max_cuts`, `cut_force`, `energy_tol`, `stability`, `window_offset`, and `cubic` are the adaptive window. `stability` and `window_offset` must be at least 1. `rgsaddle_band_free_end_residual` writes the signed residual \(E(x_{\mathrm{end}}) - E_{\mathrm{target}}\) from the last step, and `rgsaddle_band_free_end_cuts` returns how many windows were actually removed. `rgsaddle_band_evaluation` returns the energies, gradients, and projected interior forces at the positions that step reported. A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 45 before resolving these three symbols. `include/rgsaddle/session.hpp` wraps them as `Band::set_free_end`, `Band::free_end_residual`, and `Band::free_end_cuts`. The worked example is `tests/free_end_neb.rs`.
ABI minor 47 adds `rgsaddle_lineb_solve_with_kappa` for a fixed endpoint coefficient. It takes the same arguments as `rgsaddle_lineb_solve` and one additional pointer. A positive finite value selects the fixed coefficient and a null pointer selects the normalized restraint.

ABI minor 47 adds `RGSADDLE_LINEB_PROJECTED_VERLET` `(1u << 2)` to `rgsaddle_lineb_solve_options`. It selects the projected Verlet band integrator (`LinebConfig::with_projected_verlet`). A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 47 before setting that bit.

ABI minor 47 adds the one-shot fixed-energy LI-NEB and harmonic quantum TST entry points of `howto/lineb`. `rgsaddle_lineb_config_default` fills an `rgsaddle_lineb_config_t` with the paper spring, endpoint scale, time step, step cap, turning width, unit `ℏ` and `k_B`, and four quadrature pairs for the given `opt_tol` and `perp_tol`. `rgsaddle_lineb_solve` takes that config, `n_images` (≥ 3) and `n_atoms` Cartesian images (contiguous image, atom, xyz), `n_atoms` positive `atom_masses`, `molecular` 0 (expand each mass onto the three coordinates with no rigid alignment) or 1 (quaternion molecule alignment), the tunneling `energy`, `max_steps`, `beads`, and the host `rgsaddle_surface_fn`. `beads` 0 returns the path only and writes NaN into `log_rate_over_reactant`; `beads` must otherwise be at least 2. An unconverged path returns `RGSADDLE_STALLED` after writing the last images into `optimized_positions`. `rgsaddle_lineb_result_t` carries the spline action, both half periods and temperatures, the log rate, and the optimizer, measure, dynamics and rate call counts. A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 47 before resolving these symbols. The smoke test is `tests/c/lineb_abi.c`.

The `RGSADDLE_LINEB_INTERPOLATED_FORCE_CLOCK` option selects the signed image force for the imaginary-time orbit and rate. The projected Verlet option controls band optimization independently.

ABI minor 60 adds the per-step refine stepper. `rgsaddle_refine_method_t` is `RGSADDLE_REFINE_NONE` or `RGSADDLE_REFINE_LBFGS`. `rgsaddle_band_set_refine` installs L-BFGS for steps whose convergence force is at or under `threshold`, in the host's force units, and leaves every other step on the band method. A threshold of 0 selects 0.5, and `memory` less than or equal to 0 selects 20 pairs. `RGSADDLE_REFINE_NONE` clears the stepper and does not read the threshold. A negative or non-finite threshold and an unknown method are refused. `rgsaddle_band_is_refining` is 1 when the last first-order step used the refine stepper. A string, trust-region, solid-state, quick-min, or free-end band ignores the call. `include/rgsaddle/session.hpp` wraps the pair as `Band::set_refine` and `Band::is_refining`, and Python exposes `Band.set_refine` and `Band.is_refining`. A host checks `rgsaddle_abi_version()` for minor 60 or newer. The worked example is `tests/band_refine.rs`.

ABI minor 64 adds geodesic interpolation (Zhu, Thompson, and Martinez, J. Chem. Phys. 150, 164103 (2019), doi:10.1063/1.5090303 [zhuGeodesicInterpolation2019]).
`rgsaddle_geodesic_config_default` fills an `rgsaddle_geodesic_config_t`.
`rgsaddle_geodesic_path` minimizes the length of an existing image-major path under a host chart callback, and `rgsaddle_geodesic_morse` builds the path between two geometries with the Morse pair coordinates of their Eq. (7) (alpha 1.7, beta 0.01).
`rgsaddle_geodesic_path` and `rgsaddle_geodesic_morse` return `RGSADDLE_NOT_CONVERGED` when a round of sweeps uses all of `max_sweeps` with an image still moving; the outputs then hold the last iterate.
A NULL config selects the defaults, including `max_images` 32, so it requires `n_images` of at least 32.
A supplied `max_images` above `n_images` is `RGSADDLE_INVALID_PARAMETER`: the output buffer cannot grow, and the cap is not clamped.
`bound_samples` is even. `length`, `lower`, and `upper` may be NULL.
A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 64 before resolving these symbols.

ABI minor 65 adds dynamic NEB.
`rgsaddle_band_set_dynamic` takes 0 to clear it or 1 to set `fmax` and `scale_fmax`; any other flag returns `RGSADDLE_INVALID_PARAMETER` and leaves the band unchanged.
A non-finite `fmax` or `scale_fmax` returns `RGSADDLE_NON_FINITE` when the call would turn the option on. Clearing it ignores both values.
A solid-state band, the trust-region stepper, the simplified string method, and the free-end adaptive NEB are refused.
`rgsaddle_dyneb_mask` applies the same mask to a projected band the host already holds.
A non-finite position, energy, force, `fmax`, or `scale_fmax` returns `RGSADDLE_NON_FINITE`.
While the option is on, an interior image that a neighbour pulls back over its threshold is requested alone: `RGSADDLE_REQ_ONE_IMAGE` is set, `image` is that image's band index, `n_images` is the band length, and `RGSADDLE_REQ_CLIMBING_IMAGE` is not set.
A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 65 before resolving either symbol.

ABI minor 68 adds the run-to-completion AutoNEB of Kolsbjerg, Groves, and Hammer, J. Chem. Phys. 145, 094107 (2016), doi:10.1063/1.4961868. `rgsaddle_autoneb_run` grows a band from at least two images and writes `n_max` rows. `rgsaddle_autoneb_config_t` carries the spring `k`, the two force stops, the two step caps, `n_simul`, `n_max`, the projection, the tangent, and `space_energy_ratio`. `RGSADDLE_AUTONEB_CLIMB` arms the climb from the first evaluation of the climbing window. `RGSADDLE_AUTONEB_IDPP` places new images with the image-dependent pair potential. `RGSADDLE_AUTONEB_KEEP_TRANSLATION` leaves the mean Cartesian force in the window. `rgsaddle_autoneb_report_t` reports `status`, `max_force`, `ci_index` (-1 when there is none), `surface_rows`, `n_images`, and `iteration`. `iteration` counts the steps of the last stage alone, also when that stage keeps the window and the band session of the stage before it. The surface callback is the band callback, and it is not entered from another thread. Python calls it as `autoneb_run` and reads `AutonebReport` (`status`, `max_force`, `ci_index`, `surface_rows`, `n_images`, `iteration`, `positions`). `rgsaddle.ase.AutoNEB` is the ASE-shaped wrapper, and its `run()` returns an `AutoNEBReport` (`status`, `max_force`, `ci_index`, `surface_rows`, `n_images`, `iteration`, `positions`, `images`). A run that spends its steps returns `RGSADDLE_OK` with `status` 0, so a host tests `status` and `max_force`. `tests/c/autoneb_abi.c` drives the entry point on a double well and checks the status, the force, the iteration count, and the error returns. A host checks `rgsaddle_abi_version()` for minor 68 before resolving the symbol. The Rust types are `RgsaddleAutonebConfig` and `RgsaddleAutonebReport`.

ABI minor 69 adds the downward solution-landscape search. `rgsaddle_landscape_config_default` fills an `rgsaddle_landscape_config_t` from the Rust defaults. `rgsaddle_landscape_create` opens an `RgsaddleLandscape` at a critical point whose optional unstable block is row-major `(3 * n_atoms)` by `k`. `rgsaddle_landscape_run` follows every unstable direction. Its Hessian argument is the new `rgsaddle_hessian_at_fn`, which receives the geometry, the vector and the output action; a null Hessian estimates the action from the surface. On `RGSADDLE_LANDSCAPE_BOUND` the report's `n_nodes` and `evaluations` are the counts already reached, `bound` is 1 for the node limit or 2 for the evaluation limit, `n_edges` is 0, and no pathway is stored. `rgsaddle_landscape_node`, `rgsaddle_landscape_modes`, and `rgsaddle_landscape_edge` read a stored map; before one they return `RGSADDLE_NO_EVALUATION`. `rgsaddle_landscape_free` releases the session. `include/rgsaddle/session.hpp` wraps it as `rgsaddle::Landscape`, and the constructor requires ABI 1.69. Python exposes `Landscape`. The worked example is `tests/landscape.rs`. ABI minor 69 also adds the typedef `rgsaddle_hessian_at_fn`, which is `int (*)(void *user, int64_t n_dof, const double *position, const double *vector, double *action)`. `rgsaddle_indexk_step_at` is `rgsaddle_indexk_step` with that geometry-aware callback, and `rgsaddle::IndexK::step_at` wraps it. `rgsaddle_hessian_fn` keeps its original four-argument signature, and `rgsaddle_indexk_step` and `rgsaddle_kappa_dimer_force` still take it. `rgsaddle_landscape_report_t` carries `flags` right after `version`, and the library writes zero. A library below minor 69 does not export the landscape symbols or `rgsaddle_indexk_step_at`.

From minor 70, `RGSADDLE_TANGENT_SPLINE` selects the cubic-spline tangent on `rgsaddle_band_project` and `rgsaddle_band_step`, and `rgsaddle_spline_resample` places interior images at equal steps of the normalized chord length. A band session refuses that tangent together with the simplified string, a solid-state cell, free-end adaptive NEB, or the exponential metric.

ABI minor 71 adds three initial paths. `rgsaddle_idpp_fixed_path` is `rgsaddle_idpp_path` with a frozen atom mask: NULL moves every atom, 1 keeps that atom at the reactant coordinates, and 0 lets it move. `rgsaddle_sidpp_alternating_path` inserts images from both ends at `alpha` (inside (0, 1), default 0.33), runs a short collective quick-min, places the band at equal minimum-image arc length, and runs a final collective quick-min. A count of 0 skips that stage. `rgsaddle_sidpp_alternating_inverse_distance_path` is the same loop with inverse distance targets and a last per-image pull onto the finished target. Its `final_iterations` is at least 1 and its `force_tol` is positive. This entry is not `rgsaddle_geodesic_path`. A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 71 before resolving these symbols. That host check is minor 71. The PAFI and OH-TST layout names in the C contract use minor 72.

ABI minor 72 adds PAFI and OH-TST sessions. `rgsaddle_pafi_run` and `rgsaddle_ohtst_run` call `rgsaddle_point_surface_fn` from worker threads. That callback must be thread safe, because one run may enter it from more than one thread at once.

ABI minor 73 adds `rgsaddle_energy_weighted_spring_ks`, the energy-weighted spring constants of Ásgeirsson et al. for a band's energies, ready for `rgsaddle_band_config_t.spring_ks`. Its `reference` argument picks the endpoint energy the rule measures from: `RGSADDLE_ENERGY_REFERENCE_HIGHER_ENDPOINT` leaves every segment at or below both endpoints soft, and `RGSADDLE_ENERGY_REFERENCE_LOWER_ENDPOINT` already stiffens a segment that lies between the two endpoint energies. The Rust function is `energy_weighted_constants_from`, and `EnergyReference` names that endpoint. A host that loads the library at run time checks `rgsaddle_abi_version()` for at least minor 73 before resolving it.

# Use the Fortran bindings (`docs/orgmode/howto/fortran.org`)

> Fortran 2008 module for the band, minimum-mode, PAFI, and OH-TST C ABI

The optional Fortran layer builds a Fortran 2008 module, `rgsaddle`, over `include/rgsaddle.h` (ABI major 1, minor 72) using `iso_c_binding`. See [the reference page](../reference.html) for the full symbol table of the module.

## Build and link
The feature is off by default in the top-level `meson.build`. Build the Rust C ABI library first, then configure and install the Fortran wrapper with meson:

```sh
cargo build --locked --features capi
meson setup build -Dfortran=enabled --prefix "$PWD/dist" --libdir=lib
meson compile -C build
meson install -C build
```

The install layout under `--prefix` contains:

- `<libdir>/librgsaddle_fortran.a`, the compiled Fortran wrapper archive
- `<includedir>/rgsaddle/fortran/rgsaddle.mod`, the Fortran module file
- `<libdir>/pkgconfig/rgsaddle-fortran.pc`, pkg-config metadata naming `-lrgsaddle_fortran` and `-lrgsaddle`
- `<libdir>/cmake/rgsaddleFortran/rgsaddleFortranConfig.cmake` and its version file, defining the `rgsaddle::fortran` imported target

Fortran `.mod` files are specific to the compiler vendor and major version. Configure meson with the same Fortran compiler (`FC=...`) that builds the consumer, or compile `fortran/rgsaddle.f90` directly alongside the consumer sources (as `ci/fortran_abi.sh` does for `flang-20` and `ifx`).

`librgsaddle` is built by cargo (`cargo build --features capi` or `cargo cinstall`), not by meson. All three build-system integrations reference it:

- *pkg-config*: pass `-L` (and `-Wl,-rpath,` for a shared build) for the directory holding `librgsaddle` before `$(pkg-config --libs rgsaddle-fortran)`. When an installed prefix is moved to a new directory on Linux, pass `--define-prefix` to `pkg-config` so `${prefix}` is recomputed from the `.pc` file path (Windows enables `--define-prefix` by default).
- *CMake*: call `find_package(rgsaddleFortran REQUIRED)` and link `rgsaddle::fortran`. All paths in `rgsaddleFortranConfig.cmake` are computed relative to the config file, so the installed prefix is relocatable. Pass `-DrgsaddleFortran_CAPI_LIBRARY="$PWD/target/debug/librgsaddle.so"` when `librgsaddle` is not in `<libdir>` or the default library search path:

```cmake
cmake_minimum_required(VERSION 3.16)
project(app LANGUAGES Fortran)
find_package(rgsaddleFortran REQUIRED)
add_executable(app main.f90)
target_link_libraries(app PRIVATE rgsaddle::fortran)
```

- *Meson*: resolve `dependency('rgsaddle-fortran')` from `PKG_CONFIG_PATH` (or from a subproject configured with `-Dfortran=enabled`) and pass the link directory for `librgsaddle`.

## Bound subset and status handling
`rgsaddle` binds four session families from the C ABI at minor 72:

- `band_handle`: `create`, `step`, `step_c`, `positions`, `move_from`, `release`
- `minmode_handle`: `create`, `step`, `step_c`, `position`, `mode`, `move_from`, `release`
- `pafi_handle`: `create`, `set_config`, `run`, `run_c`, `result`, `profile`, `move_from`, `release`
- `ohtst_handle`: `create`, `set_config`, `run`, `run_c`, `result`, `curve`, `move_from`, `release`

Entry points outside this subset (`set_positions`, `restart`, `reset`, `evaluation`, `estimate`, `connect`, `index1`, `indexk`, `sella_*`, `irc`, `solid_*`, `stencil`, and standalone `saddle_index`) remain on the C header; see [the C and C++ how-to](c-abi.html).

Every status code from `RGSADDLE_OK` through `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES` is exported. `RGSADDLE_NOT_EQUILIBRATED` (-14) and `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES` (-15) are the PAFI and OH-TST equilibration failures. The step states (`RGSADDLE_STATUS_RUNNING`, `RGSADDLE_STATUS_CONVERGED`), and the method, minimum-mode, OH-TST, `RGSADDLE_BAND_PER_IMAGE`, and `RGSADDLE_REQ_ONE_IMAGE` constants used by the bound calls are exported. Integer selectors not re-exported as Fortran parameters (such as tangent, spring, projection, finite-difference scheme, `RGSADDLE_BAND_NO_MIN_MODE`, or quick-min variants) take their integer values from `include/rgsaddle.h`. `status_name(status)` maps any status integer to an allocatable Fortran string.

Configuration initializers stamp `config%version` via `abi_stamp`:

- `init_band_config(config)` sets improved tangent, uniform spring `k = 5`, NEB projection, FIRE, `ci_trigger_factor = 0.5`, `force_tol = sqrt(epsilon(1.0_c_double))`, `max_move = 0.1`, and L-BFGS `memory = 10`.
- `init_minmode_config(config[, kind])` fills the Rust `MinModeConfig` defaults (`RGSADDLE_MINMODE_DIMER` when `kind` is omitted, FIRE, `dr = 0.001`, `rotation_tol = 0.0001`, `max_rotations = 20`, `krylov_dim = 12`, `force_tol = 0.001`, `max_move = 0.2`, and the five-degree `rotation_angle_tol`).
- `init_pafi_config(config)` fills the PAFI sampling defaults. `init_ohtst_config(config)` fills the Rust `LangevinConfig` and `TransmissionConfig` defaults: sample step 0.05, burn-in 500, 2000 records, 20 blocks, retain 16, shooting friction 0, 256 shots, shooting seed 1, and first-crossing counts. Their `seed`, `sample_seed`, and `shooting_seed` fields hold the 64-bit pattern of C `uint64_t` in `integer(c_int64_t)`; values above \(2^{63} - 1\) appear negative in signed 64-bit arithmetic and can be constructed from two 32-bit halves with `uint64_bits(high, low)`.

On `create`, the wrapper checks the ABI major and dimensions before or alongside the C constructor so that a major version other than 1 returns `RGSADDLE_ABI_MISMATCH`, non-positive or overflowing dimensions return `RGSADDLE_SHAPE`, and invalid configuration values (such as negative temperature or non-monotonic `arcs`) return `RGSADDLE_INVALID_PARAMETER`.

`pafi_handle%profile` and `ohtst_handle%curve` take assumed-shape 1D slices and pass the minimum slice length as `capacity`. When any slice is shorter than the stored series, the call returns `RGSADDLE_INVALID_PARAMETER` and sets the optional `written` output to the required length.

## Handle ownership and finalization
Each handle owns one opaque C session pointer and has a `final` subroutine:

- Assignment (`b = a`) is overloaded on all four handle types and terminates with `error stop RGSADDLE_HANDLE_NOT_ASSIGNABLE` (exit code 17), preventing two handles from aliasing and double-freeing the same C session.
- `call b%move_from(a)` frees any session currently held by `b`, transfers ownership from `a` to `b`, and leaves `a` empty. Self-move (`call a%move_from(a)`) is a no-op. Calling `create` on an already-live handle frees the old session first.
- Calling a query or step method on an empty handle returns `RGSADDLE_NULL_BAND` for `band_handle` and `RGSADDLE_NULL_SESSION` for `minmode_handle`, `pafi_handle`, and `ohtst_handle`.
- `call a%release()` frees the C session immediately and leaves `a` empty. Under Fortran 2008, local non-`save` variables of subroutines, functions, and `block` constructs run their finalizer on scope exit, whereas variables declared in the main `program` unit or with `save` are not finalized when the program exits; call `release()` explicitly in a main program if deterministic teardown is required.

## Array layout and callbacks
Position, energy, and gradient buffers on `band_handle` and `minmode_handle` (and `frames` on `pafi_handle%create`) are passed as contiguous `real(c_double)` storage. In C, band buffers are row-major `n_images` by `3 * n_atoms` (image stride `3 * n_atoms`) and PAFI frames are row-major `n_frames` by `n_dof` (frame stride `n_dof`). Because Fortran stores arrays in column-major order (the first subscript varies fastest in memory), placing coordinate subscripts first and the image or frame subscript last matches the C layout directly without transposing:

```fortran
type(band_handle) :: band
type(pafi_handle) :: pafi
real(c_double) :: positions(3, n_atoms, n_images)
real(c_double) :: frames(n_dof, n_frames)

! Atom a of image i occupies three contiguous doubles at positions(:, a, i).
positions(:, a, i) = [x, y, z]
status = band%create(bcfg, int(n_images, c_int64_t), int(n_atoms, c_int64_t), positions)

! Frame k occupies n_dof contiguous doubles at frames(:, k).
frames(:, k) = q(:)
status = pafi%create(pcfg, int(n_frames, c_int64_t), int(n_dof, c_int64_t), frames)
```

Note that indices stored in C report and result structs (`rgsaddle_report_t%ci_index` and `rgsaddle_pafi_result_t%dividing`) are zero-based C indices: add `1` when indexing a 1-based Fortran array such as `positions(:, :, report%ci_index + 1)`.

Surface callbacks are supported in two forms:

1. *Native Fortran procedure pointers* (`step` and `run`), typed by the abstract interfaces `surface_proc` (for `band_handle` and `minmode_handle`) and `point_surface_proc` (for `pafi_handle` and `ohtst_handle`). For `surface_proc`, the trampoline passes the number of rows actually present in `positions`, `energies`, and `gradients` as `n_images`: when the C request sets `RGSADDLE_REQ_ONE_IMAGE`, `n_images` is `1` and `image` is the zero-based band index; on a batch evaluation, `image` is `-1`. A request whose buffer extent exceeds `huge(0)` returns `RGSADDLE_SHAPE` without invoking the callback.
2. *Raw C function pointers* (`step_c` and `run_c`), accepting a `type(c_funptr)` bound with `bind(C)` that matches `rgsaddle_surface_fn` or `rgsaddle_point_surface_fn` from `include/rgsaddle.h`.

On all eight `step`, `step_c`, `run`, and `run_c` methods, the `user` (`type(c_ptr)`) argument is optional; omitting `user` forwards `c_null_ptr`. On `step` and `step_c`, the `out` (`type(rgsaddle_report_t)`) argument is also optional.

The Fortran trampolines pack the procedure pointer and caller `user` pointer into a stack-allocated box passed through the C `user` context of that call. No module-level state is used:

- A surface or point callback can create and run nested `band_handle`, `minmode_handle`, `pafi_handle`, or `ohtst_handle` sessions without clobbering the outer callback or its `user` pointer.
- `pafi_handle%run` and `ohtst_handle%run` invoke `point_surface_proc` concurrently from worker threads. Point callbacks must be free of unsynchronized shared writes and must carry the `recursive` prefix (required by `gfortran -fcheck=recursion` and `-fcheck=all`).
- Every `surface_proc` and `point_surface_proc` signature declares the `user` dummy argument. Under `-Wall` or `-Wextra`, gfortran enables `-Wunused-dummy-argument` if `user` is untouched; unpack `user` with `c_f_pointer` when passing state, or check `c_associated(user)` when no state is expected.

## Runnable band and minimum-mode example
The host steps `band_handle` or `minmode_handle` in a loop until `report%status == RGSADDLE_STATUS_CONVERGED`, then reads back the geometry. Save the following program as `band_minmode_demo.f90`:

```fortran
module band_minmode_surfaces
  use, intrinsic :: iso_c_binding
  use rgsaddle, only: RGSADDLE_OK, RGSADDLE_INVALID_PARAMETER
  implicit none
contains
  recursive integer(c_int) function double_well_3d(user, n_images, n_atoms, &
      positions, energies, gradients, image) result(status)
    type(c_ptr), value :: user
    integer(c_int64_t), value :: n_images
    integer(c_int64_t), value :: n_atoms
    real(c_double), intent(in) :: positions(*)
    real(c_double), intent(inout) :: energies(*)
    real(c_double), intent(inout) :: gradients(*)
    integer(c_int64_t), value :: image
    integer :: i, base
    real(c_double) :: x, y, z
    if (c_associated(user) .or. n_atoms /= 1_c_int64_t .or. &
        n_images < 1_c_int64_t .or. image < -1_c_int64_t) then
      status = RGSADDLE_INVALID_PARAMETER
      return
    end if
    do i = 1, int(n_images, kind=kind(0))
      base = 3 * (i - 1)
      x = positions(base + 1)
      y = positions(base + 2)
      z = positions(base + 3)
      energies(i) = (x * x - 1.0_c_double) ** 2 + 2.0_c_double * (y * y + z * z)
      gradients(base + 1) = 4.0_c_double * x * (x * x - 1.0_c_double)
      gradients(base + 2) = 4.0_c_double * y
      gradients(base + 3) = 4.0_c_double * z
    end do
    status = RGSADDLE_OK
  end function double_well_3d
end module band_minmode_surfaces

program band_minmode_demo
  use, intrinsic :: iso_c_binding
  use rgsaddle
  use band_minmode_surfaces
  implicit none

  integer, parameter :: n_images = 9
  type(band_handle) :: band
  type(rgsaddle_band_config_t) :: bcfg
  type(rgsaddle_report_t) :: report
  real(c_double) :: path(3, 1, n_images), t
  type(minmode_handle) :: dimer
  type(rgsaddle_minmode_config_t) :: mcfg
  real(c_double) :: start(3), seed(3), saddle(3), mode(3)
  procedure(surface_proc), pointer :: cb
  integer(c_int) :: status
  integer :: i, step, ci

  do i = 1, n_images
    t = real(i - 1, c_double) / real(n_images - 1, c_double)
    path(1, 1, i) = -1.0_c_double + 2.0_c_double * t
    path(2, 1, i) = 0.4_c_double * sin(acos(-1.0_c_double) * t)
    path(3, 1, i) = 0.0_c_double
  end do

  call init_band_config(bcfg)
  bcfg%force_tol = 1.0_c_double / 10000.0_c_double
  bcfg%max_move = 0.1_c_double
  bcfg%ci_trigger_force = 0.5_c_double

  status = band%create(bcfg, int(n_images, c_int64_t), 1_c_int64_t, path)
  if (status /= RGSADDLE_OK) stop 1
  cb => double_well_3d
  do step = 1, 4000
    status = band%step(cb, out=report)
    if (status /= RGSADDLE_OK) stop 2
    if (report%status == RGSADDLE_STATUS_CONVERGED) exit
  end do
  if (report%status /= RGSADDLE_STATUS_CONVERGED) stop 3
  status = band%positions(path)
  if (status /= RGSADDLE_OK) stop 4
  ci = int(report%ci_index, kind=kind(0)) + 1

  start = [0.35_c_double, 0.20_c_double, -0.15_c_double]
  seed = [0.8_c_double, 0.2_c_double, 0.1_c_double]
  call init_minmode_config(mcfg, int(RGSADDLE_MINMODE_DIMER, c_int32_t))
  mcfg%force_tol = 1.0_c_double / 1000.0_c_double
  mcfg%max_move = 0.1_c_double
  status = dimer%create(mcfg, 1_c_int64_t, start, seed)
  if (status /= RGSADDLE_OK) stop 5
  do step = 1, 4000
    status = dimer%step(cb, out=report)
    if (status /= RGSADDLE_OK) stop 6
    if (report%status == RGSADDLE_STATUS_CONVERGED) exit
  end do
  if (report%status /= RGSADDLE_STATUS_CONVERGED) stop 7
  status = dimer%position(saddle)
  if (status /= RGSADDLE_OK) stop 8
  status = dimer%mode(mode)
  if (status /= RGSADDLE_OK) stop 9

  write(*, '(a,1x,i0,1x,3f8.4,1x,a,1x,3f8.4,1x,a,1x,f6.4)') &
    'ci=', ci, path(:, 1, ci), 'dimer=', saddle, 'mode_x=', abs(mode(1))
  call band%release()
  call dimer%release()
end program band_minmode_demo
```

## Runnable PAFI and OH-TST example
Both `pafi_handle` and `ohtst_handle` take a `point_surface_proc` callback (or `c_funptr` via `run_c`). Below, `double_well` runs with `user` omitted (checking `if (c_associated(user))`) while `quad_saddle` unpacks caller parameters through `c_f_pointer`, so both compile cleanly under `-Wall -Wextra`. Save the following program as `pafi_ohtst_demo.f90`:

```fortran
module demo_surfaces
  use, intrinsic :: iso_c_binding
  use rgsaddle, only: RGSADDLE_OK, RGSADDLE_INVALID_PARAMETER
  implicit none

  type :: saddle_params
    real(c_double) :: transverse_k = 4.0_c_double
  end type saddle_params

contains
  recursive integer(c_int) function double_well(user, n_dof, position, energy, gradient) result(status)
    type(c_ptr), value :: user
    integer(c_int64_t), value :: n_dof
    real(c_double), intent(in) :: position(*)
    real(c_double), intent(inout) :: energy
    real(c_double), intent(inout) :: gradient(*)
    real(c_double) :: x
    if (c_associated(user) .or. n_dof /= 1_c_int64_t) then
      status = RGSADDLE_INVALID_PARAMETER
      return
    end if
    x = position(1)
    energy = (1.0_c_double - x * x) ** 2
    gradient(1) = -4.0_c_double * x * (1.0_c_double - x * x)
    status = RGSADDLE_OK
  end function double_well

  recursive integer(c_int) function quad_saddle(user, n_dof, position, energy, gradient) result(status)
    type(c_ptr), value :: user
    integer(c_int64_t), value :: n_dof
    real(c_double), intent(in) :: position(*)
    real(c_double), intent(inout) :: energy
    real(c_double), intent(inout) :: gradient(*)
    type(saddle_params), pointer :: params
    if (.not. c_associated(user) .or. n_dof /= 2_c_int64_t) then
      status = RGSADDLE_INVALID_PARAMETER
      return
    end if
    call c_f_pointer(user, params)
    energy = 0.5_c_double * (-position(1) ** 2 + params%transverse_k * position(2) ** 2)
    gradient(1) = -position(1)
    gradient(2) = params%transverse_k * position(2)
    status = RGSADDLE_OK
  end function quad_saddle
end module demo_surfaces

program pafi_ohtst_demo
  use, intrinsic :: iso_c_binding
  use rgsaddle
  use demo_surfaces
  implicit none

  integer, parameter :: n_frames = 41
  type(pafi_handle) :: pafi
  type(rgsaddle_pafi_config_t) :: pcfg
  type(rgsaddle_pafi_result_t) :: pout
  real(c_double) :: frames(n_frames), arcs(n_frames)
  real(c_double) :: grad(n_frames), grad_err(n_frames), free_e(n_frames), free_err(n_frames)
  integer(c_int64_t) :: written
  integer(c_int) :: status, i
  procedure(point_surface_proc), pointer :: cb

  type(ohtst_handle) :: tx
  type(rgsaddle_ohtst_config_t) :: ocfg
  type(rgsaddle_ohtst_result_t) :: oout
  type(saddle_params), target :: params
  real(c_double) :: point(2), normal(2), t(32), kappa_t(32)

  call init_pafi_config(pcfg)
  pcfg%thermal = 0.02_c_double
  pcfg%time_step = 0.01_c_double
  pcfg%thermalize = 5_c_int64_t
  pcfg%stride = 1_c_int64_t
  pcfg%samples = 200_c_int64_t
  ! A 1D path gives a deterministic series with 2.2 effective samples.
  pcfg%blocks = 2_c_int64_t
  pcfg%seed = 3_c_int64_t
  pcfg%fix_com = 0_c_int32_t
  pcfg%retain = 1_c_int64_t
  pcfg%max_rounds = 1_c_int64_t

  do i = 1, n_frames
    frames(i) = -1.0_c_double + 2.0_c_double * real(i - 1, c_double) / real(n_frames - 1, c_double)
    arcs(i) = 2.0_c_double * real(i - 1, c_double) / real(n_frames - 1, c_double)
  end do

  status = pafi%create(pcfg, int(n_frames, c_int64_t), 1_c_int64_t, frames, arcs)
  if (status /= RGSADDLE_OK) stop 1
  cb => double_well
  status = pafi%run(cb)
  if (status /= RGSADDLE_OK) stop 2
  status = pafi%result(pout)
  if (status /= RGSADDLE_OK) stop 3
  status = pafi%profile(arcs, grad, grad_err, free_e, free_err, written)
  if (status /= RGSADDLE_OK) stop 4

  call init_ohtst_config(ocfg)
  ocfg%thermal = 0.5_c_double
  ocfg%shooting_friction = 1.5_c_double
  ocfg%shooting_shots = 4096_c_int64_t
  point = [0.0_c_double, 0.0_c_double]
  normal = [1.0_c_double, 0.0_c_double]
  status = tx%create(ocfg, 2_c_int64_t, point, normal)
  if (status /= RGSADDLE_OK) stop 5
  cb => quad_saddle
  status = tx%run(cb, c_loc(params))
  if (status /= RGSADDLE_OK) stop 6
  status = tx%result(oout)
  if (status /= RGSADDLE_OK) stop 7
  status = tx%curve(t, kappa_t, written)
  if (status /= RGSADDLE_OK) stop 8

  write(*, '(a,1x,f8.5,1x,a,1x,f8.5)') 'barrier=', pout%barrier, 'kappa=', oout%kappa
  call pafi%release()
  call tx%release()
end program pafi_ohtst_demo
```

Compile and run either example against the installed prefix. `-L` for the cargo library precedes `$(pkg-config --libs rgsaddle-fortran)`, which already appends `-lrgsaddle`:

```sh
PKG_CONFIG_PATH="$PWD/dist/lib/pkgconfig:$PWD/dist/share/pkgconfig" \
  gfortran -std=f2008 -Wall -Wextra -fcheck=all \
  $(pkg-config --cflags rgsaddle-fortran) \
  pafi_ohtst_demo.f90 \
  -Ltarget/debug -Wl,-rpath,"$PWD/target/debug" \
  $(pkg-config --libs rgsaddle-fortran) \
  -o pafi_ohtst_demo.x
./pafi_ohtst_demo.x
```

`ci/fortran_abi.sh` runs both documented programs and the full `tests/fortran/` suite (NEB, per-image requests, dimer, Lanczos, PAFI 1D and 2D widening profiles, OH-TST aligned and tilted planes under BAOAB and GHMC, handle move/release/non-assignability, optional and forwarded `user` pointers on `step`, `step_c`, `run`, and `run_c`, and nested outer band, min-mode, PAFI, and OH-TST re-entrancy).

# Use the headers from a meson project (`docs/orgmode/howto/meson.org`)

> Consuming rgsaddle headers from Meson wrap-git or pkg-config

The top-level `meson.build` gives a C or C++ project the rgsaddle headers: `rgsaddle.h`, `rgsaddle/session.hpp` and `rgsaddle/stencil.hpp`. By default it is headers only. The optional `-Dfortran=enabled` feature adds the Fortran 2008 wrappers documented in `howto/fortran`. The Rust library is still built by cargo; the host links that library (for example from `cargo build --features capi` or `cargo cinstall`) or loads it at run time. The headers are the hand-written contract, the same files cargo-c installs, so there is nothing to generate.

The meson project is `rgsaddle`, and its version is the crate's. `tests/package_version.rs` fails when `meson.build` and `Cargo.toml` disagree. The dependency answers to two names, `rgsaddle-headers` and `rgsaddle`, and the variable `rgsaddle_headers_dep` holds it.

## Pull the headers in with a wrap
Pin a full commit, as the crate pins its own git dependencies. Save this as `subprojects/rgsaddle-headers.wrap`:

```ini
[wrap-git]
directory = rgsaddle-headers
url = https://github.com/OmniPotentRPC/rgsaddle.git
revision = <full 40-hex commit>
depth = 1

[provide]
dependency_names = rgsaddle-headers, rgsaddle
```

Then ask for the dependency by either name:

```meson
rgsaddle_dep = dependency('rgsaddle-headers')
```

The explicit form that names the subproject and its variable also works:

```meson
rgsaddle_dep = dependency(
    'rgsaddle-headers',
    fallback: ['rgsaddle-headers', 'rgsaddle_headers_dep'],
)
```

As a subproject, rgsaddle installs nothing into the parent's prefix.

## Move off the packagefiles overlay
A project that carried `subprojects/packagefiles/rgsaddle-headers/meson.build` deletes that directory and the `patch_directory` line of its wrap, and moves `revision` to a commit that has `meson.build`. Its `dependency()` call stays as it was. The overlay only exposed `include/rgsaddle.h`; the subproject now exposes `include/`, so `#include <rgsaddle/session.hpp>` also resolves.

## Use installed headers through pkg-config
From a checkout:

```sh
meson setup build --prefix "$PREFIX"
meson install -C build
```

That installs the headers under `include` and `rgsaddle-headers.pc` under `share/pkgconfig`, the directory for files with no architecture. The file has `Cflags` and no `Libs`. Put that directory on `PKG_CONFIG_PATH`, and `dependency('rgsaddle-headers')` finds it before any fallback.

`cargo cinstall` writes `rgsaddle.pc`, which also links `-lrgsaddle`. The meson file has another name so that the two can share a prefix. Installed, `dependency('rgsaddle')` is therefore the cargo-c library. As a subproject, the `rgsaddle` name is the headers alone.

## Load the library at run time
A host that loads the library with `dlopen`, as gpridge does through `RGSADDLE_LIBRARY`, types each lookup with the header's declaration and needs no link line:

```cpp
#include <rgsaddle.h>
#include <dlfcn.h>

void* lib = dlopen(path, RTLD_NOW | RTLD_LOCAL);
auto* band_create = reinterpret_cast<decltype(rgsaddle_band_create)*>(
    dlsym(lib, "rgsaddle_band_create"));
```

Call `rgsaddle_abi_stamp` first and refuse a library whose major differs from `RGSADDLE_ABI_MAJOR` or whose minor is below what the host uses. The inline helpers of `rgsaddle/session.hpp` that only fill structs, such as `rgsaddle::band_config()`, need no symbol either. The wrapper classes call the library directly and need it linked.

## What CI checks
The `meson-consumer` job builds `ci/meson-consumer`, a C++ project that makes the explicit `dependency()` call above, once through a wrap-git at the commit under test and once through an installed `rgsaddle-headers.pc` with fallbacks off. Each run checks which of the two it got and its version, loads the cdylib, and steps a climbing band on a double well to the saddle. The job runs on meson 0.63.0, the `meson_version` floor, and on the current release. To run it locally:

```sh
cargo build --features capi
ci/meson_consumer.sh subproject target/debug/librgsaddle.so
ci/meson_consumer.sh pkgconfig target/debug/librgsaddle.so
```

The subproject mode clones the checkout, so it sees committed files only. The consumer loads the library with `dlopen`; CI runs it on Linux.

# Python package (`docs/orgmode/howto/python.org`)

> Python nanobind surface, SurfaceAdapter, and ASE drop-in classes

The package is a nanobind extension, `rgsaddle._core`, with a pure Python layer. `import rgsaddle` does not import ASE. Install ASE only when you construct `rgsaddle.ase.SurfaceAdapter`:

```sh
pip install .
pip install 'rgsaddle[ase]'
```

Wheels are cp310, cp311, cp312-abi3 (CPython 3.12 through 3.15 with the GIL), cp314t and cp315t. There is no musllinux wheel and no cp313t wheel.

## Enum controls
Eight `IntEnum` classes keep the names and values of the previous module: `ForceGate`, `HessUpdate`, `IrcKind`, `MinModeKind`, `EigenDevice`, `ExpandKind`, `CellChart`, `RestrictedKind`. An unknown ordinal raises `ValueError`. `MinModeKind` contains dimer and Lanczos; `RGSADDLE_MINMODE_LOBPCG` belongs to the index-k C ABI and has no Python session. `rgsaddle.__version__` is the package version.

```python
import rgsaddle
assert rgsaddle.ForceGate.MAX_FORCE_ON_ATOM == 2
assert rgsaddle.ForceGate(2) is rgsaddle.ForceGate.MAX_FORCE_ON_ATOM
```

## Status codes
`raise_status(code)` maps `rgsaddle_status_t`. `RGSADDLE_OK` returns true. `RGSADDLE_SHAPE` and `RGSADDLE_INVALID_PARAMETER` raise `ValueError`. `RGSADDLE_NON_FINITE` raises `NumericalError`, a subclass of `ArithmeticError`. `RGSADDLE_SURFACE_FAILED` raises `RuntimeError`. It does not re-raise a stored calculator exception. Every other code, including `RGSADDLE_NOT_EQUILIBRATED` and `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES`, raises `RuntimeError`. The exception message is the thread-local text when that text is non-empty, and the status name otherwise. `raise_status` clears that text. `last_error()` is reserved for the C ABI last-error text. It returns an empty string unless an error text was set. Convergence of a stepping run is a report, not a status code. The geodesic interpolation is the exception, and its `RGSADDLE_NOT_CONVERGED` raises `RuntimeError` like any other remaining code.

## Surface adapter
`SurfaceAdapter(images, allow_shared_calculator=False)` checks the image list, then evaluates C ABI request rows `(ids, x) -> (energies, gradients)`.

- Image ids are the list positions at construction.
- `x` has shape `(rows, 3 * n_atoms)`, float64, C contiguous.
- Positions are written with `set_positions(..., apply_constraint=False)`, so the row stays on the geometry the caller passed.
- The gradient is minus `Atoms.get_forces()`, which applies constraints the way ASE does.
- `raw_forces` keeps `get_forces(apply_constraint=False)` for those rows, in request order. The assignment happens while the call still holds the in-use claim.
- Two images may share one calculator object only when `allow_shared_calculator` is true. The same check runs again at `__call__`, `owners`, and `reentrant`, using `atoms.calc` identity.
- `owners(ids)` is the calculator identity of each row, as `uint64`. `reentrant(ids)` is `uint8`, 1 when that calculator sets `reentrant` true. A caller uses those arrays to group rows. The adapter does not start threads.

`__call__(ids, x)` evaluates the given rows on the calling thread, in the given order.

A calculator exception, including `KeyboardInterrupt`, propagates out of `__call__`. It is not wrapped. A second call on the same adapter, while the first call still holds it, raises `RuntimeError` with the text `SurfaceAdapter is in use by another thread`.

`connect(surface, left, right, force_tol=0.001, max_calls=250000, quench_nodes=True)` runs the double-ended search to completion. `surface(x)` receives one image with shape `(1, 3N)` and returns `(energy, gradient)`, energy shape `(1,)` and gradient shape `(1, 3N)`, the same callback as `Stencil.step`. `left` and `right` are length `3N`. The GIL is released for the search and taken again inside the callback. A calculator exception propagates. `ConnectReport` holds `position`, `energy`, `force_norm`, `kind` (`s`, `u`, or `f`), `hessian_index`, and `evaluations`. The evaluation count includes finite differences that decide a step or an index. The Lanczos acceptance estimates the next curvature with two actions and does not build a dense Hessian. The COMPASS fallback does, and that Hessian is counted.

`lineb_solve(surface, positions, atom_masses, energy, opt_tol, perp_tol, molecular=False, max_steps=1000, beads=0, ...)` runs a fixed-energy LI-NEB path to completion and optionally the harmonic quantum TST rate (`howto/lineb`). `positions` is `(n_images, 3N)`. `atom_masses` holds one positive mass per atom: with `molecular=False` each mass expands to three coordinates, and with `molecular=True` the free molecule is quaternion-aligned. `surface(x)` is the same one-image callback as `connect`. The GIL is released around `rgsaddle_lineb_solve` and taken again inside the trampoline. A calculator exception propagates unchanged. `beads=0` skips the rate and leaves `log_rate_over_reactant` as NaN. An unconverged search raises with the existing non-success C status. `LinebResult` holds `positions`, `action`, both half periods and temperatures, `log_rate_over_reactant`, `iterations`, and the `optimizer_calls`, `measure_calls`, `dynamics_calls`, and `rate_calls` tallies.

`rgsaddle.ase.NEB`, `AutoNEB`, `SimplifiedString`, `GrowingString`, `MinModeAtoms`, and `Sella` are the ASE-shaped calls. `AutoNEB` runs `autoneb_run`, and its `run()` returns an `AutoNEBReport` (`status`, `max_force`, `ci_index`, `surface_rows`, `n_images`, `iteration`, `positions`, `images`): a `status` of 0 means the last stage spent its steps before it met the force stop. `NEB`, `SimplifiedString`, and `GrowingString` read `FixAtoms` from the images into the band's fixed-atom mask: those atoms get zero force rows, `interpolate` leaves them on the first image, and every image must fix the same atoms. `NEB.interpolate` takes `method` `linear` or `idpp` and `mic`. `idpp` calls `idpp_path`. `DyNEB` freezes images that are already under `fmax`; `NEB` does not, unless `dynamic_relaxation=True` is passed and the `FutureWarning` is accepted. `DimerControl` and `MinModeTranslate` are the dimer parameter object and the optimizer that takes one `MinMode.step`. `SimplifiedString` runs the simplified string method of E, Ren, and Vanden-Eijnden [eSimplifiedImprovedString2007] with `'not-a-knot'` (or `'spline'`) or `'linear'` equal-arc-length reparametrization and an optional climbing image (`run(fmax, steps)` drives `rgsaddle.Band` under an ASE `Optimizer` subclass so `logfile`, `trajectory`, and attached observers run per step). `GrowingString` runs the growing string method of Peters, Heyden, Bell, and Chakraborty [petersGrowingStringMethod2004] from the endpoint images, handing off to `StringSession` once the fragments join. The migration page says where `NEB` follows ASE and where the endpoint-slope climb, the `aseneb` name, and the plain `eb` projection do not. `NEBOptimizer` drives that band with ASE's ODE12r step or a fixed step (`howto/neb-optimizer`). IRC stays on the Rust and C sessions.

`_core.halve_raised_energy(previous, trial, step)` returns `(raised, new_step)`. A trial more than 1e-4 above `previous` halves `step`. `_core.trust_update(radius, predicted, actual, step_norm, sigma_inc, sigma_dec, rho_inc, rho_dec, delta_min)` is the Sella radius after those energy changes. A prediction below 1e-14 in absolute value returns `radius`. Neither call evaluates a surface.

`rgsaddle.Band` is the stepping band and simplified-string session: `Band(positions, ..., string=True, reparametrization="not-a-knot")` takes a batched surface callback receiving `(rows, 3N)` and returning `(energies, gradients)`, with `step`, `run`, `positions`, `set_positions`, `evaluation`, `set_string`, `set_fixed_atoms`, `saddle_index`, `set_saddle_check`, `restart`, and `reset`. `rgsaddle.GrowingString(reactant, product, n_images=11, frontier_tol=0.2, ...)` steps the growing string and hands off to `StringSession` upon join, with `step`, `run`, `n_images`, `nodes_added`, `joined`, `positions`, `ids`, `set_fixed_atoms`, and `saddle_index`. `Band.set_free_end(enabled, side="last", target_energy=None, max_cuts=2, cut_force=0.0, energy_tol=0.001, stability=2, window_offset=1, cubic=True)` enables the free-end adaptive NEB of Zhang, Zhang, Ye, and Zheng [zhangFreeEndAdaptive2016] on an existing band (ABI minor 45; a host checks the loaded minor before calling it). `Band.set_refine(enabled=True, threshold=0.0, memory=20)` and `Band.is_refining` install the per-step L-BFGS refine stepper (ABI minor 60). A threshold of 0 selects 0.5, in the host's force units, and `enabled=False` clears it. `Band.target_energy_residual` and `Band.free_end_cuts` report the level-set residual and how many local windows were removed. `Band.evaluation` returns the energies, gradients, and projected interior forces at the positions the last step reported. The worked example is `tests/free_end_neb.rs`. `_core.project_band` projects an evaluated band (including `projection="string"` for the unprojected potential force with optional climbing reflection). `_core.MinMode` and `_core.SellaSaddle` are the point sessions those classes drive; their surface callback receives one image shaped `(1, 3N)` and returns `(energy, gradient)`.

`_core.MinMode` translates with L-BFGS, unlike the FIRE default of Rust's `MinModeConfig` and `rgsaddle_minmode_create` when its method field is zero.

The low-level Python session is intentionally smaller than the C and Rust sessions.
It does not expose reset, an explicit mode setter, the torque window, HiGHS, force-gate selection, or kappa controls.
Use the Rust session or the corresponding `rgsaddle_minmode_*` C entry points when a host needs those controls.

## Saddle index
A converged `_core.MinMode` step certifies the saddle index of its point, as in `howto/minmode`: `SessionReport.saddle_index` is the index on that step and -1 on the others.
`MinMode.saddle_index()` returns a `SaddleIndex` with `certified`, `index`, `converged`, the ascending `curvatures`, `evaluations`, and the session's `total_evaluations` and `escapes`.
`MinMode.set_saddle_check(enabled=True, escape_attempts=0, escape_push=0.1, lowest=4, max_actions=100, dr=1e-3, residual_tol=1e-2, negative_tol=1e-3)` replaces the check; `enabled=False` turns it off, and a positive `escape_attempts` pushes a point of index two or more off its extra negative modes and searches again.
`rgsaddle.saddle_index(surface, x, gradient=None, mode=None, fixed=None, ...)` certifies one point through the same callback, with an optional gradient at `x`, seed mode and `uint8` fixed-atom mask.
Both Python calls keep the C defaults that are not keyword arguments: block size 2, forward differences, and the library's deterministic seed.
`rgsaddle.ase.saddle_index(atoms, mode=None, ...)` certifies ASE atoms on their calculator with `FixAtoms` as the mask and leaves them where they were, and `rgsaddle.ase.NEB.saddle_index()` certifies the climbing image of a band that climbs, seeded with its tangent.
An index above 1 at a converged climbing image says the band stopped on a saddle of higher index, as a band whose start shares a symmetry with the surface can.

The index-k step has no Python session name. It is `rgsaddle_indexk_step` in the C ABI and `rgsaddle::IndexK` in the C++ header.

`Landscape` searches downward from a critical point of length `3N`. `modes` is shape `(3N, k)` or omitted. The opening controls are `push` (0.1), `duplicate_distance` (0.001), `max_nodes` (64), `max_evaluations` (100000), `max_steps` (2000), and `force_tol` and `relax_force_tol` (0.001). `Landscape.run` takes the surface callback and an optional `hessian`. It returns a `PathwayMap` whose `nodes` are `CriticalPoint` values and whose `edges` are `LandscapeEdge` values. `hessian` matches `rgsaddle_hessian_at_fn`: it receives the geometry and the vector. Omit it and the search estimates the action from the surface. A node has `position`, `energy`, `index`, `curvatures`, and `evaluations`. An edge has `parent`, `child`, `direction`, `sign`, and `evaluations`. The map's `evaluations` counts every force evaluation. A node or evaluation limit raises `ValueError` and returns no pathway. The surface callback is the one-image `(1, 3N)` callback of `saddle_index`.

## Thread safety
Immutable values, such as the enum members, are shared freely. `SurfaceAdapter` is a mutable session. Each call claims an atomic flag for the whole call and drops it when the call returns, including when the calculator raises. `raw_forces` is assigned before that drop. Do not call the adapter again from inside its own calculator.

The adapter does not start threads. The caller passes request rows and the adapter evaluates them on that caller's thread. A Python exception raised by the calculator propagates on that thread. It does not unwind through the Rust static library. `PyErr_CheckSignals` runs on that thread.

There is no global mutable state. The last-error string is thread-local. Arrays are float64 and C contiguous. Wrong dtype or order is `TypeError`. Wrong shape is `ValueError` that names the argument and both shapes. Outputs are new arrays. `-0.0`, NaN and subnormals pass through. Sub-interpreters are unsupported.

# Drive an ASE band with NEBOptimizer (`docs/orgmode/howto/neb-optimizer.org`)

> Drive an ASE NEB band with NEBOptimizer, the ODE12r step and the fixed step

`rgsaddle.ase.NEB` already takes a list of ASE `Atoms` images, each with its own calculator, and the ASE keywords `k`, `climb`, and `method`. `interpolate` and `idpp_interpolate` are methods. `NEBOptimizer` is the missing driver: the object ASE scripts construct around that band.

Replace

```python
from ase.mep import NEB
from ase.mep.neb import NEBOptimizer
```

with

```python
from rgsaddle.ase import NEB, NEBOptimizer
```

The rest of the call stays:

```python
band = NEB(images, k=0.1, climb=True, method="improvedtangent")
band.interpolate()  # or band.interpolate(method="idpp")
finished = NEBOptimizer(band, method="ODE", logfile=None).run(fmax=0.05, steps=300)
```

`images` is the list of ASE images. Lengths and energies are the calculator's. `precon` still raises `NotImplementedError` on `NEB`. `DyNEB` stays opt-in and is not this class.

## Constructor
`NEBOptimizer(neb, restart=None, logfile='-', trajectory=None, master=None, append_trajectory=False, method='ODE', alpha=0.01, verbose=0, rtol=0.1, C1=1e-2, C2=2.0)`.

`method` is lowercased and stored. The accepted names are `ode`, `static`, and `krylov`. Anything else raises `ValueError` with the text `method must be one of` and the list of those three names. `krylov` is stored. `run` then raises `ValueError`.

`logfile`, `trajectory`, `append_trajectory`, `master`, and `restart` are passed to ASE's `Optimizer`. `logfile='-'` is stdout. `logfile=None` writes nothing. An observer attached with `attach` runs from the step callback, and it sees `nsteps` before the callback increments it. A `restart` path that names an existing file raises `NotImplementedError`. A missing path does not.

Importing `rgsaddle.ase` does not import ASE. The first `NEBOptimizer` call does.

## run
`run(fmax=0.05, steps=100000000, method=None)` returns a bool. `steps` defaults to ASE's `DEFAULT_MAX_STEPS`, 100000000. `method` selects `ode` or `static` and is not lowercased. Omitted, it is the stored name. `run(method='ODE')` on a solver stored as `ode` raises `ValueError` whose text is `unknown method: ode`. `run(method='ode')` is the call that selects the ODE solver. `run(method='static')` selects the fixed step even when the constructor stored `ode`.

`method='ode'` calls ASE's `ode12r` on the band force. `rtol`, `C1`, `C2`, and `verbose` are the arguments of that solver. The step is the adaptive ODE12r integrator of Makri, Ortner, and Kermode, J. Chem. Phys. 150, 094109 (2019), doi:10.1063/1.5064465 [makriPreconditioningScheme2019]. This path returns false only when that solver raises `OptimizerConvergenceError`. A run that spends `steps` without converging still returns true, because ASE's wrapper does.

`method='static'` adds `alpha` times the band force and returns true when `neb.get_residual() <= fmax`. It returns false when `steps` is spent. `alpha` 0 leaves the images where they are.

## Residual
`NEB.get_residual` and `NEBOptimizer.get_residual` are the same number. `get_forces` stores one infinity norm per interior image, the largest absolute component of that image's projected force. A call before `get_forces` raises `RuntimeError` with the text `get_residual() called before get_forces()`.

The value is the largest of those norms. The climbing image is omitted only when one was chosen. With `climb=True` and no climbing image, every interior image stays in the maximum, the same residual as `climb=False`. When an image does climb it is omitted, so a converged climb can still have a climbing-image force above `fmax`. On an exact tie of interior energies the omitted image is the first maximum (`np.argmax`). ASE omits `1 + np.argsort(interior)[-1]`. With one interior image that climbs, the stored list is empty and the maximum raises `ValueError`. One interior image that does not climb has a residual, and `run` does not raise.

`ase.optimize` drivers (`BFGS`, `FIRE`, `MDMin`) do not use this residual. They stop on the largest per-atom force of every interior image, through `__ase_optimizable__`.

## Al adatom hop
`tests/python/test_ase_neb_optimizer.py` runs one hop both ways. An Al adatom sits in a hollow of a three-layer Al(100) slab (two by two), EMT calculator, bottom layers fixed with `FixAtoms`. The product is the same slab with the adatom moved by half the x cell vector, and both ends are relaxed. Five images, `k=0.1`, `climb=True`, `method='improvedtangent'`, linear `interpolate`, then `NEBOptimizer(..., method='ODE', logfile=None).run(fmax=0.05, steps=300)`.

The test first checks that the band forces match within 1e-9 eV/Å. It then asserts that the barriers and the climbing-image energies agree within 1e-9 eV. On this hop the two ODE runs reproduce those energies to about 1e-14 eV. The 1e-9 eV bound stays far inside the 0.05 eV/Å force stop: both runs halt on the same residual, and the energy comparison is between those two runs.

# Move a search from ASE or eOn (`docs/orgmode/howto/migrate.org`)

> Migrating NEB, dimer, and Sella workflows from ASE or eOn

The Rust sessions are the source of the mechanics. The Python classes in `rgsaddle.ase` follow the call shape of ASE's nudged elastic band, minimum-mode atoms, and Sella's `run(fmax, steps)`. Where the numbers differ, the difference is the one the tests lock in.

## From 0.5.x to 0.6.0
A converged band, minimum-mode, or OCI-NEB session now certifies the saddle index by default.
Those finite-difference evaluations count in the step report, so force-call totals can increase even when the search takes the same path.
Use `with_saddle_check(None)` on `BandConfig` or `MinModeConfig` when reproducing 0.5.x counts.

`BandReport`, `MinModeReport`, and `OcinebReport` add `saddle_index`.
Code that constructs or exhaustively matches one of those reports must accept the new field.
The C ABI introduced the saddle-check structs and functions at minor 40; a config stamped with an older minor keeps the check off.
Python's `_core.MinMode` enables the check by default and returns it through `SessionReport.saddle_index` and `MinMode.saddle_index()`.

## From ASE's NEB
`rgsaddle.ase.NEB(images, k=0.1, climb=False)` takes the same list of `Atoms` with calculators. `k` is one spring or one constant per segment. `interpolate()` places the interior images on the straight line between the ends, and `interpolate(method='idpp')` then runs `idpp_path`. `mic` uses the minimum image for the straight line. `get_positions` and `get_forces` are the interior images only, and `ase.optimize` (`BFGS`, `FIRE`, `MDMin`) drives them through `__ase_optimizable__`. `get_potential_energy` is the highest interior energy. `NEB.get_residual` is the largest absolute component of the projected force on the interior images, stored by `get_forces` as an infinity norm per image. The climbing image is omitted only when one was chosen. A call before `get_forces` raises `RuntimeError`. One interior image that does climb leaves that list empty and the maximum raises `ValueError`. `NEBOptimizer` (`howto/neb-optimizer`) stops on that residual.

The spring constant defaults to 0.1, ASE's value. A `BandSession` still defaults to 5, eOn's value. Pass the number you mean.

`method='improvedtangent'` and `method='aseneb'` build the same force. The tangent is a unit vector, so ASE's extra division by the tangent norm in the `aseneb` climbing step is 1. `eb` keeps the full spring. `dneb` adds the doubly nudged correction. `spline` takes the unit tangent and the curvature spring from the not-a-knot cubic through the images in normalized chord length (Makri, Ortner, and Kermode, 2019). `string` uses that tangent with no spring, and `set_positions` places the interior images at equal steps of the same parameter. A `precon` raises `NotImplementedError`. The exponential metric stays `BandConfig.exp_precon` on the Rust session.

`climb=True` climbs on the call, with no arming delay. It does not climb when a higher endpoint slopes down into the band. ASE climbs the highest image anyway. That image then feels the reflected force and walks up a slope that has no saddle between it and the endpoint. `tests/python/test_ase_dropin.py` and `tests/api_input.rs` lock the refusal. A `BandSession` still waits until the band force drops before it arms the climb; the one-shot projection does not, because the caller already asked for it.

`remove_rotation_and_translation=True` on a free, non-periodic band moves each image onto the previous one with ASE's rigid fit before the force is built, and `interpolate` fits the product onto the reactant. A fixed atom is not rotated, and a periodic image is not rotated: the mean Cartesian force is removed instead, and a fixed atom keeps that mean. `parallel=True` on one rank evaluates on the calling thread. `world.size > 1` raises `NotImplementedError`. `BandConfig::remove_rotation_and_translation` is that neighbour fit for a Rust `BandSession` and for `band_forces`, and it is off unless set. A collinear cloud leaves rotation about its axis undetermined, and the Rust fit keeps the residual minimizer closest to the identity. `rgsaddle.ase.NEB` does not read the flag; it keeps calling ASE's `minimize_rotation_and_translation`.

`FixAtoms` on the images is read into the band's fixed-atom mask, as `rgsaddle_band_set_fixed_atoms` takes it from C. The fixed atoms get zero force rows, keep the mean force even with `remove_rotation_and_translation=True`, and stay where the first image has them through `interpolate()`. Every image must fix the same atoms. Other constraints act through `get_forces()` as before.

`dynamic_relaxation`, `fmax`, and `scale_fmax` on `NEB` raise `NotImplementedError`. `DyNEB` takes them: an image under `fmax` is left in place, `scale_fmax` loosens that test with the distance from the highest-energy image, and the default band is unchanged. A variable cell in a periodic direction raises `NotImplementedError` as well.

`AutoNEB` reads `prefix000.traj` and `prefix001.traj` and grows the band with `autoneb_run`. The constructor arguments match `ase.mep.AutoNEB`. The stored images must agree on the atom count, the atomic numbers, `pbc`, and the periodic cell vectors, as ASE's `NEB` requires, and a mismatch raises the same error. The endpoints keep their own `Atoms` records, and a new interior image copies the start, as ASE copies the image left of the cut. `world=None` is `ase.parallel.world`. `parallel=True` on more than one rank raises `NotImplementedError`; with `parallel=False` every rank runs the same search and rank 0 alone writes the trajectories. `remove_rotation_and_translation=True` removes the mean force during the search and, for a free, non-periodic band without `FixAtoms`, fits each image onto the one before it by the Kabsch rotation before and after the search, which is the fit of `minimize_rotation_and_translation`. The steps are the band's FIRE solver. `maxstep` is read from the optimizer class signature when that parameter has a numeric default. A default of None uses the optimizer's documented `defaults['maxstep']`, which is the value ASE applies. `smooth_curve=True`, a non-FIRE optimizer, and `method` `spline` or `string` raise `NotImplementedError`. The final images are written back to `prefixNNN.traj`. Per-iteration trajectory files are not written. The initial fill matches ASE when `n_simul` is 1 or 3. ASE's `run()` returns nothing, and this one returns an `AutoNEBReport` (`status`, `max_force`, `ci_index`, `surface_rows`, `n_images`, `iteration`, `positions`, `images`). `status` is 1 when the last stage met its force stop and 0 when it ran out of steps. `max_force` is the largest force component of that stage and `iteration` is its step count. `positions` is the finished band, shaped `(n_images, 3N)`, and `images` is that band with its endpoints. A spent step budget is not an error, so a caller tests `status`. `all_images`, `status`, `max_force`, and `iteration` on the object hold the same values after the call. With a partially periodic first image, a slab or a wire, the minimum image wraps only the periodic axes, so the band is not folded across its vacuum.

## From ASE's dimer and from Sella
`rgsaddle.ase.MinModeAtoms(atoms, mode=...)` estimates a dimer or Lanczos mode and returns the effective force. Above the well the perpendicular force is dropped. Below it the force along the mode is reflected. An ASE optimizer can drive that object.

`MinModeAtoms(atoms, control)` with a `DimerControl` is ASE's dimer call. `displace()` with the default `displacement_method='gauss'` draws the same `RandomState` normals as ASE 3.29 when `random_seed` is set, one coordinate at a time. A mask, or a `displacement_center` with `radius` or `number_of_atoms`, limits that draw, and `mic` is the minimum image when the center is an atom index. `method='vector'` still applies a Cartesian displacement. `initial_eigenmode_method='gauss'` (the default) builds the mode from one further draw and restores the positions. `'displacement'` uses the move away from the original positions. `get_potential_energy` stores that guess without rotating it. `get_eigenmode`, `get_curvature`, and `get_barrier_energy` read the estimate, and `MinModeTranslate` takes the trial step and the conjugate-gradient direction from ASE while the rotated mode comes from this dimer. `order` other than 1, an `eigenmode_method` other than `dimer`, and a communicator with `size > 1` raise `NotImplementedError` naming the option. The mode's sign follows the guess. Convergence wants the force below `fmax` and a negative curvature.

`rgsaddle.ase.Sella(atoms, order=1)` is the saddle optimizer. `run(fmax, steps)` is ASE's loop. One step is the partitioned rational-function trust step, not a dimer translation. Masses come from `atoms.get_masses`.

## From eOn
The band tangents, springs, projections, and the climbing-image arm follow eOn's branch structure. `CiConfig::after(0.5)` is eOn's `ci_after`. `after_rel` is `ci_after_rel`. `always` climbs from the first evaluation. The minimum-mode dimer is eOn's improved dimer: `rotation_angle_tol` defaults to five degrees (`converged_angle`), and a rotation stops when the trial or the fitted angle falls under it, on `rotation_tol`, or at `max_rotations`. It does not infer the classic torque window; `rotation_angle_tol` 0 restores that window at the stock residual, and `set_torque_window(Some(true))` adds it to the improved dimer. Lanczos stops on the window at two vectors. eOn's Lanczos stops on the relative change of its lowest Ritz value (`lanczos_tolerance`), which `set_lanczos_rel_tol` sets here without the window.

eOn's client reads a config file and a potential plugin. Here the host passes positions and a surface. There is no system name, species table, or potential key in the session. A solid-state band takes one cell per image and the Cauchy stress through `BandSurface::eval_cells`.

Live Onsager-Machlup displacements are the atomic force over `2k`. A solid-state band has a cell block in the same vector, so that spring is refused at construction rather than applied as zeros.

## ASE 3.29 tests
`tests/python/ase_upstream` vendors ASE 3.29.0's NEB and dimer tests (LGPL-2.1-or-later) and substitutes `rgsaddle.ase.NEB`, `DyNEB`, `MinModeAtoms`, `DimerControl`, `MinModeTranslate`, `interpolate`, and `idpp_interpolate`. The Python CI job sets `RGSADDLE_REQUIRE_ASE=1`, so a missing ASE install fails collection. `ase/optimize/test/neb.py` is not vendored: it is a script with no pytest entry and no assertion.

| Result | Test | Why |
| --- | --- | --- |
| passing | `test_neb` | Al(100)+Au, `FixAtoms`, BFGS, constrained and unconstrained forces |
| passing | `test_idpp` | ethane methyl permutation through `idpp_path` |
| passing | `test_interpolate_images` | linear placement, `mic`, constraints, cell and scaled coordinates |
| passing | `test_COCu111`, `test_COCu111_2` | IDPP start, BFGS, shared calculator, trajectory |
| passing | `test_neb_methods` `aseneb` and `improvedtangent`, precon `None` | Morse vacancy barrier |
| passing | `test_deprecations`, `test_neb_default`, `test_raising_parallel_errors`, `test_no_shared_calc`, `test_init_checks`, `test_freeze_method` | constructor, shared calculator, image checks, frozen results |
| passing | `test_dimer_method` | Pt hop with `DimerControl`, `displace`, and `MinModeTranslate` |
| skipped | `test_autoneb.py` | drives ASE AutoNEB image insertion, not these drivers |
| skipped | `test_dimer.py` | `FixBondLength` on a two-atom cluster, not the minimum-mode method |
| skipped | `test_get_neb_method` | asserts ASE's private NEB method classes, not the public force |
| skipped | `test_neb_optimizers` | drives ASE `NEBOptimizer` on a spline band with an Exp preconditioner |
| skipped | `test_precon_initialisation`, `test_single_precon_initialisation`, `test_list_precon_initialisation`, `test_precon_assembly` | asserts ASE Exp preconditioner assembly, not the band force |
| skipped | `test_spline_fit` | asserts ASE's cubic-spline fit object, not the band force |
| skipped | `test_integrate_forces` | integrates forces on ASE's spline fit, not the band force |
| skipped | `test_neb_methods` `spline` and `string`, and any precon | those rows drive NEBOptimizer or an Exp preconditioner; the identity spline and string forces are `tests/python/test_ase_spline_string.py` |
| skipped | `test_neb_tr` | FIRE step-count ratio follows ASE's partial BFGS IDPP path; the band force matches on one geometry and the barriers agree, but the aligned run is not faster by the factor 0.75 |
| passing | `test_dynamic_neb` | Pt(111)+O, EMT, BFGS; dynamic and scaled DyNEB use fewer force calls than the plain band, and the barriers agree |
| not supported | `precon` | preconditioned spline and string forces are not implemented; the name is in the `NotImplementedError` |
| not supported | `parallel` with `world.size > 1` | no MPI image distribution |
| not supported | `idpp` `mic` on a partially periodic cell | `idpp_path` wraps every axis |
| not supported | `idpp_interpolate` `optimizer` other than `MDMin` or `BFGS`, and a custom `traj` or `log` | the path is `idpp_path` and it writes no trajectory |
| not supported | gauss displacement, `order` other than 1, `eigenmode_method` other than `dimer` | the estimator is the dimer or Lanczos mode of order 1 |
| not supported | variable cell in a periodic direction | the band cell is one lattice |

# Step a point stencil (`docs/orgmode/howto/stencil.org`)

> Unified point stencil builder across Rust, C, C++, and Python

`Stencil::point` builds a minimiser, a dimer, Lanczos, ART, or eigen following. Its defaults are forward difference, `dr = 1e-3`, rotation tolerance `1e-4`, rotation angle five degrees, 20 rotations, Krylov dimension 12, FIRE with opening timestep 1.0, and maximum move 0.2. A dimer whose builder leaves `rotation_angle_tol` unset explicitly keeps the five-degree stop at every `rotation_tol`; setting the angle to zero disables it. Lanczos reads `rotation_tol` as a dimensionless Ritz residual, divided by the absolute Ritz value, and as its relative Ritz-value tolerance and, at `1e-4` or looser, infers the classic torque window while no host relative tolerance is set. The dimer reads it as a rotational force in curvature units. Explicit angle values on Lanczos and ART do not add an angle criterion, but they must still be finite and non-negative. When the per-atom cap shortens a negative-curvature FIRE step and the arrival is no longer negative, that step is replaced from the last negative point by 0.01 times the reflected force. Dimer and Lanczos are a `MinModeSession`. Dimer rotational conjugate-gradient history crosses translations. A negative curvature reflects the parallel force. A curvature that is not negative moves the largest atom by the maximum move along the mode and drops the perpendicular force; within half that step of the minimum along the mode it keeps the mode's orientation, for eigen following as well. Henkelman and Jónsson (1999), doi:10.1063/1.480097. Goswami, Gunde, and Jónsson, Front. Chem. (2026), doi:10.3389/fchem.2026.1807063, Eq. 9.

```rust
let mut search = Stencil::point(x0)
    .preset(Preset::Dimer)
    .mode(seed)
    .build()?;
let report = search.step(&surface)?;
```

ART pushes along the seed until the curvature falls under `art_threshold` (default 0), then climbs with Lanczos. Malek and Mousseau (2000), doi:10.1103/PhysRevE.62.7723. Eigen following builds a central-difference Hessian, calls `exact_eigh`, and makes the largest-magnitude component of the lowest mode positive. `build` rejects `Climb::Reflect` on a minimiser, a window on a point, a zero thread count, and ART without a mode solver.

`Stencil::band` checks the array and returns `BAND_PRESET_SEAM` (`band presets stay on feat/band-methods-zoom`, kept for compatibility) because band presets are not implemented in the stencil builder. Use `BandSession`, `AutoNeb`, or `OcinebSession` directly for a band search, and `BandConfig::zoom` or `SpringKind::EnergyWeighted` for zoom-NEB and energy-weighted springs. The chain, the mesh (remesh, insert, window), and the point controller are implemented.

From C, `rgsaddle_stencil_config_new` takes the preset discriminant. Unknown keys return `RGSADDLE_INVALID_PARAMETER`. `rgsaddle_last_error` is thread-local. `rgsaddle_stencil_run` loops over `rgsaddle_stencil_step`. The report opens with `struct_size`. The older band and min-mode entries stay step-only; the stencil symbols were added at ABI minor 16 and remain additive under the current ABI minor 72.

From Python, `rgsaddle.Stencil.point(x, preset="dimer")` takes a C-contiguous float64 vector. `step(surface)` releases the thread, and the surface callback re-attaches. `rgsaddle.ase.Point(atoms, preset="dimer").run(fmax, steps)` is an ASE `Optimizer` whose `step` is one stencil step. A second thread that enters the same handle raises `RuntimeError`.

`Chain::evaluate` writes each image from a block of one. Threads 1, 2, 3, and 8 produce the same bytes. A point preset is one row, so its thread count does not change the bytes either.

# Formal stencil (`docs/orgmode/howto/formal.org`)

> Lean 4 formal proofs and MPFR differential verification

The climbing image with a zero doubly-nudged term is the Householder reflection of the true force. Goswami, Gunde, and Jónsson, Front. Chem. (2026), doi:10.3389/fchem.2026.1807063, Eq. 9, is the identity used first. The same reflection is the negative-curvature dimer translation. Henkelman and Jónsson, J. Chem. Phys. 111, 7010 (1999), doi:10.1063/1.480097, define that step. The improved tangent is Henkelman and Jónsson, J. Chem. Phys. 113, 9978 (2000), doi:10.1063/1.1323224.

## Check
```console
$ cd formal && ./check.sh
$ (cd formal && lake exe mirror)
$ cargo test --features capi --test formal_mirror
```

`formal/check.sh` builds the pinned Lean toolchain and refuses `sorry`, `admit`, and axioms beyond `propext`, `Classical.choice`, and `Quot.sound`. `lake exe mirror` writes `formal/golden/stencil.json`. The Rust test compares those bits.

The MPFR comparison is a separate feature so a default build does not link GMP.

```console
$ cargo test --features capi,verify --lib differential -- --nocapture
```

That test asserts only the dot-product bound in Higham, Accuracy and Stability of Numerical Algorithms, 2nd ed., SIAM, 2002, doi:10.1137/1.9780898718027, Section 3.1. It prints the largest ULP it saw.

The two-dimensional reflected Hessian `diag(-a, b)` has eigenvalues of positive real part exactly when the mode's first component exceeds `1/sqrt(2)`. The same threshold in dimension 3 and higher is open. `validation/stencil/fortyfive.py` records the search.

# Mass-weighted reaction paths (`docs/orgmode/explanation/mep.org`)

> Mass-weighted intrinsic reaction coordinates and unweighted minimum energy paths

An intrinsic reaction coordinate follows the gradient in mass-weighted coordinates. With `x_mw = sqrt(m) x`, its tangent is the normalized negative mass-weighted gradient.

The inner steps of both sphere kinds use a moving constraint whose radius is measured in that metric. The displacement and the stored path offset appear together in the constraint, so the sphere is not the unit sphere centred at the coordinate origin. The steps follow the full mass-weighted gradient. Only the launch mode that `from_surface` estimates leaves out the excluded directions of the surface, such as rigid-body motion.

The launch direction is the lowest eigenvector `u` of the mass-weighted Hessian `M^{-1/2} H M^{-1/2}`, taken as the Cartesian displacement `M^{-1/2} u`. A surface that supports Hessian actions can supply it without materializing a dense Hessian. An existing dense Hessian can use the corresponding eigensolver. The host chooses the method and verifies the physical saddle before tracing its branches.

A geodesic initial path (Zhu, Thompson, and Martinez, J. Chem. Phys. 150, 164103 (2019), doi:10.1063/1.5090303) places images by minimizing redundant coordinate length before any potential call. `geodesic_path` does that for a caller supplied chart. It is not itself a minimum energy path.

In unweighted Cartesian coordinates, a minimum energy path between two basins satisfies \(\nabla V(x)^\perp = 0\) along the curve. `BandSession` approximates that path either by the nudged elastic band, which projects the potential force perpendicular to a discrete tangent and spaces images with tangential springs, or by the simplified string method of E, Ren, and Vanden-Eijnden, J. Chem. Phys. 126, 164103 (2007), doi:10.1063/1.2720838 [eSimplifiedImprovedString2007] (`StringConfig`), which evolves images under the full potential force \(-\nabla V\) and restores equal arc length geometrically on the not-a-knot cubic spline or the polyline after each step.

# One stencil (`docs/orgmode/explanation/one-stencil.org`)

> Householder reflection shared by climbing-image NEB and minimum-mode searches

The dimer translation and the climbing image are one Householder reflection of the true force. Goswami, Gunde, and Jónsson, Front. Chem. (2026), doi:10.3389/fchem.2026.1807063, Eqs. 3, 8, and 9, and Sec. 2.3.1 and Sec. 4. CI-NEB and dimer translation share that reflection, using the path tangent and minimum mode, respectively, as the distinguished direction. Goswami (2026), arXiv:2603.10992, doi:10.48550/arXiv.2603.10992, Eqs. 2.14-2.16.

A preset chooses the sides, the tangent, the coupling, the climb, and the mesh. `Stencil::point` runs a minimiser, the dimer, Lanczos, ART, and eigen following. Dimer and Lanczos construct `MinModeSession`, so the recorded position and energy hashes stay the same. `Stencil::band` names the band presets but returns an error because band presets are not implemented. Use the dedicated band sessions instead.

| Preset | Tangent | Climb | Mode |
| --- | --- | --- | --- |
| minimiser | none | none | none |
| dimer | axis | reflect if the curvature is negative, otherwise ascend | rotation |
| Lanczos | Ritz | as the dimer | Lanczos |
| ART | seed, then Ritz | ascend until the curvature drops, then reflect | Lanczos |
| eigen following | lowest eigenvector | as the dimer | dense central-difference `exact_eigh` |

rgmin started as Rohit Goswami's xtsci-optimize (2023-2024), which composed minimisers from small strategy objects. The stencil core extends that to saddle and band methods. eOn v2.9.0.1 is doi:10.5281/zenodo.18529496. Goswami (2025), arXiv:2510.21368, doi:10.48550/arXiv.2510.21368.

`Chain::evaluate` owns one block per image. The block size is fixed at one image and does not depend on the thread count. Each block is written back by index after the surface call. Remesh, insert, and window do not call the surface. Image ids survive an insert.

The C surface is `rgsaddle_stencil_*` with an opaque config, typed key setters, and a thread-local `rgsaddle_last_error`. `include/rgsaddle/stencil.hpp` is the RAII wrapper. Python `rgsaddle.Stencil.point` and `rgsaddle.ase.Point` call that wrapper. `Point.run` uses an ASE `Optimizer` subclass. The extension is nanobind with `Py_MOD_GIL_NOT_USED` on a free-threaded build.

Method papers, after the citations above: Henkelman and Jónsson (1999), doi:10.1063/1.480097; Henkelman, Uberuaga, and Jónsson (2000), doi:10.1063/1.1329672; Henkelman and Jónsson (2000), doi:10.1063/1.1323224; Jónsson, Mills, and Jacobsen (1998); Ásgeirsson et al. (2021), doi:10.1021/acs.jctc.1c00462; Kolsbjerg, Groves, and Hammer (2016), doi:10.1063/1.4961868; Malek and Mousseau (2000), doi:10.1103/PhysRevE.62.7723; Smidstrup et al. (2014), doi:10.1063/1.4878664; Schmerwitz, Ásgeirsson, and Jónsson (2024), doi:10.1021/acs.jctc.3c01111; Curtis, Powell, and Reid (1974), doi:10.1093/imamat/13.1.117.

A benchmark that changes iterates cites Goswami, AIP Adv. (2025), doi:10.1063/5.0283639, first.

# Hyperplane methods on one geometric footing (`docs/orgmode/explanation/hyperplane-methods.org`)

> PAFI, OH-TST, and constrained-ensemble samplers on one geometric footing

## Scope and provenance

The implementation starts from the operator construction used by Goswami,
Gunde, and Jónsson, /Enhanced climbing image nudged elastic band method with
Hessian eigenmode alignment/, /Frontiers in Chemistry/ 14 (2026),
doi:10.3389/fchem.2026.1807063: dimer translation and climbing-image
translation are reflections made from the same rank-one projector.  Goswami,
/A Tutorial Review of Bayesian Optimization with Gaussian Processes to
Accelerate Stationary Point Searches/ (2026), arXiv:2603.10992, writes the
dimer construction in the same form.  The cost accounting used when these
operators are compared follows Goswami, /Bayesian hierarchical models for
quantitative estimates for performance metrics applied to saddle search
algorithms/, /AIP Advances/ 15 (2025), doi:10.1063/5.0283639.  These papers
are cited first because they are the direct provenance of the implementation
and its comparisons; they did not introduce PAFI or OH-TST.

The method sources are:

- Swinburne and Marinica, /Unsupervised Calculation of Free Energy Barriers
  in Large Crystalline Systems/, /Physical Review Letters/ 120, 135503
  (2018), doi:10.1103/PhysRevLett.120.135503 (PAFI).
- Jóhannesson and Jónsson, /Optimization of hyperplanar transition states/,
  /The Journal of Chemical Physics/ 115, 9644-9656 (2001),
  doi:10.1063/1.1415499 (OH-TST).
- Bligaard and Jónsson, /Optimization of hyperplanar transition states:
  Application to 2D test problems/, /Computer Physics Communications/ 169,
  284-288 (2005), doi:10.1016/j.cpc.2005.03.064 (the twisted-path
  validation).
- Hermes, Sargsyan, Najm, and Zádor, /Sella, an Open-Source
  Automation-Friendly Molecular Saddle Point Optimizer/, /Journal of Chemical
  Theory and Computation/ 18, 6974-6988 (2022),
  doi:10.1021/acs.jctc.2c00395.
- Absil, Mahony, and Sepulchre, /Optimization Algorithms on Matrix
  Manifolds/, Princeton University Press (2008),
  doi:10.1515/9781400830244.

## Symmetry-unique hard regions and rate multiplicity

A dividing hyperplane is infinite.  In a crystal it can therefore intersect
several symmetry-equivalent images of the same transition.  Sampling all of
them is wasteful and can mix images.  `SymmetryUniqueRegion` instead builds
the Voronoi cell of one representative configuration under point- or
space-group operations that leave the plane invariant.  Its faces are hard
half-spaces.  MD reflects the in-plane velocity normal to a crossed face;
GHMC rejects an outside proposal.  There is no collective variable, spring,
window, or soft wall.

The region reports the number of distinct in-plane images as its
`degeneracy`.  `RateMultiplicity` keeps that number separate from the number
of paths or hop directions:

\[
k_{\rm total}=m_{\rm path}m_{\rm plane}k_{\rm unique}.
\]

Each symmetry orbit belongs in exactly one factor.  The twelve fcc
nearest-neighbour vacancy-hop directions are `m_path=12`.  They are not the
degeneracy of one hop's dividing plane.  That factor is the order of the
subgroup that fixes both the reactant and the chosen saddle, the in-plane
symmetry of that plane.  Jóhannesson and Jónsson, Secs. II D and III D,
sample one such part of the hyperplane; the construction is in
[crystal operations and symmetry-unique regions](/explanation/symmetry-regions.html).
Putting the twelve directions into `m_plane` as well as `m_path` counts each
hop twice.

`AffineSymmetry` and `SymmetrySource` accept generic configuration-space
point- or space-group maps.  `PeriodicSymmetryOperations` evaluates their
per-atom displacements with `minimage::Cell`.  `readcon-core` currently
supplies structures and cells but no generic symmetry-operation source, while
`minimage` supplies periodic geometry but no space-group finder.  Automatic
discovery therefore belongs as a future patch to one of those owning
libraries; rgsaddle consumes operations supplied by the host and does not
duplicate crystallographic symmetry discovery.

`RegionIntersection` composes the primary symmetry cell with `PathSlab`
(between neighbouring path planes) and `QuenchedTransitionRegion` (outside
either rgmin-quenched basin).  It rejects more than one non-unit degeneracy,
preventing accidental multiplication of overlapping symmetry counts.
Predicate faces without a geometric penetration depth return to the last
contained point before velocity reflection.

The engine-neutral sampling budget carries the same region.  The analytic
BAOAB/GHMC implementation consumes it through its existing drift or proposal
step.  LAMMPS hard-region sampling is pending a lammpc capability that applies
a host boundary callback after every `lammpc_session_md_step`, restores a
complete accepted state on rejection, and refreshes forces after reflection.
The callback registration entry points already exist, but current lammpc main
does not apply them to constrained MD steps.  Until lammpc advertises that
behavior, the LAMMPS adapter fails closed when a sampling budget carries a
region.

## One constraint and its metric

Let Cartesian coordinates be \(x\), let \(M\) be a positive diagonal mass
matrix, and put

\[
q=M^{1/2}x .
\]

A Cartesian plane with covector \(a\) through \(x_0\) is
\(a^{T}(x-x_0)=0\).  In mass-weighted coordinates it has unit normal

\[
\nu={M^{-1/2}a\over\sqrt{a^{T}M^{-1}a}},\qquad q_0=M^{1/2}x_0 .
\]

Its tangent space and Euclidean projector in \(q\) are

\[
T_q{\cal H}=\{v:\nu^Tv=0\},\qquad
P_q=I-\nu\nu^T .
\]

Mapping a tangent displacement back to Cartesian coordinates gives

\[
P_x=M^{-1/2}P_qM^{1/2}
   =I-{M^{-1}aa^T\over a^TM^{-1}a}.
\]

Forces are covectors, so their Cartesian map is \(P_x^T\), not \(P_x\).
The code therefore performs all OH-TST geometry in \(q\).  PAFI without
explicit masses is the unit-mass case.  `MassWeighted`,
`Hyperplane::from_cartesian`, and the fixed-energy path take those maps
from `MassMetric` rather than hiding a metric in a dot product.

The affine level set is a flat embedded manifold.  Its retraction is exact:

\[
R_q(v)=q+P_qv,\qquad
\Pi_{\cal H}(y)=y-\nu\nu^T(y-q_0).
\]

For a non-unit normal \(n\), both occurrences of \(\nu\nu^T\) become
\(nn^T/(n^Tn)\).  This is the arithmetic retained by PAFI.

## PAFI: a fixed family of planes

Let \(X(s)\) be a path parameterised by arc length, \(n(s)=X'(s)\), and
\(n'(s)=X''(s)\).  PAFI samples the canonical distribution restricted to

\[
{\cal H}_s=\{q:(q-X(s))^Tn(s)=0\}.
\]

Projected Brownian dynamics removes the normal part of drift and noise with
\(P_s=I-nn^T\), then applies the exact affine restoration.  With

\[
\psi(q,s)=(q-X(s))^Tn'(s),
\]

the mean-force estimator used in `pafi.rs` is

\[
{dF\over ds}
 =\left\langle
   \bigl(\nabla V(q)^Tn(s)\bigr)\bigl(1-\psi(q,s)\bigr)
  \right\rangle_{{\cal H}_s}.
\]

`average_hyperplane` estimates this expression and its block error.
`pafi_profile` evaluates independent fixed planes along the path.
`integrate_profile` applies the trapezoid rule and propagates the plane
errors.  PAFI optimises neither \(X\) nor a plane normal; path quality and
sampling error are separate inputs to the result.

## OH-TST: optimise the dividing plane

Write a plane using a pivot \(c\), unit normal \(\nu\), and offset \(d\):

\[
{\cal H}(\nu,d;c)=\{q:\nu^T(q-c)=d\}.
\]

Its configurational free energy, up to the common normalisation, is

\[
A(\nu,d)
=-k_BT\log\int
 \delta\!\left(\nu^T(q-c)-d\right)
 e^{-V(q)/(k_BT)}\,dq .
\]

Transition-state theory is variational: maximizing \(A\) minimizes the rate
within this family of hyperplanar dividing surfaces.  An unoriented plane
normal is a point of \(\mathrm{Gr}(D,1)\).  When the reactant-to-product sign
is retained it is represented on \(S^{D-1}\); antipodal normals describe the
same geometric plane with opposite side labels.  Thus the outer problem is

\[
\max_{([\nu],d)\in\mathrm{Gr}(D,1)\times\mathbb R} A(\nu,d),
\]

or the oriented sphere equivalent.  At \(\nu\), a normal update \(w\) is
projected by \(P_\nu=I-\nu\nu^T\), and the retraction is
\((\nu+w)/\|\nu+w\|\).  Held translations, rotations, or user directions
replace the sphere by rgmin's `SubspaceSphere`.  The offset is a Euclidean
factor.  `PlaneOptimizer` assembles those factors as an rgmin
`ProductManifold` and minimizes \(-A\) with its Riemannian trust region.
In ambient dimension \(D=3N\), a unit normal on \(S^{D-1}\) has \(D-1=3N-1\)
degrees of freedom and the signed offset has one, so the combined family has
\(D\) degrees of freedom before held rigid modes. `PlaneOptimizer` optimizes
all \(D-1\) orientational ones. Johannesson and Jonsson (2001) describe the
orientational optimization as \(D-2\) dimensional, as a size comparison with
the one-dimensional translation along the reaction coordinate; they do not
say which direction that count leaves out.

Sample sizing and convergence are separate.  The gradient norm test may grow
the constrained ensemble up to `max_records`.  It does not decide
convergence: the accepted translation and orientation steps must instead be
smaller than `confidence` times their gradient errors propagated through the
current model curvature, or smaller than `tolerance`, for `patience`
consecutive accepted steps.  `max_iterations` and `max_evaluations` return a
finite last estimate with `PlaneOptimizerStatus::MaxIterations` or
`PlaneOptimizerStatus::MaxEvaluations`; sampling noise cannot make the run
unbounded.

Sampling gives the ambient derivatives

\[
{\partial A\over\partial p}
 =\langle\nu^T\nabla V\rangle\nu,\qquad
{\partial A\over\partial\nu}
 =-\left\langle(\nu^T\nabla V)(q-p)\right\rangle ,
\]

followed by tangent projection.  Moving the pivot inside the plane is a
gauge.  Recentering it at the sample centroid leaves the plane unchanged
and expresses the rotational derivative as the corresponding covariance.

The `ohtst` Cargo feature is opt-in.  There is one shared `Hyperplane` type;
`Hyperplane::new` stores a unit normal and `Hyperplane::from_path` retains
PAFI's path derivative only to preserve the historical \(nn^T/(n^Tn)\)
operation order.  The analytic two-dimensional unit test uses
\(V(x,y)=-x^2/2+y^2\), whose constrained Gaussian has its closed-form
optimal plane at \(x=0\), normal to the unstable mode.

### Twisted-path PAFI and OH-TST observables

For Bligaard and Jónsson's
\[
V(x,y)={V_0\over\cosh^2(\alpha x/2)}
       +{1\over2}\mu\omega^2(y-Cx)^2 ,
\]
the checked analytic reference integrates each line through the saddle only
to the stated \(V_0+22k_BT\) energy cutoff.  It scans the line orientation
and compares free energies relative to the paper's reference orientation.
The same test then exercises the rotation-only `PlaneOptimizer` through
`AnalyticSurfaceSampler` and `HyperplaneSampler`.

At \(T=0.01E_a/k_B\), the cutoff quadrature gives a low-angle maximum of
\(1.16954^\circ\); the paper quotes \(1.24^\circ\).  The test records that
measured discrepancy and does not weaken quadrature or manufacture the
published number.

PAFI and OH-TST answer different questions on this surface.  PAFI fixes a
reaction path \(X(s)\), samples planes normal to that path, estimates
\(dF/ds\), and integrates a one-dimensional potential of mean force.  It
does not rotate those planes.  OH-TST instead holds a candidate dividing
line through the saddle and varies its orientation to maximize its
constrained free energy.  The abrupt low-angle/high-angle branch switch is
therefore an OH-TST variational result; PAFI sees it only if a separately
chosen path supplies the corresponding family of plane normals.

## The constrained ensemble belongs to an MD engine

rgsaddle owns plane geometry and statistical estimators, not production
molecular dynamics.  `HyperplaneSampler` is the engine boundary.  Its input
is a `HyperplaneSampleBudget` containing \(k_BT\), seed, equilibration,
stride, record count, position-retention request, and an explicit coordinate
convention.  `MassWeighted` means \(q=M^{1/2}x\), with a Euclidean unit
normal.  `Cartesian` means the engine applies its configured masses when it
projects momenta and forces.

Each `HyperplaneObservation` reports the mechanical constraint force
\(-\nu^T\nabla V\), an optional complete PAFI gradient record, the PAFI
Jacobian term \(\psi\), an optional position, the force after constrained
directions have been removed, and any velocity component removed by the
integrator.  A general engine need only return positions and the unit-normal
constraint force for PAFI: rgsaddle derives \(\psi\) and the path-normal
scaling from the path geometry.  The complete PAFI record is used by the
analytic reference backend to retain its historical floating-point operation
order.  `HyperplaneEnsemble` adds engine force-call accounting and an
acceptance fraction.  PAFI and OH-TST consume these records; they compute
means, torques, Jacobian corrections, autocorrelation times, block errors,
and retained configurations without knowing the engine handle type.

`AnalyticSurfaceSampler<S: PointSurface>` is the named reference backend.
It keeps the existing projected BAOAB/GHMC dynamics for analytic-surface
tests only.  PAFI's historical overdamped analytic sampler also implements
the interface so its seeded bit dump remains unchanged.  Neither is the
production path.

### Restricted MD, curvature, and thermodynamic integration

Restricted molecular dynamics and proton-transfer thermodynamic integration
use the same boundary rather than a second constrained eigensolver or Gaussian
sampler.

For a plane with additional orthonormal constrained rows \(U\), define
\[
Q=I-\nu\nu^T-U^TU,\qquad H_{\cal H}v=QH(Qv).
\]
The implemented API is

```rust
Hyperplane::hessian_vector(
    surface: &impl PointSurface,
    vector: ArrayView1<f64>,
    constrained_rows: ArrayView2<f64>,
    config: &MinModeConfig,
) -> Result<Array1<f64>, SaddleError>;

Hyperplane::lowest_modes(
    surface: &impl PointSurface,
    constrained_rows: ArrayView2<f64>,
    count: usize,
    config: &MinModeConfig,
    ) -> Result<HyperplaneModes, SaddleError>;
```

Both calls are thin public entries to rgsaddle's existing
`PointSurface::hessian_vector` / finite-difference action and block-Lanczos
implementation.  They must project the trial vector before the action and
the result afterwards.  `HyperplaneModes` reports the shared workspace's
Hessian-action and finite-difference evaluation counts.  The analytic test
checks the restricted Ritz values and vectors against the exact projected
Hessian.

An `ExactGaussianPlaneSampler` implements `HyperplaneSampler` for a
quadratic model \(V(q)=V_c+g^T(q-c)+\tfrac12(q-c)^TH(q-c)\).  It obtains the
positive in-plane spectrum from `Hyperplane::lowest_modes`, draws independent
normal coordinates with variance \(k_BT/\lambda_i\), and reports the same
positions, normal constraint forces, projected forces, and Jacobian fields
as an MD engine.  Zero or negative free curvatures are typed model errors.

Thermodynamic integration uses
\[
V_\lambda=(1-\lambda)V_{\rm harmonic}+\lambda V_{\rm full},\qquad
{dF\over d\lambda}
=\left\langle V_{\rm full}-V_{\rm harmonic}\right\rangle_{\lambda,{\cal H}} .
\]
The sampler request has an extensible observable selector and each returned
record has named scalar observables.  The implemented estimator API is:

```rust
trait HyperplaneSampler {
    fn sample_hyperplane(
        &mut self,
        plane: &Hyperplane,
        budget: &HyperplaneSampleBudget,
    ) -> Result<HyperplaneEnsemble, SaddleError>;
}

fn thermodynamic_integration<E: HyperplaneSampler>(
    sampler: &mut E,
    plane: &Hyperplane,
    config: &ThermodynamicIntegrationConfig,
) -> Result<ThermodynamicIntegrationEstimate, SaddleError>;
```

The TI estimator selects Gauss-Legendre nodes, consumes the named
\(V_{\rm full}-V_{\rm harmonic}\) series, applies the same automated
equilibration and `block_mean` implementation as PAFI and OH-TST, and uses
independent per-node block errors.  Backend-specific Hamiltonian
interpolation remains behind the sampler.  The
`restricted_thermodynamic_integration` spelling documents the Amsel-style
fixed-plane MD/TI use: it does not optimize or move the chosen plane.

### Complete OH-TST workflow on engine traits

Amsel's Cu run demonstrates why a sampled plane factor must not be labelled
OH-TST by itself.  The complete path has three first-class operations:

```rust
optimize_plane(&mut impl HyperplaneSampler, initial, config)
    -> Result<PlaneOptimum, SaddleError>;
reversible_work(&mut impl HyperplaneSampler, path, config)
    -> Result<WorkEstimate, SaddleError>;
transmission_coefficient(&mut impl HyperplaneDynamics, plane, config)
    -> Result<TransmissionCoefficient, SaddleError>;
```

`optimize_plane` and `reversible_work` use repeated constrained ensembles and
depend only on `HyperplaneSampler`.  BAR and MBAR request optional arbitrary
configuration energies through the same engine trait.  The transmission coefficient
\(\kappa\) does not: it launches flux-weighted configurations from the plane
and propagates unconstrained trajectories to basin commitment.  A separate
`HyperplaneDynamics` engine trait exposes that shooting operation.
`AnalyticSurfaceDynamics` is the BAOAB/Newtonian analytic reference.
Pretending that `sample_hyperplane` can provide those operations would hide
the recrossing correction.  `ohtst_rate` combines the free-energy factor and
\(\kappa\) only when both typed results are present.

### Derived equilibration and drift rejection

`thermalize` (PAFI) and `burn_in` (OH-TST) are minimum engine warm-up floors,
not declarations that equilibrium has been reached.  After that floor the
estimator applies John D. Chodera, /A Simple Method for Automated
Equilibration Detection in Molecular Simulations/, /Journal of Chemical
Theory and Computation/ 12, 1799-1805 (2016),
doi:10.1021/acs.jctc.5b00784.  For every candidate discard \(t_0\), it
estimates the statistical inefficiency

\[
g(t_0)=\max(1,2\tau(t_0))
\]

and selects the tail maximizing

\[
N_{\mathrm{eff}}(t_0)={N-t_0\over g(t_0)}.
\]

The candidate scan is coarse-to-fine for bounded cost, followed by an exact
scan around the best coarse candidate.  PAFI applies it to the plane-gradient
series; OH-TST applies it to the constraint-force series.  Statistics are
then computed only from the selected tail.

A second, independent stationarity guard splits that tail in half.  It
requires

\[
\left|\bar f_1-\bar f_2\right|\le 4\sqrt{\mathrm{SE}_1^2+\mathrm{SE}_2^2},
\]

where each standard error comes from correlation-length block means.  The
factor four is a conservative four-sigma guard: it rejects visible drift
without treating an ordinary finite-sample fluctuation as failed
equilibration; a 32-ulp scale floor handles analytically constant series.
`EquilibrationReport` records the floor plus selected
discard, \(\tau\), \(N_{\mathrm{eff}}\), drift, error, threshold, and
pass/fail.  A failed guard returns `SaddleError::NotEquilibrated`; no plane
estimate is silently emitted.

### Production backends

- *LAMMPS through OmniPotentRPC/lammpc.* `LammpsHyperplaneSampler` loads the
  pinned rgpot potential profile and creates a lammpc session. lammpc's
  projected BAOAB stepper constrains \(\nu^T(q-p)=0\), projects force and
  velocity in the selected coordinate convention, thermostats tangent
  velocity, and restores the plane after each drift. It returns the scalar
  constraint force, removed velocity, position, projected force, and force
  call count. Hard-region enforcement remains pending the constrained-step
  callback capability described above. No LAMMPS class or pointer appears in
  the Rust trait.
- *OpenMM.*  The adapter may represent the signed plane coordinate with a
  `CustomCVForce` plus a constraint-force readback, or use a
  constraint-projection integrator.  It must expose the same scalar
  constraint force, projected velocity, positions, mass/unit convention,
  step budget, and seed mapping.  A penalty restraint without exact
  constraint-force recovery is not equivalent.
- *GROMACS.*  The adapter uses pull code configured for a plane coordinate,
  reached through the supported API.  It must return the pull constraint
  force, removed momentum or the Jacobian term, optional positions, units,
  masses, step/evaluation accounting, and seed mapping.  Text-log scraping
  is not an API.

The C ABI is callback based so the engine retains ownership:

```c
typedef struct rgsaddle_hyperplane_sampler rgsaddle_hyperplane_sampler;
typedef struct rgsaddle_hyperplane_budget rgsaddle_hyperplane_budget;
typedef struct rgsaddle_hyperplane_observation rgsaddle_hyperplane_observation;

typedef int32_t (*rgsaddle_sample_hyperplane_fn)(
    void *engine_context,
    const double *point,
    const double *unit_normal,
    size_t dimension,
    const rgsaddle_hyperplane_budget *budget,
    int32_t (*emit)(void *, const rgsaddle_hyperplane_observation *),
    void *emit_context);

int32_t rgsaddle_hyperplane_thermodynamic_integration(
    rgsaddle_hyperplane_sampler *, /* plane, config, output */);
```

The opaque sampler stores the callback, engine context, coordinate
convention, units, and masses.  The observation uses borrowed arrays valid
only during `emit`.  Construction, destruction, fixed-layout budget and
observation structs, and fixed-plane TI are implemented at ABI minor 42.
The Python binding presents the same operation as
`hyperplane_thermodynamic_integration` and calls a Python-owned sampler at
every Gauss-Legendre node.
The callback receives the plane point and normal, the coupling lambda, the
thermal energy, the seed, and the thermalize, stride, and sample counts, and
returns float64 C-contiguous observations of `V_full - V_harmonic`.
Callback bindings for plane optimization,
reversible work, PAFI profiles, and unconstrained shooting remain designed
but not implemented.

## Dimer, Lanczos, bands, and Sella are one operator family

For a unit direction \(u\), define

\[
P_u=I-uu^T,\qquad H_u=I-2uu^T=2P_u-I .
\]

`P_u` keeps the perpendicular component and `H_u` reflects the parallel
component.  NEB uses \(P_tF\) for the true force and the complementary
rank-one part for its spring force.  A climbing image uses \(H_tF\).
Dimer translation and Lanczos min-mode following use \(H_uF\) after their
different procedures have supplied \(u\).  The projection is identical;
only the source and update of the direction differ.

Sella equalities \(c(x)=0\) have Jacobian \(J\).  Their tangent projector is

\[
P_J=I-J^T(JJ^T)^+J .
\]

For one normalized row \(J=\nu^T\), \(P_J=P_\nu\).  Sella's
internal-coordinate constraints, a PAFI plane, an OH-TST plane, NEB
nudging, and min-mode force splitting are therefore rank-\(k\) members of
the same projector family.  Nonlinear Sella constraints differ only because
\(J(x)\) and the restoration retraction must be recomputed at each point.

The first shared code piece is deliberately small:

- `TangentProjector` owns force/vector projection.
- `ProjectedConstraint` adds level-set restoration.
- `Hyperplane` is shared by PAFI and OH-TST and retains PAFI's raw path
  derivative only for bitwise-stable projection.
- `HyperplaneSampler` is the engine-neutral constrained-ensemble boundary.
- `UnitNormal` retains the historical band/dimer/Lanczos arithmetic.
- `ManifoldTangent` binds any rgmin `Manifold`, including Sella's
  `Constraints`, at a point.
- PAFI, OH-TST, and `stencil::perp` use these shared implementations.

The checked-in before/after bit dump covers a seeded PAFI sample and the
unit-normal projector.  It is in addition to the existing PAFI, band,
min-mode, Sella, and rgmin manifold tests.

## Reproducing the OH-TST paper is a separate validation piece

The present change validates the implementation; it does not claim to
reproduce published numbers.  A reproduction of Jóhannesson and Jónsson requires all of the
following to be pinned in a separate validation directory:

1. the paper's Appendix-B potential and derivatives, parameters, reduced
   units, masses, and every reported temperature;
2. the initial saddle plane and the allowed position/orientation degrees of
   freedom for each model;
3. a converged line integral or constrained-sampling protocol for every
   trial plane, including domain truncation, quadrature tolerance or
   thermostat, friction, time step, equilibration, stride, and sample count;
4. the outer-plane stopping rule and the handling of the \(\nu\sim-\nu\)
   gauge;
5. reactant partition-function boundaries and the flux prefactor used to
   convert the optimized plane free energy to the OH-TST rate;
6. the dynamical transmission-coefficient definition, launch distribution,
   basin commitment rule, trajectory length, and recrossing convention when
   comparing corrected rates;
7. deterministic seeds plus raw per-plane force, torque, uncertainty, free
   energy, and rate outputs;
8. digitized paper tables/figures with provenance, units, and an explicit
   numerical acceptance tolerance chosen before the comparison.

Without those inputs, agreement with a plotted or rounded paper value is not
a reproducible test.

## Ranked remaining unification pieces

1. *Rank-\(k\) metric projector.* Move Sella's row-space orthogonalisation,
   held-mode projection, and OH-TST subspace projection behind one
   rank-revealing \(J\)-projector with Euclidean and diagonal-mass metrics.
   This removes the largest remaining duplication and must preserve the
   present rank threshold and operation order.
2. *Point-dependent constraint adapter.* Add a fallible constraint API that
   returns \(J(x)\), projects tangents, and restores a trial point.  Migrate
   Sella `Constraints` and then expose it as an rgmin manifold without
   swallowing shape or restoration errors.
3. *Shared Householder functions.* Express climbing image, dimer translation,
   Lanczos translation, and band perpendicular splitting through paired
   `project/reflect` functions while retaining each call site's current
   arithmetic and golden hashes.
4. *Additional production engine adapters.* Implement OpenMM and GROMACS
   against `HyperplaneSampler` and the C ABI contract above.
5. *Production callback bindings.* Complete callback-owned C and Python
   engine adapters for optimization, work, TI, and shooting without exposing
   an engine pointer to Rust.
6. *Paper reproduction suite.* Implement the eight pinned inputs above and
   compare paper observables only after independent quadrature references
   pass.

# Crystal operations and symmetry-unique regions (`docs/orgmode/explanation/symmetry-regions.org`)

> Crystal symmetry operations, path multiplicity, and hard Voronoi regions

## Construction

A host supplies three-dimensional orthogonal matrices, optional affine
translations or rotation centres, and reactant and saddle Cartesian
geometries.  An operation acts on an atom at \(x\) as

\[
x' = R(x-c)+c+t.
\]

The operation may also carry a source-to-target atom permutation.  When it
does not, rgsaddle matches transformed reactant atoms to reactant atoms of
the same species.  Periodic distances and the final unwrapping use
`minimage::Cell::displacement_euclidean`.  The implementation does not
duplicate a minimum-image convention.

This is a consumer API, not a space-group finder.  The host remains
responsible for supplying the candidate crystallographic operations.
The affine form and the distinction between point and space-group
operations follow the conventions in International Tables for
Crystallography, Volume A, edited by Theo Hahn, 5th edition (2005),
doi:10.1107/97809553602060000100.

## Path multiplicity and region degeneracy

Operations which map the reactant onto itself form the reactant stabilizer
\(H\).  Applied to the selected saddle, they produce an orbit.  The path
multiplicity is the number of distinct images

\[
m_{\rm path} = |H \cdot s| = {|H| \over |H_s|},
\]

where \(H_s\) is the joint stabilizer, the subgroup of \(H\) that also maps
that saddle to itself.  This is the orbit-stabilizer theorem; see
Jean-Pierre Serre, /Linear Representations of Finite Groups/, Springer
(1977), doi:10.1007/978-1-4684-9458-7.  \(m_{\rm path}\) is the number of
equivalent hops.  Callers pass it to `RateMultiplicity::with_paths`.  It is
not the degeneracy of the sampled cell.

\(H_s\) is the symmetry of one hop.  Each of its operations fixes the
reactant and the saddle, and therefore maps the dividing plane of that hop
onto itself.  The region degeneracy is the order \(|H_s|\).  The returned
`SymmetryUniqueRegion` is the asymmetric unit of that plane, the Dirichlet
cell of one generic in-plane point under \(H_s\), and `Region::degeneracy`
reports the same order.  Faces lie in the plane.  Sampling the cell and
multiplying by \(|H_s|\) restores the full plane of that one hop.
Multiplying again by \(m_{\rm path}\) counts the other hops.

Jóhannesson and Jónsson, /Optimization of hyperplanar transition states/,
/The Journal of Chemical Physics/ 115, 9644-9656 (2001),
doi:10.1063/1.1415499, build this kind of restricted sample in Sec. II D
("Incorporation of symmetry").  For an \(n\)-fold axis, half-lines start at
the reactant minimum and run toward each symmetry-equivalent product.  The
sample is kept in the sector of one product: a step that comes closer to
another half-line is rejected and the velocity is reflected in the mirror
that exchanges the two product directions.  Their Eqs. 13-17 remove the
part of that mirror normal parallel to the hyperplane normal, so the
reflection stays in the plane.  Sec. III D ("Al adatom diffusion on
Al(100)") uses the fourfold form of this construction for every thermal
sample.  Without the constraint, the optimized hyperplane was an average of
two symmetrically equivalent concerted-displacement channels.

An identity-only group has path multiplicity one, region degeneracy one,
and no faces.  The full octahedral stabilizer of an fcc vacancy sends one
nearest-neighbour hop to twelve images.  Those twelve are the path
multiplicity.  The region degeneracy is \(|H_s|\) for that hop, the
operations that fix both the vacancy reactant and the chosen saddle.

## Validation and tolerances

The constructor rejects non-finite data, non-orthogonal matrices,
non-bijective permutations, and permutations that map unlike species.
Operations that are valid group operations but do not stabilize the
particular reactant are omitted from \(H\).  Matching, orbit, and
orthogonality tolerances are explicit fields of
`CrystalSymmetryConfig`.  Callers should choose them for their coordinate
units and structure accuracy instead of relying on a hidden physical
tolerance.

For periodic cells the nearest-image displacement is the standard
simulation-cell convention described by Daan Frenkel and Berend Smit,
/Understanding Molecular Simulation/, 2nd edition, Academic Press (2002),
doi:10.1016/B978-0-12-267351-1.X5000-7.

# Translation rotation internal coordinates with splicing (`docs/orgmode/explanation/trics.org`)

> Translation-rotation internal coordinates, stability diagnostic maze, and segment splicing

TRICS constructs a molecular path in internal coordinates while changing
coordinate systems before an angle or dihedral becomes singular.  The method
is due to Park, Song, and Wang.  The implementation follows the algorithmic
ideas in the BSD licensed geomeTRIC reference implementation without
including its source.

## Translation rotation internal coordinates
For a fragment, the primitive vector \(p(x)\) contains bond distances,
angles, dihedrals, three mean translations, and three rotations relative to
the reference geometry.  Its Wilson matrix and metric are

\[
B_p = \frac{\partial p}{\partial x}, \qquad G_p = B_p B_p^{\mathsf T}.
\]

Let \(U\) contain the eigenvectors of \(G_p\) whose eigenvalues pass the
configured absolute rank threshold.  The nonredundant TRIC coordinates and
their Wilson matrix are

\[
q = U^{\mathsf T}p, \qquad B_q = U^{\mathsf T}B_p.
\]

The translation and rotation coordinates keep disconnected fragments in the
same coordinate construction.  Fragment rotations are scaled by the
fragment radius of gyration.  Ordinary angles switch to two linear bend
directions at 155 degrees, matching the angular warning threshold.  Out of
plane primitives complete suitable three connected centers.

Bonds extended through every linear angle at either end form atom lines.  A
torsion about a line is a dihedral whose two central atoms lie on the line
and whose terminal atoms are bonded off it, so the twist of an allene is
carried across its linear center.  No dihedral is built with a linear angle,
and a line with no atoms bonded off both ends, such as acetylene, carries no
dihedral at all.

## Stability diagnostic
A separate TRIC system \(Q_i\) is built at each initial image \(x_i\).  The
diagnostic matrix evaluates each system on every image,

\[
D_{ij} = \max_{\alpha \in Q_i} d_\alpha(x_j).
\]

Here \(d_\alpha\) is zero for a regular primitive, one for a warning, two for
an unstable angular primitive, and three or above for imminent failure.
Distances, translations, and rotations are regular unless their geometry is
invalid.  Dihedrals use adjacent angle boundaries of 155, 165, and 175
degrees.  Linear bends use absolute cosine boundaries of 0.8, 0.6, and 0.4.
Out of plane coordinates use 0.95, 0.98, and 0.99 for each adjacent angle
and add the two scores, so their diagnostic can reach six.

Entries at or below `diagnostic_threshold` form an internal coordinate maze.
The selection prunes dead ends, drives square cars from both the left and
right edges, minimizes the number of segments, and then chooses the largest
successful car.  The splice width is the next even integer nearest one tenth
of the image count, bounded from two through six.  Short segments are merged
before each segment is expanded by half that width.  A segment is
interpolated only in a coordinate system whose diagnostic stays at or below
`diagnostic_threshold` on every image of the expanded segment, so a threshold
of zero or one never admits a level two system.

## Segment interpolation and inversion
Inside one stable interval, the internal displacement is divided uniformly,

\[
q(t_k) = q(0) + t_k\Delta q,\qquad
t_k = \frac{k}{n-1}.
\]

Each image is recovered iteratively.  With internal residual \(r\), one
Cartesian update is

\[
\Delta x = B_q^{\mathsf T}
           (B_q B_q^{\mathsf T})^{-1}r.
\]

The largest atom move is bounded by `TricInversionConfig::max_atom_move`.
An update that increases the residual, or that lands where a primitive or
its Wilson row is singular, is rejected and retried at half damping.
Accepted updates increase damping by a factor of 1.2 up to one.  Five
consecutive rejected updates, a damped step below tolerance, or reaching the
iteration cap above tolerance returns a solver error.  A start geometry or
segment endpoint at which the system is singular is also a solver error,
as is a diagnostic maze with no stable route.
Following the reference implementation, the aligned Cartesian endpoint must
be within 0.01 Angstrom.  The implementation tries the reverse direction and
alternate stable coordinate systems when a candidate does not converge.

## Splicing and concatenation
Write \(\chi_s(x_a,x_b,t_a,t_b;t)\) for interpolation at \(t\) in segment
system \(s\).  For two overlapping segments, their endpoint iteration is

\[
x_a \leftarrow \chi_1(x_b,x_1,t_b,1;t_a), \qquad
x_b \leftarrow \chi_0(x_0,x_a,0,t_a;t_b).
\]

For splice width \(L\), the paired Cartesian geometries are the left
segment's \(-L\) and \(-1\) images and the right segment's 0 and \(L-1\)
images.  All neighboring pairs are updated from the preceding iteration.
Splice damping starts at one, decreases by a factor of 0.8 to a floor of 0.2
after a nondecreasing mismatch, and resets to one after three decreases.
Iteration stops when the maximum Cartesian displacement of any atom between
overlapping segment endpoints is at most
`TricsConfig::splice_tolerance`.  Its default is
`TRICS_SPLICE_TOLERANCE_ANGSTROM`, \(1.8\times10^{-3}\) Angstrom.

The final path takes images from the left segment up to the midpoint of each
overlap and from the right segment after it.  If one system is stable across
the whole path, TRICS interpolates once and skips the splice iteration.
Three images split into two segments of two images that share the middle
image.  Neither segment has an interior image to place, so TRICS returns
`SaddleError::Solver` (`RGSADDLE_SOLVER` from C) and does not return the
unrefined path.  A path of four or more images still splices, because its
segments then overlap by two images.

The coordinate construction is kept in `rgsaddle::trics` behind an
engine-independent Cartesian boundary.  It can therefore serve future
geometry optimizers without coupling `rgsaddle` to a potential engine or
changing `rgmin`.

## Length unit
Every absolute length threshold is stated in angstrom: the splice tolerance,
the inversion move cap and residual, and the 0.01 Angstrom endpoint agreement
above.  `TricsConfig::length_per_angstrom` is the length of one angstrom in
the caller's coordinates (1 by default, 0.1 for nanometres, about 1.8897 for
bohr).  `trics_path` divides the path by it before the work and multiplies
the result by it afterwards, and returns the first and last image exactly as
given, so a path in any unit needs only that one option.  The finite
difference step of the primitive derivatives is a fraction of the size of the
atoms it moves and does not depend on the unit.  The Kabsch rotation inside
the rotation coordinates treats two eigenvalues as equal when they differ by
a fixed fraction of the largest, so it does not depend on the unit either.

# Elastic dipoles and periodic images (`docs/orgmode/explanation/elastic-dipole.org`)

> Finite-cell elastic dipole correction for periodic images, and the benchmark row labels

## Dipole of a relaxed defect
The sign convention is the one of Varvenne and Clouet, Phys. Rev. B 96, 224103 (2017), doi:10.1103/PhysRevB.96.224103: a dipole \(P\) in an imposed strain has energy \(-P:\epsilon\).  For a fixed periodic cell,

```text
P = -V (sigma_defect - sigma_bulk).
```

`ElasticDipole::from_stress` applies that residual-stress formula and symmetrizes the result.  `ElasticDipole::from_energy_strain_gradient` accepts the two homogeneous-strain energy gradients directly, \(P=-(dE_defect/d\epsilon-dE_bulk/d\epsilon)\).  `ElasticDipole::from_forces` computes the symmetric first moment of equilibrated Kanzaki forces.  It refuses a force set with a resultant or torque above its scale-dependent roundoff allowance.  These three routes and the perfect-cell stress subtraction are reviewed by Clouet, Varvenne, and Jourdan, Comput. Mater. Sci. 147, 49 (2018), doi:10.1016/j.commatsci.2018.01.053.

The potential is not part of these types.  A host evaluates the relaxed bulk and defect configurations with rgpot, obtains stress (or homogeneous-strain derivatives) from rgpot strain requests, and passes the results to rgsaddle.  Atomic geometry remains in `linkcell::Cell`; its re-exported minimage displacement is used for the defect separation.  No second neighbour list or minimum-image convention is hidden in the elastic layer.

## Anisotropic Green function
`ElasticConstants` accepts a full \(C_{ijkl}\), conventional Voigt \(C_{IJ}\), cubic \(C_{11},C_{12},C_{44}\), or isotropic Lamé constants.  It checks elastic symmetries and the acoustic tensor.  `AnisotropicGreen` evaluates Barnett's half-circle integral and Barnett's analytic second derivative, D. M. Barnett, Phys. Status Solidi B 49, 741 (1972), doi:10.1002/pssb.2220490238.  There is no finite-difference fallback.

For separation \(r\), source \(P^a\), and target \(P^b\), the interaction is

```text
E_ab = P^b_ij G_ik,jl(r) P^a_kl.
```

The periodic trapezoid rule is evaluated on nested angular meshes.
Their difference is the angular error estimate.
The isotropic test compares the dipole interaction with Kelvin's closed form result.
The cubic test uses the exact `[100]` result of Dederichs and Leibfried, Phys. Rev. 188, 1175 (1969), doi:10.1103/PhysRev.188.1175: \(G_{xx,xx}=1/(2 pi C_{44}r^3)\), while choosing constants that are not isotropic.

## Periodic correction
The \(1/r^3\) image sum is conditionally convergent.  `PeriodicElastic` fixes its order by growing Cartesian spheres, as required when applying the periodic image correction of Varvenne, Bruneval, Marinica, and Clouet, Phys. Rev. B 88, 134102 (2013), doi:10.1103/PhysRevB.88.134102.  It reports the change on removing the outer sphere plus both nested angular errors.  For a pair,

```text
correction = E_infinite - E_periodic_images
E_corrected = E_atomistic_periodic + correction.
```

`correct_energy` handles one pair state, `correct_landscape` maps a whole energy landscape, and `correct_rate_catalogue` applies the reactant and saddle corrections before rebuilding the harmonic rate.  Every result carries an absolute error estimate.  The periodic energy includes the cross interaction with every image and one half of each defect's interaction with its own nonzero images.  Consequently a barrier remains correct when a defect dipole changes between the reactant and saddle states.

The smoke cell-size test synthesizes the atomistic long-range contribution from the same periodic sum, then verifies that adding the correction removes its cell drift for several separations and box lengths.
The full copper job is driven by `scripts/benchmark-elastic-dipole.sh`.
It builds the defect-pair catalogue once, runs the network volume calculation for every size in `RGSADDLE_REPEATS`, and records the vector-return and vector-dipole \(V_{iv}\) estimators as separate rows.
Both rows carry the vector- and orientation-resolved dipole bias on every hop of the same per-vector network.
The vector-return row sends a hop past the cutoff back to its source through the return layer of the lumped model.
The vector-dipole row matches the network to the field-free crystal outside the cutoff.
Neither row is uncorrected: the run without the dipole interaction is the no-strain-bias row of `benchmarks/defect_pair_run13_volume.csv`.

## Copper reference status
The opt-in Mishin Cu EAM test uses a reference supercell with 2048 lattice sites by default, relaxes a vacancy and a `[100]` dumbbell, derives their dipoles from the residual stress, and records finite symmetric tensors.
No published tensor for those two defects using exactly the 2001 Mishin parameterization and this fixed-cell convention was identified, so the test does not assert an unrelated potential's numbers.
Mishin et al., Phys. Rev. B 63, 224106 (2001), doi:10.1103/PhysRevB.63.224106, report defect energetics and elastic constants, not these residual-stress dipole tensors.

# Architecture (`docs/orgmode/reference/architecture.org`)

> Crate architecture and module boundaries

The host supplies the potential surface and owns the outer search loop. rgsaddle supplies band force assembly, minimum-mode rotation, restricted index-1 steps, Sella sessions, intrinsic reaction coordinate integration and molecular dynamics mechanics.

Band and minimum-mode translation use rgmin's solver. Dense quadratic restriction is available through `rgsaddle::trust`, which re-exports rgmin's dense controller. The root `rgsaddle::TrustRegion` accepts a spectrum for Sella steps. The projected band trust method is implemented by `BandRtr`.

`PointSurface` accepts one coordinate vector. `BandSurface` accepts a collection of images. The C callback expresses either request with the same official structure. The library has no Message Passing Interface (MPI) dependency; a host can evaluate a request collectively or distribute image work itself.

Hessian storage and updates live in `pes` and `qn`. `linalg` supplies numerical actions and cached direction/action pairs. `eigensolve` supplies dense and iterative eigenproblems. `sparse_hessian` builds a cutoff Hessian by a direct Curtis-Powell-Reid partition of a distance-2 colouring and implements `ApplyHessian`. Molecular topology enters through `vocn` and the equality chart. Periodic differences use linkcell.

# LAMMPS hyperplane API (`docs/orgmode/reference/lammps-hyperplane.org`)

> LAMMPS hyperplane sampler contract and C ABI hooks

## Cargo feature

`lammps` is opt-in and enables `ohtst`. It adds the pinned
`rgpot-core` profile dependency. `liblammpc` and `liblammps` are runtime
shared libraries and are not needed by default builds.

## Public types

| Type | Contract |
| --- | --- |
| `LammpsSystem` | Flat `PotentialConfig`, Cartesian positions, atomic numbers, masses, and optional cell |
| `LammpsSamplerConfig` | Shared library path, BAOAB time step in ps, Langevin friction in inverse ps, thermostat kind, the excluded-mode count used in \(3N - 1 - n_{\mathrm{excluded}}\), and an optional Taylor reference for lambda mixing |
| `LammpsThermodynamicReference` | Reference geometry, energy, gradient, and dense Hessian in the sampler coordinates of the plane |
| `LammpsThermostatKind` | Thermostat enum stored in records; currently `BaoabLangevin` |
| `LammpsThermostatRecord` | Serializable thermostat metadata with `thermostat` and `effective_degrees_of_freedom` |
| `LammpsHyperplaneSampler` | Persistent lammpc session implementing `HyperplaneSampler` |

All configuration structs are `#[non_exhaustive]`, implement `Default`, and
provide `with_*` builders. A default system is incomplete and validation
returns `SaddleError::Invalid` or `SaddleError::Shape` before loading the
engine.

## Units and coordinates

The rgpot `ForceInput` uses angstrom and eV. LAMMPS uses `metal` units.
The sampler controls use:

| Quantity | Unit |
| --- | --- |
| time step | ps |
| friction | ps^-1 |
| thermal energy | eV |
| mass | amu |

`HyperplaneCoordinates::MassWeighted` passes the plane in
\(q=M^{1/2}x\). Returned positions are \(q\), forces are
\(F_q=M^{-1/2}F_x\), and velocities are \(\dot q=M^{1/2}\dot x\).

`HyperplaneCoordinates::Cartesian` passes Cartesian point and normal. lammpc
uses the diagonal mass metric when restoring positions and projecting
velocity and force.

## Thermostat metadata and records

Each `HyperplaneObservation` from `LammpsHyperplaneSampler` carries two stable
scalar observables:

| Observable | Meaning |
| --- | --- |
| `lammps.thermostat` | Numeric code of `LammpsThermostatKind` (1 for `BaoabLangevin`) |
| `lammps.effective_degrees_of_freedom` | \(3N - 1 - n_{\mathrm{excluded}}\) |

`LammpsThermostatRecord::to_json` writes
`rgsaddle.lammps_thermostat` documents, and `from_json` reads the same
format.

## lammpc constrained MD extension

The adapter requires these additive C ABI functions:

```c
int lammpc_session_md_initialize(...);
int lammpc_session_md_step(LammpcSession *, size_t);
int lammpc_session_md_state(...);
```

`md_initialize` receives one rgpot `ForceInput`, a point, a normal, and
`LammpcMdConfig`. `md_step` advances exactly the requested number of BAOAB
steps. `md_state` returns positions, projected forces, removed velocities,
the scalar constraint force, the force-evaluation count, and the completed
step count.

LAMMPS hard-region sampling additionally requires lammpc to advertise that
`md_step` applies a registered hard-boundary callback, restores the complete
accepted state on rejection, and refreshes projected forces after reflection.
The callback registration symbols alone do not establish this behavior.
Current lammpc main does not provide it, so the adapter fails closed for a
sampling budget with a region.

The extension is generic. It does not contain an OH-TST, PAFI, pair-style,
or material type. rgsaddle maps those arrays into `HyperplaneObservation`.

## Thermodynamic integration coupling

When `HyperplaneSampleBudget::lambda` is set, `LammpsHyperplaneSampler`
requires `LammpsSamplerConfig::thermodynamic_reference`: a Taylor harmonic
model stored as reference geometry, energy, gradient, and dense Hessian in
the sampler coordinates of the plane. Those are the coordinates selected by
`HyperplaneSampleBudget::coordinates` and passed to `md_initialize`.

Until lammpc exposes a mixing hook, lambda sampling fails with a surface
error. The additive ABI is:

```c
typedef struct {
  double lambda;
  double reference_energy;
} lammpc_md_thermodynamic_coupling_t;

int lammpc_session_md_set_thermodynamic_coupling(
    LammpcSession *session,
    const lammpc_md_thermodynamic_coupling_t *coupling,
    const double *reference_point,
    const double *reference_gradient,
    const double *reference_hessian,
    size_t dimension);
```

`reference_point`, `reference_gradient`, and `reference_hessian` are in the
sampler frame. The Hessian is passed already symmetrized. Each MD step adds
`(1-lambda) F_harmonic` in that frame, with
`F_harmonic = -(g_0 + H (x - x_0))`, and the engine converts that force to
the Cartesian LAMMPS force with the same mass metric it uses for the
constraint. The hook is not tied to a pair style or a material.

The observable also needs the unmixed full potential. A missing symbol is a
surface error when lambda is set:

```c
int lammpc_session_md_potential_energy(
    LammpcSession *session,
    const double *position,
    size_t dimension,
    double *energy);
```

`position` is the Cartesian geometry returned by `md_state`. The scalar
energy is frame invariant. rgsaddle evaluates `V_harm` itself at the
sampler-frame image of that geometry, including the mass-weighted scaling
`q = M^{1/2} x` when the budget asks for mass-weighted coordinates.

## Errors

Library lookup follows rgpot's `lammpc` profile candidates. An explicit path
has priority, followed by `LAMMPC_LIBRARY`, `RGPOT_LAMMPC_ENGINE`, and
platform library names. Missing symbols, an unavailable stub build, ABI
mismatch, invalid geometry, and LAMMPS failures become
`SaddleError::Surface` with lammpc's diagnostic.

# Bibliography (`docs/orgmode/reference/bibliography.org`)

> Literature bibliography

The method references are stored in `docs/source/references.bib`.

# C function index (`docs/orgmode/reference/c-symbols.org`)

> Complete C ABI symbol index for include/rgsaddle.h

Every function, type, macro, and enum constant declared in `include/rgsaddle.h`.
The sentence is the comment above the declaration.
Parameters are that declaration.
Units are the caller's unless the sentence names them.
The narrative for a session is the C and C++ how-to, not this list.

## Functions

- `rgsaddle_hyperplane_sampler_create`. Purpose: Create a callback sampler. Parameters: the declaration. Units: the caller's.
- `rgsaddle_hyperplane_sampler_free`. Purpose: Free a callback sampler. Parameters: the declaration. Units: the caller's.
- `rgsaddle_hyperplane_thermodynamic_integration`. Purpose: Integrate V_full - V_harmonic over lambda on a fixed hyperplane. Parameters: the declaration. Units: the caller's.
- `rgsaddle_thermodynamic_derivative_observable`. Purpose: Stable observable name `potential.full_minus_harmonic` for TI records. Parameters: the declaration. Units: the caller's.
- `rgsaddle_abi_version`. Purpose: (major << 16) | minor. Parameters: the declaration. Units: the caller's.
- `rgsaddle_abi_stamp`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_status_name`. Purpose: Human-readable name for a status code. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_create`. Purpose: Create a band session over n_images x (3 * n_atoms) positions, copied in. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_create_solid`. Purpose: Band with one cell per image. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_step_solid`. Purpose: One optimizer step of a band from rgsaddle_band_create_solid: atoms and interior cells move together, endpoint cells stay. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_quickmin_variant`. Purpose: Select the quick-min variant of a band made with RGSADDLE_METHOD_QUICKMIN; the velocity and time step restart. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_time_step`. Purpose: Initial time step of FIRE and quick-min (rgmin Control::istep, 1 at create); RGSADDLE_QUICKMIN_EON keeps it fixed. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_cells`. Purpose: Copy the band's cells out (n_images * 9 doubles). Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_solid_jacobian`. Purpose: The fixed Jacobian J = (V/N)^(1/3) sqrt(N) weight, V the mean endpoint volume: the length unit of the cell block. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_step`. Purpose: One optimizer step over the assembled band force. Parameters: the declaration. Units: the caller's.
- `xts_band_step`. Purpose: xtsci name of rgsaddle_band_step. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_positions`. Purpose: Copy the current band out (n_images * 3 * n_atoms doubles). Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_positions`. Purpose: Replace the band; the host may move images between steps. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_reset`. Purpose: Surface boundary: drop optimizer history, climbing state, the endpoint energies, and the last evaluation. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_restart`. Purpose: Optimizer restart on the same surface (after a reparameterization or a host policy reset): drop optimizer history and climbing state, keep the endpoint energies and the last evaluation. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_evaluation`. Purpose: The last evaluation, when it was taken at the current band (after a step, it is the accepted point). Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_project`. Purpose: Project an already evaluated band. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_project_fixed`. Purpose: rgsaddle_band_project with a per-atom fixed mask, ABI minor 39. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_create`. Purpose: Create a minimum-mode session at one geometry with an initial mode estimate; both are 3 * n_atoms doubles, copied in. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_step`. Purpose: Refresh the lowest mode, invert along it, take one step. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_estimate`. Purpose: Refresh the lowest mode without translating. Parameters: the declaration. Units: the caller's.
- `xts_minmode_estimate`. Purpose: xtsci name of rgsaddle_minmode_estimate. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_position`. Purpose: Move the session to a new point (3 * n_atoms doubles). Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_mode`. Purpose: Replace the mode seed (3 * n_atoms doubles, normalized on entry) and clear dimer rotational history and carried Lanczos curvature. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_mode`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_reset`. Purpose: Clear optimizer/rotation history, carried curvature, and the centre cache. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pafi_create`. Purpose: Create a PAFI session from path frames. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pafi_set_config`. Purpose: Replace the PAFI configuration between runs. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pafi_run`. Purpose: Run PAFI and store the profile in the session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pafi_result`. Purpose: Read the last PAFI barrier summary. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pafi_profile`. Purpose: Read the full stored profile. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pafi_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ohtst_create`. Purpose: Create an OH-TST session on one dividing plane. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ohtst_set_config`. Purpose: Replace the OH-TST configuration between runs. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ohtst_run`. Purpose: Sample the plane, run transmission shooting, and store the result. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ohtst_result`. Purpose: Read the last OH-TST transmission summary. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ohtst_curve`. Purpose: Read the stored κ(t) curve. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ohtst_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_nichols_step`. Purpose: Nichols displacement from a spectrum of the mass-weighted energy Hessian. Parameters: the declaration. Units: the caller's.
- `rgsaddle_prfo_step`. Purpose: Restricted-step partitioned RFO. Parameters: the declaration. Units: the caller's.
- `rgsaddle_hessian_powell`. Purpose: Powell symmetric Broyden update of a Cartesian energy Hessian. Parameters: the declaration. Units: the caller's.
- `rgsaddle_hessian_bofill`. Purpose: Bofill mix of the Powell update and the symmetric rank-one term. Parameters: the declaration. Units: the caller's.
- `rgsaddle_halve_raised_energy`. Purpose: Step length after comparing a trial energy with the energy before the step. Parameters: the declaration. Units: the caller's.
- `rgsaddle_trust_update`. Purpose: Trust radius after a predicted energy change and the change that occurred. Parameters: the declaration. Units: the caller's.
- `rgsaddle_reparametrize`. Purpose: ABI minor 38. Parameters: the declaration. Units: the caller's.
- `rgsaddle_spline_resample`. Purpose: ABI minor 70. Parameters: the declaration. Units: the caller's.
- `rgsaddle_cap_max_abs`. Purpose: Scale `step` so its largest absolute entry equals `trust_radius`. Parameters: the declaration. Units: the caller's.
- `rgsaddle_index1_create`. Purpose: Index-1 session over one geometry of `3 * n_atoms` coordinates. Parameters: the declaration. Units: the caller's.
- `rgsaddle_index1_step`. Purpose: One Nichols step, trust cap, and Hessian update. Parameters: the declaration. Units: the caller's.
- `rgsaddle_index1_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_index1_hessian`. Purpose: Copies the Cartesian Hessian. Parameters: the declaration. Units: the caller's.
- `rgsaddle_index1_reset`. Purpose: Drop the Hessian and the gradient cache at a surface boundary. Parameters: the declaration. Units: the caller's.
- `rgsaddle_index1_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_force_gate_name`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_energy_weighted_spring_ks`. Purpose: Energy-weighted spring constants (Asgeirsson et al. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_force_gate`. Purpose: Defaults remain LINF. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_force_gate`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_kappa_config_default`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_kappa`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_kappa_dimer_force`. Purpose: Inputs and outputs do not overlap. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_create`. Purpose: Create an IRC session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_create_from_surface`. Purpose: Same, but the launch mode is the lowest eigenvector of the mass-weighted Hessian, from Lanczos on the host surface. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_step`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_set_direction`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_set_lengths`. Purpose: Set the kick and the adaptive Morokuma bounds. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_reset`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_irc_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_create`. Purpose: Create a Sella minimum session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_create_on`. Purpose: Same, retracting on a live Constraints chart. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_create_internal`. Purpose: Same, QN in the internals chart (Sella InternalPES). Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_create_cell`. Purpose: QN in packed [x; cell_params]. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_create_cell_internal`. Purpose: Packed [q_int; cell_params]. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_step`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_reset`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_set_hess_update`. Purpose: `update` is 0 = BFGS, 1 = TS-BFGS. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_set_restricted`. Purpose: `restricted` is 0 = TrustRegion, 1 = MaxInternalStep, 2 = RestrictedAtomicStep. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_set_cell_chart`. Purpose: `chart` is 0 = entries, 1 = log-deform. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_maybe_niggli`. Purpose: Niggli-reduce a cell session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_min_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_create`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_create_on`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_create_internal`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_create_cell`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_create_cell_internal`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_step`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_reset`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_seed_mode`. Purpose: Seed a Cartesian session's Hessian with a 3N mode and its curvature. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_set_hess_update`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_set_restricted`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_maybe_niggli`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_set_expand`. Purpose: `expand` is ExpandKind: 0 lanczos, 1 gd, 2 jd0, 3 jd0_alt, 4 mjd0, 5 mjd0_alt. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_set_symmetrized_ritz`. Purpose: ABI minor 24. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_set_small_system_atom_ceiling`. Purpose: ABI minor 25. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sella_saddle_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_constraints_create`. Purpose: Create an empty Constraints chart on n_atoms. Parameters: the declaration. Units: the caller's.
- `rgsaddle_constraints_fix_com`. Purpose: Fix the fragment COM on every axis. Parameters: the declaration. Units: the caller's.
- `rgsaddle_constraints_fix_bond`. Purpose: Fix a bond between atoms `i` and `j`. Parameters: the declaration. Units: the caller's.
- `rgsaddle_constraints_residual_norm`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_constraints_project`. Purpose: Project `v` onto ker(J) at `x`. Parameters: the declaration. Units: the caller's.
- `rgsaddle_constraints_retract`. Purpose: Retract `x` along `v` and restore onto the level set. Parameters: the declaration. Units: the caller's.
- `rgsaddle_constraints_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_create`. Purpose: Cartesian PES (Sella peswrapper.PES). Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_kick`. Purpose: `d` is 3N. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_set_hess_update`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_project`. Purpose: Project `v` onto ker(J) at the living position. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_retract`. Purpose: Retract along `v` and restore onto the trans/rot set. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_transport`. Purpose: Transport `v` from the living point to `x_to`. Parameters: the declaration. Units: the caller's.
- `rgsaddle_pes_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_create`. Purpose: InternalPES over a Constraints chart. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_create_dummies`. Purpose: Same, with `n_dummy` extra 3-vectors. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_create_from_find`. Purpose: InternalPES from a vocn auto-find primitive set. Parameters: the declaration. Units: the caller's.
- `rgsaddle_place_perp_dummy`. Purpose: Dummy 1 Å off the i-j bond. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_n_int`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_internals`. Purpose: `out` holds n_int doubles. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_kick`. Purpose: `dq` is n_int. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_set_hess_update`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_grad`. Purpose: `g_cart` and `out` are 3N and n_int. Parameters: the declaration. Units: the caller's.
- `rgsaddle_internal_pes_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_niggli_reduce`. Purpose: Niggli-reduce a row-major 3x3 cell in place when any angle is more than `angle_threshold` degrees from 90. Parameters: the declaration. Units: the caller's.
- `rgsaddle_samd_create`. Purpose: Create a SAMD session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_samd_step`. Purpose: One BDP step. Parameters: the declaration. Units: the caller's.
- `rgsaddle_samd_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_samd_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_idpp_path`. Purpose: Image dependent pair potential initial path. Parameters: the declaration. Units: the caller's.
- `rgsaddle_autoneb_run`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_trics_path`. Purpose: Translation rotation internal coordinates with splicing, ABI minor 66. Parameters: the declaration. Units: the caller's.
- `rgsaddle_idpp_fixed_path`. Purpose: IDPP initial path with a frozen atom mask, ABI minor 71. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sidpp_alternating_path`. Purpose: Sequential IDPP initial path grown from both ends, ABI minor 71. Parameters: the declaration. Units: the caller's.
- `rgsaddle_sidpp_alternating_inverse_distance_path`. Purpose: Sequential path with inverse distance targets and a final pull, ABI minor 71. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ocineb_create`. Purpose: Climbing-image band that hands the climbing image to a min-mode climb. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ocineb_step`. Purpose: One band step, one alignment, or one P-RFO climb step. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ocineb_positions`. Purpose: Copy the current band out (n_images * 3 * n_atoms doubles). Parameters: the declaration. Units: the caller's.
- `rgsaddle_ocineb_reset`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ocineb_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_highs`. Purpose: Select the optional HiGHS feasible-set step. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_highs`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_torque_window`. Purpose: ABI minor 32. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_rotation_stop_length`. Purpose: ABI minor 38. Parameters: the declaration. Units: the caller's.
- `rgsaddle_artn_config_default`. Purpose: ABI minor 43. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_artn`. Purpose: ABI minor 43. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_exp_precon`. Purpose: Per-image exponential metric (Packwood et al. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_fixed_atoms`. Purpose: Per-atom fixed mask shared by every image, ABI minor 39. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_zoom`. Purpose: Zoom-NEB, eOn's zoom_* keys. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_string`. Purpose: Select the simplified string method on the band, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_dynamic`. Purpose: Select dynamic NEB on the band, ABI minor 65. Parameters: the declaration. Units: the caller's.
- `rgsaddle_dyneb_mask`. Purpose: ASE 3.29 DyNEB mask, ABI minor 65. Parameters: the declaration. Units: the caller's.
- `rgsaddle_last_error`. Purpose: Diagnostic for the calling thread. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_config_new`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_config_set_f64`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_config_set_i64`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_config_set_array`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_config_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_new`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_step`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_run`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_positions`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_query`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_stencil_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_create`. Purpose: Create an index-k session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_step`. Purpose: One index-k step. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_step_at`. Purpose: rgsaddle_indexk_step with a geometry-aware Hessian action, ABI minor 69. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_modes`. Purpose: Writes n-by-k row-major modes and k curvatures. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_translated`. Purpose: The effective gradient of the last successful step, length 3 * n_atoms. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_set_position`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_indexk_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_reflect_force`. Purpose: Householder reflection of force through an orthonormal n-by-k block. Parameters: the declaration. Units: the caller's.
- `rgsaddle_connect`. Purpose: Run the connect search. Parameters: the declaration. Units: the caller's.
- `rgsaddle_saddle_check_default`. Purpose: Fill out with the default saddle check, ABI minor 40. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_saddle_check`. Purpose: Replace the band's saddle check between steps, ABI minor 40; NULL turns it off. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_saddle_index`. Purpose: The certificate of the climbing image at its current position, ABI minor 40. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_set_saddle_check`. Purpose: rgsaddle_band_set_saddle_check for a min-mode session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_minmode_saddle_index`. Purpose: rgsaddle_band_saddle_index for a min-mode session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ocineb_set_saddle_check`. Purpose: rgsaddle_band_set_saddle_check for an OCI-NEB session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_ocineb_saddle_index`. Purpose: rgsaddle_band_saddle_index for an OCI-NEB session. Parameters: the declaration. Units: the caller's.
- `rgsaddle_saddle_index`. Purpose: Certify one point, ABI minor 40. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_config_default`. Purpose: Fill out with the default growing-string controls (n_images 11, frontier_tol 0.2, min_steps_per_node 1, not-a-knot spline), ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_create`. Purpose: Open a growing string session between reactant and product (3 * n_atoms values each), ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_step`. Purpose: Advance a growing string session by one step (or one simplified-string step once joined), ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_n_images`. Purpose: Active image count of a growing string session (left_nodes + right_nodes while growing, n_images once joined), or 0 for NULL, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_nodes_added`. Purpose: Nodes the last rgsaddle_growing_string_step grew on the reactant and product fragments (0, 1, or 2), or 0 for NULL and before the first step, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_phase`. Purpose: Phase of a growing string session (RGSADDLE_GROWING_STRING_GROWING or RGSADDLE_GROWING_STRING_JOINED), or RGSADDLE_NULL_SESSION for NULL, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_positions`. Purpose: Copy the active positions (rgsaddle_growing_string_n_images(session) * 3 * n_atoms values) into out, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_ids`. Purpose: Copy the stable image identifiers (rgsaddle_growing_string_n_images(session) uint64_t values) into out, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_set_fixed_atoms`. Purpose: Replace the per-atom fixed mask (n_atoms bytes, 1 fixed and 0 free) on a growing string session, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_saddle_index`. Purpose: Read the saddle-index certificate of a joined growing string session, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_growing_string_free`. Purpose: Free a growing string session, ABI minor 44. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_free_end`. Purpose: Enable, replace, or clear the free-end adaptive NEB (FEA-NEB) of Zhang, Zhang, Ye, and Zheng, J. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_free_end_residual`. Purpose: Read the signed target-energy residual `E(x_end) - E_target` from the most recent free-end step into `out`, ABI minor 45. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_free_end_cuts`. Purpose: Number of adaptive cut-and-remesh refinements performed so far on a free-end band, or 0 for NULL, ABI minor 45. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_config_default`. Purpose: Fill out with the solver defaults for the given force tolerances, ABI minor 47. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve`. Purpose: Optimize a fixed-energy tunneling path and optionally its harmonic quantum TST rate, ABI minor 47. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve_with_kappa`. Purpose: Solve with fixed endpoint coefficient κ. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve_options`. Purpose: Optimize with a choice of initial path, convergence test, and integrator. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve_counted`. Purpose: Same inputs as solve_options, with optional detailed counters. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve_counted_diagnostics`. Purpose: Counted solve with the number of negative and total retained fluctuation modes. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve_counted_orbit`. Purpose: Counted solve with optional bead observations. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve_counted_turning`. Purpose: Counted orbit solve with optional return-turn geometry and energy checks. Parameters: the declaration. Units: the caller's.
- `rgsaddle_lineb_solve_counted_rate`. Purpose: Counted solve with selectable image-Hessian interpolation. Parameters: the declaration. Units: the caller's.
- `rgsaddle_landscape_config_default`. Purpose: Write the Rust defaults. Parameters: the declaration. Units: the caller's.
- `rgsaddle_landscape_create`. Purpose: Open a search. Parameters: the declaration. Units: the caller's.
- `rgsaddle_landscape_run`. Purpose: Run the search. Parameters: the declaration. Units: the caller's.
- `rgsaddle_landscape_node`. Purpose: Read one node. Parameters: the declaration. Units: the caller's.
- `rgsaddle_landscape_modes`. Purpose: Unstable modes, row-major, 3 * n_atoms by the saddle index. Parameters: the declaration. Units: the caller's.
- `rgsaddle_landscape_edge`. Purpose: One downward edge. Parameters: the declaration. Units: the caller's.
- `rgsaddle_landscape_free`. Purpose: Declared in include/rgsaddle.h. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_set_refine`. Purpose: Per-step refine stepper, ABI minor 60. Parameters: the declaration. Units: the caller's.
- `rgsaddle_band_is_refining`. Purpose: 1 when the last first-order step used the refine stepper, else 0. Parameters: the declaration. Units: the caller's.
- `rgsaddle_geodesic_config_default`. Purpose: Fill `out` with the default geodesic controls (step and gradient tolerances 1e-6, max_move 0.5, lower_ratio 0.95, upper_ratio 1.1, 40 sweeps, 40 iterations, memory 8, 10 bound samples, 32 images, seed 0). Parameters: the declaration. Units: the caller's.
- `rgsaddle_geodesic_path`. Purpose: Minimize the geodesic length of an existing path. Parameters: the declaration. Units: the caller's.
- `rgsaddle_geodesic_morse`. Purpose: Morse pair geodesic between two geometries. Parameters: the declaration. Units: the caller's.

## Types and callbacks

- `RgsaddleBand`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleMinMode`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleHyperplaneSampler`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddlePafi`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleOhtst`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleIndex1`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleIrc`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleSellaMin`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleConstraints`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleSellaSaddle`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddlePes`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleInternalPes`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleSamd`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleOcineb`. Purpose: Opaque session handle in include/rgsaddle.h.
- `rgsaddle_stencil_config_t`. Purpose: Point stencil.
- `rgsaddle_stencil_t`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleIndexK`. Purpose: Opaque session handle in include/rgsaddle.h.
- `RgsaddleGrowingString`. Purpose: Opaque handle to a growing string session, ABI minor 44.
- `RgsaddleLandscape`. Purpose: Opaque session handle in include/rgsaddle.h.
- `rgsaddle_version_t`. Purpose: Version head carried by every wire struct.
- `rgsaddle_status_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_tangent_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_spring_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_projection_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_method_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_minmode_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_reparametrization_t`. Purpose: Equal arc-length placement of rgsaddle_reparametrize (ABI minor 38).
- `rgsaddle_difference_t`. Purpose: Finite difference of the min-mode Hessian actions.
- `rgsaddle_run_status_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_hyperplane_budget_t`. Purpose: Hyperplane ensemble request (ABI minor 42).
- `rgsaddle_hyperplane_observation_t`. Purpose: Borrowed hyperplane observation (ABI minor 42).
- `rgsaddle_hyperplane_ti_config_t`. Purpose: C struct typedef in include/rgsaddle.h.
- `rgsaddle_hyperplane_ti_result_t`. Purpose: C struct typedef in include/rgsaddle.h.
- `rgsaddle_surface_request_t`. Purpose: Host-surface request.
- `rgsaddle_band_config_t`. Purpose: Band configuration.
- `rgsaddle_report_t`. Purpose: One step's report.
- `rgsaddle_solid_surface_request_t`. Purpose: Surface request of a solid-state band, ABI minor 16.
- `rgsaddle_quickmin_t`. Purpose: Quick-min variants (rgmin QuickMinOptions).
- `rgsaddle_minmode_config_t`. Purpose: Minimum-mode configuration.
- `rgsaddle_artn_config_t`. Purpose: ART nouveau protocol controls, ABI minor 43.
- `rgsaddle_pafi_config_t`. Purpose: PAFI configuration.
- `rgsaddle_pafi_result_t`. Purpose: PAFI barrier summary after rgsaddle_pafi_run.
- `rgsaddle_ohtst_integrator_t`. Purpose: OH-TST sample integrator kind for rgsaddle_ohtst_config_t: 0 BAOAB, 1 GHMC.
- `rgsaddle_ohtst_counting_t`. Purpose: OH-TST trajectory counting kind for rgsaddle_ohtst_config_t: 0 final state, 1 first crossing.
- `rgsaddle_ohtst_config_t`. Purpose: OH-TST configuration.
- `rgsaddle_ohtst_result_t`. Purpose: OH-TST summary after rgsaddle_ohtst_run.
- `rgsaddle_hess_update_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_nichols_mode_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_prfo_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_index1_config_t`. Purpose: Index-1 Newton configuration.
- `rgsaddle_force_gate_t`. Purpose: Convergence norm for sessions with a selectable force criterion.
- `rgsaddle_energy_reference_t`. Purpose: Endpoint energy the energy-weighted spring rule measures from (minor 73).
- `rgsaddle_kappa_config_t`. Purpose: Basin constrained dimer.
- `rgsaddle_kappa_report_t`. Purpose: C struct typedef in include/rgsaddle.h.
- `rgsaddle_irc_kind_t`. Purpose: RGSADDLE_IRC_GS2 is the Gonzalez and Schlegel step: the energy minimum on the mass-weighted sphere of radius dx/2 about a pivot dx/2 down the gradient.
- `rgsaddle_irc_dir_t`. Purpose: C enum typedef in include/rgsaddle.h.
- `rgsaddle_irc_config_t`. Purpose: C struct typedef in include/rgsaddle.h.
- `rgsaddle_sella_min_config_t`. Purpose: Sella order-0 (QN + trust).
- `rgsaddle_sella_saddle_config_t`. Purpose: Sella order-1 (P-RFO + trust).
- `rgsaddle_constraints_config_t`. Purpose: Empty Constraints chart.
- `rgsaddle_samd_config_t`. Purpose: Sella BDP thermostat.
- `rgsaddle_autoneb_config_t`. Purpose: Run-to-completion AutoNEB, ABI minor 68.
- `rgsaddle_autoneb_report_t`. Purpose: Result of rgsaddle_autoneb_run.
- `rgsaddle_ocineb_phase_t`. Purpose: Phase of one OCI-NEB host step.
- `rgsaddle_ocineb_config_t`. Purpose: Hand-off parameters.
- `rgsaddle_ocineb_report_t`. Purpose: One OCI-NEB step.
- `rgsaddle_stencil_report_t`. Purpose: Leading struct_size is sizeof(rgsaddle_stencil_report_t).
- `rgsaddle_connect_config_t`. Purpose: Double-ended connect, ABI minor 18.
- `rgsaddle_connect_report_t`. Purpose: kind is 's', 'u', or 'f'.
- `rgsaddle_indexk_config_t`. Purpose: Index-k minimum-mode configuration, ABI minor 37.
- `rgsaddle_saddle_check_t`. Purpose: Saddle-index certification, ABI minor 40.
- `rgsaddle_saddle_index_t`. Purpose: A certificate, ABI minor 40.
- `rgsaddle_growing_string_phase_t`. Purpose: Phase of a growing string session, ABI minor 44.
- `rgsaddle_growing_string_config_t`. Purpose: Configuration of rgsaddle_growing_string_create, ABI minor 44.
- `rgsaddle_free_end_side_t`. Purpose: Which terminal image moves on the target-energy level set, ABI minor 45.
- `rgsaddle_lineb_config_t`. Purpose: Fixed-energy LI-NEB controls for rgsaddle_lineb_solve, ABI minor 47.
- `rgsaddle_lineb_result_t`. Purpose: Path, temperature and rate summary from rgsaddle_lineb_solve, ABI minor 47.
- `rgsaddle_lineb_counts_t`. Purpose: Disjoint configuration evaluations for one successful solve.
- `rgsaddle_lineb_orbit_t`. Purpose: Opt-in observations from the rate's own surface calls.
- `rgsaddle_lineb_turning_t`. Purpose: Return-turn agreement for the interpolated-force clock, in the caller's units.
- `rgsaddle_lineb_rate_diagnostics_t`. Purpose: Geometry counts within the rate, and the Cartesian finite-difference displacement used at the path images (NaN for direct or path-only solves).
- `rgsaddle_landscape_config_t`. Purpose: C struct typedef in include/rgsaddle.h.
- `rgsaddle_landscape_report_t`. Purpose: C struct typedef in include/rgsaddle.h.
- `rgsaddle_refine_method_t`. Purpose: Refine stepper of rgsaddle_band_set_refine, ABI minor 60.
- `rgsaddle_geodesic_config_t`. Purpose: Geodesic interpolation controls.
- `rgsaddle_hyperplane_emit_fn`. Purpose: Callback typedef in include/rgsaddle.h.
- `rgsaddle_sample_hyperplane_fn`. Purpose: Callback typedef in include/rgsaddle.h.
- `rgsaddle_surface_fn`. Purpose: Callback typedef in include/rgsaddle.h.
- `rgsaddle_solid_surface_fn`. Purpose: Callback typedef in include/rgsaddle.h.
- `rgsaddle_point_surface_fn`. Purpose: Point-surface callback used by PAFI and OH-TST handles.
- `rgsaddle_hessian_fn`. Purpose: Callback typedef in include/rgsaddle.h.
- `rgsaddle_hessian_at_fn`. Purpose: Geometry-aware Hessian action, ABI minor 69.
- `rgsaddle_stencil_eval_fn`. Purpose: Callback typedef in include/rgsaddle.h.
- `rgsaddle_geodesic_chart_fn`. Purpose: Redundant coordinate chart for geodesic interpolation.

## Macros and enum constants

- `RGSADDLE_ABI_MAJOR`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_ABI_MINOR`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_BAND_PER_IMAGE`. Purpose: Band config flags bit 0.
- `RGSADDLE_BAND_KEEP_TRANSLATION`. Purpose: Band config flags bit 1.
- `RGSADDLE_BAND_CI_AFTER`. Purpose: Band config flags bit 2, ABI minor 17.
- `RGSADDLE_BAND_NO_MIN_MODE`. Purpose: Band config flags bit 3, ABI minor 21.
- `RGSADDLE_BAND_SPLINE_REPARAM`. Purpose: Band config flags bit 4, ABI minor 38.
- `RGSADDLE_BAND_STRING`. Purpose: Band config flags bit 5, ABI minor 44.
- `RGSADDLE_MINMODE_EXPLICIT_ROTATION_ANGLE_TOL`. Purpose: Min-mode config flags bit 0, ABI minor 63.
- `RGSADDLE_REQ_ONE_IMAGE`. Purpose: Request flags bit 0.
- `RGSADDLE_REQ_CLIMBING_IMAGE`. Purpose: Request flags bit 1, ABI minor 23.
- `RGSADDLE_VERSION_INIT`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_IRC_ADAPTIVE`. Purpose: IRC flags bit 0, ABI minor 74.
- `RGSADDLE_AUTONEB_CLIMB`. Purpose: AutoNEB flag bit 0, ABI minor 68.
- `RGSADDLE_AUTONEB_IDPP`. Purpose: AutoNEB flag bit 1, ABI minor 68.
- `RGSADDLE_AUTONEB_KEEP_TRANSLATION`. Purpose: AutoNEB flag bit 2, ABI minor 68.
- `RGSADDLE_STENCIL_MIN`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_DIMER`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_LANCZOS`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_ART`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_EIGEN`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_NEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_DNEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_CI_NEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_ENERGY_WEIGHTED_NEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_ZOOM_NEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_AUTONEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_OCI_NEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_IDPP`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_SIDPP`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_DR`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_FORCE_TOL`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_MAX_MOVE`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_ROTATION_TOL`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_MAX_ROTATIONS`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_KRYLOV_DIM`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_THREADS`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_ART_THRESHOLD`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_ART_PUSH`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_KEY_MODE`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_QUERY_POSITIONS`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_QUERY_MODE`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_STENCIL_QUERY_CURVATURE`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_HAS_LINEB`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_LINEB_LINEAR_SEED`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_LINEB_ENDPOINT_CONVERGENCE`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_LINEB_PROJECTED_VERLET`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_LINEB_MASSES_COORDINATES`. Purpose: Values of the molecular argument of the LI-NEB entry points.
- `RGSADDLE_LINEB_MASSES_MOLECULE`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_LINEB_MASSES_MOLECULE_ADJACENT`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_LINEB_INTERPOLATED_FORCE_CLOCK`. Purpose: Imaginary-time velocity Verlet on the cubic signed image force.
- `RGSADDLE_LINEB_INTERPOLATED_HESSIAN`. Purpose: Interpolate Cartesian image Hessians onto the equal-time replicas.
- `RGSADDLE_LINEB_BATCH_SURFACE`. Purpose: Accept surface requests with multiple geometry rows in input order.
- `RGSADDLE_HAS_LINEB_RATE_DIAGNOSTICS`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_HAS_LINEB_ORBIT`. Purpose: Macro constant in include/rgsaddle.h.
- `RGSADDLE_OK`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NULL_SESSION`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NULL_BAND`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NULL_SURFACE`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NULL_REPORT`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_SHAPE`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_SURFACE_FAILED`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NON_FINITE`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_SOLVER`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_ABI_MISMATCH`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_ALLOC`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_INVALID_PARAMETER`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NO_EVALUATION`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_STALLED`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NOT_EQUILIBRATED`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_INSUFFICIENT_EFFECTIVE_SAMPLES`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_NOT_CONVERGED`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_LANDSCAPE_BOUND`. Purpose: Enumerator of `rgsaddle_status_t`.
- `RGSADDLE_TANGENT_SIMPLE`. Purpose: Enumerator of `rgsaddle_tangent_t`.
- `RGSADDLE_TANGENT_IMPROVED`. Purpose: Enumerator of `rgsaddle_tangent_t`.
- `RGSADDLE_TANGENT_SPLINE`. Purpose: Enumerator of `rgsaddle_tangent_t`.
- `RGSADDLE_SPRING_UNIFORM`. Purpose: Enumerator of `rgsaddle_spring_t`.
- `RGSADDLE_SPRING_WEIGHTED`. Purpose: Enumerator of `rgsaddle_spring_t`.
- `RGSADDLE_SPRING_ONSAGER_MACHLUP`. Purpose: Enumerator of `rgsaddle_spring_t`.
- `RGSADDLE_PROJECTION_PLAIN_EB`. Purpose: Enumerator of `rgsaddle_projection_t`.
- `RGSADDLE_PROJECTION_NEB`. Purpose: Enumerator of `rgsaddle_projection_t`.
- `RGSADDLE_PROJECTION_DNEB`. Purpose: Enumerator of `rgsaddle_projection_t`.
- `RGSADDLE_METHOD_FIRE`. Purpose: Enumerator of `rgsaddle_method_t`.
- `RGSADDLE_METHOD_LBFGS`. Purpose: Enumerator of `rgsaddle_method_t`.
- `RGSADDLE_METHOD_RTR`. Purpose: Enumerator of `rgsaddle_method_t`.
- `RGSADDLE_METHOD_QUICKMIN`. Purpose: Enumerator of `rgsaddle_method_t`.
- `RGSADDLE_METHOD_ODE12R`. Purpose: Enumerator of `rgsaddle_method_t`.
- `RGSADDLE_MINMODE_DIMER`. Purpose: Enumerator of `rgsaddle_minmode_t`.
- `RGSADDLE_MINMODE_LANCZOS`. Purpose: Enumerator of `rgsaddle_minmode_t`.
- `RGSADDLE_MINMODE_LOBPCG`. Purpose: Enumerator of `rgsaddle_minmode_t`.
- `RGSADDLE_REPARAM_LINEAR`. Purpose: Enumerator of `rgsaddle_reparametrization_t`.
- `RGSADDLE_REPARAM_NOT_A_KNOT`. Purpose: Enumerator of `rgsaddle_reparametrization_t`.
- `RGSADDLE_DIFFERENCE_FORWARD`. Purpose: Enumerator of `rgsaddle_difference_t`.
- `RGSADDLE_DIFFERENCE_CENTRAL`. Purpose: Enumerator of `rgsaddle_difference_t`.
- `RGSADDLE_STATUS_RUNNING`. Purpose: Enumerator of `rgsaddle_run_status_t`.
- `RGSADDLE_STATUS_CONVERGED`. Purpose: Enumerator of `rgsaddle_run_status_t`.
- `RGSADDLE_QUICKMIN_RGMIN`. Purpose: Enumerator of `rgsaddle_quickmin_t`.
- `RGSADDLE_QUICKMIN_EON`. Purpose: Enumerator of `rgsaddle_quickmin_t`.
- `RGSADDLE_QUICKMIN_PER_ATOM`. Purpose: Enumerator of `rgsaddle_quickmin_t`.
- `RGSADDLE_OHTST_INTEGRATOR_BAOAB`. Purpose: Enumerator of `rgsaddle_ohtst_integrator_t`.
- `RGSADDLE_OHTST_INTEGRATOR_GHMC`. Purpose: Enumerator of `rgsaddle_ohtst_integrator_t`.
- `RGSADDLE_OHTST_COUNT_FINAL`. Purpose: Enumerator of `rgsaddle_ohtst_counting_t`.
- `RGSADDLE_OHTST_COUNT_FIRST_CROSSING`. Purpose: Enumerator of `rgsaddle_ohtst_counting_t`.
- `RGSADDLE_HESS_POWELL`. Purpose: Enumerator of `rgsaddle_hess_update_t`.
- `RGSADDLE_HESS_BOFILL`. Purpose: Enumerator of `rgsaddle_hess_update_t`.
- `RGSADDLE_NICHOLS_MINIMIZE`. Purpose: Enumerator of `rgsaddle_nichols_mode_t`.
- `RGSADDLE_NICHOLS_INDEX1`. Purpose: Enumerator of `rgsaddle_nichols_mode_t`.
- `RGSADDLE_PRFO_MINIMIZE`. Purpose: Enumerator of `rgsaddle_prfo_t`.
- `RGSADDLE_PRFO_INDEX1`. Purpose: Enumerator of `rgsaddle_prfo_t`.
- `RGSADDLE_FORCE_L2`. Purpose: Enumerator of `rgsaddle_force_gate_t`.
- `RGSADDLE_FORCE_LINF`. Purpose: Enumerator of `rgsaddle_force_gate_t`.
- `RGSADDLE_FORCE_MAX_ATOM`. Purpose: Enumerator of `rgsaddle_force_gate_t`.
- `RGSADDLE_FORCE_MW_L2`. Purpose: Enumerator of `rgsaddle_force_gate_t`.
- `RGSADDLE_ENERGY_REFERENCE_HIGHER_ENDPOINT`. Purpose: Enumerator of `rgsaddle_energy_reference_t`.
- `RGSADDLE_ENERGY_REFERENCE_LOWER_ENDPOINT`. Purpose: Enumerator of `rgsaddle_energy_reference_t`.
- `RGSADDLE_IRC_GS2`. Purpose: Enumerator of `rgsaddle_irc_kind_t`.
- `RGSADDLE_IRC_MOROKUMA`. Purpose: Enumerator of `rgsaddle_irc_kind_t`.
- `RGSADDLE_IRC_SELLA_SPHERE`. Purpose: Enumerator of `rgsaddle_irc_kind_t`.
- `RGSADDLE_IRC_FORWARD`. Purpose: Enumerator of `rgsaddle_irc_dir_t`.
- `RGSADDLE_IRC_REVERSE`. Purpose: Enumerator of `rgsaddle_irc_dir_t`.
- `RGSADDLE_OCINEB_BAND`. Purpose: Enumerator of `rgsaddle_ocineb_phase_t`.
- `RGSADDLE_OCINEB_ALIGN`. Purpose: Enumerator of `rgsaddle_ocineb_phase_t`.
- `RGSADDLE_OCINEB_MINMODE`. Purpose: Enumerator of `rgsaddle_ocineb_phase_t`.
- `RGSADDLE_GROWING_STRING_GROWING`. Purpose: Enumerator of `rgsaddle_growing_string_phase_t`.
- `RGSADDLE_GROWING_STRING_JOINED`. Purpose: Enumerator of `rgsaddle_growing_string_phase_t`.
- `RGSADDLE_FREE_END_FIRST`. Purpose: Enumerator of `rgsaddle_free_end_side_t`.
- `RGSADDLE_FREE_END_LAST`. Purpose: Enumerator of `rgsaddle_free_end_side_t`.
- `RGSADDLE_REFINE_NONE`. Purpose: Enumerator of `rgsaddle_refine_method_t`.
- `RGSADDLE_REFINE_LBFGS`. Purpose: Enumerator of `rgsaddle_refine_method_t`.

# Cyclic block factorization (`docs/orgmode/explanation/cyclic-block.org`)

> Rotation fallback, singular criterion, symmetric part, and residual norm of the cyclic block factor

`block_cyclic` factors a ring of at least three beads.
Each diagonal block is an `n` by `n` matrix supplied by the caller.
Every neighbor coupling, including the corner that closes the ring, is `-spring` times the identity.
The open chain is eliminated by block Thomas.
The last bead is the Schur complement of that chain.
The log absolute determinant and the negative count add across those complements (Haynsworth).
Each accepted complement is inverted once, as \(V \mathrm{diag}(\lambda^{-1}) V^{T}\), by one matrix product.
Later block products use that same product.
The public items are listed in [cyclic block factor](/reference/block-cyclic.html).

## Rotation fallback
Pivot selection reads the eigenvalues of the original blocks and does not form those eigenvalues again while eliminating one rotation.
The quality of a block is the ratio of its smallest absolute eigenvalue to its largest.
A block whose largest absolute eigenvalue is zero has quality zero.
The best-conditioned block is eliminated first.
The bead order is rotated so that block opens the chain.
That rotation is the preferred one.

A complement with an eigenvalue inside the relative zero tolerance fails that rotation.
The failure does not, by itself, make the ring singular.
The next rotation, starting one bead later, is tried, and so on around the ring.
The first rotation whose complements all lie outside the tolerance is the factor.
It stores the open-chain inverses and the inverse of the closing Schur complement.

The spring-squared term in each complement is applied as two scalings by `spring`.
Forming `spring * spring` overflows for a large finite spring, and scaling twice keeps a well-conditioned complement finite.

When every rotation meets a zero complement, the ring is assembled into one dense matrix of `beads * n` rows and factored from its spectrum.
If that spectrum has full rank, the assembled inverse replaces the block Thomas factors.
The log absolute determinant and the negative count then come from the assembled eigenvalues.

## Singular criterion
`SaddleError::Singular` is returned only when an assembled eigenvalue lies inside the relative zero tolerance.
The tolerance is `relative_zero_tolerance(scale, n)`, with `scale` the largest absolute eigenvalue and `n` the number of rows.
An eigenvalue is inside the tolerance when its absolute value is less than or equal to that product.
A zero complement of one rotation is not this error when another rotation, or the assembled spectrum, has full rank.

The index on the error is the preferred rotation's complement.
It is the index, in that rotation's bead order, of the first complement whose eigenvalue fell inside the tolerance.
It is not an index into the assembled spectrum.
A pivot inside the tolerance is not replaced by a finite value, because that substitution would change every later Schur complement.

`logdet_cyclic_blocks` and `logdet_cyclic_strict` share this test.
Both refuse the pivot.
`logdet_cyclic_strict` is the same computation as `logdet_cyclic_blocks`.

## Symmetric part
Before a block is factored, its off-diagonal pairs are compared with the relative zero tolerance of its largest absolute entry.
The scale in that tolerance is the largest absolute entry, and the length is the block size `n`.
A pair whose absolute difference is greater than the tolerance is `SaddleError::Invalid`.
The factor would otherwise use the symmetric part while a residual formed from the original entries would not.
A smaller skew, including a difference equal to the tolerance, is replaced by the symmetric part: both entries become the mean of the two.
That replacement is made before the factor and before the residual.
`factor_cyclic` adds `tau` to every diagonal entry after the replacement.
A non-finite entry, spring, shift, or pivot is `SaddleError::NonFinite`.

## Residual norm
`CyclicFactor::solve_report` solves \(M x = b\) and returns a `SolveReport`.
The residual vector is \(M x - b\).
`M` is built from the symmetrized blocks stored on the factor, including the `tau` shift when `factor_cyclic` built it, and from the spring couplings.
The reported `residual` is the Euclidean norm of that vector.

The norm scales its accumulator the way LAPACK `dnrm2` does.
Zero entries are skipped.
The largest magnitude seen so far is factored out of the sum of squares, and the square root is multiplied by that magnitude at the end.
Squaring an entry near `1e200` would overflow.
A non-finite solution or a non-finite residual is `SaddleError::NonFinite`.

One correction is applied when the residual exceeds `SOLVE_REFINE_TOLERANCE` times the norm of `b`.
`SOLVE_REFINE_TOLERANCE` is `1e-11`.
A zero right-hand side is corrected when the residual is positive.
The correction solves `M` against the residual vector and subtracts that step from the solution.
The residual is then measured again.
There is no second correction.
`corrections` is 1 when the step ran and 0 otherwise.
A right-hand side whose length is not `beads * n` is `SaddleError::Shape`.

# Cyclic block factor (`docs/orgmode/reference/block-cyclic.org`)

> Cyclic block-tridiagonal factor, inertia, and the solve residual

`block_cyclic` is the cyclic block-tridiagonal factor.
It is exported with the default `faer` feature.
Full API documentation is on [docs.rs/rgsaddle](https://docs.rs/rgsaddle), under `rgsaddle::block_cyclic`.
This page is the inventory of each public item.
[Cyclic block factorization](/explanation/cyclic-block.html) records the rotation fallback, the singular criterion, the symmetric part, and the residual norm.

## Module
The matrix is a ring of at least three beads.
Each diagonal block is an `n` by `n` matrix.
Every neighbor coupling, including the corner that closes the ring, is `-spring` times the identity.
The open chain is eliminated by block Thomas.
The closing bead is the Schur complement of that chain.
The log absolute determinant and the negative count add across those complements.

## Types
| Type | Role |
| --- | --- |
| `BlockInertia` | `log_abs_det` is the sum of \(\ln\lvert\lambda\rvert\) over eigenvalues outside the relative zero tolerance. `n_negative` counts eigenvalues below the negative side of that tolerance. A successful call has already refused every eigenvalue inside the tolerance, so both fields cover the spectrum that was kept |
| `CyclicFactor` | Factor returned by `factor_cyclic`. It holds the open-chain inverses and the closing Schur inverse, or the dense inverse of the assembled matrix when no rotation factors. `CyclicFactor::solve` returns the solution of \(M x = b\). `CyclicFactor::solve_report` returns that solution together with a `SolveReport` |
| `SolveReport` | `solution` is in the caller's bead order. `residual` is the Euclidean norm of `M x - b` after the optional correction. `corrections` is 1 when that correction ran and 0 otherwise |

## Functions
| Function | Role |
| --- | --- |
| `logdet_cyclic_blocks` | `logdet_cyclic_blocks(diag, n, spring)` returns a `BlockInertia`. A pivot inside the relative zero tolerance, or a non-finite pivot, is an error. Substituting a finite value for that pivot would change every later Schur complement. `SaddleError::Invalid` when there are fewer than three blocks, `n` is zero, or a block is asymmetric beyond the tolerance of its largest absolute entry. `SaddleError::Shape` when a block is not `n` by `n`. `SaddleError::NonFinite` when an entry, the spring, or a pivot is non-finite. `SaddleError::Singular` only when the assembled matrix has an eigenvalue inside that tolerance. A zero complement of one rotation is not singular when another rotation, or the assembled spectrum, has full rank. The singular index is the preferred rotation's complement |
| `logdet_cyclic_strict` | `logdet_cyclic_strict(diag, n, spring)` is the same computation as `logdet_cyclic_blocks`. It refuses a pivot inside the relative zero tolerance and does not substitute a finite value. The errors are the same |
| `factor_cyclic` | `factor_cyclic(diag, n, spring, tau)` adds `tau` to every diagonal entry after the symmetric part is taken, then returns a `CyclicFactor`. `CyclicFactor::solve` refines one step at `SOLVE_REFINE_TOLERANCE`. `SaddleError::Invalid` below three blocks, for a zero block size, or for an asymmetric block. `SaddleError::Singular` when the assembled spectrum has an eigenvalue inside the relative zero tolerance. `SaddleError::NonFinite` when `spring` or `tau` is non-finite, and the shape and finiteness errors of `logdet_cyclic_blocks` |

## Constant
`SOLVE_REFINE_TOLERANCE` is `1e-11`.
`CyclicFactor::solve_report` applies one correction when the residual exceeds this value times the Euclidean norm of the right-hand side.
A zero right-hand side is corrected when the residual is positive.
The reported norm is measured again after that single correction.

# Contributing (`docs/orgmode/contributing/index.org`)

> Build, test, MSRV, Python stub, documentation, and release workflow

## System prerequisites
- The current stable Rust with clippy and rustfmt; CI formats, lints and tests with it.
- rustup and jq, which the minimum supported Rust version checks below use to install the toolchain that `rust-version` in `Cargo.toml` names.
- A C compiler, and a C++ compiler with C++17 support and its standard library headers.
  The C and C++ smoke tests call `cc` and `c++`, or the compilers named by `CC` and `CXX`.
  The CMake builds below use the same compilers.
  If Clang cannot find `cstddef`, set `CXX=g++`.
  Or install the libstdc++ development package for the GNU Compiler Collection (GCC) version that Clang selects.
- GNU m4, which the GNU Multiple Precision Arithmetic Library (GMP) build behind the `verify` feature needs.
  On Debian and Ubuntu install the `m4` package.
- CMake, which the `chemfiles` and `highs` features use to build native libraries.
  CMake 4 needs `CMAKE_POLICY_VERSION_MINIMUM=3.5` for the chemfiles build.
  [Read a molecular frame](/howto/io.html) uses the same setting.

## Build and test
Build and test a pinned checkout with its Cargo lockfile.
The C and C++ smoke tests require the C ABI library as well as the test executables.

```sh
cargo build --locked --features capi
cargo test --locked --features capi
CMAKE_POLICY_VERSION_MINIMUM=3.5 cargo clippy --locked --all-targets --all-features -- -D warnings
cargo fmt --check
```

Optional features are checked with their dependencies enabled.
The `faer` feature is part of the default set.
It is the dense self-adjoint spectrum used by connect and SQNM.
The Kani workflow's prove step builds with `--no-default-features --features capi` so that job does not compile `pulp`.
The `kani-github-action` default command is a bare `cargo-kani`, which would enable `faer`.
The workflow overrides that command and does not pass `--ignore-global-asm`.
Build the Python package with scikit-build-core (`pip install .`) and run `tests/python` against the installed package.
The algebra and interval checks live in `validation` and `tests/symbolic`; the Lean libraries live in `formal`.
The verify workflow's symbolic-script step runs those checks and leaves `validation/benchmark/` out.
Those files are the pt-island campaign drivers.
They import optbench and take a checkout plus a long run, so they are not part of the minute-long symbolic check.

A git dependency names a full 40-character `rev`, never a `tag` or `branch`, with the exact version of the crate at that commit, such as `version = "=0.5.2"`.
Cargo keys a git source by its reference, so a dependent that pins the same commit another way locks a second copy.
`ci/consumer` is such a dependent: it takes this checkout by path and pins linkcell, minimage, rgmin, and rgpot-core from crates.io. The rgpot-core pin is the crates.io version `"=3.7.0"`.
Bump its version pins together with `Cargo.toml`.
The CI test job runs the check and compiles the consumer:

```sh
python3 ci/check_dependency_pins.py
cargo check --manifest-path ci/consumer/Cargo.toml --target-dir target
```

## Minimum supported Rust version
The minimum supported Rust version (MSRV) is `1.88`, the `rust-version` in `Cargo.toml`.
A change must not need a newer compiler, and must pass the MSRV checks below as well as the stable ones.
Clippy adds and revises lints between releases, so code that stable's clippy accepts can fail the MSRV's, and the reverse.
The `msrv` job of the CI workflow reads `rust-version` with `cargo metadata` and installs that toolchain.
It runs the clippy steps of the test and readcon jobs and of the verify workflow's rust job on it, then builds and tests `--features capi`, all with `--locked`.
A dependency in `Cargo.lock` that needs a newer compiler fails the job.
Edition 2024's resolver avoids that when it can: `cargo update` prefers versions that support the MSRV.
To raise the MSRV, edit `rust-version`; the job and the commands below read it from there.
These commands reproduce the job:

```sh
msrv=$(cargo metadata --no-deps --format-version 1 | jq -er '.packages[] | select(.name == "rgsaddle") | .rust_version')
rustup toolchain install "$msrv" --profile minimal --component clippy
cargo +"$msrv" clippy --locked --features capi -- -D warnings
cargo +"$msrv" clippy --locked --all-targets --features capi,ohtst -- -D warnings
cargo +"$msrv" clippy --locked --all-targets --features readcon -- -D warnings
cargo +"$msrv" clippy --locked --all-targets --features readcon,readcon-db -- -D warnings
cargo +"$msrv" clippy --locked --all-targets --features capi,verify -- -D warnings
cargo +"$msrv" build --locked --features capi
cargo +"$msrv" test --locked --features capi
```

## Python stub
`python/rgsaddle/_core.pyi` is the output of nanobind's stubgen on the installed extension.
Do not edit it by hand.
The typing job of the Python binding workflow regenerates it with nanobind 3.1.0 and fails on any difference.
The extension renders its own signatures, so `build-system.requires` in `pyproject.toml` pins the same nanobind.
Give a binding that takes a callable or returns a tuple an `nb::sig`, as `connect` does; a bare `Callable` or `tuple` fails `mypy --strict`.
After a change to `bind/ext.cpp`, rebuild against the pinned nanobind and regenerate the stub:

```sh
python -m pip install 'nanobind==3.1.0' 'scikit-build-core>=1.1'
python -m pip install --no-build-isolation .
python scripts/regen_stub.py
```

`python scripts/regen_stub.py --check` prints the difference and exits nonzero, as the typing job does.
The script reads the pin from `pyproject.toml` and refuses another nanobind.

## Documentation
Narrative pages are the Org sources under `docs/orgmode`.
`docs/export.el` writes a reStructuredText file under `docs/source` for each of them.
Git ignores those files, so edit the Org source and do not add the generated files.
Build the site as the docs workflow does:

```sh
python docs/check_c_symbols.py
python docs/check_paths.py
python docs/check_dois.py
emacs --batch -l docs/export.el
python -m pip install -r docs/requirements.txt
sphinx-build -b html -n -W --keep-going docs/source docs/build
sphinx-build -b linkcheck -n -W --keep-going docs/source docs/build/linkcheck
```

The API documentation builds with every rustdoc warning denied on each feature set CI tests, and once with private items.
A public doc that links a private item, a broken or redundant intra-doc link, a bare URL or unclosed HTML fails the CI test job.
Each entry point opens with an example on a small analytic surface, which `cargo test` runs.

```sh
ci/check_rustdoc.sh
cargo test --locked --doc --features capi
```

Retain numerical assertions and record the source, dependency and library revisions with performance results.

## Changelog
Each change adds a fragment under `docs/newsfragments`
and leaves `docs/orgmode/changelog.org` as it is.
Name the fragment `+<slug>.<type>.org`, or `<issue>.<type>.org` for a
change with an issue number.
The types are the sections of `towncrier.toml`: `breaking`, `security`,
`removed`, `deprecated`, `added`, `doc`, `dev`, `changed`, `fixed` and `misc`.
Write Org markup with one sentence per line.
A release collects the fragments under a new heading, and `--draft`
prints that heading without writing it:
```sh
python -m pip install towncrier
towncrier build --draft --version <version>
towncrier build --version <version>
```

## Release to crates.io
A pushed `v*` tag starts `publish.yml` on the tagged commit.
The workflow checks out the tag, obtains a crates.io token through `rust-lang/crates-io-auth-action`, and runs `cargo publish --locked --no-verify -p rgsaddle`.
`rgmin`, `linkcell`, `minimage` and the `rgpot-pair` dev-dependency all come from crates.io, so every dependency of the published manifest resolves from the registry.
`--no-verify` is kept in the workflow; run `cargo publish --dry-run --locked` on a checkout before tagging to verify the package.

Before tagging, run the MSRV test line above, bump versions as below, and collect the changelog.

## Release to PyPI
A `v*` tag publishes the Python package to PyPI through `pypi.yml`; the crate upload is the crates.io workflow above.
`pypi.yml` uses PyPI trusted publishing, so the repository holds no PyPI token.
Before the first upload, the PyPI account that will own the project adds a pending publisher at https://pypi.org/manage/account/publishing/ with these values:

- PyPI Project Name: `rgsaddle`
- Owner: `OmniPotentRPC`
- Repository name: `rgsaddle`
- Workflow name: `pypi.yml`
- Environment name: `pypi`

The first upload creates the project and turns the pending publisher into its trusted publisher.
Only the `publish` job runs in the `pypi` environment and holds `id-token: write`, so required reviewers added to that environment in the repository settings hold every upload until one approves it.

To release a version:

1. Set it in `Cargo.toml`, `pyproject.toml`, `meson.build`, `CITATION.cff`, `codemeta.json`, `.zenodo.json`, `docs/source/conf.py`, and the install example in `docs/orgmode/getting-started.org`; `tests/package_version.rs` holds the first six equal. Rebuild `llms.txt` and `llms-full.txt` with `python docs/render_llms.py` when narrative pages moved.
2. Collect the fragments with `towncrier build --version <version>` and commit the updated `docs/orgmode/changelog.org`.
3. Push the release commit to `main`, then push the tag `v<version>` on that commit. The tag runs `publish.yml` and `pypi.yml` on GitHub-hosted runners; neither workflow needs a local publish.

The `versions` job stops the run unless the tag is `v` followed by the version in both `Cargo.toml` and `pyproject.toml`.
The `wheels` job runs cibuildwheel with the `[tool.cibuildwheel]` table of `pyproject.toml` on Linux `x86_64` and `aarch64`, macOS `arm64` and `x86_64`, and Windows `x86_64`, and tests every wheel.
The `smoke` job installs each platform's wheels into a fresh virtual environment under CPython 3.10, 3.14 and 3.14t, and the sdist under 3.12, and imports the package.
`publish` uploads after every other job has passed.

A pushed tag runs the workflows of the tagged commit, so a tag cut before `pypi.yml` existed, such as `v0.5.0`, does not start it.
Once `pypi.yml` is on the default branch, a manual run with the `tag` input builds and publishes such a tag:

```sh
gh workflow run pypi.yml --ref main -f tag=v0.5.0
```

A deployment branch rule on the `pypi` environment must admit `main` for that run.
A manual run without the input builds and smoke-tests the selected branch and uploads nothing.

## Contact
Report bugs, ask questions and propose changes on the issue tracker at https://github.com/OmniPotentRPC/rgsaddle/issues.
The maintainer is Rohit Goswami (rgoswami@ieee.org), the author listed in `Cargo.toml` and `pyproject.toml`.

## Acknowledgments
The nudged elastic band (NEB) force assembly is ported from eOn [eon2901].
The tangents, springs, projections and climbing-image force keep eOn's branch structure.
They come from eOn's `NEBTangent`, `NEBSpringForce` and `NEBForceProjection`.

Other parts follow existing codes.
AutoNEB follows the window and spring rescaling of the AutoNEB in the Atomic Simulation Environment (ASE).
The Sella sessions follow the optimizer, constraints and eigensolvers of Sella.
`nichols_step` and the Powell update follow i-PI under the MIT option of its licence.

The crate builds on rgmin for its steppers and on linkcell for cutoff neighbour walks.
ndarray, faer and rayon supply arrays, dense linear algebra and threads.
The optional features read structure files with readcon-core and chemfiles.
readcon-db stores traces and restarts.
The `verify` checks use rug, which binds GMP and the GNU Multiple Precision Floating-Point Reliable (MPFR) library.
The Python package is built with nanobind, scikit-build-core and Corrosion.
Its `rgsaddle.ase` module uses ASE.
