.. index:: pair: class; gpr::ManifoldEnergyForceKernel .. _doxid-classgpr_1_1_manifold_energy_force_kernel: class gpr::ManifoldEnergyForceKernel ==================================== .. toctree:: :hidden: enum_gpr_ManifoldEnergyForceKernel_Derivative.rst struct_gpr_ManifoldEnergyForceKernel_ChartPoint.rst Overview ~~~~~~~~ Squared-exponential scalar energy kernel pulled back through a fixed differentiable Cartesian or molecular internal-coordinate chart. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class ManifoldEnergyForceKernel { public: // typedefs typedef std::function :target:`JointCovarianceTileFunction`; typedef std::function`)> :target:`JointContraction`; typedef std::function :target:`JointWeightRows`; // enums enum :ref:`Derivative`; // structs struct :ref:`ChartPoint`; // construction :target:`ManifoldEnergyForceKernel`(std::shared_ptr`> chart, double magnitude_variance, double length_scale); // methods double :target:`magnitudeVariance`() const; double :target:`lengthScale`() const; const :ref:`geometry::CoordinateChart`& :target:`chart`() const; void :target:`setMagnitudeVariance`(double value); void :target:`setLengthScale`(double value); Eigen::MatrixXd :ref:`covarianceBlock`(const Eigen::MatrixXd& left_positions, const Eigen::MatrixXd& right_positions, Eigen::Index left_channel, Eigen::Index right_channel) const; Eigen::MatrixXd :ref:`jointEnergyGradientCrossCovariance`(const Eigen::MatrixXd& left_positions, const Eigen::MatrixXd& right_positions) const; :ref:`JointCovarianceTileFunction` :ref:`prepareJointCovarianceTiles`(const Eigen::MatrixXd& positions) const; Eigen::MatrixXd :ref:`jointEnergyGradientCovariance`(const Eigen::MatrixXd& positions) const; Eigen::MatrixXd :ref:`jointEnergyGradientCovariance`(const Eigen::MatrixXd& positions, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const; double :ref:`contractJointEnergyGradientCrossCovariance`(const Eigen::MatrixXd& left_positions, const Eigen::MatrixXd& right_positions, const Eigen::MatrixXd& weight, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const; Eigen::MatrixXd :ref:`jointEnergyForceCovariance`(const Eigen::MatrixXd& positions) const; void :target:`setDerivative`(:ref:`Derivative` d); :ref:`Derivative` :target:`derivative`() const; :ref:`JointContraction` :ref:`prepareJointContraction`(const Eigen::MatrixXd& positions, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const; Eigen::Vector2d :ref:`contractJointLogHyperparameterDerivatives`(const Eigen::MatrixXd& positions, const :ref:`JointWeightRows`& weight_rows, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const; Eigen::Vector2d :ref:`contractJointLogHyperparameterDerivatives`(const Eigen::MatrixXd& positions, const :ref:`JointWeightRows`& left_factors, const :ref:`JointWeightRows`& right_factors, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const; }; .. _details-classgpr_1_1_manifold_energy_force_kernel: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Squared-exponential scalar energy kernel pulled back through a fixed differentiable Cartesian or molecular internal-coordinate chart. The scalar process E(x) = f(z(x)) induces Cartesian gradients through G(x) = Dz(x)^T grad_z f. Consequently all energy, gradient, and physical force channels belong to one positive-semidefinite differential-observation tensor. The kernel has one intrinsic length scale; primitive bonds, angles, and torsions do not receive separate hyperparameters. Methods ------- .. index:: pair: function; covarianceBlock .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a619a4f1b4438c2db5674df0886487f59: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd covarianceBlock(const Eigen::MatrixXd& left_positions, const Eigen::MatrixXd& right_positions, Eigen::Index left_channel, Eigen::Index right_channel) const Covariance between one channel at each set of geometry rows. Channel -1 denotes energy; channel d in [0, D) denotes Cartesian gradient component d. This is the :ref:`Observation ` storage convention, where physical force is F = -G. .. index:: pair: function; jointEnergyGradientCrossCovariance .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1aa08de6cafdce40e09510757e6816a077: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd jointEnergyGradientCrossCovariance(const Eigen::MatrixXd& left_positions, const Eigen::MatrixXd& right_positions) const Cross covariance in :ref:`Observation ` order on each operand: [E; G_col0; ...; G_colD-1]. .. index:: pair: function; prepareJointCovarianceTiles .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a04d5c46a6b25f17a0f9df6f24fbdee04: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`JointCovarianceTileFunction` prepareJointCovarianceTiles(const Eigen::MatrixXd& positions) const Own chart coordinates, Jacobians and kernel parameters for each row. Each call evaluates one geometry pair in [E; G] channel order. .. index:: pair: function; jointEnergyGradientCovariance .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1ae19bac93cc505ac49ac100ade53d9286: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd jointEnergyGradientCovariance(const Eigen::MatrixXd& positions) const Joint covariance in :ref:`Observation ` order [E; G_col0; ...; G_colD-1]. .. index:: pair: function; jointEnergyGradientCovariance .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a9513ec15e1c8b16aae8743b07091395d: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd jointEnergyGradientCovariance(const Eigen::MatrixXd& positions, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const Assemble each geometry pair once within the supplied process group. Local workers own disjoint entries and join before MPI communication. .. index:: pair: function; contractJointEnergyGradientCrossCovariance .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a098f43f84a5d58ce78e33aa13ff634a1: .. ref-code-block:: cpp :class: doxyrest-title-code-block double contractJointEnergyGradientCrossCovariance(const Eigen::MatrixXd& left_positions, const Eigen::MatrixXd& right_positions, const Eigen::MatrixXd& weight, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const Frobenius contraction with a rectangular joint covariance (or the selected hyperparameter derivative), without storing that covariance. Geometry pairs are partitioned across the supplied process group. .. index:: pair: function; jointEnergyForceCovariance .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a8dff3aa56fee5e40ce233934164c539f: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd jointEnergyForceCovariance(const Eigen::MatrixXd& positions) const Joint covariance in physical order [E; F_col0; ...; F_colD-1]. .. index:: pair: function; prepareJointContraction .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a64f8f6d2e56a77de8b1e947154112a42: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`JointContraction` prepareJointContraction(const Eigen::MatrixXd& positions, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const Retain chart coordinates and Jacobians for repeated row contractions. The callable owns its kernel parameters and geometry data. Its first argument selects a contiguous geometry range in every weight channel; the weight columns cover every prepared geometry. .. index:: pair: function; contractJointLogHyperparameterDerivatives .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a0086a73b9bccafefba5af78eb8d2fb3f: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Vector2d contractJointLogHyperparameterDerivatives(const Eigen::MatrixXd& positions, const :ref:`JointWeightRows`& weight_rows, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const Contract log magnitude and log length derivatives against joint weights. Each rank requests only its own geometry rows from weight_rows, in bounded batches. The callback is local and must not enter collectives. Its matrix contains every channel for the requested rows and every prepared geometry on the column axis, in :ref:`Observation ` order. .. index:: pair: function; contractJointLogHyperparameterDerivatives .. _doxid-classgpr_1_1_manifold_energy_force_kernel_1a26e9afe896a0cb480d58dbcc684f9587: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Vector2d contractJointLogHyperparameterDerivatives(const Eigen::MatrixXd& positions, const :ref:`JointWeightRows`& left_factors, const :ref:`JointWeightRows`& right_factors, const :ref:`linalg::MpiContext`& context, const :ref:`linalg::LocalExecutor`& execution) const Contract a joint weight L R^T through its thin factors. Each callback returns one geometry's [E; G] rows and the same number of factor columns. Left geometries belong to one rank; right factors stream in bounded batches. Affine charts use their fixed Jacobian; other chart geometries retain the general joint-weight contraction.