namespace gpr::htst¶
Overview¶
namespace htst {
// typedefs
typedef std::function<Eigen::VectorXd(const Eigen::VectorXd&position)> GradientOracle;
typedef std::array<std::optional<Half>, 3> SearchHalves;
// enums
enum Kind;
enum Mode;
enum Source;
enum Status;
// structs
struct Half;
struct Options;
struct SearchRequest;
// classes
class EvaluationRecord;
// global functions
Options geometryOptions(const Options& options, const AtomsConfiguration& atoms, Eigen::Index dof);
Half fromHessian(const Eigen::MatrixXd& hessian, const Eigen::VectorXd& x, Kind kind, const Options& options);
Half measured(const GradientOracle& oracle, const Eigen::VectorXd& x, Kind kind, const Options& options);
Half surrogate(GaussianProcessRegression& gp, const Eigen::VectorXd& x, Kind kind, const Options& options);
Half refined(GaussianProcessRegression& gp, const GradientOracle& oracle, const Eigen::VectorXd& x, Kind kind, const Options& options);
SearchRequest& searchRequest();
SearchRequest takeSearchRequest();
void validateSearchRequest(const SearchRequest& request, const AtomsConfiguration& atoms, Eigen::Index dof);
SearchHalves& lastSearchHalves();
Half searchHalf(const EvaluationRecord& record, const Eigen::VectorXd& x, Kind kind, const InputParameters& params, const AtomsConfiguration& atoms, const GradientOracle& oracle, const SearchRequest& request, const Eigen::MatrixXd* stencil_hessian = nullptr);
InputParameters searchParameters();
Half minimumHalf(const EvaluationRecord& record, const Eigen::VectorXd& x, const AtomsConfiguration& atoms, const GradientOracle& oracle, const SearchRequest& request);
Eigen::MatrixXd stencilHessian(const Eigen::MatrixXd& positions, const Eigen::MatrixXd& gradients, double step);
SearchHalves bandHalves(const EvaluationRecord& record, const Eigen::VectorXd& initial, const Eigen::VectorXd& final_state, const Eigen::VectorXd& climbing, const Eigen::MatrixXd& stencil_positions, const Eigen::MatrixXd& stencil_gradients, double stencil_step, const InputParameters& params, const AtomsConfiguration& atoms, const GradientOracle& oracle, const SearchRequest& request);
double evAngstromAmuOmega();
} // namespace htst
Detailed Documentation¶
Typedefs¶
typedef std::array<std::optional<Half>, 3> SearchHalves
Reactant, saddle and product, indexed as gpr_htst_point_t. An empty slot is a point the search did not compute.
Global Functions¶
Options geometryOptions(const Options& options, const AtomsConfiguration& atoms, Eigen::Index dof)
Frozen atoms anchor the system, so neither translations nor rotations are projected. A periodic cell keeps translations and drops rotations. This is the rule physicalCurvatureBasis already uses. When options.masses is empty and atoms carries atomic_masses, movingAtomicMasses validates and selects the moving atoms’ masses.
Apply geometry-derived projection and mass rules from atoms to options : frozen atoms disable translation and rotation projection, a periodic MIC cell disables rotation projection while keeping translations, and empty options.masses inherits atoms.atomic_masses.
Half fromHessian(const Eigen::MatrixXd& hessian, const Eigen::VectorXd& x, Kind kind, const Options& options)
The half of an exact Hessian in the units of its coordinates.
Half measured(const GradientOracle& oracle, const Eigen::VectorXd& x, Kind kind, const Options& options)
Full central difference of the oracle gradient: 2 d calls.
Half surrogate(GaussianProcessRegression& gp, const Eigen::VectorXd& x, Kind kind, const Options& options)
The GP posterior-mean Hessian, with no oracle call. converged says whether every mode’s estimated ln nu spread is under the tolerance.
Half refined(GaussianProcessRegression& gp, const GradientOracle& oracle, const Eigen::VectorXd& x, Kind kind, const Options& options)
Start from the GP posterior-mean Hessian and replace it, direction by direction, by oracle Hessian actions (2 calls each) along the mode with the largest estimated ln nu spread, until ln_sum settles. An empty oracle is surrogate().
SearchRequest& searchRequest()
This thread’s request; it persists until it is assigned again.
SearchRequest takeSearchRequest()
Consume this thread’s one-shot request masses and return the request for the search about to run.
void validateSearchRequest(const SearchRequest& request, const AtomsConfiguration& atoms, Eigen::Index dof)
Validate a search request’s options and masses against atoms and dof before a search runs. An enabled request on coordinates that are not a whole number of atoms throws std::invalid_argument, masses given or not.
SearchHalves& lastSearchHalves()
The halves of the last search on this thread.
Half searchHalf(const EvaluationRecord& record, const Eigen::VectorXd& x, Kind kind, const InputParameters& params, const AtomsConfiguration& atoms, const GradientOracle& oracle, const SearchRequest& request, const Eigen::MatrixXd* stencil_hessian = nullptr)
One half at x from a finished search. A measured stencil Hessian is used when given; otherwise MEASURED differentiates the oracle, and the other modes fit a GP with params on the record’s evaluations nearest x. A half that cannot be formed is returned with Status::Unavailable.
InputParameters searchParameters()
The GP settings of gpr_model_config_defaults, used by searches that carry no GP configuration of their own.
Half minimumHalf(const EvaluationRecord& record, const Eigen::VectorXd& x, const AtomsConfiguration& atoms, const GradientOracle& oracle, const SearchRequest& request)
The minimizer’s half at its result x: searchHalf with searchParameters().
Eigen::MatrixXd stencilHessian(const Eigen::MatrixXd& positions, const Eigen::MatrixXd& gradients, double step)
Central-difference Hessian of an index stencil: the center, then the +h and -h displacements along each coordinate, as columns (or rows) of gradients. Empty when the stencil does not have that shape.
SearchHalves bandHalves(const EvaluationRecord& record, const Eigen::VectorXd& initial, const Eigen::VectorXd& final_state, const Eigen::VectorXd& climbing, const Eigen::MatrixXd& stencil_positions, const Eigen::MatrixXd& stencil_gradients, double stencil_step, const InputParameters& params, const AtomsConfiguration& atoms, const GradientOracle& oracle, const SearchRequest& request)
The halves of a band: its endpoints as minima, and the stencil center with its measured Hessian as the saddle when the search measured one, the climbing image otherwise.