GP surface API¶
The surface API belongs to gpridge.gp.GaussianProcess. A model must be
fitted before prediction, inspection of fitted parameters, or adapter
creation. Position arguments accept an ASE Atoms object or an array with
shape (N, 3). A flat array with 3N values is also accepted and reshaped
in atom order.
Prediction¶
Member |
Return |
Meaning |
|---|---|---|
|
|
Posterior-mean energy in eV |
|
array |
Posterior-mean ASE forces in eV/Å |
|
|
One mean prediction |
|
|
Predictive energy variance in eV² |
|
array shaped like |
Posterior-mean Cartesian Hessian times |
|
array |
Full posterior-mean Cartesian Hessian |
|
|
Energy, forces, energy variance, and force-component variance |
Prediction.force_variance has shape (N, 3). Variances are variances, not
standard deviations. Prediction.energy_std returns the energy standard
deviation.
Training and inspection¶
Member |
Return |
|---|---|
|
Append energy and forces read from |
|
Append values already evaluated |
|
Fit all accumulated observations |
|
|
|
Dictionary of length scales, signal variance, likelihood variance, and jitter variance |
|
|
|
|
TrainingSet.positions and TrainingSet.forces have shape
(n_observations, N, 3). TrainingSet.energies has shape
(n_observations,). Forces use the ASE sign convention. All three arrays are
copies.
NoiseReport fields are variance values:
Field |
Meaning |
|---|---|
|
|
|
Fitted Gaussian likelihood noise |
|
Diagonal numerical jitter |
|
Likelihood variance plus jitter |
FitDiagnostics contains iterations, stop_reason, and
optimizer_failed. iterations is rgmin’s SCG steps plus the L-BFGS
fallback steps that finish a stalled rgmin SCG fit. An unfitted model reports iterations-1=,
stop_reason”unset”, and =optimizer_failed=False. A fitted model reports
budget, library, restored scg point, wall-clock limit,
non-finite marginal likelihood, or unset.
The core does not provide model serialization. There are no save or load
methods.
Adapters¶
ASE¶
as_calculator() returns the same GaussianProcess through its ASE
Calculator interface. Set atoms.calc = gp.as_calculator(). ASE requests
energy and forces. Variance remains available from gp.variance(atoms).
rgpot¶
as_rgpot() returns RgpotGPSurface. The underlying C++ type is
pot::GprMeanPotential, derived from rgpot::Potential<GprMeanPotential> and
therefore from rgpot::PotentialBase. Its call signature is:
surface(positions, atomic_numbers, box) -> (energy, forces, energy_variance)
Positions and forces have shape (N, 3). Atomic numbers have shape (N,).
The box has shape (3, 3) with lattice vectors as rows. The adapter reports
ProcessSerial reentrancy because prediction updates model workspaces.
Repeated calls return the same live adapter. A later gp.fit() retargets it
to the new posterior and advances surface_epoch(). The atomic identities,
periodic axes, and fixed periodic cell must still match the model’s template.
ForceOut::variance carries energy variance. rgpot has no standard
force-variance channel. The proposed generic interface is recorded in
docs/design/usability-audit-gp-surface.md.
The C++ header is gpridge/GprMeanPotential.h. Construct
pot::GprMeanPotential from a trained GaussianProcessRegression& and pass
it wherever an rgpot::PotentialBase& is accepted. Its
hessianVectorImpl supplies rgpot’s analytic Hessian-action concept from the
GP posterior mean.