.. index:: pair: class; gpr::neb::NEBPath .. _doxid-classgpr_1_1neb_1_1_n_e_b_path: class gpr::neb::NEBPath ======================= .. toctree:: :hidden: Overview ~~~~~~~~ NEB path: chain of images between two endpoints. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class NEBPath { public: // construction :ref:`NEBPath`(const Eigen::VectorXd& initial, const Eigen::VectorXd& final_state, int n_images, double spring_constant = 0.1); :ref:`NEBPath`(const :ref:`EigenMatrix`& image_positions, double spring_constant = 0.1); // methods void :ref:`initializeIDPP`(int n_atoms, bool collective = false); void :target:`initializeIDPP`(int n_atoms, const std::vector& moving_atoms, bool collective = false); void :ref:`initializeSIDPP`(int n_atoms, double alpha = 0.33); void :target:`initializeSIDPP`(int n_atoms, const std::vector& moving_atoms, double alpha = 0.33); void :ref:`initializeSIDPPGeodesic`(int n_atoms, double alpha = 0.33); void :target:`initializeSIDPPGeodesic`(int n_atoms, const std::vector& moving_atoms, double alpha = 0.33); void :ref:`computeNEBForces`(); void :ref:`enableClimbingImage`(); int :ref:`highestEnergyImageIndex`() const; int :ref:`highestEnergyImageIndexPreferring`(int preferred) const; int :ref:`highestLocalMaximumImageIndex`() const; int :target:`highestLocalMaximumImageIndexPreferring`(int preferred) const; void :ref:`setForceVariance`(int i, const Eigen::VectorXd& variance); void :target:`clearForceVariance`(); bool :target:`hasForceVariance`(int i) const; void :ref:`setPeriodicCell`(const std::array& cell); void :ref:`interpolateFromEndpoints`(); void :ref:`setMovingAtoms`(std::vector moving_atoms); void :ref:`setExternalFixedAtoms`(bool present); void :ref:`setSpringCoordinates`(std::vector coordinates, std::vector weights = {}); const std::vector& :target:`springCoordinates`() const; const std::vector& :target:`springWeights`() const; void :ref:`setMolecularRigidMotion`(bool enabled); bool :target:`molecularRigidMotion`() const; void :ref:`projectPhysicalVector`(const Eigen::VectorXd& reference, Eigen::Ref vector) const; Eigen::VectorXd :ref:`alignMolecularGeometry`(const Eigen::VectorXd& reference, const Eigen::VectorXd& geometry) const; void :ref:`alignMolecularFrames`(); void :ref:`pinFixedAtoms`(Eigen::Ref positions) const; void :ref:`maskFixedForce`(Eigen::Ref force) const; bool :target:`usesPeriodicCell`() const; const Eigen::VectorXd& :ref:`nebForce`(int i) const; double :ref:`saddleForce`(int i) const; void :target:`setConvergenceForceNorm`(std::optional<:ref:`ConvergenceNormType`> norm); :ref:`ConvergenceNormType` :target:`convergenceForceNorm`(Eigen::Index dof) const; double :ref:`forceMagnitude`(const Eigen::VectorXd& force) const; double :ref:`nebForceMagnitude`(int i) const; double :ref:`tangentStiffness`(int i) const; Eigen::VectorXd :ref:`tangentAt`(int i) const; :ref:`Image`& :ref:`image`(int i); const :ref:`Image`& :target:`image`(int i) const; int :target:`numImages`() const; int :target:`numIntermediate`() const; :ref:`EigenMatrix` :ref:`intermediatePositions`() const; void :ref:`setFromObservation`(const :ref:`Observation`& obs, int start_image = 1); void :ref:`setSpringBounds`(double k_max, double k_min); void :ref:`setGeometricSpring`(bool on); bool :target:`geometricSpring`() const; void :ref:`setEnergyWeightedSprings`(bool on); bool :target:`energyWeightedSprings`() const; void :ref:`setSpringRestLengths`(std::vector rest_lengths); const std::vector& :target:`springRestLengths`() const; double :ref:`maxSpacingDeviation`() const; double :ref:`maxMetricSpacingDeviation`(const std::vector& segment_metric_factors) const; double :ref:`reparametrizeByArcLength`(); double :ref:`reparametrizeByArcLengthKeepingImage`(int anchor_index); double :ref:`reparametrizeByMetricArcLength`(const std::vector& segment_metric_factors); double :ref:`reparametrizeByMetricArcLengthKeepingImage`(const std::vector& segment_metric_factors, int anchor_index); std::vector :ref:`inverseDistanceSegmentMetricFactors`(int n_atoms) const; std::vector :ref:`inverseDistanceSegmentMetricFactors`(int n_atoms, const std::vector& moving_atoms) const; double :ref:`reparametrizeByInverseDistanceGeodesicArcLength`(int n_atoms); double :target:`reparametrizeByInverseDistanceGeodesicArcLength`(int n_atoms, const std::vector& moving_atoms); double :ref:`reparametrizeByInverseDistanceGeodesicArcLengthKeepingImage`(int n_atoms, const std::vector& moving_atoms, int anchor_index); void :ref:`setPosteriorVarianceThreshold`(double threshold); void :ref:`setClimbingCurvatureDirection`(Eigen::VectorXd direction); void :target:`clearClimbingCurvatureDirection`(); const Eigen::VectorXd& :target:`climbingCurvatureDirection`() const; double :ref:`posteriorVarianceThreshold`() const; static Eigen::VectorXd :ref:`inverseDistanceGeodesicStep`(int n_atoms, const std::vector& moving_atoms, const Eigen::VectorXd& positions, const Eigen::VectorXd& cartesian_step, const std::array* cell = nullptr); static Eigen::VectorXd :ref:`inverseDistanceGeodesicInterpolate`(int n_atoms, const std::vector& moving_atoms, const Eigen::VectorXd& left, const Eigen::VectorXd& right, double alpha, const std::array* cell = nullptr); }; .. _details-classgpr_1_1neb_1_1_n_e_b_path: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ NEB path: chain of images between two endpoints. Construction ------------ .. index:: pair: function; NEBPath .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a3f133d60e1532c6d7ccaf429c31b6c6d: .. ref-code-block:: cpp :class: doxyrest-title-code-block NEBPath(const Eigen::VectorXd& initial, const Eigen::VectorXd& final_state, int n_images, double spring_constant = 0.1) Initialize path with linear interpolation between endpoints. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - initial - Initial state positions (flat) * - final_state - Final state positions (flat) * - n_images - Number of intermediate images (excluding endpoints) * - spring_constant - NEB spring constant k .. index:: pair: function; NEBPath .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1abe4e4b9b5877174a9d2855e796a15825: .. ref-code-block:: cpp :class: doxyrest-title-code-block NEBPath(const :ref:`EigenMatrix`& image_positions, double spring_constant = 0.1) Initialize path from explicit image positions. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - image_positions - Matrix with one image per row, endpoints included. * - spring_constant - NEB spring constant k Methods ------- .. index:: pair: function; initializeIDPP .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a618286a8604bc7b62d07b5ce130adbe7: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initializeIDPP(int n_atoms, bool collective = false) Initialize from IDPP (image dependent pair potential) interpolation. Better initial path than linear interpolation for molecular systems. The per-image seed is rgsaddle_idpp_fixed_path. collective is the alternating S-IDPP seed with the insertion stage skipped; rgsaddle has no collective entry of its own. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - n_atoms - Number of atoms (positions.size() / 3) * - collective - If true, relax the whole chain together. .. index:: pair: function; initializeSIDPP .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a8d39ebf7562f859fda6f37eff076a46f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initializeSIDPP(int n_atoms, double alpha = 0.33) Initialize via Sequential IDPP (SIDPP). rgsaddle_sidpp_alternating_path. The spring on that call is the unit IDPP spring, not the physical NEB spring. .. index:: pair: function; initializeSIDPPGeodesic .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1abee12eaf6bbf80bcf1bdb0fda11f7481: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initializeSIDPPGeodesic(int n_atoms, double alpha = 0.33) Initialize via inverse-distance S-IDPP. rgsaddle_sidpp_alternating_inverse_distance_path. This is the sidpp-geodesic blend (close pairs stay close longer). It is not rgsaddle_geodesic_path, which minimises a redundant-coordinate length and needs a chart. .. index:: pair: function; computeNEBForces .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ae06a2cf27c761cca31a9bbff7a332aa8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void computeNEBForces() Compute NEB forces for all intermediate images. For each image i (not endpoint): F_NEB = F_perp + F_spring_parallel Where: F_perp = F - (F . tau) \* tau (perpendicular to path) F_spring = k times [length(r\_{i+1} - r_i) - length(r_i - r\_{i-1})] times tau tau = normalized tangent along path For climbing image: F_CI = F - 2\*(F . tau)\*tau (inverted parallel component) .. index:: pair: function; enableClimbingImage .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a810d450394070f3a63b4e23200701881: .. ref-code-block:: cpp :class: doxyrest-title-code-block void enableClimbingImage() Enable climbing image on the highest-energy intermediate image. .. index:: pair: function; highestEnergyImageIndex .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a1a12aeabc8291d18cf6de13574b5dfc7: .. ref-code-block:: cpp :class: doxyrest-title-code-block int highestEnergyImageIndex() const Highest finite interior energy, or -1 when none exists. A non-finite energy is not a candidate. A strict interior local maximum wins a tie at that energy over a non-strict shoulder, and loses to any strictly higher interior energy. The lowest index breaks remaining ties. .. index:: pair: function; highestEnergyImageIndexPreferring .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1adedfa1aad0792dfe73414606820a0399: .. ref-code-block:: cpp :class: doxyrest-title-code-block int highestEnergyImageIndexPreferring(int preferred) const Like highestEnergyImageIndex, but if ~preferred~ is still a strict interior local maximum, keep it (CI continuity on multi-saddle bands). .. index:: pair: function; highestLocalMaximumImageIndex .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a3aa84182889eaeecf372165b3a0b0b54: .. ref-code-block:: cpp :class: doxyrest-title-code-block int highestLocalMaximumImageIndex() const Strict interior local maximum, else the highest finite energy. A higher shoulder that is not itself strict does not replace a lower strict maximum. Non-finite energies are not candidates. The GP-OIE candidate uses this so the seeded reaction coordinate keeps the climb. highestEnergyImageIndex remains the global maximum. .. index:: pair: function; setForceVariance .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a210d42c5802394290d6edefdf789a291: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setForceVariance(int i, const Eigen::VectorXd& variance) Per-degree-of-freedom force variance for image i, from the surrogate. When set, computeNEBForces removes the tangent component in the Sigma^{-1} metric instead of the Euclidean one (UA-NEB, Yu and Wang, DOI 10.48550/arxiv.2605.24401), so a direction the model has not resolved does not steer the band as strongly as one it has. Passing an empty vector, or never calling this, keeps the classical projection. .. index:: pair: function; setPeriodicCell .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ad23d07b058469fcfa3ec11443b5bcdd6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPeriodicCell(const std::array& cell) ASE row-major cell. A lattice other than the 25 A vacuum box makes inter-image chords, tangents, springs and arc-length resampling use the minimum image on the periodic axes. A zero cell keeps the Cartesian difference. .. index:: pair: function; interpolateFromEndpoints .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1aaa0a6f940722018bce60698642eaf1ef: .. ref-code-block:: cpp :class: doxyrest-title-code-block void interpolateFromEndpoints() Rebuild interior images on the chord between the current endpoints. .. index:: pair: function; setMovingAtoms .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1aad4d78fd02958545d8d36fd9e7a176bf: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setMovingAtoms(std::vector moving_atoms) Zero entries stay at the reactant coordinate and carry no NEB force. Empty means every atom moves. .. index:: pair: function; setExternalFixedAtoms .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a3e91c899f728f054bdc92e37d853a60b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setExternalFixedAtoms(bool present) Fixed atoms that pin the frame but are not part of the band coordinates (the band carries only the moving atoms). A periodic band then keeps its net translation: it is a real displacement against the fixed atoms, not a free slide of the crystal. .. index:: pair: function; setSpringCoordinates .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1aab8ee60cd027b855347a4bc0279bdab5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSpringCoordinates(std::vector coordinates, std::vector weights = {}) Band coordinates that carry the springs; empty means all. With a non-empty set the spring of a segment measures the displacement of these coordinates alone and acts along the tangent restricted to them. The perpendicular projection keeps the full tangent. The restricted direction has a positive projection on the tangent, so a stationary band still has zero perpendicular force and balanced springs on every image: the path is the same nudged elastic band, with its images spaced by the motion of these coordinates. A spring acts along the tangent, where the true force is projected out. A spectator mode softer than the spring constant (the free layers of a slab sliding rigidly over its fixed layers) that enters the tangent is then held by nothing but the spring, which drives it. Restricting the springs to the coordinates the reaction moves leaves such modes to the true force alone. Spring rest lengths, when set, are lengths in the same measure. ``weights`` parallels ``coordinates``. A weight is the share of the configured spring that coordinate carries: 1 is the full spring, 0 leaves the coordinate out of the length and the force. Empty weights are 1 on every listed coordinate. .. index:: pair: function; setMolecularRigidMotion .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a515c61bccf1b1e334bedd209ee93f82f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setMolecularRigidMotion(bool enabled) Remove whole-molecule rigid motion from an isolated, unfrozen path. Generic coordinate paths retain their Cartesian geometry by default. .. index:: pair: function; projectPhysicalVector .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a6251b55f5b606655b460eba6b717a3d0: .. ref-code-block:: cpp :class: doxyrest-title-code-block void projectPhysicalVector(const Eigen::VectorXd& reference, Eigen::Ref vector) const :ref:`Project ` a force or step onto the molecular internal-motion space. Linear molecules retain both bending directions. .. index:: pair: function; alignMolecularGeometry .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ae4e2812a3c4d8389801abf69df95dc7b: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd alignMolecularGeometry(const Eigen::VectorXd& reference, const Eigen::VectorXd& geometry) const Proper rigid alignment with fixed atom correspondence; no reassignment. .. index:: pair: function; alignMolecularFrames .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a75ee2ded8f3db4961a860d162c40e265: .. ref-code-block:: cpp :class: doxyrest-title-code-block void alignMolecularFrames() Normalize seed frames before evaluation, invalidating changed images. .. index:: pair: function; pinFixedAtoms .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ac575afe4665699f241dbba46ec0afc93: .. ref-code-block:: cpp :class: doxyrest-title-code-block void pinFixedAtoms(Eigen::Ref positions) const Copy reactant coordinates onto fixed atoms. .. index:: pair: function; maskFixedForce .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a4e5486de2d022291359cbc7333dffe22: .. ref-code-block:: cpp :class: doxyrest-title-code-block void maskFixedForce(Eigen::Ref force) const Zero a force on fixed atoms. .. index:: pair: function; nebForce .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ad8afa2f6d0b3a0e022a7689b87b79d10: .. ref-code-block:: cpp :class: doxyrest-title-code-block const Eigen::VectorXd& nebForce(int i) const Get the NEB force for image i. .. index:: pair: function; saddleForce .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1aed3d0b8a141587219450fc6d9a7e15fa: .. ref-code-block:: cpp :class: doxyrest-title-code-block double saddleForce(int i) const Physical force magnitude without the climbing-image reflection. .. index:: pair: function; forceMagnitude .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ae1208d26cfb99ae8fe38d2615e3b1cf5: .. ref-code-block:: cpp :class: doxyrest-title-code-block double forceMagnitude(const Eigen::VectorXd& force) const Physical and prediction-error forces use the same stopping norm. .. index:: pair: function; nebForceMagnitude .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1acccbddc72746024ff24cad337cd88db6: .. ref-code-block:: cpp :class: doxyrest-title-code-block double nebForceMagnitude(int i) const The automatic whole-band measure is the Euclidean image norm. .. index:: pair: function; tangentStiffness .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1aaf856f1f57190a4f5345be473a3547a4: .. ref-code-block:: cpp :class: doxyrest-title-code-block double tangentStiffness(int i) const Stiffness the tangent adds to image i across the path. The band force of an image, -g + (g . tau) tau, depends on the image's own position through its tangent as well as through the gradient. With the unnormalised tangent t = a tau_plus + b tau_minus the derivative of the force with respect to that position is -(H + s (I - tau tau^T)) up to terms that vanish with the perpendicular force, where s = -(g . tau) (b - a) / abs(t). On a rising profile the tangent is the forward chord (a = 1, b = 0) and on a falling one the backward chord (a = 0, b = 1), so s = abs(g . tau) / abs(t): the image is held across the path by the parallel gradient over the chord length in addition to the curvature of the surface. A climbing image carries the term twice. The value is negative where the gradient opposes the energy ordering, and zero for endpoints, non-finite energies and a vanishing tangent. A relaxation that preconditions with the Hessian alone overshoots every mode softer than this stiffness. .. index:: pair: function; tangentAt .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a91474c9e8e253b9184e67066b3b60135: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd tangentAt(int i) const Improved (energy-weighted) tangent at image i, normalised. Used by the OCINEB controller to seed the dimer's initial mode at the CI image when no cached eigenvector is available. .. index:: pair: function; image .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1aeb9e00cdabf3479b291a72f1db9c5297: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Image`& image(int i) Access image i. .. index:: pair: function; intermediatePositions .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ad81feaa6087784ea1197acfa17e4a771: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` intermediatePositions() const Get all intermediate image positions as a matrix. .. rubric:: Returns: Matrix of shape (n_intermediate, n_coords) .. index:: pair: function; setFromObservation .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a3e0e3bc3b0dd849cb7734b08cc0d7c6b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setFromObservation(const :ref:`Observation`& obs, int start_image = 1) Set energies and gradients for images from an :ref:`Observation `. .. index:: pair: function; setSpringBounds .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a8243cd86211eb983677ed1157870826d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSpringBounds(double k_max, double k_min) Set the spring constant bounds for the energy-weighted variable-spring force computation. Mirrors the eOn ~WeightedSpring~ parameters (~neb_options.spring.weighting.k_min~ and ~.k_max~). Springs in the saddle region (E_pair near E_max) approach ~k_max~; springs in the basins (E_pair near or below E_ref) drop to ~k_min~. See ~computeNEBForces~ for the alpha-blend formula. Default ~k_min~ derived from the constructor's spring_constant as ~0.1 \* spring_constant~ for backwards compatibility; the spring_constant ctor parameter is the k_max value. .. index:: pair: function; setGeometricSpring .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ade4b13c14770d678c644491684ae78b9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setGeometricSpring(bool on) Toggle the geometric (cubic-potential) spring on the intermediate-image NEB force. With geometric=true the parallel spring force becomes ~F_par = k \* (d_n^2 - d_p^2) \* tau~ (derived from U = (k/3) sum ||R\_{i+1}-R_i||^3); the perpendicular component cancels exactly under right-triangle perturbations of dense meshes and ~K_eff = 4 k s~ scales linearly in spacing. The energy-weighted ~spring_constant_min\_~ tapering is ignored when geometric mode is on the cubic potential's natural softening replaces it. .. index:: pair: function; setEnergyWeightedSprings .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a6d32601a31a18a8a292f89b592fe0832: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setEnergyWeightedSprings(bool on) Allow the energy-weighted spring taper. With the taper allowed (the default) the springs are weighted by image energy whenever the whole profile is measured, or whenever none of it is, and sit at ~k_max~ on a mixed profile. A band that relaxes on a surrogate (measured endpoints, predicted interior) and is certified on measured rows passes through both states at the same geometry: the relaxation stops on uniform springs, the full-band measurement then reads the weighted springs, and the difference ~(k\_+ - k\_-) d~ on the basin-side images is reported as a true NEB force that no surrogate step can remove. Such a band turns the taper off so that every image carries the same spring law whichever of its rows are measured. .. index:: pair: function; setSpringRestLengths .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a24b535ca24ca8823c0b27813016f1c9b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSpringRestLengths(std::vector rest_lengths) Per-segment spring rest lengths (:ref:`numImages() ` -1 entries). When set, the intermediate-image spring force is ~k_max ((d_plus - l_plus) - (d_minus - l_minus))~ with the uniform ~k_max~, so the relaxed band reproduces the rest lengths up to a common offset, and every arc-length reparametrization places the images at the cumulative rest-length fractions instead of at equal spacing. The inverse-distance geodesic reparameterizer applies the same fractions along its q-space arc. An empty vector restores the zero-rest-length energy-weighted spring and equal spacing. The rest lengths are the equidistribution of the chord-tangent leak (gpr::neb::detail::chordLeakSpringRestLengths). .. index:: pair: function; maxSpacingDeviation .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a4d8fdfa8f419b39ddcbefed04328b3cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block double maxSpacingDeviation() const Maximum relative deviation of image spacing from uniform. For a chain of total arc length L with N images, the uniform segment length is h = L / (N-1). This returns max_i abs(s_i - h) / h where s_i = ||r\_{i+1} - r_i||. Zero means uniformly spaced; a value >1 means at least one segment is more than 2x the mean. Callers gate path reparametrization on this returning above a tolerance. .. index:: pair: function; maxMetricSpacingDeviation .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ae9ea219de4dfea3e7579b11853c24843: .. ref-code-block:: cpp :class: doxyrest-title-code-block double maxMetricSpacingDeviation(const std::vector& segment_metric_factors) const Maximum relative spacing deviation measured in a pullback metric. Uses the same segment metric factors consumed by :ref:`reparametrizeByMetricArcLength() `. The deviation is local and scale-free: max_i abs(ell_i - mean(ell)) / mean(ell), where ell_i is the metric length of segment i. .. index:: pair: function; reparametrizeByArcLength .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a2dc7b394c039b442a7fd4142876169ec: .. ref-code-block:: cpp :class: doxyrest-title-code-block double reparametrizeByArcLength() Redistribute interior images uniformly along arc length. Computes cumulative arc length along the current chain, then resamples each interior image at uniform arc-length spacing via piecewise-linear interpolation between the original positions. Endpoints are unchanged. A resampled image drops its energy, gradient, evaluated flag, posterior variance (back to +infinity), and force variance, because that state does not describe the new positions. Cached NEB forces on every intermediate image are zeroed. The caller must refresh the surrogate predictions and call :ref:`computeNEBForces() ` before the next L-BFGS step. Returns the :ref:`maxSpacingDeviation() ` measured BEFORE reparametrizing. Quasi-Newton state held by the band L-BFGS optimizer is invalidated by this operation: every curvature pair (s_k, y_k) is indexed against the pre-reparam parameterization, so the caller MUST reset its optimizer's history after this call returns. .. index:: pair: function; reparametrizeByArcLengthKeepingImage .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a20236db2a72cc0be7642d38b3ea2344c: .. ref-code-block:: cpp :class: doxyrest-title-code-block double reparametrizeByArcLengthKeepingImage(int anchor_index) Redistribute the two subchains while preserving one image. The preserved image is an exact observation anchor, such as a dimer-refined saddle row. Images on each side are resampled uniformly along their own arc-length interval; endpoints and the anchor retain their coordinates and exact-data state. Non-anchor interiors are invalidated like :ref:`reparametrizeByArcLength() `. .. index:: pair: function; reparametrizeByMetricArcLength .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a67e0dc8275d996d16c2c0395597ab214: .. ref-code-block:: cpp :class: doxyrest-title-code-block double reparametrizeByMetricArcLength(const std::vector& segment_metric_factors) Redistribute interior images uniformly in a pullback metric. segment_metric_factors[i] maps the Cartesian displacement images[i+1].positions - images[i].positions into the coordinate space used to measure that segment. For internal-coordinate spacing this factor is an internal-coordinate Jacobian (or a midpoint/trapezoid representative of neighbouring Jacobians); for IRC mass weighting it is diag(sqrt(m)). The segment length is ||B_i \* (R\_{i+1} - R_i)||. Endpoints are unchanged; interior energies, gradients, evaluated flags, posterior variances, force variances, and cached NEB forces are invalidated in the same way as :ref:`reparametrizeByArcLength() `. .. index:: pair: function; reparametrizeByMetricArcLengthKeepingImage .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ad9177ac29f442c7952db2d7d1fdea06d: .. ref-code-block:: cpp :class: doxyrest-title-code-block double reparametrizeByMetricArcLengthKeepingImage(const std::vector& segment_metric_factors, int anchor_index) Metric pullback variant of :ref:`reparametrizeByArcLengthKeepingImage() `. .. index:: pair: function; inverseDistanceSegmentMetricFactors .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a0df3e46901f24239ea4f4b972461f9a9: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector inverseDistanceSegmentMetricFactors(int n_atoms) const Build segment metric factors for inverse-distance coordinates. For each segment, evaluates the Jacobian of q_ab = 1 / r_ab at the segment midpoint for every atom pair a < b. Passing the returned factors into :ref:`reparametrizeByMetricArcLength() ` spaces the band uniformly in the local inverse-distance coordinate metric used by geodesic IDPP. .. index:: pair: function; inverseDistanceSegmentMetricFactors .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a95d5248a6f753c3e760a264ce5e58e22: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector inverseDistanceSegmentMetricFactors(int n_atoms, const std::vector& moving_atoms) const Build inverse-distance segment factors over active atom pairs. moving_atoms[a] marks atoms whose coordinates may change along the band. Pairs where both atoms are fixed are removed from the pullback metric, while moving-moving and moving-fixed pairs remain. An empty mask keeps every pair active. .. index:: pair: function; reparametrizeByInverseDistanceGeodesicArcLength .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1acd91aa42211add2f9aa3ce576c292477: .. ref-code-block:: cpp :class: doxyrest-title-code-block double reparametrizeByInverseDistanceGeodesicArcLength(int n_atoms) Redistribute the band by solving inverse-distance targets. Builds q_ab(R) = 1 / ||R_a - R_b|| for every active atom pair and spaces the chain along that q-space arc. Spring rest lengths, when set, fix the cumulative fractions; otherwise the spacing is uniform. Each target q is mapped back to Cartesian coordinates with an SVD Gauss-Newton internal-coordinate step. Moved images are invalidated like :ref:`reparametrizeByArcLength() `. This is the NEB reparameterization analogue of the geodesic internal coordinate update in Hermes et al. (doi:10.1063/5.0060146). .. index:: pair: function; reparametrizeByInverseDistanceGeodesicArcLengthKeepingImage .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ad81ff67c698b43a9b0c0a2de96c097cd: .. ref-code-block:: cpp :class: doxyrest-title-code-block double reparametrizeByInverseDistanceGeodesicArcLengthKeepingImage(int n_atoms, const std::vector& moving_atoms, int anchor_index) Anchor-preserving inverse-distance geodesic reparameterization. .. index:: pair: function; setPosteriorVarianceThreshold .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a7c361abc0fe371a20161ce5f69ed5728: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPosteriorVarianceThreshold(double threshold) Set the signal-scaled posterior-variance confidence threshold. The GP-OIE outer loop sets this each iteration to ~unc_convergence \* magnSigma2(now)~ (a scale-free fraction of the GP signal variance). :ref:`Image ` posterior variances below it mark the GP as confident about that image's energy at its current geometry. .. index:: pair: function; setClimbingCurvatureDirection .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a28e9c24aa4552c05dbfbd7af6d4db030: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setClimbingCurvatureDirection(Eigen::VectorXd direction) Unit climb direction from a true-force secant. Empty keeps the path tangent, which is the climb direction when the option is off. .. index:: pair: function; posteriorVarianceThreshold .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1aa64c8b8441012db844b4d7718f83cb48: .. ref-code-block:: cpp :class: doxyrest-title-code-block double posteriorVarianceThreshold() const Current signal-scaled posterior-variance confidence threshold. .. index:: pair: function; inverseDistanceGeodesicStep .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1a0c8df96b79146c0b5a55199737ae6fd5: .. ref-code-block:: cpp :class: doxyrest-title-code-block static Eigen::VectorXd inverseDistanceGeodesicStep(int n_atoms, const std::vector& moving_atoms, const Eigen::VectorXd& positions, const Eigen::VectorXd& cartesian_step, const std::array* cell = nullptr) Apply one inverse-distance internal-coordinate retraction. The Cartesian step defines a linearized internal-coordinate target q(R) + J(R) dR for q_ab = 1 / ||R_a - R_b|| over active atom pairs. The target is mapped back to Cartesian coordinates with the same SVD Gauss-Newton solve used by the band geodesic reparameterizer. .. index:: pair: function; inverseDistanceGeodesicInterpolate .. _doxid-classgpr_1_1neb_1_1_n_e_b_path_1ae06d8c77ac5eb3f8c0a8bc965ac72f31: .. ref-code-block:: cpp :class: doxyrest-title-code-block static Eigen::VectorXd inverseDistanceGeodesicInterpolate(int n_atoms, const std::vector& moving_atoms, const Eigen::VectorXd& left, const Eigen::VectorXd& right, double alpha, const std::array* cell = nullptr) Interpolate between two geometries in inverse-distance space. Active atom-pair inverse distances follow ~(1 - alpha) q(left) + alpha q(right)~. Inactive Cartesian columns are held at the left geometry, so fixed-atom masks remain fixed during trust bisection and line-search interpolation.