OCI-NEB: a climbing image with dimer bursts¶
OCI-NEB is the off-path climbing image nudged elastic band method.
It runs a climbing-image nudged elastic band (CI-NEB) and, once the band has relaxed far enough, hands the climbing image to a minimum-mode dimer search for a short burst.
The dimer follows the lowest curvature mode and is free to leave the band, which is the “off-path” of the name; the band then resumes around the point the dimer reached.
The method is described in R. Goswami, M. Gunde and H. Jónsson, “Enhanced climbing image nudged elastic band method with Hessian eigenmode alignment”, Frontiers in Chemistry (2026), doi:10.3389/fchem.2026.1807063.
GPRidge’s controller, gpr/neb/OCINEBController.h, is a port of the eOn NEBOcinebController.
This tutorial explains how OCI-NEB relates to the gp_oie band, then runs plain CI-NEB, a GP-OIE band and OCI-NEB on the same reaction through the C API and reads their reports.
The program is compiled and run by the documentation test.
How a burst works¶
Each outer iteration of the band ends at a hook where the controller decides whether to fire a burst on the climbing image.
The controls are the fields of gpr_ocineb_config_t, from gpr_ocineb_config_defaults():
Trigger. The controller records the band force at the first eligible outer iteration as a baseline and fires once the force has fallen to
trigger_factortimes that baseline (0.31 by default, the optimum of the paper). A positivetrigger_forcereplaces the relative rule by an absolute force; the paper shows that a fixed early handover can send the dimer to a saddle off the reaction path.Alignment. The dimer starts along the band tangent, displaced by
perturb_along_tangent(0.05). The burst continues while the absolute cosine between the rotated dimer axis and the tangent stays at or abovealignment_cos_tol(0.85), and stops when it drops below.Outcome. A burst that converges hands the dimer’s position back to the band as the new climbing image. A burst that finds positive curvature, or whose true-surface force does not improve, restores or hands back the image and the band continues.
dimer_max_rot_iter(10) bounds the rotations per translation;dimer_max_phases,dimer_max_inner_iterandmax_stepsare condition-driven at 0.Convergence. The run converges when the band meets
conv_tolofgpr_neb_config_t;force_tolerance(0.05) is the dimer’s own force criterion.
How it relates to gp_oie¶
gp_oie is the default band mode of gprn and of gpr_neb_config_defaults() (GPR_NEB_GP_OIE).
Its band relaxes on a Gaussian-process (GP) surrogate, and each outer iteration evaluates the true potential at one image, chosen by an acquisition rule; Run a GP-NEB band describes it.
OCI-NEB is not a band mode. It is the burst controller laid over a band. In GPRidge the band can be:
The true potential,
--nebmode standardingprn: classical OCI-NEB as in the paper. Every image is evaluated at every iteration.A GP band,
GPR_NEB_GP_OIEorGPR_NEB_GP_AIE: GP-assisted OCI-NEB. The bursts borrow the band’s GP session, so the dimer reads every observation the band made, and the band reads the dimer’s (GP-NEB to GP-Dimer state transfer). On a GP band the first burst waits until the band’s own state shows that the dimer is the next useful step (MmfHandoffPolicy,--mmf-handoff-policy auto).
gpr_ocineb_search takes the same arguments as gpr_neb_search_gp plus a gpr_ocineb_config_t, and requires a GP mode.
In gprn the switch is --use-mmf true, with --mmf-trigger-factor, --mmf-angle-tol and the other --mmf-* flags of the gprn reference.
On a GP band gprn lowers the alignment tolerance from 0.85 to 0.3 unless --mmf-angle-tol is given, because the GP band tangent is less reliable than the true one; the C API keeps the value of alignment_cos_tol.
The reaction¶
One Lennard-Jones atom (\(\epsilon = \sigma = 1\), reduced units) hops between two hollow sites of a frozen 5 by 4 square layer, across the bridge between them.
The layer spacing is the pair minimum, \(2^{1/6}\), and the energies are relative to the layer alone.
The same system is the C API’s own test of these entries (test_capi_gp_neb).
The plain CI-NEB oracle takes only the adatom’s three coordinates and holds the layer fixed.
The GP searches take all 21 atoms, with the layer marked frozen in a gpr_atoms_t: frozen atoms stay at their R_initial positions, and the kernel sees the ones within actdist_fro of the moving atom.
The program¶
The program runs the three searches on a band of 5 intermediate images with conv_tol 0.05 and checks that both GP searches converge on the CI-NEB barrier, to 0.02, in fewer oracle calls.
#include <gpr/capi/gpridge_c.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#define NX 5
#define NY 4
#define N_FROZEN (NX * NY)
#define N_ATOMS (N_FROZEN + 1)
#define N_COORDS (3 * N_ATOMS)
#define N_IMAGES 5
/* Nearest-neighbour spacing of the layer: the minimum of the LJ pair. */
static const double kSpacing = 1.122462048309373;
typedef struct {
double layer[3 * N_FROZEN];
double layer_energy;
long calls;
} system_t;
/* Lennard-Jones energy and gradient of the layer and the adatom, relative
* to the layer alone. */
static void energy_of(const system_t* s, const double* x, double* e,
double* g)
{
gpr_potential_lj(x, N_ATOMS, 1.0, 1.0, e, g);
*e -= s->layer_energy;
}
/* The oracle of the GP searches: every atom, frozen ones included. */
static void oracle(int n_coords, const double* x, double* e, double* g,
void* user_data)
{
system_t* s = (system_t*)user_data;
(void)n_coords;
++s->calls;
energy_of(s, x, e, g);
}
/* The oracle of the plain band: the adatom only, the layer held fixed. */
static void adatom_oracle(int n_coords, const double* x, double* e, double* g,
void* user_data)
{
system_t* s = (system_t*)user_data;
double full[N_COORDS], grad[N_COORDS];
(void)n_coords;
++s->calls;
memcpy(full, s->layer, sizeof s->layer);
memcpy(full + 3 * N_FROZEN, x, 3 * sizeof(double));
energy_of(s, full, e, grad);
memcpy(g, grad + 3 * N_FROZEN, 3 * sizeof(double));
}
/* Steepest descent of the adatom into the hollow below its start. */
static void relax_adatom(system_t* s, double* adatom)
{
double full[N_COORDS], grad[N_COORDS], e;
int it, k;
memcpy(full, s->layer, sizeof s->layer);
for (it = 0; it < 40000; ++it) {
double norm = 0.0;
memcpy(full + 3 * N_FROZEN, adatom, 3 * sizeof(double));
energy_of(s, full, &e, grad);
for (k = 0; k < 3; ++k) {
norm += grad[3 * N_FROZEN + k] * grad[3 * N_FROZEN + k];
adatom[k] -= 0.004 * grad[3 * N_FROZEN + k];
}
if (norm < 1e-20) break;
}
}
static gpr_neb_config_t band(gpr_neb_mode_t mode)
{
gpr_neb_config_t config = gpr_neb_config_defaults();
config.mode = mode;
config.verbose = 0;
config.use_idpp = 0;
config.climbing_image = 1;
config.conv_tol = 0.05;
config.max_outer_iter = mode == GPR_NEB_STANDARD ? 2000 : 150;
return config;
}
static int report_of(gpr_neb_t result, gpr_neb_report_t* report)
{
memset(report, 0, sizeof *report);
report->struct_size = sizeof *report;
return gpr_neb_result_report(result, report);
}
int main(void)
{
system_t s;
double grad[N_COORDS], initial[N_COORDS], final_state[N_COORDS];
double hollow_a[3] = {1.5 * kSpacing, 1.5 * kSpacing, 0.8}, hollow_b[3];
int is_frozen[N_ATOMS], i, j;
long plain_calls, oie_calls;
double plain_barrier;
gpr_atoms_config_t atoms_config = gpr_atoms_config_defaults();
gpr_neb_config_t plain_config = band(GPR_NEB_STANDARD);
gpr_neb_config_t gp_config = band(GPR_NEB_GP_OIE);
gpr_ocineb_config_t oci = gpr_ocineb_config_defaults();
gpr_neb_report_t report;
gpr_atoms_t atoms;
gpr_neb_t result;
if (GPR_ABI_CHECK() != GPR_SUCCESS) return 1;
/* A frozen square layer and an adatom that hops between two hollows
* across the bridge at x = 2a. */
for (j = 0; j < NY; ++j)
for (i = 0; i < NX; ++i) {
double* p = s.layer + 3 * (j * NX + i);
p[0] = i * kSpacing;
p[1] = j * kSpacing;
p[2] = 0.0;
}
gpr_potential_lj(s.layer, N_FROZEN, 1.0, 1.0, &s.layer_energy, grad);
relax_adatom(&s, hollow_a);
hollow_b[0] = 4.0 * kSpacing - hollow_a[0];
hollow_b[1] = hollow_a[1];
hollow_b[2] = hollow_a[2];
memcpy(initial, s.layer, sizeof s.layer);
memcpy(final_state, s.layer, sizeof s.layer);
memcpy(initial + 3 * N_FROZEN, hollow_a, sizeof hollow_a);
memcpy(final_state + 3 * N_FROZEN, hollow_b, sizeof hollow_b);
/* 1. Plain climbing-image NEB on the true surface. */
s.calls = 0;
result = gpr_neb_search(adatom_oracle, &s, hollow_a, hollow_b, 3,
N_IMAGES, &plain_config);
if (!result || !gpr_neb_result_converged(result)) return 1;
plain_calls = s.calls;
plain_barrier = gpr_neb_result_barrier(result);
printf("CI-NEB barrier %.4f oracle calls %ld\n", plain_barrier,
plain_calls);
gpr_neb_result_destroy(result);
/* The GP searches take every atom; the layer is frozen. */
for (i = 0; i < N_ATOMS; ++i) is_frozen[i] = i < N_FROZEN;
atoms_config.n_atoms_total = N_ATOMS;
atoms_config.is_frozen = is_frozen;
atoms = gpr_atoms_create(&atoms_config);
if (!atoms) return 1;
/* 2. GP-OIE: the band on the GP, one oracle call per outer iteration. */
s.calls = 0;
result = gpr_neb_search_gp(oracle, &s, atoms, NULL, initial, final_state,
N_COORDS, N_IMAGES, &gp_config);
if (!result || report_of(result, &report) != GPR_SUCCESS) return 1;
oie_calls = s.calls;
printf("GP-OIE barrier %.4f oracle calls %ld outer iterations %ld\n",
report.barrier, oie_calls, report.outer_iterations);
if (!report.converged || fabs(report.barrier - plain_barrier) > 0.02)
return 1;
gpr_neb_result_destroy(result);
/* 3. OCI-NEB: the same GP-OIE band, with dimer bursts that move the
* climbing image off the band onto the saddle. */
s.calls = 0;
result = gpr_ocineb_search(oracle, &s, atoms, NULL, initial, final_state,
N_COORDS, N_IMAGES, &gp_config, &oci);
if (!result || report_of(result, &report) != GPR_SUCCESS) return 1;
printf("OCI-NEB barrier %.4f oracle calls %ld (band %ld, dimer %ld) "
"bursts %ld\n",
report.barrier, s.calls, report.oracle_calls,
report.dimer_oracle_calls, report.mmf_bursts);
if (!report.converged || report.callback_calls != s.calls ||
fabs(report.barrier - plain_barrier) > 0.02)
return 1;
gpr_neb_result_destroy(result);
gpr_atoms_destroy(atoms);
if (oie_calls >= plain_calls || s.calls >= plain_calls) return 1;
printf("both GP bands used fewer oracle calls than CI-NEB\n");
return 0;
}
The lines that start with [ocineb] are the controller’s report of each burst.
The run that checked this page printed:
CI-NEB barrier 1.3389 oracle calls <n>
GP-OIE barrier 1.3389 oracle calls <n> outer iterations <n>
...
[ocineb] burst: status=-1 force <s> -> <s> alignment=<s> threshold=<s> oracle+=<n>
OCI-NEB barrier 1.3389 oracle calls <n> (band <n>, dimer <n>) bursts <n>
both GP bands used fewer oracle calls than CI-NEB
Reading the result¶
In the run that checked this page, plain CI-NEB took 137 oracle calls, the GP-OIE band 19, and OCI-NEB 27: 21 for the band and 6 for two bursts.
Both bursts ended with status-1=.
The two symmetry-equivalent endpoints tie, so the signal-variance prior is the variance of the energies rather than their round-off median absolute deviation; the dimer steps then exceed the surrogate’s displacement trust radius, the controller hands the image back, and the band goes on.
It still converges to the same bridge saddle.
A prior centred on that round-off used to hold the signal variance near 1e-28 eV², and that longer search was the one whose third burst ended at status=0.
The fields of gpr_neb_report_t, from gpr_neb_result_report, that matter here:
Field |
Meaning |
|---|---|
|
1 when the band met |
|
Energy of the highest image minus that of the first |
|
The band’s evaluations: endpoints, design points, acquisitions |
|
The evaluations of the bursts |
|
Every evaluation, band and bursts together; the program checks it |
|
Number of bursts |
|
1 when at least one burst ran |
|
Outer iterations of the band |
On this small system the GP band alone already converges in fewer calls than OCI-NEB, and on this symmetric hop the bursts are rejected while the band’s own climbing image is the saddle. When a GP band stalls next to the saddle, or its climbing image converges onto a ridge instead of the saddle, a burst the surrogate trusts is what moves the image. Measure both on your system before choosing.
Where to go next¶
The C API reference documents
gpr_neb_search_gpandgpr_ocineb_searchwith the conventions for frozen atoms.C++: a GP-NEB band on a Lennard-Jones cluster runs
GP_OIEfrom C++.Python API: a first dimer search runs the dimer on its own.