#include <gpr/dimer/Dimer.h>
Public Types | |
| enum class | RotationStepResult { Converged , Updated , EvaluationFailed } |
| using | Image1Evaluator = std::function<bool(gpr::Observation&)> |
| using | HessianVectorEvaluator |
Public Member Functions | |
| Dimer (double separation, bool is_subsystem=false) | |
| Default constructor. | |
| virtual | ~Dimer () |
| void | translate (const gpr::Coord &R, const gpr::Coord &orient, const gpr::Coord &F, const double curv, const gpr::TransitionParameters ¶m_trans, gpr::LBFGSInfo &transinfo, gpr::Coord &R_new) |
| Translate dimer. | |
| void | translateWithForce (const gpr::Coord &R, const gpr::Coord &force, const gpr::TransitionParameters ¶meters, gpr::LBFGSInfo &history, gpr::Coord &output) |
| void | rotate (const gpr::Coord &R, const gpr::Coord &orient, const gpr::Coord &G01, const uint8_t potential, const double T_anglerot, const bool estim_Curv, const gpr::Observation &all_obs, gpr::GaussianProcessRegression *gpr_model, gpr::LBFGSInfo &rotinfo, gpr::Coord &orient_new, double &Curv, gpr::Observation &image1) |
| Rotate dimer. | |
| RotationStepResult | rotateWithImage1Evaluator (const gpr::Coord &R, const gpr::Coord &orient, const gpr::Coord &G01, const double T_anglerot, const bool estim_Curv, const Image1Evaluator &image1_evaluator, gpr::LBFGSInfo &rotinfo, gpr::Coord &orient_new, double &Curv, gpr::Observation &image1) |
| RotationStepResult | rotateWithHessian (const gpr::Coord &R, const gpr::Coord &orient, const gpr::Coord &G01, const bool estim_Curv, const Image1Evaluator &image1_evaluator, gpr::Coord &orient_new, double &Curv, gpr::Observation &image1, const HessianVectorEvaluator &hessian_evaluator) |
| RotationStepResult | rotateWithRgminDimer (const gpr::Coord &R, const gpr::Coord &orient, const gpr::Coord &G01, const bool estim_Curv, const Image1Evaluator &image1_evaluator, gpr::Coord &orient_new, double &Curv, gpr::Observation &image1) |
| RotationStepResult | rotateWithRgminDimer (const gpr::Coord &R, const gpr::Coord &orient, const gpr::Coord &G01, const bool estim_Curv, const Image1Evaluator &image1_evaluator, gpr::Coord &orient_new, double &Curv, gpr::Observation &image1, const HessianVectorEvaluator &hessian_evaluator) |
| void | rotateForce (const gpr::Coord &G01, const gpr::Coord &orient, gpr::Coord &F_rot) |
| Calculate rotational force acting on image 1 of the dimer. | |
| void | setForceVariance (const Eigen::VectorXd &variance) |
| void | clearForceVariance () |
| bool | hasForceVariance () const |
| void | translateForce (const gpr::Coord &F, const gpr::Coord &orient, gpr::Coord &F_trans) |
| Calculate translational force acting on image 1 of the dimer. | |
| double | estimateRotationalAngle (const gpr::Coord &orient, const gpr::Coord &G01, const gpr::Coord &F_rot_oriented) |
| Calculate a rough estimate of the optimal Rotation angle. | |
| void | setProjectRotations (bool enabled) noexcept |
| A fixed periodic cell admits translations but not rigid rotations. | |
| void | setRotationBasis (Eigen::MatrixXd basis) |
| Orthonormal columns span the allowed Cartesian rotation directions. | |
| void | setRotationObservation (const gpr::Observation *endpoint) noexcept |
| The observed endpoint supplies the sphere objective's energy origin. | |
| void | bindRgminTranslation (gpr::optim::RgminStep *session) noexcept |
| double | calculateCurvature (const gpr::Coord &G01, const gpr::Coord &orient) |
| Calculate curvature of the energy along the dimer. | |
| void | calculatePotential (const uint8_t potential, gpr::GaussianProcessRegression *gpr_model, gpr::Observation &image1) |
| Calculate potential. | |
Friends | |
| gpr::PublicLayoutBytes | gpr::libraryPublicLayout () |
| gpr::PublicLayoutBytes | gpr::consumerPublicLayout () |
| using dimer::Dimer::Image1Evaluator = std::function<bool(gpr::Observation&)> |
|
strong |
| Enumerator | |
|---|---|
| Converged | |
| Updated | |
| EvaluationFailed | |
Definition at line 65 of file Dimer.h.
|
inline |
Default constructor.
| separation | Dimer separation |
| is_subsystem | True when the dimer coordinates are a subset of a larger system. Skips rigid rotation/translation removal, which is not robust on partial coordinates. |
Definition at line 79 of file Dimer.h.
|
inlinenoexcept |
| double dimer::Dimer::calculateCurvature | ( | const gpr::Coord & | G01, |
| const gpr::Coord & | orient ) |
Calculate curvature of the energy along the dimer.
Two-point estimate from the gradients at the midpoint and at image 1; also the index-1 witness a force-converged start must pass.
| G01 | Gradient at the middle point and image 1 of the dimer. |
| orient | Unit vector along the direction of the dimer. |
Definition at line 484 of file Dimer.cpp.
| void dimer::Dimer::calculatePotential | ( | const uint8_t | potential, |
| gpr::GaussianProcessRegression * | gpr_model, | ||
| gpr::Observation & | image1 ) |
Calculate potential.
| potential | Potential type. |
| gpr_model | Pointer to the GPR model (or nullptr). |
| image1 | Observation to populate with the selected potential's energy and gradient. |
Definition at line 502 of file Dimer.cpp.
|
inline |
| double dimer::Dimer::estimateRotationalAngle | ( | const gpr::Coord & | orient, |
| const gpr::Coord & | G01, | ||
| const gpr::Coord & | F_rot_oriented ) |
Calculate a rough estimate of the optimal Rotation angle.
| orient | Unit vector along the direction of the dimer (before rotation). |
| G01 | Gradient at the middle point and image 1 of the dimer (before rotation). Each point occupies one row in the field. |
| F_rot_oriented | Oriented rotational force acting on image 1 of the dimer. |
Definition at line 562 of file Dimer.cpp.
|
inlinenodiscard |
| void dimer::Dimer::rotate | ( | const gpr::Coord & | R, |
| const gpr::Coord & | orient, | ||
| const gpr::Coord & | G01, | ||
| const uint8_t | potential, | ||
| const double | T_anglerot, | ||
| const bool | estim_Curv, | ||
| const gpr::Observation & | all_obs, | ||
| gpr::GaussianProcessRegression * | gpr_model, | ||
| gpr::LBFGSInfo & | rotinfo, | ||
| gpr::Coord & | orient_new, | ||
| double & | Curv, | ||
| gpr::Observation & | image1 ) |
Rotate dimer.
The dimer is rotated one step towards its minimum energy orientation. The first call seeds the mode with rgmin's measured Rayleigh-Ritz plane solve; later calls with the same rotinfo continue a persistent sphere L-BFGS refinement of the curvature.
| R | Coordinates of the middle point of the dimer. |
| orient | Unit vector along the direction of the dimer. |
| G01 | Gradient at the middle point and image 1 of the dimer. |
| potential | Potential and gradient function. |
| T_anglerot | Unused; the caller owns rotation convergence. |
| estim_Curv | If true, an estimate for the curvature along the direction of the dimer after the rotation is calculated. |
| all_obs | Object of all observed points. |
| gpr_model | Pointer to the GPR model. |
| rotinfo | Structure with information on previous external iterations. |
| orient_new | Unit vector along the direction of the dimer after optimal rotation. |
| Curv | Estimate for the curvature along the direction of the dimer after the rotation (0 if estim_Curv = 0 or no rotation). |
| image1 | Observation of the new observed location. |
Definition at line 210 of file Dimer.cpp.
| void dimer::Dimer::rotateForce | ( | const gpr::Coord & | G01, |
| const gpr::Coord & | orient, | ||
| gpr::Coord & | F_rot ) |
Calculate rotational force acting on image 1 of the dimer.
| G01 | Gradient vectors at the middle point and image 1 of the dimer. |
| orient | Unit vector along the direction of the dimer. |
| F_rot | Rotational force acting on image 1 of the dimer. |
Definition at line 428 of file Dimer.cpp.
| Dimer::RotationStepResult dimer::Dimer::rotateWithHessian | ( | const gpr::Coord & | R, |
| const gpr::Coord & | orient, | ||
| const gpr::Coord & | G01, | ||
| const bool | estim_Curv, | ||
| const Image1Evaluator & | image1_evaluator, | ||
| gpr::Coord & | orient_new, | ||
| double & | Curv, | ||
| gpr::Observation & | image1, | ||
| const HessianVectorEvaluator & | hessian_evaluator ) |
Minimize the analytic curvature in the seed and Hessian-residual plane, then query the resulting endpoint on the supplied potential.
Definition at line 229 of file Dimer.cpp.
| Dimer::RotationStepResult dimer::Dimer::rotateWithImage1Evaluator | ( | const gpr::Coord & | R, |
| const gpr::Coord & | orient, | ||
| const gpr::Coord & | G01, | ||
| const double | T_anglerot, | ||
| const bool | estim_Curv, | ||
| const Image1Evaluator & | image1_evaluator, | ||
| gpr::LBFGSInfo & | rotinfo, | ||
| gpr::Coord & | orient_new, | ||
| double & | Curv, | ||
| gpr::Observation & | image1 ) |
Definition at line 376 of file Dimer.cpp.
| Dimer::RotationStepResult dimer::Dimer::rotateWithRgminDimer | ( | const gpr::Coord & | R, |
| const gpr::Coord & | orient, | ||
| const gpr::Coord & | G01, | ||
| const bool | estim_Curv, | ||
| const Image1Evaluator & | image1_evaluator, | ||
| gpr::Coord & | orient_new, | ||
| double & | Curv, | ||
| gpr::Observation & | image1 ) |
| Dimer::RotationStepResult dimer::Dimer::rotateWithRgminDimer | ( | const gpr::Coord & | R, |
| const gpr::Coord & | orient, | ||
| const gpr::Coord & | G01, | ||
| const bool | estim_Curv, | ||
| const Image1Evaluator & | image1_evaluator, | ||
| gpr::Coord & | orient_new, | ||
| double & | Curv, | ||
| gpr::Observation & | image1, | ||
| const HessianVectorEvaluator & | hessian_evaluator ) |
Definition at line 248 of file Dimer.cpp.
|
inline |
UA-Dimer: per-degree-of-freedom force variance from the surrogate. When set and sized to the configuration, rotateForce removes the axial component in that Sigma^{-1} metric rather than the Euclidean one (Yu and Wang, DOI 10.48550/arxiv.2605.24401), so the rotation follows curvature the model resolves instead of the largest raw force difference. Unset leaves the classical arithmetic untouched.
Definition at line 187 of file Dimer.h.
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
| void dimer::Dimer::translate | ( | const gpr::Coord & | R, |
| const gpr::Coord & | orient, | ||
| const gpr::Coord & | F, | ||
| const double | curv, | ||
| const gpr::TransitionParameters & | param_trans, | ||
| gpr::LBFGSInfo & | transinfo, | ||
| gpr::Coord & | R_new ) |
Translate dimer.
The dimer is translated one step towards saddle point by the bound rgmin L-BFGS session (bindRgminTranslation), or by rgmin's empty-memory step when no session is bound.
| R | Coordinates of the middle point of the dimer. |
| orient | Unit vector along the direction of the dimer. |
| F | Force at the middle point of the dimer. |
| curv | Curvature of energy along the direction of the dimer. |
| param_trans | Predefined step length for convex regions, maximum step length. |
| transinfo | Unused; the curvature pairs live in the rgmin session. |
| R_new | Coordinates of the new middle point of the dimer. |
Definition at line 128 of file Dimer.cpp.
| void dimer::Dimer::translateForce | ( | const gpr::Coord & | F, |
| const gpr::Coord & | orient, | ||
| gpr::Coord & | F_trans ) |
Calculate translational force acting on image 1 of the dimer.
| F | Force at the middle point of the dimer. |
| orient | Unit vector along the direction of the dimer. |
| F_trans | Translational force acting on image 1 of the dimer. |
| void dimer::Dimer::translateWithForce | ( | const gpr::Coord & | R, |
| const gpr::Coord & | force, | ||
| const gpr::TransitionParameters & | parameters, | ||
| gpr::LBFGSInfo & | history, | ||
| gpr::Coord & | output ) |
Apply a caller-assembled dimer force through the same rgmin translation step.
Definition at line 153 of file Dimer.cpp.
|
friend |
|
friend |