class atmd::AtomicDimer

Overview

Atomic dimer. More…

#include <gpr/AtomicDimer.h>
 
class AtomicDimer {
public:
    // structs
 
    struct AccurateObservationResult;
    struct DimerPhaseRecord;
    struct InterAtomicTrustDistance;
    struct LocalPotentialReference;
    struct SurrogateSpectrum;
    struct VarianceGateConfig;
    struct early_stopping_t;
 
    // fields
 
    gpr::AtomsConfiguration atoms_config;
 
    // construction
 
    AtomicDimer();
    virtual ~AtomicDimer();
 
    // methods
 
    void initialize(const gpr::InputParameters& parameters, const gpr::Observation& initial_data, const gpr::Observation& middle_point, const gpr::Coord& initial_orientation, const gpr::AtomsConfiguration& init_atom_config);
    void setAtomsConfiguration(const gpr::AtomsConfiguration& _atoms_config);
    void execute(pot::PotentialWrapper& general_potential);
    void setSecantHessianConfig(const gpr::optim::SecantHessianConfig& config);
    void setSecantOrientationSeed(bool enabled);
    const gpr::optim::SecantHessian& secantHessian() const;
    gpr::optim::SecantCurvatureCounts secantCounts() const;
    gpr::optim::SecantCurvatureCounts secantLedger() const;
    void setMaxWallSeconds(double seconds);
    void setWallClockLimit(std::shared_ptr<const gpr::WallClockLimit> limit);
    void setTrainingPolicy(const gpr::policy::TrainingPolicy* policy);
    void setTrainingPolicy(std::shared_ptr<const gpr::policy::TrainingPolicy> policy);
    bool wallClockLimitReached() const;
    void stopForWallClockLimit();
    bool certifyStoppedForce(pot::PotentialWrapper& potential, double step, int& calls);
    void setForceStopCertificateStep(double step);
    void setVibrationalStencil(gpr::optim::VibrationalStencil mode);
    gpr::optim::VibrationalStencil vibrationalStencil() const;
    double forceStopCertificateStep() const;
    bool getForceStopCertified() const;
    int getForceStopCertificateCalls() const;
    bool hasValidAtomsConfiguration();
    double getFinalRotationAngle() const;
    double getLatestModeCurvature() const;
    const gpr::Observation& finalMidpoint() const;
    bool isMinModeAngleCertified() const;
    double getFinalRotationResidual() const;
    bool measuredModeIsCertified() const;
    bool terminalModeIsReady() const;
    void refineMeasuredModeCurvature(const gpr::Observation& midpoint, const gpr::Coord& orientation, pot::PotentialWrapper& potential, double surrogate_curvature);
    Eigen::VectorXd getFinalGradientAtMidPoint() const;
    Eigen::VectorXd getFinalForceAtMidPoint() const;
    double getFinalForceNormForConvergence() const;
    Eigen::VectorXd getFinalCoordOfMidPoint() const;
    bool restartFromHigherOrderPoint(const Eigen::MatrixXd& cartesian_hessian, const Eigen::VectorXd& kick, const gpr::Observation& measured_rows, pot::PotentialWrapper& potential);
    bool refineSaddleFromMeasuredHessian(const Eigen::MatrixXd& cartesian_hessian, pot::PotentialWrapper& potential, double resolution = 0.0);
    bool refineSaddleFromMeasuredHessian(const Eigen::MatrixXd& cartesian_hessian, pot::PotentialWrapper& potential, gpr::Observation* raw_candidate, double resolution = 0.0, bool complete_stencil = false);
    bool commitExternallyCertifiedRefinement(const gpr::Observation& raw_center, const Eigen::MatrixXd& certified_cartesian_hessian, const Eigen::MatrixXd& certified_mass_weighted_basis, bool first_order_certificate);
    bool hasUnconditionedObservations() const;
    bool restartAlongWeakMode(const Eigen::VectorXd& direction, double length, const gpr::Observation& measured_rows, pot::PotentialWrapper& potential);
    bool restartAlongWeakMode(const Eigen::VectorXd& direction, double length, const gpr::Observation& measured_rows, pot::PotentialWrapper& potential, const Eigen::MatrixXd& cartesian_hessian);
    gpr::Index_t getTotalForceCalls() const;
    bool measureCurvatureProbes(const gpr::Coord& positions, pot::PotentialWrapper& potential, gpr::Observation& raw);
    gpr::Index_t getTotalGPRForceCalls() const;
    gpr::Index_t getIterations() const;
    double getFinalEnergy() const;
    double getFinalCurvature() const;
    bool getConverged() const;
    double getMaxStepLength() const;
    double getConvergenceForce() const;
    void setConvergenceForce(double force);
    double convergenceForceNorm(const Eigen::Ref<const Eigen::RowVectorXd>& positions, const Eigen::Ref<const Eigen::RowVectorXd>& gradient) const;
    const gpr::Coord& getFinalOrientation() const;
    const std::vector<DimerPhaseRecord>& getPhaseHistory() const;
    DimerRelaxationTerminationReason getRelaxationTerminationReason() const;
    Eigen::MatrixXd getMeasuredIndexZeroHessian() const;
    double getMeasuredIndexZeroResolution() const;
    Eigen::MatrixXd gpMeanHessianAtMidpoint();
    DimerSurrogateActionCertificate previewFirstSurrogateAction(const gpr::Observation& oracle_middle_point, const gpr::Coord& initial_orientation);
    const DimerSurrogateActionCertificate& getFirstSurrogateActionCertificate() const;
    gpr::Coord& getMidPointCoordForAllObservationPointsRef();
    gpr::FieldMatrixd& getEnergyForAllObservationPointsRef();
    gpr::Coord& getGradientForAllObservationPointsRef();
    gpr::GaussianProcessRegression* getGPRModel();
    void preserveSeedKernel();
    void attachExternalGP(gpr::GaussianProcessRegression* external_gp);
    gpr::Index_t getNumNewObservations() const;
    gpr::Index_t getInitialObservationCount() const;
    gpr::FieldMatrixd getEnergyZeroLevel() const;
    void callGeneralPotentialFromEON(const gpr::vector3_reg(&) cell_dimensions[3], gpr::Observation& mid_point, pot::PotentialWrapper& potential);
    bool isFinalConvergenceReached(const gpr::Observation& middle_point, const double stop_criteria);
    bool isRotationalConvergenceReached(const gpr::Coord& orient, gpr::Observation& middle_point);
    bool isApproximateRotationalConvergenceReached(const gpr::Coord& orient, const gpr::Observation& approx_obs, const double stop_criteria);
    bool rotateDimer(const double stop_criteria, gpr::Coord& orient, gpr::LBFGSInfo& rot_info, gpr::Observation& middle_point, gpr::Observation& approx_obs);
    void translateDimer(const gpr::Observation& middle_point, const gpr::Coord& orient, const gpr::Observation& approx_obs, const double curvature, gpr::LBFGSInfo& trans_info, gpr::Coord& R_new);
    bool updateActiveFrozenAtoms(const gpr::Coord& R_new, gpr::LBFGSInfo& rot_info, gpr::LBFGSInfo& trans_info);
    void setVarianceGateConfig(const VarianceGateConfig& cfg);
    const VarianceGateConfig& getVarianceGateConfig() const;
    void setVarianceAcceptTau(double tau);
    void writeTraceFrame(const gpr::Observation& obs, const std::string& phase, size_t idx);
    void archiveObservations(const gpr::Observation& obs);
    double getVarianceAcceptTau() const;
    void setVarianceAcceptTauRelative(double tau_relative);
    double getVarianceAcceptTauRelative() const;
    gpr::Index_t getVarianceSkippedAccurateCalls() const;
    gpr::Index_t getImspeSoftSkippedCalls() const;
    gpr::Index_t getImspeFixedThetaRefreshCalls() const;
    gpr::Index_t getFixedThetaRefreshCalls() const;
    gpr::Index_t getImspeAdmittedNearDuplicateObservations() const;
    gpr::Index_t getDedupRejectedObservations() const;
    void setAlignmentAbortTol(double tol);
    void setAbortOnDegenerateProbes(bool enabled);
    void setMaxOracleCalls(gpr::Index_t calls);
    gpr::Index_t maxOracleCalls() const;
    void setIndexFrequencyResolution(double wavenumber);
    double indexFrequencyResolution() const;
    void setRejectHigherIndexSurrogateConvergence(bool enabled);
    bool measuredIndexRecoveryEnabled() const;
    void setExternalTerminalCertificate(bool enabled);
    Eigen::Index lastNegativeModeCount() const;
    void setMeasuredEnergyCeiling(double ceiling);
    void setSaddleEnergyFloor(double floor);
    bool lastRefinementReachedIndexOne() const;
    void setAbortOnInteratomicCollapse(bool enabled);
    void setPreserveInitialAlignmentReference(bool enabled);
    void setLikelihoodNoiseFloorSigma2(double floor_sigma2);
    void setSelfOwnedModelProfile(gpr::GPModelProfile profile);
    void setSelfOwnedUseZblPriorMean(bool use);
    void setSelfOwnedUseFfPriorMean(bool use);
    double getAlignmentAbortTol() const;
    void setLeashRelaxWhenClose(bool enabled);
    bool getLeashRelaxWhenClose() const;
    void setEvaluateImage1EachPhase(bool enabled);
    bool getEvaluateImage1EachPhase() const;
    void setConvergenceForceNorm(int norm_type);
    void setProjectRigidModesForConvergence(bool enabled);
    void setOracleBatchChunk(Eigen::Index chunk);
    Eigen::Index getOracleBatchChunk() const;
    void setProfilePhaseTiming(bool enabled);
    bool getProfilePhaseTiming() const;
    void setProfileDimerTimes(bool enabled);
    bool getProfileDimerTimes() const;
    void setUseHssvdAnalyticCurvature(bool enabled);
    bool getUseHssvdAnalyticCurvature() const;
    void setHssvdModeSelectionPolicy(HssvdModeSelectionPolicy policy);
    gpr::Index_t activeSetChangeCount() const;
    gpr::Index_t activeFrozenCount() const;
    void setHdf5TracePath(const std::string& path);
    void setUncertaintyAwareRotation(bool enabled);
    void setProjectMeasuredRotations(bool enabled);
    void setKappaDimer(double beta);
    double kappaDimerBeta() const;
    const std::string& getHdf5TracePath() const;
    void setHdf5TraceEnabled(bool enabled);
    bool hdf5TraceEnabled() const;
};

Detailed Documentation

Atomic dimer.

Fields

Configuration of atoms

Construction

AtomicDimer()

Default constructor.

Methods

void initialize(const gpr::InputParameters& parameters, const gpr::Observation& initial_data, const gpr::Observation& middle_point, const gpr::Coord& initial_orientation, const gpr::AtomsConfiguration& init_atom_config)

Initilalize with initial data.

Parameters:

parameters

Structure of parameters from the input file

initial_data

Initial observation (energy, gradients, positions)

middle_point

Initial observation at the middle point (energy, gradients, positions)

initial_orientation

Initial orientation of the dimer

init_atom_config

Structure with initial configuration of atoms

void setAtomsConfiguration(const gpr::AtomsConfiguration& _atoms_config)

Set configuration of the atoms.

Parameters:

_atoms_config

A reference configuration

void execute(pot::PotentialWrapper& general_potential)

This function uses the atomic GP-dimer method to converge to a saddle point, starting from somewhere inside the convergence area.

The relaxation of the dimer on the approximated energy surface is done according to a dimer method, where a rotation step rotates the dimer (a pair of images) towards its minimum energy orientation to find the lowest curvature mode of the potential energy and translation step moves the dimer towards the saddle point by inverting the force component in the direction of the dimer. After each relaxation phase, the energy and gradient are acquired at the middle point of the dimer, and the GP hyperparameters are reoptimized.

Parameters:

general_potential

Reference to a class of general potential or to the object of Matter class (in a case of coupling with EON)

void setSecantHessianConfig(const gpr::optim::SecantHessianConfig& config)

Replace the true-force secant and drop its history.

void setSecantOrientationSeed(bool enabled)

A caller that already seeded the orientation from a secant of its own turns this off, so the dimer’s secant, replayed from whatever rows it was handed, does not replace that seed. The Hessian seeds are kept.

gpr::optim::SecantCurvatureCounts secantLedger() const

Pair, probe and rejection counts, without the GP’s quadratic-mean uses.

void setMaxWallSeconds(double seconds)

Set a wall-clock cap measured from this call. Non-positive disables.

void setWallClockLimit(std::shared_ptr<const gpr::WallClockLimit> limit)

Share an enclosing deadline (used by OCI-NEB and deterministic tests).

void setTrainingPolicy(const gpr::policy::TrainingPolicy* policy)

Not owned. The pointer must outlive execute(). Null is the engine.

void setTrainingPolicy(std::shared_ptr<const gpr::policy::TrainingPolicy> policy)

Keeps a Python adapter alive for execute(), which releases the GIL.

void stopForWallClockLimit()

Mark a deadline raised by certificate/refinement work outside execute(). Restores the latest measured midpoint when one is available.

bool certifyStoppedForce(pot::PotentialWrapper& potential, double step, int& calls)

One Cartesian stencil after the force loop has stopped, then a min-mode escape when that stencil is higher-order. calls counts those evaluations, which go through the search’s counted and budgeted oracle path. True only when a measured stencil certifies a first-order saddle; an unmeasured stop is uncertified.

void setForceStopCertificateStep(double step)

Displacement of the index stencil execute() measures at a force stop before it reports convergence. Defaults to defaultStencilStep(). Zero, or setExternalTerminalCertificate(true), hands the certificate to the caller: execute() then reports the force stop, and the caller must certify it before claiming a saddle.

void setVibrationalStencil(gpr::optim::VibrationalStencil mode)

Full measures every coordinate of the force-stop stencil. Vibrational measures vibrationalStencilDirections. Both displace every coordinate of a lone atom.

bool getForceStopCertified() const

Whether the last execute() certified its force stop as index one.

int getForceStopCertificateCalls() const

Oracle evaluations the last execute() spent on its force-stop certificate, including escapes. They are part of getNumEvaluations().

bool hasValidAtomsConfiguration()

Whether the atoms configuration holds the moving-atom set that execute() needs.

execute() returns without searching when this is false; callers that bind the dimer to another language use it to report that as an error.

double getFinalRotationAngle() const

Min-mode rotational angle omega (radians) at the converged midpoint, or NaN if no converged phase recorded it. A small omega means the dimer axis is aligned with the true lowest-curvature eigenvector, so the caller can certify a flat saddle on angle + negative curvature rather than force alone.

double getLatestModeCurvature() const

Latest min-mode curvature from a dimer rotation. The force-stop stencil records the returned curvature separately in getFinalCurvature().

const gpr::Observation& finalMidpoint() const

Midpoint recorded at the end of execute().

bool isMinModeAngleCertified() const

True iff the converged min-mode is angle-certified: a converged phase recorded a finite rotation omega within the dimer’s own true-PES rotation tolerance (stop_citeria_dimer.angle_rotation) AND the converged curvature is negative (a real saddle direction). Uses the tolerance the dimer already rotated to no new constant.

double getFinalRotationResidual() const

Measured eigen-residual of the terminal mode in the convergence force norm: the gradient difference across the dimer after removing its component along the mode. Infinite until a converged phase records it.

bool measuredModeIsCertified() const

The recorded terminal mode has negative curvature and either its rotation angle is within the angle tolerance or the measured rotation sequence at its midpoint stopped lowering the residual.

bool terminalModeIsReady() const

A resolved negative direction suffices for handback when the caller certifies the complete Hessian. Standalone searches require the measured mode’s rotation certificate.

void refineMeasuredModeCurvature(const gpr::Observation& midpoint, const gpr::Coord& orientation, pot::PotentialWrapper& potential, double surrogate_curvature)

Refine the measured mode curvature with a second image at twice the dimer separation when the single forward difference is within the surrogate’s disagreement with it; one oracle call.

Eigen::VectorXd getFinalGradientAtMidPoint() const

Return the final gradient dE/dR at the middle point.

The dimer stores gradients, so this is the negative of the force.

Eigen::VectorXd getFinalForceAtMidPoint() const

Deprecated alias of getFinalGradientAtMidPoint().

Despite the name it returns the gradient, not the force. Kept so existing callers keep their values; use the gradient name, or negate the result for the force.

double getFinalForceNormForConvergence() const

Return final force in the configured convergence norm.

Eigen::VectorXd getFinalCoordOfMidPoint() const

Return final coordinates of the middle point.

bool restartFromHigherOrderPoint(const Eigen::MatrixXd& cartesian_hessian, const Eigen::VectorXd& kick, const gpr::Observation& measured_rows, pot::PotentialWrapper& potential)

From a converged midpoint the complete stencil shows to be a higher-order saddle: retain the measured rows along its weak negative mode, refit, and run the order-one search on the surrogate from the stencil Hessian (Cartesian, eV/A^2), started one stencil separation along kick on the side the surrogate ranks lower. The returned point is measured, and the next execute starts from it.

bool refineSaddleFromMeasuredHessian(const Eigen::MatrixXd& cartesian_hessian, pot::PotentialWrapper& potential, double resolution = 0.0)

From a converged midpoint whose complete stencil shows a soft second negative mode (a weak mode resolved by the refinement, or a coarse curvature within twice the resolution): the force along it stays below the convergence threshold over displacements far longer than a dimer step, so a force-driven search stops anywhere on that ridge. Starting from the measured cartesian_hessian (eV/A^2), partitioned rational-function steps on the oracle maximize along the lowest mode and minimize along all others, with a Bofill update of a mass-weighted model from each measured gradient, rigid motion projected at the current geometry, and a Cartesian trust radius that starts at the translation limit. The two-sided defect of the modelled energy change over the clamped step, beyond the energy a force at the convergence threshold makes over the step in the configured norm, scores each step under the scale-free trust-region thresholds: a low score rejects the step and halves the radius, a high score after a clamped step restores it. The translation limit bounds the whole step on an inferred model. With complete_stencil, for a Hessian measured on every coordinate, it bounds the largest atomic displacement of the step, so the radius may reach the length at which the most displaced atom moves by the limit. After a rejected step, and before an index-one model ends the walk, the model’s two lowest modes, and every further mode whose curvature lies within resolution (eV/(A^2 amu), the empirical resolution of the measurement that produced the Hessian) of zero, are measured by one Hessian action each at the dimer separation. With a positive resolution the walk was seeded by a complete stencil and ends at one, so an index-one model is then tested by the stencil’s own four-point difference along the two steering modes (eight calls): a second curvature that is negative beyond its truncation error keeps the walk going. The walk takes the dimer’s outer-iteration limit and oracle budget. It stops once the measured model has index one and the force is inside the tolerance, when the radius falls below coordinate resolution, or at the saddle energy floor; the floor and a walk without a step return false and leave the midpoint to the order-one restart, every other end hands the end point to the next search. One oracle call per step; the probes stay out of the training set, the end point becomes its only new row, and the next execute starts from it along the model’s lowest mode.

bool refineSaddleFromMeasuredHessian(const Eigen::MatrixXd& cartesian_hessian, pot::PotentialWrapper& potential, gpr::Observation* raw_candidate, double resolution = 0.0, bool complete_stencil = false)

Return the exact raw oracle endpoint in packed moving coordinates when an index-one refinement ends strictly inside the force tolerance. This measurement carries no physical-frame or terminal certificate; the two-argument overload retains the same walk and handoff behavior.

bool commitExternallyCertifiedRefinement(const gpr::Observation& raw_center, const Eigen::MatrixXd& certified_cartesian_hessian, const Eigen::MatrixXd& certified_mass_weighted_basis, bool first_order_certificate)

Commit the same endpoint under the caller’s complete first-order certificate and mass-weighted physical frame. The caller establishes matching oracle, cell, atom order and complete allowed coordinate space. The frame may be nonorthonormal; its mass-weighted Gram matrix selects the mode, which is reported as a Cartesian unit direction and Rayleigh curvature. This performs no evaluation, archive write, training admission or posterior fit. Raw energies are absolute and must roundtrip exactly through the retained energy gauge; the retained endpoint remains unconditioned in the GP. With initialized MPI this is collective: one rank’s refusal prevents every rank’s commit.

bool hasUnconditionedObservations() const

Retained measurements require conditioning before a posterior can represent the current observed data. The raw model accessor exposes its existing fitted state independently of the measured final point.

bool restartAlongWeakMode(const Eigen::VectorXd& direction, double length, const gpr::Observation& measured_rows, pot::PotentialWrapper& potential)

The complete stencil cannot certify the weak modes of the converged midpoint positive. The curvature of the softest weak mode changes along the flat valley it spans; the search continues from the point length along the unit Cartesian direction, signed so that the curvature rises. The refinement rows become training rows, the moved point is measured, and the next execute starts from it. A supplied Cartesian Hessian carries a measured negative subspace into fresh index probes before the search returns for a complete stencil.

gpr::Index_t getTotalForceCalls() const

Return the total number of force calls.

bool measureCurvatureProbes(const gpr::Coord& positions, pot::PotentialWrapper& potential, gpr::Observation& raw)

Measure an all-moving Cartesian probe batch, one geometry per row. Every rank participates; the root supplies the positions and each point has one owner. Scalar engine calls preserve pointwise values. A batch that exceeds the remaining oracle budget makes no calls. Successful raw rows retain absolute energies and physical gradients in the archive without entering the GP training set. Refusal or an owner failure clears raw; every attempted point is still counted.

gpr::Index_t getTotalGPRForceCalls() const

Return the total number of force calls.

gpr::Index_t getIterations() const

Return the total number of cycles.

This is essentially the number of relaxation phases

double getFinalEnergy() const

Return final energy.

double getFinalCurvature() const

Return final curvature.

bool getConverged() const

Return true when the final force convergence criterion is met.

double getMaxStepLength() const

The bound of one translation step in Cartesian length (Angstrom).

double getConvergenceForce() const

Force norm below which the dimer search is converged.

void setConvergenceForce(double force)

Replace the configured true-PES force criterion and the live stop.

double convergenceForceNorm(const Eigen::Ref<const Eigen::RowVectorXd>& positions, const Eigen::Ref<const Eigen::RowVectorXd>& gradient) const

gradient in the norm the convergence test applies at positions.

const gpr::Coord& getFinalOrientation() const

Return final orientation of the dimer.

const std::vector<DimerPhaseRecord>& getPhaseHistory() const

Return the per-phase dimer trajectory history.

Eigen::MatrixXd getMeasuredIndexZeroHessian() const

Cartesian Hessian of the complete measured expansion at the midpoint a MeasuredIndexZero relaxation stopped on, rigid directions zero. Empty after any other termination.

double getMeasuredIndexZeroResolution() const

Empirical resolution in the mass-weighted physical space of the walk (eV/(A^2 amu)); zero after any other termination.

Eigen::MatrixXd gpMeanHessianAtMidpoint()

Hessian of the fitted posterior mean at the final midpoint, on all 3N Cartesian coordinates (eV/A^2), symmetrized; empty without a fitted model or a midpoint. No oracle call: the surrogate’s own curvature, which proposes where a measurement should look.

DimerSurrogateActionCertificate previewFirstSurrogateAction(const gpr::Observation& oracle_middle_point, const gpr::Coord& initial_orientation)

Evaluate exactly one GP-surrogate relaxation action without invoking the accurate potential. The initialized dimer parameters, model, observation set, force norm, and trust/globalization policy are all reused.

gpr::Coord& getMidPointCoordForAllObservationPointsRef()

Return gpr::Coordinates of all observed points.

gpr::FieldMatrixd& getEnergyForAllObservationPointsRef()

Return energies for all observed points.

Return energies for all observation points.

gpr::Coord& getGradientForAllObservationPointsRef()

Return gradients for all observed points.

Return gradients for all observation points.

Get GPR model.

void preserveSeedKernel()

Retain an imported kernel’s parameters and absolute energy origin.

void attachExternalGP(gpr::GaussianProcessRegression* external_gp)

Attach an externally-owned GPR model. Must be called BEFORE ~initialize~. The dimer will use this GP for all predict, refit, Cholesky and variance calls, and will NOT call its ~initialize(parameters, atoms_config)~ entry (the external owner has already done that). The dimer takes no ownership: the GP is not deleted in the destructor. Use case: ~OCINEBController~ shares the long-lived ~ActiveLearningSession::gp~ across NEB outer iters and MMF bursts so the singleton ~DistributedState~ distributed factor stays coherent across phases.

Idempotent: passing nullptr restores the legacy self-owned path (which ~initialize~ will then lazily allocate).

gpr::Index_t getNumNewObservations() const

Number of accurate (general-potential) observations the dimer accumulated during ~execute~. Equals ~all_obs.E.rows() - N_obs_init~. The caller can pair this with ~getMidPointCoordForAllObservationPointsRef~ / ~getEnergyForAllObservationPointsRef~ / ~getGradientForAllObservationPointsRef~ to harvest the new rows back into a shared ~session.training_obs~ buffer. Energies are relative to ~getEnergyZeroLevel()~ as documented above.

gpr::Index_t getInitialObservationCount() const

Index of the first row in ~all_obs~ that the dimer appended during ~execute~. Pair with ~getNumNewObservations~ for harvest bookkeeping.

gpr::FieldMatrixd getEnergyZeroLevel() const

Internal E_zero_level used by the dimer’s cutOffEnergy bookkeeping. The energies returned by ~getEnergyForAllObservationPointsRef~ and ~getFinalEnergy~ are relative to this value, not absolute PES energies. Add E_zero_level back to recover the absolute energy.

Required by the OCINEB controller when harvesting the dimer’s all_obs into a shared training_obs that the NEB expects to hold absolute PES energies.

void callGeneralPotentialFromEON(const gpr::vector3_reg(&) cell_dimensions[3], gpr::Observation& mid_point, pot::PotentialWrapper& potential)

Call for a potential defined in a Matter object.

Parameters:

cell_dimensions

Dimensions of the cell in EON 9 element format

mid_point

The point on which to obtain the potential

potential

The potential wrapper used for the evaluation

bool isFinalConvergenceReached(const gpr::Observation& middle_point, const double stop_criteria)

Final convergence test for force.

Compares forceNormForConvergence of the midpoint gradient to stop_criteria (T_dimer). The default norm is L2 of the full gradient vector (ConvergenceNormType::L2_NORM). Linf and per-atom max are selectable; they are not the default.

Parameters:

middle_point

The current mid-point of the configuration

stop_criteria

The final convergence threshold

Returns:

true if final convergence is reached

bool isRotationalConvergenceReached(const gpr::Coord& orient, gpr::Observation& middle_point)

Rotational convergence test.

Parameters:

orient

Current dimer orientation

middle_point

Current midpoint observation, including its gradient

Returns:

true if rotational convergence is reached

bool isApproximateRotationalConvergenceReached(const gpr::Coord& orient, const gpr::Observation& approx_obs, const double stop_criteria)

GP-stencil rotational convergence test.

Evaluates the same finite-dimer angle equation used by the rotation optimizer on an approximate midpoint/image-1 stencil.

bool rotateDimer(const double stop_criteria, gpr::Coord& orient, gpr::LBFGSInfo& rot_info, gpr::Observation& middle_point, gpr::Observation& approx_obs)

Rotate the dimer.

void translateDimer(const gpr::Observation& middle_point, const gpr::Coord& orient, const gpr::Observation& approx_obs, const double curvature, gpr::LBFGSInfo& trans_info, gpr::Coord& R_new)

Translate the dimer.

bool updateActiveFrozenAtoms(const gpr::Coord& R_new, gpr::LBFGSInfo& rot_info, gpr::LBFGSInfo& trans_info)

Update active frozen atoms.

Returns:

True if new atoms are activated

void setVarianceAcceptTau(double tau)

Convenience setter for the absolute accept_tau alone; other fields of the default-constructed VarianceGateConfig are preserved.

void writeTraceFrame(const gpr::Observation& obs, const std::string& phase, size_t idx)

Record one dimer-trace frame. With a corpus attached, writes a one-frame CON (energy, frame_index, phase in prebox1) onto the phase trajectory (1=outer_loop, 2=inner_loop, 3=initial_rotations). With no corpus, falls through to writeHDF5 when WITH_HDF5.

void archiveObservations(const gpr::Observation& obs)

Persist every row of obs to the observation archive when one is attached; a no-op otherwise. Never gates the science path.

void setVarianceAcceptTauRelative(double tau_relative)

Convenience setter for the relative accept_tau alone. The effective absolute threshold is recomputed on every gate call from the current magnSigma2, so this setter need not be re-invoked when SCG re-fits the hyperparameters between outer iterations.

gpr::Index_t getDedupRejectedObservations() const

Number of freshly oracled rows the dimer rejected as EMD near-duplicates of an existing observation during ~execute~. A degenerate probe carries no conditioning information; a run of them is what the early-handback criterion watches.

void setAlignmentAbortTol(double tol)

Alignment-governed termination tolerance alpha_tol. When > 0, each outer dimer phase computes alpha = abs(dot(d, tau)) between the current dimer axis and the axis that initialized the burst. The burst terminates when alpha drops below this tolerance. <= 0 disables the check.

void setAbortOnDegenerateProbes(bool enabled)

Abort the search after ~kMaxConsecutiveDegenerateProbes~ EMD near-duplicate probes even without an alignment reference. The burst gets this through its alignment tolerance; a standalone search (the index-certificate escape) has no reference axis but the same degenerate-probe loop: the surrogate reports convergence at a point whose row it already holds, the oracle disagrees, and every re-measurement coalesces into that row.

void setMaxOracleCalls(gpr::Index_t calls)

Caller’s budget of true potential evaluations. No oracle call is started that would exceed it; the search then stops with DimerRelaxationTerminationReason::OracleBudget, unconverged. Zero or less leaves the search unbounded by calls.

void setIndexFrequencyResolution(double wavenumber)

Wavenumber (cm^-1) below which a mode counts as flat in the in-search index test: a measured curvature softer than this displacement’s curvature at that wavenumber neither refuses the midpoint nor is followed. The independent validation reports such modes as unresolved at the same value.

void setRejectHigherIndexSurrogateConvergence(bool enabled)

See want_second_negative_mode_.

void setExternalTerminalCertificate(bool enabled)

Hand a force-converged point with a measured negative direction to the caller’s complete-Hessian certificate without rotating its mode. The caller must resolve the index before accepting the saddle.

void setMeasuredEnergyCeiling(double ceiling)

A converged midpoint whose measured (absolute) energy lies above ~ceiling~ is not accepted as converged. The escape from a refused index certificate looks for the saddle downhill of the refused point along its offending mode, so the saddle it may return lies below that point; a surrogate overshoot above it during the search is corrected by its own row and is not an abort. NaN disables.

void setSaddleEnergyFloor(double floor)

Absolute energy below which no first-order saddle between the search endpoints can lie (the higher endpoint energy). A measured partitioned-RFO refinement that steps below it is abandoned. NaN disables.

bool lastRefinementReachedIndexOne() const

Whether the last measured partitioned-RFO refinement ended on an index-one model inside the force tolerance.

void setAbortOnInteratomicCollapse(bool enabled)

Abort the search when a measured midpoint’s shortest interatomic distance drops below ~ratio_at_limit~ times the seed’s: the canonical gprd bound on interatomic distances, applied to the measured trajectory. A standalone search on a surrogate that does not hold its rows can slide into a repulsive wall phase after phase (10_tetrazine: 300 phases to 336 eV/A); the bound ends it at the first measured collapse.

void setPreserveInitialAlignmentReference(bool enabled)

Keep the caller-supplied dimer axis as the alignment reference when analytic HS-SVD installs a minimum mode. OCI-NEB enables this because its supplied axis is the reaction-path tangent: a minimum mode that rotates away from it belongs to a different channel. Standalone dimer searches may instead track the first certified HS-SVD mode.

void setLikelihoodNoiseFloorSigma2(double floor_sigma2)

Likelihood noise floor (sigma_n^2, energy units squared) applied after every internal hyperparameter refit. The dimer’s rows come from the same oracle as the caller’s session GP, so its likelihood must carry the same reported-noise floor; the refit re-seeds sigma2 from data statistics and would otherwise fit near-duplicate dimer steps against a vanishing nugget (near-singular local covariance, garbage min-mode curvature). NaN or non-positive disables.

void setSelfOwnedModelProfile(gpr::GPModelProfile profile)

Model profile for the SELF-OWNED surrogate built by ~initialize~ from ~empty_obs~. An attached external GP keeps its owner’s profile; the fresh-bootstrap burst must run the same coherent model family (classic CHEMGP/GPRD_ZBL vs EXTENDED) as the session it rescues.

void setSelfOwnedUseZblPriorMean(bool use)

ZBL residual prior mean for the self-owned surrogate; keeps the fresh-bootstrap burst on the same compression wall as the session model that hands off to it.

void setLeashRelaxWhenClose(bool enabled)

When set, the band-tangent alignment-abort leash is suspended once the dimer is close to its force criterion (largest force component under twice the dimer convergence force). The controller enables this only for bursts where the band tangent is an unreliable saddle-mode seed the GP is over-confident-but-inaccurate at the CI, or the CI has reached the adaptive acceptance threshold. Far from the saddle the leash still holds, so a burst cannot wander onto a wrong saddle while the force is large; near the saddle the dimer is free to rotate onto the true local mode (which legitimately diverges from the coarse chain tangent).

void setOracleBatchChunk(Eigen::Index chunk)

pot::OracleBatchLayout::chunk of every true-potential call: 0 shares the images out one by one and evaluates a rank’s images in one call, K cuts a call into contiguous chunks of K images.

void setUncertaintyAwareRotation(bool enabled)

Enable the UA-Dimer rotational projection (DOI 10.48550/arxiv.2605.24401).

void setProjectMeasuredRotations(bool enabled)

Exclude molecular rigid rotations from measured orientation searches. Translations, frozen coordinates and index certification keep their physical constraints independently of this search-space choice.

void setKappaDimer(double beta)

Xiao contour force at nonnegative dimer curvature; the ordinary dimer force once the curvature along the dimer is negative.