Posterior-mean derivatives (ABI 1.20)

Batched derivatives and uncertainty of a trained GP model’s posterior mean at B points of dimension d = n_coords. Every array is row-major and in the model’s native training units: energies and lengths exactly as passed to gpr_model_train. No conversion and no mass weighting happens here; the energy_unit and length_unit tags of gpr_derivative_options_t are echoed into the report so a caller can carry them along.

Hessians are exact analytic second derivatives of the posterior mean; a model without an analytic mean Hessian returns GPR_ERR_UNSUPPORTED and never falls back to finite differences. Hessians are raw by default. With project_rigid set, Hessians and actions are projected with P = I - T T^T, where T spans the three translations and three centroid rotations of the point (n_coords must then be 3N).

Support: each call computes the posterior energy standard deviation at every point and reports the largest one with its index. When max_energy_std > 0 and that std exceeds it, the call fails closed with GPR_ERR_OUT_OF_SUPPORT, writes the report, and leaves every output buffer untouched. Outputs are never NaN on GPR_SUCCESS: a non-finite intermediate returns an error instead.

Covariance and variance outputs are probabilistic estimates under the GP prior and its fitted hyperparameters, never certificates. The Hessian covariances are those of a central difference of the posterior gradient process with step variance_step along each unit direction, so they converge to the Hessian posterior covariance as the step shrinks.

Calls on one model handle are serialized by a per-model lock, so any number of threads may call these functions concurrently. Points are processed in order; with one BLAS thread the results are bit-identical from run to run.

// structs
 
struct gpr_derivative_options;
struct gpr_derivative_report;