#include "rgpot_engine_c_abi.h"Go to the source code of this file.
Classes | |
| struct | RgpotEngineGprResidualPrior |
| struct | RgpotEngineGprHint |
| struct | RgpotEngineGprStats |
Macros | |
| #define | RGPOT_ENGINE_ERR_OUTSIDE_SUPPORT 4 |
| #define | RGPOT_ENGINE_GPR_RESIDUAL_PRIOR_MAGIC 0x47505251u /* "GPRQ" */ |
| #define | RGPOT_ENGINE_GPR_RESIDUAL_PRIOR_VERSION 1u |
| #define | RGPOT_ENGINE_GPR_HINT_MAGIC 0x47505248u /* "GPRH" */ |
| #define | RGPOT_ENGINE_GPR_HINT_VERSION 1u |
Enumerations | |
| enum | rgpot_engine_gpr_hill_policy { RGPOT_GPR_HILL_TRUE = 0 , RGPOT_GPR_HILL_GP = 1 } |
| enum | rgpot_engine_gpr_phase { RGPOT_GPR_PHASE_SADDLE , RGPOT_GPR_PHASE_ORBIT , RGPOT_GPR_PHASE_HILL = 2 , RGPOT_GPR_PHASE_SURROGATE = 3 } |
| enum | rgpot_engine_gpr_hint_kind { RGPOT_ENGINE_GPR_HINT_INCORPORATE = 0 , RGPOT_ENGINE_GPR_HINT_SET_PHASE = 1 , RGPOT_ENGINE_GPR_HINT_LEARN_POINTS = 2 , RGPOT_ENGINE_GPR_HINT_RECORD_TRUE_CALLS = 3 , RGPOT_ENGINE_GPR_HINT_SET_TRAINING = 4 } |
Functions | |
| RGPOT_ENGINE_API int | rgpot_engine_hessian_checked (RgpotEnginePot *pot, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, double *hessian_out, size_t hessian_len, const double *box) |
| RGPOT_ENGINE_API int | rgpot_engine_hessian_action_checked (RgpotEnginePot *pot, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, const double *direction, size_t direction_len, double *hv_out, size_t hv_len, const double *box, unsigned long long *ops_out, double *scale_out) |
| RGPOT_ENGINE_API int | rgpot_engine_prediction_supported_checked (RgpotEnginePot *pot, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, const double *box, int *supported_out) |
| RGPOT_ENGINE_API int | rgpot_engine_predict_variance_checked (RgpotEnginePot *pot, long nSystems, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, double *var_energy_out, size_t var_energy_len, double *var_gradient_out, size_t var_gradient_len, const double *boxes) |
| RGPOT_ENGINE_API int | rgpot_engine_gpr_stats (const RgpotEnginePot *pot, RgpotEngineGprStats *stats_out) |
| #define RGPOT_ENGINE_ERR_OUTSIDE_SUPPORT 4 |
Definition at line 16 of file gpr_engine_curvature.h.
| #define RGPOT_ENGINE_GPR_HINT_MAGIC 0x47505248u /* "GPRH" */ |
Hint message for a curvature learning engine, passed to rgpot_engine_hint.
For RGPOT_ENGINE_GPR_HINT_LEARN_POINTS, the struct is followed immediately by n_points * n_coords doubles of positions, n_points doubles of energies, and n_points * n_coords doubles of gradients (dE/dx = -force).
RGPOT_ENGINE_GPR_HINT_SET_TRAINING takes effect at the next fit. n_points is the training window: a full fit trains on the most recent n_points observations, or on all of them at zero. phase 1 selects the Cholesky posterior and, after the first full fit, conditions later observations on the fitted hyperparameters through gpr_model_append_fixed_checked; phase 0 refits in full. An append needs a zero window and a Cartesian session and falls back to a full fit where the posterior cannot be extended.
Definition at line 101 of file gpr_engine_curvature.h.
| #define RGPOT_ENGINE_GPR_HINT_VERSION 1u |
Definition at line 102 of file gpr_engine_curvature.h.
| #define RGPOT_ENGINE_GPR_RESIDUAL_PRIOR_MAGIC 0x47505251u /* "GPRQ" */ |
Saddle-quadratic residual-prior configuration for a learning curvature engine, passed as the config blob to rgpot_engine_create.
The engine trains a Gaussian process on the residual of the quadratic expansion at the reference geometry (the saddle point), so far from training data its curvature returns to the reference Hessian.
The config buffer consists of this header followed immediately by:
Definition at line 33 of file gpr_engine_curvature.h.
| #define RGPOT_ENGINE_GPR_RESIDUAL_PRIOR_VERSION 1u |
Definition at line 34 of file gpr_engine_curvature.h.
Where fluctuation Hessians in the Hill phase come from.
Definition at line 37 of file gpr_engine_curvature.h.
| Enumerator | |
|---|---|
| RGPOT_ENGINE_GPR_HINT_INCORPORATE | |
| RGPOT_ENGINE_GPR_HINT_SET_PHASE | |
| RGPOT_ENGINE_GPR_HINT_LEARN_POINTS | |
| RGPOT_ENGINE_GPR_HINT_RECORD_TRUE_CALLS | |
| RGPOT_ENGINE_GPR_HINT_SET_TRAINING | |
Definition at line 104 of file gpr_engine_curvature.h.
Evaluation phase of a curvature learning engine.
Definition at line 47 of file gpr_engine_curvature.h.
| RGPOT_ENGINE_API int rgpot_engine_gpr_stats | ( | const RgpotEnginePot * | pot, |
| RgpotEngineGprStats * | stats_out ) |
Read the operation counters accumulated by the engine instance.
Definition at line 1884 of file GprEngineAbi.cpp.
| RGPOT_ENGINE_API int rgpot_engine_hessian_action_checked | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| const double * | direction, | ||
| size_t | direction_len, | ||
| double * | hv_out, | ||
| size_t | hv_len, | ||
| const double * | box, | ||
| unsigned long long * | ops_out, | ||
| double * | scale_out ) |
Extent-checked Hessian-vector product H(positions) * direction. positions_len, direction_len and hv_len must each be at least n_coords (for residual sessions) or 3*nAtoms. When ops_out and scale_out are non-NULL, the owning implementation writes the floating-point operation count and the magnitude scale used for roundoff certification (ops * DBL_EPSILON * scale). Returns 0 on success, RGPOT_ENGINE_ERR_OUTSIDE_SUPPORT (4) when the query lies outside the trained prediction kernel support.
Definition at line 2287 of file GprEngineAbi.cpp.
| RGPOT_ENGINE_API int rgpot_engine_hessian_checked | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| double * | hessian_out, | ||
| size_t | hessian_len, | ||
| const double * | box ) |
Extent-checked dense Hessian evaluation at one geometry. positions_len must be at least n_dof, and hessian_len at least n_dof * n_dof. n_dof is n_coords when that count is positive, otherwise 3*nAtoms. A longer positions buffer does not enlarge the Hessian. Returns 0 on success.
Definition at line 2251 of file GprEngineAbi.cpp.
| RGPOT_ENGINE_API int rgpot_engine_predict_variance_checked | ( | RgpotEnginePot * | pot, |
| long | nSystems, | ||
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| double * | var_energy_out, | ||
| size_t | var_energy_len, | ||
| double * | var_gradient_out, | ||
| size_t | var_gradient_len, | ||
| const double * | boxes ) |
Extent-checked posterior energy and gradient variance query at nSystems geometries. positions_len and var_gradient_len must each be at least nSystems * n_coords (for residual sessions) or nSystems * 3 * nAtoms, and var_energy_len at least nSystems. Surrogate-phase rgpot_engine_force and rgpot_engine_force_batch write this energy variance into their variance slot, so a host does not treat the GP as exact. Oracle phases write 0: those evaluations are the true potential. The gradient variance is only available here. Returns 0 on success.
Definition at line 2365 of file GprEngineAbi.cpp.
| RGPOT_ENGINE_API int rgpot_engine_prediction_supported_checked | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| const double * | box, | ||
| int * | supported_out ) |
Extent-checked prediction-support query at one geometry. positions_len must be at least n_coords (for residual sessions) or 3*nAtoms. On success, *supported_out is 1 inside the prediction kernel support and 0 outside it.
Definition at line 2326 of file GprEngineAbi.cpp.