GPRidge v1.0.0
GPR-accelerated saddle point searches on potential energy surfaces
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
gpr_engine_curvature.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: MIT
2
* Copyright (c) gpridge developers
3
* See LICENSE for details.
4
*
5
* Optional libgpr_engine curvature-session exports alongside the
6
* pinned rgpot engine ABI.
7
*/
8
#pragma once
9
10
#include "
rgpot_engine_c_abi.h
"
11
12
#ifdef __cplusplus
13
extern
"C"
{
14
#endif
15
16
#define RGPOT_ENGINE_ERR_OUTSIDE_SUPPORT 4
17
33
#define RGPOT_ENGINE_GPR_RESIDUAL_PRIOR_MAGIC 0x47505251u
/* "GPRQ" */
34
#define RGPOT_ENGINE_GPR_RESIDUAL_PRIOR_VERSION 1u
35
37
typedef
enum
{
38
RGPOT_GPR_HILL_TRUE
= 0,
42
RGPOT_GPR_HILL_GP
= 1
44
}
rgpot_engine_gpr_hill_policy
;
45
47
typedef
enum
{
48
RGPOT_GPR_PHASE_SADDLE
=
49
0,
50
RGPOT_GPR_PHASE_ORBIT
=
51
1,
52
RGPOT_GPR_PHASE_HILL
= 2,
53
RGPOT_GPR_PHASE_SURROGATE
= 3
54
}
rgpot_engine_gpr_phase
;
55
56
typedef
struct
{
57
unsigned
magic
;
58
unsigned
version
;
59
long
n_atoms
;
62
long
n_coords
;
63
int
hill_policy
;
64
int
has_gradient
;
65
int
has_atomic_nrs
;
66
double
reference_energy
;
67
/* GP model configuration (matches gpr_model_config_t fields) */
68
double
sigma2
;
69
double
jitter_sigma2
;
70
double
magn_sigma2
;
71
double
const_sigma2
;
72
double
prior_mu
;
73
double
prior_nu
;
74
double
prior_s2
;
75
int
optim_alg
;
76
int
max_iter
;
77
double
tol_func
;
78
double
tol_sol
;
79
int
report_level
;
80
double
tp_hyperprior_a
;
81
double
tp_hyperprior_b
;
82
int
use_zbl_prior_mean
;
83
int
use_ff_prior_mean
;
84
}
RgpotEngineGprResidualPrior
;
85
101
#define RGPOT_ENGINE_GPR_HINT_MAGIC 0x47505248u
/* "GPRH" */
102
#define RGPOT_ENGINE_GPR_HINT_VERSION 1u
103
104
typedef
enum
{
105
RGPOT_ENGINE_GPR_HINT_INCORPORATE
= 0,
106
RGPOT_ENGINE_GPR_HINT_SET_PHASE
= 1,
107
RGPOT_ENGINE_GPR_HINT_LEARN_POINTS
= 2,
108
RGPOT_ENGINE_GPR_HINT_RECORD_TRUE_CALLS
= 3,
109
RGPOT_ENGINE_GPR_HINT_SET_TRAINING
= 4
110
}
rgpot_engine_gpr_hint_kind
;
111
112
typedef
struct
{
113
unsigned
magic
;
114
unsigned
version
;
115
int
kind
;
116
int
phase
;
119
long
n_points
;
121
long
n_coords
;
122
}
RgpotEngineGprHint
;
123
129
typedef
struct
{
130
size_t
struct_size
;
131
unsigned
long
long
true_energy_calls
;
132
unsigned
long
long
true_gradient_calls
;
133
unsigned
long
long
true_hessian_calls
;
134
unsigned
long
long
gp_hessians
;
135
unsigned
long
long
gp_predictions
;
136
unsigned
long
long
fits
;
137
unsigned
long
long
observations
;
140
unsigned
long
long
fixed_appends
;
141
}
RgpotEngineGprStats
;
142
150
RGPOT_ENGINE_API
int
rgpot_engine_hessian_checked
(
151
RgpotEnginePot
*
pot
,
long
nAtoms,
const
double
*positions,
152
size_t
positions_len,
const
int
*atomicNrs,
double
*hessian_out,
153
size_t
hessian_len,
const
double
*box);
154
165
RGPOT_ENGINE_API
int
rgpot_engine_hessian_action_checked
(
166
RgpotEnginePot
*
pot
,
long
nAtoms,
const
double
*positions,
167
size_t
positions_len,
const
int
*atomicNrs,
const
double
*direction,
168
size_t
direction_len,
double
*hv_out,
size_t
hv_len,
const
double
*box,
169
unsigned
long
long
*ops_out,
double
*scale_out);
170
177
RGPOT_ENGINE_API
int
rgpot_engine_prediction_supported_checked
(
178
RgpotEnginePot
*
pot
,
long
nAtoms,
const
double
*positions,
179
size_t
positions_len,
const
int
*atomicNrs,
const
double
*box,
180
int
*supported_out);
181
192
RGPOT_ENGINE_API
int
rgpot_engine_predict_variance_checked
(
193
RgpotEnginePot
*
pot
,
long
nSystems,
long
nAtoms,
const
double
*positions,
194
size_t
positions_len,
const
int
*atomicNrs,
double
*var_energy_out,
195
size_t
var_energy_len,
double
*var_gradient_out,
size_t
var_gradient_len,
196
const
double
*boxes);
197
201
RGPOT_ENGINE_API
int
rgpot_engine_gpr_stats
(
const
RgpotEnginePot
*
pot
,
202
RgpotEngineGprStats
*stats_out);
203
204
#ifdef __cplusplus
205
}
206
#endif
rgpot_engine_gpr_hint_kind
rgpot_engine_gpr_hint_kind
Definition
gpr_engine_curvature.h:104
RGPOT_ENGINE_GPR_HINT_LEARN_POINTS
@ RGPOT_ENGINE_GPR_HINT_LEARN_POINTS
Definition
gpr_engine_curvature.h:107
RGPOT_ENGINE_GPR_HINT_SET_PHASE
@ RGPOT_ENGINE_GPR_HINT_SET_PHASE
Definition
gpr_engine_curvature.h:106
RGPOT_ENGINE_GPR_HINT_RECORD_TRUE_CALLS
@ RGPOT_ENGINE_GPR_HINT_RECORD_TRUE_CALLS
Definition
gpr_engine_curvature.h:108
RGPOT_ENGINE_GPR_HINT_SET_TRAINING
@ RGPOT_ENGINE_GPR_HINT_SET_TRAINING
Definition
gpr_engine_curvature.h:109
RGPOT_ENGINE_GPR_HINT_INCORPORATE
@ RGPOT_ENGINE_GPR_HINT_INCORPORATE
Definition
gpr_engine_curvature.h:105
rgpot_engine_gpr_hill_policy
rgpot_engine_gpr_hill_policy
Definition
gpr_engine_curvature.h:37
RGPOT_GPR_HILL_TRUE
@ RGPOT_GPR_HILL_TRUE
Definition
gpr_engine_curvature.h:38
RGPOT_GPR_HILL_GP
@ RGPOT_GPR_HILL_GP
Definition
gpr_engine_curvature.h:42
rgpot_engine_gpr_stats
RGPOT_ENGINE_API int rgpot_engine_gpr_stats(const RgpotEnginePot *pot, RgpotEngineGprStats *stats_out)
Definition
GprEngineAbi.cpp:1884
rgpot_engine_hessian_checked
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)
Definition
GprEngineAbi.cpp:2251
rgpot_engine_predict_variance_checked
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)
Definition
GprEngineAbi.cpp:2365
rgpot_engine_prediction_supported_checked
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)
Definition
GprEngineAbi.cpp:2326
rgpot_engine_gpr_phase
rgpot_engine_gpr_phase
Definition
gpr_engine_curvature.h:47
RGPOT_GPR_PHASE_ORBIT
@ RGPOT_GPR_PHASE_ORBIT
Definition
gpr_engine_curvature.h:50
RGPOT_GPR_PHASE_HILL
@ RGPOT_GPR_PHASE_HILL
Definition
gpr_engine_curvature.h:52
RGPOT_GPR_PHASE_SADDLE
@ RGPOT_GPR_PHASE_SADDLE
Definition
gpr_engine_curvature.h:48
RGPOT_GPR_PHASE_SURROGATE
@ RGPOT_GPR_PHASE_SURROGATE
Definition
gpr_engine_curvature.h:53
rgpot_engine_hessian_action_checked
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)
Definition
GprEngineAbi.cpp:2287
pot
Potential wrappers and the batched oracle interface.
Definition
ProblemSetUp.h:22
rgpot_engine_c_abi.h
RgpotEngineGprHint
Definition
gpr_engine_curvature.h:112
RgpotEngineGprHint::n_points
long n_points
Definition
gpr_engine_curvature.h:119
RgpotEngineGprHint::magic
unsigned magic
Definition
gpr_engine_curvature.h:113
RgpotEngineGprHint::phase
int phase
Definition
gpr_engine_curvature.h:116
RgpotEngineGprHint::version
unsigned version
Definition
gpr_engine_curvature.h:114
RgpotEngineGprHint::kind
int kind
Definition
gpr_engine_curvature.h:115
RgpotEngineGprHint::n_coords
long n_coords
Definition
gpr_engine_curvature.h:121
RgpotEngineGprResidualPrior
Definition
gpr_engine_curvature.h:56
RgpotEngineGprResidualPrior::tol_sol
double tol_sol
Definition
gpr_engine_curvature.h:78
RgpotEngineGprResidualPrior::sigma2
double sigma2
Definition
gpr_engine_curvature.h:68
RgpotEngineGprResidualPrior::tol_func
double tol_func
Definition
gpr_engine_curvature.h:77
RgpotEngineGprResidualPrior::has_gradient
int has_gradient
Definition
gpr_engine_curvature.h:64
RgpotEngineGprResidualPrior::tp_hyperprior_b
double tp_hyperprior_b
Definition
gpr_engine_curvature.h:81
RgpotEngineGprResidualPrior::use_zbl_prior_mean
int use_zbl_prior_mean
Definition
gpr_engine_curvature.h:82
RgpotEngineGprResidualPrior::max_iter
int max_iter
Definition
gpr_engine_curvature.h:76
RgpotEngineGprResidualPrior::tp_hyperprior_a
double tp_hyperprior_a
Definition
gpr_engine_curvature.h:80
RgpotEngineGprResidualPrior::magn_sigma2
double magn_sigma2
Definition
gpr_engine_curvature.h:70
RgpotEngineGprResidualPrior::const_sigma2
double const_sigma2
Definition
gpr_engine_curvature.h:71
RgpotEngineGprResidualPrior::prior_s2
double prior_s2
Definition
gpr_engine_curvature.h:74
RgpotEngineGprResidualPrior::use_ff_prior_mean
int use_ff_prior_mean
Definition
gpr_engine_curvature.h:83
RgpotEngineGprResidualPrior::has_atomic_nrs
int has_atomic_nrs
Definition
gpr_engine_curvature.h:65
RgpotEngineGprResidualPrior::magic
unsigned magic
Definition
gpr_engine_curvature.h:57
RgpotEngineGprResidualPrior::prior_mu
double prior_mu
Definition
gpr_engine_curvature.h:72
RgpotEngineGprResidualPrior::prior_nu
double prior_nu
Definition
gpr_engine_curvature.h:73
RgpotEngineGprResidualPrior::jitter_sigma2
double jitter_sigma2
Definition
gpr_engine_curvature.h:69
RgpotEngineGprResidualPrior::hill_policy
int hill_policy
Definition
gpr_engine_curvature.h:63
RgpotEngineGprResidualPrior::report_level
int report_level
Definition
gpr_engine_curvature.h:79
RgpotEngineGprResidualPrior::n_coords
long n_coords
Definition
gpr_engine_curvature.h:62
RgpotEngineGprResidualPrior::n_atoms
long n_atoms
Definition
gpr_engine_curvature.h:59
RgpotEngineGprResidualPrior::version
unsigned version
Definition
gpr_engine_curvature.h:58
RgpotEngineGprResidualPrior::optim_alg
int optim_alg
Definition
gpr_engine_curvature.h:75
RgpotEngineGprResidualPrior::reference_energy
double reference_energy
Definition
gpr_engine_curvature.h:66
RgpotEngineGprStats
Definition
gpr_engine_curvature.h:129
RgpotEngineGprStats::struct_size
size_t struct_size
Definition
gpr_engine_curvature.h:130
RgpotEngineGprStats::gp_predictions
unsigned long long gp_predictions
Definition
gpr_engine_curvature.h:135
RgpotEngineGprStats::true_gradient_calls
unsigned long long true_gradient_calls
Definition
gpr_engine_curvature.h:132
RgpotEngineGprStats::true_hessian_calls
unsigned long long true_hessian_calls
Definition
gpr_engine_curvature.h:133
RgpotEngineGprStats::fits
unsigned long long fits
Definition
gpr_engine_curvature.h:136
RgpotEngineGprStats::gp_hessians
unsigned long long gp_hessians
Definition
gpr_engine_curvature.h:134
RgpotEngineGprStats::true_energy_calls
unsigned long long true_energy_calls
Definition
gpr_engine_curvature.h:131
RgpotEngineGprStats::observations
unsigned long long observations
Definition
gpr_engine_curvature.h:137
RgpotEngineGprStats::fixed_appends
unsigned long long fixed_appends
Definition
gpr_engine_curvature.h:140
RgpotEnginePot
Definition
Cp2kEngineAbi.cc:25
gpr
potentials
gpr_engine_curvature.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf