gpridge¶
Python API for gpridge.
ASE / pyeonclient overlay entrypoints:
gpridge.gp.GaussianProcess– GP surrogate (ASE Calculator-shaped).
gpridge.session.GPNEBSession– step surface: interpolate / prepare / compute / apply (mirrors pyeonclient NEB composition).
gpridge.neb.GPNEB– list-of-images driver (facade over Session).
gpridge.dimer.GPDimer– single-saddle driver.
gpridge.ase_bridge/gpridge.pyeon_bridge– Atoms and optional Matter path-matrix + oracle wiring.
GPNEB and GPDimer accept ASE-style logfile= / trajectory=
and attach(), stepping once per oracle call. Library errors derive
from gpridge.GPRidgeError (gpridge.errors), and
gpridge.__version__ is the library version.
Layered-chain configuration lives on the GP via
gpridge.surrogate.Surrogate (immutable fluent builder).
Example:
from metatomic.torch.ase_calculator import MetatomicCalculator
from gpridge.gp import GaussianProcess
from gpridge.neb import GPNEB
from gpridge.dimer import GPDimer
petmad = MetatomicCalculator("model.pt") # an exported model file
gp = GaussianProcess(
uncertainty='laplace',
psis=True,
psis_deterministic=True,
use_delta=True,
rff_features=512,
hyperparameters='inla',
)
# NEB: builds + fits gp. Omitting model_profile leaves the library
# profile. This example keeps the layered chain above, so it names extended.
# reactant and product are ase.Atoms with the same atoms in the same
# order. The list holds the reactant, eight copies for the images between
# the endpoints, and the product; interpolate() fills the copies.
images = [reactant] + [reactant.copy() for _ in range(8)] + [product]
neb = GPNEB(images, oracle=petmad, gp=gp, climb=True,
model_profile='extended', use_idpp=True)
neb.interpolate('idpp')
neb.run(fmax=0.05, steps=500)
# Dimer: SAME gp, warm-started
dimer = GPDimer(neb.images[neb.max_energy_image], oracle=petmad, gp=gp,
model_profile='extended')
dimer.run(fmax=0.01)
The low-level nanobind objects (GaussianProcessRegression,
AtomicDimer, Observation, etc.) remain available for users
who need direct C++ access; see the _core module.
Submodules¶
- gpridge._adapters
- gpridge._api
- gpridge._calculator
- gpridge._core
- gpridge._observers
- gpridge.ase_active_gp
- gpridge.ase_bridge
- gpridge.baker_board
- gpridge.build_info
- gpridge.dimer
- gpridge.engine
- gpridge.errors
- gpridge.fes
- gpridge.gp
- gpridge.instanton
- gpridge.integrations
- gpridge.neb
- gpridge.policy
- gpridge.provenance
- gpridge.pyeon_bridge
- gpridge.session
- gpridge.surrogate
- gpridge.wheel_smoke
Exceptions¶
|
|
|
|
|
|
A failure reported by |
|
Base class of every error GPRidge raises on purpose. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functions¶
|
Version, SBOM digest, the build inventory, and the runtime components. |
|
Short static name of a |
Package Contents¶
- gpridge.read_build_info() dict[str, Any]¶
Version, SBOM digest, the build inventory, and the runtime components.
dependenciesare the CycloneDX components keyed by package URL andsourceisbuild-sbom.digest_verifiedis true whengpridge._core.build_infosupplied the digest compiled fromgpr_sbom_digest.hand the installed CycloneDX bytes match it.A library built with
-Dsbom=disabledembeds an empty digest. Thensourceissbom-disabled,dependenciesis empty, and no directory is searched: another installation’s SBOM does not describe this build. Without the extension, the first complete installed SBOM is read unverified; if there is none,SbomLookupErroris raised.runtime_componentsisgpridge.provenance.component_registry()’s component list, or None when the extension is not importable.
- exception gpridge.ABIError¶
Bases:
GPRidgeError,RuntimeErrorGPR_ERR_ABI: header and library disagree.- status = -11¶
- status_name = 'GPR_ERR_ABI'¶
- exception gpridge.AllocationError¶
Bases:
GPRidgeError,MemoryErrorGPR_ERR_ALLOC: a memory allocation failed.- status = -4¶
- status_name = 'GPR_ERR_ALLOC'¶
- exception gpridge.CholeskyError¶
Bases:
GPRidgeError,RuntimeErrorGPR_ERR_CHOLESKY: the covariance matrix is not positive definite.- status = -5¶
- status_name = 'GPR_ERR_CHOLESKY'¶
- exception gpridge.EngineError(message: str, code: int | None = None)¶
Bases:
GPRidgeError,RuntimeErrorA failure reported by
libgpr_engineover the rgpot engine ABI.codeis the engine’s return value (Nonewhen the call returned a null handle instead of a code).- status_name = 'RGPOT_ENGINE_ERROR'¶
- code = None¶
- exception gpridge.GPRidgeError¶
Bases:
ExceptionBase class of every error GPRidge raises on purpose.
statusis the matchingGPR_ERR_*code (0when the error has no C counterpart) andstatus_nameits symbolic name.
- exception gpridge.InternalError¶
Bases:
GPRidgeError,RuntimeErrorGPR_ERR_INTERNAL: any other failure inside the library.- status = -99¶
- status_name = 'GPR_ERR_INTERNAL'¶
- exception gpridge.InvalidArgumentError¶
Bases:
GPRidgeError,ValueErrorGPR_ERR_INVALID_ARG: a size, shape, key or value out of range.- status = -2¶
- status_name = 'GPR_ERR_INVALID_ARG'¶
- exception gpridge.NotConvergedError¶
Bases:
GPRidgeError,RuntimeErrorGPR_ERR_NOT_CONVERGED: a search ended without converging.- status = -7¶
- status_name = 'GPR_ERR_NOT_CONVERGED'¶
- exception gpridge.NotTrainedError¶
Bases:
GPRidgeError,ValueErrorGPR_ERR_NOT_TRAINED: the model has no training data.A
ValueError, asget_alphaon an untrained model raised before.- status = -3¶
- status_name = 'GPR_ERR_NOT_TRAINED'¶
- exception gpridge.NullHandleError¶
Bases:
GPRidgeError,ValueErrorGPR_ERR_NULL_HANDLE: a required handle or object was absent.- status = -1¶
- status_name = 'GPR_ERR_NULL_HANDLE'¶
- exception gpridge.OptimizerError¶
Bases:
GPRidgeError,RuntimeErrorGPR_ERR_OPTIMIZER: the hyperparameter optimizer failed.- status = -6¶
- status_name = 'GPR_ERR_OPTIMIZER'¶
- exception gpridge.OracleError¶
Bases:
GPRidgeError,RuntimeErrorGPR_ERR_ORACLE: the oracle failed past the search’s bound.- status = -9¶
- status_name = 'GPR_ERR_ORACLE'¶
- exception gpridge.OutOfSupportError¶
Bases:
GPRidgeError,ValueErrorGPR_ERR_OUT_OF_SUPPORT: a query’s posterior energy standard deviation exceeds the caller’smax_energy_std.- status = -12¶
- status_name = 'GPR_ERR_OUT_OF_SUPPORT'¶
- exception gpridge.SizeLimitError¶
Bases:
GPRidgeError,ValueErrorGPR_ERR_SIZE_LIMIT: the problem exceeds an index limit.- status = -8¶
- status_name = 'GPR_ERR_SIZE_LIMIT'¶
- exception gpridge.UnitMismatchError¶
Bases:
GPRidgeError,ValueErrorGPR_ERR_UNIT_MISMATCH: inputs that must share a unit were computed in different ones, such as prefactor halves with differentomega_scale.- status = -13¶
- status_name = 'GPR_ERR_UNIT_MISMATCH'¶
- exception gpridge.UnsupportedError¶
Bases:
GPRidgeError,NotImplementedErrorGPR_ERR_UNSUPPORTED: the feature is absent from this build.- status = -10¶
- status_name = 'GPR_ERR_UNSUPPORTED'¶