=================================== The soft geodesic heat-kernel prior =================================== The atomistic kernel in :doc:`the joint energy-force Gaussian process ` compares two configurations pairtype by pairtype and has no notion of **where along the reaction path** a configuration sits. Two geometries with similar bond lengths but on opposite sides of a barrier look similar to that kernel even though they belong to different basins. The soft geodesic heat-kernel prior adds a second, additive term that encodes position along a weighted reference graph (typically the working NEB band), without touching the guarantees established on the atomistic term. **Status:** implemented and off by default. ``gprn --gp-geodesic-prior true`` adds the term to the GP (class ``gpr::GeodesicHeatEnergyForceKernel``), and ``gprn --gp-geodesic-image-prior true`` (TOML key ``[band] geodesic_image_prior``) adds it to image placement. ``gprd`` and the Python bindings have no switch for it. This page proves properties of the construction. It does not show that the term lowers the number of oracle calls on any system. The composite kernel is .. math:: k(x,y) = k_{\text{atom}}(x,y) + \gamma \, h(x)^\top h(y), \qquad \gamma \ge 0, where :math:`h(x)` is a finite spectral feature built from the reference graph's heat kernel. Every theorem below is checked symbolically in ``scripts/derive_soft_geodesic_energy_force_gp.py``. Composition with a coordinate chart ----------------------------------- The base term can be either ``Sexpat`` or ``Pullback(SE, chart)``. ``Sum(Pullback(SE, chart), GeodesicHeat)`` combines the chart with the heat features on the same Cartesian observation space. The chart and heat components do not require mutually exclusive dispatch. The pair-type inverse-distance lengths remain a separate vector from the chart's scalar length. The heat features retain their own reference path, pair metric, and nonnegative covariance weight. Fitting the chart length does not resize the pair vector or alter the heat weight. A chart's initial length matches the base force covariance; the independent heat term is excluded from this matching calculation. Training, prediction, posterior variance, and Hessian-vector products use the same assembled operator. Training uses ``[E; G]`` with Cartesian ``G = grad(E)``; physical force output is ``F = -G``. The energy-force cross blocks therefore change sign together when converting observation layouts. The heat-weight evidence uses the same prior-mean residuals, output scale, and diagonal regularization as the training likelihood. Base parameters are fitted with the retained heat term present; the conditional heat-weight fit holds that base fixed. An attached heat component keeps its own metric through amplitude fits and changes of reference path. Base length updates do not overwrite it. Parameter derivatives evaluate their owning component directly, avoiding cancellation against independently weighted summands. GP-OIE installs its selected components before the initial fit. A changed global chart requires another parameter fit, and its coordinate map stays fixed throughout a surrogate relaxation. Reattaching the identical chart preserves its fitted parameters and posterior. These consistency conditions do not establish that the composed kernel improves molecular convergence; that requires oracle-call and saddle validation comparisons. Prediction support of the composition ------------------------------------- A summed covariance has a position-dependent diagonal. Its positive correlation support uses .. math:: \rho(x,y) = \frac{k(x,y)}{\sqrt{k(x,x)}\sqrt{k(y,y)}}, \qquad s(x,y) = \sqrt{-2\log\rho(x,y)}. The NEB motion rule requires a training geometry with ``s <`` 1=, equivalent to ``rho >`` exp(-1/2)=. Nonpositive correlations and invalid variances have infinite score. This is a support score, with no triangle-inequality assumption. Using only the base component's length misses the heat component's changing variance and correlations. ``KernelOperator::energyDiagonal`` evaluates only the diagonal, and ``Sum`` adds its component diagonals. Heat energy queries omit Cartesian Jacobians. Separate square roots in the normalization avoid multiplying extreme variances; no query cache is required. Energy correlation alone does not bound Cartesian force uncertainty. For positive scalar coordinates, the valid summed kernel .. math:: k(x,y)=\exp[-2(1/x-1/y)^2]+2 has joint training covariance ``diag(3, 4)`` for exact energy and gradient observations at ``x=1``. As ``x`` approaches zero, its energy correlation with that training point approaches ``2/3 > exp(-1/2)``. Its conditional gradient variance nevertheless grows as ``4/x^4``: the derivative cross covariance with the training point vanishes exponentially while the gradient prior variance diverges. A summed kernel can therefore satisfy the energy support rule with unresolved force channels. Force support requires a separate assessment of those channels. This counterexample does not establish the cause of a particular molecular trajectory. Why not exponentiate the geodesic distance directly --------------------------------------------------- One way to build a "position along the path" kernel measures a geodesic distance :math:`d_{\text{geo}}(x,y)` along the reference graph and plugs it into a squared-exponential form, :math:`\exp(-d_{\text{geo}}(x,y)^2 / 2\ell^2)`, the same way the atomistic kernel uses Euclidean distance in descriptor space. That substitution is not sound in general. A squared-exponential form is PSD for every length scale only when the squared distance is conditionally negative definite, equivalently when the distance embeds isometrically into a Hilbert space (Schoenberg, 1938). Euclidean distance satisfies that condition. Ordinary geodesic distance on a sphere does not in general: four equally spaced points on a great circle give a Gaussian Gram matrix with a negative quadratic form at a suitable positive length scale. The exact witness is checked by ``theorem_circle_geodesic_gaussian_can_be_indefinite``. Shortest-path distance on a general weighted graph also lacks the guarantee, so there is no assurance that a reference path graph built from NEB-image spacings and per-pairtype conductance values gives a metric that embeds that way. Exponentiating it directly can produce an indefinite kernel with no diagnostic to catch it. The construction here sidesteps the question entirely: rather than exponentiating a distance, it builds an explicit finite-dimensional feature map :math:`h(x)` from the graph's own spectral decomposition, and defines the new term as the literal Gram matrix :math:`\gamma\, h(x)^\top h(y)` of that feature map. A Gram matrix is PSD by elementary linear algebra regardless of the geometry that produced the features, so the term is valid by construction rather than by an argument about whether the underlying metric embeds that way. The reference path Laplacian ---------------------------- Discretize the reference path as a weighted graph: nodes are reference configurations, edges carry conductances :math:`c_i` (inverse of the effective spring constant between adjacent images), and each node carries a lumped mass :math:`m_i`. The mass-normalized Laplacian is .. math:: L = M^{-1/2} B^\top C\, B\, M^{-1/2}, with :math:`B` the oriented incidence matrix, :math:`C = \operatorname{diag}(c_i)`, and :math:`M = \operatorname{diag}(m_i)`. Theorem ``theorem_mass_normalized_path_laplacian_is_psd`` checks that :math:`L` is symmetric, that its quadratic form equals the conductance-weighted edge norm :math:`\|\sqrt{C}\,B\,M^{-1/2}z\|^2` (hence :math:`L \succeq 0`), and that the mass-weighted constant vector :math:`(\sqrt{m_0}, \sqrt{m_1}, \ldots)` is an exact null mode. :math:`L` is the discrete Laplace-Beltrami operator this construction diffuses heat on. The heat features are a Gram matrix by construction --------------------------------------------------- Given the eigenpairs :math:`(\lambda_k, v_k)` of :math:`L`, the heat kernel at diffusion time :math:`t` is :math:`\sum_k e^{-t\lambda_k} v_k v_k^\top`. Writing the nodal heat features as :math:`h_i = (v_{k,i}\, e^{-t\lambda_k /2})_k`, the heat kernel between two nodes is exactly :math:`h_i^\top h_j`, a Gram matrix by definition. Theorem ``theorem_heat_features_are_positive_semidefinite`` checks this Gram identity symbolically for a truncated two-mode spectrum: the resulting covariance is symmetric and its quadratic form matches the feature-space norm, so it is PSD for any finite truncation, any diffusion time :math:`t \ge 0`, and any nonnegative eigenvalues. This is the theorem that licenses the additive term: because :math:`h` is an explicit map into :math:`\mathbb{R}^m`, PSD-ness never depends on the graph's metric structure at all. Extending the feature map off the reference nodes ------------------------------------------------- :math:`h` is only defined at the discrete reference nodes so far; a query geometry :math:`x` is a continuous point that rarely coincides with one. The extension used here is a smooth, normalized affinity: given per-node affinities :math:`a_k(x)`, define probabilities :math:`p_k(x) = a_k(x) / \sum_j a_j(x)` and set :math:`h(x) = \sum_k p_k(x)\, h_k`. In the code the affinity is measured in the atomistic metric of :doc:`the joint energy-force Gaussian process `: .. math:: a_k(x) = \exp\!\left(-\sum_f \frac{\big(\phi_f(x)-\phi_f(c_k)\big)^2}{\ell_{\mathrm{pt}(f)}^2}\right), where :math:`c_k` is the :math:`k`-th reference node, :math:`\phi_f` is the pair feature (the inverse distance :math:`1/r`, with the quintic cutoff switch when ``--gp-pair-cutoff`` is positive), and :math:`\ell_{\mathrm{pt}}` is the atomistic length scale of pairtype :math:`\mathrm{pt}(f)` (``radialPairFeatures`` and ``atomistic_length_scale_`` in ``gpr/covariance_functions/GeodesicHeatEnergyForceKernel.cpp``). The exponent is the one of the atomistic kernel, so a query close to a node in that kernel's metric takes that node's feature. Theorem ``theorem_normalized_affinity_jacobian`` checks the derivative of this softmax-style extension against its closed form on a two-node example with Gaussian affinities in one coordinate. The identity holds for any positive differentiable affinities, since it is the derivative of a softmax: .. math:: \partial_x p_k = p_k \Big(\partial_x \log a_k - \textstyle\sum_j p_j\, \partial_x \log a_j\Big), The theorem also checks that the derivatives of all :math:`p_k` sum to zero (probabilities stay normalized to first order). This normalized-affinity identity makes :math:`h(x)` differentiable at every query point, including away from the reference nodes, which the force-channel blocks derived next require: the extension has to be smooth for :math:`\nabla_x h(x)` to exist at all. The Laplacian null mode duplicates the constant kernel ------------------------------------------------------ :math:`L`'s null mode is the mass-weighted constant vector. Passed through the affinity-based extension, theorem ``theorem_constant_heat_mode_is_redundant`` checks that the query-side image of that mode is a literal constant function of :math:`x` (its value does not depend on which node the query is closest to) with identically zero Cartesian derivative, and that appending it to a retained non-constant mode's covariance contributes exactly an additive constant to the energy block and nothing to the force block. A constant-plus-noise term is already what ``ConstantCF`` provides; carrying the null mode in :math:`h` would duplicate that degree of freedom for no benefit, so the retained feature set keeps only the non-constant spectrum. The composite joint energy-force blocks --------------------------------------- Differentiation distributes over the sum :math:`k = k_{\text{atom}} + \gamma h^\top h`, so every joint block from :doc:`the joint energy-force Gaussian process ` decomposes additively: .. math:: K_{EF} = \underbrace{-\nabla_y k_{\text{atom}}}_{\text{atomistic}} \;-\; \gamma\, h(x)^\top J_h(y), \qquad K_{FF} = \underbrace{\nabla_x\nabla_y^\top k_{\text{atom}}}_{\text{atomistic}} \;+\; \gamma\, J_h(x)^\top J_h(y), with :math:`J_h` the Jacobian of :math:`h`. Theorem ``theorem_soft_joint_energy_force_blocks`` checks all three cross blocks (:math:`K_{EF}`, :math:`K_{FE}`, :math:`K_{FF}`) against this direct sum, and separately checks that setting :math:`\gamma = 0` recovers the pure atomistic kernel exactly: the geodesic term is **added to**, not substituted for, the atomistic kernel, so turning it off is a literal special case rather than a separate code path. The stacked feature factor reconstructs the same blocks ------------------------------------------------------- Applying the Gram argument from :doc:`the joint energy-force Gaussian process ` to the geodesic term specifically: stacking :math:`\sqrt{\gamma}\, h(x)` with its negated per-coordinate derivatives into one factor reproduces every block of the geodesic contribution as an exact Gram matrix. Theorem ``theorem_joint_feature_factor_reconstruction`` checks this for a three-node, two-mode reference path and confirms the factor has exactly one column per retained mode (the redundant constant mode from the previous section stays excluded). That factor is the representation an efficient implementation would use directly: a finite explicit factor rather than a dense block matrix formed from derivatives after the fact. Regularity through linear geometries ------------------------------------ Theorem ``theorem_linear_geometry_descriptor_is_regular`` checks that a descriptor built from log pair distances, and its Jacobian, stay finite (no ``zoo``, ``oo``, or ``nan``) at a collinear three-atom geometry, the configuration where a bond-angle internal-coordinate chart would hit a coordinate singularity. The theorem is stated for log pair distances. The production affinity above uses the inverse distances :math:`1/r` (with a cutoff switch), not their logarithms. For those features finiteness at a collinear geometry is immediate: :math:`1/r` and its derivative are finite whenever :math:`r>0`, and distinct atoms have :math:`r>0`. Both descriptors depend on pair distances only, so the kernel stays well-defined through near-linear transition-state-like geometries without a special case. Stable whitening for an efficient update ---------------------------------------- Forming :math:`k_{\text{atom}} + \gamma h h^\top` densely for every evaluation is wasteful when the atomistic term is already factored as :math:`LL^\top`. Theorem ``theorem_feature_factor_whitening`` checks the whitened form .. math:: LL^\top + \gamma\, h h^\top = L\Big(I + \gamma\, \tilde h\, \tilde h^\top\Big) L^\top, \qquad \tilde h = L^{-1} h, together with the matrix determinant lemma :math:`\det(I + \gamma\, \tilde h \tilde h^\top) = 1 + \gamma\, \tilde h^\top \tilde h` and the corresponding Woodbury inverse and joint-target quadratic-form reduction. These are exact rank-one update identities: adding the geodesic term never requires refactoring the atomistic Cholesky factor from scratch, only a rank-one correction of it. Evidence-selected mixing weight ------------------------------- :math:`\gamma` is not a free hyperparameter fit by gradient descent on the full joint likelihood; it is chosen by the marginal likelihood (evidence) of the one-dimensional mixing problem. Using the Woodbury reduction, theorem ``theorem_fixed_base_evidence_weight`` checks the exact evidence delta .. math:: \Delta \mathrm{NLML}(\gamma) = \tfrac12\Big(\log(1+\gamma a) - \frac{\gamma a c^2}{1+\gamma a}\Big), its exact score (derivative in :math:`\gamma`), that :math:`\gamma = 0` recovers the base model's evidence exactly (:math:`\Delta\mathrm{NLML}(0) = 0`), and the stationary weight :math:`\gamma^\star = (c^2-1)/a` for a single mode. :math:`a` and :math:`c` are the mode's prior precision and its whitened alignment with the training targets; the sign of :math:`c^2 - 1` decides whether that mode is evidence-supported at all. Scale-free heat time -------------------- The one remaining free parameter is the diffusion time :math:`t`, and it should not need re-tuning every time the reference path's units or overall length change. Theorem ``theorem_scale_free_spectral_heat_time`` checks that a uniform metric rescaling by a factor :math:`s` (conductances divide by :math:`s`, lumped masses multiply by :math:`s`, the natural pairing under which the reference path's physical length scales by :math:`s`) divides the Laplacian by :math:`s^2` exactly: .. math:: L(s) = L(1) / s^2. Because eigenvalues of a rescaled matrix rescale identically (:math:`\lambda_k(s) = \lambda_k(1)/s^2`), the **ratio** :math:`\lambda_k / \lambda_1` is invariant under :math:`s`, and so is any heat weight expressed in Fiedler units, :math:`\exp(-\lambda_k/\lambda_1)`; the theorem checks this invariance directly on the ratio formula. Fixing the diffusion time as a Fiedler-normalized quantity rather than an absolute one lets the same :math:`t` setting apply unchanged across different molecular systems and different reference-path unit conventions, with no per-system recalibration. Checks ------ The pixi task ``derive-soft-geodesic-energy-force-gp`` (environment ``symbolic``) runs ``scripts/derive_soft_geodesic_energy_force_gp.py``, which calls all eleven theorems named above and prints ``ALL_CHECKS_PASS``. The permutation-symmetry caveat noted at the end of :doc:`the joint energy-force Gaussian process ` applies to this term directly: ``scripts/derive_symmetry_adapted_joint_gp.py`` checks that a raw path-affinity feature breaks atom-exchange symmetry (``raw_path_affinity_breaks_atom_exchange_symmetry``) and only becomes invariant after the same group-averaging applied to the atomistic kernel is applied to :math:`h` as well (``projected_path_feature_is_invariant``); projecting the geodesic term alone, without also projecting the atomistic base kernel, leaves the composite still asymmetric. Related ------- - Explanation: :doc:`the joint energy-force Gaussian process ` defines the atomistic kernel this term is added to; :doc:`How GPRidge finds a saddle <../method>` shows where the surrogate sits in the search; :doc:`the mathematics index ` lists the other theory pages. - How-to: :doc:`Run a GP-NEB band <../../howto/gpneb>` and :doc:`Choose GP settings <../../howto/gp_settings>` cover the band options that decide whether the term is used. - Reference: ``--gp-geodesic-prior`` and ``--gp-geodesic-image-prior`` in :doc:`the command-line reference <../../reference/cli_reference>`; ``[band] geodesic_image_prior`` in :doc:`TOML configuration keys <../../reference/config_keys>`.