.. index:: pair: namespace; gpr .. _doxid-namespacegpr: namespace gpr ============= .. toctree:: :hidden: namespace_gpr_abi.rst namespace_gpr_bo.rst namespace_gpr_capi.rst namespace_gpr_cli.rst namespace_gpr_coord.rst namespace_gpr_derivatives.rst namespace_gpr_extended.rst namespace_gpr_field.rst namespace_gpr_geometry.rst namespace_gpr_htst.rst namespace_gpr_io.rst namespace_gpr_irc.rst namespace_gpr_itergp.rst namespace_gpr_kokkos_environment.rst namespace_gpr_laplace.rst namespace_gpr_linalg.rst namespace_gpr_memory.rst namespace_gpr_neb.rst namespace_gpr_numerics.rst namespace_gpr_optim.rst namespace_gpr_optim_abi.rst namespace_gpr_pairlocal.rst namespace_gpr_policy.rst namespace_gpr_posterior.rst namespace_gpr_potentials.rst namespace_gpr_priors.rst namespace_gpr_quantum.rst namespace_gpr_readcon_abi.rst namespace_gpr_readcon_db_abi.rst namespace_gpr_rgmin_abi.rst namespace_gpr_rgpot_abi.rst namespace_gpr_runtime.rst namespace_gpr_sfc.rst namespace_gpr_ski.rst namespace_gpr_startup.rst namespace_gpr_track.rst namespace_gpr_uasaddle.rst namespace_gpr_vecchia.rst enum_gpr_BorderedSchurSign.rst enum_gpr_ChartScalarKernel.rst enum_gpr_GPModelProfile.rst enum_gpr_HyperparameterObjectiveMode.rst enum_gpr_HyperparameterOptimizationMode.rst enum_gpr_MapPriorWeightMode.rst enum_gpr_PriorMeanStatistic.rst enum_gpr_ScgCurvatureMode.rst enum_gpr_UncertaintyMode.rst struct_gpr_ARDSearchResult.rst struct_gpr_AdamOptimizationSettings.rst struct_gpr_AtomicEnvironments.rst struct_gpr_AtomsConfiguration.rst struct_gpr_AtomsPositionAndType.rst struct_gpr_BMAPrediction.rst struct_gpr_BorderedNoiseReport.rst struct_gpr_BorderedVarianceInterval.rst struct_gpr_CanonicalDimerDefaultOptions.rst struct_gpr_CeresOptimizationSettings.rst struct_gpr_CutoffPairFeature.rst struct_gpr_Derivatives.rst struct_gpr_DeviceResidency.rst struct_gpr_EnergyAndGradient.rst struct_gpr_EnergySurfaceOutputInfo.rst struct_gpr_FactoredTrainingGeometry.rst struct_gpr_GPRSetup.rst struct_gpr_INLAPrediction.rst struct_gpr_Indices2D.rst struct_gpr_InputParameters.rst struct_gpr_IterationsLimits.rst struct_gpr_JointObservationVarianceReduction.rst struct_gpr_KeyValuePair.rst struct_gpr_LBFGSInfo.rst struct_gpr_LazyFactoredTrainingGeometry.rst struct_gpr_NoiseSearchResult.rst struct_gpr_Observation.rst struct_gpr_OptimizerCommonSettings.rst struct_gpr_Pair.rst struct_gpr_PhaseTimers.rst struct_gpr_PhaseTotals.rst struct_gpr_PublicLayoutBytes.rst struct_gpr_RFFFeatureSelection.rst struct_gpr_RFFValidationPlan.rst struct_gpr_RadialPairFeature.rst struct_gpr_RigidDeflationDiagnostic.rst struct_gpr_SaddleCertificate.rst struct_gpr_ScaleFreeTrustConfig.rst struct_gpr_ScgOptimizationSettings.rst struct_gpr_SexpatLocalOracleScope.rst struct_gpr_StableBasisPosteriorWeights.rst struct_gpr_StopCriteriaForDimer.rst struct_gpr_StructuredPermutation.rst struct_gpr_SupportedAtomicEnvironments.rst struct_gpr_TrainingKernelGeometry.rst struct_gpr_TrainingKernelGeometryBlock.rst struct_gpr_TrainingKernelGeometrySubset.rst struct_gpr_TransitionParameters.rst struct_gpr_Triplet.rst class_gpr_ARDGridSearch.rst class_gpr_AdditivePairKernel.rst class_gpr_AtomicInducingPosterior.rst class_gpr_BayesianModelAveraging.rst class_gpr_ConditionalKernelProjection.rst class_gpr_ConditionalPosterior.rst class_gpr_ConditionedKernel.rst class_gpr_ConstantCF.rst class_gpr_ConstrainedChartCovariance.rst class_gpr_FactorizedLikelihood.rst class_gpr_FeatomicEnvironmentDescriptor.rst class_gpr_GaussianProcessRegression.rst class_gpr_GeodesicCovarianceEvidence.rst class_gpr_GeodesicHeat.rst class_gpr_GeodesicHeatEnergyForceKernel.rst class_gpr_InverseDistanceDescriptor.rst class_gpr_KernelOperator.rst class_gpr_Kronecker.rst class_gpr_LaplaceINLA.rst class_gpr_LikGaussian.rst class_gpr_LowRankCholesky.rst class_gpr_ManifoldEnergyForceKernel.rst class_gpr_Matern52.rst class_gpr_ModeRefitPolicy.rst class_gpr_MpiLifetime.rst class_gpr_NoiseGridSearch.rst class_gpr_ObservationLikelihood.rst class_gpr_PairCutoff.rst class_gpr_PriorBase.rst class_gpr_PriorGaussian.rst class_gpr_PriorLogNormal.rst class_gpr_PriorLogUnif.rst class_gpr_PriorSqrtt.rst class_gpr_PriorT.rst class_gpr_PriorUnif.rst class_gpr_Project.rst class_gpr_Pullback.rst class_gpr_RFFFeatureSelectionError.rst class_gpr_RFFModel.rst class_gpr_RandomFourierFeatures.rst class_gpr_ScaleFreeTrustRegion.rst class_gpr_ScopedPhaseTimer.rst class_gpr_ScopedPredictTimer.rst class_gpr_ScopedVarianceTimer.rst class_gpr_Sexpat.rst class_gpr_SexpatCF.rst class_gpr_SpeciesEnvironmentKernel.rst class_gpr_StableBasis1D.rst class_gpr_StableBasisND.rst class_gpr_StationaryChartKernel.rst class_gpr_StudentTProcessRegression.rst class_gpr_Sum.rst class_gpr_TrustRadius.rst class_gpr_WallClockLimit.rst class_gpr_WallClockLimitReached.rst Overview ~~~~~~~~ Gaussian-process regression, kernels, priors, and the searches that run on the surrogate. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace gpr { // namespaces namespace :ref:`gpr::abi`; namespace :ref:`gpr::bo`; namespace :ref:`gpr::bo::testing`; namespace :ref:`gpr::capi`; namespace :ref:`gpr::capi::testing`; namespace :ref:`gpr::cli`; namespace :ref:`gpr::coord`; namespace :ref:`gpr::derivatives`; namespace :ref:`gpr::derivatives::generated`; namespace :ref:`gpr::extended`; namespace :ref:`gpr::extended::directed`; namespace :ref:`gpr::extended::scaled`; namespace :ref:`gpr::field`; namespace :ref:`gpr::geometry`; namespace :ref:`gpr::htst`; namespace :ref:`gpr::io`; namespace :ref:`gpr::irc`; namespace :ref:`gpr::itergp`; namespace :ref:`gpr::kokkos_environment`; namespace :ref:`gpr::laplace`; namespace :ref:`gpr::linalg`; namespace :ref:`gpr::linalg::backend`; namespace :ref:`gpr::linalg::canonical`; namespace :ref:`gpr::linalg::cutlass`; namespace :ref:`gpr::linalg::fixed`; namespace :ref:`gpr::linalg::kokkos_joint`; namespace :ref:`gpr::linalg::linop`; namespace :ref:`gpr::linalg::portable_tiles`; namespace :ref:`gpr::linalg::schemeii`; namespace :ref:`gpr::memory`; namespace :ref:`gpr::neb`; namespace :ref:`gpr::neb::oie`; namespace :ref:`gpr::numerics`; namespace :ref:`gpr::optim`; namespace :ref:`gpr::optim_abi`; namespace :ref:`gpr::pairlocal`; namespace :ref:`gpr::policy`; namespace :ref:`gpr::posterior`; namespace :ref:`gpr::potentials`; namespace :ref:`gpr::priors`; namespace :ref:`gpr::quantum`; namespace :ref:`gpr::quantum::bathresponse`; namespace :ref:`gpr::quantum::beadcorrection`; namespace :ref:`gpr::quantum::elementfluct`; namespace :ref:`gpr::quantum::functionaldesign`; namespace :ref:`gpr::quantum::gaussian`; namespace :ref:`gpr::quantum::ratepost`; namespace :ref:`gpr::quantum::ringbath`; namespace :ref:`gpr::quantum::ringspread`; namespace :ref:`gpr::quantum::spectraldet`; namespace :ref:`gpr::readcon_abi`; namespace :ref:`gpr::readcon_db_abi`; namespace :ref:`gpr::rgmin_abi`; namespace :ref:`gpr::rgpot_abi`; namespace :ref:`gpr::runtime`; namespace :ref:`gpr::sfc`; namespace :ref:`gpr::ski`; namespace :ref:`gpr::startup`; namespace :ref:`gpr::track`; namespace :ref:`gpr::uasaddle`; namespace :ref:`gpr::vecchia`; // typedefs typedef uint32_t :target:`Index_t`; typedef Eigen::Matrix`, :ref:`EigenDynamic`, :ref:`EigenMatrixStorage`> :target:`EigenMatrix`; typedef Eigen::Matrix`, :ref:`EigenDynamic`, :ref:`FieldMatrixStorage`> :target:`FieldMatrixd`; typedef Eigen::Matrix`, :ref:`EigenDynamic`, :ref:`FieldMatrixStorage`> :target:`FieldMatrixi`; typedef Eigen::Matrix<:ref:`Index_t`, :ref:`EigenDynamic`, :ref:`EigenDynamic`, :ref:`FieldMatrixStorage`> :target:`FieldMatrixIdx`; typedef Eigen::Matrix`, :ref:`EigenDynamic`, :ref:`FieldMatrixStorage`> :target:`FieldMatrixU8`; typedef :ref:`FieldMatrixd` :target:`Coord`; typedef Eigen::Vector3d :target:`vector3_reg`; typedef std::vector<:ref:`CutoffPairFeature`> :target:`CutoffPairFeatures`; typedef std::function :ref:`RefusalAwareHessianAction`; typedef std::function<:ref:`RefusalAwareHessianAction`(const Eigen::VectorXd&, bool&exact_refusal)> :ref:`RefusalAwareHessianPreparation`; typedef std::function<:ref:`EigenMatrix`(const std::vector&lengthscales, double noise)> :ref:`KernelMatrixBuilder`; // enums enum :ref:`BorderedSchurSign`; enum :ref:`ChartScalarKernel`; enum :ref:`GPModelProfile`; enum :ref:`HyperparameterObjectiveMode`; enum :ref:`HyperparameterOptimizationMode`; enum :ref:`MapPriorWeightMode`; enum :ref:`PriorMeanStatistic`; enum :ref:`ScgCurvatureMode`; enum :ref:`UncertaintyMode`; // structs struct :ref:`ARDSearchResult`; struct :ref:`AdamOptimizationSettings`; struct :ref:`AtomicEnvironments`; struct :ref:`AtomsConfiguration`; struct :ref:`AtomsPositionAndType`; struct :ref:`BMAPrediction`; struct :ref:`BorderedNoiseReport`; struct :ref:`BorderedVarianceInterval`; struct :ref:`CanonicalDimerDefaultOptions`; struct :ref:`CeresOptimizationSettings`; struct :ref:`CutoffPairFeature`; template struct :ref:`Derivatives`; struct :ref:`DeviceResidency`; struct :ref:`EnergyAndGradient`; struct :ref:`EnergySurfaceOutputInfo`; struct :ref:`FactoredTrainingGeometry`; struct :ref:`GPRSetup`; struct :ref:`INLAPrediction`; struct :ref:`Indices2D`; struct :ref:`InputParameters`; struct :ref:`IterationsLimits`; struct :ref:`JointObservationVarianceReduction`; template struct :ref:`KeyValuePair`; struct :ref:`LBFGSInfo`; struct :ref:`LazyFactoredTrainingGeometry`; struct :ref:`NoiseSearchResult`; struct :ref:`Observation`; struct :ref:`OptimizerCommonSettings`; template struct :ref:`Pair`; struct :ref:`PhaseTimers`; struct :ref:`PhaseTotals`; struct :ref:`PublicLayoutBytes`; struct :ref:`RFFFeatureSelection`; struct :ref:`RFFValidationPlan`; struct :ref:`RadialPairFeature`; struct :ref:`RigidDeflationDiagnostic`; struct :ref:`SaddleCertificate`; struct :ref:`ScaleFreeTrustConfig`; struct :ref:`ScgOptimizationSettings`; struct :ref:`SexpatLocalOracleScope`; struct :ref:`StableBasisPosteriorWeights`; struct :ref:`StopCriteriaForDimer`; struct :ref:`StructuredPermutation`; struct :ref:`SupportedAtomicEnvironments`; struct :ref:`TrainingKernelGeometry`; struct :ref:`TrainingKernelGeometryBlock`; struct :ref:`TrainingKernelGeometrySubset`; struct :ref:`TransitionParameters`; template struct :ref:`Triplet`; // classes class :ref:`ARDGridSearch`; class :ref:`AdditivePairKernel`; class :ref:`AtomicInducingPosterior`; class :ref:`BayesianModelAveraging`; class :ref:`ConditionalKernelProjection`; class :ref:`ConditionalPosterior`; class :ref:`ConditionedKernel`; class :ref:`ConstantCF`; class :ref:`ConstrainedChartCovariance`; class :ref:`FactorizedLikelihood`; class :ref:`FeatomicEnvironmentDescriptor`; class :ref:`GaussianProcessRegression`; class :ref:`GeodesicCovarianceEvidence`; class :ref:`GeodesicHeat`; class :ref:`GeodesicHeatEnergyForceKernel`; class :ref:`InverseDistanceDescriptor`; class :ref:`KernelOperator`; class :ref:`Kronecker`; class :ref:`LaplaceINLA`; class :ref:`LikGaussian`; class :ref:`LowRankCholesky`; class :ref:`ManifoldEnergyForceKernel`; class :ref:`Matern52`; class :ref:`ModeRefitPolicy`; class :ref:`MpiLifetime`; class :ref:`NoiseGridSearch`; class :ref:`ObservationLikelihood`; class :ref:`PairCutoff`; class :ref:`PriorBase`; class :ref:`PriorGaussian`; class :ref:`PriorLogNormal`; class :ref:`PriorLogUnif`; class :ref:`PriorSqrtt`; class :ref:`PriorT`; class :ref:`PriorUnif`; class :ref:`Project`; class :ref:`Pullback`; class :ref:`RFFFeatureSelectionError`; class :ref:`RFFModel`; class :ref:`RandomFourierFeatures`; class :ref:`ScaleFreeTrustRegion`; class :ref:`ScopedPhaseTimer`; class :ref:`ScopedPredictTimer`; class :ref:`ScopedVarianceTimer`; class :ref:`Sexpat`; class :ref:`SexpatCF`; class :ref:`SpeciesEnvironmentKernel`; class :ref:`StableBasis1D`; class :ref:`StableBasisND`; template class :ref:`StationaryChartKernel`; class :ref:`StudentTProcessRegression`; class :ref:`Sum`; class :ref:`TrustRadius`; class :ref:`WallClockLimit`; class :ref:`WallClockLimitReached`; // global variables auto :target:`EigenDynamic` = Eigen::Dynamic; auto :target:`EigenMatrixStorage` = Eigen::StorageOptions::ColMajor; auto :target:`FieldMatrixStorage` = Eigen::StorageOptions::RowMajor; :ref:`ChartScalarKernel` :target:`kDefaultChartScalarKernel` = :ref:`ChartScalarKernel::SquaredExponential`; bool :ref:`sexpat_local_oracle_active` = false; double :target:`g_geom_build_seconds` = 0.0; double :target:`g_max_cond_k` = 0.0; double :target:`g_max_abs_alpha` = 0.0; double :ref:`kRFFEnergyNoiseFloor` = 1e-6; double :ref:`kRFFGradientNoiseFloor` = 1e-4; double :ref:`kRFFForceConvergenceTolerance` = 0.0514221; std::uint64_t :ref:`kRFFValidationMemoryCapBytes` = 256ull* 1024ull* 1024ull; int :ref:`kRFFFeaturesAuto` = -1; // global functions std::optional<:ref:`ConvergenceNormType`> :ref:`parseForceNorm`(std::string_view name); std::string_view :target:`forceNormName`(std::optional<:ref:`ConvergenceNormType`> norm); template double :ref:`forceNorm`(const Eigen::MatrixBase& force, :ref:`ConvergenceNormType` norm); template double :ref:`forceDualNorm`(const Eigen::MatrixBase& direction, :ref:`ConvergenceNormType` norm); std::vector<:ref:`CutoffPairFeatures`> :ref:`cutoffPairFeatures`(const :ref:`Coord`& positions, const :ref:`AtomsConfiguration`& configuration); std::vector<:ref:`CutoffPairFeatures`> :ref:`radialPairFeatures`(const :ref:`Coord`& positions, const :ref:`AtomsConfiguration`& configuration); std::vector<:ref:`CutoffPairFeatures`> :ref:`radialPairFeatures`(const :ref:`Coord`& positions, const :ref:`AtomsConfiguration`& configuration, double far_radius); std::vector<:ref:`FieldMatrixd`> :ref:`cutoffPairSquaredDistances`(const :ref:`Coord`& left, const :ref:`Coord`& right, const :ref:`AtomsConfiguration`& configuration, const :ref:`FieldMatrixd`& lengths); std::vector<:ref:`FieldMatrixd`> :target:`radialPairSquaredDistances`(const :ref:`Coord`& left, const :ref:`Coord`& right, const :ref:`AtomsConfiguration`& configuration, const :ref:`FieldMatrixd`& lengths, double far_radius); template void :ref:`forEachCutoffPair`(const :ref:`CutoffPairFeatures`& left, const :ref:`CutoffPairFeatures`& right, Function&& function); std::string :ref:`sha256Hex`(const void* data, std::size_t size); std::string :ref:`sha256File`(const std::string& path); bool :ref:`conditionKernelMatrix`(const Eigen::MatrixXd& joint, const std::vector& derivatives, Eigen::Index anchor_rows, Eigen::Index query_rows, Eigen::Index dimensions, const Eigen::VectorXd& anchor_noise, Eigen::MatrixXd& covariance, std::vector& conditional_derivatives); bool :target:`conditionKernelMatrix`(const Eigen::MatrixXd& joint, const std::vector& derivatives, Eigen::Index anchor_rows, Eigen::Index query_rows, Eigen::Index dimensions, const Eigen::VectorXd& anchor_noise, Eigen::MatrixXd& covariance, std::vector& conditional_derivatives, const :ref:`linalg::LocalExecutor`& execution); :ref:`KernelOperator::CrossCovarianceFunction` :target:`makeKernelCrossCovariance`(std::shared_ptr`> kernel, const Eigen::MatrixXd& training); :ref:`KernelOperator::MeanFunction` :ref:`makeKernelMean`(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights); :ref:`KernelOperator::MeanHessianFunction` :ref:`makeAnalyticKernelMeanHessianVector`(const std::shared_ptr`>& kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights); :ref:`KernelOperator::MeanHessianPreparation` :target:`makeAnalyticKernelMeanHessian`(const std::shared_ptr`>& kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights); :ref:`KernelOperator::MeanHessianFunction` :target:`makeKernelMeanHessianVector`(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights); :ref:`RefusalAwareHessianPreparation` :ref:`makeRefusalAwareKernelMeanHessian`(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights, bool* all_exact = nullptr, bool* has_exact_or_refusal = nullptr); :ref:`KernelOperator::MeanHessianPreparation` :target:`makeKernelMeanHessian`(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights); :ref:`KernelOperator::MeanHessianMatrixFunction` :ref:`makeKernelMeanHessianMatrix`(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights); std::shared_ptr`> :ref:`makeChartScalarKernel`(std::shared_ptr`> chart, double magnitude_variance, double length_scale, :ref:`ChartScalarKernel` kernel); bool :target:`ownsBlock`(long block_idx, int rank, int nprocs, bool serial_per_rank); bool :target:`ownsBlockIfReduce`(long block_idx, int rank, int nprocs, bool do_reduce); bool :target:`buildFactoredTrainingGeometry`(const :ref:`AtomsConfiguration`& conf_info, const :ref:`FieldMatrixd`& x_loc, :ref:`FactoredTrainingGeometry`& out, double far_field_radius = 0.0); bool :ref:`buildCrossBlockDerivativesFactored`(const :ref:`FactoredTrainingGeometry`& factors, :ref:`Index_t` block_n, :ref:`Index_t` block_m, uint8_t derivative_options, :ref:`SexpatCF::CrossBlockGeometry`& out); const :ref:`SexpatCF::CrossBlockGeometry`* :ref:`resolveTrainingBlockGeometry`(const :ref:`SexpatCF`& covariance, const :ref:`TrainingKernelGeometry`& geom, const :ref:`TrainingKernelGeometryBlock`& block, :ref:`SexpatCF::CrossBlockGeometry`& scratch); double :ref:`lengthscaleProjectionFloor`(double max_pair_distance, double absolute_floor); Eigen::MatrixXd :ref:`hssvdHermiteCartesianAction`(const Eigen::MatrixXd& jacobian, const Eigen::MatrixXd& residuals, const Eigen::MatrixXd& force_weights, const Eigen::VectorXd& energy_kernel_weights, const Eigen::VectorXd& force_kernel_weights, const Eigen::VectorXd& force_residual_dots, double energy_kernel_weight_sum, double force_kernel_residual_dot_sum, const Eigen::MatrixXd& directions); bool :ref:`arrowheadEigenpairs`(const Eigen::Ref& diagonal, const Eigen::Ref& spike, double corner, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs); bool :ref:`extendSymmetricSpectrum`(const Eigen::Ref& grown, const Eigen::Ref& diagonal, const Eigen::Ref& basis, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs); bool :ref:`priorFreeReplicatedInverse`(bool cholmod, bool scalapack, bool slate, bool unregularized, bool use_hssvd_gradient); bool :ref:`useDenseFactorForTrace`(bool prior_free_inverse, bool use_hssvd_gradient, bool distributed_factor, long long factor_rows, long long factor_cols, long long target_size); :ref:`RFFValidationPlan` :ref:`planRFFFeatureValidation`(int n_geometries, int cartesian_dimension, std::uint64_t memory_cap_bytes = :ref:`kRFFValidationMemoryCapBytes`); std::vector :ref:`rffFarthestPointOrder`(const Eigen::MatrixXd& positions); std::string :target:`formatRFFFeatureSelection`(const :ref:`RFFFeatureSelection`& report); bool :ref:`looCalibrationIsUnityFromCholeskyDiagonal`(const Eigen::VectorXd& alpha, const Eigen::VectorXd& diagonal); double :ref:`looVarianceCalibrationFactor`(const Eigen::VectorXd& alpha, const Eigen::VectorXd& inv_diag); bool :ref:`stabilizePosteriorCovariance`(Eigen::MatrixXd& covariance); bool :ref:`subtractStableBasisProjectedCrossCovariance`(const :ref:`StableBasisND`& basis, const Eigen::MatrixXd& Kstar, const Eigen::MatrixXd& Kright, const Eigen::MatrixXd& prior, double total_sigma2, Eigen::MatrixXd& K_post, bool contracted_mean = false, Eigen::Index left_queries = 1, Eigen::Index right_queries = 1); Eigen::VectorXd :target:`applyStableBasisStatisticalInverse`(const :ref:`StableBasisND`& basis, const Eigen::VectorXd& rhs, double noise); bool :target:`subtractStableBasisProjectedCrossCovariance`(const :ref:`StableBasisND`& basis, const :ref:`EigenMatrix`& Kstar, const :ref:`EigenMatrix`& Kright, const :ref:`EigenMatrix`& prior, const double total_sigma2, :ref:`EigenMatrix`& K_post, bool contracted_mean, Eigen::Index left_queries, Eigen::Index right_queries); std::optional<:ref:`JointObservationVarianceReduction`> :ref:`jointObservationVarianceReduction`(Eigen::MatrixXd candidate_covariance, const Eigen::MatrixXd& target_candidate_covariance, double target_variance, double noise_variance); std::optional<:ref:`JointObservationVarianceReduction`> :ref:`jointObservationVarianceReduction`(const Eigen::MatrixXd& posterior_covariance, Eigen::Index query_count, Eigen::Index dimensions, Eigen::Index candidate_query, const std::vector& target_queries, double noise_variance); std::optional<:ref:`JointObservationVarianceReduction`> :ref:`jointObservationForceVarianceReduction`(const Eigen::MatrixXd& posterior_covariance, Eigen::Index query_count, Eigen::Index dimensions, Eigen::Index candidate_query, const std::vector& target_queries, double noise_variance); Eigen::VectorXd :ref:`findFMode`(const :ref:`EigenMatrix`& K, const Eigen::VectorXd& y, const :ref:`ObservationLikelihood`& ol, int max_iter = 30, double tol = 1e-8); double :ref:`laplaceMarginalLogLik`(const :ref:`EigenMatrix`& K, const Eigen::VectorXd& y, const Eigen::VectorXd& f_mode, const :ref:`ObservationLikelihood`& ol); :ref:`StructuredPermutation` :target:`buildStructuredPermutation`(const Eigen::VectorXd& ind_Ddim); :ref:`StructuredPermutation` :target:`buildObservationTiledPermutation`(const Eigen::VectorXd& ind_Ddim); Eigen::VectorXd :target:`permuteVector`(const Eigen::VectorXd& input, const :ref:`StructuredPermutation`& p); Eigen::VectorXd :target:`unpermuteVector`(const Eigen::VectorXd& input, const :ref:`StructuredPermutation`& p); :ref:`EigenMatrix` :target:`permuteMatrixRows`(const :ref:`EigenMatrix`& input, const :ref:`StructuredPermutation`& p); :ref:`EigenMatrix` :target:`unpermuteMatrixRows`(const :ref:`EigenMatrix`& input, const :ref:`StructuredPermutation`& p); :ref:`EigenMatrix` :target:`permuteSymmetricMatrix`(const :ref:`EigenMatrix`& input, const :ref:`StructuredPermutation`& p); :ref:`EigenMatrix` :target:`unpermuteSymmetricMatrix`(const :ref:`EigenMatrix`& input, const :ref:`StructuredPermutation`& p); void :target:`requireWallClock`(const std::shared_ptr`>& limit); bool :ref:`collectiveWallClockLimitReached`(const std::shared_ptr`>& limit, const :ref:`linalg::MpiContext`& context); bool :ref:`collectiveWallClockLimitReached`(const std::shared_ptr`>& limit); double :ref:`medianPairwiseDistance`(const :ref:`EigenMatrix`& R_train); :ref:`SaddleCertificate` :ref:`certifyFinalSaddle`(double true_pes_saddle_force, double conv_tol, const std::vector& per_image_variance, double variance_envelope); void :ref:`applyCanonicalReadconDimerDefaults`(:ref:`InputParameters`& parameters, const :ref:`CanonicalDimerDefaultOptions`& options = {}); :ref:`CanonicalDimerDefaultOptions` :ref:`gprdUnflaggedDimerOptions`(); void :ref:`applyGprdDimerDefaults`(:ref:`InputParameters`& parameters, const :ref:`CanonicalDimerDefaultOptions`& options = :ref:`gprdUnflaggedDimerOptions`()); bool :target:`defaultDimerImage1EachPhase`(const bool use_hssvd, const bool use_hssvd_analytic_curvature); void :target:`requirePositiveFinitePriorParameter`(const char* density, const char* name, double value); void :target:`requireFinitePriorParameter`(const char* density, const char* name, double value); :ref:`PublicLayoutBytes` :target:`libraryPublicLayout`(); :ref:`PublicLayoutBytes` :target:`consumerPublicLayout`(); bool :target:`iterationAllowedByLimit`(:ref:`Index_t` iteration, :ref:`Index_t` configured_limit); bool :ref:`usesClassicJointEnergyForcePrior`(:ref:`GPModelProfile` profile); bool :ref:`launchedOnOneNode`(); void :ref:`excludeLibfabricBtlOnOneNode`(); int :ref:`reportFatal`(const char* program, const char* what); template void :ref:`assembleCollectively`(const MpiContext& context, Matrices& result, const Body& body); double :target:`applyPrincipledDiagonalNugget`(:ref:`EigenMatrix`& K, Eigen::Index n_x, Eigen::Index d, double kappa_max, bool gradient_enhanced = true); double :target:`computePrincipledNugget`(Eigen::Index n_x, Eigen::Index d, double kappa_max, bool gradient_enhanced = true); double :target:`principledKappaMaxDefault`(); double :target:`localTraceProduct`(const :ref:`EigenMatrix`& A, const :ref:`EigenMatrix`& B); Eigen::Vector3d :target:`priorParametersVector`(const :ref:`PriorBase`& prior); Eigen::VectorXd :target:`inlaClipToLogBox`(const Eigen::VectorXd& theta, const Eigen::VectorXd& lower, const Eigen::VectorXd& upper); void :target:`addConstantCovarianceBlock`(:ref:`ConstantCF`* const_cov_fun, const Eigen::VectorXd& row_indices, const Eigen::VectorXd& col_indices, :ref:`EigenMatrix`& matrix); template bool :target:`reduce_laplace_factor_vectors_in_grid_order`(std::vector& factor_values, :ref:`linalg::BackendContext`& context); bool :target:`symmetrizeObservedInformation`(Eigen::MatrixXd& H); void :target:`writeBMAOutput`(const Eigen::VectorXd& flat, :ref:`Index_t` N_im, :ref:`Index_t` D, :ref:`Observation`& image1); void :target:`writePredictionVectorToObservation`(const :ref:`Observation`& query, const Eigen::VectorXd& values, :ref:`Observation`& out); } // namespace gpr .. _details-namespacegpr: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Gaussian-process regression, kernels, priors, and the searches that run on the surrogate. Typedefs -------- .. index:: pair: typedef; RefusalAwareHessianAction .. _doxid-namespacegpr_1a6eeeeca20b40b1e70f0e9adbcafee2e3: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef std::function RefusalAwareHessianAction Hessian action that reports whether an exact child refused. .. index:: pair: typedef; RefusalAwareHessianPreparation .. _doxid-namespacegpr_1a9b0858cbad6a7cd0a0f9a8f2208e70b6: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef std::function<:ref:`RefusalAwareHessianAction`(const Eigen::VectorXd&, bool&exact_refusal)> RefusalAwareHessianPreparation Query preparation that reports whether an exact child refused. .. index:: pair: typedef; KernelMatrixBuilder .. _doxid-namespacegpr_1ad34198070c3f65e042e2ace59b5099f2: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef std::function<:ref:`EigenMatrix`(const std::vector&lengthscales, double noise)> KernelMatrixBuilder Kernel matrix builder: given lengthscales and noise, return K_XX. Global Variables ---------------- .. index:: pair: variable; sexpat_local_oracle_active .. _doxid-namespacegpr_1a6a50a57eab678dd87b0067fa0766413b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool sexpat_local_oracle_active = false Thread-local switch for the local-oracle gradient region: when true the per-pair OpenMP pragma inside SexpatCF::calculateGradOfCov- MatrixWithDerivatives\* activates. Set to true ONLY inside the SVGD per-particle oracle (which runs serial_per_rank=true with no MPI/ScaLAPACK collectives); SCG/MAP/Laplace paths leave it false so the distributed Cholesky doesn't get nested OMP teams that would oversubscribe the host. .. index:: pair: variable; kRFFEnergyNoiseFloor .. _doxid-namespacegpr_1ae8f0d2d92bfe6faea225ae233ebc7e39: .. ref-code-block:: cpp :class: doxyrest-title-code-block double kRFFEnergyNoiseFloor = 1e-6 Energy-channel floor used by the production random-feature model. .. index:: pair: variable; kRFFGradientNoiseFloor .. _doxid-namespacegpr_1a965ba6ee5d850276e4e9bc32ff0be3e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block double kRFFGradientNoiseFloor = 1e-4 Gradient-channel floor used by the production random-feature model. .. index:: pair: variable; kRFFForceConvergenceTolerance .. _doxid-namespacegpr_1a9189b04ebe12453527ba381eeea5a3f0: .. ref-code-block:: cpp :class: doxyrest-title-code-block double kRFFForceConvergenceTolerance = 0.0514221 Band force tolerance the random-feature error is not allowed to cross. .. index:: pair: variable; kRFFValidationMemoryCapBytes .. _doxid-namespacegpr_1a7579ff92596a13aeea2cbf7697d44a08: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::uint64_t kRFFValidationMemoryCapBytes = 256ull* 1024ull* 1024ull Exact validation Gram, and the D-by-D normal matrix, stay under this. .. index:: pair: variable; kRFFFeaturesAuto .. _doxid-namespacegpr_1af2f0089225405b095d6df70204140628: .. ref-code-block:: cpp :class: doxyrest-title-code-block int kRFFFeaturesAuto = -1 Sentinel stored in integer feature-count fields for the automatic rule. Global Functions ---------------- .. index:: pair: function; parseForceNorm .. _doxid-namespacegpr_1a7201b3b1cc8fcf5aaf042a7eaa348644: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional<:ref:`ConvergenceNormType`> parseForceNorm(std::string_view name) An omitted norm preserves the search's dimension-dependent default. .. index:: pair: function; forceNorm .. _doxid-namespacegpr_1a8d41ddc2a37e66e69727d9dbd525d4fc: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double forceNorm(const Eigen::MatrixBase& force, :ref:`ConvergenceNormType` norm) Force magnitude in the selected convergence norm. .. index:: pair: function; forceDualNorm .. _doxid-namespacegpr_1aea6412f350d62a394858faf604c3a756: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double forceDualNorm(const Eigen::MatrixBase& direction, :ref:`ConvergenceNormType` norm) Dual norm bounding the magnitude of direction dot force by ||direction||\_\* ||force||. .. index:: pair: function; cutoffPairFeatures .. _doxid-namespacegpr_1ac06ca833b5a7266cebfee637c9660ab7: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`CutoffPairFeatures`> cutoffPairFeatures(const :ref:`Coord`& positions, const :ref:`AtomsConfiguration`& configuration) Sorted pair features for each configuration; absent pairs are exact zeros. .. index:: pair: function; radialPairFeatures .. _doxid-namespacegpr_1ad47b31f3f1f62caeb8e5b41737f91654: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`CutoffPairFeatures`> radialPairFeatures(const :ref:`Coord`& positions, const :ref:`AtomsConfiguration`& configuration) Radial features with analytic Cartesian curvature. A positive cutoff selects neighbours; zero retains every active moving-atom pair. .. index:: pair: function; radialPairFeatures .. _doxid-namespacegpr_1a66ec466b6f701651fecec0fbb406c122: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`CutoffPairFeatures`> radialPairFeatures(const :ref:`Coord`& positions, const :ref:`AtomsConfiguration`& configuration, double far_radius) A positive far radius compresses distant frozen atoms into linear features in the fixed reference chart. It cannot be combined with a cutoff. .. index:: pair: function; cutoffPairSquaredDistances .. _doxid-namespacegpr_1ac12276afa4a5ef43ad2c4d5b3b39334f: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`FieldMatrixd`> cutoffPairSquaredDistances(const :ref:`Coord`& left, const :ref:`Coord`& right, const :ref:`AtomsConfiguration`& configuration, const :ref:`FieldMatrixd`& lengths) Per-pairtype contributions to the :ref:`Sexpat ` squared distance, 2 sum(delta^2/l^2). .. index:: pair: function; forEachCutoffPair .. _doxid-namespacegpr_1a8144802087a58b7efc1bf7bc47e39e00: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void forEachCutoffPair(const :ref:`CutoffPairFeatures`& left, const :ref:`CutoffPairFeatures`& right, Function&& function) Visit the union of two sparse feature rows in their common pair vocabulary. .. index:: pair: function; sha256Hex .. _doxid-namespacegpr_1a498292ccaea190f937bcdbb95bc84c42: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string sha256Hex(const void* data, std::size_t size) Lowercase hexadecimal SHA-256 digest of a byte range (FIPS 180-4). .. index:: pair: function; sha256File .. _doxid-namespacegpr_1ace54cc5afc23d7c17b1bf5ab32665866: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string sha256File(const std::string& path) Digest of a file's contents; empty when the file cannot be read. .. index:: pair: function; conditionKernelMatrix .. _doxid-namespacegpr_1a36ea2a1968644b84e2fdc665f51e9f01: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool conditionKernelMatrix(const Eigen::MatrixXd& joint, const std::vector& derivatives, Eigen::Index anchor_rows, Eigen::Index query_rows, Eigen::Index dimensions, const Eigen::VectorXd& anchor_noise, Eigen::MatrixXd& covariance, std::vector& conditional_derivatives) :ref:`Project ` covariance and parameter derivatives using the same Schur complement. Joint rows are channel-major with anchors first in each channel. Anchor noise is fixed with respect to the fitted parameters. .. index:: pair: function; makeKernelMean .. _doxid-namespacegpr_1af89f4f6126af10f54d2c311451404cf1: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`KernelOperator::MeanFunction` makeKernelMean(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights) Owning fitted mean, using the kernel's representation or its exact product. .. index:: pair: function; makeAnalyticKernelMeanHessianVector .. _doxid-namespacegpr_1a84625932ae1accf4b54b04a9e120ca8a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`KernelOperator::MeanHessianFunction` makeAnalyticKernelMeanHessianVector(const std::shared_ptr`>& kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights) The kernel's own Hessian preparation, or an empty function when it has none. Unlike makeKernelMeanHessian\*, no meanHessianVector stand-in is made, so an empty result means the kernel has no analytic Hessian to prepare. .. index:: pair: function; makeRefusalAwareKernelMeanHessian .. _doxid-namespacegpr_1aeaab094a31fb83685d71d2cdceb75c2b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`RefusalAwareHessianPreparation` makeRefusalAwareKernelMeanHessian(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights, bool* all_exact = nullptr, bool* has_exact_or_refusal = nullptr) Prepare a fitted kernel Hessian action that propagates exact-child refusals through composite operators. .. index:: pair: function; makeKernelMeanHessianMatrix .. _doxid-namespacegpr_1ad825c1b9e018e07ef75bac5e0f8ff30d: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`KernelOperator::MeanHessianMatrixFunction` makeKernelMeanHessianMatrix(std::shared_ptr`> kernel, const Eigen::MatrixXd& training, const Eigen::VectorXd& weights) Dense mean Hessian of a kernel from the columns of its refusal-aware action. A failed column is Refused when an exact child refused it and Unavailable when only a generic child missed; the matrix is left empty in both cases. .. index:: pair: function; makeChartScalarKernel .. _doxid-namespacegpr_1afe038e18ef9ddffda1d9df64fa36944b: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::shared_ptr`> makeChartScalarKernel(std::shared_ptr`> chart, double magnitude_variance, double length_scale, :ref:`ChartScalarKernel` kernel) Squared-exponential :ref:`Pullback ` unless ``kernel`` is :ref:`Matern52 `. .. index:: pair: function; buildCrossBlockDerivativesFactored .. _doxid-namespacegpr_1ad22f0ca72d5ee5d9909ffc38a521f0cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool buildCrossBlockDerivativesFactored(const :ref:`FactoredTrainingGeometry`& factors, :ref:`Index_t` block_n, :ref:`Index_t` block_m, uint8_t derivative_options, :ref:`SexpatCF::CrossBlockGeometry`& out) Rebuild one block's d1/d2/d12 fields from the factors, in the layout and sign convention of :ref:`SexpatCF::buildCrossBlockDerivativesOnly `. .. index:: pair: function; resolveTrainingBlockGeometry .. _doxid-namespacegpr_1a3afd9d1e628e85fc620c42f4c58bdc4c: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`SexpatCF::CrossBlockGeometry`* resolveTrainingBlockGeometry(const :ref:`SexpatCF`& covariance, const :ref:`TrainingKernelGeometry`& geom, const :ref:`TrainingKernelGeometryBlock`& block, :ref:`SexpatCF::CrossBlockGeometry`& scratch) The derivative tensors of one geometry block: the cached copy, or, for a streamed geometry, a rebuild into ``scratch`` from the stored coordinate blocks. Returns nullptr when the block cannot be built. .. index:: pair: function; lengthscaleProjectionFloor .. _doxid-namespacegpr_1ab64c95a748e3f8145b0673682a82f715: .. ref-code-block:: cpp :class: doxyrest-title-code-block double lengthscaleProjectionFloor(double max_pair_distance, double absolute_floor) Lower edge of the feasible kernel length-scale domain for the MAP projection in optimize(). Two floors compose: a numerical collapse guard relative to the data diameter, and an absolute caller-set resolution floor (the dimer sets its finite-difference stencil diameter on its self-owned GP). A length scale below the sampling resolution fits sub-stencil noise as signal: the kernel degenerates into a delta comb whose relaxation endpoints scatter into EMD-distinct probes. The resolution floor guards against sub-resolution collapse only: when the training data spans less than the stencil (the two-row bootstrap), it is capped at the data diameter so the projection never forbids fits at the scale of the data itself. A chain-spacing floor (diameter/(n_images-1)) is deliberately NOT part of this domain: forcing the NEB session GP above chain spacing over-smooths the surrogate and moves the converged saddle (Baker14 anchor: 2.36819 eV at free length scales, 3.7772 eV with the chain bound; single-node A/B at 31b415ab). .. index:: pair: function; hssvdHermiteCartesianAction .. _doxid-namespacegpr_1a9f14ce0d8ca63bbf233870196b2bdda9: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd hssvdHermiteCartesianAction(const Eigen::MatrixXd& jacobian, const Eigen::MatrixXd& residuals, const Eigen::MatrixXd& force_weights, const Eigen::VectorXd& energy_kernel_weights, const Eigen::VectorXd& force_kernel_weights, const Eigen::VectorXd& force_residual_dots, double energy_kernel_weight_sum, double force_kernel_residual_dot_sum, const Eigen::MatrixXd& directions) Cartesian action of the HS-SVD Hermite weights on ``directions``. Equal-and-opposite energy weights cancel; the result is within one ulp of the cancelled weight scale of the exact residual. .. index:: pair: function; arrowheadEigenpairs .. _doxid-namespacegpr_1ae1ef35eba5f3cfd205a9ff3054b672ca: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool arrowheadEigenpairs(const Eigen::Ref& diagonal, const Eigen::Ref& spike, double corner, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs) Eigenpairs of ``[diag(diagonal), spike; spike^T, corner]``, ascending. False when a pole gap is inside the symmetric backward error: the caller then uses the full eigensolver, whose basis is the one the search already runs. .. index:: pair: function; extendSymmetricSpectrum .. _doxid-namespacegpr_1a1daa8f0eeb1350fae9cd35ca4c9bb48a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool extendSymmetricSpectrum(const Eigen::Ref& grown, const Eigen::Ref& diagonal, const Eigen::Ref& basis, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs) Eigenpairs of ``grown``, whose leading principal submatrix has eigenpairs ``diagonal`` / ``basis`` (columns). Each new row is one arrowhead in that basis. False when any arrowhead is too clustered for the secular roots; the caller keeps the full eigensolver. .. index:: pair: function; priorFreeReplicatedInverse .. _doxid-namespacegpr_1abe68106e23ed51a50ab1982fabd1c0b0: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool priorFreeReplicatedInverse(bool cholmod, bool scalapack, bool slate, bool unregularized, bool use_hssvd_gradient) Whether the prior-free marginal-likelihood gradient may form a replicated K^{-1}. :ref:`Eigen ` 's prior-free fit was measured on that inverse: the solve-based trace disagrees by about cond(K) \* eps and the fit then stops one step early. CHOLMOD's solve already takes the measured number of steps. ScaLAPACK and SLATE (which also defines GPR_LINALG_SCALAPACK) take the trace from the distributed factor and never read a replicated inverse, so gathering one only costs N^2 memory per rank. .. index:: pair: function; useDenseFactorForTrace .. _doxid-namespacegpr_1ac6d777e2e41d73f117b4e69b89b9421b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool useDenseFactorForTrace(bool prior_free_inverse, bool use_hssvd_gradient, bool distributed_factor, long long factor_rows, long long factor_cols, long long target_size) Whether evaluateGradientWithGeometry may pass dense Cholesky factor ``L`` to the derivative trace contractions and appendLikelihoodNoiseGradient. Prior-free :ref:`Eigen ` fits use ``invC.trace()`` instead of ``L``; HS-SVD Q-form gradients skip Cholesky decomposition so ``L`` may be absent or stale; ScaLAPACK/SLATE distributed fits must pass an empty factor so appendLikelihoodNoiseGradient selects the collective distributed trace. .. index:: pair: function; planRFFFeatureValidation .. _doxid-namespacegpr_1a1adef24a429d404d9228f64f5fed89c5: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`RFFValidationPlan` planRFFFeatureValidation(int n_geometries, int cartesian_dimension, std::uint64_t memory_cap_bytes = :ref:`kRFFValidationMemoryCapBytes`) Counts for ``n_geometries`` rows of ``cartesian_dimension`` coordinates. The fit is the longest farthest-point prefix whose joint Gram fits in ``memory_cap_bytes``, leaving at least one hold-out when there are two or more geometries. Feature counts are the powers of two from 1 through the largest power of two that is twice-overdetermined on both the fit and the full design and whose normal matrix fits in the same cap. .. index:: pair: function; rffFarthestPointOrder .. _doxid-namespacegpr_1adb790e870d968ab48e81feda1eb1203b: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector rffFarthestPointOrder(const Eigen::MatrixXd& positions) Greedy maximin on squared Euclidean distance. Index 0 is first. A tie keeps the smaller index, so the order does not use a random generator. .. index:: pair: function; looCalibrationIsUnityFromCholeskyDiagonal .. _doxid-namespacegpr_1a225b3af1baa020ed39a8193bf9cd178b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool looCalibrationIsUnityFromCholeskyDiagonal(const Eigen::VectorXd& alpha, const Eigen::VectorXd& diagonal) Certify unit LOO calibration using diag(L) without forming diag(K^-1). An inconclusive bound returns false and requires the full LOO statistic. .. index:: pair: function; looVarianceCalibrationFactor .. _doxid-namespacegpr_1ab4b84285f7d6239318cc402f728d4b78: .. ref-code-block:: cpp :class: doxyrest-title-code-block double looVarianceCalibrationFactor(const Eigen::VectorXd& alpha, const Eigen::VectorXd& inv_diag) Leave-one-out variance calibration factor from posterior weights alpha and the diagonal of the noisy precision (K + sigma2 I)^-1: the median squared LOO z-score over the chi-square(1) median, floored at 1. Shared by the dense Cholesky and HS-SVD backends. .. index:: pair: function; stabilizePosteriorCovariance .. _doxid-namespacegpr_1ad4269e4079f7c55360940a04354843db: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool stabilizePosteriorCovariance(Eigen::MatrixXd& covariance) :ref:`Project ` a rounded covariance onto the positive-semidefinite cone while preserving its nonnegative diagonal exactly. Returns false for a non-square, non-finite or negative-diagonal input, when a correlation ratio is not finite, when a negative eigenvalue of that correlation exceeds the rounding tolerance, or when the correlation eigensolver fails. A smaller negative eigenvalue is projected away. .. index:: pair: function; subtractStableBasisProjectedCrossCovariance .. _doxid-namespacegpr_1ad65f9a5391b802dc1628f87ccc3b99e8: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool subtractStableBasisProjectedCrossCovariance(const :ref:`StableBasisND`& basis, const Eigen::MatrixXd& Kstar, const Eigen::MatrixXd& Kright, const Eigen::MatrixXd& prior, double total_sigma2, Eigen::MatrixXd& K_post, bool contracted_mean = false, Eigen::Index left_queries = 1, Eigen::Index right_queries = 1) Posterior cross covariance K(q, q') - k\*^T (K + sigma2 I)^{-1} k\*' on a stable basis. An in-range query cancels to a diagonal a few ulps of the prior diagonal from zero, the rounding of the basis column norms. For a self-covariance (&Kstar == &Kright and not a contracted mean), a negative diagonal cancellation residue is bounded by 2 \* eps \* local_scale. local_scale is abs(prior_ii) + abs(projected_ii) + abs(complement_ii): the absolute prior diagonal and the absolute values of the two subtracted terms. A column of n entries has a squared norm that rounds by about n\*eps/2, so the raw diagonal can reach about n\*eps\*abs(prior). When that raw value lies within 3 times the bound, the subtraction returns the bound and keeps the sign. Cross-covariances and contracted means are left unclamped. .. index:: pair: function; jointObservationVarianceReduction .. _doxid-namespacegpr_1a96c325cc6931dacc4394b3c5147bdda4: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional<:ref:`JointObservationVarianceReduction`> jointObservationVarianceReduction(Eigen::MatrixXd candidate_covariance, const Eigen::MatrixXd& target_candidate_covariance, double target_variance, double noise_variance) Integrated reduction from the candidate block, target cross block, and target diagonal sum. No covariance between distinct targets is needed. .. index:: pair: function; jointObservationVarianceReduction .. _doxid-namespacegpr_1abc1629012912e3fcf15a42d6382cf54e: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional<:ref:`JointObservationVarianceReduction`> jointObservationVarianceReduction(const Eigen::MatrixXd& posterior_covariance, Eigen::Index query_count, Eigen::Index dimensions, Eigen::Index candidate_query, const std::vector& target_queries, double noise_variance) Integrated variance reduction from one joint energy-force query. The covariance uses derivative-major :ref:`Observation ` ordering: all query energies, followed by each Cartesian gradient component for all queries. Conditioning always uses the candidate's complete D+1 channel block. .. index:: pair: function; jointObservationForceVarianceReduction .. _doxid-namespacegpr_1af3d4463f2f83d9913c8866fefcf0bf01: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional<:ref:`JointObservationVarianceReduction`> jointObservationForceVarianceReduction(const Eigen::MatrixXd& posterior_covariance, Eigen::Index query_count, Eigen::Index dimensions, Eigen::Index candidate_query, const std::vector& target_queries, double noise_variance) Integrated force-variance reduction from one joint energy-force query. The candidate conditions on its complete energy-and-gradient observation block, while the target trace contains only Cartesian-gradient channels. The resulting score therefore has force-variance units and can rank acquisitions for a force-readiness decision without mixing physical units. .. index:: pair: function; findFMode .. _doxid-namespacegpr_1a0df3c71414c8d1ddcdd385ec318e5589: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd findFMode(const :ref:`EigenMatrix`& K, const Eigen::VectorXd& y, const :ref:`ObservationLikelihood`& ol, int max_iter = 30, double tol = 1e-8) Posterior mode f_mode = argmax_f [log p(y|f) + log N(f | 0, K)] via the Rasmussen-Williams safe Newton recursion (Algo 3.1). Uses the B = I + W^{1/2} K W^{1/2} parameterisation that avoids inverting K directly. Converges in O(log(1/tol)) iterations on log-concave likelihoods when K is well-conditioned. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - K - Prior covariance; pass the K_theta at the current hyperparameters (WITHOUT noise added; noise lives in W). * - y - Observations. * - ol - Observation-likelihood contract (log-concave). * - max_iter - Max Newton steps; throws if exceeded without abs(Delta f) < tol \* max(1, abs(f)). * - tol - Relative convergence tolerance. .. rubric:: Returns: Converged f_mode, same size as y. .. index:: pair: function; laplaceMarginalLogLik .. _doxid-namespacegpr_1a68b031e64bb02344523afbe917ad98e5: .. ref-code-block:: cpp :class: doxyrest-title-code-block double laplaceMarginalLogLik(const :ref:`EigenMatrix`& K, const Eigen::VectorXd& y, const Eigen::VectorXd& f_mode, const :ref:`ObservationLikelihood`& ol) Laplace approximation to log p(y | theta) given prior K and the converged posterior mode f_mode (R&W eq. 3.32): log p(y|theta) ~= log p(y|f_mode) + log N(f_mode | 0, K) * (1/2) log|I + W K| with W = diag(negHessDiag(y, f_mode)). .. index:: pair: function; collectiveWallClockLimitReached .. _doxid-namespacegpr_1a8c7b2ffdbcc7543771e8427a09119945: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool collectiveWallClockLimitReached(const std::shared_ptr`>& limit, const :ref:`linalg::MpiContext`& context) Agree at a shared phase boundary before entering further collectives. Rank-local oracle callbacks use requireWallClock and agree their outcome through the oracle batch protocol instead. .. index:: pair: function; collectiveWallClockLimitReached .. _doxid-namespacegpr_1a74f67e8fcacbc5ecbdea40e6a03a745f: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool collectiveWallClockLimitReached(const std::shared_ptr`>& limit) The oracle/search process group, with a local fallback outside MPI. .. index:: pair: function; medianPairwiseDistance .. _doxid-namespacegpr_1a89937015cb72c33e74d1d7f15897eb4c: .. ref-code-block:: cpp :class: doxyrest-title-code-block double medianPairwiseDistance(const :ref:`EigenMatrix`& R_train) Median of the strict-upper-triangle pairwise Euclidean row distances over a training set. Degree-1 homogeneous: median(s\*X) = s\*median(X). .. rubric:: Returns: Median pairwise distance, or 0.0 when fewer than two rows. .. index:: pair: function; certifyFinalSaddle .. _doxid-namespacegpr_1a42696e098112544ab04241ad9daac042: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`SaddleCertificate` certifyFinalSaddle(double true_pes_saddle_force, double conv_tol, const std::vector& per_image_variance, double variance_envelope) Combined force and variance criterion for callers that request it. The variance envelope is an optional exploration condition. A physical saddle additionally requires an independent assessment of its Hessian index; neither this helper nor a trust radius establishes that index. .. index:: pair: function; applyCanonicalReadconDimerDefaults .. _doxid-namespacegpr_1afec5f3f1d1a4ec231a4ef67b330370bc: .. ref-code-block:: cpp :class: doxyrest-title-code-block void applyCanonicalReadconDimerDefaults(:ref:`InputParameters`& parameters, const :ref:`CanonicalDimerDefaultOptions`& options = {}) Apply the canonical readcon dimer defaults to ``parameters``. Also installs the published Student-t prior parameters (mu = 0, nu = 20, s2 = 1). initialize() copies this triple onto the Student-t magnitude, Gaussian length-scale, and log-normal priors; data-bearing setHyperparameters() later overwrites Student-t s2 with target_variance and Gaussian s2 with seed_length_scale\_^2. .. index:: pair: function; gprdUnflaggedDimerOptions .. _doxid-namespacegpr_1a35ac2d8e2353b07c81c95857a088bd3a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`CanonicalDimerDefaultOptions` gprdUnflaggedDimerOptions() Options of an unflagged ``gprd`` invocation. The CLI member defaults and ``:ref:`gpr_dimer_config_defaults ``` both read this record. .. index:: pair: function; applyGprdDimerDefaults .. _doxid-namespacegpr_1a24eab593321041a5a5525e9402654b64: .. ref-code-block:: cpp :class: doxyrest-title-code-block void applyGprdDimerDefaults(:ref:`InputParameters`& parameters, const :ref:`CanonicalDimerDefaultOptions`& options = :ref:`gprdUnflaggedDimerOptions`()) The parameter block ``gprd`` installs before it applies flags: the canonical readcon dimer defaults, then the GP hyperparameter block in ``main``. ``:ref:`gpr_dimer_search ``` starts from the same block. .. index:: pair: function; usesClassicJointEnergyForcePrior .. _doxid-namespacegpr_1a896b33f2050b5197c82fced7dd29afd4: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool usesClassicJointEnergyForcePrior(:ref:`GPModelProfile` profile) Classic joint [E, F] inverse-distance profiles share the original :ref:`Sexpat ` prior density (:ref:`PriorSqrtt ` on magnSigma2, :ref:`PriorGaussian ` on length scales, plus the packed-parameter log Jacobian). .. index:: pair: function; launchedOnOneNode .. _doxid-namespacegpr_1abd4ff37a774b6bf321a1547d208cfe4a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool launchedOnOneNode() Whether the launcher placed every rank of this run on one node: the Open MPI launcher's world and node-local sizes agree, a Slurm step spans one node, or no launcher started the process (a singleton). Unknown launches count as several nodes. .. index:: pair: function; excludeLibfabricBtlOnOneNode .. _doxid-namespacegpr_1a09682a4f9ac706e9754d8fbdff4958bb: .. ref-code-block:: cpp :class: doxyrest-title-code-block void excludeLibfabricBtlOnOneNode() Open MPI's libfabric BTL sleeps for one second when MPI_Finalize closes it (mca_btl_ofi_component_close), on every rank of every run that opened it. Ranks on one node exchange messages through the UCX or shared-memory transports and never use it, so a single-node launch leaves it out unless the caller chose the BTLs (OMPI_MCA_btl). Other MPI implementations ignore the variable. .. index:: pair: function; reportFatal .. _doxid-namespacegpr_1af82f04e38ee568df15c9050ec0ada723: .. ref-code-block:: cpp :class: doxyrest-title-code-block int reportFatal(const char* program, const char* what) Ends a driver after an exception escaped it: prints the message and returns the exit status 1. On more than one rank the job is aborted through MPI_Abort, since the other ranks may wait in a collective the failing rank never reaches; on one rank an MPI world the driver initialized is finalized. This replaces std::terminate, whose abort leaves a core dump and no message on most launchers. .. index:: pair: function; assembleCollectively .. _doxid-namespacegpr_1a96822b6ef7e0aaad911073155ee9e3b8: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void assembleCollectively(const MpiContext& context, Matrices& result, const Body& body) Assemble disjoint entries, propagate failures within the owning group, and replicate the tensors. The body joins its workers before returning; only the calling thread enters MPI collectives.