gpridge._core

Attributes

ForceFn

Force callback. It writes forces in place into the third argument and

RgPotFn

rgpot-style callable returning (energy, forces), optionally followed by

HTST_OMEGA_EV_ANGSTROM_AMU

Classes

DistanceMetricType

Distance metric for early stopping checks.

FrozenAndMovingAtoms

Atom mobility flags for is_frozen arrays.

DebugLevels

Verbosity levels for debug output.

OptimizationAlgorithms

Hyperparameter optimization algorithms.

UncertaintyMode

Posterior estimator that GaussianProcessRegression dispatches

HyperparameterOptimizationMode

Hyperparameter optimiser the GP runs to fit theta.

HyperparameterObjectiveMode

Hyperparameter objective used to score theta.

GPModelProfile

Coherent GP model family (prior, objective, solver contract).

LinalgMode

Distributed factorization (gprn --linalg-mode).

NEBMode

NEB execution branch in gpr::neb::gpNEB.

VibrationalStencil

Coordinates a true-oracle Hessian stencil displaces.

ConvergenceNorm

Norm of the band force that the convergence test reads.

AcquisitionType

OIE worst-image acquisition strategy.

BQMeasure

Integration measure. A uniform box is the Lebesgue integral divided by the

BQBasis

Bayes-Sard basis. GPR_BQ_BASIS_FOLLOW_CONFIG, the state of a new handle

BQKernel

Kernel family for scalar GP Bayesian quadrature (ABI 1.17).

BQHyperMode

Hyperparameter treatment for Bayesian quadrature (ABI 1.17).

BQConfig

Scalar GP and Bayesian quadrature configuration (ABI 1.17).

BQIntegralReport

Posterior decomposition for a Bayesian quadrature integral.

BQUncertainty

Integral uncertainty split by source. variance is the historical report,

BayesianQuadrature

Bayesian quadrature handle (gpr_bq_t).

FESConfig

Free-energy surrogate configuration (gpr_fes_config_t, ABI 1.23).

FESRateConfig

Posterior-sampled Kramers rate configuration (gpr_fes_rate_config_t).

FESRateReport

Summary of the accepted posterior rate draws (gpr_fes_rate_report_t).

PsearchAxis

Kind of a continuous parameter-search axis.

ScalarSurrogate

Scalar Gaussian process on a parameter vector, for a noisy oracle.

ParameterSearch

Ask-and-tell minimization of a loss over a box.

FreeEnergySurrogate

Gaussian process for a free energy F(s) on collective variables.

BandEngineKind

Inner-band stepper.

Image

One image in a NEB path: positions, energy, gradient.

NEBPath

NEB chain of images. Step surface: init path, forces, CI, reparam.

Observation

Container for observation data: coordinates (R), energies (E), gradients (G).

AtomsConfiguration

Atomic configuration: positions, frozen flags, IDs, atomic numbers.

PriorBase

Base class for GP prior distributions.

PriorGaussian

Gaussian prior: log p(x) = -0.5 * sum_j [log(2*pi*s2) + (x_j-mu)^2/s2]

PriorLogNormal

Log-normal prior on exp(x).

PriorT

Student's t prior with nu degrees of freedom.

PriorSqrtt

Prior on sqrt(exp(x)) with Student's t distribution.

PriorUnif

Uniform (uninformative) prior: log p(x) = 0.

PriorLogUnif

Log-uniform prior on exp(x).

PotentialWrapper

Plug-in oracle wrapper.

NoiseFloorReport

Condition-floored noise and certificate gap of a trained model.

RgpotGPSurface

Trained GPRidge posterior mean; prefer GaussianProcess.as_rgpot.

RFFFeatureSelection

Stored report from automatic random-feature selection.

ARDSearchResult

Result of ARD grid search.

ARDGridSearch

Grid search over ARD lengthscales + noise.

BMAPrediction

Prediction result from Bayesian model averaging.

BayesianModelAveraging

Bayesian model averaging over hyperparameter grid.

EnergyUnit

Energy unit tag of a model's training data (no conversion).

LengthUnit

Length unit tag of a model's training data (no conversion).

DerivativeStatus

Outcome of a posterior-derivative call.

DerivativeOptions

Options of the batched posterior-derivative primitives.

DerivativeReport

Report of a posterior-derivative call. Variances are probabilistic

HtstMode

How an HTST half obtains its Hessian.

HtstKind

Stationary point of a half (ABI 1.20).

HtstStatus

Outcome of a half (ABI 1.20).

HtstSource

Where a half's Hessian came from (ABI 1.20).

HtstPoint

Which stationary point of a search a half belongs to.

HtstOptions

Harmonic prefactor options (gpr_htst_options_t).

HtstHalf

One side of ln nu = ln_sum(minimum) - ln_sum(saddle).

GaussianProcessRegression

Low-level GP regression class. Most users want gpridge.GaussianProcess

StudentTProcessRegression

Student-t process variant with heavier-tailed observation noise.

GPNEBConfig

Configuration for the low-level GP-NEB driver.

OCINEBConfig

Configuration for the low-level OCINEB dimer-burst phase.

GPNEBStopReason

Terminal stop reason recorded on GPNEBResult.

GPNEBResult

Result of a gp_neb run. The .path holds the converged image chain.

OCINEBResult

Result of a run_ocineb run: NEB summary plus dimer accounting.

PeriodicBandDefaults

Defaults of the periodic local band, shared with the C API.

HssvdBackend

Posterior solver on a model config. Default keeps library HS-SVD.

PeriodicBandInitial

Initial path construction for periodic local bands.

LocalBandConfig

Local-band configuration mirroring gpr_local_band_config_t.

PeriodicBandConfig

Periodic local-band configuration mirroring gpr_periodic_band_config_t.

AtomicDimer

Single-saddle dimer search driver. Construct with no arguments,

SecantHessianMethod

True-gradient secant update. BFGS keeps positive curvature and is

SecantSeedStatus

Why a secant Newton step was or was not used.

SecantHessianConfig

True-force secant curvature for gp_minimize. Every switch is off

MinimizationConfig

Configuration for GP-accelerated geometry minimization. max_iter

MinimizationResult

Result of gp_minimize. x_final, e_final, and g_final are

PolicyState

Read-only search state passed to a training policy. iteration is

PolicyCandidate

One measured row offered to select_training_points.

Functions

fes_noise_from_weights(...)

Noise variances inversely proportional to relative sample weights.

neb_linear_path(→ numpy.typing.NDArray[numpy.float64])

Linear path matrix (n_intermediate+2, 3*n_atoms).

neb_idpp_path(→ numpy.typing.NDArray[numpy.float64])

Per-image IDPP full path matrix.

neb_idpp_collective_path(...)

Collective IDPP full path matrix.

neb_sidpp_path(→ numpy.typing.NDArray[numpy.float64])

Sequential IDPP full path matrix.

neb_sidpp_geodesic_path(...)

Geodesic-SIDPP full path matrix.

pair_distance_matrix(→ numpy.typing.NDArray[numpy.float64])

Return the production inverse-pair-distance matrix between coordinate

periodic_band_defaults(→ PeriodicBandDefaults)

The periodic local band defaults.

status_name(→ str)

Short static name of a GPR_* status code.

neb_request_index_certificate(→ None)

Request that the next NEB search on this thread certify the stopped band.

neb_request_sidpp(→ None)

Select SIDPP or classic IDPP for the next NEB search on this thread.

neb_request_vibrational_stencil(→ None)

Stencil of the next non-local NEB search on this thread.

neb_search_potential(→ GPNEBResult)

Run gpr_neb_search_potential through a PotentialWrapper.

neb_search_gp_potential(→ GPNEBResult)

Run gpr_neb_search_gp_potential through a PotentialWrapper.

neb_search_local(→ GPNEBResult)

Run gpr_neb_search_local with optional atoms_config, box, config, and

neb_search_local_potential(→ GPNEBResult)

Run gpr_neb_search_local_potential through a PotentialWrapper.

neb_search_periodic(→ GPNEBResult)

Run gpr_neb_search_periodic with optional atoms_config, box,

neb_search_periodic_potential(→ GPNEBResult)

Run gpr_neb_search_periodic_potential through a PotentialWrapper.

gp_neb(→ GPNEBResult)

Run the gpr::neb::gpNEB driver. Config uses GPNEBConfig field

run_ocineb(→ OCINEBResult)

Run gpr::neb::runOCINEB -- GP-NEB with the interleaved MMF dimer burst.

set_linalg_mode(→ None)

Select the distributed factorization for the whole process.

linalg_mode(→ str)

The selected distributed factorization, "reproducible" or "library".

set_linalg_threads(→ None)

Set the dense linear-algebra thread count (gprn --linalg-threads).

set_training_product(→ None)

'' (native), 'scheme2:fp64[...]', 'scheme2:int8[...]' or a library

training_product_configured(→ bool)

True when a Scheme II engine or a product library is selected.

check_model_package(→ None)

RuntimeError when the AOTInductor package needs a CPU extension the

backend_name(→ str)

Compiled linear-algebra backend, such as "eigen" or "scalapack".

abi_report(→ list[str])

One [startup] abi ... line per native library.

component_registry(→ dict[str, Any])

Canonical runtime component registry, its SHA-256, and components.

check_abi(→ None)

Raise ABIError naming both stamps when a loaded native library

minimize_request_max_inner_steps(→ None)

Set the inner surrogate L-BFGS step cap for the next C API

gp_minimize(→ MinimizationResult)

Run GP-accelerated geometry minimization. policy is a training

save_gp_state(→ None)

Write a trained GP to gp-state.npz.

load_gp_observations(→ Observation)

Read the observation rows of a gp-state.npz file.

apply_saved_gp_state(→ None)

Install the fitted kernel of a gp-state.npz onto an initialized model.

train_phase_reset(→ None)

Zero the train-phase wall-time accumulators.

train_phase_read(→ dict[str, float])

Read the five train-phase wall-time accumulators.

train_phase_read_leaves(→ dict[str, float])

Read the ten train-phase leaf accumulators.

set_library_serial(→ None)

Select Eigen serial factor/solves (True) or OpenMP panel kernels (False).

build_info(→ dict[str, str])

Digest and SOURCE_DATE_EPOCH compiled from gpr_sbom_digest.h.

version_components(→ tuple[int, int, int])

Return (major, minor, patch) of the loaded library.

abi_version(→ tuple[int, int])

Return (major, minor) of the loaded library's C ABI.

backend_requires_mpi(→ bool)

True if the compiled linear-algebra backend requires MPI_Init.

mpi_initialized(→ bool)

True if MPI_Init has been called.

mpi_world_rank(→ int)

MPI rank in MPI_COMM_WORLD, or 0 without MPI.

mpi_world_size(→ int)

MPI size of MPI_COMM_WORLD, or 1 without MPI.

omp_max_threads(→ int)

OpenMP thread budget for this process.

potential_lj(→ tuple[float, ...)

Evaluate Lennard-Jones energy and gradient.

potential_muller_brown(→ tuple[float, ...)

Evaluate Muller-Brown energy and gradient.

potential_leps(→ tuple[float, ...)

Evaluate LEPS collinear potential energy and gradient.

canonical_dimer_parameters(→ dict[str, Any])

The dimer settings gprd runs with, as a parameter dict.

initialize_atoms_config(→ None)

Fully initialize an AtomsConfiguration's internal structures.

htst_half_from_hessian(→ HtstHalf)

HTST half of a caller-supplied Hessian (source MEASURED).

htst_half(→ HtstHalf)

HTST half at x: REFINED, MEASURED or SURROGATE per options.mode.

htst_ln_prefactor(→ tuple[float, float])

(ln nu, std) = ln_sum(minimum) - ln_sum(saddle).

request_prefactor(→ None)

Opt this thread's later searches into prefactor halves.

search_prefactor(→ HtstHalf)

The HTST half of this thread's last search at point.

Module Contents

class gpridge._core.DistanceMetricType

Bases: enum.Enum

Distance metric for early stopping checks.

MAX_1D_LOG = 0
RMSD = 1
EMD = 2
class gpridge._core.FrozenAndMovingAtoms

Bases: enum.IntEnum

Atom mobility flags for is_frozen arrays.

MOVING_ATOM = 0
FROZEN_ATOM = 1
class gpridge._core.DebugLevels

Bases: enum.IntEnum

Verbosity levels for debug output.

DEBUG_L0: silent, DEBUG_L2: per outer loop, DEBUG_L3: per inner loop.

DEBUG_L0 = 0
DEBUG_L1 = 1
DEBUG_L2 = 2
DEBUG_L3 = 3
class gpridge._core.OptimizationAlgorithms

Bases: enum.IntEnum

Hyperparameter optimization algorithms.

SCG_opt = 0
INLA_opt = 1
class gpridge._core.UncertaintyMode

Bases: enum.IntEnum

Posterior estimator that GaussianProcessRegression dispatches calculate_potential / calculate_variance through.

MAP = 0
LAPLACE = 2
LAPLACE_SLICE = 5
EB = 3
BMA = 1
SVGD = 4
class gpridge._core.HyperparameterOptimizationMode

Bases: enum.IntEnum

Hyperparameter optimiser the GP runs to fit theta.

SCG = 0
INLA = 1
MAP_LBFGS = 2
class gpridge._core.HyperparameterObjectiveMode

Bases: enum.IntEnum

Hyperparameter objective used to score theta.

NLML = 0
LOO = 1
LOCAL_LOO = 2
class gpridge._core.GPModelProfile

Bases: enum.IntEnum

Coherent GP model family (prior, objective, solver contract).

CHEMGP = 0
GPRD_ZBL = 1
EXTENDED = 2
class gpridge._core.LinalgMode

Bases: enum.IntEnum

Distributed factorization (gprn –linalg-mode).

REPRODUCIBLE = 0
LIBRARY = 1
class gpridge._core.NEBMode

Bases: enum.IntEnum

NEB execution branch in gpr::neb::gpNEB.

Standard = 0
AIE = 1
OIE = 2
GP_AIE = 3
GP_OIE = 4
GP_LOCAL = 5
class gpridge._core.VibrationalStencil

Bases: enum.IntEnum

Coordinates a true-oracle Hessian stencil displaces.

Full = 0
Vibrational = 1
class gpridge._core.ConvergenceNorm

Bases: enum.IntEnum

Norm of the band force that the convergence test reads.

L2 = 0
LINF = 1
MAX_FORCE_ON_ATOM = 2
class gpridge._core.AcquisitionType

Bases: enum.IntEnum

OIE worst-image acquisition strategy.

MaxForce = 1
MaxVariance = 0
UCB = 2
ThompsonSampling = 3
IMSPE = 4
ExpectedImprovement = 5
PriorityCascade = 6
TPE = 7
PSBAX = 8
class gpridge._core.BQMeasure

Bases: enum.IntEnum

Integration measure. A uniform box is the Lebesgue integral divided by the volume.

LebesgueBox: int
UniformBox: int
Gaussian: int
class gpridge._core.BQBasis

Bases: enum.IntEnum

Bayes-Sard basis. GPR_BQ_BASIS_FOLLOW_CONFIG, the state of a new handle and of gpr_bq_set_basis(bq, -1), keeps the historical switch use_prior_mean: the constant basis when it is set, no basis otherwise.

FollowConfig = -1
None_: int
Constant: int
Affine: int
class gpridge._core.BQKernel

Bases: enum.IntEnum

Kernel family for scalar GP Bayesian quadrature (ABI 1.17).

SE = 0
Matern32Product = 1
Matern52Product = 2
Matern32Isotropic = 3
Matern52Isotropic = 4
class gpridge._core.BQHyperMode

Bases: enum.IntEnum

Hyperparameter treatment for Bayesian quadrature (ABI 1.17).

Fixed = 0
ML = 1
MAP = 2
TPMarginal = 3
Marginalized = 4
class gpridge._core.BQConfig

Scalar GP and Bayesian quadrature configuration (ABI 1.17).

dimension: int
kernel: BQKernel
ard: int
hyper_mode: BQHyperMode
magn_sigma2: float
lengthscale: float
extra_sigma2: float
optimize_extra_sigma2: int
jitter_sigma2: float
kappa_max: float
use_prior_mean: int
ls_prior_mu: float
ls_prior_s2: float
ls_prior_nu: float
tp_hyperprior_a: float
tp_hyperprior_b: float
quad_nodes: int
gl_max_panels: int
max_iter: int
tol_func: float
tol_sol: float
report_level: int
interpolate_candidate_noise: int
class gpridge._core.BQIntegralReport

Posterior decomposition for a Bayesian quadrature integral.

mean: float
variance: float
std_dev: float
prior_integral_variance: float
explained_variance: float
mean_shift_variance: float
aleatoric_variance: float
epistemic_variance: float
hyperparameter_variance: float
loo_calibration_scale: float
tp_variance_scale: float
condition_number: float
effective_nugget: float
quadrature_models: int
class gpridge._core.BQUncertainty

Integral uncertainty split by source. variance is the historical report, including the leave-one-out factor.

mean: float
variance: float
gp_variance: float
observation_noise_variance: float
hyperparameter_variance: float
numerical_abs_tolerance: float
loo_predictive_scale: float
variance_model: float
measure_mass: float
quadrature_models: int
class gpridge._core.BayesianQuadrature(config: BQConfig = ...)

Bayesian quadrature handle (gpr_bq_t).

reset(config: BQConfig) → None

Replace the configuration and drop every observation and any stored integration box.

dimension: int
n_observations: int
n_lengthscales: int
lengthscales: list[float]
magn_sigma2: float
extra_sigma2: float
train(x: numpy.typing.NDArray[numpy.float64], y: numpy.typing.NDArray[numpy.float64], noise_var: numpy.typing.NDArray[numpy.float64]) → None

Train on n_obs points and infer the integration box from the training extrema.

train_bounded(x: numpy.typing.NDArray[numpy.float64], y: numpy.typing.NDArray[numpy.float64], noise_var: numpy.typing.NDArray[numpy.float64], lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64]) → None

Train and store an explicit integration box. Each lower[d] is finite and strictly below upper[d], and every training coordinate lies in the closed interval.

append(x: numpy.typing.NDArray[numpy.float64], y: numpy.typing.NDArray[numpy.float64], noise_var: numpy.typing.NDArray[numpy.float64], refit: bool = False) → None

Append n_new observations to a trained model.

fit_hyperparameters(mode: BQHyperMode) → dict[str, Any]

Re-infer the hyperparameters of a trained model with the given treatment, which then becomes the configured treatment, and return the fit report plus fitted length scales.

predict(x: numpy.typing.NDArray[numpy.float64]) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Posterior mean and variance at n_queries points.

kernel_mean(lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64], x: numpy.typing.NDArray[numpy.float64]) → numpy.typing.NDArray[numpy.float64]

Kernel mean z_i = integral over the box [lower, upper] of k(x, X_i) dx at each row of x.

kernel_double_integral(lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64]) → float

Kernel double integral of k over the box (output unit squared times volume squared).

integrate(lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64]) → tuple[float, float]

Integral mean and variance over a box. Equivalent to gpr_bq_integrate_report_checked keeping only mean and variance.

integrate_measure(kind: BQMeasure, lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64], mean: numpy.typing.NDArray[numpy.float64], covariance: numpy.typing.NDArray[numpy.float64]) → tuple[float, float, float]

Integrate against a Lebesgue box, the uniform probability on that box, or a Gaussian.

integrate_uncertainty(kind: BQMeasure, lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64], mean: numpy.typing.NDArray[numpy.float64], covariance: numpy.typing.NDArray[numpy.float64]) → BQUncertainty

As gpr_bq_integrate_measure_checked, with the uncertainty split by source.

set_basis(basis: BQBasis) → None

Select the Bayes-Sard mean model with a gpr_bq_basis_t value; GPR_BQ_BASIS_FOLLOW_CONFIG (-1) follows the configuration (use_prior_mean: constant when set, none otherwise).

property basis: BQBasis

Active basis selection (GPR_BQ_BASIS_FOLLOW_CONFIG until a basis is set).

integrate_report(lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64]) → BQIntegralReport

Integral over a box with the full decomposition of the variance.

integrate_cumulative(lower: numpy.typing.NDArray[numpy.float64], upper_limits: numpy.typing.NDArray[numpy.float64]) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Joint posterior of the integrals over [lower, upper_limits[j]] for n_limits nested upper limits.

sample_cumulative(lower: numpy.typing.NDArray[numpy.float64], upper_limits: numpy.typing.NDArray[numpy.float64], n_draws: int, seed: int = 0) → numpy.typing.NDArray[numpy.float64]

Draw n_draws joint samples of the cumulative integrals, deterministic in seed.

candidate_variance_reduction(lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64], candidates: numpy.typing.NDArray[numpy.float64], noise_var: numpy.typing.NDArray[numpy.float64] | None = None) → numpy.typing.NDArray[numpy.float64]

Variance reduction of the integral from one extra observation at each candidate.

select_batch_candidates(lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64], candidates: numpy.typing.NDArray[numpy.float64], noise_var: numpy.typing.NDArray[numpy.float64] | None, batch_size: int) → tuple[list[int], list[float]]

Greedily choose batch_size candidates, each conditioned on the ones chosen before it.

calibrate_loo(nominal_probability: float) → dict[str, Any]

Closed-form leave-one-out calibration summary at the given central probability in (0, 1). It makes no oracle call and does not change the model.

calibrate_loo_scores(nominal_probability: float) → tuple[float, list[float]]

As gpr_bq_calibrate_loo_checked, and also write every standardized leave-one-out score.

class gpridge._core.FESConfig

Free-energy surrogate configuration (gpr_fes_config_t, ABI 1.23).

kernel is the kernel family; only the squared exponential is supported. ard is 1 for one length scale per coordinate and 0 for one shared scale.

struct_size: int
kernel: BQKernel
ard: int
class gpridge._core.FESRateConfig

Posterior-sampled Kramers rate configuration (gpr_fes_rate_config_t).

posterior_samples is the number of joint posterior draws (at least 2). seed seeds the reproducible normal stream. beta is the inverse temperature in the inverse units of F and must be positive. credible_mass is the probability inside the equal-tailed intervals. saddle_tolerance stops the search when the scaled gradient of the posterior mean is at most that fraction of the signal standard deviation.

struct_size: int
posterior_samples: int
seed: int
beta: float
credible_mass: float
saddle_tolerance: float
class gpridge._core.FESRateReport

Summary of the accepted posterior rate draws (gpr_fes_rate_report_t).

Means and sample standard deviations cover the barrier, the prefactor and the rate; equal-tailed intervals cover the barrier and the rate only. samples_accepted counts draws with a positive barrier, a positive-definite reactant Hessian and a saddle Hessian of index one. saddle_gradient_norm is ||l .* grad F|| / sqrt(signal variance) of the posterior mean at the saddle, the ratio the search compares against saddle_tolerance.

struct_size: int
barrier_mean: float
barrier_std: float
barrier_lower: float
barrier_upper: float
prefactor_mean: float
prefactor_std: float
rate_mean: float
rate_std: float
rate_lower: float
rate_upper: float
samples_requested: int
samples_accepted: int
saddle_gradient_norm: float
gpridge._core.fes_noise_from_weights(weights: numpy.typing.NDArray[numpy.float64], reference_variance: float, min_relative_weight: float) → numpy.typing.NDArray[numpy.float64]

Noise variances inversely proportional to relative sample weights.

Each variance is reference_variance times max(w), divided by the larger of that weight and min_relative_weight times max(w). Scaling every weight by the same factor leaves the result unchanged.

class gpridge._core.PsearchAxis

Bases: enum.IntEnum

Kind of a continuous parameter-search axis.

Linear: int
Log: int
Integer: int
class gpridge._core.ScalarSurrogate(dimension: int, kernel: BQKernel = ...)

Scalar Gaussian process on a parameter vector, for a noisy oracle.

The kernel is a radial shape of the scaled distance with one length scale per coordinate: BQKernel.SE, BQKernel.Matern32Isotropic or BQKernel.Matern52Isotropic. Rows are observed either all with a noise variance each or all without one.

property dimension: int

Number of coordinates.

property n_observations: int

Number of observed rows.

set_kernel(kernel: BQKernel) → None

Select the radial shape; a new fit is needed afterwards.

set_mean_basis(basis: BQBasis) → None

Select a zero (None_), constant or affine mean, fitted by generalized least squares at each fit.

set_hyperparameters(length_scales: numpy.typing.NDArray[numpy.float64], signal_variance: float = 1.0, noise_variance: float = 1e-08) → None

Set one length scale (or one per coordinate), the signal variance and the shared noise variance.

hyperparameters() → tuple[numpy.typing.NDArray[numpy.float64], float, float]

Length scales, signal variance and shared noise variance.

observe(x: numpy.typing.NDArray[numpy.float64], y: numpy.typing.NDArray[numpy.float64], noise_var: numpy.typing.NDArray[numpy.float64] | None = None) → None

Append rows x with values y and, optionally, one noise variance per row.

fit(optimize: bool = False, n_starts: int = 8) → float

Condition on the rows and return the log marginal likelihood.

With optimize the likelihood is first maximized over the length scales, the signal variance and, without per-row noise, the noise variance, from n_starts starting points.

predict(x: numpy.typing.NDArray[numpy.float64], query_noise_var: float = 0.0) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Mean and standard deviation at each row of x.

The standard deviation is that of the latent function when query_noise_var is zero; a positive value is added to the variance.

class gpridge._core.ParameterSearch(lower: numpy.typing.NDArray[numpy.float64], upper: numpy.typing.NDArray[numpy.float64], axis_kind: collections.abc.Sequence[PsearchAxis] | None = None, kernel: BQKernel = ..., noisy: bool = False)

Ask-and-tell minimization of a loss over a box.

observe reports evaluated rows and propose returns the next batch, built by expected improvement under the constant liar. With noisy the incumbent is the smallest posterior mean at the evaluated points.

property dimension: int

Number of axes.

set_allowed_values(axis: int, values: numpy.typing.NDArray[numpy.float64], categorical: bool = False) → None

Restrict the zero-based axis to values, before the first observation or proposal. categorical marks unordered labels.

observe(x: numpy.typing.NDArray[numpy.float64], y: numpy.typing.NDArray[numpy.float64], noise_var: numpy.typing.NDArray[numpy.float64] | None = None, constraint: numpy.typing.NDArray[numpy.float64] | None = None) → None

Report evaluated rows. A constraint value is feasible at or below zero; a run without a loss holds NaN and a positive constraint.

propose(q: int = 1) → numpy.typing.NDArray[numpy.float64]

Up to q parameter vectors to evaluate next, one per row.

best() → tuple[numpy.typing.NDArray[numpy.float64], float]

The incumbent and its loss (the posterior mean when noisy).

class gpridge._core.FreeEnergySurrogate(dimension: int, config: FESConfig = ..., *, sigma2: float | None = None, jitter_sigma2: float | None = None, magn_sigma2: float | None = None, max_iter: int | None = None, tol_func: float | None = None, tol_sol: float | None = None, report_level: int | None = None, grad_noise_var: numpy.typing.NDArray[numpy.float64] | None = None)

Gaussian process for a free energy F(s) on collective variables.

It observes F at points s, each with its own noise variance, and optionally the gradient of F. The prior is a squared-exponential kernel of the scaled distance around the mean of the observed F. F must be a free energy, not a bias potential or an unreweighted biased histogram.

property dimension: int

Collective-variable dimension.

property n_observations: int

Number of training points, or 0 before training.

train(s: numpy.typing.NDArray[numpy.float64], F: numpy.typing.NDArray[numpy.float64], F_noise_var: numpy.typing.NDArray[numpy.float64] | None = None, grad_F: numpy.typing.NDArray[numpy.float64] | None = None, grad_noise_var: numpy.typing.NDArray[numpy.float64] | None = None, grad_present: numpy.typing.NDArray[numpy.uint8] | None = None) → None

Replace the training data and fit the hyperparameters.

s is one row per point and F the free energies. F_noise_var is omitted for zero noise. grad_F, grad_noise_var and grad_present are all omitted or all given; a grad_present entry is 1 where that row’s gradient is observed. A failed train keeps the previous posterior.

predict(s: numpy.typing.NDArray[numpy.float64], with_gradient: bool = False, with_variance: bool = False) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64] | None, numpy.typing.NDArray[numpy.float64] | None]

Posterior mean of F at each query.

The gradient of the mean and the latent variance of F (no observation noise) are included when requested, and are None otherwise.

rate_path(path: numpy.typing.NDArray[numpy.float64], reactant_index: int, product_index: int, diffusion: numpy.typing.NDArray[numpy.float64], config: FESRateConfig) → FESRateReport

Overdamped Kramers-Langer rate from reactant_index to product_index.

The saddle is the index-one stationary point of the posterior mean of F within one length-scale-scaled unit of the path polyline. Uncertainty comes from joint posterior draws of F and its Hessian at the reactant and the saddle. diffusion is the positive diagonal of the diffusion tensor.

class gpridge._core.BandEngineKind

Bases: enum.IntEnum

Inner-band stepper.

Production default is RgLbfgs. InternalLbfgs is the parity harness. RgFire is rgmin FIRE2. Rgsaddle is the linked rgsaddle library.

InternalLbfgs = 0
RgLbfgs = 1
RgFire = 2
Rgsaddle = 3
class gpridge._core.Image

One image in a NEB path: positions, energy, gradient.

positions: numpy.typing.NDArray[numpy.float64]
energy: float
gradient: numpy.typing.NDArray[numpy.float64]
is_endpoint: bool
is_climbing: bool
evaluated: bool
posterior_variance: float
class gpridge._core.NEBPath(initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int, spring_constant: float = 0.1)

NEB chain of images. Step surface: init path, forces, CI, reparam.

num_images() → int

Number of images on the path.

num_intermediate() → int

Number of intermediate images.

image(i: int) → Image

Image i of the chain, with the reactant as 0.

Raises IndexError unless 0 <= i < num_images().

initialize_idpp(n_atoms: int, collective: bool = False) → None

Step: replace intermediates with per-image (or collective) IDPP.

initialize_sidpp(n_atoms: int, alpha: float = 0.33) → None

Step: Sequential IDPP path growth (SIDPP).

initialize_sidpp_geodesic(n_atoms: int, alpha: float = 0.33) → None

Step: Geodesic-SIDPP (inverse-distance target interpolation).

compute_neb_forces() → None

Step: recompute spring + tangent + climbing forces from current image energies/gradients.

enable_climbing_image() → None

Step: mark the highest-energy intermediate as climbing image.

highest_energy_image_index() → int

Highest finite interior energy, or -1 when none exists.

highest_energy_image_index_preferring(preferred: int) → int

Highest interior energy image, keeping preferred if still a local max.

neb_force(i: int) → numpy.typing.NDArray[numpy.float64]

NEB force vector for image i (after compute_neb_forces).

tangent_at(i: int) → numpy.typing.NDArray[numpy.float64]

Improved (energy-weighted) unit tangent at image i.

intermediate_positions() → numpy.typing.NDArray[numpy.float64]

Matrix (n_intermediate, n_coords) of interior image positions.

set_from_observation(obs: Observation, start_image: int = 1) → None

Step: load energies/gradients from an Observation into images.

set_spring_bounds(k_max: float, k_min: float) → None

Energy-weighted spring bounds (k_max at saddle, k_min in basins).

set_geometric_spring(on: bool) → None

Toggle geometric (cubic-potential) spring force.

geometric_spring() → bool

Whether geometric spring mode is on.

max_spacing_deviation() → float

Max relative spacing deviation from uniform arc length.

reparametrize_by_arc_length() → float

Step: redistribute interiors uniformly along arc length; returns pre-reparam max_spacing_deviation. Invalidates energies/grads.

reparametrize_by_arc_length_keeping_image(anchor_index: int) → float

Step: reparam subchains while preserving one anchor image.

positions_matrix() → numpy.typing.NDArray[numpy.float64]

All image positions as matrix (n_images, 3*n_atoms), endpoints included.

gpridge._core.neb_linear_path(initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_intermediate: int, spring_constant: float = 0.1) → numpy.typing.NDArray[numpy.float64]

Linear path matrix (n_intermediate+2, 3*n_atoms).

gpridge._core.neb_idpp_path(initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_intermediate: int, n_atoms: int, max_iter: int = 200, force_tol: float = 0.01, step_size: float = 0.1) → numpy.typing.NDArray[numpy.float64]

Per-image IDPP full path matrix.

gpridge._core.neb_idpp_collective_path(initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_intermediate: int, n_atoms: int, spring_constant: float = 0.1, max_iter: int = 500, force_tol: float = 0.01, step_size: float = 0.05) → numpy.typing.NDArray[numpy.float64]

Collective IDPP full path matrix.

gpridge._core.neb_sidpp_path(initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_intermediate: int, n_atoms: int, spring_constant: float = 0.1, alpha: float = 0.33, relax_steps: int = 100, max_iter: int = 500, force_tol: float = 0.01, step_size: float = 0.05) → numpy.typing.NDArray[numpy.float64]

Sequential IDPP full path matrix.

gpridge._core.neb_sidpp_geodesic_path(initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_intermediate: int, n_atoms: int, spring_constant: float = 0.1, alpha: float = 0.33, relax_steps: int = 100, max_iter: int = 500, force_tol: float = 0.01, step_size: float = 0.05) → numpy.typing.NDArray[numpy.float64]

Geodesic-SIDPP full path matrix.

class gpridge._core.Observation

Container for observation data: coordinates (R), energies (E), gradients (G).

Each field is a row-major Eigen matrix mapped to/from numpy:

R: (N_obs, 3*N_atoms) – atomic coordinates E: (N_obs, 1) – potential energies G: (N_obs, 3*N_atoms) – energy gradients

R: numpy.typing.NDArray[numpy.float64]
E: numpy.typing.NDArray[numpy.float64]
G: numpy.typing.NDArray[numpy.float64]
clear() → None

Reset all fields to empty.

class gpridge._core.AtomsConfiguration

Atomic configuration: positions, frozen flags, IDs, atomic numbers.

positions: numpy.typing.NDArray[numpy.float64]
is_frozen: numpy.typing.NDArray[numpy.uint8]
id: numpy.typing.NDArray[numpy.uint32]
atomic_nrs: numpy.typing.NDArray[numpy.int32]
atomic_masses: numpy.typing.NDArray[numpy.float64]
evict_frozen: bool
nn_frozen: int
nn_auto: bool
clear() → None

Reset all fields.

count_moving_atoms() → int

Return the number of non-frozen atoms.

n_pairtypes() → int

Return the number of active pair types.

class gpridge._core.PriorBase

Base class for GP prior distributions.

Parameters: mu (location), s2 (scale^2), nu (degrees of freedom).

calculate_log_prior(x: numpy.typing.NDArray[numpy.float64]) → float

Evaluate log p(x) under this prior.

calculate_log_prior_gradient(x: numpy.typing.NDArray[numpy.float64]) → numpy.typing.NDArray[numpy.float64]

Evaluate d/dx log p(x) under this prior.

mu: float
s2: float
nu: float
class gpridge._core.PriorGaussian

Bases: PriorBase

Gaussian prior: log p(x) = -0.5 * sum_j [log(2*pi*s2) + (x_j-mu)^2/s2]

class gpridge._core.PriorLogNormal

Bases: PriorBase

Log-normal prior on exp(x).

class gpridge._core.PriorT

Bases: PriorBase

Student’s t prior with nu degrees of freedom.

class gpridge._core.PriorSqrtt

Bases: PriorBase

Prior on sqrt(exp(x)) with Student’s t distribution.

class gpridge._core.PriorUnif

Bases: PriorBase

Uniform (uninformative) prior: log p(x) = 0.

class gpridge._core.PriorLogUnif

Bases: PriorBase

Log-uniform prior on exp(x).

gpridge._core.ForceFn

Force callback. It writes forces in place into the third argument and returns the total energy.

gpridge._core.RgPotFn

rgpot-style callable returning (energy, forces), optionally followed by energy_variance and force_noise_rms.

class gpridge._core.PotentialWrapper(fn: ForceFn)

Plug-in oracle wrapper.

Construct from a write-in-place callable, or from an rgpot PotentialBase / rgpot-style callable via from_rgpot().

static from_rgpot(pot: RgPotFn | Any) → PotentialWrapper

Wrap an rgpot PotentialBase or an rgpot-style callable.

force(positions: numpy.typing.NDArray[numpy.float64], atomic_numbers: numpy.typing.NDArray[numpy.int32], box: numpy.typing.NDArray[numpy.float64]) → tuple[float, numpy.typing.NDArray[numpy.float64]]

Evaluate energy and forces. Returns (energy, forces[N,3]).

force_with_uncertainty(positions: numpy.typing.NDArray[numpy.float64], atomic_numbers: numpy.typing.NDArray[numpy.int32], box: numpy.typing.NDArray[numpy.float64]) → tuple[float, numpy.typing.NDArray[numpy.float64], float, float]

Evaluate energy, forces, and both noise channels. Returns (energy, forces[N,3], energy_noise_rms, force_noise_rms).

class gpridge._core.NoiseFloorReport

Condition-floored noise and certificate gap of a trained model.

sigma2_requested: float
sigma2_floored: float
certificate_gap: float
sigma2_interval: float
floor_active: bool
certified: bool
class gpridge._core.RgpotGPSurface(model: GaussianProcessRegression)

Trained GPRidge posterior mean; prefer GaussianProcess.as_rgpot.

evaluate(positions: numpy.typing.NDArray[numpy.float64], atomic_numbers: numpy.typing.NDArray[numpy.int32], box: numpy.typing.NDArray[numpy.float64]) → dict[str, Any]

Evaluate the rgpot surface and return energy, forces and variance.

surface_epoch() → int

Return the surface epoch for cache invalidation.

It changes when the source changes or the active model is refactored.

class gpridge._core.RFFFeatureSelection

Stored report from automatic random-feature selection.

accepted: bool
deferred: bool
features: int
start_features: int
limit_features: int
fit_geometries: int
holdout_geometries: int
full_geometries: int
cartesian_dimension: int
joint_rows: int
force_tol_fraction: float
force_convergence_tolerance: float
energy_tolerance: float
force_tolerance: float
energy_noise: float
gradient_noise: float
max_energy_error: float
max_force_error: float
max_energy_oracle_error: float
max_force_oracle_error: float
exact_energy_oracle_error: float
exact_force_oracle_error: float
exact_gram_bytes: int
memory_cap_bytes: int
full_gram_bytes: int
status: str
detail: str
class gpridge._core.ARDSearchResult

Result of ARD grid search.

best_lengthscales: list[float]
best_noise: float
best_likelihood: float
best_prefactor: float
total_evaluations: int
valid() → bool

Whether the search actually found a usable point.

gpridge._core.pair_distance_matrix(left: numpy.typing.NDArray[numpy.float64], right: numpy.typing.NDArray[numpy.float64], atoms_config: AtomsConfiguration, lengthscales: numpy.typing.NDArray[numpy.float64]) → numpy.typing.NDArray[numpy.float64]

Return the production inverse-pair-distance matrix between coordinate rows. Initialize atoms_config with initialize_atoms_config first.

class gpridge._core.ARDGridSearch(n_ls_per_dim: int = 10, n_noise: int = 20, n_refine: int = 1, log_ls_min: float = -3.0, log_ls_max: float = 1.0, log_noise_min: float = -10.0, log_noise_max: float = 2.0)

Grid search over ARD lengthscales + noise.

search(targets: numpy.typing.NDArray[numpy.float64], kernel_builder: collections.abc.Callable[[collections.abc.Sequence[float], float], numpy.typing.NDArray[numpy.float64]], n_pairtypes: int) → ARDSearchResult

Search for optimal (lengthscales, noise) using GP likelihood.

class gpridge._core.BMAPrediction

Prediction result from Bayesian model averaging.

mean: numpy.typing.NDArray[numpy.float64]
variance: numpy.typing.NDArray[numpy.float64]
n_models: int
class gpridge._core.BayesianModelAveraging

Bayesian model averaging over hyperparameter grid.

set_grid(log_ls_min: float, log_ls_max: float, n_ls: int, log_noise_min: float, log_noise_max: float, n_noise: int) → None

Configure the hyperparameter grid.

fit(targets: numpy.typing.NDArray[numpy.float64], kernel_builder: collections.abc.Callable[[float, float], tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]], use_tp: bool = False, tp_a: float = 1e-20, tp_b: float = 1e-20) → None

Evaluate likelihoods on the grid and compute posterior weights.

predict(targets: numpy.typing.NDArray[numpy.float64], kernel_builder: collections.abc.Callable[[float, float], tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]]) → BMAPrediction

BMA-averaged prediction at test points.

total_models() → int

Number of models with a stored posterior weight.

weights() → list[float]

Access posterior weights (for testing parallel correctness).

class gpridge._core.EnergyUnit

Bases: enum.IntEnum

Energy unit tag of a model’s training data (no conversion).

NATIVE = 0
EV = 1
HARTREE = 2
KCAL_PER_MOL = 3
KJ_PER_MOL = 4
class gpridge._core.LengthUnit

Bases: enum.IntEnum

Length unit tag of a model’s training data (no conversion).

NATIVE = 0
ANGSTROM = 1
BOHR = 2
NANOMETER = 3
class gpridge._core.DerivativeStatus

Bases: enum.Enum

Outcome of a posterior-derivative call.

OK = 0
INVALID_ARGUMENT = 1
NOT_TRAINED = 2
UNSUPPORTED = 3
OUT_OF_SUPPORT = 4
class gpridge._core.DerivativeOptions

Options of the batched posterior-derivative primitives.

struct_size: int
energy_unit: EnergyUnit
length_unit: LengthUnit
project_rigid: bool
max_energy_std: float
variance_step: float
class gpridge._core.DerivativeReport

Report of a posterior-derivative call. Variances are probabilistic estimates, never certificates.

struct_size: int
status: DerivativeStatus
message: str
energy_unit: EnergyUnit
length_unit: LengthUnit
n_points: int
projected: bool
max_energy_std: float
max_energy_std_point: int
max_translation_residual: float
max_rotation_residual: float
factor_appended: int
ok() → bool

True when the call succeeded.

class gpridge._core.HtstMode

Bases: enum.IntEnum

How an HTST half obtains its Hessian.

REFINED = 0
MEASURED = 1
SURROGATE = 2
class gpridge._core.HtstKind

Bases: enum.IntEnum

Stationary point of a half (ABI 1.20).

MINIMUM = 0
SADDLE = 1
class gpridge._core.HtstStatus

Bases: enum.IntEnum

Outcome of a half (ABI 1.20).

OK = 0
NOT_CONVERGED = 1
WRONG_INDEX = 2
UNAVAILABLE = 3
class gpridge._core.HtstSource

Bases: enum.IntEnum

Where a half’s Hessian came from (ABI 1.20).

REFINED = 0
MEASURED = 1
STENCIL = 2
SURROGATE = 3
CONDITIONED = 4
class gpridge._core.HtstPoint

Bases: enum.IntEnum

Which stationary point of a search a half belongs to.

REACTANT = 0
TRANSITION = 1
PRODUCT = 2
class gpridge._core.HtstOptions

Harmonic prefactor options (gpr_htst_options_t).

struct_size: int
enabled: bool
mode: HtstMode
project_translation: bool
project_rotation: bool
max_measured: int
omega_scale: float
tolerance: float
fd_step: float
variance_step: float
class gpridge._core.HtstHalf

One side of ln nu = ln_sum(minimum) - ln_sum(saddle).

struct_size: int
status: HtstStatus
kind: HtstKind
source: HtstSource
n_coords: int
n_projected: int
n_modes: int
n_negative: int
oracle_calls: int
n_measured: int
converged: bool
ln_sum: float
ln_sum_std: float
imaginary_frequency: float
omega_scale: float
frequencies: numpy.typing.NDArray[numpy.float64]
measured: list[int]
message: str
gpridge._core.HTST_OMEGA_EV_ANGSTROM_AMU: float
class gpridge._core.GaussianProcessRegression

Low-level GP regression class. Most users want gpridge.GaussianProcess instead, which wraps this with an ASE-friendly interface.

initialize(parameters: dict[str, Any], atoms_config: AtomsConfiguration) → None

Initialize the GP model with parameters and atomic configuration.

set_hyperparameters(observations: Observation, atoms_config: AtomsConfiguration, update_sexpat: bool = True, update_const: bool = True, update_prior: bool = True) → None

Set hyperparameters from observations and atomic configuration.

optimize(observations: Observation) → None

Optimize hyperparameters. Releases the GIL during computation.

train_marginal_likelihood(observations: Observation) → dict[str, Any]

Fit by prior-free Gaussian marginal likelihood and return the fit report plus fitted length scales.

append_fixed(observations: Observation, new_observations: Observation) → Observation

Append new rows at fixed hyperparameters via a Cholesky block update and return the combined observation set.

calibrate_forces(held_out: Observation, nominal_probability: float) → dict[str, Any]

Evaluate held-out force residual calibration.

calibrate_loo(nominal_probability: float) → dict[str, Any]

Evaluate closed-form leave-one-out calibration on fitted channels.

update(observations: Observation, new_observations: Observation, atoms_config: AtomsConfiguration) → Observation

Append new observations to a copy of observations and retrain.

calculate_potential(observation: Observation) → None

Predict energy and gradient in physical units for the given observation (in-place).

calculate_variance(observation: Observation) → None

Predict variance in physical units for the given observation (in-place).

predict(positions: numpy.typing.NDArray[numpy.float64]) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Predict energy and gradient arrays for row-major coordinates.

predict_variance(positions: numpy.typing.NDArray[numpy.float64]) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Predict energy and gradient variance arrays for row-major coordinates.

predict_full(positions: numpy.typing.NDArray[numpy.float64]) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Predict energy, gradient, and their variances in one call.

predict_batch(positions: numpy.typing.NDArray[numpy.float64], with_variance: bool = True) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64] | None, numpy.typing.NDArray[numpy.float64] | None]

Batch predict energies, gradients, and optional variances for positions shaped (n_queries, n_coords).

set_uncertainty_mode(mode: UncertaintyMode) → None

Select MAP / BMA / LAPLACE / LAPLACE_SLICE / EB / SVGD as the posterior estimator.

set_use_alpha_k_predict_mean(enabled: bool) → None

Enable the alpha-K contraction for MAP mean prediction.

get_use_alpha_k_predict_mean() → bool

Return whether the alpha-K MAP mean contraction is enabled.

set_use_alpha_k_laplace_mean(enabled: bool) → None

Enable the alpha-K contraction for Laplace-mixture mean prediction.

get_use_alpha_k_laplace_mean() → bool

Return whether the alpha-K Laplace-mixture mean contraction is enabled.

set_laplace_skip_scg_threshold(threshold: float) → None

Set the Laplace shift threshold that skips hyperparameter SCG.

get_laplace_skip_scg_threshold() → float

Return the Laplace shift threshold for skipping SCG.

set_objective_stationarity_skip_auto(enabled: bool) → None

Use the optimizer step tolerance as the stationarity-skip threshold.

get_objective_stationarity_skip_auto() → bool

Return whether the automatic stationarity-skip threshold is enabled.

set_use_training_geometry_handle(enabled: bool) → None

Route hyperparameter objective calls through the cached training geometry handle.

get_use_training_geometry_handle() → bool

Return whether cached training geometry is enabled.

set_profile_predict_mean(enabled: bool) → None

Enable predict-mean timing accumulation.

get_profile_predict_mean() → bool

Return whether predict-mean timing is enabled.

set_profile_energy_split(enabled: bool) → None

Enable energy timing split output.

get_profile_energy_split() → bool

Return whether energy timing splits are enabled.

set_profile_gradient_split(enabled: bool) → None

Enable gradient timing split output.

get_profile_gradient_split() → bool

Return whether gradient timing splits are enabled.

set_log_training_geometry(enabled: bool) → None

Enable training geometry diagnostic logging.

get_log_training_geometry() → bool

Return whether training geometry diagnostic logging is enabled.

set_log_rank_block_cholesky(enabled: bool) → None

Deprecated compatibility setter. True emits a warning and is ignored.

get_log_rank_block_cholesky() → bool

Deprecated compatibility getter; always returns false.

set_scalapack_block_size(block_size: int) → None

Set the requested ScaLAPACK block size.

get_scalapack_block_size() → int

Return the requested ScaLAPACK block size.

set_scalapack_nprow(nprow: int) → None

Set the requested ScaLAPACK process-grid row count.

get_scalapack_nprow() → int

Return the requested ScaLAPACK process-grid row count.

set_cutlass_plugin_path(path: str) → None

Set the CUTLASS GEMM plugin path.

get_cutlass_plugin_path() → str

Return the CUTLASS GEMM plugin path.

set_use_psis_laplace(enabled: bool) → None

Enable PSIS-Laplace importance-weighted variance mixture inside the LAPLACE_SLICE arm.

set_use_psis_deterministic_grid(enabled: bool) → None

Use the deterministic axial-grid sampler for PSIS-Laplace (np-reproducible).

set_use_delta_method(enabled: bool) → None

Enable the analytical INLA-Delta variance estimator (replaces per-call slice / sampling burst).

set_delta_uh_min_diag(v: float) → None

Conditioning gate on the DELTA correction: skip the alpha-K Hessian Laplace term when min(diag(U_H)) < v. Default 1e-6; <= 0 disables.

set_delta_max_ratio(v: float) → None

Magnitude cap on the DELTA correction: per-query delta_var clipped to v * magnSigma2. Default 100.0; <= 0 disables.

set_hssvd_backend(enabled: bool) → None

Enable the HS-SVD stable-basis solver backend.

get_hssvd_backend() → bool

Return whether the HS-SVD stable-basis backend is enabled.

set_rigid_null_deflation(enabled: bool) → None

Enable or disable rigid-motion nullspace deflation on training factorizations.

rigid_null_deflation_enabled() → bool

Return whether rigid-motion nullspace deflation is enabled.

set_disable_output_normalization(enabled: bool) → None

Disable output target normalization for stable-basis runs.

set_rff_features_requested(n_features: int) → None

Set the Random Fourier Feature count for the RFF-routed mean predict path (0 disables; layered ON TOP of LAPLACE_SLICE).

enable_rff_feature_selection(force_tol_fraction: float = 0.0) → None

Select the feature count by held-out validation. A fraction of 0 derives the force tolerance from the gradient noise.

rff_feature_selection_auto() → bool

True when automatic feature selection is enabled.

rff_feature_selection() → RFFFeatureSelection

The stored automatic-selection report.

set_hyperparameter_optimization_mode(mode: HyperparameterOptimizationMode) → None

Select SCG (default) or INLA hyperparameter optimiser.

set_sigma2(sigma2: float, observations: Observation | None = None) → None

Set a positive finite likelihood noise variance and refresh the posterior when observations are provided.

get_sigma2() → float

Fitted physical output-noise variance (sigma2).

n_lengthscales() → int

Number of kernel lengthscale parameters.

fit_iterations() → int

Optimizer iterations the last fit ran: 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.

fit_restarts() → int

Restarts the last fit needed: 1 after a restarted marginal-likelihood fit, otherwise 0.

fit_stop_reason() → str

Why the last fit stopped: budget, library, restored scg point, wall-clock limit, non-finite marginal likelihood, or unset.

predict_hessian(positions: numpy.typing.NDArray[numpy.float64]) → numpy.typing.NDArray[numpy.float64]

Symmetric posterior-mean Hessian (n_coords x n_coords) at positions. A prepared HS-SVD block that does not apply raises UnsupportedError and returns no matrix.

predict_hessian_action(positions: numpy.typing.NDArray[numpy.float64], direction: numpy.typing.NDArray[numpy.float64]) → numpy.typing.NDArray[numpy.float64]

One action of the posterior-mean Hessian: H(positions) @ direction.

predict_energy_variance_interval(positions: numpy.typing.NDArray[numpy.float64]) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Certified energy-variance enclosure (lower, upper) at each row of positions.

noise_floor_report() → NoiseFloorReport

Condition-floored noise, certificate gap and interval noise of the trained model.

prediction_supported(positions: numpy.typing.NDArray[numpy.float64], atoms_config: AtomsConfiguration, observations: Observation) → bool

Whether the trained prediction kernel supports the query geometry.

prediction_factors(positions: numpy.typing.NDArray[numpy.float64]) → tuple[float, float, float, numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]

Return (energy, scale, mean, kstar, weights) for one energy prediction.

get_jitter() → float

Configured numerical diagonal jitter variance.

get_alpha() → numpy.typing.NDArray[numpy.float64]

Owned copy of the posterior mean weights.

Length is n_obs * (1 + n_coords). The array does not alias model storage. Raises NotTrainedError (a ValueError) when the model has no weight vector.

get_length_scales() → list[float]

Fitted Sexpat length scales, one per pair type.

set_length_scales(length_scales: collections.abc.Sequence[float]) → None

Set the Sexpat length scales, one per pair type.

get_magn_sigma2() → float

Fitted signal variance of the Sexpat kernel.

set_magn_sigma2(magn_sigma2: float) → None

Seed the Sexpat signal variance.

get_noise_sigma2() → float

Fitted likelihood noise variance.

set_noise_sigma2(sigma2: float) → None

Set sigma2 value.

set_optimize_noise(enabled: bool) → None

Let the optimizer move the likelihood noise variance (NLML only).

get_hyperparameter_objective_mode() → HyperparameterObjectiveMode

The objective the hyperparameters are fitted on.

set_hyperparameter_objective_mode(mode: HyperparameterObjectiveMode) → None

Objective the hyperparameters are fitted on.

set_model_profile(profile: GPModelProfile) → None

Apply a kernel/prior profile (chemgp, gprd_zbl, extended).

get_use_ff_prior_mean() → bool

Whether the Teng/Bao first-level Morse force-field prior mean is enabled.

set_use_ff_prior_mean(use: bool) → None

Subtract the Teng Morse force-field prior mean from the targets.

set_use_zbl_prior_mean(use: bool) → None

Subtract the ZBL repulsive prior mean from the targets.

set_use_ls_prior(use: bool) → None

Karvonen length-scale prior on the fit (gprn –ls-prior).

refresh_full_data_posterior_if_objective_stationary(observations: Observation) → tuple[bool, float]

Stationarity check of the fitted objective on new data.

Returns (held_or_stepped, shift_norm).

property failed_optimizer: bool

True if the hyperparameter optimizer failed to converge.

get_num_potential_calls() → int

Return the number of potential evaluations during optimization.

mean_hessian_batch(points: numpy.typing.NDArray[numpy.float64], options: DerivativeOptions = ..., residuals: bool = False) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64] | None, DerivativeReport]

Exact posterior-mean Hessians (B, d, d) at the rows of points.

mean_hessian_action_batch(points: numpy.typing.NDArray[numpy.float64], vectors: numpy.typing.NDArray[numpy.float64], options: DerivativeOptions = ...) → tuple[numpy.typing.NDArray[numpy.float64], DerivativeReport]

Posterior-mean Hessian actions for vectors of shape (B, k, d).

hessian_bilinear_covariance(points: numpy.typing.NDArray[numpy.float64], left: numpy.typing.NDArray[numpy.float64], right: numpy.typing.NDArray[numpy.float64], options: DerivativeOptions = ...) → tuple[numpy.typing.NDArray[numpy.float64], DerivativeReport]

Posterior covariance of v_i^T H w_j per point (an estimate).

hessian_trace_variance(points: numpy.typing.NDArray[numpy.float64], weights: numpy.typing.NDArray[numpy.float64], options: DerivativeOptions = ...) → tuple[numpy.typing.NDArray[numpy.float64], DerivativeReport]

Posterior variance of tr(A dH) per point (an estimate).

posterior_variance_batch(points: numpy.typing.NDArray[numpy.float64], options: DerivativeOptions = ...) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], DerivativeReport]

Posterior energy and gradient variance at the rows of points.

condition_fixed(training: Observation, added: Observation, queries: numpy.typing.NDArray[numpy.float64], options: DerivativeOptions = ..., hessian: numpy.typing.NDArray[numpy.float64] | None = None, hvp: collections.abc.Callable[[numpy.typing.NDArray[numpy.float64]], numpy.typing.NDArray[numpy.float64]] | None = None) → tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], DerivativeReport]

Condition on added at fixed hyperparameters, predict at queries.

class gpridge._core.StudentTProcessRegression

Bases: GaussianProcessRegression

Student-t process variant with heavier-tailed observation noise.

set_hyperprior_parameters(a: float, b: float) → None

Set inverse-gamma hyperprior shape (a) and scale (b).

get_hyperprior_a() → float

Get inverse-gamma shape parameter.

get_hyperprior_b() → float

Get inverse-gamma scale parameter.

get_tp_prefactor() → float

Get the TP prefactor (signal variance estimate from hyperprior).

class gpridge._core.GPNEBConfig

Configuration for the low-level GP-NEB driver.

mode: NEBMode
linalg_mode: LinalgMode
conv_tol: float
max_outer_iter: int
band_refinement_max: int
band_certificate_force_scale: float
band_midpoint_certificate: bool
ci_index_certificate: bool
force_stop_certificate: bool
vibrational_stencil: VibrationalStencil
band_leak_bound: bool
first_attempt_wall_seconds: float
max_inner_iter: int
inner_step_size: float
spring_constant: float
climbing_image: bool
climbing_image_converged_only: bool
ci_activation_tol: float
ci_activation_factor: float
unc_convergence: float
restricted_variance_acquisition: bool
use_relative_neighborhood_graph: bool
n_atoms: int
remove_molecular_rigid_motion: bool
use_idpp: bool
use_sidpp: bool
sidpp_alpha: float
use_geometric_spring: bool
acquisition: AcquisitionType
use_three_phase_picker: bool
imspe_refit_skip_relative_tol: float
ucb_kappa: float
evals_per_iter: int
use_triplet: bool
seed: int
verbose: bool
has_initial_path: bool
initial_path: numpy.typing.NDArray[numpy.float64]
uncertainty_mode: UncertaintyMode
use_psis_laplace: bool
use_psis_deterministic: bool
use_delta_method: bool
rff_features: int
rff_force_tol_fraction: float
disable_output_normalization: bool
use_hssvd_solver: bool
use_hssvd_objective_contractions: bool
hssvd_dual_chop_tol: float
hssvd_dual_randomized_sketch: int
hssvd_dual_lapack_rrr: bool
hssvd_local_active_set_size: int
hssvd_local_posterior_active_set_size: int
per_image_min_train: int
per_image_knn: int
scalapack_block_size: int
scalapack_nprow: int
theta_shift_skip_tol: float
theta_shift_skip_auto: bool
hyperparameter_mode: HyperparameterOptimizationMode
hyperparameter_objective: HyperparameterObjectiveMode
model_profile: GPModelProfile
seed_full_chain: bool
max_inner_iter_gp: int
oie_fixed_point_measured_step: bool
oie_fixed_point_reparam: bool
oie_hook_reparam: bool
lbfgs_max_move: float
lbfgs_memory: int
band_engine: BandEngineKind
rgsaddle_library: str
lbfgs_inverse_curvature: float
lbfgs_finite_difference: float
lbfgs_auto_scale: bool
lbfgs_angle_reset: bool
lbfgs_distance_reset: bool
lbfgs_newton_agreement: float
reparam_period: int
reparam_tol: float
inner_conv_tol: float
gp_tol_divisor: float
inner_unc_relative: float
trust_metric: DistanceMetricType
use_adaptive_trust: bool
trust_radius: float
trust_adaptive_A: float
trust_adaptive_floor: float
trust_t_min: float
trust_delta_explore: float
trust_half_life: int
trust_ratio_at_limit: float
scalefree_trust: bool
scalefree_tau: float
use_ls_prior: bool
principled_nugget: bool
use_rigid_null_deflation: bool
kappa_max: float
convergence_force_norm: ConvergenceNorm | None
spring_constant_min: float
cell: list[float]
atomic_numbers: list[int]
frozen_positions: numpy.typing.NDArray[numpy.float64]
frozen_atomic_numbers: list[int]
moving_atoms: list[bool]
gp_local_fraction: float
gp_local_radius: float
gp_local_window: int
gp_local_trust: float
gp_local_inner_max: int
gp_local_refit_iters: int
gp_local_inner_tol_factor: float
gp_local_phase: bool
gp_local_refit_every: int
gp_local_noise: float
gp_local_pair_cutoff: float
gp_local_pair_spacing: float
gp_local_far_trust: float
gp_local_far_refresh: float
gp_local_initial_sweep: bool
gp_local_batch: int
gp_local_batch_growth: int
gp_local_batch_max: int
gp_local_sweep_images: int
gp_local_jacobi: bool
gp_local_grow_radius: float
gp_local_safeguard: bool
gp_local_keep_memory: bool
gp_local_residual: bool
gp_local_pair_split: float
gp_local_pair_tail_refresh: float
gp_local_cycles: int
gp_local_sweep: bool
gp_setup: collections.abc.Callable[Ellipsis, None] | None
class gpridge._core.OCINEBConfig

Configuration for the low-level OCINEB dimer-burst phase.

use_mmf: bool
rg_minmode_dimer: bool
trigger_force: float
trigger_factor: float
max_steps: int
alignment_cos_tol: float
force_tolerance: float
dimer_max_phases: int
dimer_max_inner_iter: int
dimer_max_rot_iter: int
dimer_eval_image1: bool
keep_force_improving_burst: bool
initial_orient: numpy.typing.NDArray[numpy.float64]
perturb_along_tangent: float
max_burst_displacement: float
dimer_variance_tau_rel: float
dimer_variance_tau_abs: float
dimer_imspe_soft_threshold: float
dimer_imspe_history_size: int
class gpridge._core.GPNEBStopReason

Bases: enum.IntEnum

Terminal stop reason recorded on GPNEBResult.

Unspecified = Ellipsis
Converged = Ellipsis
IterationBudget = Ellipsis
WallClockLimit = Ellipsis
class gpridge._core.GPNEBResult

Result of a gp_neb run. The .path holds the converged image chain.

property converged: bool

True when the band met the force criterion.

property stop_reason: GPNEBStopReason

Terminal stop reason of the search.

property convergence_status: str

"force_tolerance", "model_noise_floor" or "not_converged".

property hssvd_factorizations: int

Stable-basis factorizations performed by the band GP.

property cholesky_factorizations: int

Dense Cholesky factorizations of that GP’s training covariance.

property oracle_calls: int

All oracle evaluations. They cover the endpoints, the initial design, the outer iterations and the validation, which includes the index certificate.

property prior_observations: int

Rows loaded from a seed. They are not included in oracle_calls.

property oracle_calls_endpoints: int

Evaluations that measured the two endpoints.

property oracle_calls_initial: int

Evaluations of the initial design.

property oracle_calls_outer: int

Evaluations made by the outer loop.

property oracle_calls_validation: int

Evaluations of the post-convergence validation, including the index certificate.

property oracle_calls_to_convergence: int

Oracle evaluations of the search. The index certificate is not included.

property certified: bool

True when the band index certificate holds.

property index: int

Negative-mode count of the band index certificate.

property n_certificate_calls: int

True oracle evaluations the certificate spent. They are included in oracle_calls and not in oracle_calls_to_convergence.

property index_checked: bool

The vibrational-index gate ran on this result.

property index_refused: bool

A force-quiet point failed the index-1 gate and no budget remains.

property index_continue: bool

The gate stepped the climbing image; the caller resumes the search.

property index_unresolved: int

The index_unresolved member of GPNEBResult.

property index_resolution: float

The index_resolution member of GPNEBResult.

property index_gate_true_calls: int

True-surface force evaluations spent by the gate.

property fixed_theta_refreshes: int

The fixed_theta_refreshes member of GPNEBResult.

property returned_true_force: float

Oracle force, in the stopping norm, at the geometry in max_energy_image.

property force_stop_hand_off: bool

The climbing image and any measured stencil are the saddle stage’s starting point.

property force_stop_deferred: bool

The saddle owns the index. This stage did not measure a stencil.

property force_stop_inconclusive: bool

The stencil was measured and did not resolve an index.

property force_stop_displacement: float

The force_stop_displacement member of GPNEBResult.

property force_stop_center_reused: bool

The force_stop_center_reused member of GPNEBResult.

property force_stop_wall_s: float

The force_stop_wall_s member of GPNEBResult.

property force_stop_negative_upper: float

A bound that fixed the index (certifyAdaptiveStencilIndex).

property force_stop_positive_lower: float

A bound that fixed the index (certifyAdaptiveStencilIndex).

property force_stop_negative_pair_upper: float

A bound that fixed the index (certifyAdaptiveStencilIndex).

property force_stop_refinement_recorded: bool

The force_stop_refinement_recorded member of GPNEBResult.

property force_stop_refinement_higher_order: bool

The force_stop_refinement_higher_order member of GPNEBResult.

property outer_iterations: int

Outer iterations completed.

property max_energy_image: int

Index of the highest-energy image, counting the reactant as 0.

property barrier_energy: float

Highest image energy minus the reactant energy, in eV.

property reverse_barrier_energy: float

Reverse barrier, E_saddle - E_product (image[N-1]).

property ci_barrier_energy: float

The band’s own saddle, retained when dimer refinement later overwrites barrier_energy / reverse_barrier_energy with the refined saddle’s.

property ci_reverse_barrier_energy: float

The band’s own reverse barrier, retained when dimer refinement overwrites reverse_barrier_energy.

property max_force_history: list[float]

Largest band force after each outer iteration, in eV/Angstrom.

property path: NEBPath | None

The relaxed band, or None when the run produced no path.

image_energies() → numpy.typing.NDArray[numpy.float64]

Energy of every image in eV, endpoints included.

image_positions(i: int) → numpy.typing.NDArray[numpy.float64]

Flat positions of image i in Angstrom; the reactant is 0.

Raises IndexError unless 0 <= i < len(image_energies()).

prefactor(point: HtstPoint) → HtstHalf

The HTST half this search computed at point.

Raises UnsupportedError when this search did not compute that point. A later search does not replace it.

class gpridge._core.OCINEBResult

Result of a run_ocineb run: NEB summary plus dimer accounting.

property neb_result: GPNEBResult

The NEB result of the run.

property dimer_ran: bool

True when a dimer burst ran.

property dimer_converged: bool

True when the dimer reported convergence.

property dimer_oracle_calls: int

Oracle evaluations spent in dimer bursts.

property mmf_bursts: int

Number of minimum-mode-following bursts that ran.

property barrier_energy: float

Barrier energy of the run in eV.

property ci_index_evaluated: bool

Climbing-image index certificate (see certifyClimbingImageIndex).

property refinements: int

Number of band refinements (image doublings) folded into this result.

property band_certificate_evaluated: bool

Band discretization certificate on the returned band (leak and chord-perpendicular residual at the climbing-image neighbours).

property band_certificate_holds: bool

Whether the band discretization certificate holds.

property band_certificate_leak: float

Leak of the band discretization certificate at the climbing-image neighbours.

property band_certificate_residual: float

Chord-perpendicular residual of the band discretization certificate at the climbing-image neighbours.

property band_midpoint_evaluated: bool

Whether certifyBandMidpoints evaluated the returned band.

property band_midpoint_holds: bool

Whether each segment midpoint energy upper bound is at most the climbing-image energy.

property band_midpoint_excess: float

Mean E_mid - E_ci (eV) on the segment with the highest energy upper bound.

property band_midpoint_segment: int

Index of the segment with the highest energy upper bound, or -1 when none.

property ci_index_certified: bool

Climbing-image index certificate (see certifyClimbingImageIndex).

property ci_index_attempts: int

Climbing-image index certificate (see certifyClimbingImageIndex).

property ci_index_oracle_calls: int

Climbing-image index certificate (see certifyClimbingImageIndex).

property ci_index_curvature1: float

Climbing-image index certificate (see certifyClimbingImageIndex).

property ci_index_curvature2: float

Climbing-image index certificate (see certifyClimbingImageIndex).

property ci_index_verified: bool

Climbing-image index certificate (see certifyClimbingImageIndex).

property ci_index_residual1: float

Climbing-image index certificate (see certifyClimbingImageIndex).

property ci_index_residual2: float

Climbing-image index certificate (see certifyClimbingImageIndex).

class gpridge._core.PeriodicBandDefaults

Defaults of the periodic local band, shared with the C API.

n_images: int
fmax: float
steps: int
max_move: float
spring_constant: float
climb: bool
seed: int
verbose: bool
config: GPNEBConfig
gpridge._core.periodic_band_defaults() → PeriodicBandDefaults

The periodic local band defaults.

class gpridge._core.HssvdBackend

Bases: enum.IntEnum

Posterior solver on a model config. Default keeps library HS-SVD.

Default = 0
Hssvd = 1
Cholesky = 2
class gpridge._core.PeriodicBandInitial

Bases: enum.IntEnum

Initial path construction for periodic local bands.

Linear = 0
Idpp = 1
Sidpp = 2
class gpridge._core.LocalBandConfig

Local-band configuration mirroring gpr_local_band_config_t.

fraction: float
radius: float
window: int
trust: float
inner_max: int
refit_iters: int
inner_tol_factor: float
phase: int
refit_every: int
noise: float
pair_cutoff: float
pair_spacing: float
far_trust: float
far_refresh: float
initial_sweep: int
batch: int
batch_growth: int
batch_max: int
sweep_images: int
jacobi: int
grow_radius: float
safeguard: int
keep_memory: int
residual: int
pair_split: float
pair_tail_refresh: float
cycles: int
sweep: int
force_stop_certificate: int
certificate_step: float
vibrational_stencil: int
class gpridge._core.PeriodicBandConfig

Periodic local-band configuration mirroring gpr_periodic_band_config_t.

fmax: float
spring_constant: float
max_move: float
steps: int
climb: int
initial: int
seed: int
verbose: int
convergence_norm: int
gpridge._core.status_name(status: int) → str

Short static name of a GPR_* status code.

gpridge._core.neb_request_index_certificate(enable: bool, step: float = 0.0) → None

Request that the next NEB search on this thread certify the stopped band.

On the periodic band searches a nonzero step takes precedence over LocalBandConfig.certificate_step.

gpridge._core.neb_request_sidpp(enable: bool) → None

Select SIDPP or classic IDPP for the next NEB search on this thread.

The periodic band searches take the initializer from PeriodicBandConfig.initial alone, so the request has no effect on them. gp_neb and run_ocineb take theirs from GPNEBConfig.use_sidpp; they discard a pending SIDPP request.

gpridge._core.neb_request_vibrational_stencil(mode: int) → None

Stencil of the next non-local NEB search on this thread.

0 measures every coordinate. 1 measures the vibrational directions and can resolve a borderline mode that 0 leaves unresolved. A local or periodic band takes LocalBandConfig.vibrational_stencil instead. gp_neb and run_ocineb take GPNEBConfig.vibrational_stencil and discard a pending request.

gpridge._core.neb_search_potential(potential: PotentialWrapper, atomic_numbers: numpy.typing.NDArray[numpy.int32], box: numpy.typing.NDArray[numpy.float64], initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int, config: GPNEBConfig = ...) → GPNEBResult

Run gpr_neb_search_potential through a PotentialWrapper.

gpridge._core.neb_search_gp_potential(potential: PotentialWrapper, atoms_config: AtomsConfiguration, initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int, config: GPNEBConfig = ..., box: numpy.typing.NDArray[numpy.float64] | None = None, gp_params: dict[str, Any] | None = None) → GPNEBResult

Run gpr_neb_search_gp_potential through a PotentialWrapper.

gpridge._core.neb_search_local(oracle: collections.abc.Callable[[numpy.typing.NDArray[numpy.float64]], tuple[float, numpy.typing.NDArray[numpy.float64]]], initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int = 8, atoms_config: AtomsConfiguration | None = None, box: numpy.typing.NDArray[numpy.float64] | None = None, config: GPNEBConfig | None = None, local_config: LocalBandConfig | None = None, gp: Any | None = None, init_data: Any | None = None) → GPNEBResult

Run gpr_neb_search_local with optional atoms_config, box, config, and LocalBandConfig. gp and init_data seed the search.

gpridge._core.neb_search_local_potential(potential: PotentialWrapper, initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int = 8, atomic_numbers: numpy.typing.NDArray[numpy.int32] | None = None, box: numpy.typing.NDArray[numpy.float64] | None = None, atoms_config: AtomsConfiguration | None = None, config: GPNEBConfig | None = None, local_config: LocalBandConfig | None = None) → GPNEBResult

Run gpr_neb_search_local_potential through a PotentialWrapper.

gpridge._core.neb_search_periodic(oracle: collections.abc.Callable[[numpy.typing.NDArray[numpy.float64]], tuple[float, numpy.typing.NDArray[numpy.float64]]], initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int = 8, atoms_config: AtomsConfiguration | None = None, box: numpy.typing.NDArray[numpy.float64] | None = None, periodic_config: PeriodicBandConfig | None = None, local_config: LocalBandConfig | None = None, gp: Any | None = None, init_data: Any | None = None) → GPNEBResult

Run gpr_neb_search_periodic with optional atoms_config, box, PeriodicBandConfig, and LocalBandConfig. gp and init_data seed the search.

gpridge._core.neb_search_periodic_potential(potential: PotentialWrapper, initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int = 8, atomic_numbers: numpy.typing.NDArray[numpy.int32] | None = None, box: numpy.typing.NDArray[numpy.float64] | None = None, atoms_config: AtomsConfiguration | None = None, periodic_config: PeriodicBandConfig | None = None, local_config: LocalBandConfig | None = None) → GPNEBResult

Run gpr_neb_search_periodic_potential through a PotentialWrapper.

gpridge._core.gp_neb(oracle: collections.abc.Callable[[numpy.typing.NDArray[numpy.float64]], tuple[float, numpy.typing.NDArray[numpy.float64]]], initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int, config: GPNEBConfig = ..., gp_params: dict[str, Any] | None = None, atoms_config: AtomsConfiguration | None = None, policy: object | None = None, gp: Any | None = None, init_data: Any | None = None) → GPNEBResult

Run the gpr::neb::gpNEB driver. Config uses GPNEBConfig field initializers, not the gprn CLI defaults. policy is a training policy, or None for the engine’s own decisions. gp and init_data seed the search.

gpridge._core.run_ocineb(oracle: collections.abc.Callable[[numpy.typing.NDArray[numpy.float64]], tuple[float, numpy.typing.NDArray[numpy.float64]]], initial: numpy.typing.NDArray[numpy.float64], final_state: numpy.typing.NDArray[numpy.float64], n_images: int, config: GPNEBConfig = ..., oci_config: OCINEBConfig = ..., gp_params: dict[str, Any] | None = None, atoms_config: AtomsConfiguration | None = None, policy: object | None = None, gp: Any | None = None, init_data: Any | None = None) → OCINEBResult

Run gpr::neb::runOCINEB – GP-NEB with the interleaved MMF dimer burst. policy is a training policy, or None for the engine’s own decisions.

class gpridge._core.AtomicDimer

Single-saddle dimer search driver. Construct with no arguments, call initialize() with a parameter dict and the initial data, then execute() with a PotentialWrapper; query results via the get_* methods.

initialize(parameters: dict[str, Any], initial_data: Observation, middle_point: Observation, initial_orientation: numpy.typing.NDArray[numpy.float64], atoms_config: AtomsConfiguration) → None

Set up the dimer with a parameter dict and initial data.

execute(potential: PotentialWrapper) → None

Run the dimer search. Releases the GIL while it runs.

Raises InvalidArgumentError when the atoms configuration has no moving-atom set or the dimer separation is not positive.

set_training_policy(policy: object | None) → None

Install a training policy for execute. None restores the engine.

get_final_gradient_at_mid_point() → numpy.typing.NDArray[numpy.float64]

Flat gradient dE/dR at the final mid-point, in eV/Angstrom.

The negative of the force. The core stores gradients, and ASE forces are the negation of this array.

get_final_force_at_mid_point() → numpy.typing.NDArray[numpy.float64]

Deprecated alias of get_final_gradient_at_mid_point().

Despite the name it returns the gradient, not the force, and emits a DeprecationWarning.

get_final_coord_of_mid_point() → numpy.typing.NDArray[numpy.float64]

Flat coordinates of the final mid-point, in Angstrom.

get_total_force_calls() → int

Number of true potential evaluations.

get_total_gpr_force_calls() → int

Number of surrogate evaluations.

get_iterations() → int

Outer iterations (relaxation phases) completed.

get_final_energy() → float

Energy at the final mid-point in eV, relative to the zero level.

The zero level is the first measured energy. Add get_energy_zero_level() for the absolute energy.

get_energy_zero_level() → float

Energy in eV that the dimer measures its energies from.

get_final_curvature() → float

Curvature along the dimer axis at the end of the search, in eV/Angstrom^2.

get_converged() → bool

True when the true force criterion is met and the index stencil at that point measures exactly one negative mode.

set_max_oracle_calls(calls: int) → None

Budget of true potential evaluations.

The budget is never exceeded: the search stops unconverged before a call that would spend more. Zero or less leaves the search unbounded by calls.

set_max_wall_seconds(seconds: float) → None

Set one wall-clock deadline for the dimer search and its oracle calls. Non-positive values disable the deadline.

get_force_stop_certified() → bool

True when the index stencil at the force stop measured one negative mode.

get_force_stop_certificate_calls() → int

True potential evaluations the force-stop index stencil spent.

set_vibrational_stencil(mode: VibrationalStencil | str) → None

Choose the force-stop stencil.

"full" measures every coordinate. "vibrational" measures only the vibrational directions and can resolve a borderline mode that "full" leaves unresolved. A lone atom is measured in every coordinate either way.

get_termination_reason() → str

Why the search stopped, as one of "force_converged", "measured_non_descent", "degenerate_probe", "measured_index_zero", "uninformative_rotation", "alignment_loss", "iteration_budget", "interatomic_collapse", "oracle_budget", "wall_clock_limit", "uncertified_force_stop", "invalid_parameters", "invalid_atoms_configuration" or "unspecified".

restart_along_weak_mode(direction: numpy.typing.NDArray[numpy.float64], length: float, measured_rows: Observation, potential: PotentialWrapper, cartesian_hessian: numpy.typing.NDArray[numpy.float64] | None = None) → bool

From a converged midpoint whose weak modes the complete stencil cannot certify positive (gprd –weak-mode-continuations): move length along the unit Cartesian direction, signed so the curvature rises, measure the point, and keep the refinement rows. The next execute() starts there. Releases the GIL.

refine_saddle_from_measured_hessian(cartesian_hessian: numpy.typing.NDArray[numpy.float64], potential: PotentialWrapper) → bool

From a converged midpoint with a soft second negative mode: partitioned rational-function steps on the oracle from the measured Hessian (eV/A^2) until the model has index one and the force is inside the tolerance. Releases the GIL.

restart_from_higher_order_point(cartesian_hessian: numpy.typing.NDArray[numpy.float64], kick: numpy.typing.NDArray[numpy.float64], measured_rows: Observation, potential: PotentialWrapper) → bool

From a converged higher-order saddle: keep the measured rows along its weak negative mode, refit, and restart the order-one search one stencil separation along kick. Releases the GIL.

get_gpr_model() → GaussianProcessRegression | None

The surrogate the search used, or None.

set_profile_dimer_times(enabled: bool) → None

Enable dimer phase timing output.

get_profile_dimer_times() → bool

Return whether dimer phase timing output is enabled.

get_active_set_change_count() → int

Number of times activateFrozenAtoms grew the active frozen set (the bloat / stale-history stressor; CuH2-step demonstrator).

get_active_frozen_count() → int

Current number of active frozen atoms.

atoms_config: AtomsConfiguration
gpridge._core.set_linalg_mode(mode: str) → None

Select the distributed factorization for the whole process.

"reproducible" (the default) uses tile-ordered kernels that give the same bits at every rank and thread count. "library" uses ScaLAPACK/SLATE with threaded BLAS. 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 (gprn --linalg-mode). Any other name raises InvalidArgumentError, a ValueError.

gpridge._core.linalg_mode() → str

The selected distributed factorization, "reproducible" or "library".

gpridge._core.set_linalg_threads(threads: int) → None

Set the dense linear-algebra thread count (gprn --linalg-threads).

Call it before building models. It also sets the OpenMP team. A value below 1 raises InvalidArgumentError.

gpridge._core.set_training_product(spec: str) → None

‘’ (native), ‘scheme2:fp64[…]’, ‘scheme2:int8[…]’ or a library path (gprn –training-product-library). ValueError for a malformed specification, RuntimeError when a library or provider is missing.

gpridge._core.training_product_configured() → bool

True when a Scheme II engine or a product library is selected.

gpridge._core.check_model_package(path: str) → None

RuntimeError when the AOTInductor package needs a CPU extension the host lacks.

gpridge._core.backend_name() → str

Compiled linear-algebra backend, such as "eigen" or "scalapack".

gpridge._core.abi_report() → list[str]

One [startup] abi ... line per native library.

A line gives the ABI stamp of the header that gpridge was built against, the stamp of the loaded library, and whether they agree.

gpridge._core.component_registry() → dict[str, Any]

Canonical runtime component registry, its SHA-256, and components.

gpridge._core.check_abi() → None

Raise ABIError naming both stamps when a loaded native library does not match the header that gpridge was built against.

class gpridge._core.SecantHessianMethod

Bases: enum.IntEnum

True-gradient secant update. BFGS keeps positive curvature and is the only method a minimization Newton seed accepts. SR1 and Bofill keep indefinite curvature.

BFGS = 0
SR1 = 1
Bofill = 2
class gpridge._core.SecantSeedStatus

Bases: enum.IntEnum

Why a secant Newton step was or was not used.

Seeded = 0
NoAcceptedPair = 1
DimensionMismatch = 2
NoResolvedCurvature = 3
NoCurrentDirection = 4
NotPositiveDefinite = 5
class gpridge._core.SecantHessianConfig

True-force secant curvature for gp_minimize. Every switch is off by default. quadratic_prior_mean installs the accepted secant as the GP prior mean and requires a finite oracle energy at the reference geometry.

method: SecantHessianMethod
consistency_check: bool
quadratic_prior_mean: bool
seed_curvature: bool
consistency_relative_tolerance: float
finite_difference_step: float
class gpridge._core.MinimizationConfig

Configuration for GP-accelerated geometry minimization. max_iter bounds outer surrogate-relaxation cycles of up to max_inner_steps inner surrogate steps each (default 200, must be >= 1).

trust_radius: float
conv_tol: float
max_iter: int
max_inner_steps: int
max_oracle_calls: int
gp_train_iter: int
n_initial_perturb: int
perturb_scale: float
max_move: float
max_training_points: int
fps_history: int
jitter_sigma2: float
use_hssvd_solver: bool
verbose: bool
seed: int
secant: SecantHessianConfig
class gpridge._core.MinimizationResult

Result of gp_minimize. x_final, e_final, and g_final are an exact oracle evaluation at x_final; total_iterations counts inner surrogate steps taken across outer cycles.

property x_final: numpy.typing.NDArray[numpy.float64]

x_final, e_final and g_final are exact oracle values from an evaluation at x_final (never surrogate predictions or merged/averaged session rows).

property e_final: float

x_final, e_final and g_final are exact oracle values from an evaluation at x_final (never surrogate predictions or merged/averaged session rows).

property g_final: numpy.typing.NDArray[numpy.float64]

x_final, e_final and g_final are exact oracle values from an evaluation at x_final (never surrogate predictions or merged/averaged session rows).

property converged: bool

When converged, they are an oracle evaluation whose gradient norm is below conv_tol; otherwise they are the lowest-energy finite oracle evaluation of the run.

property oracle_calls: int

The oracle_calls member of MinimizationResult.

property prior_observations: int

Rows supplied by the caller. They are not included in oracle_calls.

property total_iterations: int

Inner surrogate steps taken across outer cycles.

property secant_pairs: int

Accepted true-force secant pairs.

property secant_update_failures: int

Moved geometries whose secant update was refused.

property finite_difference_hvp_calls: int

Forward force probes bought after a secant consistency mismatch.

property secant_curvature_seed_steps: int

Inner steps that applied a secant Newton factor.

property secant_curvature_seed_refusals: int

Inner steps whose secant Newton factor was refused.

property last_secant_seed_status: SecantSeedStatus

Status of the latest secant Newton seed.

property last_secant_relative_error: float

Relative mismatch of the latest secant consistency comparison.

property energy_trajectory: list[float]

The energy_trajectory member of MinimizationResult.

class gpridge._core.PolicyState

Read-only search state passed to a training policy. iteration is the inner surrogate step count for gp_minimize (shared across oracle and hyperparameter-retraining hooks) and the outer iteration index for NEB and dimer searches.

kind: str
role: str
iteration: int
oracle_calls: int
training_size: int
hyperparameter_refits: int
image_index: int
posterior_variance: float
force_variance: float
trust_radius: float
distance_to_training: float
engine_would_call_oracle: bool
engine_would_retrain: bool
engine_would_rebuild_factor: bool
within_trust: bool
surrogate_proposes_stop: bool
property positions: numpy.typing.NDArray[numpy.float64]

Copy of the candidate coordinates, or an empty vector.

property hyperparameters: numpy.typing.NDArray[numpy.float64]

Copy of the packed hyperparameters, or an empty vector.

class gpridge._core.PolicyCandidate

One measured row offered to select_training_points.

positions: numpy.typing.NDArray[numpy.float64]
energy: float
gradient: numpy.typing.NDArray[numpy.float64]
posterior_variance: float
gpridge._core.minimize_request_max_inner_steps(max_inner_steps: int) → None

Set the inner surrogate L-BFGS step cap for the next C API gpr_minimize call on this thread (must be >= 1). gp_minimize reads MinimizationConfig.max_inner_steps directly and discards any request pending when it starts.

gpridge._core.gp_minimize(oracle: collections.abc.Callable[[numpy.typing.NDArray[numpy.float64]], tuple[float, numpy.typing.NDArray[numpy.float64]]], x_init: numpy.typing.NDArray[numpy.float64], atoms_config: AtomsConfiguration, config: MinimizationConfig = ..., policy: object | None = None, gp: Any | None = None, init_data: Any | None = None) → MinimizationResult

Run GP-accelerated geometry minimization. policy is a training policy, or None for the engine’s own decisions. gp and init_data are prior observations and are not counted as oracle calls.

gpridge._core.save_gp_state(path: str, gp: GaussianProcessRegression, observations: Observation, atoms: AtomsConfiguration) → None

Write a trained GP to gp-state.npz.

gpridge._core.load_gp_observations(path: str) → Observation

Read the observation rows of a gp-state.npz file.

gpridge._core.apply_saved_gp_state(gp: GaussianProcessRegression, path: str) → None

Install the fitted kernel of a gp-state.npz onto an initialized model.

gpridge._core.train_phase_reset() → None

Zero the train-phase wall-time accumulators.

gpridge._core.train_phase_read() → dict[str, float]

Read the five train-phase wall-time accumulators.

gpridge._core.train_phase_read_leaves() → dict[str, float]

Read the ten train-phase leaf accumulators.

gpridge._core.set_library_serial(enabled: bool) → None

Select Eigen serial factor/solves (True) or OpenMP panel kernels (False).

gpridge._core.build_info() → dict[str, str]

Digest and SOURCE_DATE_EPOCH compiled from gpr_sbom_digest.h.

gpridge._core.version_components() → tuple[int, int, int]

Return (major, minor, patch) of the loaded library.

gpridge._core.abi_version() → tuple[int, int]

Return (major, minor) of the loaded library’s C ABI.

gpridge._core.backend_requires_mpi() → bool

True if the compiled linear-algebra backend requires MPI_Init.

gpridge._core.mpi_initialized() → bool

True if MPI_Init has been called.

gpridge._core.mpi_world_rank() → int

MPI rank in MPI_COMM_WORLD, or 0 without MPI.

gpridge._core.mpi_world_size() → int

MPI size of MPI_COMM_WORLD, or 1 without MPI.

gpridge._core.omp_max_threads() → int

OpenMP thread budget for this process.

gpridge._core.potential_lj(positions: numpy.typing.NDArray[numpy.float64], n_atoms: int, epsilon: float = 1.0, sigma: float = 1.0) → tuple[float, numpy.typing.NDArray[numpy.float64]]

Evaluate Lennard-Jones energy and gradient.

gpridge._core.potential_muller_brown(xy: numpy.typing.NDArray[numpy.float64]) → tuple[float, numpy.typing.NDArray[numpy.float64]]

Evaluate Muller-Brown energy and gradient.

gpridge._core.potential_leps(r: numpy.typing.NDArray[numpy.float64]) → tuple[float, numpy.typing.NDArray[numpy.float64]]

Evaluate LEPS collinear potential energy and gradient.

gpridge._core.canonical_dimer_parameters(report_level: int = 1) → dict[str, Any]

The dimer settings gprd runs with, as a parameter dict.

report_level sets the verbosity of the C++ report.

gpridge._core.initialize_atoms_config(atoms_config: AtomsConfiguration, atom_types: numpy.typing.NDArray[numpy.uint32], R_init: numpy.typing.NDArray[numpy.float64], actdist_fro: float, n_atom_types: int) → None

Fully initialize an AtomsConfiguration’s internal structures.

Populates atoms_mov, atoms_froz_inactive, pairtype, etc. after the caller has set positions / is_frozen / id / atomic_nrs.

gpridge._core.htst_half_from_hessian(hessian: numpy.typing.NDArray[numpy.float64], x: numpy.typing.NDArray[numpy.float64], kind: HtstKind, options: HtstOptions = ..., masses: numpy.typing.NDArray[numpy.float64] | None = None) → HtstHalf

HTST half of a caller-supplied Hessian (source MEASURED).

gpridge._core.htst_half(x: numpy.typing.NDArray[numpy.float64], kind: HtstKind, model: GaussianProcessRegression | None = None, oracle: collections.abc.Callable[[numpy.typing.NDArray[numpy.float64]], tuple[float, numpy.typing.NDArray[numpy.float64]]] | None = None, options: HtstOptions = ..., masses: numpy.typing.NDArray[numpy.float64] | None = None) → HtstHalf

HTST half at x: REFINED, MEASURED or SURROGATE per options.mode.

MEASURED central-differences the oracle. A supplied model applies its geometry projection and mass rules, as in REFINED and SURROGATE.

gpridge._core.htst_ln_prefactor(minimum: HtstHalf, saddle: HtstHalf) → tuple[float, float]

(ln nu, std) = ln_sum(minimum) - ln_sum(saddle).

gpridge._core.request_prefactor(options: HtstOptions | None = None, masses: numpy.typing.NDArray[numpy.float64] | None = None) → None

Opt this thread’s later searches into prefactor halves.

Searches stay off until this call. None sets enabled = 1 and SURROGATE.

gpridge._core.search_prefactor(point: HtstPoint) → HtstHalf

The HTST half of this thread’s last search at point.