gpridge._core ============= .. py:module:: gpridge._core Attributes ---------- .. autoapisummary:: gpridge._core.ForceFn gpridge._core.RgPotFn gpridge._core.HTST_OMEGA_EV_ANGSTROM_AMU Classes ------- .. autoapisummary:: gpridge._core.DistanceMetricType gpridge._core.FrozenAndMovingAtoms gpridge._core.DebugLevels gpridge._core.OptimizationAlgorithms gpridge._core.UncertaintyMode gpridge._core.HyperparameterOptimizationMode gpridge._core.HyperparameterObjectiveMode gpridge._core.GPModelProfile gpridge._core.LinalgMode gpridge._core.NEBMode gpridge._core.VibrationalStencil gpridge._core.ConvergenceNorm gpridge._core.AcquisitionType gpridge._core.BQMeasure gpridge._core.BQBasis gpridge._core.BQKernel gpridge._core.BQHyperMode gpridge._core.BQConfig gpridge._core.BQIntegralReport gpridge._core.BQUncertainty gpridge._core.BayesianQuadrature gpridge._core.FESConfig gpridge._core.FESRateConfig gpridge._core.FESRateReport gpridge._core.PsearchAxis gpridge._core.ScalarSurrogate gpridge._core.ParameterSearch gpridge._core.FreeEnergySurrogate gpridge._core.BandEngineKind gpridge._core.Image gpridge._core.NEBPath gpridge._core.Observation gpridge._core.AtomsConfiguration gpridge._core.PriorBase gpridge._core.PriorGaussian gpridge._core.PriorLogNormal gpridge._core.PriorT gpridge._core.PriorSqrtt gpridge._core.PriorUnif gpridge._core.PriorLogUnif gpridge._core.PotentialWrapper gpridge._core.NoiseFloorReport gpridge._core.RgpotGPSurface gpridge._core.RFFFeatureSelection gpridge._core.ARDSearchResult gpridge._core.ARDGridSearch gpridge._core.BMAPrediction gpridge._core.BayesianModelAveraging gpridge._core.EnergyUnit gpridge._core.LengthUnit gpridge._core.DerivativeStatus gpridge._core.DerivativeOptions gpridge._core.DerivativeReport gpridge._core.HtstMode gpridge._core.HtstKind gpridge._core.HtstStatus gpridge._core.HtstSource gpridge._core.HtstPoint gpridge._core.HtstOptions gpridge._core.HtstHalf gpridge._core.GaussianProcessRegression gpridge._core.StudentTProcessRegression gpridge._core.GPNEBConfig gpridge._core.OCINEBConfig gpridge._core.GPNEBStopReason gpridge._core.GPNEBResult gpridge._core.OCINEBResult gpridge._core.PeriodicBandDefaults gpridge._core.HssvdBackend gpridge._core.PeriodicBandInitial gpridge._core.LocalBandConfig gpridge._core.PeriodicBandConfig gpridge._core.AtomicDimer gpridge._core.SecantHessianMethod gpridge._core.SecantSeedStatus gpridge._core.SecantHessianConfig gpridge._core.MinimizationConfig gpridge._core.MinimizationResult gpridge._core.PolicyState gpridge._core.PolicyCandidate Functions --------- .. autoapisummary:: gpridge._core.fes_noise_from_weights gpridge._core.neb_linear_path gpridge._core.neb_idpp_path gpridge._core.neb_idpp_collective_path gpridge._core.neb_sidpp_path gpridge._core.neb_sidpp_geodesic_path gpridge._core.pair_distance_matrix gpridge._core.periodic_band_defaults gpridge._core.status_name gpridge._core.neb_request_index_certificate gpridge._core.neb_request_sidpp gpridge._core.neb_request_vibrational_stencil gpridge._core.neb_search_potential gpridge._core.neb_search_gp_potential gpridge._core.neb_search_local gpridge._core.neb_search_local_potential gpridge._core.neb_search_periodic gpridge._core.neb_search_periodic_potential gpridge._core.gp_neb gpridge._core.run_ocineb gpridge._core.set_linalg_mode gpridge._core.linalg_mode gpridge._core.set_linalg_threads gpridge._core.set_training_product gpridge._core.training_product_configured gpridge._core.check_model_package gpridge._core.backend_name gpridge._core.abi_report gpridge._core.component_registry gpridge._core.check_abi gpridge._core.minimize_request_max_inner_steps gpridge._core.gp_minimize gpridge._core.save_gp_state gpridge._core.load_gp_observations gpridge._core.apply_saved_gp_state gpridge._core.train_phase_reset gpridge._core.train_phase_read gpridge._core.train_phase_read_leaves gpridge._core.set_library_serial gpridge._core.build_info gpridge._core.version_components gpridge._core.abi_version gpridge._core.backend_requires_mpi gpridge._core.mpi_initialized gpridge._core.mpi_world_rank gpridge._core.mpi_world_size gpridge._core.omp_max_threads gpridge._core.potential_lj gpridge._core.potential_muller_brown gpridge._core.potential_leps gpridge._core.canonical_dimer_parameters gpridge._core.initialize_atoms_config gpridge._core.htst_half_from_hessian gpridge._core.htst_half gpridge._core.htst_ln_prefactor gpridge._core.request_prefactor gpridge._core.search_prefactor Module Contents --------------- .. py:class:: DistanceMetricType Bases: :py:obj:`enum.Enum` Distance metric for early stopping checks. .. py:attribute:: MAX_1D_LOG :value: 0 .. py:attribute:: RMSD :value: 1 .. py:attribute:: EMD :value: 2 .. py:class:: FrozenAndMovingAtoms Bases: :py:obj:`enum.IntEnum` Atom mobility flags for is_frozen arrays. .. py:attribute:: MOVING_ATOM :value: 0 .. py:attribute:: FROZEN_ATOM :value: 1 .. py:class:: DebugLevels Bases: :py:obj:`enum.IntEnum` Verbosity levels for debug output. DEBUG_L0: silent, DEBUG_L2: per outer loop, DEBUG_L3: per inner loop. .. py:attribute:: DEBUG_L0 :value: 0 .. py:attribute:: DEBUG_L1 :value: 1 .. py:attribute:: DEBUG_L2 :value: 2 .. py:attribute:: DEBUG_L3 :value: 3 .. py:class:: OptimizationAlgorithms Bases: :py:obj:`enum.IntEnum` Hyperparameter optimization algorithms. .. py:attribute:: SCG_opt :value: 0 .. py:attribute:: INLA_opt :value: 1 .. py:class:: UncertaintyMode Bases: :py:obj:`enum.IntEnum` Posterior estimator that GaussianProcessRegression dispatches calculate_potential / calculate_variance through. .. py:attribute:: MAP :value: 0 .. py:attribute:: LAPLACE :value: 2 .. py:attribute:: LAPLACE_SLICE :value: 5 .. py:attribute:: EB :value: 3 .. py:attribute:: BMA :value: 1 .. py:attribute:: SVGD :value: 4 .. py:class:: HyperparameterOptimizationMode Bases: :py:obj:`enum.IntEnum` Hyperparameter optimiser the GP runs to fit theta. .. py:attribute:: SCG :value: 0 .. py:attribute:: INLA :value: 1 .. py:attribute:: MAP_LBFGS :value: 2 .. py:class:: HyperparameterObjectiveMode Bases: :py:obj:`enum.IntEnum` Hyperparameter objective used to score theta. .. py:attribute:: NLML :value: 0 .. py:attribute:: LOO :value: 1 .. py:attribute:: LOCAL_LOO :value: 2 .. py:class:: GPModelProfile Bases: :py:obj:`enum.IntEnum` Coherent GP model family (prior, objective, solver contract). .. py:attribute:: CHEMGP :value: 0 .. py:attribute:: GPRD_ZBL :value: 1 .. py:attribute:: EXTENDED :value: 2 .. py:class:: LinalgMode Bases: :py:obj:`enum.IntEnum` Distributed factorization (gprn --linalg-mode). .. py:attribute:: REPRODUCIBLE :value: 0 .. py:attribute:: LIBRARY :value: 1 .. py:class:: NEBMode Bases: :py:obj:`enum.IntEnum` NEB execution branch in gpr::neb::gpNEB. .. py:attribute:: Standard :value: 0 .. py:attribute:: AIE :value: 1 .. py:attribute:: OIE :value: 2 .. py:attribute:: GP_AIE :value: 3 .. py:attribute:: GP_OIE :value: 4 .. py:attribute:: GP_LOCAL :value: 5 .. py:class:: VibrationalStencil Bases: :py:obj:`enum.IntEnum` Coordinates a true-oracle Hessian stencil displaces. .. py:attribute:: Full :value: 0 .. py:attribute:: Vibrational :value: 1 .. py:class:: ConvergenceNorm Bases: :py:obj:`enum.IntEnum` Norm of the band force that the convergence test reads. .. py:attribute:: L2 :value: 0 .. py:attribute:: LINF :value: 1 .. py:attribute:: MAX_FORCE_ON_ATOM :value: 2 .. py:class:: AcquisitionType Bases: :py:obj:`enum.IntEnum` OIE worst-image acquisition strategy. .. py:attribute:: MaxForce :value: 1 .. py:attribute:: MaxVariance :value: 0 .. py:attribute:: UCB :value: 2 .. py:attribute:: ThompsonSampling :value: 3 .. py:attribute:: IMSPE :value: 4 .. py:attribute:: ExpectedImprovement :value: 5 .. py:attribute:: PriorityCascade :value: 6 .. py:attribute:: TPE :value: 7 .. py:attribute:: PSBAX :value: 8 .. py:class:: BQMeasure Bases: :py:obj:`enum.IntEnum` Integration measure. A uniform box is the Lebesgue integral divided by the volume. .. py:attribute:: LebesgueBox :type: int .. py:attribute:: UniformBox :type: int .. py:attribute:: Gaussian :type: int .. py:class:: BQBasis Bases: :py:obj:`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. .. py:attribute:: FollowConfig :value: -1 .. py:attribute:: None_ :type: int .. py:attribute:: Constant :type: int .. py:attribute:: Affine :type: int .. py:class:: BQKernel Bases: :py:obj:`enum.IntEnum` Kernel family for scalar GP Bayesian quadrature (ABI 1.17). .. py:attribute:: SE :value: 0 .. py:attribute:: Matern32Product :value: 1 .. py:attribute:: Matern52Product :value: 2 .. py:attribute:: Matern32Isotropic :value: 3 .. py:attribute:: Matern52Isotropic :value: 4 .. py:class:: BQHyperMode Bases: :py:obj:`enum.IntEnum` Hyperparameter treatment for Bayesian quadrature (ABI 1.17). .. py:attribute:: Fixed :value: 0 .. py:attribute:: ML :value: 1 .. py:attribute:: MAP :value: 2 .. py:attribute:: TPMarginal :value: 3 .. py:attribute:: Marginalized :value: 4 .. py:class:: BQConfig Scalar GP and Bayesian quadrature configuration (ABI 1.17). .. py:attribute:: dimension :type: int .. py:attribute:: kernel :type: BQKernel .. py:attribute:: ard :type: int .. py:attribute:: hyper_mode :type: BQHyperMode .. py:attribute:: magn_sigma2 :type: float .. py:attribute:: lengthscale :type: float .. py:attribute:: extra_sigma2 :type: float .. py:attribute:: optimize_extra_sigma2 :type: int .. py:attribute:: jitter_sigma2 :type: float .. py:attribute:: kappa_max :type: float .. py:attribute:: use_prior_mean :type: int .. py:attribute:: ls_prior_mu :type: float .. py:attribute:: ls_prior_s2 :type: float .. py:attribute:: ls_prior_nu :type: float .. py:attribute:: tp_hyperprior_a :type: float .. py:attribute:: tp_hyperprior_b :type: float .. py:attribute:: quad_nodes :type: int .. py:attribute:: gl_max_panels :type: int .. py:attribute:: max_iter :type: int .. py:attribute:: tol_func :type: float .. py:attribute:: tol_sol :type: float .. py:attribute:: report_level :type: int .. py:attribute:: interpolate_candidate_noise :type: int .. py:class:: BQIntegralReport Posterior decomposition for a Bayesian quadrature integral. .. py:attribute:: mean :type: float .. py:attribute:: variance :type: float .. py:attribute:: std_dev :type: float .. py:attribute:: prior_integral_variance :type: float .. py:attribute:: explained_variance :type: float .. py:attribute:: mean_shift_variance :type: float .. py:attribute:: aleatoric_variance :type: float .. py:attribute:: epistemic_variance :type: float .. py:attribute:: hyperparameter_variance :type: float .. py:attribute:: loo_calibration_scale :type: float .. py:attribute:: tp_variance_scale :type: float .. py:attribute:: condition_number :type: float .. py:attribute:: effective_nugget :type: float .. py:attribute:: quadrature_models :type: int .. py:class:: BQUncertainty Integral uncertainty split by source. `variance` is the historical report, including the leave-one-out factor. .. py:attribute:: mean :type: float .. py:attribute:: variance :type: float .. py:attribute:: gp_variance :type: float .. py:attribute:: observation_noise_variance :type: float .. py:attribute:: hyperparameter_variance :type: float .. py:attribute:: numerical_abs_tolerance :type: float .. py:attribute:: loo_predictive_scale :type: float .. py:attribute:: variance_model :type: float .. py:attribute:: measure_mass :type: float .. py:attribute:: quadrature_models :type: int .. py:class:: BayesianQuadrature(config: BQConfig = ...) Bayesian quadrature handle (`gpr_bq_t`). .. py:method:: reset(config: BQConfig) -> None Replace the configuration and drop every observation and any stored integration box. .. py:attribute:: dimension :type: int .. py:attribute:: n_observations :type: int .. py:attribute:: n_lengthscales :type: int .. py:attribute:: lengthscales :type: list[float] .. py:attribute:: magn_sigma2 :type: float .. py:attribute:: extra_sigma2 :type: float .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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). .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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). .. py:property:: basis :type: BQBasis Active basis selection (GPR_BQ_BASIS_FOLLOW_CONFIG until a basis is set). .. py:method:: 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. .. py:method:: 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. .. py:method:: 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`. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:class:: 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. .. py:attribute:: struct_size :type: int .. py:attribute:: kernel :type: BQKernel .. py:attribute:: ard :type: int .. py:class:: 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. .. py:attribute:: struct_size :type: int .. py:attribute:: posterior_samples :type: int .. py:attribute:: seed :type: int .. py:attribute:: beta :type: float .. py:attribute:: credible_mass :type: float .. py:attribute:: saddle_tolerance :type: float .. py:class:: 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`. .. py:attribute:: struct_size :type: int .. py:attribute:: barrier_mean :type: float .. py:attribute:: barrier_std :type: float .. py:attribute:: barrier_lower :type: float .. py:attribute:: barrier_upper :type: float .. py:attribute:: prefactor_mean :type: float .. py:attribute:: prefactor_std :type: float .. py:attribute:: rate_mean :type: float .. py:attribute:: rate_std :type: float .. py:attribute:: rate_lower :type: float .. py:attribute:: rate_upper :type: float .. py:attribute:: samples_requested :type: int .. py:attribute:: samples_accepted :type: int .. py:attribute:: saddle_gradient_norm :type: float .. py:function:: 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. .. py:class:: PsearchAxis Bases: :py:obj:`enum.IntEnum` Kind of a continuous parameter-search axis. .. py:attribute:: Linear :type: int .. py:attribute:: Log :type: int .. py:attribute:: Integer :type: int .. py:class:: 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. .. py:property:: dimension :type: int Number of coordinates. .. py:property:: n_observations :type: int Number of observed rows. .. py:method:: set_kernel(kernel: BQKernel) -> None Select the radial shape; a new ``fit`` is needed afterwards. .. py:method:: set_mean_basis(basis: BQBasis) -> None Select a zero (``None_``), constant or affine mean, fitted by generalized least squares at each fit. .. py:method:: 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. .. py:method:: hyperparameters() -> tuple[numpy.typing.NDArray[numpy.float64], float, float] Length scales, signal variance and shared noise variance. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:class:: 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. .. py:property:: dimension :type: int Number of axes. .. py:method:: 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. .. py:method:: 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. .. py:method:: propose(q: int = 1) -> numpy.typing.NDArray[numpy.float64] Up to ``q`` parameter vectors to evaluate next, one per row. .. py:method:: best() -> tuple[numpy.typing.NDArray[numpy.float64], float] The incumbent and its loss (the posterior mean when noisy). .. py:class:: 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. .. py:property:: dimension :type: int Collective-variable dimension. .. py:property:: n_observations :type: int Number of training points, or 0 before training. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:class:: BandEngineKind Bases: :py:obj:`enum.IntEnum` Inner-band stepper. Production default is RgLbfgs. InternalLbfgs is the parity harness. RgFire is rgmin FIRE2. Rgsaddle is the linked rgsaddle library. .. py:attribute:: InternalLbfgs :value: 0 .. py:attribute:: RgLbfgs :value: 1 .. py:attribute:: RgFire :value: 2 .. py:attribute:: Rgsaddle :value: 3 .. py:class:: Image One image in a NEB path: positions, energy, gradient. .. py:attribute:: positions :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: energy :type: float .. py:attribute:: gradient :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: is_endpoint :type: bool .. py:attribute:: is_climbing :type: bool .. py:attribute:: evaluated :type: bool .. py:attribute:: posterior_variance :type: float .. py:class:: 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. .. py:method:: num_images() -> int Number of images on the path. .. py:method:: num_intermediate() -> int Number of intermediate images. .. py:method:: image(i: int) -> Image Image ``i`` of the chain, with the reactant as 0. Raises ``IndexError`` unless ``0 <= i < num_images()``. .. py:method:: initialize_idpp(n_atoms: int, collective: bool = False) -> None Step: replace intermediates with per-image (or collective) IDPP. .. py:method:: initialize_sidpp(n_atoms: int, alpha: float = 0.33) -> None Step: Sequential IDPP path growth (SIDPP). .. py:method:: initialize_sidpp_geodesic(n_atoms: int, alpha: float = 0.33) -> None Step: Geodesic-SIDPP (inverse-distance target interpolation). .. py:method:: compute_neb_forces() -> None Step: recompute spring + tangent + climbing forces from current image energies/gradients. .. py:method:: enable_climbing_image() -> None Step: mark the highest-energy intermediate as climbing image. .. py:method:: highest_energy_image_index() -> int Highest finite interior energy, or -1 when none exists. .. py:method:: highest_energy_image_index_preferring(preferred: int) -> int Highest interior energy image, keeping preferred if still a local max. .. py:method:: neb_force(i: int) -> numpy.typing.NDArray[numpy.float64] NEB force vector for image i (after compute_neb_forces). .. py:method:: tangent_at(i: int) -> numpy.typing.NDArray[numpy.float64] Improved (energy-weighted) unit tangent at image i. .. py:method:: intermediate_positions() -> numpy.typing.NDArray[numpy.float64] Matrix (n_intermediate, n_coords) of interior image positions. .. py:method:: set_from_observation(obs: Observation, start_image: int = 1) -> None Step: load energies/gradients from an Observation into images. .. py:method:: set_spring_bounds(k_max: float, k_min: float) -> None Energy-weighted spring bounds (k_max at saddle, k_min in basins). .. py:method:: set_geometric_spring(on: bool) -> None Toggle geometric (cubic-potential) spring force. .. py:method:: geometric_spring() -> bool Whether geometric spring mode is on. .. py:method:: max_spacing_deviation() -> float Max relative spacing deviation from uniform arc length. .. py:method:: reparametrize_by_arc_length() -> float Step: redistribute interiors uniformly along arc length; returns pre-reparam max_spacing_deviation. Invalidates energies/grads. .. py:method:: reparametrize_by_arc_length_keeping_image(anchor_index: int) -> float Step: reparam subchains while preserving one anchor image. .. py:method:: positions_matrix() -> numpy.typing.NDArray[numpy.float64] All image positions as matrix (n_images, 3*n_atoms), endpoints included. .. py:function:: 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). .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:class:: 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 .. py:attribute:: R :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: E :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: G :type: numpy.typing.NDArray[numpy.float64] .. py:method:: clear() -> None Reset all fields to empty. .. py:class:: AtomsConfiguration Atomic configuration: positions, frozen flags, IDs, atomic numbers. .. py:attribute:: positions :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: is_frozen :type: numpy.typing.NDArray[numpy.uint8] .. py:attribute:: id :type: numpy.typing.NDArray[numpy.uint32] .. py:attribute:: atomic_nrs :type: numpy.typing.NDArray[numpy.int32] .. py:attribute:: atomic_masses :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: evict_frozen :type: bool .. py:attribute:: nn_frozen :type: int .. py:attribute:: nn_auto :type: bool .. py:method:: clear() -> None Reset all fields. .. py:method:: count_moving_atoms() -> int Return the number of non-frozen atoms. .. py:method:: n_pairtypes() -> int Return the number of active pair types. .. py:class:: PriorBase Base class for GP prior distributions. Parameters: mu (location), s2 (scale^2), nu (degrees of freedom). .. py:method:: calculate_log_prior(x: numpy.typing.NDArray[numpy.float64]) -> float Evaluate log p(x) under this prior. .. py:method:: calculate_log_prior_gradient(x: numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] Evaluate d/dx log p(x) under this prior. .. py:attribute:: mu :type: float .. py:attribute:: s2 :type: float .. py:attribute:: nu :type: float .. py:class:: PriorGaussian Bases: :py:obj:`PriorBase` Gaussian prior: log p(x) = -0.5 * sum_j [log(2*pi*s2) + (x_j-mu)^2/s2] .. py:class:: PriorLogNormal Bases: :py:obj:`PriorBase` Log-normal prior on exp(x). .. py:class:: PriorT Bases: :py:obj:`PriorBase` Student's t prior with nu degrees of freedom. .. py:class:: PriorSqrtt Bases: :py:obj:`PriorBase` Prior on sqrt(exp(x)) with Student's t distribution. .. py:class:: PriorUnif Bases: :py:obj:`PriorBase` Uniform (uninformative) prior: log p(x) = 0. .. py:class:: PriorLogUnif Bases: :py:obj:`PriorBase` Log-uniform prior on exp(x). .. py:data:: ForceFn Force callback. It writes forces in place into the third argument and returns the total energy. .. py:data:: RgPotFn rgpot-style callable returning (energy, forces), optionally followed by energy_variance and force_noise_rms. .. py:class:: PotentialWrapper(fn: ForceFn) Plug-in oracle wrapper. Construct from a write-in-place callable, or from an rgpot PotentialBase / rgpot-style callable via :meth:`from_rgpot`. .. py:method:: from_rgpot(pot: RgPotFn | Any) -> PotentialWrapper :staticmethod: Wrap an rgpot ``PotentialBase`` or an rgpot-style callable. .. py:method:: 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]). .. py:method:: 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). .. py:class:: NoiseFloorReport Condition-floored noise and certificate gap of a trained model. .. py:attribute:: sigma2_requested :type: float .. py:attribute:: sigma2_floored :type: float .. py:attribute:: certificate_gap :type: float .. py:attribute:: sigma2_interval :type: float .. py:attribute:: floor_active :type: bool .. py:attribute:: certified :type: bool .. py:class:: RgpotGPSurface(model: GaussianProcessRegression) Trained GPRidge posterior mean; prefer ``GaussianProcess.as_rgpot``. .. py:method:: 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. .. py:method:: surface_epoch() -> int Return the surface epoch for cache invalidation. It changes when the source changes or the active model is refactored. .. py:class:: RFFFeatureSelection Stored report from automatic random-feature selection. .. py:attribute:: accepted :type: bool .. py:attribute:: deferred :type: bool .. py:attribute:: features :type: int .. py:attribute:: start_features :type: int .. py:attribute:: limit_features :type: int .. py:attribute:: fit_geometries :type: int .. py:attribute:: holdout_geometries :type: int .. py:attribute:: full_geometries :type: int .. py:attribute:: cartesian_dimension :type: int .. py:attribute:: joint_rows :type: int .. py:attribute:: force_tol_fraction :type: float .. py:attribute:: force_convergence_tolerance :type: float .. py:attribute:: energy_tolerance :type: float .. py:attribute:: force_tolerance :type: float .. py:attribute:: energy_noise :type: float .. py:attribute:: gradient_noise :type: float .. py:attribute:: max_energy_error :type: float .. py:attribute:: max_force_error :type: float .. py:attribute:: max_energy_oracle_error :type: float .. py:attribute:: max_force_oracle_error :type: float .. py:attribute:: exact_energy_oracle_error :type: float .. py:attribute:: exact_force_oracle_error :type: float .. py:attribute:: exact_gram_bytes :type: int .. py:attribute:: memory_cap_bytes :type: int .. py:attribute:: full_gram_bytes :type: int .. py:attribute:: status :type: str .. py:attribute:: detail :type: str .. py:class:: ARDSearchResult Result of ARD grid search. .. py:attribute:: best_lengthscales :type: list[float] .. py:attribute:: best_noise :type: float .. py:attribute:: best_likelihood :type: float .. py:attribute:: best_prefactor :type: float .. py:attribute:: total_evaluations :type: int .. py:method:: valid() -> bool Whether the search actually found a usable point. .. py:function:: 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. .. py:class:: 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. .. py:method:: 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. .. py:class:: BMAPrediction Prediction result from Bayesian model averaging. .. py:attribute:: mean :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: variance :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: n_models :type: int .. py:class:: BayesianModelAveraging Bayesian model averaging over hyperparameter grid. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: total_models() -> int Number of models with a stored posterior weight. .. py:method:: weights() -> list[float] Access posterior weights (for testing parallel correctness). .. py:class:: EnergyUnit Bases: :py:obj:`enum.IntEnum` Energy unit tag of a model's training data (no conversion). .. py:attribute:: NATIVE :value: 0 .. py:attribute:: EV :value: 1 .. py:attribute:: HARTREE :value: 2 .. py:attribute:: KCAL_PER_MOL :value: 3 .. py:attribute:: KJ_PER_MOL :value: 4 .. py:class:: LengthUnit Bases: :py:obj:`enum.IntEnum` Length unit tag of a model's training data (no conversion). .. py:attribute:: NATIVE :value: 0 .. py:attribute:: ANGSTROM :value: 1 .. py:attribute:: BOHR :value: 2 .. py:attribute:: NANOMETER :value: 3 .. py:class:: DerivativeStatus Bases: :py:obj:`enum.Enum` Outcome of a posterior-derivative call. .. py:attribute:: OK :value: 0 .. py:attribute:: INVALID_ARGUMENT :value: 1 .. py:attribute:: NOT_TRAINED :value: 2 .. py:attribute:: UNSUPPORTED :value: 3 .. py:attribute:: OUT_OF_SUPPORT :value: 4 .. py:class:: DerivativeOptions Options of the batched posterior-derivative primitives. .. py:attribute:: struct_size :type: int .. py:attribute:: energy_unit :type: EnergyUnit .. py:attribute:: length_unit :type: LengthUnit .. py:attribute:: project_rigid :type: bool .. py:attribute:: max_energy_std :type: float .. py:attribute:: variance_step :type: float .. py:class:: DerivativeReport Report of a posterior-derivative call. Variances are probabilistic estimates, never certificates. .. py:attribute:: struct_size :type: int .. py:attribute:: status :type: DerivativeStatus .. py:attribute:: message :type: str .. py:attribute:: energy_unit :type: EnergyUnit .. py:attribute:: length_unit :type: LengthUnit .. py:attribute:: n_points :type: int .. py:attribute:: projected :type: bool .. py:attribute:: max_energy_std :type: float .. py:attribute:: max_energy_std_point :type: int .. py:attribute:: max_translation_residual :type: float .. py:attribute:: max_rotation_residual :type: float .. py:attribute:: factor_appended :type: int .. py:method:: ok() -> bool True when the call succeeded. .. py:class:: HtstMode Bases: :py:obj:`enum.IntEnum` How an HTST half obtains its Hessian. .. py:attribute:: REFINED :value: 0 .. py:attribute:: MEASURED :value: 1 .. py:attribute:: SURROGATE :value: 2 .. py:class:: HtstKind Bases: :py:obj:`enum.IntEnum` Stationary point of a half (ABI 1.20). .. py:attribute:: MINIMUM :value: 0 .. py:attribute:: SADDLE :value: 1 .. py:class:: HtstStatus Bases: :py:obj:`enum.IntEnum` Outcome of a half (ABI 1.20). .. py:attribute:: OK :value: 0 .. py:attribute:: NOT_CONVERGED :value: 1 .. py:attribute:: WRONG_INDEX :value: 2 .. py:attribute:: UNAVAILABLE :value: 3 .. py:class:: HtstSource Bases: :py:obj:`enum.IntEnum` Where a half's Hessian came from (ABI 1.20). .. py:attribute:: REFINED :value: 0 .. py:attribute:: MEASURED :value: 1 .. py:attribute:: STENCIL :value: 2 .. py:attribute:: SURROGATE :value: 3 .. py:attribute:: CONDITIONED :value: 4 .. py:class:: HtstPoint Bases: :py:obj:`enum.IntEnum` Which stationary point of a search a half belongs to. .. py:attribute:: REACTANT :value: 0 .. py:attribute:: TRANSITION :value: 1 .. py:attribute:: PRODUCT :value: 2 .. py:class:: HtstOptions Harmonic prefactor options (gpr_htst_options_t). .. py:attribute:: struct_size :type: int .. py:attribute:: enabled :type: bool .. py:attribute:: mode :type: HtstMode .. py:attribute:: project_translation :type: bool .. py:attribute:: project_rotation :type: bool .. py:attribute:: max_measured :type: int .. py:attribute:: omega_scale :type: float .. py:attribute:: tolerance :type: float .. py:attribute:: fd_step :type: float .. py:attribute:: variance_step :type: float .. py:class:: HtstHalf One side of ln nu = ln_sum(minimum) - ln_sum(saddle). .. py:attribute:: struct_size :type: int .. py:attribute:: status :type: HtstStatus .. py:attribute:: kind :type: HtstKind .. py:attribute:: source :type: HtstSource .. py:attribute:: n_coords :type: int .. py:attribute:: n_projected :type: int .. py:attribute:: n_modes :type: int .. py:attribute:: n_negative :type: int .. py:attribute:: oracle_calls :type: int .. py:attribute:: n_measured :type: int .. py:attribute:: converged :type: bool .. py:attribute:: ln_sum :type: float .. py:attribute:: ln_sum_std :type: float .. py:attribute:: imaginary_frequency :type: float .. py:attribute:: omega_scale :type: float .. py:attribute:: frequencies :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: measured :type: list[int] .. py:attribute:: message :type: str .. py:data:: HTST_OMEGA_EV_ANGSTROM_AMU :type: float .. py:class:: GaussianProcessRegression Low-level GP regression class. Most users want gpridge.GaussianProcess instead, which wraps this with an ASE-friendly interface. .. py:method:: initialize(parameters: dict[str, Any], atoms_config: AtomsConfiguration) -> None Initialize the GP model with parameters and atomic configuration. .. py:method:: 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. .. py:method:: optimize(observations: Observation) -> None Optimize hyperparameters. Releases the GIL during computation. .. py:method:: train_marginal_likelihood(observations: Observation) -> dict[str, Any] Fit by prior-free Gaussian marginal likelihood and return the fit report plus fitted length scales. .. py:method:: 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. .. py:method:: calibrate_forces(held_out: Observation, nominal_probability: float) -> dict[str, Any] Evaluate held-out force residual calibration. .. py:method:: calibrate_loo(nominal_probability: float) -> dict[str, Any] Evaluate closed-form leave-one-out calibration on fitted channels. .. py:method:: update(observations: Observation, new_observations: Observation, atoms_config: AtomsConfiguration) -> Observation Append new observations to a copy of observations and retrain. .. py:method:: calculate_potential(observation: Observation) -> None Predict energy and gradient in physical units for the given observation (in-place). .. py:method:: calculate_variance(observation: Observation) -> None Predict variance in physical units for the given observation (in-place). .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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). .. py:method:: set_uncertainty_mode(mode: UncertaintyMode) -> None Select MAP / BMA / LAPLACE / LAPLACE_SLICE / EB / SVGD as the posterior estimator. .. py:method:: set_use_alpha_k_predict_mean(enabled: bool) -> None Enable the alpha-K contraction for MAP mean prediction. .. py:method:: get_use_alpha_k_predict_mean() -> bool Return whether the alpha-K MAP mean contraction is enabled. .. py:method:: set_use_alpha_k_laplace_mean(enabled: bool) -> None Enable the alpha-K contraction for Laplace-mixture mean prediction. .. py:method:: get_use_alpha_k_laplace_mean() -> bool Return whether the alpha-K Laplace-mixture mean contraction is enabled. .. py:method:: set_laplace_skip_scg_threshold(threshold: float) -> None Set the Laplace shift threshold that skips hyperparameter SCG. .. py:method:: get_laplace_skip_scg_threshold() -> float Return the Laplace shift threshold for skipping SCG. .. py:method:: set_objective_stationarity_skip_auto(enabled: bool) -> None Use the optimizer step tolerance as the stationarity-skip threshold. .. py:method:: get_objective_stationarity_skip_auto() -> bool Return whether the automatic stationarity-skip threshold is enabled. .. py:method:: set_use_training_geometry_handle(enabled: bool) -> None Route hyperparameter objective calls through the cached training geometry handle. .. py:method:: get_use_training_geometry_handle() -> bool Return whether cached training geometry is enabled. .. py:method:: set_profile_predict_mean(enabled: bool) -> None Enable predict-mean timing accumulation. .. py:method:: get_profile_predict_mean() -> bool Return whether predict-mean timing is enabled. .. py:method:: set_profile_energy_split(enabled: bool) -> None Enable energy timing split output. .. py:method:: get_profile_energy_split() -> bool Return whether energy timing splits are enabled. .. py:method:: set_profile_gradient_split(enabled: bool) -> None Enable gradient timing split output. .. py:method:: get_profile_gradient_split() -> bool Return whether gradient timing splits are enabled. .. py:method:: set_log_training_geometry(enabled: bool) -> None Enable training geometry diagnostic logging. .. py:method:: get_log_training_geometry() -> bool Return whether training geometry diagnostic logging is enabled. .. py:method:: set_log_rank_block_cholesky(enabled: bool) -> None Deprecated compatibility setter. True emits a warning and is ignored. .. py:method:: get_log_rank_block_cholesky() -> bool Deprecated compatibility getter; always returns false. .. py:method:: set_scalapack_block_size(block_size: int) -> None Set the requested ScaLAPACK block size. .. py:method:: get_scalapack_block_size() -> int Return the requested ScaLAPACK block size. .. py:method:: set_scalapack_nprow(nprow: int) -> None Set the requested ScaLAPACK process-grid row count. .. py:method:: get_scalapack_nprow() -> int Return the requested ScaLAPACK process-grid row count. .. py:method:: set_cutlass_plugin_path(path: str) -> None Set the CUTLASS GEMM plugin path. .. py:method:: get_cutlass_plugin_path() -> str Return the CUTLASS GEMM plugin path. .. py:method:: set_use_psis_laplace(enabled: bool) -> None Enable PSIS-Laplace importance-weighted variance mixture inside the LAPLACE_SLICE arm. .. py:method:: set_use_psis_deterministic_grid(enabled: bool) -> None Use the deterministic axial-grid sampler for PSIS-Laplace (np-reproducible). .. py:method:: set_use_delta_method(enabled: bool) -> None Enable the analytical INLA-Delta variance estimator (replaces per-call slice / sampling burst). .. py:method:: 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. .. py:method:: 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. .. py:method:: set_hssvd_backend(enabled: bool) -> None Enable the HS-SVD stable-basis solver backend. .. py:method:: get_hssvd_backend() -> bool Return whether the HS-SVD stable-basis backend is enabled. .. py:method:: set_rigid_null_deflation(enabled: bool) -> None Enable or disable rigid-motion nullspace deflation on training factorizations. .. py:method:: rigid_null_deflation_enabled() -> bool Return whether rigid-motion nullspace deflation is enabled. .. py:method:: set_disable_output_normalization(enabled: bool) -> None Disable output target normalization for stable-basis runs. .. py:method:: 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). .. py:method:: 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. .. py:method:: rff_feature_selection_auto() -> bool True when automatic feature selection is enabled. .. py:method:: rff_feature_selection() -> RFFFeatureSelection The stored automatic-selection report. .. py:method:: set_hyperparameter_optimization_mode(mode: HyperparameterOptimizationMode) -> None Select SCG (default) or INLA hyperparameter optimiser. .. py:method:: set_sigma2(sigma2: float, observations: Observation | None = None) -> None Set a positive finite likelihood noise variance and refresh the posterior when observations are provided. .. py:method:: get_sigma2() -> float Fitted physical output-noise variance (sigma2). .. py:method:: n_lengthscales() -> int Number of kernel lengthscale parameters. .. py:method:: 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. .. py:method:: fit_restarts() -> int Restarts the last fit needed: 1 after a restarted marginal-likelihood fit, otherwise 0. .. py:method:: fit_stop_reason() -> str Why the last fit stopped: budget, library, restored scg point, wall-clock limit, non-finite marginal likelihood, or unset. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: noise_floor_report() -> NoiseFloorReport Condition-floored noise, certificate gap and interval noise of the trained model. .. py:method:: prediction_supported(positions: numpy.typing.NDArray[numpy.float64], atoms_config: AtomsConfiguration, observations: Observation) -> bool Whether the trained prediction kernel supports the query geometry. .. py:method:: 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. .. py:method:: get_jitter() -> float Configured numerical diagonal jitter variance. .. py:method:: 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. .. py:method:: get_length_scales() -> list[float] Fitted Sexpat length scales, one per pair type. .. py:method:: set_length_scales(length_scales: collections.abc.Sequence[float]) -> None Set the Sexpat length scales, one per pair type. .. py:method:: get_magn_sigma2() -> float Fitted signal variance of the Sexpat kernel. .. py:method:: set_magn_sigma2(magn_sigma2: float) -> None Seed the Sexpat signal variance. .. py:method:: get_noise_sigma2() -> float Fitted likelihood noise variance. .. py:method:: set_noise_sigma2(sigma2: float) -> None Set sigma2 value. .. py:method:: set_optimize_noise(enabled: bool) -> None Let the optimizer move the likelihood noise variance (NLML only). .. py:method:: get_hyperparameter_objective_mode() -> HyperparameterObjectiveMode The objective the hyperparameters are fitted on. .. py:method:: set_hyperparameter_objective_mode(mode: HyperparameterObjectiveMode) -> None Objective the hyperparameters are fitted on. .. py:method:: set_model_profile(profile: GPModelProfile) -> None Apply a kernel/prior profile (chemgp, gprd_zbl, extended). .. py:method:: get_use_ff_prior_mean() -> bool Whether the Teng/Bao first-level Morse force-field prior mean is enabled. .. py:method:: set_use_ff_prior_mean(use: bool) -> None Subtract the Teng Morse force-field prior mean from the targets. .. py:method:: set_use_zbl_prior_mean(use: bool) -> None Subtract the ZBL repulsive prior mean from the targets. .. py:method:: set_use_ls_prior(use: bool) -> None Karvonen length-scale prior on the fit (gprn --ls-prior). .. py:method:: 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)``. .. py:property:: failed_optimizer :type: bool True if the hyperparameter optimizer failed to converge. .. py:method:: get_num_potential_calls() -> int Return the number of potential evaluations during optimization. .. py:method:: 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. .. py:method:: 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). .. py:method:: 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). .. py:method:: 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). .. py:method:: 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. .. py:method:: 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. .. py:class:: StudentTProcessRegression Bases: :py:obj:`GaussianProcessRegression` Student-t process variant with heavier-tailed observation noise. .. py:method:: set_hyperprior_parameters(a: float, b: float) -> None Set inverse-gamma hyperprior shape (a) and scale (b). .. py:method:: get_hyperprior_a() -> float Get inverse-gamma shape parameter. .. py:method:: get_hyperprior_b() -> float Get inverse-gamma scale parameter. .. py:method:: get_tp_prefactor() -> float Get the TP prefactor (signal variance estimate from hyperprior). .. py:class:: GPNEBConfig Configuration for the low-level GP-NEB driver. .. py:attribute:: mode :type: NEBMode .. py:attribute:: linalg_mode :type: LinalgMode .. py:attribute:: conv_tol :type: float .. py:attribute:: max_outer_iter :type: int .. py:attribute:: band_refinement_max :type: int .. py:attribute:: band_certificate_force_scale :type: float .. py:attribute:: band_midpoint_certificate :type: bool .. py:attribute:: ci_index_certificate :type: bool .. py:attribute:: force_stop_certificate :type: bool .. py:attribute:: vibrational_stencil :type: VibrationalStencil .. py:attribute:: band_leak_bound :type: bool .. py:attribute:: first_attempt_wall_seconds :type: float .. py:attribute:: max_inner_iter :type: int .. py:attribute:: inner_step_size :type: float .. py:attribute:: spring_constant :type: float .. py:attribute:: climbing_image :type: bool .. py:attribute:: climbing_image_converged_only :type: bool .. py:attribute:: ci_activation_tol :type: float .. py:attribute:: ci_activation_factor :type: float .. py:attribute:: unc_convergence :type: float .. py:attribute:: restricted_variance_acquisition :type: bool .. py:attribute:: use_relative_neighborhood_graph :type: bool .. py:attribute:: n_atoms :type: int .. py:attribute:: remove_molecular_rigid_motion :type: bool .. py:attribute:: use_idpp :type: bool .. py:attribute:: use_sidpp :type: bool .. py:attribute:: sidpp_alpha :type: float .. py:attribute:: use_geometric_spring :type: bool .. py:attribute:: acquisition :type: AcquisitionType .. py:attribute:: use_three_phase_picker :type: bool .. py:attribute:: imspe_refit_skip_relative_tol :type: float .. py:attribute:: ucb_kappa :type: float .. py:attribute:: evals_per_iter :type: int .. py:attribute:: use_triplet :type: bool .. py:attribute:: seed :type: int .. py:attribute:: verbose :type: bool .. py:attribute:: has_initial_path :type: bool .. py:attribute:: initial_path :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: uncertainty_mode :type: UncertaintyMode .. py:attribute:: use_psis_laplace :type: bool .. py:attribute:: use_psis_deterministic :type: bool .. py:attribute:: use_delta_method :type: bool .. py:attribute:: rff_features :type: int .. py:attribute:: rff_force_tol_fraction :type: float .. py:attribute:: disable_output_normalization :type: bool .. py:attribute:: use_hssvd_solver :type: bool .. py:attribute:: use_hssvd_objective_contractions :type: bool .. py:attribute:: hssvd_dual_chop_tol :type: float .. py:attribute:: hssvd_dual_randomized_sketch :type: int .. py:attribute:: hssvd_dual_lapack_rrr :type: bool .. py:attribute:: hssvd_local_active_set_size :type: int .. py:attribute:: hssvd_local_posterior_active_set_size :type: int .. py:attribute:: per_image_min_train :type: int .. py:attribute:: per_image_knn :type: int .. py:attribute:: scalapack_block_size :type: int .. py:attribute:: scalapack_nprow :type: int .. py:attribute:: theta_shift_skip_tol :type: float .. py:attribute:: theta_shift_skip_auto :type: bool .. py:attribute:: hyperparameter_mode :type: HyperparameterOptimizationMode .. py:attribute:: hyperparameter_objective :type: HyperparameterObjectiveMode .. py:attribute:: model_profile :type: GPModelProfile .. py:attribute:: seed_full_chain :type: bool .. py:attribute:: max_inner_iter_gp :type: int .. py:attribute:: oie_fixed_point_measured_step :type: bool .. py:attribute:: oie_fixed_point_reparam :type: bool .. py:attribute:: oie_hook_reparam :type: bool .. py:attribute:: lbfgs_max_move :type: float .. py:attribute:: lbfgs_memory :type: int .. py:attribute:: band_engine :type: BandEngineKind .. py:attribute:: rgsaddle_library :type: str .. py:attribute:: lbfgs_inverse_curvature :type: float .. py:attribute:: lbfgs_finite_difference :type: float .. py:attribute:: lbfgs_auto_scale :type: bool .. py:attribute:: lbfgs_angle_reset :type: bool .. py:attribute:: lbfgs_distance_reset :type: bool .. py:attribute:: lbfgs_newton_agreement :type: float .. py:attribute:: reparam_period :type: int .. py:attribute:: reparam_tol :type: float .. py:attribute:: inner_conv_tol :type: float .. py:attribute:: gp_tol_divisor :type: float .. py:attribute:: inner_unc_relative :type: float .. py:attribute:: trust_metric :type: DistanceMetricType .. py:attribute:: use_adaptive_trust :type: bool .. py:attribute:: trust_radius :type: float .. py:attribute:: trust_adaptive_A :type: float .. py:attribute:: trust_adaptive_floor :type: float .. py:attribute:: trust_t_min :type: float .. py:attribute:: trust_delta_explore :type: float .. py:attribute:: trust_half_life :type: int .. py:attribute:: trust_ratio_at_limit :type: float .. py:attribute:: scalefree_trust :type: bool .. py:attribute:: scalefree_tau :type: float .. py:attribute:: use_ls_prior :type: bool .. py:attribute:: principled_nugget :type: bool .. py:attribute:: use_rigid_null_deflation :type: bool .. py:attribute:: kappa_max :type: float .. py:attribute:: convergence_force_norm :type: ConvergenceNorm | None .. py:attribute:: spring_constant_min :type: float .. py:attribute:: cell :type: list[float] .. py:attribute:: atomic_numbers :type: list[int] .. py:attribute:: frozen_positions :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: frozen_atomic_numbers :type: list[int] .. py:attribute:: moving_atoms :type: list[bool] .. py:attribute:: gp_local_fraction :type: float .. py:attribute:: gp_local_radius :type: float .. py:attribute:: gp_local_window :type: int .. py:attribute:: gp_local_trust :type: float .. py:attribute:: gp_local_inner_max :type: int .. py:attribute:: gp_local_refit_iters :type: int .. py:attribute:: gp_local_inner_tol_factor :type: float .. py:attribute:: gp_local_phase :type: bool .. py:attribute:: gp_local_refit_every :type: int .. py:attribute:: gp_local_noise :type: float .. py:attribute:: gp_local_pair_cutoff :type: float .. py:attribute:: gp_local_pair_spacing :type: float .. py:attribute:: gp_local_far_trust :type: float .. py:attribute:: gp_local_far_refresh :type: float .. py:attribute:: gp_local_initial_sweep :type: bool .. py:attribute:: gp_local_batch :type: int .. py:attribute:: gp_local_batch_growth :type: int .. py:attribute:: gp_local_batch_max :type: int .. py:attribute:: gp_local_sweep_images :type: int .. py:attribute:: gp_local_jacobi :type: bool .. py:attribute:: gp_local_grow_radius :type: float .. py:attribute:: gp_local_safeguard :type: bool .. py:attribute:: gp_local_keep_memory :type: bool .. py:attribute:: gp_local_residual :type: bool .. py:attribute:: gp_local_pair_split :type: float .. py:attribute:: gp_local_pair_tail_refresh :type: float .. py:attribute:: gp_local_cycles :type: int .. py:attribute:: gp_local_sweep :type: bool .. py:attribute:: gp_setup :type: collections.abc.Callable[Ellipsis, None] | None .. py:class:: OCINEBConfig Configuration for the low-level OCINEB dimer-burst phase. .. py:attribute:: use_mmf :type: bool .. py:attribute:: rg_minmode_dimer :type: bool .. py:attribute:: trigger_force :type: float .. py:attribute:: trigger_factor :type: float .. py:attribute:: max_steps :type: int .. py:attribute:: alignment_cos_tol :type: float .. py:attribute:: force_tolerance :type: float .. py:attribute:: dimer_max_phases :type: int .. py:attribute:: dimer_max_inner_iter :type: int .. py:attribute:: dimer_max_rot_iter :type: int .. py:attribute:: dimer_eval_image1 :type: bool .. py:attribute:: keep_force_improving_burst :type: bool .. py:attribute:: initial_orient :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: perturb_along_tangent :type: float .. py:attribute:: max_burst_displacement :type: float .. py:attribute:: dimer_variance_tau_rel :type: float .. py:attribute:: dimer_variance_tau_abs :type: float .. py:attribute:: dimer_imspe_soft_threshold :type: float .. py:attribute:: dimer_imspe_history_size :type: int .. py:class:: GPNEBStopReason Bases: :py:obj:`enum.IntEnum` Terminal stop reason recorded on GPNEBResult. .. py:attribute:: Unspecified :value: Ellipsis .. py:attribute:: Converged :value: Ellipsis .. py:attribute:: IterationBudget :value: Ellipsis .. py:attribute:: WallClockLimit :value: Ellipsis .. py:class:: GPNEBResult Result of a gp_neb run. The .path holds the converged image chain. .. py:property:: converged :type: bool True when the band met the force criterion. .. py:property:: stop_reason :type: GPNEBStopReason Terminal stop reason of the search. .. py:property:: convergence_status :type: str ``"force_tolerance"``, ``"model_noise_floor"`` or ``"not_converged"``. .. py:property:: hssvd_factorizations :type: int Stable-basis factorizations performed by the band GP. .. py:property:: cholesky_factorizations :type: int Dense Cholesky factorizations of that GP's training covariance. .. py:property:: oracle_calls :type: int All oracle evaluations. They cover the endpoints, the initial design, the outer iterations and the validation, which includes the index certificate. .. py:property:: prior_observations :type: int Rows loaded from a seed. They are not included in ``oracle_calls``. .. py:property:: oracle_calls_endpoints :type: int Evaluations that measured the two endpoints. .. py:property:: oracle_calls_initial :type: int Evaluations of the initial design. .. py:property:: oracle_calls_outer :type: int Evaluations made by the outer loop. .. py:property:: oracle_calls_validation :type: int Evaluations of the post-convergence validation, including the index certificate. .. py:property:: oracle_calls_to_convergence :type: int Oracle evaluations of the search. The index certificate is not included. .. py:property:: certified :type: bool True when the band index certificate holds. .. py:property:: index :type: int Negative-mode count of the band index certificate. .. py:property:: n_certificate_calls :type: int True oracle evaluations the certificate spent. They are included in ``oracle_calls`` and not in ``oracle_calls_to_convergence``. .. py:property:: index_checked :type: bool The vibrational-index gate ran on this result. .. py:property:: index_refused :type: bool A force-quiet point failed the index-1 gate and no budget remains. .. py:property:: index_continue :type: bool The gate stepped the climbing image; the caller resumes the search. .. py:property:: index_unresolved :type: int The `index_unresolved` member of `GPNEBResult`. .. py:property:: index_resolution :type: float The `index_resolution` member of `GPNEBResult`. .. py:property:: index_gate_true_calls :type: int True-surface force evaluations spent by the gate. .. py:property:: fixed_theta_refreshes :type: int The `fixed_theta_refreshes` member of `GPNEBResult`. .. py:property:: returned_true_force :type: float Oracle force, in the stopping norm, at the geometry in `max_energy_image`. .. py:property:: force_stop_hand_off :type: bool The climbing image and any measured stencil are the saddle stage's starting point. .. py:property:: force_stop_deferred :type: bool The saddle owns the index. This stage did not measure a stencil. .. py:property:: force_stop_inconclusive :type: bool The stencil was measured and did not resolve an index. .. py:property:: force_stop_displacement :type: float The `force_stop_displacement` member of `GPNEBResult`. .. py:property:: force_stop_center_reused :type: bool The `force_stop_center_reused` member of `GPNEBResult`. .. py:property:: force_stop_wall_s :type: float The `force_stop_wall_s` member of `GPNEBResult`. .. py:property:: force_stop_negative_upper :type: float A bound that fixed the index (certifyAdaptiveStencilIndex). .. py:property:: force_stop_positive_lower :type: float A bound that fixed the index (certifyAdaptiveStencilIndex). .. py:property:: force_stop_negative_pair_upper :type: float A bound that fixed the index (certifyAdaptiveStencilIndex). .. py:property:: force_stop_refinement_recorded :type: bool The `force_stop_refinement_recorded` member of `GPNEBResult`. .. py:property:: force_stop_refinement_higher_order :type: bool The `force_stop_refinement_higher_order` member of `GPNEBResult`. .. py:property:: outer_iterations :type: int Outer iterations completed. .. py:property:: max_energy_image :type: int Index of the highest-energy image, counting the reactant as 0. .. py:property:: barrier_energy :type: float Highest image energy minus the reactant energy, in eV. .. py:property:: reverse_barrier_energy :type: float Reverse barrier, E_saddle - E_product (image[N-1]). .. py:property:: ci_barrier_energy :type: float The band's own saddle, retained when dimer refinement later overwrites barrier_energy / reverse_barrier_energy with the refined saddle's. .. py:property:: ci_reverse_barrier_energy :type: float The band's own reverse barrier, retained when dimer refinement overwrites reverse_barrier_energy. .. py:property:: max_force_history :type: list[float] Largest band force after each outer iteration, in eV/Angstrom. .. py:property:: path :type: NEBPath | None The relaxed band, or ``None`` when the run produced no path. .. py:method:: image_energies() -> numpy.typing.NDArray[numpy.float64] Energy of every image in eV, endpoints included. .. py:method:: 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())``. .. py:method:: 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. .. py:class:: OCINEBResult Result of a run_ocineb run: NEB summary plus dimer accounting. .. py:property:: neb_result :type: GPNEBResult The NEB result of the run. .. py:property:: dimer_ran :type: bool True when a dimer burst ran. .. py:property:: dimer_converged :type: bool True when the dimer reported convergence. .. py:property:: dimer_oracle_calls :type: int Oracle evaluations spent in dimer bursts. .. py:property:: mmf_bursts :type: int Number of minimum-mode-following bursts that ran. .. py:property:: barrier_energy :type: float Barrier energy of the run in eV. .. py:property:: ci_index_evaluated :type: bool Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: refinements :type: int Number of band refinements (image doublings) folded into this result. .. py:property:: band_certificate_evaluated :type: bool Band discretization certificate on the returned band (leak and chord-perpendicular residual at the climbing-image neighbours). .. py:property:: band_certificate_holds :type: bool Whether the band discretization certificate holds. .. py:property:: band_certificate_leak :type: float Leak of the band discretization certificate at the climbing-image neighbours. .. py:property:: band_certificate_residual :type: float Chord-perpendicular residual of the band discretization certificate at the climbing-image neighbours. .. py:property:: band_midpoint_evaluated :type: bool Whether certifyBandMidpoints evaluated the returned band. .. py:property:: band_midpoint_holds :type: bool Whether each segment midpoint energy upper bound is at most the climbing-image energy. .. py:property:: band_midpoint_excess :type: float Mean E_mid - E_ci (eV) on the segment with the highest energy upper bound. .. py:property:: band_midpoint_segment :type: int Index of the segment with the highest energy upper bound, or -1 when none. .. py:property:: ci_index_certified :type: bool Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: ci_index_attempts :type: int Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: ci_index_oracle_calls :type: int Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: ci_index_curvature1 :type: float Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: ci_index_curvature2 :type: float Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: ci_index_verified :type: bool Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: ci_index_residual1 :type: float Climbing-image index certificate (see certifyClimbingImageIndex). .. py:property:: ci_index_residual2 :type: float Climbing-image index certificate (see certifyClimbingImageIndex). .. py:class:: PeriodicBandDefaults Defaults of the periodic local band, shared with the C API. .. py:attribute:: n_images :type: int .. py:attribute:: fmax :type: float .. py:attribute:: steps :type: int .. py:attribute:: max_move :type: float .. py:attribute:: spring_constant :type: float .. py:attribute:: climb :type: bool .. py:attribute:: seed :type: int .. py:attribute:: verbose :type: bool .. py:attribute:: config :type: GPNEBConfig .. py:function:: periodic_band_defaults() -> PeriodicBandDefaults The periodic local band defaults. .. py:class:: HssvdBackend Bases: :py:obj:`enum.IntEnum` Posterior solver on a model config. Default keeps library HS-SVD. .. py:attribute:: Default :value: 0 .. py:attribute:: Hssvd :value: 1 .. py:attribute:: Cholesky :value: 2 .. py:class:: PeriodicBandInitial Bases: :py:obj:`enum.IntEnum` Initial path construction for periodic local bands. .. py:attribute:: Linear :value: 0 .. py:attribute:: Idpp :value: 1 .. py:attribute:: Sidpp :value: 2 .. py:class:: LocalBandConfig Local-band configuration mirroring gpr_local_band_config_t. .. py:attribute:: fraction :type: float .. py:attribute:: radius :type: float .. py:attribute:: window :type: int .. py:attribute:: trust :type: float .. py:attribute:: inner_max :type: int .. py:attribute:: refit_iters :type: int .. py:attribute:: inner_tol_factor :type: float .. py:attribute:: phase :type: int .. py:attribute:: refit_every :type: int .. py:attribute:: noise :type: float .. py:attribute:: pair_cutoff :type: float .. py:attribute:: pair_spacing :type: float .. py:attribute:: far_trust :type: float .. py:attribute:: far_refresh :type: float .. py:attribute:: initial_sweep :type: int .. py:attribute:: batch :type: int .. py:attribute:: batch_growth :type: int .. py:attribute:: batch_max :type: int .. py:attribute:: sweep_images :type: int .. py:attribute:: jacobi :type: int .. py:attribute:: grow_radius :type: float .. py:attribute:: safeguard :type: int .. py:attribute:: keep_memory :type: int .. py:attribute:: residual :type: int .. py:attribute:: pair_split :type: float .. py:attribute:: pair_tail_refresh :type: float .. py:attribute:: cycles :type: int .. py:attribute:: sweep :type: int .. py:attribute:: force_stop_certificate :type: int .. py:attribute:: certificate_step :type: float .. py:attribute:: vibrational_stencil :type: int .. py:class:: PeriodicBandConfig Periodic local-band configuration mirroring gpr_periodic_band_config_t. .. py:attribute:: fmax :type: float .. py:attribute:: spring_constant :type: float .. py:attribute:: max_move :type: float .. py:attribute:: steps :type: int .. py:attribute:: climb :type: int .. py:attribute:: initial :type: int .. py:attribute:: seed :type: int .. py:attribute:: verbose :type: int .. py:attribute:: convergence_norm :type: int .. py:function:: status_name(status: int) -> str Short static name of a GPR_* status code. .. py:function:: 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``. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:class:: AtomicDimer Single-saddle dimer search driver. Construct with no arguments, call ``initialize()`` with a parameter dict and the initial data, then ``execute()`` with a :class:`PotentialWrapper`; query results via the ``get_*`` methods. .. py:method:: 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. .. py:method:: 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. .. py:method:: set_training_policy(policy: object | None) -> None Install a training policy for ``execute``. None restores the engine. .. py:method:: 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. .. py:method:: get_final_force_at_mid_point() -> numpy.typing.NDArray[numpy.float64] Deprecated alias of :meth:`get_final_gradient_at_mid_point`. Despite the name it returns the gradient, not the force, and emits a ``DeprecationWarning``. .. py:method:: get_final_coord_of_mid_point() -> numpy.typing.NDArray[numpy.float64] Flat coordinates of the final mid-point, in Angstrom. .. py:method:: get_total_force_calls() -> int Number of true potential evaluations. .. py:method:: get_total_gpr_force_calls() -> int Number of surrogate evaluations. .. py:method:: get_iterations() -> int Outer iterations (relaxation phases) completed. .. py:method:: 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 :meth:`get_energy_zero_level` for the absolute energy. .. py:method:: get_energy_zero_level() -> float Energy in eV that the dimer measures its energies from. .. py:method:: get_final_curvature() -> float Curvature along the dimer axis at the end of the search, in eV/Angstrom^2. .. py:method:: get_converged() -> bool True when the true force criterion is met and the index stencil at that point measures exactly one negative mode. .. py:method:: 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. .. py:method:: 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. .. py:method:: get_force_stop_certified() -> bool True when the index stencil at the force stop measured one negative mode. .. py:method:: get_force_stop_certificate_calls() -> int True potential evaluations the force-stop index stencil spent. .. py:method:: 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. .. py:method:: 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"``. .. py:method:: 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. .. py:method:: 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. .. py:method:: 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. .. py:method:: get_gpr_model() -> GaussianProcessRegression | None The surrogate the search used, or ``None``. .. py:method:: set_profile_dimer_times(enabled: bool) -> None Enable dimer phase timing output. .. py:method:: get_profile_dimer_times() -> bool Return whether dimer phase timing output is enabled. .. py:method:: get_active_set_change_count() -> int Number of times activateFrozenAtoms grew the active frozen set (the bloat / stale-history stressor; CuH2-step demonstrator). .. py:method:: get_active_frozen_count() -> int Current number of active frozen atoms. .. py:attribute:: atoms_config :type: AtomsConfiguration .. py:function:: 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``. .. py:function:: linalg_mode() -> str The selected distributed factorization, ``"reproducible"`` or ``"library"``. .. py:function:: 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``. .. py:function:: 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. .. py:function:: training_product_configured() -> bool True when a Scheme II engine or a product library is selected. .. py:function:: check_model_package(path: str) -> None RuntimeError when the AOTInductor package needs a CPU extension the host lacks. .. py:function:: backend_name() -> str Compiled linear-algebra backend, such as ``"eigen"`` or ``"scalapack"``. .. py:function:: 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. .. py:function:: component_registry() -> dict[str, Any] Canonical runtime component registry, its SHA-256, and components. .. py:function:: check_abi() -> None Raise ``ABIError`` naming both stamps when a loaded native library does not match the header that gpridge was built against. .. py:class:: SecantHessianMethod Bases: :py:obj:`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. .. py:attribute:: BFGS :value: 0 .. py:attribute:: SR1 :value: 1 .. py:attribute:: Bofill :value: 2 .. py:class:: SecantSeedStatus Bases: :py:obj:`enum.IntEnum` Why a secant Newton step was or was not used. .. py:attribute:: Seeded :value: 0 .. py:attribute:: NoAcceptedPair :value: 1 .. py:attribute:: DimensionMismatch :value: 2 .. py:attribute:: NoResolvedCurvature :value: 3 .. py:attribute:: NoCurrentDirection :value: 4 .. py:attribute:: NotPositiveDefinite :value: 5 .. py:class:: 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. .. py:attribute:: method :type: SecantHessianMethod .. py:attribute:: consistency_check :type: bool .. py:attribute:: quadratic_prior_mean :type: bool .. py:attribute:: seed_curvature :type: bool .. py:attribute:: consistency_relative_tolerance :type: float .. py:attribute:: finite_difference_step :type: float .. py:class:: 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). .. py:attribute:: trust_radius :type: float .. py:attribute:: conv_tol :type: float .. py:attribute:: max_iter :type: int .. py:attribute:: max_inner_steps :type: int .. py:attribute:: max_oracle_calls :type: int .. py:attribute:: gp_train_iter :type: int .. py:attribute:: n_initial_perturb :type: int .. py:attribute:: perturb_scale :type: float .. py:attribute:: max_move :type: float .. py:attribute:: max_training_points :type: int .. py:attribute:: fps_history :type: int .. py:attribute:: jitter_sigma2 :type: float .. py:attribute:: use_hssvd_solver :type: bool .. py:attribute:: verbose :type: bool .. py:attribute:: seed :type: int .. py:attribute:: secant :type: SecantHessianConfig .. py:class:: 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. .. py:property:: x_final :type: 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). .. py:property:: e_final :type: 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). .. py:property:: g_final :type: 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). .. py:property:: converged :type: 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. .. py:property:: oracle_calls :type: int The `oracle_calls` member of `MinimizationResult`. .. py:property:: prior_observations :type: int Rows supplied by the caller. They are not included in oracle_calls. .. py:property:: total_iterations :type: int Inner surrogate steps taken across outer cycles. .. py:property:: secant_pairs :type: int Accepted true-force secant pairs. .. py:property:: secant_update_failures :type: int Moved geometries whose secant update was refused. .. py:property:: finite_difference_hvp_calls :type: int Forward force probes bought after a secant consistency mismatch. .. py:property:: secant_curvature_seed_steps :type: int Inner steps that applied a secant Newton factor. .. py:property:: secant_curvature_seed_refusals :type: int Inner steps whose secant Newton factor was refused. .. py:property:: last_secant_seed_status :type: SecantSeedStatus Status of the latest secant Newton seed. .. py:property:: last_secant_relative_error :type: float Relative mismatch of the latest secant consistency comparison. .. py:property:: energy_trajectory :type: list[float] The `energy_trajectory` member of `MinimizationResult`. .. py:class:: 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. .. py:attribute:: kind :type: str .. py:attribute:: role :type: str .. py:attribute:: iteration :type: int .. py:attribute:: oracle_calls :type: int .. py:attribute:: training_size :type: int .. py:attribute:: hyperparameter_refits :type: int .. py:attribute:: image_index :type: int .. py:attribute:: posterior_variance :type: float .. py:attribute:: force_variance :type: float .. py:attribute:: trust_radius :type: float .. py:attribute:: distance_to_training :type: float .. py:attribute:: engine_would_call_oracle :type: bool .. py:attribute:: engine_would_retrain :type: bool .. py:attribute:: engine_would_rebuild_factor :type: bool .. py:attribute:: within_trust :type: bool .. py:attribute:: surrogate_proposes_stop :type: bool .. py:property:: positions :type: numpy.typing.NDArray[numpy.float64] Copy of the candidate coordinates, or an empty vector. .. py:property:: hyperparameters :type: numpy.typing.NDArray[numpy.float64] Copy of the packed hyperparameters, or an empty vector. .. py:class:: PolicyCandidate One measured row offered to ``select_training_points``. .. py:attribute:: positions :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: energy :type: float .. py:attribute:: gradient :type: numpy.typing.NDArray[numpy.float64] .. py:attribute:: posterior_variance :type: float .. py:function:: 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. .. py:function:: 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. .. py:function:: save_gp_state(path: str, gp: GaussianProcessRegression, observations: Observation, atoms: AtomsConfiguration) -> None Write a trained GP to ``gp-state.npz``. .. py:function:: load_gp_observations(path: str) -> Observation Read the observation rows of a ``gp-state.npz`` file. .. py:function:: apply_saved_gp_state(gp: GaussianProcessRegression, path: str) -> None Install the fitted kernel of a ``gp-state.npz`` onto an initialized model. .. py:function:: train_phase_reset() -> None Zero the train-phase wall-time accumulators. .. py:function:: train_phase_read() -> dict[str, float] Read the five train-phase wall-time accumulators. .. py:function:: train_phase_read_leaves() -> dict[str, float] Read the ten train-phase leaf accumulators. .. py:function:: set_library_serial(enabled: bool) -> None Select Eigen serial factor/solves (True) or OpenMP panel kernels (False). .. py:function:: build_info() -> dict[str, str] Digest and SOURCE_DATE_EPOCH compiled from gpr_sbom_digest.h. .. py:function:: version_components() -> tuple[int, int, int] Return (major, minor, patch) of the loaded library. .. py:function:: abi_version() -> tuple[int, int] Return (major, minor) of the loaded library's C ABI. .. py:function:: backend_requires_mpi() -> bool True if the compiled linear-algebra backend requires MPI_Init. .. py:function:: mpi_initialized() -> bool True if MPI_Init has been called. .. py:function:: mpi_world_rank() -> int MPI rank in MPI_COMM_WORLD, or 0 without MPI. .. py:function:: mpi_world_size() -> int MPI size of MPI_COMM_WORLD, or 1 without MPI. .. py:function:: omp_max_threads() -> int OpenMP thread budget for this process. .. py:function:: 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. .. py:function:: potential_muller_brown(xy: numpy.typing.NDArray[numpy.float64]) -> tuple[float, numpy.typing.NDArray[numpy.float64]] Evaluate Muller-Brown energy and gradient. .. py:function:: potential_leps(r: numpy.typing.NDArray[numpy.float64]) -> tuple[float, numpy.typing.NDArray[numpy.float64]] Evaluate LEPS collinear potential energy and gradient. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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). .. py:function:: 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. .. py:function:: htst_ln_prefactor(minimum: HtstHalf, saddle: HtstHalf) -> tuple[float, float] (ln nu, std) = ln_sum(minimum) - ln_sum(saddle). .. py:function:: 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. .. py:function:: search_prefactor(point: HtstPoint) -> HtstHalf The HTST half of this thread's last search at point.