betaFeedback

WorksPhysics and Astronomy

Data-driven path collective variables

Abstract

Identifying optimal collective variables to model transformations, using atomic-scale simulations, is a long-standing challenge. We propose a new method for the generation, optimization, and comparison of collective variables, which can be thought of as a data-driven generalization of the path collective variable concept. It consists in a kernel ridge regression of the committor probability, which encodes a transformation's progress. The resulting collective variable is one-dimensional, interpretable, and differentiable, making it appropriate for enhanced sampling simulations requiring biasing. We demonstrate the validity of the method on two different applications: a precipitation model, and the association of Li+^+ and F−^- in water. For the former, we show that global descriptors such as the permutation invariant vector allow to reach an accuracy far from the one achieved via simpler, more intuitive variables. For the latter, we show that information correlated with the transformation mechanism is contained in the first solvation shell only, and that inertial effects prevent the derivation of optimal collective variables from the atomic positions only.

Introduction

Accurately modeling how matter transforms at the atomic scale is key in understanding many fundamental physical phenomena, ranging from phase transitions to chemical reactions. An ideal approach to studying such phenomena in silico would consist in simply observing the time evolution of an atomistic system, at a given set of thermodynamic conditions; i.e. an equilibrium molecular dynamics simulation. However, the free energy barriers associated with transformations are usually several times larger than the thermal energy kBTk_{\mathrm{B}}T, so that naturally observing and sufficiently sampling these rare phenomena is simply unachievable. Researchers have therefore developed advanced methods to bias the dynamics of a given system, allowing to effectively lower selected barriers of interest, and to enhance the sampling of rare events over the course of a molecular dynamics simulation. This set of methods[1] has been applied to many different physical problems, including the phase diagram of water[2] and its putative liquid-liquid phase transition[3, 4], ice nucleation[5], protein folding dynamics[6], and chemical reactions governing prebiotic chemistry[7].

The difficulty and subtlety associated with enhanced sampling methods comes from the high dimensionality (3N3N, where NN is the number of particles) of configuration space, i.e. the space spanning all possible atomic configurations. Since it is virtually impossible to directly identify relevant barriers in such a high-dimensional space, the solution is to select collective variables (CVs), expressed as a function of the system’s degrees of freedom. By doing so, the configuration space is projected onto one of much lower dimension. Good CVs should allow to distinguish basins of metastability, as well as transition state ensembles. The way they are chosen affects many crucial elements: i) the observed transformation mechanism in the context of enhanced sampling; ii) the CVs are often used as a means of analyzing a reaction mechanism, be it observed from biased or unbiased dynamics. A poorly selected CV can therefore lead to a biased or incomplete rationalization of the transformation mechanism, even in the context of unbiased simulations; iii) free energies of activation, ΔF‡\Delta F^{\ddagger}, are sometimes extracted from gauge-invariant free energy profiles[8, 9, 10] along collective variables, and used to interpret the kinetics of the system of interest. Using a sub-optimal CV will lead, in this context, to an underestimated ΔF‡\Delta F^{\ddagger} for the transformation under scrutiny[9]; iv) while in the context of the Eyring-Polanyi equation kinetic rates are independent of the choice of CV, thus a poorly selected one will have an associated transmission coefficient far from unity; v) sub-optimal CVs hamper the efficiency of enhanced sampling methods based on bias forces, since the latter are partly wasted along degrees-of-freedom not related to the transformation, leading to the unphysical overestimation of the free energy barrier height[11]; vi) on the contrary, sub-optimal CVs result also in an under-estimation of the free-energy barrier from the viewpoint of the ideal, exact calculation based on marginalizing the canonical probability density (see, e.g., Eq. (6) here below), due to overlap between metastable basins[12]. The latter effect has been exploited in a CV optimization approach based on rate minimization [13], and concerns, more generally, Langevin models describing the high-dimensional dynamics projected on CVs, constructed from statistical inference on unbiased MD trajectories[14, 15].

Selecting a CV on solid grounds is therefore an active field of research, with many methods developed in the last decades, following different approaches. Identifying slow modes is one: this has been achieved using diffusion maps[16, 17, 18, 19], variational approaches based on the overdamped Langevin equation[13, 20] or Markov state models[21] – combined with independent component analysis[22, 23] and deep learning[24] –, or maximizing the spectral gap of a transition matrix[25, 26]. Another set of methods relies on (auto)encoders[27, 28] and the information bottleneck principle[29, 30]. A few techniques[31, 32, 33] analyze fluctuations in the metastable states to extract optimal CVs.

Finally, a large body of work has been dedicated to deriving optimal collective variables based on the committor probability p(B∣X)p(B|\mathbf{X}), i.e. in a system showing two metastable states A and B, the probability of reaching basin B first, conditioned on an initial point X\mathbf{X} in configuration space. The committor is, by construction, the reaction coordinate of the transformation under scrutiny, as it encodes the entire dynamical process of transforming from one metastable state into the other[34]. Depending on how optimality is defined, it may or may not be an optimal collective variable: for instance, in the presence of large free energy barriers, the committor’s strong non-linearity near basins[35] is impractical to handle. Nevertheless, an intuitive approach is therefore to perform a regression of the committor using a flexible basis of collective variables; this has been pioneered by Ma and Dinner[34] using neural networks and a genetic algorithm. Later, Peters and Trout[36] devised a fitting approach based on transition path sampling[37] data and the transition path probability p(TP∣X)p(\mathrm{TP}|\mathbf{X}), which is analytically related to the committor under the assumption of diffusive dynamics. This was later expanded to obtain CVs with maximal transmission coefficients[38], or using cross-entropy minimization and regularization[39]. Recently, this approach has been recast in a reinforcement learning framework to allow the identification of CVs over the course of transition path sampling simulations[40, 41], including an extension to extract free energies and rates[42]. Committor-based methods have also been combined with slow process identification[43].

In this article, we propose a committor regression technique for CV selection based on kernel ridge regression, which as we show can be thought of as a data-driven generalization of path collective variables[44]. The resulting optimized collective variable is one-dimensional and differentiable, making it appropriate for biased simulations. It is interpretable, provided that the CV subspace it is based on is interpretable as well.

This paper is structured as follows: in Sec. II, we introduce the method and discuss its connection to path collective variables. In Sec. III, we apply the method to a two-dimensional toy potential for which we can compute the committor exactly. We then turn to more realistic examples, with a precipitation phenomenon using Lennard-Jones particles (Sec. IV), and the association of small, monoatomic ions in water (Sec. V). Finally, we conclude and provide an outlook regarding possible extensions to the method, in Sec. VI.

From standard to data-driven path collective variables

Path collective variables[44, 45] describe the progress along a reaction pathway connecting metastable states. The main concept, summarized in the top part of Figure 1, is to define reference states, and to compute, for a given atomic configuration, the similarity to these reference states using a kernel function K(ξi,ξ)K(\boldsymbol{\xi}_i,\boldsymbol{\xi}). The similarity is not computed on the raw atomic coordinates, but rather on a vector of collective variables of arbitrary dimension, ξ\boldsymbol{\xi}. For instance, coordination numbers of a specific set of atoms are often used for chemical reactions[45, 46]. Path CVs therefore involve two projections: from the atomic positions X\mathbf{X} to intermediate CVs ξ\boldsymbol{\xi} (which live in what we call the CV subspace), and from ξ\boldsymbol{\xi} to the one-dimensional path CV denoted s(ξ)s(\boldsymbol{\xi}):

Figure 1. Standard, or two-state (left) and data-driven (right) path collective variables. Consider a system made of a red particle, a blue particle, and several gray particles. The red and blue particles can be in two metastable states: dissociated (A) or associated (B). Left: two reference states describing metastable states A and B are fed to the path CV. This will lead to a good description of configurations close to or in either metastable states, but the behavior outside of the basins is difficult to predict. This can be seen when comparing the committor p(B∣X)p(\mathrm{B}|\mathrm{X}) and s(ξ)s(\xi): configurations far from the basins do not have close by reference states. Right: in a data-driven approach, a much greater number of references is considered, describing the full reaction process, from state A to state B. The committor has to be computed for each reference, and is fed to the path collective variable through kernel ridge regression. Agreement with the true committor function is improved as reference states are distributed over the whole reaction pathway.

s(ξ)=∑i=1NiK(ξi,ξ)∑j=1NK(ξj,ξ).(1)s(\boldsymbol{\xi}) = \frac{\sum_{i=1}^{N} iK(\boldsymbol{\xi}_i,\boldsymbol{\xi})}{\sum_{j=1}^{N} K(\boldsymbol{\xi}_j,\boldsymbol{\xi})}. \tag*{(1)}

A typical choice for the kernel is K=exp⁡(−λ∥ξi−ξ∥22)K = \exp\left(-\lambda\left\lVert\boldsymbol{\xi}_i-\boldsymbol{\xi}\right\rVert_2^2\right), i.e. the radial basis function kernel, where λ\lambda is a bandwidth parameter, and ∥ξi−ξ∥22\left\lVert\boldsymbol{\xi}_i-\boldsymbol{\xi}\right\rVert_2^2 the squared ℓ2\ell^2-norm. Conceptually, ss describes the progress along the polygonal chain in ξ\boldsymbol{\xi}-space connecting all references. An additional quantity, zz, is usually defined to express the distance to this pathway[44]. Traditionally, O(101)\mathcal{O}(10^1) equidistant references in CV subspace are selected along the pathway using nudged-elastic-band-like algorithms[44, 47]; they can also be optimized during enhanced sampling simulations with an adaptive approach[48]. Later, a simpler and more explorative approach proposed to set the number of reference states to the number of identified metastable states of interest[2, 45]. For instance, in the association/dissociation problem considered in Figure 1, the number of states is set to two. In any case, it is then assumed that the path CV will be able to interpolate correctly for configurations halfway between both states. A more important assumption is that the selected CV subspace ξ\boldsymbol{\xi} is able to resolve the transformation. At this stage, both are uncontrolled approximations that should be thoroughly verified, as a good CV should capture the transition state ensemble, whose configurations do not belong to either states.

It is therefore natural to consider including many reference states in the path CV definition. As illustrated in Figure 1, this can only improve CV quality along the whole reaction path, i.e. the pathway, in CV subspace, that connects metastable states. However, a measure of the reaction progress is now needed. Indeed, ss can be seen as a weighted average; for two reference states, ii is simply set to 1 and 2. A configuration close to basin A will therefore have a ss close to 1. If one wants to include reference states outside of metastable basins, it is therefore mandatory to use a measure of the progress along the reaction path, with some methods implemented to evenly space references in the CV subspace[49, 50].

One way to evaluate the quality of a collective variable is to compare it to the committor probability, which is widely considered the optimal CV[36] for a system of two metastable states. For a configuration already in basin A $p(\mathrm{B}|\mathrm{X} \in \mathrm{A}) = 0$, and $p(\mathrm{B}|\mathrm{X} \in \mathrm{B}) = 1$ for one in state B. At the transition state, $p(\mathrm{B}|\mathrm{X} \in \mathrm{TS}) = 0.5$. Unfortunately, for realistic – i.e. high-dimensional – systems, computing the committor for a given configuration is computationally expensive: one has to run a series of short independent simulations by randomly drawing initial velocities from the Maxwell-Boltzmann distribution. These simulations end when the system reaches either basins, and to reach a satisfying accuracy on the committor, it is necessary to generate hundreds-to-thousands of short trajectories when the committor value is not too close to zero or one[51]. In the presence of high barriers the transition mechanism largely involves configurations with very tiny deviations of the committor from zero or one, requiring more sophisticated estimation approaches{citep}[35]`.

In addition, the committor, estimated numerically in this way, is not differentiable, which is problematic for biased simulations. While it is therefore nearly impossible to use the committor directly as a CV, one can compute values for an ensemble of reference configurations, and use these values as weights in the path CV. This is the main idea behind the present data-driven path collective variables.

Interestingly, the expression of ss, which is shown in Figure 1, is that of a kernel regression (or kernel smoothing) estimator. Kernel regression is a class of non-parametric methods for non-linear regression. Since kernel regression improves with increasing amounts of data, it is even more natural to consider using many reference states. Surprisingly, the connection to kernel regression was not made in the original article on path CVs[44], or in any other subsequent work. In greater detail, ss is the Nadaraya-Watson estimator[52, 53], which is the zeroth-order approximation to the local polynomial estimator, also called the "local constant" approximation. We switch to a global method in the form of kernel ridge regression (KRR), i.e. the combination of linear least squares with l2l^2-norm regularization and the kernel trick. The KRR estimator is:

f^(ξ)=∑i=1NαiK(ξi,ξ),(2)\hat{f}(\boldsymbol{\xi})=\sum_{i=1}^{N}\alpha_i K(\boldsymbol{\xi}_i,\boldsymbol{\xi}), \tag*{(2)}

optimal parameters α^=[α^1,…,α^n]T\hat{\boldsymbol{\alpha}}=[\hat{\alpha}_1,\ldots,\hat{\alpha}_n]^T are obtained by solving the following linear system:

α^=arg⁡min⁡α∈RN ∥y−Kα∥22+λαTα=(KNN+λIn)−1y,(3)\hat{\boldsymbol{\alpha}}=\underset{\boldsymbol{\alpha}\in\mathbb{R}^{N}}{\arg\min}\ \lVert\boldsymbol{y}-K\boldsymbol{\alpha}\rVert_2^2+\lambda\boldsymbol{\alpha}^T\boldsymbol{\alpha}=(K_{NN}+\lambda I_n)^{-1}\boldsymbol{y}, \tag*{(3)}

where we introduced the kernel matrix of all pairs of data KNNK_{NN}, the target vector y=[p(B∣X1),…,p(B∣XN)]T\boldsymbol{y}=[p(B|\boldsymbol{X}_1),\ldots,p(B|\boldsymbol{X}_N)]^T, and the regularization parameter λ\lambda. In addition, we introduce a bandwidth matrix Σ\Sigma such that our kernel becomes:

K(ξi,ξ)=exp⁡(−(ξi−ξ)TΣ−1(ξi−ξ)),(4)K(\boldsymbol{\xi}_i,\boldsymbol{\xi})=\exp\left(-(\boldsymbol{\xi}_i-\boldsymbol{\xi})^T\Sigma^{-1}(\boldsymbol{\xi}_i-\boldsymbol{\xi})\right), \tag*{(4)}

allowing more flexibility in reproducing the target data. In the following, Σ\Sigma is always diagonal and reduces to a bandwidth vector σ=[σ1,…,σd]T\boldsymbol{\sigma}=[\sigma_1,\ldots,\sigma_d]^T, for ξ∈Rd\boldsymbol{\xi}\in\mathbb{R}^d. In this way, each component in ξ\boldsymbol{\xi} has a corresponding weight which encodes its importance: a low σ\sigma means that the corresponding CV component is highly correlated to the committor. ξ\boldsymbol{\xi} can be composed of simple, intuitive collective variables, but can also include high-dimensional, abstract representations such as commonly used local descriptors for machine-learned interatomic potentials (e.g. atom-centered symmetry functions[54] and the smooth overlap of atomic positions (SOAP)[55]), or global variants such as the permutation-invariant vector (PIV)[2, 56]. Optimal values for σ\boldsymbol{\sigma} and the regularization parameter λ\lambda are obtained through optimization, by minimizing a loss function based on a training set, distinct from the set of configurations used in KRR (the reference set).

The rugged Müller-Brown potential

As a starting point, we select the two-dimensional rugged Müller-Brown[57, 58] (rMB) analytical potential. Assuming overdamped Langevin dynamics, we can calculate the committor probability over the whole configuration space, as explained in Appendix § 1.7. This allows us to assess the quality of various regression models without projection errors, by considering the configuration space as the CV subspace. The rMB potential takes the form of the traditional Müller-Brown potential[59] with added ruggedness:

\begin{aligned} V(x,y)={}&\sum_{i=1}^{4}D_i\exp\left[a_i(x-X_i)^2+b_i(x-X_i)(y-Y_i)\\ &\qquad+c_i(y-Y_i)^2\right]+\gamma\sin(2k\pi x)\sin(2k\pi y), \tag*{(5)} \end{aligned}

where D1…4=[−400,−200,−340,30]D_{1\ldots4}=[-400,-200,-340,30], a1…4=[−1,−1,−6.5,0.7]a_{1\ldots4}=[-1,-1,-6.5,0.7], b1…4=[0,0,11,0.6]b_{1\ldots4}=[0,0,11,0.6], c1…4=[−10,−10,−6.5,0.7]c_{1\ldots4}=[-10,-10,-6.5,0.7], X1…4=[1,0,−0.5,−1]X_{1\ldots4}=[1,0,-0.5,-1], Y1…4=[0,0.5,1.5,1]Y_{1\ldots4}=[0,0.5,1.5,1], γ=9\gamma=9, and k=5k=5. We define metastable states A and B, shown in Figure 2(a), as circles of radius 0.1 and centered respectively at (−0.58,1.39)(-0.58,1.39) and (0.55,0.05)(0.55,0.05).

Figure 2. Path collective variables for the rugged Müller-Brown potential. (a) The potential energy surface. Shaded circles correspond to the metastable states definition used for the evaluation of the committor, (b) test set mean absolute error for different path collective variables as a function of the number of reference configurations included. Red circles and blue squares respectively correspond to models built on data sampled from the uniform and Gibbs measures. Error bars correspond to 95% confidence intervals of a distribution of predictions spanning ten different reference and training sets. The red broken line is a power law fit. The full and broken gray lines respectively correspond to the "12R" and "2R" path collective variables, (c) canonical and (d) geometric free energy profiles along various path collective variables, compared to the committor (small wiggles are due to the numerical integration and marginalization), (e-h) collective variables plotted in configuration space: (e) the committor as obtained from the backward Kolmogorov equation, (f) the kernel ridge regression based on 500 references, (g) the "2R" and (g) "12R" path collective variables.

To construct datasets for KRR CVs (i.e. a reference set and a training set), we sample p(B∣(x,y))p(B|(x,y)) values from the uniform measure or from the Gibbs measure on the configuration space. Sampling configurations in high-dimensional space – especially in the presence of potential energy barriers – is a difficult task, which is why we consider two radically different sampling strategies. As we will see in the next sections, for realistic systems, enhanced sampling strategies are leveraged. The test set is always the same for all models, consisting of 4000 data points sampled randomly. The detailed procedure for model optimization is reported in Appendix B. We assess the accuracy of the various path collective variables by comparing their mean absolute error (MAE) on the test set (Figure 2(b)), their value over configuration space 2(d,e), and free energy profiles 2(f). Free energy profiles are obtained by evaluating the collective variable’s marginal probability density over configuration space:

F(ξ)=−β−1ln⁡∬e−βV(x,y)δ(ξ(x,y)−ξ) dx dy,(6)F(\boldsymbol{\xi})=-\beta^{-1}\ln\iint e^{-\beta V(x,y)}\delta\left(\boldsymbol{\xi}(x,y)-\boldsymbol{\xi}\right)\,dx\,dy, \tag*{(6)}

where β=0.1\beta=0.1. We also report a "geometric" free energy profile, Fg(ξ)F_g(\boldsymbol{\xi}), distinct from the canonical definition of equation 6. The canonical free energy profile is not left invariant by a gauge transformation of a CV, which makes it impossible to compare different choices of ξ\boldsymbol{\xi}, even if they contain the same amount of information with respect to the reaction[9, 10]. The geometric definition incorporates this gauge invariance, which, as we will see later on, will be useful to compare quantities such as free energies of activation for different CVs. The geometric free energy profile can be derived through the application of the coarea formula, as has been discussed many times before[8, 60]:

Fg(ξ)=−β−1ln⁡∬e−βV(x,y)∣∇ξ(x,y)∣δ(ξ(x,y)−ξ) dxdy.(7)F_g(\xi)=-\beta^{-1}\ln\iint e^{-\beta V(x,y)}\lvert\nabla\xi(x,y)\rvert\delta\left(\xi(x,y)-\xi\right)\,\mathrm{d}x\mathrm{d}y. \tag*{(7)}

Both profiles are related in the following way:

e−βFg(ξ)=⟨∣∇ξ(x,y)∣⟩ξe−βF(ξ),(8)e^{-\beta F_g(\xi)}=\langle\lvert\nabla\xi(x,y)\rvert\rangle_{\xi}e^{-\beta F(\xi)}, \tag*{(8)}

where ⟨⋅⟩\langle\cdot\rangle is an ensemble average. We also construct two variants of traditional path CVs: the first one ("2R") containing two references – one in each basin –, and a more advanced version ("12R"), containing twelve references equally spaced along the minimum energy path, including the exact same two as for the "2R" version. The latter one is assumed to be more advanced than the former since the minimum energy path is usually not available a priori for realistic, high-dimensional settings. References are respectively labeled 1,2 and 1,...,12; to compare with the committor, the path CVs are scaled to the [0,1] interval. The scalar bandwidth parameter λ\lambda is set so that the distance between the first and second references times λ\lambda is equal to 2.3, a common practice leading to smooth free-energy landscapes, typically with a good separation of reactants, products and transition states[44, 45].

Results are shown on Figure 2, with the global ability in reproducing the committor of each method reported in Figure 2(b). The largest MAE attainable is roughly 0.5, since the test set is composed of values in the [0,1] interval with mean roughly equal to 0.5. As one would expect, the test set MAE decreases with increasing number of references. However, sampling from the Gibbs measure is demonstrated to be largely inefficient, which obviously shows the importance of enhanced sampling for realistic systems. Sampling from the Gibbs measure leads to selecting points mostly in the metastable states, where the committor is constant, while it rapidly varies near the separatrix. This is even more critical with a low temperature or large energy barriers. Canonical path CVs, while they do not aim at reproducing the committor, perform relatively decently, with test set MAEs respectively equal to 0.194 and 0.169 for the "2R" and "12R" variants (see also Figure 2(g,Figure 2h)). Using only two references, or aligned references in the CV subspace, leads to constant path CVs along the direction normal to the line connecting the references. Here, as can be seen in Figure 2(e), there are non-negligible variations of the committor in directions normal to the line connecting both metastable states. In addition, with no measure of the reaction progress, one can only label references in a linear fashion.

As mentioned before, the true committor varies non-linearly, depending on the underlying potential energy surface and the temperature. This highlights the importance of extracting such information, possibly by computing committor values. We note that other methods are used for labeling references, for instance based on transition path sampling data [50]. With a "reasonable" number of 500 references (reasonable because it can be rather easily achieved with moderate computational cost for the realistic examples reported in the next sections), one can achieve excellent, yet still improvable, agreement with the true committor, with a test set MAE smaller than 10−210^{-2}. This also translates into a qualitative agreement across configuration space (Figure 2(e,Figure 2f)), and quantitative agreement of free energy profiles (Figure 2(c,Figure 2d)).

Features of the free energy profiles along path collective variables such as the free energy of activation are in good agreement with the committor. Depending on the system, this might not always be the case: in Appendix C, we show results for a three wells model potential for which simple path collective variables do not perform as well. Realistic, high-dimensional systems typically show many shallow intermediate states. Nevertheless, these results demonstrate the strength of path collective variables. Of course, this is valid only in the limit where the CV subspace is the configuration space itself, i.e. when there is no loss of information due to a projection.

To assess the robustness of the KRR approach, we add parasitic dimensions to the potential, uncorrelated to the committor:

V(x,y,z)=V(x,y)+∑j=1d+zj2,(9)V(x,y,z) = V(x,y) + \sum_{j=1}^{d_{+}} z_j^2, \tag*{(9)}

in which we vary d+d_{+} from 10 to 1000. The test set mean absolute error as a function of d+d_{+} and the number of references is presented in Figure 3. As one can see, variations along d+d_{+} are relatively negligible. This mostly demonstrates the robustness of the bandwidth optimization approach, since the problem here is finding directions correlated with the committor in a high-dimensional space. Finally, as shown in Appendix D, we can also embed the two-dimensional potential in a five-dimensional space using non-linear transformations leading to large degeneracies, and still recover a low test set MAE. This is perhaps expected, since kernel ridge regression models can learn non-linear features.

Figure 3. Test set mean absolute error for KRR models trained using different number of references and parasitic dimensions. The error is interpolated over data points represented by the intersections of the white lines (including N=2N = 2 and d+=10d_{+} = 10).

Precipitation of Lennard-Jones particles

We now turn to a more realistic system involving Lennard-Jones interactions, aimed at capturing the onset of a precipitation process. Precipitation is a critical phenomenon in inorganic or organic chemistry, as well as in biochemistry and metallurgy. For instance, in Li-ion batteries, decomposition products precipitate to form a solid interphase between a solid electrode and the liquid electrolyte. Here 20 particles represent the precipitating species, and 4086 smaller particles represent the solvent. The solute species interact strongly with one another (ε11=3.1\varepsilon_{11} = 3.1, σ11=1.2\sigma_{11} = 1.2), while the solvent-solvent and solute-solvent interactions are weaker (ε12=ε22=1.0\varepsilon_{12} = \varepsilon_{22} = 1.0, σ12=σ22=1.0\sigma_{12} = \sigma_{22} = 1.0). The interaction cutoff is set to 6σ6\sigma. All masses are set to 1. These parameters are chosen such that two metastable states separated by a free energy barrier exist: an associated state, where solute particles clump together to form an aggregate, and a dissociated state, where solvent particles coordinate solute particles. The integration time step (δt\delta t) is set to 2⋅10−32 \cdot10^{-3}, and all simulations are run at T=1T = 1, p=1p = 1, using the LAMMPS program[61] (version 7 Aug 2019), with PLUMED[62, 63] (version 2.5.3) as an add-on to compute collective variables and perform enhanced sampling.

Our sampling strategy is the following: 1) converging free energy profiles from unbiased molecular dynamics, 2) sampling the putative transition state ensemble using a simple collective variable, 3) sampling close to the true transition state ensemble using transition path sampling. The committor is numerically estimated for configurations extracted from steps 2) and 3); these pairs of structure and committor constitute the datasets we then use to optimize and validate KRRCV models. All computational details regarding these steps are presented in Appendix E.

We start by obtaining free energy profiles along two simple one-dimensional collective variables, which we select to be properties of the largest aggregate. We use a depth-first search (DFS) clustering algorithm to identify the largest aggregate in a given configuration[64], using a distance-based criterion to assess if particles are aggregated or not. Our two collective variables correspond to the number of particles in the largest cluster (ΣN\Sigma N), and of the sum of solute coordination numbers over solute particles in the largest cluster (ΣC\Sigma C). Profiles are obtained from long unbiased molecular dynamics in the canonical (nVTnVT) ensemble.

Free energy profiles are reported in Figure 4(a,Figure 4b). As can be seen, with both ΣN\Sigma N and ΣC\Sigma C, the associated state is considered more thermodynamically stable than the dissociated one; in addition, both states are separated by a barrier of a few kBTk_\mathrm{B}T.

Figure 4. Lennard-Jones model of a precipitation phenomenon. Left panels: system snapshots in the dissociated and associated states. Large cyan and small gray spheres respectively represent solute and solvent particles. (a,b) Free energy profiles along collective variables ΣN\Sigma N and ΣC\Sigma C. (c,d) distributions of committor values for configurations at the putative transition state ensemble of ΣN\Sigma N and ΣC\Sigma C.

Enhanced sampling involving biasing along ΣN\Sigma N is not achievable as it is a discontinuous quantity; we therefore perform umbrella sampling along ΣC\Sigma C[64], from which we extract 500 configurations. We also perform transition path sampling simulations, using the flexible-length aimless shooting algorithm[36, 65]. We initialize such simulations by generating 100 reactive trajectories connecting both basins. The basin definition is the following: A:ΣN<5A : \Sigma N < 5, B:ΣN>14B : \Sigma N > 14. From these initial reactive paths, we perform aimless shooting simulations, exploring configurations close to the separatrix. We select 500 configurations from umbrella sampling simulations, and 1000 configurations from transition path sampling – 500 accepted, 500 rejected – for which we compute the committor. The evaluation of the committor is performed by repeated, independent simulations for which initial velocities are drawn from the Maxwell-Boltzmann distribution, and the system is evolved in the nVTnVT ensemble, until a basin is reached. For each configuration, we perform 200 simulations. In the end, we obtain a dataset of 1500 configurations and corresponding committors.

We are also interested in seeing how well ΣN\Sigma_N and ΣC\Sigma_C capture the true transition state ensemble. For that purpose, from the umbrella sampling dataset, we select configurations at the putative transition state for both simple collective variables using the following conditions: ΣN=8\Sigma_N = 8 (85 configurations), 7≤ΣN≤97 \le\Sigma_N \le9 (227 configurations), 8≤ΣC≤108 \le\Sigma_C \le10 (153 configurations), and 7≤ΣC≤117 \le\Sigma_C \le11 (259 configurations). These conditions are selected according to the free energy profiles, and correspond to configurations at or close to the transition state ensembles according to both collective variables. Results, in the form of distributions of committor values for these sets of configurations, are reported in Figure 4(c,Figure 4d). A good CV would lead to a sharp, unimodal distribution centered at p(B∣X)=0.5p(B|X) = 0.5, meaning that its putative transition state ensemble overlaps well with the actual one. Here, the distributions largely lean towards the dissociated state: that most configurations supposed to be transition states according to these CVs are in fact close to one of the metastable states. This means that ΣN\Sigma_N and ΣC\Sigma_C lack important information mandatory to appropriately describe the transition between both states.

From our configuration-committor dataset, we optimize various KRR models, based on different CV subspaces: ΣN\Sigma_N, ΣC\Sigma_C, the pairwise interaction energy between all solute particles (ΣV11\Sigma_{V11}), a combination of ΣC\Sigma_C and individual solute coordination numbers for all solute particles (C, d=21d = 21), and the permutation invariant vector[56] of all solute particles (PIV, d=190d = 190). The PIV consists of all pairwise distances of the group of atoms, sorted to enforce permutation invariance. While a cutoff function is usually used on the distances to allow focusing on a certain range, here we simply use the inverse distance, which smoothly converges to zero with increasing distance. The detailed procedure for model optimization is reported in Appendix B.

Performances of the various KRR models are reported in Figure 5(a-Figure 5f), comparing test set committor values with model predictions. Training and test set mean absolute errors are reported in Figure 5(g). Two bounds on the MAE values are derived, and represented on Figure 5(g) as gray boxes. The upper bound corresponds to the MAE of a naïve model always returning the average of its training set. The lower bound, which represents a limit on the meaningful accuracy a model can reach, is due to the uncertainty on the committor estimation, due to the finite number of trials. Here, as demonstrated in Appendix F, the MAE on the test set distribution of committor values calculated with 200 trials is about 0.017. First, from Figure 5(g), it is apparent that CVs rank differently in correlating with the committor. The worst performing ones are ΣC\Sigma_C and ΣV11\Sigma_{V11}; looking at Figure 5(b,Figure 5e), they seem weakly positively correlated with the committor, with larger deviations closer to the basins (p(B∣X)=0p(B|X) = 0 and 1). ΣN\Sigma_N (Figure 5(a)) performs better, in particular close to the basins. Combining ΣN\Sigma_N and ΣC\Sigma_C (Figure 5(c)) as a two-dimensional CV does not seem to improve the performances, which means that all the relevant information relative to the transition in ΣC\Sigma_C is already captured by ΣN\Sigma_N. The more complicated list of solute coordination numbers C (Figure 5(d)) performs as well as ΣN\Sigma_N. Contrarily to the latter, it is however a continuous quantity, which makes it appropriate for biasing. Finally, the PIV based KRR model (Figure 5(f)) performs significantly better than all other collective variables, with a test set MAE close to the lower bound. A key difference between C and the PIV collective variables, is that they are composed respectively of single-particle (an atom’s coordination number) and two-particle (an interatomic distance) descriptors. While this leads to having to handle a descriptor of much larger dimensionality, the difference in correlation to the committor hints to the importance of two-particle features in properly describing a model precipitation transformation.

Figure 5. KRRCV models for the Lennard-Jones precipitation example. (a-f) Performance on the test set of models based on various collective variables. Small blue circles represent individual data points. The data is also shown using boxplots (the orange line is the median, the box extends from the first to the third quartile of the distribution, whiskers extend from the box edges to the last data point smaller or larger than ±1.5 times the interquartile range). Data is partitioned in 0.05 wide bins, with two additional blue bins for the basins. (g) Training and test set mean absolute error, averaged over ten dataset splits, plotted as a function of the selected collective variable. Gray boxes show bounds as described in the main text. (h) Sorted inverse bandwidths (blue line), and corresponding test set mean absolute error of reduced models (red line) as a function of the number of included components.

An analysis of the bandwidth components of the PIV-based model (Figure 5(h)) reveals that most of the relevant information is contained in about 10 pairwise distances, out of 190 in total. The analysis proceeds in the following way: inverse bandwidths are sorted in decreasing order; the largest valued components are the most important. Then, models containing only the nn (1 ≤n≤\le n \le 190) most important components are trained. Finally, the test set MAE of each model is plotted as a function of the number of components included. There is a good correlation between inverse bandwidth values and the performance of the resulting reduced model. This shows that the descriptor can be significantly compressed, allowing to bypass the costly evaluation of all pairwise distances.

In addition, it is beneficial to minimize the amount of reference configurations in the kernel ridge regression model, most importantly to reduce the amount of committor evaluations, but also to decrease training and inference times. To this end, we trained PIV models with varying amounts of data points outside of basins (both for reference and training sets), keeping the number of points in basins constant, where the committor can be evaluated at no cost. Results are presented in Figure 6(a,Figure 6b). As expected, predictions are poor for datasets only including basin configurations. When increasing the amount of points outside of basins, the accuracy of the model rapidly increases. In addition, the correlation between the reduced training set and full test set MAEs steadily increases. From Figure 6(b), it is clear that a range of models with reduced dimensionality or data points can achieve similar performance on the full test set. Eventually, we selected four models, represented as white points on Figure 6(b), for which we performed subsequent tests: the original one (190 PIV components and 330 data points), one with only 10 PIV components preserved (KRR(PIV)10_{10}), one with only 25 data points outside of basins (KRR(PIV)25_{25}), and one fully reduced model (KRR(PIV)2510_{25}^{10}). Ideally, selecting an appropriate number of reference points would not require obtaining a large test set. We therefore propose in Appendix E8 an empirical approach for model selection based on training set error and noise level. Finally, modifying the loss function for bandwidth optimization by increasing the weight on data points outside of basins could allow to obtain satisfying models with even less reference configurations.

Figure 6. Performance of various KRR(PIV) models. (a) Evolution of the full test set MAE as a function of the number of points in the reference and training sets not in metastable basins (red curve). Also shown is the corresponding evolution of the Pearson correlation coefficient between the training set and full test set MAEs (blue curve). Results are averaged for 20 dataset splits. (b) Full test set MAE as a function of the number of PIV components included in the model (sorted by bandwidth importance), and number of points in datasets outside of basins. White dots correspond to selected models for further analyses. (c) Free energy and geometric free energy profiles along KRR(PIV). (d) Free energy profiles along reduced KRR(PIV) models. (e) Distribution of committor values for configurations at the putative transition state ensemble of KRR(PIV). (f) Same as (e), for reduced KRR(PIV) models.

To further confirm the quality of the newly obtained CVs, we perform committor analyses. To sample new configurations at the putative transition state ensembles of KRR CVs, we implement the approach in the hack-the-tree branch of PLUMED[63, 66]. Enhanced sampling simulations are automatically enabled as long as the input collective variables forming the subspace are differentiable; we therefore performed umbrella sampling on all four K R R C V models based on the PIV, and obtained datasets constrained at 0.45≤ξ≤0.550.45 \le\xi\le0.55. We then compute the committor of the sampled configurations, for both collective variables; committor distributions are reported in Figure 6(e,Figure 6f). These are in stark contrast with those presented in Figure 4(c,Figure 4d). For all four models, the distribution is unimodal and sharply peaked at 0.5, which demonstrates that the projection of the configuration space onto this collective variable preserves the features of the transition state ensemble. Furthermore, we evaluate free energy profiles along these CV models using the previously obtained unbiased molecular dynamics simulations; results are shown, for the original PIV model, in Figure 6(c). The profile, mostly flat, and rapidly varying close to the basins, is typical of committor approximations[67]. Profiles obtained for the reduced models (Figure 6(d)) are very similar. The ensemble-averaged gradients along Cartesian coordinates of ΣN\Sigma_N, ΣC\Sigma_C, and KRR(PIV) are reported in Figure 16. These gradients are used to compute the geometric free energy profile, and intuitively, should be zero in metastable basins, and for monotonous CVs like the committor, maximal at the transition state ensemble. Obviously, this is here only achieved by KRR(CV). Finally, the free energy of activation values for various collective variables (reported in Table IV) are significantly different, even when enforcing gauge-invariance in the free energy profile definition. Additional information is therefore encoded in the KRR(PIV) model, for which ΔF‡\Delta F^{\ddagger} is maximized. Since the reaction rate is independent of the collective variable, using the Eyring–Polanyi equation, the transmission coefficients of ΣN\Sigma_N and ΣC\Sigma_C should be smaller than the one of KRR(PIV). Recrossings due to a poor choice of collective variable (and therefore separatrix) are therefore reduced.

Figure 16. Norm of the gradient of collective variables along Cartesian coordinates: (a) ΣN\Sigma_N, (b) ΣC\Sigma_C, (c) KRR(PIV)

ξ\xiΔF‡\Delta F^{\ddagger} (kBTk_B T)ΔFg‡\Delta F_g^{\ddagger} (kBTk_B T)
ΣN\Sigma_N1.86±0.211.86 \pm0.211.36±0.211.36 \pm0.21
ΣC\Sigma_C2.61±0.212.61 \pm0.211.48±0.221.48 \pm0.22
KRR(PIV)5.59±0.215.59 \pm0.212.52±0.232.52 \pm0.23

Table I. Free energy of activation, for both free energy profile definitions, and for three collective variables. The error estimates are 95% confidence intervals computed through uncertainty propagation, assuming zero covariance.

A kernel ridge regression approach also ensures the interpretability of the model, since a single parameter (the bandwidth) rates the importance of each component of the collective variable space. For more involved estimators, such as neural networks, this is far from being the case. Obviously, in the end, interpretability will be dictated by the abstractness of the selected collective variable: it is easier to extract knowledge from a small list of simple, intuitive descriptors than from broad, general representations such as a PIV. In the top panel of Figure 7(a), we display the inverse bandwidth values of the KRR(PIV) model, along with the corresponding number of particles in the PIV displayed as white or gray boxes (the number of distance components grows as N(N−1)/2N(N-1)/2, where NN is the number of particles in the system). Most of the important bandwidths are in a range corresponding to 5 to 14 particles in the largest cluster (gray boxes), which is precisely the condition on ΣN\Sigma_N used for basin definition. In addition, we also evaluate the gradient in PIV space of the KRR(PIV) model along p(B∣X)p(B \mid X), by binning the test set configurations. The absolute gradient, normalized for each committor bin, is displayed in the bottom panel of Figure 7(a). This analysis allows to identify the most important PIV components along the reaction process. Although there is some dispersion, along the transition from the dissociated state to the associated state, important components seem to concern larger distances with increasing transformation progress.

Figure 7. (a) Absolute gradient in PIV space of the KRR(PIV) model, averaged and normalized along p(B∣X)p(B\mid X) bins computed over the test set. The greater the PIV component, the greater the distance out of all pair distances of solute particles. Upper panels: inverse bandwidth values for each PIV components, and corresponding number of particles (white and gray boxes), ranging from 2 (left) to 20 (right) particles. The gray area, from 5 to 14, corresponds to the range between basins definition. (b,c) 2d histograms of configurations sampled from unbiased molecular dynamics, along KRR(PIV) and either ΣN\Sigma N (b) or ΣC\Sigma C (c).

Finally, we can use the KRR(PIV) as a proxy to the committor, to analyze configurations along the reaction process. To this end, we perform an analysis over configurations sampled from unbiased molecular dynamics, here mostly to assess the quality of simple collective variables (ΣN\Sigma_N and ΣC\Sigma_C) in describing the transformation. We emphasize that a much more thorough analysis using other collective variables can be performed easily, if the interest is in understanding the transformation process, since an inexpensive-to-compute proxy to the committor is now available. 2d histograms along KRR(PIV) and either ΣN\Sigma_N (b) or ΣC\Sigma_C (c) are presented in Figure 7(b,Figure 7c), computed over the 6⋅1066 \cdot10^6 configurations sampled. Looking at the distribution of ΣN\Sigma_N at KRR(PIV) = 0.5, it is interesting to notice that for most configurations, ΣN≈10−11\Sigma_N \approx10-11, while the top of the barrier shown in Figure 4(a) corresponds to ΣN=8\Sigma_N = 8. This also explains the committor distribution in Figure 4(c), skewed towards the dissociated state. Overall, for constant KRR(PIV) values, the ΣN\Sigma_N distributions are rather unimodal, although skewed towards large values. For ΣC\Sigma_C, the distributions are very broad over the whole transformation. The basins also overlap with the transition zone. This translates to poor correlation with the committor, and inappropriateness in describing the transformation under scrutiny.

Ion association in solution: LiF in water

Finally, we investigate the association of Li+^{+} and F−^{-} ions in solution; this mechanism is an important precursor of the formation of the solid electrolyte interphase (SEI) in Li-ion batteries [68, 69], its understanding is therefore crucial to design devices with greater lifetimes. We select water as a solvent, both for simplicity, and because an LiF-rich SEI forms at the negative electrode in Li-ion batteries based on aqueous electrolytes [70]. LiF, being composed of the smallest monovalent inorganic ions, has a very high lattice energy, and is therefore only very moderately soluble in water (about 1 g/L at room temperature [71]).

From the fundamental point of view, the association of atomic, monovalent ions in water is a well-known illustration of the counter-intuitive failure of simple collective variables – namely the interionic distance – in describing transformations [67, 72, 73]. Arguments put forward include solvent degrees of freedom correlated with the transition as well as inertial effects, i.e. when the time-derivative of degrees of freedom has to be accounted for.

We follow a similar sampling strategy as in section IV: we first converge the free energy profile along the interionic distance (rr) by running unbiased molecular dynamics simulations. Then, we sample configurations with r=r∗≈2.63r = r^{*} \approx2.63 Å, the putative transition state along this collective variable, using umbrella sampling. Finally, we sample configurations near the true separatrix using aimless shooting. Committors are then computed using repeated molecular dynamics for configurations sampled using both methods. Details regarding all computational steps are included in Appendix G. The ions are modeled using the Joung-Cheatham[74] potential, and water using the SPC/E rigid model[75].

The free energy along the interionic distance is reported in Figure 8(b). At short distance, ions form a first metastable state, the contact ion pair (CIP). Separated from the CIP by a free energy barrier of more than 7kBT7k_{\mathrm{B}}T is the solvent-separated ion pair (SSIP) metastable state, where one water molecule coordinates both ions. Further increasing the distance leads to completely separating the ions. We define both states using the following criteria: CIP, state A: r≤2.036r \le2.036 Å, SSIP, state B: r≥4.190r \ge4.190 Å. These distances correspond to the bottom of the free energy wells for both states. Other state definitions are possible, such as the interionic distances corresponding to the minima of the wells plus kBTk_{\mathrm{B}}T, but a stringent state definition allows to clearly separate the transition regime and the metastable states. The distribution of committor values for configurations sampled at r∗r^{*} using umbrella sampling is reported in Figure 8(c). The distribution is bimodal, with sharp peaks at p(B∣r∗)=0p(\mathrm{B}|r^{*}) = 0 and 1, and mostly flat otherwise. Similar distributions have been recovered for other monovalent ions in water, using different interatomic potentials[67, 72, 73].

Figure 8. LiF association in water. (a) Contact ion pair (CIP) and solvent-separated ion pair (SSIP). Pink, green, red, and white spheres respectively represent Li, F, O, and H atoms. (b) Free energy profile along the interionic distance (rr). (c) Distribution of committor values for configurations at the putative transition state ensemble of rr sampled using umbrella sampling.

Interestingly, configurations sampled close to the true transition state ensemble correlate fairly well with the interionic distance. This is demonstrated in Figure 9(a), showing results from aimless shooting simulations. At r∗r^{*}, configurations sampled from aimless shooting are distributed in a unimodal fashion centered at p(B∣X)=0.5p(\mathrm{B}|\mathrm{X}) = 0.5, in stark contrast with configurations extracted from umbrella sampling, as shown in Figure 9(b). We also verify that the umbrella sampling distribution corresponds to the distribution under the same conditions obtained from unbiased equilibrium simulations, in Appendix G 7. This could explain why collective variable optimization techniques based exclusively on transition path sampling data show fairly good correlation between the committor and the interionic distance[40] – not forgetting that the ions and interatomic potentials are not the same. From these observations, we formulate the following hypothesis regarding what is lacking for the proper description of the dissociation process, schematized in Figure 9(c): the subset of configuration space R\mathcal{R} matching the r≈r∗r \approx r^{*} criterion includes the transition state ensemble T\mathcal{T}. A subset S⊂R\mathcal{S} \subset\mathcal{R} approximating T\mathcal{T} would match the r≈r∗r \approx r^{*} condition, with additional unknown constraints on degrees of freedom related to water. Identifying these constraints has been the purpose of many studies[40, 67, 72, 73].

Figure 9. (a) Correlation between rr and p(B∣X)p(\mathrm{B}|\mathrm{X}) for configurations sampled from aimless shooting simulations. The gray zone corresponds to r∈[2.55,2.70]≈r∗r \in[2.55, 2.70] \approx r^{*}. (a) Correlation between r≈r∗r \approx r^{*} and p(B∣X)p(\mathrm{B}|\mathrm{X}) for configurations sampled from aimless shooting (red circles) and umbrella sampling (blue circles) simulations. Distributions are also displayed on the right side, with matching colors. (c) Hypothesis regarding the hierarchy of ensembles in configuration space.

Following these observations, we train six K RRCV models based on different collective variables: i) rr only (d=1d = 1), ii) rr and fpf_p, the interionic force projected on the vector connecting both ions (d=2d = 2), iii) a list of scalar collective variables (rr, Li+^{+} and F−^{-}’s hydrogen and oxygen coordination numbers, the number of water molecules coordinating both ions, and the solvent-contributed Madelung potential[76] on Li+^{+} and F−^{-} (d=8d = 8), iv) the PIV of the subsystem composed of both ions and their first coordination sphere, the four closest oxygens to Li+^{+} and the six closest hydrogens to F−^{-} (d=66d = 66), v) a compact set of atom-centered symmetry functions[54] centered on both ions (ACSFs) designed for aqueous systems[77] (d=90d = 90), and vi) a larger set of ACSFs automatically designed for organic matter[78, 79] (d=595d = 595). Reference, training and test sets are homogeneously distributed in terms of committor values (using 22 bins, with half of the configurations from umbrella sampling, and the other half from aimless shooting). We include basin configurations sampled from equilibrium simulations. The models are trained with a variable number of reference configurations, from 44 to 1540 (2 to 70 per bin). Training and test sets have a fixed number of configurations (1760, or 80 per bin). Results are presented in Figure 10.

Figure 10. KRRCV models for LiF association in water. (a-f) Performance on the test set of models based on various collective variables. Small blue circles represent individual data points. The data is also shown using boxplots; data is partitioned in 0.05 wide bins, with two additional blue bins for the basins. These are the bins used to generate homogeneous datasets. Distributions of estimated committor values are also provided: an optimal estimator would return a constant distribution, since the test set is homogeneous. (g) Training and test set mean absolute errors, averaged over ten dataset splits, plotted as a function of the selected collective variable. Gray dashed lines are power law fits on the test set MAEs.

The first thing to notice is that contrary to the precipitation case, here no single model achieves satisfying performance – although going from rr to more involved collective variables certainly leads to significant improvements. Unsurprisingly, the interionic distance alone leads to a model with high variance along the whole range of committor values. The performances near the basins are particularly poor. Adding fpf_p slightly improves the situation; in particular, the variance is reduced for configurations close to the transition state. The list of six scalar collective variables, as well as the PIV of the first solvation shell, lead to an improved description of the onset of the reversible transformation mechanism. Estimated committor distributions become noticeably flatter. With the more involved ACSF collective variables, in particular with the high-dimensional (d=595d = 595) ACSFlarge_{\mathrm{large}}, the performance close to the transition state becomes acceptable, although configurations close to the basins remain poorly described. Often the committor is first modeled using a switching function[36, 40], with parameters controlling the shape of the actual function. This allows to obtain a quantity which varies more linearly in the collective variable space, which is therefore easier to fit. Here, this did not improve the situation, with performances of transformed models using a sigmoid function (excluding basins in the training) almost identical to non-transformed models. Kernel ridge regression already allows to learn non-linear patterns, although enforcing these patterns, when known a priori, usually makes the learning easier. From Figure 10(g), it is clear that complex collective variables (i) lead to larger overfitting (i.e. the inability of a model to perform satisfyingly far from the training data), and ii) require more reference configurations to converge. Increasing the number of reference configurations beyond the range considered here would certainly improve the performances of the high-dimensional collective variable models. The inability to find an accurate model for the association of LiF in water could be explained by two causes: i) structure beyond the first solvation shell is important, since almost all collective variables considered here focus at most on the ions’ first solvation shells (apart from the Madelung potentials), and/or ii) structure alone cannot predict the average evolution of the system, i.e. inertial effects are important. In the following, we test both hypotheses.

To assess the importance of structure beyond the first solvation shell, we considered PIV-based KRRCV models centered on either the cation or the anion. These always include both ions, and a variable number of water molecules (from 1 to 16), ranked by their distance to the central ion (O-Li+^{+}, or H-F−^{-}). The dimension of the collective variable ranges from 10 to 1225. Performances of the models, using 1760 reference configurations, are reported in Figure 11.

Figure 11. Performances of KRRCV models based on the ion-centered PIV with varying number of surrounding water molecules. They gray zones correspond to the first solvation shell of both ions.

While increasing the number of water molecules initially leads to reducing both training and test set MAEs, which corresponds to including more information correlated to the transformation mechanism, a plateau is rapidly reached. Interestingly, this plateau is exactly reached at a number of water molecules corresponding to the first solvation shell of both ions (4 for the cation, 6 for the anion). Increasing the number of water molecules, and therefore the dimension of the collective variable, does not lead to KRRCV models with degraded performances, as can be seen from the plateau in the MAEs. This means that the optimizer still performs well, for high-dimensional data. Within a PIV representation, there is therefore no information correlated to the LiF association mechanism beyond the first solvation shell. Assuming that the mechanism is similar for NaCl, this finding is both in agreement[80] and disagreement[73] with previous studies.

To investigate inertial effects, we start by evaluating their importance in the present setting. Hummer showed[81] that in the diffusive limit, the committor and the transition path probability p(TP∣X)p(\mathrm{TP}\mid\mathbf{X}) (the probability that a trajectory passing through configuration X\mathbf{X} connects both basins) are related in the following way:

p(TP∣X)=2p(B∣X)(1−p(B∣X)).(10)p(\mathrm{TP}\mid\mathbf{X}) = 2p(\mathrm{B}\mid\mathbf{X})\left(1-p(\mathrm{B}\mid\mathbf{X})\right). \tag*{(10)}

Away from the diffusive limit, inertial effects are important and lead to a deviation from this analytic result. For 400 configurations sampled from aimless shooting, we compute explicitly p(TP∣X)p(\mathrm{TP}|\mathrm{X}); results are presented in Figure 12(a) (blue circles, nVTnVT dynamics using a chain of Nosé-Hoover thermostats). A strong deviation from the diffusive limit, maximal at the transition state ensemble, is apparent. This deviation has also been observed for the association of NaCl in water[73]. Configurations near the transition state ensemble have an enhanced transition path probability. In the diffusive limit, atomic velocities are randomized at each timestep, while under nVTnVT dynamics, the persistence in time of momenta can influence directly the occurrence of a reactive event. To further confirm the importance of inertial effects, we perform 1000 velocity initializations for 20 configurations from umbrella sampling for which 0.475≤p(B∣X)≤0.5250.475 \leq p(\mathrm{B}|\mathrm{X}) \leq0.525, and monitor the initial atomic velocities projected on the interionic distance (∂r/∂t\partial r/\partial t), as well as the basin the system eventually commits to. Histograms depending on the commitment outcome are presented in Figure 12(b). In the absence of inertial effects, both histograms would overlap, indicating that the outcome is not conditioned on the atomic velocities. However, a clear separation is visible here, with a negative (positive) interionic velocity being more likely to lead to association (dissociation). This is a trivial result if one assumes that the persistence of atomic momenta is non-zero. Considering the reversibility of the equations of motion, and therefore, in particular, of committor trajectories, this result can also be interpreted in a specular way: initial velocities Boltzmann-distributed in each basin lead to reactive trajectories with transition-state velocities having an asymmetric non-Boltzmann distribution.

Figure 12. Inertial effects: (a) correlation between p(B∣X)p(\mathrm{B}|\mathrm{X}) and p(TP∣X)p(\mathrm{TP}|\mathrm{X}) for different cases: nVTnVT dynamics using a chain of Nosé-Hoover thermostats (blue circles), two overdamped Langevin dynamics with different friction values (red and green circles), and the limit of infinite friction (black and white line), (b,c) outcome histograms over initial interionic velocity, for nVTnVT dynamics (b), and overdamped Langevin dynamics (c). The red and blue vertical lines correspond to the average of each distribution.

Having shown that inertial effects do play a role in the context of LiF association in water, we wish to alter the dynamics in such a way that they are reduced. To this end, we modify the equation of motion of the ions only (i.e. that for water is unchanged), following the overdamped Langevin equation:

dX=−γ−1∇Udt+2kBTγ−1/2dW,(11)\mathrm{d}\mathbf{X}=-\gamma^{-1}\nabla U\mathrm{d}t+\sqrt{2k_{\mathrm{B}}T}\gamma^{-1/2}\mathrm{d}\mathbf{W}, \tag*{(11)}

where W\mathbf{W} is a 3n3n-dimensional white noise term (with nn the number of ions), and γ\gamma is the friction, identical for all ions. We perform simulations with γ=1\gamma=1 u/fs and 22 u/fs, corresponding to inertial timescales – i.e., timescales for decorrelation of the CV time derivative – of about 77 fs and 1414 fs on Li+^+, and 1919 fs and 3838 fs on F−^-. As demonstrated in Figure 12(a), increasing the friction parameter leads to a better agreement with the diffusive limit (which corresponds to γ→∞\gamma\to\infty). As shown in Figure 12(c), the outcome histograms now overlap, signifying that inertial effects are removed. We then evaluate the committor on the umbrella sampling and aimless shooting datasets previously obtained, with both friction values, and train new KRRCV models. Results are presented in Figure 13.

Figure 13. Performances of various KRRCV models, for different dynamics.

The performances of KRRCV models are systematically and significantly improved compared to nVTnVT dynamics. This is valid for each collective variable. Obviously, in the diffusive limit, the interionic distance would be the ideal collective variable, but considering that such an improvement is already obtained at low to reasonable friction values, this demonstrates that inertial effects prevent finding a collective variable only based on the structure that optimally reproduces the committor. In addition, even for γ=2\gamma=2 u/fs, the hierarchy of performance between collective variables is preserved.

There are therefore two effects to take into account when searching for an optimal collective variable for the association of small atomic ions in water: structural degrees of freedom related to the solvent, which contain information correlated with the committor, and inertial effects. An approach purely based on the committor in the case where inertial effects are important seems inappropriate, as p(B∣X)p(\mathrm{B}|\mathbf{X}) does not encode all the necessary information describing the transformation under scrutiny.

Note that the velocity-dependent committor p(B∣X,X˙)p(\mathrm{B}|\mathbf{X},\dot{\mathbf{X}}) is a deterministic quantity in the microcanonical ensemble, as it corresponds to a single point in phase space, while it retains a probabilistic nature in presence of a thermostat (see, e.g., [82] for a discussion of velocity-dependent committors in transition path theory).

A possible approach suitably accounting for inertial effects could be based on a committor conditioned on the velocity of a collective variable. This quantity is still a probability, and it would be interesting to determine to which extent inertial effects are important: do they only concern the ions, in which case evaluating p(B∣X,r˙)p(\mathrm{B}|\mathbf{X},\dot{\mathbf{r}}) should be enough, or are the momenta of the water molecules also correlated to the transformation mechanism? To efficiently evaluate p(B∣X,r˙)p(\mathrm{B}|\mathbf{X},\dot{\mathbf{r}}), velocity initialization techniques with fixed values of r˙\dot{\mathbf{r}} would have to be implemented.

Summary and conclusions

We have introduced a new method for the construction of optimized collective variables, based on a data-driven generalization of path collective variables. It consists in performing a regression of the committor – which, in the absence of inertial effects, directly encodes the transformation progress – starting from a given basis of collective variables, through kernel ridge regression. The final collective variable is one dimensional and differentiable, which makes it appropriate for enhanced sampling simulations. Our approach also allows to rank and compare CVs: the performance of a certain CV subspace choice is evaluated by computing a mean absolute error with respect to a test set of committor values. In addition, using a bandwidth vector in the kernel, with values optimized by minimizing a loss score defined on a training set, allows for interpretability of the resulting model. We apply the method to three different test cases: a two-dimensional toy model, a precipitation model of Lennard-Jones particles, and the LiF association in water.

From the two-dimensional toy model test case, we learn that a reasonable number of reference configurations is sufficient to obtain an accurate KRRCV model (Kernel Ridge Regression Collective Variable), although how they are sampled is important, with enhanced sampling being a viable strategy for constructing datasets. In addition, the optimization process of kernel bandwidth parameters is shown to be robust even when including many collective variables uncorrelated with the committor.

For the precipitation model of Lennard-Jones particles, we show that our method allows to obtain an accurate collective variable from a high-dimensional representation of the structure (the PIV). This is promising for further investigation of realistic precipitation, crystallization and nucleation phenomena. The model obtained can be significantly compressed, both in terms of the number of reference configurations and components included, without degrading its performances, evaluated on committor distributions and free energy profiles. In particular, for committor distributions, we were able to perform biased simulations using KRRCVs. The free energy of activation of the best-performing model, extracted from the gauge-invariant free energy profile, is larger than the ones obtained using simple collective variables, hinting at a significantly improved transmission coefficient too. Finally, we show that the model can be interpreted, and is useful to evaluate issues related to less well-performing collective variables.

For the association of LiF in water, we demonstrate that no information correlated with the transformation mechanism is contained beyond the first solvation shell of the ions. We obtain various KRRCV models performing better than the simple interionic distance. The highest accuracy reached is however moderate, even when resorting to flexible representations such as high-dimensional ACSFs. We show that this is mostly due to inertial effects. In this regime, the committor depends not only on the atomic positions, but also on their momenta.

In situations where inertial effects are important, such as reactions in solution, it therefore seems mandatory to account for the atomic momenta. A solution could be to evaluate committor probabilities conditioned on a collective variable momentum. In this setting, much remains to be understood. For instance, should the momenta be projected onto collective variables in the same way as the structure? Or is there a hierarchy that would allow to use simpler projections for the velocities, compared to the atomic positions; for instance, in the ion association example, could we get away with only conditioning the committor on the interionic distance time derivative? In situations where inertial effects are negligible (precipitation, nucleation, crystallization), the method introduced here allows to help understand transformation mechanisms, select collective variables on solid grounds, and allow for efficient enhanced sampling simulations.

Acknowledgments

The authors would like to gratefully acknowledge fruitful discussions with Sara Bonella, Michele Casula, Ludovic Goudènege, Pierre Monmarché, Rocio Semino, Alessandra Serva, Gabriel Stoltz, and Rodolphe Vuilleumier, within the Materials for Energy through STochastic sampling and high-peRformance cOmputing (MAESTRO) collaboration, hosted at the Institut des Sciences du Calcul et des Données. We also thank Gareth Tribello for his advice in implementing KRRCVs in the hack-the-tree branch of PLUMED. This project received funding from the European Research Council under the European Union’s Horizon 2020 research and innovation program (Grant Agreement No. 863473). This work was granted access to the HPC resources of IDRIS under the allocations A0130811069 and A0140901387, and also benefited from the computing resources at Sorbonne Université managed by SACADO.

Solving the backward Kolmogorov equation using finite elements

The committor p(B∣(x,y))p(\mathrm{B}|(x,y)) can be obtained as the solution of the following equation [83]

{Lp(B∣(x,y))=0(x,y)∈(A∪B)cp(B∣(x,y))=0(x,y)∈Ap(B∣(x,y))=1(x,y)∈B(12)\begin{cases} \mathcal{L}p(\mathrm{B}|(x,y)) = 0 & (x,y) \in(A \cup B)^{c} \\ p(\mathrm{B}|(x,y)) = 0 & (x,y) \in A \\ p(\mathrm{B}|(x,y)) = 1 & (x,y) \in B \tag*{(12)} \end{cases}

where L\mathcal{L} is the infinitesimal generator of the Langevin overdamped dynamics. For the two-dimensional potential V(x,y)V(x,y) of (5), it can be expressed as [84]

Lf(x,y)=−∂V(x,y)∂x∂f(x,y)∂x−∂V(x,y)∂y∂f(x,y)∂y+1β(∂2f(x,y)∂x2+2∂2f(x,y)∂x∂y+∂2f(x,y)∂y2)(13)\mathcal{L}f(x,y) = -\frac{\partial V(x,y)}{\partial x}\frac{\partial f(x,y)}{\partial x} - \frac{\partial V(x,y)}{\partial y}\frac{\partial f(x,y)}{\partial y} + \frac{1}{\beta}\left(\frac{\partial^{2}f(x,y)}{\partial x^{2}} + 2\frac{\partial^{2}f(x,y)}{\partial x\partial y} + \frac{\partial^{2}f(x,y)}{\partial y^{2}}\right) \tag*{(13)}

for any two-dimensional function f(x,y)f(x,y). Eq. (12) can be solved using finite elements methods [85]. For a finite element basis {fi(x,y)}1N\{f_i(x,y)\}_{1}^{N}, the backward Kolmogorov equation can be expressed as a matrix equation,

{Lq=0(x,y)∈(A∪B)cq=0(x,y)∈Aq=1(x,y)∈B(14)\begin{cases} Lq = 0 & (x,y) \in(A \cup B)^{c} \\ q = 0 & (x,y) \in A \\ q = 1 & (x,y) \in B \tag*{(14)} \end{cases}

where the matrix elements are given by

Li,j=∫R2dxdy[fi(x,y)(−∂V(x,y)∂x∂fj(x,y)∂x−∂V(x,y)∂y∂fj(x,y)∂y)−1β(∂fi(x,y)∂x∂fj(x,y)∂x+∂fi(x,y)∂x∂fj(x,y)∂y+∂fi(x,y)∂y∂fj(x,y)∂x+∂fi(x,y)∂y∂fj(x,y)∂y)].(15)L_{i,j} = \int_{\mathbb{R}^{2}} \mathrm{d}x\mathrm{d}y \left[f_i(x,y)\left(-\frac{\partial V(x,y)}{\partial x}\frac{\partial f_j(x,y)}{\partial x}-\frac{\partial V(x,y)}{\partial y}\frac{\partial f_j(x,y)}{\partial y}\right)-\frac{1}{\beta}\left(\frac{\partial f_i(x,y)}{\partial x}\frac{\partial f_j(x,y)}{\partial x}+\frac{\partial f_i(x,y)}{\partial x}\frac{\partial f_j(x,y)}{\partial y}+\frac{\partial f_i(x,y)}{\partial y}\frac{\partial f_j(x,y)}{\partial x}+\frac{\partial f_i(x,y)}{\partial y}\frac{\partial f_j(x,y)}{\partial y}\right)\right]. \tag*{(15)}

The committor is then obtained as

p(B∣(x,y))=∑iqifi(x,y)(16)p(B|(x,y)) = \sum_i q_i f_i(x,y) \tag*{(16)}

The result of Figure 2b was obtained using a regular triangular mesh of 79202 triangles defined on the rectangular domain [−1.5,1]×[−0.5,2][-1.5,1] \times[-0.5,2] and linear element (P1 Lagrange element). This leads to a finite element basis with 39534 degrees of freedom once nodes corresponding to region AA and BB were removed. Computations were performed using the scikit-fem finite element library [86].

KRR model optimization procedure

All optimizations (regarding kernel ridge regression expansion coefficients as well as hyperparameters) are performed using the python/C++ package falkon[87, 88]. A model python script is included in the Supplemental Material. For a given set of hyperparameters (regularization coefficient and bandwidths), optimal expansion coefficients are obtained by solving Eq. (3). Simultaneous optimization of hyperparameters is achieved by iteratively minimizing the MAE on a training set (distinct from the reference set), using the Adam optimizer[89], as implemented in PyTorch[90], for 100 steps. For a dataset of NN entries, the MAE is defined as:

MAE=1N∑i=1N∣p(B∣Xi)−KRRCV(ξi)∣(17)\mathrm{MAE} = \frac{1}{N}\sum_{i=1}^{N}\left|p(B|X_i)-\mathrm{KRRCV}(\xi_i)\right| \tag*{(17)}

We perform distinct optimizations with different values of the learning rate parameter (α\alpha): for the rugged Müller-Brown case, α∈[10−1,100,101]\alpha\in[10^{-1},10^{0},10^{1}], for the Lennard-Jones case, α∈[10−1,100,101,102]\alpha\in[10^{-1},10^{0},10^{1},10^{2}], and for the LiF association case, α∈[10−1,5⋅10−1,100,5⋅100,101,5⋅101,102,5⋅102]\alpha\in[10^{-1},5\cdot10^{-1},10^{0},5\cdot10^{0},10^{1},5\cdot10^{1},10^{2},5\cdot10^{2}]. We partition reference and training sets randomly in 10 different ways, to obtain uncertainty estimates. The test set is always the same. We perform 100 optimizations starting from randomly selected initial hyperparameter values. For each γ\gamma value, this amounts to 1000 optimizations. Finally, out of all optimized models, we select the one that minimizes the training set error. We observe a positive correlation between the training set and test set error metrics, as shown on Figure 14.

Figure 14. Correlation between the training set and test set mean absolute errors, for the Lennard-Jones precipitation case, with the PIV collective variable, for the dataset split 3. Points are colored according to the learning rate α\alpha; each point corresponds to the final metrics obtained for one optimization, starting from randomly selected parameters.

We note that for high-dimensional representations, the optimal models are "ridgeless", meaning that the optimal regularization parameter λ\lambda approaches zero. This has been discussed before [91] for non-linear kernels, and does not prevent generalization.

Three wells model potential

In Figure 15, we compare a "2R" path collective variable with the true committor for a two-dimensional potential showing three metastable states. The two deeper ones are labeled as AA and BB, and the shallowest one is an intermediate state. The free energy profiles differ quite significantly, especially in the vicinity of the intermediate state.

Figure 15. (a) The potential energy surface. Shaded circles correspond to the metastable states definition used for the evaluation of the committor, (b) the committor as obtained from the backward Kolmogorov equation, (c) Canonical free energy profiles, (d) the "2R" path collective variable in configuration space, (e) Ensemble-averaged collective variable gradients, (f) Geometric free energy profiles.

Müller-Brown potential non-linearly embedded in a five-dimensional space

To complicate the learning process of the committor in § 1.2, we use non-linear transformation to embed the two-dimensional Müller-Brown potential in a five-dimensional space, in a similar way as in Ref. [92]:

V(x1,x2,x3,x4,x5)=V(x,y),(18)V(x_{1},x_{2},x_{3},x_{4},x_{5}) = V(x,y), \tag*{(18)}
x1=x+0.1y2x2=y−2x+3x3=4∣xy∣x4=x3−y2x5=xy4(19)\begin{aligned} x_1 &= x+0.1y^2\\ x_2 &= y-2x+3\\ x_3 &= \sqrt{4\lvert xy\rvert}\\ x_4 &= x^3-y^2\\ x_5 &= xy^4 \tag*{(19)} \end{aligned}

We train a KRR model using all five dimensions, with 500 reference and training data points. The resulting test set MAE, ≈7⋅10−3\approx7 \cdot10^{-3}, is on par with the one of the model trained on the native two-dimensional representation.

Precipitation of Lennard-Jones particles: computational details and additional information

System generation, initial relaxation

We begin with an initial configuration composed of 4096 particles arranged on a simple cubic lattice of spacing set to l=σl = \sigma, in a cubic box with 16 σ\sigma-long edges. 20 particles, selected randomly, are set to being of type 2 (the larger, precipitating species). The atomic velocities are initialized by drawing from the Maxwell-Boltzmann distribution at T=1T = 1. A 106δt10^6\delta t simulation in the npTnpT ensemble at T=1T = 1, p=1p = 1 is then performed to relax the system and estimate the equilibrium box size. The box size is subsequently fixed at 17.20 σ\sigma.

Unbiased free energy estimates

Starting from the previously equilibrated geometry, we perform 300 independent simulations in the nVTnVT ensemble with randomized initial velocities, ran for 106δt10^6\delta t for equilibration and 2⋅107δt2 \cdot10^7\delta t for sampling, which amounts to a total of 6⋅109δt6 \cdot10^9\delta t. Collective variables are computed every 10310^3 time steps. Free energy profiles are then calculated through binning, with error estimates obtained by splitting the whole dataset into six distinct subsets, and computing 95% confidence intervals over the distribution of estimates. We performed identical simulations in the npTnpT ensemble, to verify that box size fluctuations do not significantly influence free energy profiles.

Computing collective variable gradients

We compute the derivatives of the collective variable with respect to the Cartesian coordinates using a second-order central difference scheme, with a displacement of atomic positions set to 0.05σ0.05\sigma:

dξ(x)dx≈ξ(x+0.05σ)−2ξ(x)+ξ(x−0.05σ)(0.05σ)2(20)\frac{\mathrm{d}\xi(x)}{\mathrm{d}x} \approx\frac{\xi(x+0.05\sigma)-2\xi(x)+\xi(x-0.05\sigma)}{(0.05\sigma)^2} \tag*{(20)}

Umbrella sampling simulations

To sample configurations biased along ΣC\Sigma_C, we perform simulations with five different harmonic biasing potentials of the form 0.5k(ΣC−ΣC0)20.5k\left(\Sigma_C-\Sigma_{C0}\right)^2 centered at ΣC0=10,11,12,13,14\Sigma_{C0}=10,11,12,13,14, and with a force constant k=10kBTk=10k_{\mathrm{B}}T. Trajectories last 107δt10^7\delta t and configurations are sampled every 10510^5 steps; the first configuration is discarded to allow for equilibration. We therefore sample a total of 500 configurations.

To sample configurations at the putative transition state ensembles of KRR⁡(C)\operatorname{KRR}(\mathrm{C}) and KRR⁡(PIV)\operatorname{KRR}(\mathrm{PIV}), we perform simulations with a harmonic biasing potential centered at KRR⁡(ξ)0=0.5\operatorname{KRR}(\xi)_0=0.5, and with a force constant k=104kBTk=10^4k_{\mathrm{B}}T. Trajectories last 2.5⋅106δt2.5\cdot10^6\delta t and configurations are sampled every 10410^4 steps; the first configuration is discarded to allow for equilibration. We therefore sample a total of 250 configurations for each collective variable.

Transition path sampling: brute force

In order to generate initial transition paths to be used as starting points for aimless shooting simulations, we select the 100 configurations from the ΣC0=12\Sigma_{C0}=12 umbrella sampling window and propagate them forward and backward in time with randomized initial velocities. If both forward and backward dynamics reach the same metastable basin, we perform dynamics again with new random initial velocities. In this setting, a transition path is typically achieved after less than 10 tries. Eventually, all initial contributions lead to transition pathways. The largest number of tries was 28. We report in Figure 17 a histogram of the number of tries, for all 100 starting configurations (which we call the t=0t=0 configurations).

Figure 17. Number of tries needed to connect both basins in brute force transition path sampling, for 100 starting configurations sampled from an umbrella sampling simulation.

Transition path sampling: aimless shooting

We used the transition paths generated using brute force to initialize 100 independent aimless shooting simulations[36, 65]. The approach is the following: starting from the t=0t=0 configuration in the initial path, the system is propagated both forward and backward in time, with randomized initial velocities. Both simulations end when a metastable basin is reached. If the new path connects both basins, the configuration is stored as an "accepted" configuration, and a new starting point is obtained from the new path by selecting the configuration separated by ±500δt\pm500\delta t from the t=0t=0 configuration. If the new path does not connect both basins, the configuration is stored as "rejected", and the selection strategy is applied again to the former path. The aimless shooting selection step (500δt500\delta t) has been adjusted to roughly match a 35% acceptance ratio, which represents a good balance between sampling quality (a small selection step leads to highly correlated configurations), and efficiency (there is a large enough number of accepted paths). For each initial path, we perform 2200 aimless shooting iterations. Finally, 5 "accepted" and 5 "rejected" configurations per aimless shooting simulation are selected, evenly spaced across both datasets. This leads to a final dataset of 500 "accepted" and 500 "rejected" configurations.

Numerical estimation of the committor

To compute the committor of each configuration from the sampled configurations, we launch 200 dynamics with randomized initial velocities, which end once a basin is reached, or once the trajectory reaches 106δt10^{6}\delta t. In this case, which represents about 0.35% of all trajectories, it is discarded. Histograms of trajectory lengths are displayed on Figure 18. The committor is then evaluated based on the number of outcomes. Overall, this required about 5.2⋅10105.2 \cdot10^{10} molecular dynamics time steps, which highlights the cost of evaluating the committor for systems showing slow committment kinetics.

Figure 18. Committing trajectory lengths, in δt\delta t. There is a peak at 106δt10^{6}\delta t since this is the maximum trajectory length we allow.

A model selection strategy for data points and dimensionality

When trying to minimize the amount of committor evaluations, the map reported in Figure 6(b) is generally not available, since the metric used for discrimination is the performance on the full test set. What is directly available is the performance on a small test set, or on the small training set (Figure 19(a)). The latter quantity does not allow to select the appropriate minimal number of data points outside of basins, since it will be minimal for the smallest datasets, resulting in significant overfitting. However, one can also estimate the noise MAE as a function of the dataset distribution (Figure 19(b)), following Appendix F, which decreases as a function of the number of points in the datasets. This quantity can be used as a baseline to prevent overfitting: in Figure 19(c), we plot the training set MAE divided by the noise MAE. When this quantity is smaller or close to one, overfitting is significant. When it is large (e.g. at low dimensionality), the model performs poorly even on the training set. When it reaches an intermediate value (≈2−3\approx2 - 3), it seems to lead to appropriate models, balancing accuracy and overfitting. As a strategy, we therefore recommend to optimize models with a small number of data points, progressively adding more points until this quantity reaches ≈2−3\approx2 - 3.

Figure 19. Model selection strategy. (a) Training set MAE, (b) noise MAE, and (c) ratio of the two quantities as a function of the number of reference points included outside of basins, and of the number of PIV components included in the KRRCV mode.

Uncertainty on numerical estimates of the committor probability: mean absolute error

Since the committor must be estimated numerically, there is a numerical uncertainty associated that leads to a lower bound on the MAE, i.e. even if the KRR would correlate perfect with the committor, we would get a finite value of the MAE that can be estimated as follows. The numerical estimation of the committor probability pBp_B through NN repeated and independent trial molecular dynamics simulations is a Bernoulli process. The number of successes k=N⋅pBk = N \cdot p_B, i.e. the number of trajectories committing to basin BB for NN trials, therefore follows a binomial distribution. The mean absolute error (MAE) of a binomially-distributed random variable has a closed-form expression identified by de Moivre[93, 94]:

MAE⁡(pB,N)=E∣pB−EpB∣=1N∑2k(1−pB)(Nk)b(k,N,pB)(21)\operatorname{MAE}(p_B,N) = \mathbb{E}\lvert p_B - \mathbb{E}p_B\rvert= \frac{1}{N}\sum2k(1-p_B)\binom{N}{k}b(k,N,p_B) \tag*{(21)}

where b(k,N,pB)b(k,N,p_B) is the probability mass function of the binomial distribution:

b(k,N,pB)=pBk(1−pB)N−k.(22)b(k,N,p_B)=p_B^k(1-p_B)^{N-k}. \tag*{(22)}

We can therefore compute the MAE as a function of the committor probability, and of the number of trials. For the LiF association in water, since datasets are uniform in committor values, we can estimate the MAE on data as:

MAE⁡(N)=∫01MAE⁡(pB,N) dpB.(23)\operatorname{MAE}(N)=\int_0^1 \operatorname{MAE}(p_B,N)\,\mathrm{d}p_B. \tag*{(23)}

The MAE on data for homogeneous datasets is reported in Figure 20, with the MAE dependence on both pBp_B and NN. For the LiF association in water, N=1000N=1000 and MAE ≈0.010\approx0.010. The Lennard-Jones datasets being heterogeneously distributed along pBp_B, we use the actual test set distribution to evaluate MAE(NN), i.e., for a dataset with MM data points:

Figure 20. Numerical estimation of the committor probability. Left: MAE as a function of committor value, right: MAE as a function of the number of trials.

MAE⁡(N)=1M∑i=1MMAE⁡(pBi,N)(24)\operatorname{MAE}(N)=\frac{1}{M}\sum_{i=1}^{M}\operatorname{MAE}(p_B^i,N) \tag*{(24)}

For N=200N=200, MAE ≈0.017\approx0.017. A homogeneously-distributed dataset would lead to MAE ≈0.021\approx0.021; the – small – reduction is due to the larger amount of basin configurations, for which the error is minimal.

LiF association in water: computational details and additional information

System generation, initial relaxation

We generate 100 initial configurations using a Monte Carlo algorithm implemented in the packmol program [95], with one cation, one anion, and 160 water molecules, in a cubic box with 16.90 Å-long edges. The atomic velocities are initialized by drawing from the Maxwell-Boltzmann distribution at T=300 KT = 300\ \mathrm{K}. We relax these configurations in the npTnpT ensemble at T=300 KT = 300\ \mathrm{K}, p=1 atmp = 1\ \mathrm{atm}, for 5 ns. The box size is subsequently fixed at the average equilibrium value obtained, 16.83 Å.

Unbiased free energy estimates

From the previous, relaxed geometries, we perform 100 independent simulations in the nVTnVT ensemble with randomized initial velocities, 1 ns of equilibration, and 20 ns for sampling, which amounts to a total of 2 μs of dynamics. The interionic distance (rr) is computed every 10 fs; this dataset is subsequently used to compute the free energy profile along rr by binning. Uncertainty estimates are obtained by computing 95% confidence intervals over the distribution made of the 100 estimates.

Umbrella sampling simulations

We perform a single umbrella sampling simulation by constraining the interionic distance at r0=2.636r_0 = 2.636 Å, using a harmonic biasing potential with a force constant set to 5000 kcal/mol/Å, for 50 ns. Configurations are sampled every 10 ps; we therefore obtain a dataset of 5000 configurations matching the constraint on rr.

Transition path sampling: brute force

In order to generate initial transition paths to be used as starting points for aimless shooting simulations, we randomly select 200 configurations with 0.3≤p(B∣X)≤0.70.3 \leq p(\mathrm{B}|\mathrm{X}) \leq0.7 from the umbrella sampling dataset, and propagate them forward and backward in time with randomized initial velocities. If both forward and backward dynamics reach the same metastable basin, we perform dynamics again with new random initial velocities. Transition paths are achieved with less than 5 tries for all configurations; as shown in Figure 12(a), p(TP∣X)p(\mathrm{TP}|\mathrm{X}) is high for transition state configurations.

Transition path sampling: aimless shooting

Starting from the previously generated transition paths, we perform 200 independent aimless shooting simulations of 10410^4 iterations, with a selection step of 10 fs, leading to an average acceptance ratio of 42%. Finally, we downsample the list of sampled structures by a factor of 100, leading to a dataset of 8551 configurations.

Numerical estimation of the committor and of the transition path probability

We obtain numerical estimates of the committor by launching 1000 independent unbiased dynamics from each configuration. We also perform backward dynamics to estimate p(TP∣X)p(\mathrm{TP}|\mathrm{X}); these backward dynamics statistics are however discarded when estimating p(B∣X)p(\mathrm{B}|\mathrm{X}).

Committor distribution at the critical interionic distance from unbiased molecular dynamics

We investigate the shape of the committor distribution for configurations matching r≈r∗r \approx r^* sampled from unbiased molecular dynamics. We perform 100 independent simulations of 10 ns, amounting to a total sampling time of 1 μs. Every 10 fs, configurations for which r∈[2.55,2.70]r \in[2.55, 2.70] Å are saved. We obtain 2706 configurations, out of which 581 are separated by at least 1 ps, for which we compute the committor (using 500 velocity initializations). The distribution, whose shape matches the one of the umbrella sampling distribution, is displayed in Figure 21.

Figure 21. Distribution of committor values for configurations at the putative transition state ensemble of rr sampled from unbiased simulations.

References

References

  1. [1]J. Hénin, T. Lelièvre, M. R. Shirts, O. Valsson, and L. Delemotte, Living Journal of Computational Molecular Science 4, 1583 (2022).
  2. [2]S. Pipolo, M. Salanne, G. Ferlat, S. Klotz, A. M. Saitta, and F. Pietrucci, Physical Review Letters 119, 245701 (2017).
  3. [3]A. Jedrecy, A. M. Saitta, and F. Pietrucci, The Journal of Chemical Physics 158 (2023).
  4. [4]T. E. Gartner III, P. M. Piaggi, R. Car, A. Z. Panagiotopoulos, and P. G. Debenedetti, Physical review letters 129, 255702 (2022).
  5. [5]L. Lupi, A. Hudait, B. Peters, M. Grünwald, R. Gotchy Mullen, A. H. Nguyen, and V. Molinero, Nature 551, 218 (2017).
  6. [6]J.-E. Shea and C. L. Brooks III, Annual Review of Physical Chemistry 52, 499 (2001).
  7. [7]A. M. Saitta and F. Saija, Proceedings of the National Academy of Sciences 111, 13768 (2014).
  8. [8]C. Hartmann, J. C. Latorre, and G. Ciccotti, The European Physical Journal Special Topics 200, 73 (2011).
  9. [9]K. M. Bal, S. Fukuhara, Y. Shibuta, and E. C. Neyts, The Journal of Chemical Physics 153 (2020).
  10. [10]J. C. Dietschreit, D. J. Diestler, A. Hulm, C. Ochsenfeld, and R. Gómez-Bombarelli, The Journal of Chemical Physics 157 (2022).
  11. [11]K. Palacio-Rodriguez, H. Vroylandt, L. S. Stelzl, F. Pietrucci, G. Hummer, and P. Cossio, The Journal of Physical Chemistry Letters 13, 7490 (2022).
  12. [12]S. Jungblut and C. Dellago, The European Physical Journal E 39, 1 (2016).
  13. [13]L. Mouaffac, K. Palacio-Rodriguez, and F. Pietrucci, Journal of Chemical Theory and Computation 19, 5701 (2023).
  14. [14]H. Vroylandt, L. Goudenège, P. Monmarché, F. Pietrucci, and B. Rotenberg, Proceedings of the National Academy of Sciences 119, e2117586119 (2022).
  15. [15]D. D. Girardier, H. Vroylandt, S. Bonella, and F. Pietrucci, The Journal of Chemical Physics 159 (2023).
  16. [16]B. Nadler, S. Lafon, R. R. Coifman, and I. G. Kevrekidis, Applied and Computational Harmonic Analysis 21, 113 (2006).
  17. [17]R. R. Coifman, I. G. Kevrekidis, S. Lafon, M. Maggioni, and B. Nadler, Multiscale Modeling & Simulation 7, 842 (2008).
  18. [18]M. A. Rohrdanz, W. Zheng, M. Maggioni, and C. Clementi, The Journal of chemical physics 134 (2011).
  19. [19]J. Rydzewski, M. Chen, T. K. Ghosh, and O. Valsson, Journal of Chemical Theory and Computation 18, 7179 (2022).
  20. [20]W. Zhang, C. Hartmann, and C. Schütte, Faraday discussions 195, 365 (2016).
  21. [21]F. Noé and F. Nuske, Multiscale Modeling & Simulation 11, 635 (2013).
  22. [22]G. Pérez-Hernández, F. Paul, T. Giorgino, G. De Fabritiis, and F. Noé, The Journal of chemical physics 139 (2013).
  23. [23]L. Molgedey and H. G. Schuster, Physical review letters 72, 3634 (1994).
  24. [24]A. Mardt, L. Pasquali, H. Wu, and F. Noé, Nature communications 9, 5 (2018).
  25. [25]P. Tiwary and B. Berne, Proceedings of the National Academy of Sciences 113, 2839 (2016).
  26. [26]J. Rydzewski, The Journal of Physical Chemistry Letters 14, 5216 (2023).
  27. [27]C. X. Hernández, H. K. Wayment-Steele, M. M. Sultan, B. E. Husic, and V. S. Pande, Physical Review E 97, 062412 (2018).
  28. [28]J. M. L. Ribeiro, P. R. Bravo, Y. Wang, and P. Tiwary, The Journal of chemical physics 149 (2018).
  29. [29]Y. Wang, J. M. L. Ribeiro, and P. Tiwary, Nature communications 10, 3573 (2019).
  30. [30]D. Wang and P. Tiwary, The Journal of Chemical Physics 154 (2021).
  31. [31]D. Mendels, G. M. Piccini, and M. Parrinello, The Journal of physical chemistry letters 9, 2776 (2018).
  32. [32]M. M. Sultan and V. S. Pande, The Journal of chemical physics 149 (2018).
  33. [33]L. Bonati, V. Rizzi, and M. Parrinello, The journal of physical chemistry letters 11, 2998 (2020).
  34. [34]A. Ma and A. R. Dinner, The Journal of Physical Chemistry B 109, 6769 (2005).
  35. [35]W. Lechner, J. Rogal, J. Juraszek, B. Ensing, and P. G. Bolhuis, The Journal of chemical physics 133 (2010).
  36. [36]B. Peters and B. L. Trout, The Journal of chemical physics 125, 054108 (2006).
  37. [37]P. G. Bolhuis, D. Chandler, C. Dellago, and P. L. Geissler, Annual review of physical chemistry 53, 291 (2002).
  38. [38]B. Peters, Chemical Physics Letters 554, 248 (2012).
  39. [39]Y. Mori, K.-i. Okazaki, T. Mori, K. Kim, and N. Matubayasi, The Journal of Chemical Physics 153 (2020).
  40. [40]H. Jung, R. Covino, A. Arjun, C. Leitold, C. Dellago, P. G. Bolhuis, and G. Hummer, Nature Computational Science , 1 (2023).
  41. [41]H. Jung, R. Covino, A. Arjun, C. Leitold, P. G. Bolhuis, C. Dellago, and G. Hummer, Biophysical Journal 122, 281a (2023).
  42. [42]G. Lazzeri, H. Jung, P. G. Bolhuis, and R. Covino, Journal of Chemical Theory and Computation (2023).
  43. [43]H. Chen, B. Roux, and C. Chipot, Journal of Chemical Theory and Computation (2023).
  44. [44]D. Branduardi, F. L. Gervasio, and M. Parrinello, The Journal of chemical physics 126, 054103 (2007).
  45. [45]F. Pietrucci and A. M. Saitta, Proceedings of the National Academy of Sciences 112, 15030 (2015).
  46. [46]A. France-Lanord, F. Pietrucci, A. M. Saitta, J.-M. Tarascon, A. Grimaud, and M. Salanne, PRX Energy 1, 013005 (2022).
  47. [47]G. Saladino, L. Gauthier, M. Bianciotto, and F. Gervasio, Journal of Chemical Theory and Computation 8, 1165 (2012).
  48. [48]A. Pérez de Alba Ortíz, J. Vreede, and B. Ensing, Biomolecular Simulations: Methods and Protocols , 255 (2019).
  49. [49]L. Hovan, F. Comitani, and F. L. Gervasio, Journal of Chemical Theory and Computation 15, 25 (2018).
  50. [50]T. Magrino, L. Huet, A. M. Saitta, and F. Pietrucci, The Journal of Physical Chemistry A 126, 8887 (2022).
  51. [51]B. Peters, The Journal of chemical physics 125 (2006).
  52. [52]E. A. Nadaraya, Theory of Probability & Its Applications 9, 141 (1964).
  53. [53]G. S. Watson, Sankhya: The Indian Journal of Statistics, Series A , 359 (1964).
  54. [54]J. Behler and M. Parrinello, Physical review letters 98, 146401 (2007).
  55. [55]A. P. Bartók, R. Kondor, and G. Csányi, Physical Review B 87, 184115 (2013).
  56. [56]G. A. Gallet and F. Pietrucci, The Journal of Chemical Physics 139, 074101 (2013).
  57. [57]R. Lai and J. Lu, Multiscale Modeling & Simulation 16, 710 (2018).
  58. [58]Q. Li, B. Lin, and W. Ren, The Journal of Chemical Physics 151, 054112 (2019).
  59. [59]K. Müller and L. D. Brown, Theoretica chimica acta 53, 75 (1979).
  60. [60]Weinan, E., & Vanden-Eijnden, E. (2004). Multiscale modelling and simulation (Numbers 35–68).
  61. [61]A. P. Thompson, H. M. Aktulga, R. Berger, D. S. Bolintineanu, W. M. Brown, P. S. Crozier, P. J. in’t Veld, A. Kohlmeyer, S. G. Moore, T. D. Nguyen, et al., Computer Physics Communications 271, 108171 (2022).
  62. [62]M. Bonomi, G. Bussi, C. Camilloni, G. A. Tribello, P. Banáš, A. Barducci, M. Bernetti, P. G. Bolhuis, S. Bottaro, D. Branduardi, et al., Nature Methods 16, 670 (2019).
  63. [63]G. A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni, and G. Bussi, Computer physics communications 185, 604 (2014).
  64. [64]G. A. Tribello, F. Giberti, G. C. Sosso, M. Salvalaglio, and M. Parrinello, Journal of chemical theory and computation 13, 1317 (2017).
  65. [65]R. G. Mullen, J.-E. Shea, and B. Peters, Journal of Chemical Theory and Computation 11, 2421 (2015).
  66. [66]Plumed – hack-the-tree,. (2023). Plumed – hack-the-tree,.
  67. [67]R. G. Mullen, J.-E. Shea, and B. Peters, Journal of chemical theory and computation 10, 659 (2014).
  68. [68]E. Peled and S. Menkin, Journal of The Electrochemical Society 164, A1703 (2017).
  69. [69]L. Alzate-Vargas, K. Vikrant, S. Allu, and J.-L. Fattebert, Physical Review Materials 6, 095402 (2022).
  70. [70]L. Droguet, G. M. Hobold, M. F. Lagade, R. Guo, C. Lethien, M. Hallot, O. Fontaine, J.-M. Tarascon, B. M. Gallant, and A. Grimaud, ACS Energy Letters 6, 2575 (2021).
  71. [71]J. Jones, M. Anouti, M. Caillon-Caravanier, P. Willmann, and D. Lemordant, Fluid phase equilibria 285, 62 (2009).
  72. [72]P. L. Geissler, C. Dellago, and D. Chandler, The Journal of Physical Chemistry B 103, 3706 (1999).
  73. [73]A. J. Ballard and C. Dellago, The Journal of Physical Chemistry B 116, 1490 (2012).
  74. [74]I. S. Young and T. E. Cheatham III, The journal of physical chemistry B 112, 9020 (2008).
  75. [75]H. J. Berendsen, J. R. Grigera, and T. P. Straatsma, Journal of Physical Chemistry 91, 6269 (1987).
  76. [76]J. A. Kattirtzi, D. T. Limmer, and A. P. Willard, Proceedings of the National Academy of Sciences 114, 13374 (2017).
  77. [77]C. Schran, F. L. Thiemann, P. Rowe, E. A. Müller, O. Marsalek, and A. Michaelides, Proceedings of the National Academy of Sciences 118, e2110077118 (2021).
  78. [78]M. P. Bircher, A. Singraber, and C. Dellago, Machine Learning: Science and Technology 2, 035026 (2021).
  79. [79]G. Imbalzano, A. Anelli, D. Giofré, S. Klees, J. Behler, and M. Ceriotti, The Journal of chemical physics 148 (2018).
  80. [80]D. Wang, R. Zhao, J. D. Weeks, and P. Tiwary, The Journal of Physical Chemistry B 126, 545 (2022).
  81. [81]G. Hummer, The journal of chemical physics 120, 516 (2004).
  82. [82]P. Metzner, C. Schütte, and E. Vanden-Eijnden, The Journal of chemical physics 125 (2006).
  83. [83]W. Zhang, C. Hartmann, and C. Schütte, Faraday Discussions 195, 365 (2017).
  84. [84]G. A. Pavliotis, Stochastic Processes and Applications: Diffusion Processes, the Fokker-Planck and Langevin Equations, Texts in Applied Mathematics, Vol. 60 (Springer, New York, NY, 2014).DOI
  85. [85]M. Lapelosa and C. F. Abrams, Computer Physics Communications 184, 2310 (2013).
  86. [86]T. Gustafsson and G. D. McBain, Journal of Open Source Software 5, 2369 (2020).
  87. [87]G. Meanti, L. Carratino, L. Rosasco, and A. Rudi, in Advances in Neural Information Processing Systems 32 (2020).
  88. [88]G. Meanti, L. Carratino, E. De Vito, and L. Rosasco, in Proceedings of The 25th International Conference on Artificial Intelligence and Statistics (2022).
  89. [89]D. P. Kingma and J. Ba, arXiv preprint arXiv:1412.6980 (2014).arXiv
  90. [90]A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al., Advances in neural information processing systems 32 (2019).
  91. [91]T. Liang and A. Rakhlin, The Annals of Statistics 48, 1329 (2020).
  92. [92]L. Sun, J. Vandermause, S. Batzner, Y. Xie, D. Clark, W. Chen, and B. Kozinsky, Journal of Chemical Theory and Computation 18, 2341 (2022).
  93. [93]de Moivre, A. (1756). The doctrine of chances: or, A method of calculating the probabilities of events in play (Vol. 200).
  94. [94]P. Diaconis and S. Zabell, Statistical Science , 284 (1991).
  95. [95]L. Martínez, R. Andrade, E. G. Birgin, and J. M. Martínez, J. Comput. Chem. 30, 2157 (2009).

Paper details

vlnc:W_wqun3ru4
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 2

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents