How to: Run GP-NEB with OIE Acquisition¶
1 GP-Accelerated Nudged Elastic Band¶
The GP-NEB method reduces the number of oracle (energy/force) evaluations needed to converge a minimum energy path. Three modes are available:
Mode |
Oracle calls/iter |
Best for |
|---|---|---|
Standard |
All images |
Cheap potentials, baseline |
AIE |
All images + GP inner relaxation |
Moderate potentials |
OIE |
1-3 images (acquisition-selected) |
Expensive DFT |
1.1 Quick start (C++)¶
#include <gpr_optim/NEBPath.h>
#include <gpr_optim/AnalyticalPotentials.h>
// Muller-Brown oracle
auto oracle = [](const Eigen::VectorXd& x) {
std::vector<double> xy = {x(0), x(1)};
auto [e, g] = gpr::potentials::muller_brown_energy_gradient(xy);
return std::make_pair(e, Eigen::Map<Eigen::VectorXd>(g.data(), 2));
};
// Set up GP-NEB
gpr::neb::GPNEBConfig config;
config.mode = gpr::neb::NEBMode::OIE;
config.max_outer_iter = 50;
config.conv_tol = 0.01;
config.evals_per_iter = 1;
config.acquisition = gpr::neb::AcquisitionType::ThompsonSampling;
config.climbing_image = true;
Eigen::VectorXd min1(2), min2(2);
min1 << -0.558, 1.442; // Muller-Brown minimum 1
min2 << 0.623, 0.028; // Muller-Brown minimum 2
auto result = gpr::neb::gpNEB(oracle, min1, min2, 7, config);
std::cout << "Converged: " << result.converged << "\n";
std::cout << "Oracle calls: " << result.oracle_calls << "\n";
std::cout << "Barrier energy: " << result.barrier_energy << "\n";
1.2 Acquisition strategies¶
The OIE mode selects which image to evaluate next. Four strategies:
ThompsonSampling is recommended for most cases. It naturally transitions
from exploration (early, high uncertainty) to exploitation (late, low
uncertainty).
1.3 IDPP path initialization¶
For molecular systems, use IDPP instead of linear interpolation:
gpr::neb::NEBPath path(initial, final_state, 7, 0.1);
path.initializeIDPP(n_atoms, false); // per-image IDPP
path.initializeIDPP(n_atoms, true); // collective S-IDPP with springs
1.4 Triplet evaluation¶
For better tangent accuracy in OIE mode, evaluate {i-1, i, i+1} instead of just image i:
config.use_triplet = true;
config.evals_per_iter = 3;