LI-NEB: tunneling paths and rates

This tutorial installs an eOn client with job = lineb, runs a three-atom Morse barrier, and then shows how to set up and check the molecular and surface calculations of Ásgeirsson, Arnaldsson and Jónsson, J. Chem. Phys. 148, 102334 (2018). The method, every [Lineb] key and the output formats are described in the LI-NEB reference. The rginstanton theory and comparison page covers the theory and the measured comparison with i-PI and DL-FIND.

Run eonclient --features on the installed client. A build with phase-resolved counts and rate orbit output reports

  rginstanton fixed-energy LI-NEB: enabled
  LI-NEB phase-resolved counts: enabled
  LI-NEB rate orbit output: enabled
  LI-NEB measured turning point: enabled
  LI-NEB image Hessians and rate counts: enabled

Install the Linux client with Pixi

On Linux x86-64 and ARM64, the rg-forge channel provides eOn 3.7.1 with LI-NEB enabled. In an empty directory, create a Pixi workspace and install the client and the readcon Python bindings used to inspect the orbit.

pixi init --channel https://prefix.dev/rg-forge --channel conda-forge
pixi add 'eon==3.7.1' 'readcon==0.23.2'
pixi run eonclient --features
pixi shell

Run the Morse example in that shell. Keep pixi.lock with the calculation to record the package builds.

Install the released Linux wheel

On x86-64 Linux with glibc 2.28 or newer, the CPython 3.12 wheel includes the client and the rginstanton library. Create an environment and install the release from PyPI.

uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install --only-binary eon-akmc 'eon-akmc==3.7.1'
eonclient --features

Keep the environment active to run the Morse example below.

Install the Linux client from the release checkout

The 3.7.1 checkout and source distribution include the rgpot Lennard-Jones and readcon frame-cache corrections. To reproduce a calculation with 3.7.0, build from the v3.7.0 Git checkout as described in the 3.7.0 guide. The 3.7.0 PyPI source archive omitted both corrections.

Use Rust 1.88 or newer, a C++ toolchain, and the native prerequisites in Installation. Run these commands in a fresh Python environment:

git clone --branch v3.7.1 --depth 1 https://github.com/TheochemUI/eOn.git
cd eOn
python -m pip install . readcon
eonclient --features

The installed client can run the Morse example below directly. To use a separately installed rginstanton library, follow the Meson build below.

Build the Linux client from source

Start in the eOn checkout containing examples/lineb-morse. Open the default Pixi shell as described in Installation. In that shell, run the project’s ensure_cbindgen task for the readcon build, which requires cbindgen 0.29.0 or newer. Install the rginstanton C library under a private prefix with the Rust and C/C++ toolchains from that shell.

pixi run ensure_cbindgen
prefix="$PWD/build-lineb-deps"
mkdir -p "$prefix"
git clone --branch v0.1.0 --depth 1 https://github.com/lode-org/rginstanton.git "$prefix/src/rginstanton"
cargo install cargo-c --version 0.10.23 --locked --root "$prefix/tools"
export PATH="$prefix/tools/bin:$PATH"
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="$CC"
(cd "$prefix/src/rginstanton" && cargo cinstall --locked --release --features capi \
  --prefix="$prefix" --libdir="$prefix/lib")
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="$prefix/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
meson setup build-lineb --buildtype=release -Dwith_rginstanton=true
meson compile -C build-lineb
export PATH="$PWD/build-lineb/client:$PATH"
eonclient --features

Keep this shell open for the Morse example so the client can load the same library that Meson checked.

Run a Morse barrier example

Create a run directory for the Morse example.

mkdir -p run/lineb-morse

Save the job settings as run/lineb-morse/config.ini and the three-image seed band as run/lineb-morse/seed.con. From a release checkout, the same files can be copied from examples/lineb-morse/.

(cd run/lineb-morse && eonclient)

Two fixed Pt atoms sit 10 Å apart. A third Pt atom moves between two equivalent binding sites. The three seed frames bracket the barrier at the specified energy of −0.55436031 eV. The job writes the optimized path to run/lineb-morse/lineb.con. With the counted solve API, the first frame gives the action and the cost for the entire band:

import readcon

frame = readcon.read_con("run/lineb-morse/lineb.con")[0]
print(round(frame.metadata["lineb"]["action"], 4))
counts = frame.metadata["evaluation_counts"]
print(counts["surface_calls"])
print(counts["potential_calls"])

The installed Linux client gave an action of 36.6004. Its solver requested 534 surface evaluations, distributed across seeding (104), optimization (9), path preparation (119), dynamics (195), and quadrature (107). The example requests the path only. Its JSON rate field is null.

To try the rate diagnostic, set beads = 8 in the copied [Lineb] section and rerun the client in the same directory. The reference run wrote eight frames to lineb-orbit.con. The rate calculation added 35 surface evaluations, giving 569 solver requests. The separate potential_calls record includes the cost of writing the image energies.

Run the same calculation from Python

The in-process client reads the same config.ini and seed.con as eonclient. Use a pyeonclient build configured with rginstanton. The 0.5.0 Linux wheel omits this backend. Run the following from the repository root with the example copied into run/lineb-morse as shown above.

from pathlib import Path

import pyeonclient
import readcon

work = Path("run/lineb-morse").resolve()
pyeonclient.run_job_in_directory(work)
frame = readcon.read_con(str(work / "lineb.con"))[0]
print(frame.metadata["lineb"]["action"])
print(frame.metadata["evaluation_counts"]["surface_calls"])

With beads = 8, read the eight equal-time frames from work / "lineb-orbit.con" to inspect the rate orbit.

For the image-Hessian approximation in section II.D of the 2018 paper, set interpolated_hessian = true in [Lineb]. The solver computes Cartesian Hessians by central differences at the optimized path images and interpolates them to the rate beads. The default computes the curvature at the beads. The choice is independent of the orbit clock. Set image_hessian_step to a positive displacement in Å to control the finite differences at the images. Zero selects the solver default.

The job records the chosen method in lineb.hessian. With the counted rate interface, lineb.rate_calls.curvature and lineb.rate_calls.bead separate curvature evaluations from bead energy/gradient evaluations. These are subdivisions of surface_calls.rate. Include that rate total once when comparing the cost of a reactive flux.

Prepare published calculations

The eOn job uses the number of frames in initial_path as the number of LI-NEB images. Both setups below seed the band from a path that crosses the target energy on each side of the saddle.

Ammonia-borane energy ladder

To set up Figure 4 of the paper, start from the molecular minimum-energy path (MEP). Use the saddle energy measured with the same potential and energy zero as the band. Set energy to that value minus 0.05 eV for the first level. Write ten ordered seed frames with readcon, spanning both crossings and following the shape of the MEP. Keep the B, N and six H atoms mobile. At each lower energy, use the preceding optimized band to seed the search and extend it along the reaction path far enough to bracket the new turning surfaces.

The following entries supplement initial_path and energy in the molecular job. They express the paper’s dimensionless-action controls using a reference mass of 1 amu and eOn’s default hbar = 0.06466. Section II.B aligns each molecular image with its preceding neighbor by a mass-weighted rigid fit. Select this convention with adjacent_alignment = true.

[Lineb]
molecular = true
adjacent_alignment = true
linear_seed = false
endpoint_convergence = true
projected_verlet = true
spring = 1.2932
endpoint_kappa = 6.466
opt_tol = 0.0006466
perp_tol = 0.0006466
interpolated_force_clock = true
beads = 240
interpolated_hessian = true
image_hessian_step = 0.005

The 0.005 Å displacement is a reconstruction choice for the image Hessians. Read the temperature for each level from the computed period. A fixed-temperature comparison with another instanton solver should use that temperature. To compare fixed energies as well, evaluate both orbits on the same potential and check their inferred tunneling energies.

H₂ on Cu(110)

The eOn job uses the number of frames in initial_path as the number of LI-NEB images. For the straight initial path used for H₂/Cu(110), locate its two crossings of the target energy, interpolate ten frames along the straight line between them, and pass those frames as the seed. The accuracy of the crossings matters near the saddle. For the frozen Cu(110) reconstruction, following the intrinsic reaction coordinate from the saddle in both directions resolved the first pair of crossings at 0.05 eV below the barrier.

For a frozen Cu substrate with two mobile hydrogen atoms of mass 1.00793 amu, the paper uses a spring of 20 Å⁻² and an endpoint coefficient of 1000 eV⁻¹ Å⁻¹ for the dimensionless action. With eOn’s default hbar, the corresponding inputs for projected velocity Verlet are

[Lineb]
linear_seed = true
endpoint_convergence = true
projected_verlet = true
spring = 1.28291
endpoint_kappa = 64.3993
opt_tol = 0.000643993
perp_tol = 0.000643993

Supply initial_path and an absolute energy from the same potential. These numbers use the fact that every mobile coordinate has the same mass. They convert the published controls and do not establish a converged rate.

Both optimizer tolerances have units of √eV in eOn. They apply to derivatives of the abbreviated action with respect to mass-weighted coordinates. For equal mobile masses $m$, a tolerance $g$ on the Cartesian gradient of the dimensionless action converts to $g\hbar/\sqrt{m}$, as in the hydrogen example above. For a molecule with different atomic masses, each Cartesian gradient component carries its own factor $1/\sqrt{m_a}$ before the norm is taken. Use the force residual in lineb-orbit.con to check stationarity in eV/Å.

Restart from a saved band

A saved turning point can evaluate slightly above or below the target when an electronic-structure calculation starts from a different orbital guess. If both endpoint energies are at or above the target, rginstanton treats the input as a prepared band and relaxes its endpoints toward the turning surfaces. If one end is above and the other below, the prepared-band restart requires both gaps to fit within the solver’s energy roundoff tolerance. A seed extending below the target on both sides lets the solver locate both crossings around the barrier.

If the job reports a missing reactant- or product-side crossing, its error gives the target and both endpoint energies in eV. Subtract the target from each reported energy to see which end needs attention.

To construct a bracketed seed, follow the reaction path outward on the affected side until its endpoint energy falls below the target. Keep an interior image above the target and verify the other crossing. To measure an endpoint separately, write that frame to pos.con with readcon and run an eOn job = point with the same potential and electronic-structure settings. Count these measurements as seed preparation when reporting the total cost. The LI-NEB run locates the turning points for the requested energy from the supplied band.

Analyze a rate run

For an unconstrained nonlinear molecule, rgpycrumbs can read the full orbit through readcon and normalize the rate. Both analysis commands below use rgpycrumbs 1.15.0. Supply the optimized reactant in extended XYZ format with matching species, atom order and isotope masses. Its spectrum JSON supplies the electronic energy in electronic_energy_eV and the $3N-6$ positive internal frequencies in signed_wavenumbers_cm-1. Use the same potential, energy zero and unit conversion for the reactant and the instanton. The native frames record the run’s lineb.hbar, lineb.boltzmann and lineb.molecular settings.

uvx --from rgpycrumbs==1.15.0 \
    rgpycrumbs eon molecular-instanton-rate lineb-orbit.con \
    reactant_spectrum.json reactant.extxyz --confirm-same-energy-zero

The command reports log10_rate_per_s for a single path. For $P$ replicas, write $L$ for the native log flux, $E_r$ for the reactant electronic energy, $\beta=1/(k_BT)$, and $t_0$ for the native time unit in seconds (about $1.018\times10^{-14}$ s in eOn). The natural logarithm of the rate in inverse seconds is

$$ \ln (k/\mathrm{s}^{-1}) = L + \beta E_r - \ln Q_{\mathrm{vib},r}^{(P)}

  • 6\ln P + \tfrac12 \ln(\det I_{\mathrm{ring}}/\det I_r) - \ln(t_0/\mathrm{s}). $$

$Q_{\mathrm{vib},r}^{(P)}$ is the finite-bead harmonic partition function for the internal reactant vibrations. Each of the six rigid reactant directions contributes a free-ring spring factor $1/P$, giving $+6\ln P$ in the rate. Translation cancels at equal mass. The ring inertia uses a common center of mass and weights each replica by $1/P$. Apply symmetry-equivalent path multiplicity separately when comparing with a total rate. Linear molecules and constrained systems require their own rigid-mode partition functions.

The readcon field lineb.spectrum reports the number of retained ring modes and the number with negative eigenvalues for a rate calculation. A path-only job records a null spectrum. A first-order instanton has one negative mode. Check the force residual around the ring as well as the mode count and rate when increasing the number of replicas.

For a rate job (beads > 0), open lineb-orbit.con with readcon. Each frame holds one replica of the full ring in continuous Cartesian coordinates, including the fixed atoms. The fields temperature_K and tau_over_beta give the temperature and the bead’s imaginary time as a fraction of the full period. The second-line JSON records the energy gradients of the mobile atoms at those coordinates, in the order of their CON atom IDs. Returning replicas repeat their outbound partner’s coordinates exactly. The image-Hessian rate requests all bead gradients and an rgpot cache can serve the repeated geometries. The direct bead-Hessian rate reuses its outbound measurements. The diagnostic uses the potential evaluations already counted in the rate.

import readcon

ring = readcon.read_con("lineb-orbit.con")
frame = ring[0].metadata
print(frame["lineb_orbit"]["mobile_atom_ids"])
print(frame["lineb_orbit"]["gradients_eV_per_angstrom"])
print(frame["lineb"]["stationarity"])

For replica $j$ and mobile coordinate $a$, the discrete residual is $R_{ja}=\partial_a V(x_j)+m_a(P/\tau)^2(2x_{ja}-x_{j-1,a}-x_{j+1,a})$. Indices wrap around the ring, $P$ is the number of beads, and $\tau$ is twice the reported half period. max_abs_eV_per_angstrom and rms_eV_per_angstrom summarize all mobile Cartesian components. max_bead and max_axis are zero-based. max_atom_id identifies the CON atom. Compare these values as the path images and bead count increase. A continuum residual requires differentiating the path in continuous imaginary time.

The fixed-energy optimizer tests forces on the band images. The residual above tests the reconstructed equal-time ring used for the rate. A band can satisfy both optimizer tolerances while its ring exceeds the desired Cartesian force tolerance. For a convergence study, hold the target energy and potential fixed, refine the image count and bead count separately, and record the resulting temperature, residual and normalized rate for each run. Use the reported temperature when comparing to a temperature-indexed rate curve. Compare only within the reference curve’s temperature range.

To check both residuals from the saved gradients, run the following command in the job directory. It reads the ring through readcon and uses twice the recorded half-period. It requires no calculator or electronic evaluations.

uvx --from rgpycrumbs==1.15.0 \
    rgpycrumbs eon orbit-residual lineb-orbit.con --compare-discretizations

With the eOn 3.7.1 Linux x86-64 wheel and the eight-bead Morse input, the largest finite-bead residual is 0.022988 eV/Å. It agrees with lineb.stationarity.max_abs_eV_per_angstrom for the same saved orbit. Fourier differentiation gives 0.023337 eV/Å. The diagnostic reports evaluation_counts.geometry_requests = 0 because it reuses the saved gradients.