78#define GPR_C_ABI_MAJOR 1
79#define GPR_C_ABI_MINOR 26
99#define GPR_ABI_CHECK() gpr_abi_check(GPR_C_ABI_MAJOR, GPR_C_ABI_MINOR)
422 const int* atomic_nrs,
double* F,
double* energy,
423 double* energy_noise_rms,
const double* box,
447 long n_atoms,
const double* R,
const int* atomic_nrs,
double* F,
448 double* energy,
double* energy_noise_rms,
double* force_noise_rms,
449 const double* box,
void* user_data);
461 double* energy,
double* gradient,
1256 const double* G,
int n_obs,
int n_coords);
1270 gpr_model_t model,
const double* R,
size_t R_len,
const double* E,
1271 size_t E_len,
const double* G,
size_t G_len,
int n_obs,
int n_coords,
1273 size_t lengthscales_len);
1319 double* kernel_s,
double* hessian_s);
1332 double* posterior_s,
double* subset_s,
1333 double* objective_s,
double* condition_s,
1334 double* cache_s,
double* curvature_s,
1335 double* energy_s,
double* schedule_s);
1341 const double* E_new,
const double* G_new,
int n_new,
1354 double* G_out,
int n_coords);
1364 int n_coords,
double* energy,
double* scale,
1365 double* mean,
double* kstar,
double* weights,
1366 int capacity,
int* order);
1372 double* var_E_out,
double* var_G_out,
1379 double* E_out,
double* G_out,
double* var_E_out,
1380 double* var_G_out,
int n_coords);
1387 double* E_out,
double* G_out,
double* var_E_out,
1388 double* var_G_out,
int n_queries,
int n_coords);
1410 const double* E,
size_t E_len,
const double* G,
1411 size_t G_len,
int n_obs,
int n_coords);
1414 size_t R_len,
const double* E_new,
size_t E_len,
1415 const double* G_new,
size_t G_len,
int n_new,
1426 size_t R_len,
const double* E_new,
1427 size_t E_len,
const double* G_new,
1428 size_t G_len,
int n_new,
int n_coords);
1442 const double* R_holdout,
size_t R_len,
1443 const double* G_true,
size_t G_len,
1444 int n_holdout,
int n_coords,
1445 double nominal_probability,
1461 double nominal_probability,
1465 size_t R_len,
double* E_out,
double* G_out,
1466 size_t G_len,
int n_coords);
1469 size_t R_len,
double* var_E_out,
1470 double* var_G_out,
size_t var_G_len,
1474 size_t R_len,
double* E_out,
double* G_out,
1475 size_t G_len,
double* var_E_out,
1476 double* var_G_out,
size_t var_G_len,
1480 size_t R_len,
double* E_out,
size_t E_len,
1481 double* G_out,
size_t G_len,
1482 double* var_E_out,
size_t var_E_len,
1483 double* var_G_out,
size_t var_G_len,
1484 int n_queries,
int n_coords);
1516 double* H_out,
int n_coords);
1526 size_t R_len,
double* H_out,
size_t H_len,
1548 const double* v,
double* Hv_out,
1558 const double* R_query,
1559 size_t R_len,
const double* v,
1560 size_t v_len,
double* Hv_out,
1561 size_t Hv_len,
int n_coords);
1572 int n_coords,
int* supported);
1581 const double* R_query,
size_t R_len,
1582 int n_coords,
int* supported);
1609 const double* R_queries,
1610 int n_queries,
int n_coords,
1611 double* var_E_lower_out,
1612 double* var_E_upper_out);
1622 gpr_model_t model,
const double* R_queries,
size_t R_len,
int n_queries,
1623 int n_coords,
double* var_E_lower_out,
size_t var_E_lower_len,
1624 double* var_E_upper_out,
size_t var_E_upper_len);
1776 const double*
y,
size_t y_len,
const double* noise_var,
1777 size_t noise_var_len,
int n_obs,
int n_dims);
1803 const double*
y,
size_t y_len,
1804 const double* noise_var,
size_t noise_var_len,
1805 const double* lower,
size_t lower_len,
1806 const double* upper,
size_t upper_len,
1807 int n_obs,
int n_dims);
1828 const double* y_new,
size_t y_len,
1829 const double* noise_var_new,
size_t noise_var_len,
1830 int n_new,
int n_dims,
int refit);
1852 double* lengthscales_out,
1853 size_t lengthscales_len);
1921 size_t X_len,
double* mean_out,
1922 size_t mean_len,
double* var_out,
1923 size_t var_len,
int n_queries,
int n_dims);
1946 size_t lower_len,
const double* upper,
1947 size_t upper_len,
const double* X,
size_t X_len,
1948 int n_points,
int n_dims,
double* z_out,
1957 size_t lower_len,
const double* upper,
1958 size_t upper_len,
int n_dims,
1975 const double* upper,
size_t upper_len,
int n_dims,
1976 double* mean_out,
double* var_out);
1990 size_t lower_len,
const double* upper,
1991 size_t upper_len,
int n_dims,
2017 size_t lower_len,
const double* upper,
2018 size_t upper_len,
const double* mean,
2019 size_t mean_len,
const double* covariance,
2020 size_t covariance_len,
int n_dims,
2021 double* mean_out,
double* var_out,
2041 const double* lower,
size_t lower_len,
2042 const double* upper,
size_t upper_len,
2043 const double* mean,
size_t mean_len,
2044 const double* covariance,
2045 size_t covariance_len,
int n_dims,
2085 const double* upper_limits,
2086 size_t upper_limits_len,
int n_limits,
2087 int n_dims,
double* mean_out,
2088 size_t mean_len,
double* covariance_out,
2089 size_t covariance_len);
2111 const double* upper_limits,
2112 size_t upper_limits_len,
int n_limits,
2113 int n_dims,
int n_draws, uint64_t seed,
2114 double* draws_out,
size_t draws_len);
2135 gpr_bq_t bq,
const double* lower,
size_t lower_len,
const double* upper,
2136 size_t upper_len,
const double* X_candidates,
size_t X_cand_len,
2137 const double* cand_noise_var,
size_t cand_noise_len,
int n_candidates,
2138 int n_dims,
double* delta_var_out,
size_t delta_var_len);
2165 gpr_bq_t bq,
const double* lower,
size_t lower_len,
const double* upper,
2166 size_t upper_len,
const double* X_candidates,
size_t X_cand_len,
2167 const double* cand_noise_var,
size_t cand_noise_len,
int n_candidates,
2168 int n_dims,
int batch_size,
int* selected_indices_out,
2169 size_t selected_indices_len,
double* step_reductions_out,
2170 size_t step_reductions_len);
2196 double* z_scores_out,
2197 size_t z_scores_len);
2315 const double* R,
int n_points,
int n_coords,
2316 double* H_out,
double* residuals_out,
2323 size_t R_len,
int n_points,
int n_coords,
double* H_out,
size_t H_len,
2324 double* residuals_out,
size_t residuals_len,
2336 const double* R,
int n_points,
2337 int n_coords,
const double* V,
2338 int n_vectors,
double* Hv_out,
2344 size_t R_len,
int n_points,
int n_coords,
const double* V,
size_t V_len,
2345 int n_vectors,
double* Hv_out,
size_t Hv_len,
2361 int n_points,
int n_coords,
const double* V,
int n_left,
const double* W,
2367 size_t R_len,
int n_points,
int n_coords,
const double* V,
size_t V_len,
2368 int n_left,
const double* W,
size_t W_len,
int n_right,
double* cov_out,
2381 const double* R,
int n_points,
2382 int n_coords,
const double* A,
2389 size_t R_len,
int n_points,
int n_coords,
const double* A,
size_t A_len,
2400 const double* R,
int n_points,
2401 int n_coords,
double* var_E_out,
2408 size_t R_len,
int n_points,
int n_coords,
double* var_E_out,
2409 size_t var_E_len,
double* var_G_out,
size_t var_G_len,
2431 const double* R_new,
const double* E_new,
2432 const double* G_new,
int n_new,
2433 const double* R_query,
int n_query,
int n_coords,
2434 double* E_out,
double* G_out,
double* var_E_out,
2441 const double* R_new,
size_t R_new_len,
const double* E_new,
2442 size_t E_new_len,
const double* G_new,
size_t G_new_len,
int n_new,
2443 const double* R_query,
size_t R_query_len,
int n_query,
int n_coords,
2444 double* E_out,
size_t E_len,
double* G_out,
size_t G_len,
double* var_E_out,
2445 size_t var_E_len,
double* var_G_out,
size_t var_G_len,
2455 const double* vector,
double* hv_out,
2473 const double* R_new,
const double* E_new,
const double* G_new,
int n_new,
2474 const double* H_new,
gpr_hvp_fn hvp,
void* user_data,
const double* R_query,
2475 int n_query,
int n_coords,
double* E_out,
double* G_out,
double* var_E_out,
2482 const double* R_new,
size_t R_new_len,
const double* E_new,
2483 size_t E_new_len,
const double* G_new,
size_t G_new_len,
int n_new,
2484 const double* H_new,
size_t H_new_len,
gpr_hvp_fn hvp,
void* user_data,
2485 const double* R_query,
size_t R_query_len,
int n_query,
int n_coords,
2486 double* E_out,
size_t E_len,
double* G_out,
size_t G_len,
double* var_E_out,
2487 size_t var_E_len,
double* var_G_out,
size_t var_G_len,
2539#define GPR_HTST_OMEGA_EV_ANGSTROM_AMU 9.82269385e13
2650 const double* masses,
int n_masses,
2651 const double* H,
const double*
x,
int n_coords,
2652 int kind,
double* frequencies_out,
2658 int n_masses,
const double* H,
size_t H_len,
const double*
x,
size_t x_len,
2659 int n_coords,
int kind,
double* frequencies_out,
size_t frequencies_len,
2675 int n_masses,
const double*
x,
int n_coords,
int kind,
2676 double* frequencies_out,
int* measured_out,
2682 const double* masses,
size_t masses_len,
int n_masses,
2683 const double*
x,
size_t x_len,
int n_coords,
int kind,
2684 double* frequencies_out,
size_t frequencies_len,
2685 int* measured_out,
size_t measured_len,
2731 const double* masses,
int n_masses);
2745 double* frequencies_out,
int* measured_out,
2750 double* frequencies_out,
2751 size_t frequencies_len,
int* measured_out,
2752 size_t measured_len,
int n_coords);
2756 double* frequencies_out,
int* measured_out,
2762 double* frequencies_out,
2763 size_t frequencies_len,
int* measured_out,
2764 size_t measured_len,
int n_coords);
2870 const double* grad_noise_var,
2871 size_t grad_noise_var_len);
2912 double reference_variance,
2913 double min_relative_weight,
2914 double* noise_var_out,
2915 size_t noise_var_len,
int n_obs);
2950 const double* F,
size_t F_len,
2951 const double* F_noise_var,
size_t F_noise_var_len,
2952 const double* grad_F,
size_t grad_F_len,
2953 const double* grad_noise_var,
2954 size_t grad_noise_var_len,
2955 const uint8_t* grad_present,
size_t grad_present_len,
2956 int n_obs,
int dimension);
2980 size_t s_query_len,
double* F_out,
2981 size_t F_len,
double* grad_F_out,
2982 size_t grad_F_len,
double* var_F_out,
2983 size_t var_F_len,
int n_queries,
3082 size_t path_len,
int n_path,
int dimension,
3083 int reactant_index,
int product_index,
3084 const double* diffusion,
size_t diffusion_len,
3186 const double* length_scales,
3187 size_t length_scales_len,
3188 double signal_variance,
3189 double noise_variance);
3201 double* length_scales_out,
3202 size_t length_scales_len,
3203 double* signal_variance_out,
3204 double* noise_variance_out);
3220 const double*
y,
size_t y_len,
3221 const double* noise_var,
size_t noise_var_len,
3222 int n_obs,
int n_dims);
3240 double* log_marginal_likelihood_out);
3256 size_t X_len,
int n_queries,
int n_dims,
3257 double query_noise_var,
double* mean_out,
3258 size_t mean_len,
double* std_out,
size_t std_len);
3282 const double* upper,
size_t upper_len,
3283 const int* axis_kind,
size_t axis_kind_len,
3284 int dimension,
int kernel,
int noisy);
3306 const double* values,
3307 size_t values_len,
int categorical);
3328 size_t X_len,
const double*
y,
size_t y_len,
3329 const double* noise_var,
size_t noise_var_len,
3330 const double* constraint,
size_t constraint_len,
3331 int n_obs,
int n_dims);
3350 size_t X_len,
int n_dims,
int* n_proposed_out);
3439 double force_tol_fraction);
3536 const int* atomic_nrs,
double* F,
double* energy,
3537 double* energy_noise_rms,
const double* box);
3544 const double* R,
const int* atomic_nrs,
3545 double* F,
double* energy,
3546 double* energy_noise_rms,
3547 double* force_noise_rms,
3587 const double* R_init,
const double* orient_init,
3589 const double* E_obs,
const double* G_obs,
int n_init_obs,
3590 double* R_saddle,
double* E_saddle,
double* orient_out,
3591 double* curvature,
int* n_force_calls,
int* n_gp_calls);
3601 const double* R_init,
const double* orient_init,
3603 const double* R_obs,
const double* E_obs,
3604 const double* G_obs,
int n_init_obs,
3605 double* R_saddle,
double* E_saddle,
3606 double* orient_out,
double* curvature,
3607 int* n_force_calls,
int* n_gp_calls);
3670 const double* R_init,
const double* orient_init,
3672 const double* R_obs,
const double* E_obs,
3673 const double* G_obs,
int n_init_obs,
3674 double* R_saddle,
double* E_saddle,
3714 const double* R_initial,
const double* R_final,
3715 int n_coords,
int n_images,
3733 const double* R_initial,
const double* R_final,
3734 int n_coords,
int n_images,
3746 gpr_atoms_t atoms,
const double* R_initial,
const double* R_final,
3764 const double* R_initial,
3765 const double* R_final,
int n_coords,
3773 gpr_atoms_t atoms,
const double* R_initial,
const double* R_final,
3796 const double* box,
const double* R_initial,
3797 const double* R_final,
int n_coords,
3943 const double* R_initial,
const double* R_final,
3944 int n_coords,
int n_images,
3957 const double* R_initial,
3958 const double* R_final,
int n_coords,
4002 const double* R_initial,
const double* R_final,
4003 int n_coords,
int n_images,
4047 double* E_final,
double* G_final,
int* converged,
4048 int* n_oracle_calls);
4072 double* E_out,
double* G_out);
4095 double* gradient,
void* user_data);
4099 double* energy,
double* gradient,
void* user_data);
4103 double* gradient,
void* user_data);
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out
void gpr_atoms_destroy(gpr_atoms_t atoms)
Destroy atoms configuration. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_e...
int gpr_atoms_n_moving(gpr_atoms_t atoms)
Number of moving (non-frozen) atoms.
int gpr_atoms_n_pairtypes(gpr_atoms_t atoms)
Number of pair types.
gpr_atoms_t gpr_atoms_create(const gpr_atoms_config_t *config)
Create an atoms configuration handle from descriptor. Returns NULL on failure (check gpr_last_error()...
int gpr_bq_get_lengthscales_checked(gpr_bq_t bq, double *out, size_t out_len)
Copy the current length scales out.
int gpr_bq_candidate_variance_reduction_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *X_candidates, size_t X_cand_len, const double *cand_noise_var, size_t cand_noise_len, int n_candidates, int n_dims, double *delta_var_out, size_t delta_var_len)
Variance reduction of the integral from one extra observation at each candidate.
int gpr_bq_calibrate_loo_checked(gpr_bq_t bq, double nominal_probability, gpr_calibration_report_t *report)
Closed-form leave-one-out calibration summary at the given central probability in (0,...
int gpr_bq_integrate_uncertainty_checked(gpr_bq_t bq, int kind, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *mean, size_t mean_len, const double *covariance, size_t covariance_len, int n_dims, gpr_bq_uncertainty_t *report)
As gpr_bq_integrate_measure_checked, with the uncertainty split by source. Same measure arguments and...
int gpr_bq_get_extra_sigma2(gpr_bq_t bq, double *out)
Extra observation-noise variance added to every observation. out receives one double.
gpr_bq_t gpr_bq_create(const gpr_bq_config_t *config)
Create a scalar GP / Bayesian quadrature handle.
int gpr_bq_integrate_report_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_dims, gpr_bq_integral_report_t *report)
Integral over a box with the full decomposition of the variance.
int gpr_bq_get_magn_sigma2(gpr_bq_t bq, double *out)
Signal variance of the posterior (squared output unit). out receives one double.
int gpr_bq_integrate_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_dims, double *mean_out, double *var_out)
Integral mean and variance over a box. Equivalent to gpr_bq_integrate_report_checked keeping only mea...
int gpr_bq_fit_hyperparameters_checked(gpr_bq_t bq, gpr_bq_hyper_mode_t mode, gpr_bq_fit_report_t *report, double *lengthscales_out, size_t lengthscales_len)
Re-infer the hyperparameters of a trained model with the given treatment, which then becomes the conf...
int gpr_bq_kernel_mean_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *X, size_t X_len, int n_points, int n_dims, double *z_out, size_t z_len)
Kernel mean z_i = integral over the box [lower, upper] of k(x, X_i) dx, at the training points or at ...
int gpr_bq_set_extra_sigma2(gpr_bq_t bq, double value)
Set the extra observation-noise variance. A trained model is refit with its configured hyperparameter...
int gpr_bq_train_checked(gpr_bq_t bq, const double *X, size_t X_len, const double *y, size_t y_len, const double *noise_var, size_t noise_var_len, int n_obs, int n_dims)
Train on n_obs points and infer the integration box from the training extrema.
int gpr_bq_n_lengthscales(gpr_bq_t bq)
Number of length scales: dimension when the configuration is ARD, otherwise 1; 0 for NULL or a dead h...
int gpr_bq_reset(gpr_bq_t bq, const gpr_bq_config_t *config)
Replace the configuration and drop every observation and any stored integration box.
int gpr_bq_append_checked(gpr_bq_t bq, const double *X_new, size_t X_len, const double *y_new, size_t y_len, const double *noise_var_new, size_t noise_var_len, int n_new, int n_dims, int refit)
Append n_new observations to a trained model.
void gpr_bq_destroy(gpr_bq_t bq)
Destroy a handle from gpr_bq_create. Destroying NULL or a live handle clears gpr_last_status() and gp...
int gpr_bq_get_basis(gpr_bq_t bq, int *basis_out)
Active basis selection, a gpr_bq_basis_t value written to *basis_out (GPR_BQ_BASIS_FOLLOW_CONFIG unti...
int gpr_bq_set_magn_sigma2(gpr_bq_t bq, double value)
Pin the signal variance. A trained model is rebuilt with it held and the length scales kept (an ARD s...
int gpr_bq_dimension(gpr_bq_t bq)
Input dimension of the configuration; 0 for NULL or a dead handle.
int gpr_bq_n_observations(gpr_bq_t bq)
Number of stored observations; 0 for NULL or a dead handle.
int gpr_bq_kernel_double_integral_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_dims, double *omega_out)
Kernel double integral of k over the box, written to *omega_out (output unit squared times volume squ...
int gpr_bq_train_bounded_checked(gpr_bq_t bq, const double *X, size_t X_len, const double *y, size_t y_len, const double *noise_var, size_t noise_var_len, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_obs, int n_dims)
Train and store an explicit integration box. Each lower[d] is finite and strictly below upper[d],...
int gpr_bq_sample_cumulative_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper_limits, size_t upper_limits_len, int n_limits, int n_dims, int n_draws, uint64_t seed, double *draws_out, size_t draws_len)
Draw n_draws joint samples of the cumulative integrals, deterministic in seed.
int gpr_bq_set_basis(gpr_bq_t bq, int basis)
Select the Bayes-Sard mean model with a gpr_bq_basis_t value; GPR_BQ_BASIS_FOLLOW_CONFIG (-1) follows...
int gpr_bq_calibrate_loo_scores_checked(gpr_bq_t bq, double nominal_probability, gpr_bq_loo_report_t *report, double *z_scores_out, size_t z_scores_len)
As gpr_bq_calibrate_loo_checked, and also write every standardized leave-one-out score.
int gpr_bq_predict_batch_checked(gpr_bq_t bq, const double *X_queries, size_t X_len, double *mean_out, size_t mean_len, double *var_out, size_t var_len, int n_queries, int n_dims)
Posterior mean and variance at n_queries points.
int gpr_bq_integrate_cumulative_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper_limits, size_t upper_limits_len, int n_limits, int n_dims, double *mean_out, size_t mean_len, double *covariance_out, size_t covariance_len)
Joint posterior of the integrals over [lower, upper_limits[j]] for n_limits nested upper limits.
int gpr_bq_select_batch_candidates_checked(gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *X_candidates, size_t X_cand_len, const double *cand_noise_var, size_t cand_noise_len, int n_candidates, int n_dims, int batch_size, int *selected_indices_out, size_t selected_indices_len, double *step_reductions_out, size_t step_reductions_len)
Greedily choose batch_size candidates, each conditioned on the ones chosen before it.
int gpr_bq_set_lengthscales_checked(gpr_bq_t bq, const double *values, size_t values_len)
Pin the length scales. A trained model is rebuilt with them held and the signal variance kept at its ...
int gpr_bq_integrate_measure_checked(gpr_bq_t bq, int kind, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *mean, size_t mean_len, const double *covariance, size_t covariance_len, int n_dims, double *mean_out, double *var_out, double *mass_out)
Integrate against a Lebesgue box, the uniform probability on that box, or a Gaussian.
void(* gpr_oracle_fn)(int n_coords, const double *positions, double *energy, double *gradient, void *user_data)
Simple oracle callback (used by NEB and minimizer).
void(* gpr_force_with_uncertainty_fn)(long n_atoms, const double *R, const int *atomic_nrs, double *F, double *energy, double *energy_noise_rms, double *force_noise_rms, const double *box, void *user_data)
Force callback with separate energy and force uncertainty channels.
void(* gpr_force_fn)(long n_atoms, const double *R, const int *atomic_nrs, double *F, double *energy, double *energy_noise_rms, const double *box, void *user_data)
Full atomistic force callback (used by dimer search).
gpr_atoms_t gpr_atoms_create_simple(int n_atoms)
Convenience: create an atoms handle for N identical moving atoms. Equivalent to gpr_atoms_create(&gpr...
int gpr_neb_request_sidpp(int enable)
Select the IDPP initializer for the next NEB search on this thread (ABI 1.16). enable 1 selects SIDPP...
gpr_dimer_config_t gpr_dimer_config_defaults(void)
Library defaults of every gpr_dimer_config_t field.
gpr_local_band_config_t gpr_local_band_config_defaults(void)
Library defaults of every gpr_local_band_config_t field (ABI 1.6).
int gpr_minimize_request_max_inner_steps(int max_inner_steps)
Set the inner surrogate L-BFGS step cap for the next gpr_minimize call on this thread (ABI 1....
const char * gpr_backend_name(void)
Returns a static C string naming the compiled linalg backend: "slate", "scalapack",...
int gpr_mpi_initialized(void)
Returns 1 if MPI_Init has been called on this process (queries MPI_Initialized). Returns 0 if MPI is ...
gpr_bq_config_t gpr_bq_config_defaults(void)
Defaults: one dimension, squared-exponential kernel, marginalized hyperparameters,...
int gpr_neb_request_index_certificate(int enable, double step)
Ask the next NEB search on this thread to certify the stopped band (ABI 1.6). enable 0 is the default...
gpr_periodic_band_initial_t
How a periodic band builds its initial path (ABI 1.7). GPLocalBand's "linear", "idpp" and "sidpp".
int gpr_backend_requires_mpi(void)
Returns 1 if the compiled linalg backend requires MPI to be initialised before any GPR call (e....
gpr_minimize_config_t gpr_minimize_config_defaults(void)
Library defaults of every gpr_minimize_config_t field.
gpr_atoms_config_t gpr_atoms_simple(int n_atoms)
Convenience: N identical moving atoms, one pair type.
gpr_atoms_config_t gpr_atoms_config_defaults(void)
Default atoms configuration (everything zeroed/NULL).
gpr_hyperparameter_objective_t
int gpr_neb_request_vibrational_stencil(int mode)
Choose the true-oracle Hessian stencil for the next non-local NEB search on this thread (ABI 1....
int gpr_mpi_world_size(void)
Returns the MPI size of MPI_COMM_WORLD on this process, or 1 if MPI is not initialised / not compiled...
int gpr_omp_max_threads(void)
Returns the OpenMP thread budget for this process (omp_get_max_threads). Returns 1 if OpenMP is not c...
int gpr_mpi_world_rank(void)
Returns the MPI rank in MPI_COMM_WORLD on this process, or 0 if MPI is not initialised / not compiled...
gpr_model_config_t gpr_model_config_defaults(void)
Library defaults of every gpr_model_config_t field.
gpr_hyperparameter_mode_t
gpr_periodic_band_config_t gpr_periodic_band_config_defaults(void)
Library defaults of every gpr_periodic_band_config_t field (ABI 1.7).
gpr_neb_config_t gpr_neb_config_defaults(void)
Library defaults of every gpr_neb_config_t field.
@ GPR_PERIODIC_BAND_LINEAR
@ GPR_PERIODIC_BAND_SIDPP
int gpr_model_hessian_trace_variance(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, int n_points, int n_coords, const double *A, double *var_out, gpr_derivative_report_t *report)
Posterior variance of tr(A dH) for one symmetric A per point.
int gpr_model_hessian_trace_variance_checked(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, size_t R_len, int n_points, int n_coords, const double *A, size_t A_len, double *var_out, size_t var_len, gpr_derivative_report_t *report)
Extent-checked gpr_model_hessian_trace_variance.
int gpr_model_condition_fixed_checked(gpr_model_t model, const gpr_derivative_options_t *options, const double *R_new, size_t R_new_len, const double *E_new, size_t E_new_len, const double *G_new, size_t G_new_len, int n_new, const double *R_query, size_t R_query_len, int n_query, int n_coords, double *E_out, size_t E_len, double *G_out, size_t G_len, double *var_E_out, size_t var_E_len, double *var_G_out, size_t var_G_len, gpr_derivative_report_t *report)
Extent-checked gpr_model_condition_fixed.
void(* gpr_hvp_fn)(int n_coords, const double *positions, const double *vector, double *hv_out, void *user_data)
Hessian-vector-product callback at a fixed point (ABI 1.20).
int gpr_model_hessian_bilinear_covariance(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, int n_points, int n_coords, const double *V, int n_left, const double *W, int n_right, double *cov_out, gpr_derivative_report_t *report)
Posterior covariance of the bilinear forms v_i^T H w_j.
int gpr_model_condition_fixed_hessian_checked(gpr_model_t model, const gpr_derivative_options_t *options, const double *R_new, size_t R_new_len, const double *E_new, size_t E_new_len, const double *G_new, size_t G_new_len, int n_new, const double *H_new, size_t H_new_len, gpr_hvp_fn hvp, void *user_data, const double *R_query, size_t R_query_len, int n_query, int n_coords, double *E_out, size_t E_len, double *G_out, size_t G_len, double *var_E_out, size_t var_E_len, double *var_G_out, size_t var_G_len, gpr_derivative_report_t *report)
Extent-checked gpr_model_condition_fixed_hessian; H_new_len is ignored when H_new is NULL.
int gpr_model_mean_hessian_action_batch(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, int n_points, int n_coords, const double *V, int n_vectors, double *Hv_out, gpr_derivative_report_t *report)
Posterior-mean Hessian-vector products at n_points points.
int gpr_model_mean_hessian_action_batch_checked(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, size_t R_len, int n_points, int n_coords, const double *V, size_t V_len, int n_vectors, double *Hv_out, size_t Hv_len, gpr_derivative_report_t *report)
Extent-checked gpr_model_mean_hessian_action_batch.
gpr_derivative_options_t gpr_derivative_options_defaults(void)
Defaults of gpr_derivative_options_t with struct_size set.
int gpr_model_mean_hessian_batch(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, int n_points, int n_coords, double *H_out, double *residuals_out, gpr_derivative_report_t *report)
Posterior-mean Hessians at n_points points.
int gpr_model_condition_fixed_hessian(gpr_model_t model, const gpr_derivative_options_t *options, const double *R_new, const double *E_new, const double *G_new, int n_new, const double *H_new, gpr_hvp_fn hvp, void *user_data, const double *R_query, int n_query, int n_coords, double *E_out, double *G_out, double *var_E_out, double *var_G_out, gpr_derivative_report_t *report)
Condition the posterior on a fixed point with an optional exact Hessian or Hessian-vector-product cal...
int gpr_model_mean_hessian_batch_checked(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, size_t R_len, int n_points, int n_coords, double *H_out, size_t H_len, double *residuals_out, size_t residuals_len, gpr_derivative_report_t *report)
Extent-checked gpr_model_mean_hessian_batch; residuals_len is ignored when residuals_out is NULL.
int gpr_model_posterior_variance_batch(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, int n_points, int n_coords, double *var_E_out, double *var_G_out, gpr_derivative_report_t *report)
Posterior variance of the energy and of each gradient component.
gpr_energy_unit_t
Energy unit tag (ABI 1.20). Labels only; nothing is converted.
gpr_length_unit_t
Length unit tag (ABI 1.20). Labels only; nothing is converted.
int gpr_model_posterior_variance_batch_checked(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, size_t R_len, int n_points, int n_coords, double *var_E_out, size_t var_E_len, double *var_G_out, size_t var_G_len, gpr_derivative_report_t *report)
Extent-checked gpr_model_posterior_variance_batch.
struct gpr_derivative_report gpr_derivative_report_t
Report of one derivative call (ABI 1.20).
int gpr_model_condition_fixed(gpr_model_t model, const gpr_derivative_options_t *options, const double *R_new, const double *E_new, const double *G_new, int n_new, const double *R_query, int n_query, int n_coords, double *E_out, double *G_out, double *var_E_out, double *var_G_out, gpr_derivative_report_t *report)
Condition the posterior on new oracle rows with the hyperparameters held fixed, then predict at query...
struct gpr_derivative_options gpr_derivative_options_t
Options of the derivative primitives (ABI 1.20).
int gpr_model_hessian_bilinear_covariance_checked(gpr_model_t model, const gpr_derivative_options_t *options, const double *R, size_t R_len, int n_points, int n_coords, const double *V, size_t V_len, int n_left, const double *W, size_t W_len, int n_right, double *cov_out, size_t cov_len, gpr_derivative_report_t *report)
Extent-checked gpr_model_hessian_bilinear_covariance.
@ GPR_ENERGY_UNIT_HARTREE
@ GPR_ENERGY_UNIT_KJ_PER_MOL
@ GPR_ENERGY_UNIT_KCAL_PER_MOL
@ GPR_LENGTH_UNIT_NANOMETER
@ GPR_LENGTH_UNIT_ANGSTROM
gpr_dimer_stop_t
Why a dimer search stopped (ABI 1.1).
int gpr_dimer_search(gpr_force_fn force_fn, void *user_data, gpr_atoms_t atoms, const double *R_init, const double *orient_init, const gpr_dimer_config_t *config, const double *R_obs, const double *E_obs, const double *G_obs, int n_init_obs, double *R_saddle, double *E_saddle, double *orient_out, double *curvature, int *n_force_calls, int *n_gp_calls)
GP-accelerated dimer saddle point search.
int gpr_dimer_search_report(gpr_potential_t pot, gpr_atoms_t atoms, const double *R_init, const double *orient_init, const gpr_dimer_config_t *config, const double *R_obs, const double *E_obs, const double *G_obs, int n_init_obs, double *R_saddle, double *E_saddle, double *orient_out, gpr_dimer_report_t *report)
gpr_dimer_search_potential with a report (ABI 1.1). report must not be NULL and report->struct_size m...
int gpr_dimer_search_potential(gpr_potential_t pot, gpr_atoms_t atoms, const double *R_init, const double *orient_init, const gpr_dimer_config_t *config, const double *R_obs, const double *E_obs, const double *G_obs, int n_init_obs, double *R_saddle, double *E_saddle, double *orient_out, double *curvature, int *n_force_calls, int *n_gp_calls)
Same as gpr_dimer_search, but takes a PotentialWrapper handle.
@ GPR_DIMER_STOP_UNSPECIFIED
@ GPR_DIMER_STOP_INVALID_ATOMS
@ GPR_DIMER_STOP_MEASURED_NON_DESCENT
@ GPR_DIMER_STOP_DEGENERATE_PROBE
@ GPR_DIMER_STOP_MEASURED_INDEX_ZERO
@ GPR_DIMER_STOP_UNCERTIFIED_FORCE_STOP
@ GPR_DIMER_STOP_ORACLE_BUDGET
@ GPR_DIMER_STOP_FORCE_CONVERGED
@ GPR_DIMER_STOP_UNINFORMATIVE_ROTATION
@ GPR_DIMER_STOP_ALIGNMENT_LOSS
@ GPR_DIMER_STOP_INTERATOMIC_COLLAPSE
@ GPR_DIMER_STOP_INVALID_PARAMETERS
@ GPR_DIMER_STOP_ITERATION_BUDGET
gpr_distance_metric_t
Atomic trust distance metric. Values mirror DistanceMetricType.
gpr_model_type_t
Model type tag.
gpr_bq_basis_t
Bayes-Sard basis. GPR_BQ_BASIS_FOLLOW_CONFIG, the state of a new handle and of gpr_bq_set_basis(bq,...
gpr_psearch_axis_t
Kind of a continuous parameter-search axis (ABI 1.26).
gpr_bq_hyper_mode_t
Hyperparameter treatment for Bayesian quadrature (ABI 1.17).
gpr_neb_mode_t
NEB evaluation mode.
gpr_acquisition_t
OIE acquisition strategy for image selection.
gpridge_alg_t
Hyperparameter optimization algorithm.
gpr_bq_kernel_t
Kernel family for scalar GP Bayesian quadrature (ABI 1.17).
gpr_conv_norm_t
Convergence force norm type.
gpr_hssvd_backend_t
Posterior solver selected by gpr_model_config_t::use_hssvd_backend (ABI 1.19).
gpr_bq_measure_kind_t
Integration measure. A uniform box is the Lebesgue integral divided by the volume.
@ GPR_BQ_BASIS_FOLLOW_CONFIG
@ GPR_PSEARCH_AXIS_INTEGER
@ GPR_PSEARCH_AXIS_LINEAR
@ GPR_BQ_HYPER_MARGINALIZED
@ GPR_BQ_HYPER_TP_MARGINAL
@ GPR_ACQ_PRIORITY_CASCADE
@ GPR_BQ_KERNEL_MATERN32_PRODUCT
@ GPR_BQ_KERNEL_MATERN52_ISOTROPIC
@ GPR_BQ_KERNEL_MATERN32_ISOTROPIC
@ GPR_BQ_KERNEL_MATERN52_PRODUCT
@ GPR_HSSVD_BACKEND_DEFAULT
@ GPR_HSSVD_BACKEND_CHOLESKY
@ GPR_HSSVD_BACKEND_HSSVD
@ GPR_BQ_MEASURE_UNIFORM_BOX
@ GPR_BQ_MEASURE_GAUSSIAN
@ GPR_BQ_MEASURE_LEBESGUE_BOX
const char * gpr_status_name(int status)
Short static name of a status code ("GPR_ERR_ORACLE"). Never NULL.
void gpr_abi_version(int *major, int *minor)
ABI version of the loaded library. Any pointer may be NULL.
const char * gpr_last_error(void)
Thread-local error message from last failing call. Never NULL.
int gpr_last_status(void)
Status of the last call on this thread that failed (ABI 1.1), like errno: a constructor that returns ...
int gpr_abi_check(int header_major, int header_minor)
GPR_SUCCESS when the loaded library implements the ABI a caller was compiled against (same major,...
void gpr_version_components(int *major, int *minor, int *patch)
Version components. Any pointer may be NULL.
const char * gpr_last_error_message(void)
The same string as gpr_last_error (ABI 1.6). Never NULL. Fortran and the other bindings call this nam...
const char * gpr_version(void)
Library version string ("major.minor.patch"). Never NULL.
size_t gpr_last_error_copy(char *buf, size_t capacity)
Copy the thread-local error message into buf (capacity bytes, always terminated when capacity > 0)....
int gpr_fes_predict_batch_checked(gpr_fes_t fes, const double *s_query, size_t s_query_len, double *F_out, size_t F_len, double *grad_F_out, size_t grad_F_len, double *var_F_out, size_t var_F_len, int n_queries, int dimension)
Posterior mean of F at each query point, with its gradient and the latent posterior variance of F whe...
int gpr_fes_noise_from_weights_checked(const double *weights, size_t weights_len, double reference_variance, double min_relative_weight, double *noise_var_out, size_t noise_var_len, int n_obs)
Noise variances from relative sample weights: noise[i] = reference_variance * max(w) / max(w[i],...
gpr_fes_t gpr_fes_create(int dimension, const gpr_model_config_t *model_config, const gpr_fes_config_t *fes_config, const double *grad_noise_var, size_t grad_noise_var_len)
Create an untrained free-energy surrogate.
int gpr_fes_train_checked(gpr_fes_t fes, const double *s, size_t s_len, const double *F, size_t F_len, const double *F_noise_var, size_t F_noise_var_len, const double *grad_F, size_t grad_F_len, const double *grad_noise_var, size_t grad_noise_var_len, const uint8_t *grad_present, size_t grad_present_len, int n_obs, int dimension)
Replace the training data and fit the hyperparameters.
int gpr_fes_rate_config_init(gpr_fes_rate_config_t *out, size_t out_size)
Write the default gpr_fes_rate_config_t into the first min(out_size, sizeof) bytes of out.
int gpr_fes_dimension(gpr_fes_t fes)
Collective-variable dimension, or 0 for NULL or a dead handle.
int gpr_fes_config_init(gpr_fes_config_t *out, size_t out_size)
Write the default gpr_fes_config_t (squared exponential, shared length scale) into the first min(out_...
int gpr_fes_rate_path_checked(gpr_fes_t fes, const double *path, size_t path_len, int n_path, int dimension, int reactant_index, int product_index, const double *diffusion, size_t diffusion_len, const gpr_fes_rate_config_t *config, gpr_fes_rate_report_t *report)
Overdamped Kramers-Langer rate from path point reactant_index to product_index, with its uncertainty ...
int gpr_fes_n_observations(gpr_fes_t fes)
Number of training points, or 0 before training, for NULL or for a dead handle.
void gpr_fes_destroy(gpr_fes_t fes)
Destroy a handle from gpr_fes_create. Destroying NULL or a live handle clears gpr_last_status(); a de...
struct gpr_potential_s * gpr_potential_t
struct gpr_psearch_s * gpr_psearch_t
struct gpr_model_s * gpr_model_t
Type-safe opaque handles. In Fortran, declare as type(c_ptr). The compiler catches type mismatches (u...
struct gpr_sgp_s * gpr_sgp_t
struct gpr_neb_s * gpr_neb_t
struct gpr_atoms_s * gpr_atoms_t
struct gpr_bq_s * gpr_bq_t
struct gpr_fes_s * gpr_fes_t
int gpr_request_prefactor(const gpr_htst_options_t *options, const double *masses, int n_masses)
Opt this thread's later searches into prefactor halves.
gpr_htst_mode_t
Hessian a half is built from (ABI 1.20).
gpr_htst_point_t
Which stationary point of a search (ABI 1.20).
int gpr_neb_result_prefactor(gpr_neb_t result, int point, gpr_htst_half_t *half, double *frequencies_out, int *measured_out, int n_coords)
A half of a GP NEB result, as gpr_search_prefactor.
int gpr_search_prefactor(int point, gpr_htst_half_t *half, double *frequencies_out, int *measured_out, int n_coords)
A half of the last search on this thread.
int gpr_search_prefactor_checked(int point, gpr_htst_half_t *half, double *frequencies_out, size_t frequencies_len, int *measured_out, size_t measured_len, int n_coords)
Extent-checked gpr_search_prefactor.
int gpr_htst_half_checked(gpr_model_t model, gpr_oracle_fn oracle, void *user_data, const gpr_htst_options_t *options, const double *masses, size_t masses_len, int n_masses, const double *x, size_t x_len, int n_coords, int kind, double *frequencies_out, size_t frequencies_len, int *measured_out, size_t measured_len, gpr_htst_half_t *half)
Extent-checked gpr_htst_half.
int gpr_htst_ln_prefactor(const gpr_htst_half_t *minimum, const gpr_htst_half_t *saddle, double *ln_nu, double *ln_nu_std)
ln nu = minimum->ln_sum - saddle->ln_sum and its spread sqrt(std_min^2 + std_saddle^2)....
gpr_htst_kind_t
Stationary point of a half (ABI 1.20).
gpr_htst_source_t
Where a half's Hessian came from (ABI 1.20).
struct gpr_htst_options gpr_htst_options_t
Prefactor options (ABI 1.20).
int gpr_htst_half_from_hessian(const gpr_htst_options_t *options, const double *masses, int n_masses, const double *H, const double *x, int n_coords, int kind, double *frequencies_out, gpr_htst_half_t *half)
The half of a caller's Hessian (no oracle, no model).
gpr_htst_status_t
Outcome of a half (ABI 1.20).
gpr_htst_options_t gpr_htst_options_defaults(void)
Defaults of gpr_htst_options_t with struct_size set.
int gpr_htst_half_from_hessian_checked(const gpr_htst_options_t *options, const double *masses, size_t masses_len, int n_masses, const double *H, size_t H_len, const double *x, size_t x_len, int n_coords, int kind, double *frequencies_out, size_t frequencies_len, gpr_htst_half_t *half)
Extent-checked gpr_htst_half_from_hessian.
int gpr_htst_half(gpr_model_t model, gpr_oracle_fn oracle, void *user_data, const gpr_htst_options_t *options, const double *masses, int n_masses, const double *x, int n_coords, int kind, double *frequencies_out, int *measured_out, gpr_htst_half_t *half)
The half at x from a trained model and an oracle.
int gpr_neb_result_prefactor_checked(gpr_neb_t result, int point, gpr_htst_half_t *half, double *frequencies_out, size_t frequencies_len, int *measured_out, size_t measured_len, int n_coords)
Extent-checked gpr_neb_result_prefactor.
struct gpr_htst_half gpr_htst_half_t
One half of the prefactor (ABI 1.20).
@ GPR_HTST_SOURCE_MEASURED
@ GPR_HTST_SOURCE_SURROGATE
@ GPR_HTST_SOURCE_REFINED
@ GPR_HTST_SOURCE_CONDITIONED
@ GPR_HTST_SOURCE_STENCIL
int gpr_model_set_rigid_null_deflation(gpr_model_t model, int enabled)
Enable or disable rigid-motion nullspace deflation on training factorizations (ABI 1....
int gpr_model_get_hssvd_backend(gpr_model_t model, int *out)
Get the selected solver, a gpr_hssvd_backend_t (ABI 1.19).
int gpr_model_get_sigma2(gpr_model_t model, double *out)
Get physical output-noise variance (sigma2).
int gpr_model_set_lengthscales(gpr_model_t model, const double *values, int n_values)
Set lengthscale values.
int gpr_model_get_jitter(gpr_model_t model, double *out)
Get the initialized model's numerical diagonal jitter variance.
struct gpr_rff_selection gpr_rff_selection_t
Report of the held-out random-feature selection (ABI 1.9).
int gpr_model_set_sigma2(gpr_model_t model, double value)
Set a positive finite physical output-noise variance and refresh a trained model's noise-dependent po...
int gpr_model_get_rff_selection(gpr_model_t model, gpr_rff_selection_t *out)
Copy the stored selection. Before a train this is the empty report.
int gpr_model_get_rigid_null_deflation(gpr_model_t model, int *out)
Query whether rigid-motion nullspace deflation is enabled (ABI 1.22).
int gpr_model_n_lengthscales(gpr_model_t model)
Number of kernel lengthscale parameters.
int gpr_model_set_hssvd_backend(gpr_model_t model, int selection)
Select the posterior solver for the next train (ABI 1.19). The value is a gpr_hssvd_backend_t,...
int gpr_model_n_observations(gpr_model_t model)
Number of training observations currently stored.
int gpr_model_get_alpha(gpr_model_t model, double *out, int n)
Get posterior mean weights (alpha vector). Size = n_obs * (1 + n_coords). Returns GPR_ERR_NOT_TRAINED...
int gpr_model_set_rff_features(gpr_model_t model, int n_features, double force_tol_fraction)
Set the random-feature count or turn held-out selection on (ABI 1.9).
int gpr_model_set_magn_sigma2(gpr_model_t model, double value)
Set signal variance.
int gpr_model_get_lengthscales(gpr_model_t model, double *out)
Get lengthscale values into caller-allocated array.
int gpr_model_tp_prefactor(gpr_model_t model, double *out)
TP-specific: get signal variance prefactor (valid after training).
int gpr_model_get_magn_sigma2(gpr_model_t model, double *out)
Get signal variance (magnSigma2).
int gpr_minimize(gpr_oracle_fn oracle, void *user_data, const double *R_init, int n_coords, gpr_atoms_t atoms, const gpr_minimize_config_t *config, double *R_final, double *E_final, double *G_final, int *converged, int *n_oracle_calls)
GP-accelerated geometry minimization.
int gpr_model_update_checked(gpr_model_t model, const double *R_new, size_t R_len, const double *E_new, size_t E_len, const double *G_new, size_t G_len, int n_new, int n_coords)
Extent-checked gpr_model_update (ABI 1.11).
int gpr_model_prediction_supported(gpr_model_t model, const double *R_query, int n_coords, int *supported)
Whether the trained prediction kernel supports a query (ABI 1.12).
int gpr_model_predict_full(gpr_model_t model, const double *R_query, double *E_out, double *G_out, double *var_E_out, double *var_G_out, int n_coords)
Predict energy, gradient, and variance in one call.
gpr_model_type_t gpr_model_type(gpr_model_t model)
Query model type.
void gpr_train_phase_reset(void)
Zero the train-phase walls. The next train or predict accumulates into a fresh sample....
int gpr_model_predict_batch(gpr_model_t model, const double *R_queries, double *E_out, double *G_out, double *var_E_out, double *var_G_out, int n_queries, int n_coords)
Batch prediction at multiple query points. var_E_out and var_G_out may be NULL to skip variance.
int gpr_model_init(gpr_model_t model, const gpr_model_config_t *config, gpr_atoms_t atoms)
Initialize model with configuration and atom setup. Must be called before train()....
int gpr_model_predict_energy_variance_interval(gpr_model_t model, const double *R_queries, int n_queries, int n_coords, double *var_E_lower_out, double *var_E_upper_out)
Certified energy-variance enclosure [lower, upper] for each query (ABI 1.14).
struct gpr_noise_floor_report gpr_noise_floor_report_t
Noise a trained model conditions on and the interval's certificate margin (ABI 1.14).
int gpr_model_update(gpr_model_t model, const double *R_new, const double *E_new, const double *G_new, int n_new, int n_coords)
Incremental update: append observations and retrain.
int gpr_model_predict_hessian_action_checked(gpr_model_t model, const double *R_query, size_t R_len, const double *v, size_t v_len, double *Hv_out, size_t Hv_len, int n_coords)
Extent-checked mean-Hessian action (ABI 1.12).
gpr_model_t gpr_model_create(gpr_model_type_t type)
Create a GP or TP model. Returns NULL on failure.
int gpr_model_prediction_supported_checked(gpr_model_t model, const double *R_query, size_t R_len, int n_coords, int *supported)
Extent-checked prediction-support query (ABI 1.12).
int gpr_model_predict_variance_checked(gpr_model_t model, const double *R_query, size_t R_len, double *var_E_out, double *var_G_out, size_t var_G_len, int n_coords)
Extent-checked gpr_model_predict_variance (ABI 1.11).
const char * gpr_model_fit_stop_reason(gpr_model_t model)
Why the last train stopped, as a static string.
int gpr_model_predict_hessian_action(gpr_model_t model, const double *R_query, const double *v, double *Hv_out, int n_coords)
One action of the prepared posterior-mean Hessian (ABI 1.8): Hv_out = H(R_query) v.
void gpr_train_phase_read(double *factor_s, double *solve_s, double *eigen_s, double *kernel_s, double *hessian_s)
Read the walls accumulated since the last reset. factor is the Cholesky factor, solves are the triang...
int gpr_model_train_checked(gpr_model_t model, const double *R, size_t R_len, const double *E, size_t E_len, const double *G, size_t G_len, int n_obs, int n_coords)
Extent-checked forms of the training and prediction calls (ABI 1.11).
int gpr_model_predict_full_checked(gpr_model_t model, const double *R_query, size_t R_len, double *E_out, double *G_out, size_t G_len, double *var_E_out, double *var_G_out, size_t var_G_len, int n_coords)
Extent-checked gpr_model_predict_full (ABI 1.11).
void gpr_model_destroy(gpr_model_t model)
Destroy model. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(),...
int gpr_model_train_marginal_likelihood_checked(gpr_model_t model, const double *R, size_t R_len, const double *E, size_t E_len, const double *G, size_t G_len, int n_obs, int n_coords, gpr_marginal_likelihood_report_t *report, double *lengthscales, size_t lengthscales_len)
Fit all supplied rows by prior-free Gaussian marginal likelihood (ABI 1.13).
int gpr_model_predict_hessian_checked(gpr_model_t model, const double *R_query, size_t R_len, double *H_out, size_t H_len, int n_coords)
Extent-checked mean-Hessian prediction (ABI 1.24).
int gpr_model_predict_checked(gpr_model_t model, const double *R_query, size_t R_len, double *E_out, double *G_out, size_t G_len, int n_coords)
Extent-checked gpr_model_predict (ABI 1.11).
int gpr_model_calibrate_forces_checked(gpr_model_t model, const double *R_holdout, size_t R_len, const double *G_true, size_t G_len, int n_holdout, int n_coords, double nominal_probability, gpr_calibration_report_t *report)
Evaluate true-force calibration on held-out rows (ABI 1.13).
void gpr_train_phase_read_leaves(double *setup_s, double *descriptor_s, double *posterior_s, double *subset_s, double *objective_s, double *condition_s, double *cache_s, double *curvature_s, double *energy_s, double *schedule_s)
Read the leaves that sit beside the five train walls. setup is model preparation, descriptor is the d...
int gpr_model_fit_restarts(gpr_model_t model, int *out)
Restarts the last train needed (ABI 1.15).
int gpr_model_calibrate_loo_checked(gpr_model_t model, double nominal_probability, gpr_calibration_report_t *report)
Closed-form leave-one-out calibration of all training channels (ABI 1.13).
int gpr_model_predict_energy_variance_interval_checked(gpr_model_t model, const double *R_queries, size_t R_len, int n_queries, int n_coords, double *var_E_lower_out, size_t var_E_lower_len, double *var_E_upper_out, size_t var_E_upper_len)
Extent-checked energy-variance enclosure (ABI 1.14).
int gpr_model_predict(gpr_model_t model, const double *R_query, double *E_out, double *G_out, int n_coords)
Predict energy and gradient at a query point.
int gpr_model_predict_batch_checked(gpr_model_t model, const double *R_queries, size_t R_len, double *E_out, size_t E_len, double *G_out, size_t G_len, double *var_E_out, size_t var_E_len, double *var_G_out, size_t var_G_len, int n_queries, int n_coords)
Extent-checked gpr_model_predict_batch (ABI 1.11).
int gpr_model_append_fixed_checked(gpr_model_t model, const double *R_new, size_t R_len, const double *E_new, size_t E_len, const double *G_new, size_t G_len, int n_new, int n_coords)
Append rows at the fitted hyperparameters by a Cholesky block update (ABI 1.13).
int gpr_model_get_noise_floor_report(gpr_model_t model, gpr_noise_floor_report_t *out)
Report the condition-floored noise and certificate gap of a trained model (ABI 1.14).
int gpr_model_fit_iterations(gpr_model_t model)
Iterations the last train ran, or -1 when the model is missing.
int gpr_model_prediction_factors(gpr_model_t model, const double *R_query, int n_coords, double *energy, double *scale, double *mean, double *kstar, double *weights, int capacity, int *order)
Factors of one trained energy prediction. energy is the library prediction. scale and mean undo the t...
int gpr_model_predict_variance(gpr_model_t model, const double *R_query, double *var_E_out, double *var_G_out, int n_coords)
Predict variance at a query point.
int gpr_model_predict_hessian(gpr_model_t model, const double *R_query, double *H_out, int n_coords)
Dense Hessian of the posterior mean at a query point.
int gpr_model_train(gpr_model_t model, const double *R, const double *E, const double *G, int n_obs, int n_coords)
Train the model on observations.
gpr_neb_t gpr_neb_search_gp_potential(gpr_potential_t pot, gpr_atoms_t atoms, const double *box, const gpr_model_config_t *model, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config)
gpr_neb_search_gp over a PotentialWrapper handle (ABI 1.2). The atomic numbers passed to the potentia...
gpr_ocineb_config_t gpr_ocineb_config_defaults(void)
Library defaults of every gpr_ocineb_config_t field (ABI 1.2).
int gpr_neb_result_report(gpr_neb_t result, gpr_neb_report_t *report)
Fill report from a result of any NEB entry point (ABI 1.2). report must not be NULL and report->struc...
gpr_neb_t gpr_neb_search_gp(gpr_oracle_fn oracle, void *user_data, gpr_atoms_t atoms, const gpr_model_config_t *model, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config)
GP-accelerated NEB (ABI 1.2): the band relaxes on a GP surrogate of the oracle and the oracle evaluat...
gpr_neb_t gpr_ocineb_search(gpr_oracle_fn oracle, void *user_data, gpr_atoms_t atoms, const gpr_model_config_t *model, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config, const gpr_ocineb_config_t *oci)
GP-NEB with interleaved dimer bursts on the climbing image (ABI 1.2), the band-to-dimer handover of g...
int gpr_neb_result_oracle_calls(gpr_neb_t result)
Total oracle evaluations.
double gpr_neb_result_barrier(gpr_neb_t result)
Forward barrier (reported saddle image energy minus reactant energy).
int gpr_neb_result_n_images(gpr_neb_t result)
Total number of images (including endpoints = n_images + 2).
int gpr_neb_result_max_energy_image(gpr_neb_t result)
Index of highest-energy image.
int gpr_neb_result_outer_iterations(gpr_neb_t result)
Number of outer iterations performed.
gpr_neb_t gpr_neb_search_periodic(gpr_oracle_fn oracle, void *user_data, gpr_atoms_t atoms, const double *box, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_periodic_band_config_t *periodic, const gpr_local_band_config_t *local)
Periodic local band (ABI 1.7), the C binding of GPLocalBand.
gpr_neb_t gpr_neb_search_local_potential(gpr_potential_t pot, const int *atomic_nrs, const double *box, gpr_atoms_t atoms, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config, const gpr_local_band_config_t *local)
gpr_neb_search_local over a PotentialWrapper (ABI 1.6). With atoms NULL, atomic_nrs has length n_coor...
int gpr_neb_result_image_positions(gpr_neb_t result, int image_idx, double *out, int n_coords)
Get positions for image i (0-based). n_coords must equal the full image length, frozen atoms included...
gpr_neb_t gpr_neb_search_local(gpr_oracle_fn oracle, void *user_data, gpr_atoms_t atoms, const double *box, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config, const gpr_local_band_config_t *local)
Local band (ABI 1.6). The result is the same opaque handle as the other NEB entries; destroy it with ...
int gpr_neb_result_converged(gpr_neb_t result)
1 if converged, 0 otherwise.
gpr_neb_t gpr_neb_search_potential(gpr_potential_t pot, const int *atomic_nrs, const double *box, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config)
gpr_neb_search over a PotentialWrapper. n_coords must be a positive multiple of 3,...
gpr_neb_status_t
How a NEB result converged (ABI 1.1).
void gpr_neb_result_destroy(gpr_neb_t result)
Destroy NEB result. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(),...
gpr_neb_t gpr_neb_search_periodic_potential(gpr_potential_t pot, const int *atomic_nrs, const double *box, gpr_atoms_t atoms, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_periodic_band_config_t *periodic, const gpr_local_band_config_t *local)
gpr_neb_search_periodic over a PotentialWrapper (ABI 1.7).
gpr_neb_t gpr_neb_search(gpr_oracle_fn oracle, void *user_data, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config)
NEB path optimization. GPR_NEB_STANDARD, GPR_NEB_AIE and GPR_NEB_OIE run without a surrogate....
int gpr_neb_result_all_energies(gpr_neb_t result, double *out, int n_total)
Get all image energies into an array of size n_images_total. n_total must equal gpr_neb_result_n_imag...
int gpr_neb_result_image_energy(gpr_neb_t result, int image_idx, double *out)
Get energy for image i.
int gpr_neb_result_convergence_status(gpr_neb_t result)
gpr_neb_status_t of the result; GPR_NEB_NOT_CONVERGED for NULL.
@ GPR_NEB_FORCE_TOLERANCE
@ GPR_NEB_MODEL_NOISE_FLOOR
gpr_potential_t gpr_potential_from_force_with_uncertainty(gpr_force_with_uncertainty_fn fn, void *user_data)
Wrap a C force-with-uncertainty callback as a PotentialWrapper.
gpr_potential_t gpr_potential_from_force(gpr_force_fn fn, void *user_data)
Wrap a plain force callback (the gpr_dimer_search signature) as a potential handle (ABI 1....
int gpr_potential_force(gpr_potential_t pot, long n_atoms, const double *R, const int *atomic_nrs, double *F, double *energy, double *energy_noise_rms, const double *box)
Evaluate energy and forces. energy_noise_rms may be NULL. When non-NULL, it receives the energy-noise...
void gpr_potential_destroy(gpr_potential_t pot)
Destroy a potential handle. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_er...
int gpr_potential_force_with_uncertainty(gpr_potential_t pot, long n_atoms, const double *R, const int *atomic_nrs, double *F, double *energy, double *energy_noise_rms, double *force_noise_rms, const double *box)
Evaluate energy, forces, and both uncertainty channels. energy_noise_rms and force_noise_rms may be N...
void gpr_oracle_leps(int n_coords, const double *positions, double *energy, double *gradient, void *user_data)
Oracle adapter for LEPS. user_data ignored (pass NULL).
void gpr_oracle_lj(int n_coords, const double *positions, double *energy, double *gradient, void *user_data)
Oracle adapter for LJ. user_data must point to gpr_lj_params_t.
int gpr_potential_leps(const double *r, double *E_out, double *G_out)
LEPS collinear potential. r=[r_AB,r_BC], G_out=[dE/dr_AB,dE/dr_BC].
int gpr_potential_muller_brown(const double *xy, double *E_out, double *G_out)
Muller-Brown 2D potential. xy=[x,y], G_out=[dE/dx,dE/dy].
void gpr_oracle_muller_brown(int n_coords, const double *positions, double *energy, double *gradient, void *user_data)
Oracle adapter for Muller-Brown. user_data ignored (pass NULL).
int gpr_potential_lj(const double *x, int n_atoms, double epsilon, double sigma, double *E_out, double *G_out)
Lennard-Jones energy and gradient.
int gpr_set_linalg_threads(int threads)
Dense linear-algebra thread count (>= 1).
int gpr_training_product_configured(void)
1 when a Scheme II engine or a product library is selected, else 0.
int gpr_set_library_serial(int enabled)
Nonzero selects Eigen's factor and triangular solves for the next train. Zero selects the OpenMP pane...
int gpr_set_linalg_mode(const char *mode)
Select the distributed factorization: "reproducible" (tile-ordered kernels, the same bits at every ra...
const char * gpr_linalg_mode(void)
"reproducible" or "library". Never NULL.
int gpr_check_model_package(const char *path)
Check that the AOTInductor model package at path (a .pt2) runs on this host's CPU before anything loa...
int gpr_set_training_product(const char *spec)
Select the product the training matrices use. NULL or "" selects the native backend; "scheme2:fp64[....
int gpr_sgp_set_hyperparameters_checked(gpr_sgp_t sgp, const double *length_scales, size_t length_scales_len, double signal_variance, double noise_variance)
Set the hyperparameters.
int gpr_psearch_set_allowed_values_checked(gpr_psearch_t search, int axis, const double *values, size_t values_len, int categorical)
Restrict an axis to a list of values, such as the divisors of a core count. The list replaces the bou...
void gpr_sgp_destroy(gpr_sgp_t sgp)
Destroy a handle from gpr_sgp_create. Destroying NULL or a live handle clears gpr_last_status(); a de...
int gpr_sgp_n_observations(gpr_sgp_t sgp)
Number of observed rows, or 0 for NULL or a dead handle.
int gpr_psearch_best_checked(gpr_psearch_t search, double *x_out, size_t x_len, double *loss_out)
The incumbent: the feasible evaluated row with the smallest loss, or with the smallest posterior mean...
void gpr_psearch_destroy(gpr_psearch_t search)
Destroy a handle from gpr_psearch_create. Destroying NULL or a live handle clears gpr_last_status(); ...
gpr_sgp_t gpr_sgp_create(int dimension, int kernel)
Create a scalar surrogate with unit length scales, unit signal variance, a noise variance of 1e-8 and...
gpr_psearch_t gpr_psearch_create(const double *lower, size_t lower_len, const double *upper, size_t upper_len, const int *axis_kind, size_t axis_kind_len, int dimension, int kernel, int noisy)
Create a parameter search over a box.
int gpr_sgp_set_kernel(gpr_sgp_t sgp, int kernel)
Select the radial shape. The observations and hyperparameters stay; the surrogate needs a new gpr_sgp...
int gpr_psearch_observe_checked(gpr_psearch_t search, const double *X, size_t X_len, const double *y, size_t y_len, const double *noise_var, size_t noise_var_len, const double *constraint, size_t constraint_len, int n_obs, int n_dims)
Report evaluated rows.
int gpr_sgp_predict_checked(gpr_sgp_t sgp, const double *X_queries, size_t X_len, int n_queries, int n_dims, double query_noise_var, double *mean_out, size_t mean_len, double *std_out, size_t std_len)
Predict mean and standard deviation at query rows.
int gpr_psearch_propose_checked(gpr_psearch_t search, int q, double *X_out, size_t X_len, int n_dims, int *n_proposed_out)
Propose up to q parameter vectors to evaluate next.
int gpr_sgp_observe_checked(gpr_sgp_t sgp, const double *X, size_t X_len, const double *y, size_t y_len, const double *noise_var, size_t noise_var_len, int n_obs, int n_dims)
Append observed rows.
int gpr_sgp_get_hyperparameters_checked(gpr_sgp_t sgp, double *length_scales_out, size_t length_scales_len, double *signal_variance_out, double *noise_variance_out)
Read the hyperparameters, as set or as the last fit left them.
int gpr_sgp_fit_checked(gpr_sgp_t sgp, int optimize, int n_starts, double *log_marginal_likelihood_out)
Condition the surrogate on the observed rows.
int gpr_sgp_set_mean_basis(gpr_sgp_t sgp, int basis)
Select the mean with a gpr_bq_basis_t value: GPR_BQ_BASIS_NONE (zero, the default),...
Potential wrappers and the batched oracle interface.
Atoms configuration descriptor. Describes the atomic system for the GP kernel (pair types,...
Scalar GP and Bayesian quadrature configuration (ABI 1.17).
int interpolate_candidate_noise
int optimize_extra_sigma2
gpr_bq_hyper_mode_t hyper_mode
Result of a Bayesian quadrature hyperparameter fit (ABI 1.17).
Posterior decomposition for a Bayesian quadrature integral.
double loo_calibration_scale
double hyperparameter_variance
double epistemic_variance
double mean_shift_variance
double aleatoric_variance
double explained_variance
double prior_integral_variance
LOO summary plus the number of z-scores written separately.
gpr_calibration_report_t summary
Integral uncertainty split by source. variance is the historical report, including the leave-one-out ...
double numerical_abs_tolerance
double observation_noise_variance
double loo_predictive_scale
double hyperparameter_variance
Gaussian residual-calibration report shared by ABI 1.13 workflows.
double empirical_coverage
double posterior_variance_scale
double rms_standardized_residual
double nominal_probability
double mean_log_predictive_density
double calibrated_coverage
double mean_standardized_residual
Options of the derivative primitives (ABI 1.20).
Report of one derivative call (ABI 1.20).
double max_translation_residual
double max_rotation_residual
Dimer search configuration.
double variance_accept_tau
gpr_conv_norm_t conv_norm
int use_psis_deterministic
int es_use_adaptive_threshold
double variance_accept_tau_relative
int num_bigiter_initparam
Outcome of gpr_dimer_search_report (ABI 1.1). The caller sets struct_size = sizeof(gpr_dimer_report_t...
Free-energy surrogate configuration (ABI 1.23).
Posterior-sampled Kramers rate configuration (ABI 1.23).
Summary of the accepted posterior rate draws (ABI 1.23).
double saddle_gradient_norm
One half of the prefactor (ABI 1.20).
double imaginary_frequency
Prefactor options (ABI 1.20).
Oracle adapters: wrap analytical potentials as gpr_oracle_fn. Pass directly to gpr_neb_search() or gp...
Local-band knobs (ABI 1.6), the gp_local_* fields of the C++ config. Start from gpr_local_band_config...
int force_stop_certificate
Prior-free marginal-likelihood fit result (ABI 1.13).
GP/TP model configuration. All fields have sensible defaults via gpr_model_config_defaults().
NEB search configuration.
double lbfgs_finite_difference
double lbfgs_inverse_curvature
int use_psis_deterministic
gpr_hyperparameter_mode_t hyperparameter_mode
gpr_distance_metric_t trust_metric
double trust_ratio_at_limit
gpr_uncertainty_mode_t uncertainty_mode
gpr_acquisition_t acquisition
gpr_hyperparameter_objective_t hyperparameter_objective
double trust_adaptive_floor
double trust_delta_explore
Outcome of a NEB run (ABI 1.2), read from any result handle with gpr_neb_result_report....
long oracle_calls_to_convergence
long hyperparameter_refits
Noise a trained model conditions on and the interval's certificate margin (ABI 1.14).
OCINEB controls (ABI 1.2): the minimum-mode dimer bursts that drive the climbing image of a GP band o...
double perturb_along_tangent
double max_burst_displacement
Periodic local band (ABI 1.7): the choices GPLocalBand makes on top of gpr_local_band_config_t....
Report of the held-out random-feature selection (ABI 1.9).
double exact_energy_oracle_error
double force_tol_fraction
long long memory_cap_bytes
double max_energy_oracle_error
long long exact_gram_bytes
double max_force_oracle_error
long long full_gram_bytes
double force_convergence_tolerance
double exact_force_oracle_error