C API function reference¶
Status: implemented. This page lists every function that
abi/gpridge_c.symbols exports, with its purpose, the units and extents
of its arguments, who owns each pointer, and what it returns on failure. The
guide to the shared conventions is the C API page; the declarations are in
gpr/capi/gpridge_c.h, and the Doxygen pages hold the generated signatures.
scripts/check_c_api_reference.py fails when a function of the symbol list
has no row here, when a row leaves a column empty, or when the header gives a
function no documentation comment.
How to read the tables¶
Units. The library converts no units. A coordinate has the unit of the oracle that the caller supplies, an energy has the oracle’s energy unit, and a gradient is energy per coordinate unit. A variance has the square of the quantity’s unit. The columns below name a unit only where the header fixes one (Angstrom for the local and periodic bands, eV/Angstrom for their force tolerance, radians for angles, eV for the energy-noise channel and for the random-feature selection report).
Extents. Arrays are flat and row-major. \(N\) is n_coords, three times the
number of moving atoms, and \(n\) is the number of observations. A function
with the suffix _checked takes the length of each caller buffer in doubles
and rejects a buffer that is too short, as the C API page describes.
Ownership. A pointer argument is read or written during the call and stays
with the caller unless the row says the library keeps a copy. A returned handle
belongs to the caller until it is passed to the matching destroy function. A
returned const char* is static or thread-local; the caller does not free it.
Failure. A function that returns int as a status returns GPR_SUCCESS
(0) or a negative code. The tables give the codes a function returns for its
own checks. GPR_ERR_NULL_HANDLE is not “a handle argument is NULL”.
guard_modelreturns it for aNULLmodel and for a model that is not live.gpr_model_predict_energy_variance_intervalandgpr_model_get_noise_floor_reportreturn it for aNULLmodel only; they do not test liveness.gpr_model_initreturnsGPR_ERR_INVALID_ARGfor aNULLatoms handle andGPR_ERR_NULL_HANDLEwhen that handle is not live.guard_nebreturns it for aNULLNEB result and for one that is not live.gpr_neb_result_image_positions,gpr_neb_result_image_energyandgpr_neb_result_all_energiesalso return it when the live result has no path.gpr_potential_forceandgpr_potential_force_with_uncertaintyreturn it for aNULLpotential and for one that is not live.reject_dead_atomsandreject_dead_potentialreturn it only for a non-null handle that is not live. ANULLatoms or potential argument of a dimer, minimizer or NEB search isGPR_ERR_INVALID_ARG, except where a local or periodic band allows aNULLatoms handle.An accessor that returns a count, a flag or a rank clears status and error to
GPR_SUCCESSforNULLand preserves any existing error state for a live handle. A handle that is not live setsGPR_ERR_NULL_HANDLEand the accessor returns its sentinel. DestroyingNULLor a live handle clears status and error toGPR_SUCCESS, while preserving a pendingGPR_ERR_ORACLEduring cleanup; destroying a handle that is not live setsGPR_ERR_INVALID_ARG. This status-clearing behaviour is a contract fix in ABI 1.17 without a minor version bump.
An exception that reaches the common handler (status_from_exception in
gpr/capi/gpridge_c.cpp) becomes one of these. The handler’s order, and
the five functions that catch before it, are tabulated in
the C API page.
GPR_ERR_ALLOCforstd::bad_alloc.GPR_ERR_SIZE_LIMITforstd::length_error, and when a problem exceeds an index limit of the backend.GPR_ERR_INVALID_ARGforstd::invalid_argumentandstd::domain_error, except BQ measure integration, which maps its caughtstd::domain_errortoGPR_ERR_UNSUPPORTED.GPR_ERR_ORACLEwhen an oracle callback failed and the search could not step around it.GPR_ERR_INTERNALfor any other exception. The message names it.
Those five functions return a different status for the exceptions they
catch. gpr_model_predict_energy_variance_interval (and the _checked
form, which calls it) returns GPR_ERR_CHOLESKY for std::domain_error
and GPR_ERR_INTERNAL for any other std::exception from the enclosure,
including std::bad_alloc. gpr_model_get_noise_floor_report returns
GPR_ERR_CHOLESKY for std::runtime_error and every class derived from
it. gpr_model_train_marginal_likelihood_checked returns
GPR_ERR_OPTIMIZER for the same std::runtime_error classes.
gpr_set_training_product returns GPR_ERR_UNSUPPORTED for any other
std::exception, and rethrows std::invalid_argument,
std::length_error and std::bad_alloc into the common handler.
gpr_check_model_package returns GPR_ERR_UNSUPPORTED for any other
std::exception, including std::invalid_argument and
std::length_error, and rethrows only std::bad_alloc.
A constructor or a search that returns a handle returns NULL on failure and
leaves the status and message where gpr_last_status and
gpr_last_error_message read them. The message and status belong to the
calling thread, and the next status-returning call, NULL-handle accessor
(usable_or_null), or destroy call on that thread clears them (except
that all destroy calls preserve a pending GPR_ERR_ORACLE during cleanup);
successful count/flag/rank accessors on live handles leave the thread’s
status and message intact.
A function that returns a count, a flag or a value (the rows say so) returns
that value instead, and a NULL handle gives 0 (or -1 for
gpr_model_fit_iterations, and “missing” for gpr_model_fit_stop_reason).
Version, ABI and errors¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Release version of the library as “major.minor.patch”. |
none |
Static string; the caller does not free it. |
Never fails; never |
|
Release version as three integers. |
three |
Caller supplies each pointer; any may be |
Returns nothing; unparsed parts are 0. |
|
ABI major and minor of the loaded library. |
two |
Caller supplies each pointer; any may be |
Returns nothing. |
|
Check that the loaded library implements the ABI a caller was built against. The macro |
header major and minor |
none |
|
|
Message of the last failing call on this thread. |
none |
Thread-local string, valid until the next status-returning call, constructor, |
Never fails; never |
|
The same string under the name the bindings call (ABI 1.6). |
none |
As |
As |
|
Copy the message into a caller buffer. |
|
The caller owns |
Returns the message length; a value of at least |
|
Name of a status code, such as “GPR_ERR_ORACLE”. |
a status code |
Static string; the caller does not free it. |
Never |
|
Status of the last failing call on this thread, like |
none |
none |
Returns the code; |
Configuration defaults¶
Each function returns a struct by value, filled with the library defaults. The header states the default beside each field. The caller edits the copy and passes it by pointer; the library reads it during the call.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Zeroed atoms descriptor: every atom moves, one type, atomic number 1. |
per-atom arrays are |
Returned by value; the arrays stay with the caller. |
Never fails. |
|
Descriptor for \(n\) identical moving atoms with one pair type. |
|
Returned by value. |
Never fails. |
|
GP and Student-t settings: |
noise variances in squared output units |
Returned by value. |
Never fails. |
|
Dimer settings, the unflagged |
angles in radians; lengths in the coordinate unit; variance gate in squared energy unit |
Returned by value. |
Never fails. |
|
NEB and GP-NEB settings: GP-OIE mode, climbing image on, tolerance 0.05, at most 200 outer iterations, |
force tolerance in energy per coordinate unit; |
Returned by value. |
Never fails. |
|
Local-band knobs (ABI 1.6). |
lengths in Angstrom |
Returned by value. |
Never fails. |
|
Periodic-band choices (ABI 1.7): uniform springs, linear path, tolerance 0.05. |
|
Returned by value. |
Never fails. |
|
Minimum-mode dimer-burst controls of OCINEB (ABI 1.2). |
cosine tolerance is dimensionless; forces as for the NEB |
Returned by value. |
Never fails. |
|
Minimizer settings. |
|
Returned by value. |
Never fails. |
|
Ask the next NEB search on this thread to certify the stopped band (ABI 1.6). The request is consumed by that search. On the periodic searches a nonzero |
|
none; the request is thread-local |
|
|
Select SIDPP (1) or classic IDPP (0) for the next NEB search on this thread (ABI 1.16). SIDPP is the default and the request is consumed even if search validation fails. It has no effect on |
none |
none; the request is thread-local |
|
|
Choose the true-oracle Hessian stencil of the next non-local NEB search on this thread (ABI 1.21). 0, the default, measures every Cartesian coordinate, and the resolution includes the rigid columns. 1 measures the vibrational directions; that resolution is the measured block and can call a borderline mode resolved where 0 leaves it unresolved. The request is consumed by that search. A local or periodic band takes the choice from |
none |
none; the request is thread-local |
|
Atoms handle¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Build the atoms handle from a descriptor. |
|
Caller owns the returned handle and destroys it with |
Returns |
|
Handle for \(n\) identical moving atoms. |
|
As |
As |
|
Free an atoms handle. |
none |
Takes ownership back. Accepts |
Returns nothing; clears |
|
Number of moving atoms. |
atoms |
The handle stays with the caller. |
Returns the count; 0 for |
|
Number of pair types of the kernel. |
pair types |
The handle stays with the caller. |
Returns the count; 0 for |
Model lifecycle and training¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Create an empty GP ( |
none |
Caller owns the handle and destroys it with |
Returns |
|
Free a model and the data it copied. |
none |
Takes ownership back. Accepts |
Returns nothing; clears |
|
Type tag the model was created with. |
none |
The handle stays with the caller. |
Returns the tag; |
|
Configure the model and copy the atoms descriptor. It can be called again to reconfigure: the model is rebuilt, so it is untrained and a later fit starts from the library defaults exactly as on a fresh handle. |
one |
The library copies the atoms descriptor, so the caller may destroy |
|
|
Fit hyperparameters and the posterior on \(n\) observations. It replaces earlier training data. |
|
The library copies the arrays, so the caller may free them after the call. |
|
|
|
lengths in doubles: |
As |
|
|
Append observations and optimise the hyperparameters again on the whole set. It is not a rank-one update. |
|
The library copies the arrays. |
|
|
|
lengths in doubles, as for |
As |
|
|
Fit the signal variance and length scales by the Gaussian negative log marginal likelihood alone, with no prior or barrier term, and install the posterior (ABI 1.13). When the first start does not converge the fit restarts once, still without a prior; |
arrays as |
The library copies the observations. The caller supplies the report and the length-scale buffer. |
|
|
Append complete energy-gradient rows at the fitted hyperparameters by a Cholesky block update, with no refit and no full factorisation (ABI 1.13). |
arrays as |
The library copies the rows. |
|
|
Optimizer iterations of the last train: rgmin’s SCG steps plus the L-BFGS fallback steps that finish a stalled rgmin SCG fit. After a restarted marginal-likelihood fit the count covers both passes. |
iterations |
The handle stays with the caller. |
Returns the count; -1 for a missing model. |
|
Restarts the last train needed (ABI 1.15): 1 when |
restarts |
Caller supplies the |
|
|
Why the last train stopped: “budget” when an rgmin fit exhausts its iteration budget, “library” when it does not, “restored scg point” when a rejected L-BFGS fallback restores the SCG point, “wall-clock limit” when the wall is already spent, “non-finite marginal likelihood” when a failed fit keeps a non-finite input marginal likelihood, “unset” before any train, “missing” for |
none |
Static string; the caller does not free it. |
Never fails; never |
|
Number of stored training observations. |
observations |
The handle stays with the caller. |
Returns the count; 0 for |
Prediction¶
Every prediction function takes the n_coords of the training call and
rejects another value with GPR_ERR_INVALID_ARG. Every one returns
GPR_ERR_NOT_TRAINED before a train, except the support query, which reports
zero. The _checked forms add a length in doubles after each pointer and
return GPR_ERR_INVALID_ARG for a short buffer before writing.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Posterior mean energy and gradient at one point. |
query, gradient: \(N\); energy: one value |
Caller supplies the output arrays. |
|
|
|
|
As |
As |
|
Posterior variance of the energy and of each gradient component. |
energy variance in squared energy unit; gradient variance \(N\) values |
Caller supplies the output arrays. |
As |
|
|
|
As |
As |
|
Mean and variance of energy and gradient in one call. |
as |
Caller supplies the output arrays. |
As |
|
|
lengths at least \(N\) for query, gradient and variance gradient |
As |
As |
|
Prediction at \(q\) query points. Either variance output may be |
queries, gradients: \(q \times N\); energies: \(q\) |
Caller supplies the output arrays. |
|
|
|
lengths at least \(qN\) for queries and gradients, \(q\) for energies |
As |
As |
|
The kernel row, the weights and the scale of one energy prediction, in the trained factor order. |
|
Caller supplies every output buffer. |
|
|
Symmetric dense Hessian of the posterior mean. The sources are tried in this order. An active posterior whose background and residual kernels are both exact assembles their matrices. Otherwise, when the model is neither an atomic environment nor an active posterior, a prepared HS-SVD operator applied to the identity is the matrix, and it is tried before any exact MAP kernel Hessian. A failed apply is final: the call returns |
|
Caller supplies |
|
|
|
|
As |
As |
|
One action of the prepared posterior-mean Hessian, \(Hv\) (ABI 1.8). An exact kernel that returns no action, or an action that returns false, refuses, including when that term is one part of a mean whose other term is generic. A kernel without an analytic contraction uses the fourth-order gradient stencil. An atomic-environment model uses the dispatched product. |
|
Caller supplies |
|
|
|
|
As |
As |
|
Whether the query lies inside the kernel support, by the decision the active-learning loops use (ABI 1.12). |
|
Caller supplies the |
|
|
The support query with a buffer length (ABI 1.12). |
|
As |
As |
|
Lower and upper endpoints that enclose the energy variance of each query point, from the bordered Schur certificate of an exact-kernel HS-SVD MAP model (ABI 1.14). |
queries: \(q \times N\); both outputs: \(q\) values in squared energy unit |
Caller supplies both output arrays; neither is written on failure. |
|
|
|
|
As |
As |
Posterior derivatives¶
The batched primitives of ABI 1.20 work on \(B\) points, R of
\(B \times N\) values. Each fills a gpr_derivative_report_t when one is
given: the unit tags, the point count, whether rigid motions were projected,
the largest posterior energy standard deviation and its point, the rigid
invariance residuals and, for the conditioning call, how the factor was
extended. Options are a gpr_derivative_options_t or NULL for the
defaults. With max_energy_std above zero a point whose posterior energy
standard deviation exceeds it returns GPR_ERR_OUT_OF_SUPPORT, writes the
report and leaves every output untouched. Variances and covariances are
probabilistic estimates under the fitted GP, never certificates. Calls on
one model are serialized by a per-model lock; with one BLAS thread the
results are bit-identical from run to run.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
The default |
none |
Returns the struct by value. |
Cannot fail. |
|
Exact posterior-mean Hessians at \(B\) points, symmetric, and optionally the six rigid invariance residuals \(\lVert H g_k \rVert\) per point (ABI 1.20). |
|
Caller supplies the outputs and the report. |
|
|
|
|
As |
As |
|
Posterior-mean Hessian actions \(H(x_b) v_{b,i}\) for \(k\) vectors per point (ABI 1.20). |
|
Caller supplies |
As |
|
|
|
As |
As |
|
Posterior covariance of \(v_i^\top H w_j\) at each point, over the pairs \(i k_r + j\) (ABI 1.20). |
|
Caller supplies |
As |
|
|
lengths at least the extents above |
As |
As |
|
Posterior variance of \(\mathrm{tr}(A\,\delta H)\) for one symmetric \(A\) per point (ABI 1.20). |
|
Caller supplies |
As |
|
|
|
As |
As |
|
Posterior variance of the energy and of each gradient component at \(B\) points (ABI 1.20). |
|
Caller supplies both outputs. |
As |
|
|
|
As |
As |
|
Condition the posterior on caller-chosen oracle rows with the hyperparameters held fixed, then predict mean and variance at query points; equal to a fresh fit at those hyperparameters to roundoff (ABI 1.20). |
|
Caller supplies every output. The rows join the model’s training data. |
As |
|
|
every length at least its extent above |
As |
As |
|
Condition the posterior on a fixed point with an optional exact Hessian or Hessian-vector-product callback |
As |
As |
As |
|
|
every length at least its extent above; |
As |
As |
Calibration¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Standardised residuals of the true force on held-out rows, with coverage and a calibration scale (ABI 1.13). The rows are not added to the model. |
|
Caller supplies the report; the library keeps nothing. |
|
|
Closed-form leave-one-out calibration of every training channel (ABI 1.13). It makes no oracle call and does not change the model. |
|
Caller supplies the report. |
|
Hyperparameters and the random-feature setting¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Number of kernel length scales. |
count |
The handle stays with the caller. |
Returns the count; 0 for |
|
Copy the length scales out. |
|
Caller supplies |
|
|
Replace the length scales. |
|
The library copies the values. |
|
|
Signal variance. |
squared output unit |
Caller supplies the |
|
|
Set the signal variance. |
squared output unit |
none |
|
|
Physical output-noise variance. |
squared output unit |
Caller supplies the |
|
|
Set a positive finite noise variance and refresh the noise-dependent state of a trained model. |
squared output unit |
none |
|
|
Numerical diagonal jitter variance of an initialised model. |
squared output unit |
Caller supplies the |
|
|
Select the posterior solver of an initialised model for its next training call (ABI 1.19): |
a |
none |
|
|
The |
a |
Caller supplies the |
|
|
The condition-floored noise a trained model inverts, the certificate gap and the noise the variance interval certifies (ABI 1.14). |
|
Caller supplies the struct; it is untouched on failure. |
|
|
Posterior mean weights \(\alpha\). |
|
Caller supplies |
|
|
Signal-variance prefactor of a Student-t model. |
one value |
Caller supplies the |
|
|
Set the random-feature count: positive for a fixed count, 0 for off, -1 for held-out selection (ABI 1.9). Selection runs on the next train or update. |
|
none |
|
|
Copy the report of the last selection. Before a train it is the empty report (ABI 1.9). |
|
Caller supplies the struct. |
|
|
Enable (1) or disable (0, default) rigid-motion nullspace deflation on training factorizations (ABI 1.22). Toggling invalidates any cached posterior factorization so the model must be re-trained before predicting. |
|
none |
|
|
Query whether rigid-motion nullspace deflation is enabled (ABI 1.22). |
writes 1 or 0 to |
Caller supplies |
|
Scalar GP and Bayesian quadrature¶
A handle has one writer at a time. The functions that change it are gpr_bq_reset, the train, append and fit functions, every set function and gpr_bq_destroy; none of them may overlap another call on the same handle, and the library takes no lock on the handle. Distinct handles may be used from different threads. A destroyed handle gives GPR_ERR_NULL_HANDLE from a status function and 0 from a query function; a second gpr_bq_destroy sets GPR_ERR_INVALID_ARG. A function that fails leaves its output buffers unwritten. GPR_ERR_OPTIMIZER means that hyperparameter inference failed and the model kept its previous state; the library does not substitute another treatment.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Returns a |
one struct returned by value |
Nothing is allocated. |
None. |
|
Builds a scalar GP and Bayesian quadrature handle from a configuration (ABI 1.17). |
|
Returns a handle that the caller destroys with |
Returns |
|
Releases a handle. |
none |
Takes the handle back. Accepts |
Returns nothing; clears |
|
Replaces the configuration and drops every observation and any stored box. |
|
The handle stays with the caller; it is a writer call. |
|
|
Input dimension of the configuration. |
returns a count |
Caller keeps the handle. |
Returns 0 for |
|
Number of stored observations. |
returns a count |
Caller keeps the handle. |
Returns 0 for |
|
Number of length scales, |
returns a count |
Caller keeps the handle. |
Returns 0 for |
|
Trains on observations and infers the integration box from the training extrema. |
|
Caller supplies every input; the library copies what it keeps. |
|
|
Trains and stores an explicit integration box that later refits and appends keep. |
as |
As |
As |
|
Appends observations to a trained model, optionally refitting the hyperparameters. |
|
Caller supplies every input; the library copies what it keeps. |
As |
|
Re-infers the hyperparameters of a trained model with the given treatment, which becomes the configured treatment. |
|
Caller supplies the report and the buffer; both may be absent. |
|
|
Copies the current length scales out. |
|
Caller supplies the buffer. |
|
|
Pins the length scales and rebuilds a trained model with them held and the signal variance kept, leaving the configured hyperparameter treatment unchanged. |
|
Caller supplies the values; the library copies them. It is a writer call. |
|
|
Signal variance of the posterior. |
one double in squared output unit |
Caller supplies the double. |
|
|
Pins the signal variance and rebuilds a trained model with it held and the length scales kept, leaving the configured hyperparameter treatment unchanged. |
one positive finite value |
It is a writer call. |
|
|
Extra observation-noise variance added to every observation. |
one double in squared output unit |
Caller supplies the double. |
|
|
Sets the extra observation-noise variance and refits a trained model with its configured treatment. |
one non-negative finite value |
It is a writer call. |
|
|
Posterior mean and latent-function variance at several points. |
|
Caller supplies the output arrays. |
|
|
Kernel mean of the box measure at the training points or at explicit points. |
|
Caller supplies the output array. |
|
|
Kernel double integral over the box. |
|
Caller supplies the double. |
As |
|
Integral mean and variance over a box. |
|
Caller supplies the doubles. |
|
|
Integral over a box with the full decomposition of the variance. |
as |
Caller supplies the report. |
As |
|
Integral against a Lebesgue box, the uniform probability on a box, or a Gaussian measure. |
|
Caller supplies every input and the three doubles. |
|
|
As |
as |
Caller supplies the report. |
As |
|
Selects the Bayes-Sard mean model: none, constant or affine, or |
one |
It is a writer call. |
|
|
Active basis selection, |
one |
Caller supplies the |
|
|
Joint posterior of the integrals over nested upper limits. |
|
Caller supplies the output arrays. |
|
|
Draws joint samples of the cumulative integrals, deterministic in the seed. |
as |
Caller supplies the output array. |
As |
|
Variance reduction of the integral from one extra observation at each candidate. |
|
Caller supplies the output array. |
|
|
Greedily chooses a batch of candidates, each conditioned on the earlier ones. |
as the variance reduction; indices and step reductions: \(b\) each |
Caller supplies the output arrays. |
|
|
Closed-form leave-one-out calibration summary. It makes no oracle call and does not change the model. |
|
Caller supplies the report. |
|
|
As |
|
Caller supplies the report and the buffer. |
As |
Free-energy surrogate¶
A handle has one writer at a time: gpr_fes_train_checked and gpr_fes_destroy must not overlap another call on the same handle. A destroyed handle gives GPR_ERR_NULL_HANDLE from a status function and 0 from a query function; a second gpr_fes_destroy sets GPR_ERR_INVALID_ARG. A function that fails leaves its outputs unwritten, and a failed train keeps the previous posterior. The size-prefixed structures are read and written up to their struct_size.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Writes the default |
first |
Caller supplies the struct. |
|
|
Builds an untrained free-energy surrogate over |
both configurations are one struct each, copied; |
Returns a handle that the caller destroys with |
Returns |
|
Releases a handle from |
none |
The handle is invalid afterwards. |
Clears the status for |
|
Collective-variable dimension (ABI 1.23). |
count |
none |
0 for |
|
Training points of the last successful train (ABI 1.23). |
count |
none |
0 before training, for |
|
Noise variances \(\sigma^2_\text{ref} w_\text{max} / \max(w_i, r w_\text{max})\) from relative sample weights; an approximation that ignores sample correlation (ABI 1.23). |
|
Caller supplies the output. |
|
|
Replaces the training data with \(F\) and optional gradients and fits the hyperparameters (ABI 1.23). |
|
The library copies the data. |
|
|
Posterior mean of \(F\) with its gradient and latent variance when requested (ABI 1.23). |
|
Caller supplies the outputs. |
|
|
Writes the default |
first |
Caller supplies the struct. |
|
|
Overdamped Kramers-Langer rate from |
|
Caller supplies the configuration and the report. |
|
Scalar surrogate and parameter search¶
A gpr_sgp_t is a scalar GP for an oracle that returns a value and,
optionally, the variance of its noise. A gpr_psearch_t minimizes such an
oracle over a box by ask and tell. Both take a gpr_bq_kernel_t value and
accept the squared exponential and the two isotropic Matern kernels. The
formulas are on the page The scalar surrogate for a noisy oracle.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Builds a scalar surrogate over |
|
Returns a handle that the caller destroys with |
Returns |
|
Releases a handle from |
none |
The handle is invalid afterwards. |
Clears the status for |
|
Rows observed so far (ABI 1.26). |
count |
none |
0 for |
|
Selects the radial shape; a new fit is needed before a prediction (ABI 1.26). |
a |
none |
|
|
Selects a zero, constant or affine mean, fitted by generalized least squares at each fit (ABI 1.26). |
|
none |
|
|
Sets the length scales, the signal variance and the shared noise variance (ABI 1.26). |
|
The library copies the values. |
|
|
Reads the hyperparameters, as set or as the last fit left them (ABI 1.26). |
|
Caller supplies the outputs. |
|
|
Appends rows with one noise variance each, or without one for rows that share the noise variance (ABI 1.26). |
|
The library copies the rows. |
|
|
Conditions on the rows; with |
the optional output is the log marginal likelihood |
Caller supplies the output. |
|
|
Mean and standard deviation at query rows: latent for |
|
Caller supplies the outputs. |
|
|
Builds a parameter search over a box; |
|
Returns a handle that the caller destroys with |
Returns |
|
Releases a handle from |
none |
The handle is invalid afterwards. |
Clears the status for |
|
Restricts the zero-based |
|
The library copies the list. |
|
|
Reports evaluated rows with optional noise variances and constraint values, feasible at or below zero (ABI 1.26). |
|
The library copies the rows. |
|
|
Writes up to |
|
Caller supplies the outputs. |
|
|
The feasible evaluated row with the smallest loss, or with the smallest posterior mean for a noisy search (ABI 1.26). |
|
Caller supplies the outputs. |
|
Potential wrapper¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Wrap a force callback with energy- and force-noise channels as a potential handle. |
positions and forces in the units of the callback; the noise channels are standard deviations, the energy noise in eV |
The library keeps |
Returns |
|
Wrap a plain |
as above; the noise slot may be |
As above. |
As above. |
|
Free a potential handle. |
none |
Takes ownership back; |
Returns nothing; clears |
|
Evaluate energy and forces once. |
|
Caller supplies the output arrays; |
|
|
Evaluate energy, forces and both noise channels. |
as |
Both noise outputs may be |
As |
Dimer search¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
GP-accelerated dimer saddle search with a force callback. |
|
Caller supplies every output array; optional outputs and observations may be |
|
|
|
as |
The potential stays with the caller. |
As |
|
|
the report’s lengths are in the coordinate unit; |
Caller sets |
|
NEB searches and results¶
The search functions return a result handle. The caller destroys it with
gpr_neb_result_destroy. A search fails with NULL and GPR_ERR_INVALID_ARG
for a NULL required argument. A non-null
atoms or potential handle that is not live fails with GPR_ERR_NULL_HANDLE
(reject_dead_atoms, reject_dead_potential). gpr_neb_search and
gpr_neb_search_potential run GPR_NEB_GP_OIE and GPR_NEB_GP_AIE when
n_coords is a multiple of 3, and both reject GPR_NEB_GP_LOCAL.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
NEB. |
endpoints: \(N\) each; |
The caller owns the result. The oracle and |
|
|
|
|
As |
|
|
GP-accelerated NEB ( |
coordinates cover every atom of the handle, |
The caller owns the result. |
|
|
|
|
As |
As |
|
GP-NEB with minimum-mode dimer bursts on the climbing image (ABI 1.2). |
as |
As |
As |
|
Local band of mode |
lengths in Angstrom; |
The caller owns the result. |
|
|
|
|
As |
As |
|
Periodic local band, the C binding of |
|
As |
As |
|
|
as |
As |
As |
|
1 when the band converged. |
none |
The handle stays with the caller. |
Returns the flag; 0 for |
|
Whether the band met the force tolerance ( |
a |
As above. |
Returns the code; |
|
Total oracle evaluations. |
calls |
As above. |
Returns the count; 0 for |
|
Outer iterations performed. |
iterations |
As above. |
Returns the count; 0 for |
|
Reported saddle image energy minus reactant energy. |
the oracle’s energy unit |
As above. |
Returns the value; 0.0 for |
|
Index of the highest-energy image. |
zero-based index |
As above. |
Returns the index; 0 for |
|
Number of images including the endpoints. |
images |
As above. |
Returns the count; 0 for |
|
Positions of one image. |
|
Caller supplies |
|
|
Energy of one image. |
one |
Caller supplies the |
As |
|
Energy of every image. |
|
Caller supplies |
|
|
Fill a |
the report’s counts are calls and iterations |
Caller sets |
|
|
Free a NEB result. |
none |
Takes ownership back. Accepts |
Returns nothing; clears |
Minimizer¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Set the inner surrogate L-BFGS step cap (default 200) for the next |
none |
none; the request is thread-local |
|
|
GP-accelerated geometry minimisation. The GP gradient only proposes a stop; |
|
Caller supplies every output. The oracle and |
|
Harmonic prefactors¶
The Vineyard prefactor \(\nu = \prod \nu_{\min} / \prod' \nu_{\mathrm{saddle}}\)
of ABI 1.20 is assembled from one half per stationary point,
\(\ln\nu =\) ln_sum (minimum) \(-\) ln_sum (saddle). Frequencies are
\(\omega / 2\pi\) of the mass-weighted Hessian with the rigid modes
projected out, scaled by omega_scale (1 keeps native units,
GPR_HTST_OMEGA_EV_ANGSTROM_AMU gives Hz for eV, Angstrom and amu). Masses are
one positive value per atom or NULL for unit masses. A half that cannot be
formed or has the wrong index says so in status; nothing falls back
silently.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
The default |
none |
Returns the struct by value. |
Cannot fail. |
|
The half of a caller-supplied Hessian; |
|
Caller supplies the half and the optional frequencies. |
|
|
|
|
As |
As |
|
The half at |
as |
Caller supplies the outputs. The oracle and |
|
|
|
|
As |
As |
|
\(\ln\nu\) and its estimated standard deviation from a minimum half and a saddle half (ABI 1.20). The minimum must have exactly one more real mode than the saddle. |
|
Caller supplies the outputs. |
|
|
Opt in this thread’s later searches ( |
|
Copies everything. |
|
|
The half of this thread’s last search at a |
|
Caller supplies the outputs. |
|
|
|
|
As |
As |
|
The half a NEB result holds at a |
as |
The result keeps its halves until |
|
|
|
|
As |
As |
Analytical test potentials¶
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Lennard-Jones energy and gradient. |
|
Caller supplies the output arrays. |
|
|
Muller-Brown energy and gradient. |
|
Caller supplies the output arrays. |
|
|
LEPS collinear energy and gradient. |
|
Caller supplies the output arrays. |
|
|
|
|
The caller owns the parameter struct. |
Returns nothing; a bad argument writes a non-finite energy, which a search counts as a failed trial. |
|
|
|
none |
As |
|
|
|
none |
As |
Runtime configuration, build introspection and timers¶
The setters change process-wide state. Call them before a search starts.
Function |
Purpose |
Units and extents |
Ownership |
Failure |
|---|---|---|---|---|
|
Select “reproducible” (fixed-order tile kernels) or “library” (ScaLAPACK or SLATE routines) for the distributed factorisation (ABI 1.1). The HS-SVD kernel eigensolve runs Eigen’s self-adjoint solver on the host in both modes. Library mode uses cuSOLVER at one rank when a GPU is present, and ScaLAPACK pdsyev from order 1 across ranks when unconstrained reductions are enabled. |
none |
The library copies the name. |
|
|
Current mode, “reproducible” or “library”. |
none |
Static string; the caller does not free it. |
Never fails; never |
|
Dense linear-algebra thread count. |
threads, at least 1 |
none |
|
|
Nonzero selects Eigen’s factor and triangular solves for the next train; zero selects the OpenMP panel kernels (ABI 1.4). |
flag |
none |
Returns |
|
Select the product the training matrices use: “” or |
none |
The library copies the string. |
|
|
1 when a Scheme II engine or a product library is selected. |
flag |
none |
Returns the flag. |
|
Check that an AOTInductor |
path to a file |
The library reads the file during the call. |
|
|
Name of the compiled linear-algebra backend: “slate”, “scalapack”, “kokkos”, “cusolver”, “cholmod”, “stdpar” or “eigen”. |
none |
Static string; the caller does not free it. |
Never fails. |
|
1 when the backend needs MPI initialised before any call. |
flag |
none |
Returns the flag. |
|
1 when |
flag |
none |
Returns the flag; 0 without MPI. |
|
Rank in |
rank |
none |
Returns the rank; 0 without MPI. |
|
Size of |
ranks |
none |
Returns the size; 1 without MPI. |
|
OpenMP thread budget of the process. |
threads |
none |
Returns the count; 1 without OpenMP. |
|
Zero the train-phase wall times. |
none |
none |
Returns nothing. |
|
Read the factor, solve, eigensolve, kernel and Hessian wall times since the last reset (ABI 1.3). |
seconds |
Caller supplies each pointer; any may be |
Returns nothing. |
|
Read the finer phase times: setup, descriptor, posterior, subset, objective, condition, cache, curvature, energy, schedule (ABI 1.4). |
seconds |
Caller supplies each pointer; any may be |
Returns nothing. |