WorksPhysics and Astronomy
Exploration vs Convergence Speed in Adaptive-bias Enhanced Sampling
Abstract
In adaptive-bias enhanced sampling methods, a bias potential is added to the system to drive transitions between metastable states. The bias potential is a function of a few collective variables and is gradually modified according to the underlying free energy surface. We show that when the collective variables are suboptimal, there is an exploration-convergence tradeoff, and one must choose between a quickly converging bias that will lead to fewer transitions, or a slower to converge bias that can explore the phase space more efficiently but might require a much longer time to produce an accurate free energy estimate. The recently proposed On-the-fly Probability Enhanced Sampling (OPES) method focuses on fast convergence, but there are cases where fast exploration is preferred instead. For this reason, we introduce a new variant of the OPES method that focuses on quickly escaping metastable states, at the expense of convergence speed. We illustrate the benefits of this approach on prototypical systems and show that it outperforms the popular metadynamics method.
Introduction
Molecular dynamics has become a valuable tool in the study of a variety of phenomena in physics, chemistry, biology, and materials science. One of the long-standing challenges in this important field is the sampling of rare events, such as chemical reactions or conformational changes in biomolecules. To simulate effectively such systems, many enhanced sampling methods have been developed. An important class of such methods is based on an adaptive-bias approach and includes adaptive umbrella sampling, 1 metadynamics (MetaD), 2,3 and the recently developed on-the-fly probability enhanced sampling (OPES).4–6 Adaptive-bias methods operate by adding to the system’s energy an external bias potential , that is a function of a set of collective variables (CVs), . The CVs, , depend on the atomic coordinates
and are meant to describe the slow modes associated with the rare event under study. They also define a free energy surface (FES), , where is the inverse Boltzmann factor and the marginal distribution, . The bias is periodically updated until it converges to a chosen form. A popular choice is to have it exactly offset the underlying FES, , so that the resulting distribution is uniform.
The main limitation of adaptive-bias methods is that finding good collective variables is sometimes difficult and a bad choice of CVs might not promote the desired transitions in an affordable computer time. In practical applications one generally has to live with suboptimal CVs,7 that still can drive transitions, but do not include some of the slow modes. In this case, applying a static bias cannot speed up the slow modes that are not accounted for, and thus transitions remain quite infrequent. It is sometimes possible to achieve a faster transition rate by using a rapidly changing bias, which can push the system out of a metastable state through a high free energy pathway, different from the energetically favoured one. However, unless one wishes to deal explicitly with out-of-equilibrium statistics, 8–10 it is not possible to obtain reliable information about the system while the bias changes in a non-adiabatic fashion. To estimate the FES and other observables one must let the adaptive-bias method approach convergence, and as the bias becomes quasi-static, transitions inevitably become less frequent.
We refer to this situation as an exploration-convergence tradeoff that every adaptive-bias enhanced sampling method has to deal with, when suboptimal CVs are used. Some methods, like OPES, focus more on quickly converging to a quasi-static bias potential and thus obtaining an efficiently reweighted FES, while others, like metadynamics, focus more on escaping metastable states and exploring the phase space. We will demonstrate this qualitative difference on some prototypical systems. For simplicity, in the paper we only consider the well-tempered variant of metadynamics, 3 but in the Supporting Information (SI) we provide examples that use the original non-tempered MetaD2 and other popular variants, such as parallel-bias MetaD.11
We propose here a variant of OPES, named OPES-explore, that focuses on rapid exploration, rather than on fast convergence. It shares many features with the original OPES, and is designed to be an easy-to-use tool requiring few input parameters. To this end, we also introduce an adaptive bandwidth algorithm that can be used in both OPES variants, and further reduces the number of input parameters that need to be specified. The detailed description of the adaptive bandwidth algorithm is left to the SI. All OPES simulations presented make use of this algorithm.
The OPES method
The enhanced sampling method OPES works by adding an adaptive-bias potential to the energy of the system, so as to modify the Boltzmann probability distribution into a desired target one. Most adaptive-bias methods aim at sampling uniformly the CV space, but it has been shown that choosing a different target distribution could be advantageous. 12,13 There are two different classes of target distributions that can be sampled with OPES; metadynamics-like and replica-exchange-like. We will consider here only the former type, introduced in Ref. 4, but the interested reader can find in Ref. 5 information about OPES for replica-exchange-like sampling.
To define a metadynamics-like target distribution, one has to choose a set of collective variables, . As stated in the introduction, the unbiased marginal probability along such CVs is , where is the potential energy. The target distribution is then defined by requiring a specific marginal probability distribution over the CVs, . Consequently, the desired bias potential is written as:
so that . A typical choice for is the well-tempered distribution:3
where the bias factor controls how much the original distribution is smoothed out. In the limit of one targets a uniform distribution.
The core idea of OPES is to update self-consistently the estimate of the probability distributions and of the bias potential, in an on-the-fly fashion similar to self-healing umbrella sampling.14 The estimate of the unbiased probability is obtained via a weighted kernel density estimation, so that at step one has:
where the weights are given by , and the Gaussian kernels have a diagonal covariance matrix and fixed height . The number of kernels to represent would grow linearly with simulation time, but this is avoided thanks to an on-the-fly kernel compression algorithm, 15 as described in detail in the supporting information of Ref. 4. The compression algorithm also allows for the bandwidth of the kernels to shrink over time, as the effective sample size grows. The idea is to start with a coarse estimate of and then refine it as more data are available. The kernel bandwidth of the -th CV at step is:
where is the total number of CVs.
The instantaneous bias is based on the probability estimate , following Eq. (1) and using the approximation , one has:
where is a regularization term that limits the maximum possible absolute value of the bias potential, and can be understood as a normalization of over the CV space thus far explored, :
This integral is calculated approximately as a sum of over the compressed kernels, as explained in the supplementary information of Ref. 4. The intuitive idea is that new kernels are added to the compressed representation only when a new region of CV space is sampled (otherwise they are merged with existing ones), thus the explored CV-space volume , is approximately proportional to the total number of compressed kernels.
The introduction of the term is one of the key innovations of OPES. In similar methods, once a new metastable state is found one often sees a dramatic increase of the exit time, compared to the first one16 (see SI, Fig. S5). This exit time problem is present also when the CVs are optimal, and should not be confused with the exploration-convergence trade-off that is the primary concern of this paper. Other convergence-focused methods introduce extra parameters to tackle this problem, for example in transition-tempered metadynamics17 prior knowledge of the position of all metastable states is required. Instead, OPES avoids the exit time problem by taking into account the expansion of the CV space via the term, which allows the bias to adjust more quickly when a new CV-space region is sampled.4
At the start of an OPES simulation only a handful of parameters needs to be chosen, namely the initial kernel bandwidth, the pace at which the bias is updated, and the approximate FES barrier height that needs to be overcome. From this last information a prescription is given to automatically set the values and . The number of parameters can be reduced even further if one uses, as we shall do here, the adaptive bandwidth algorithm discussed in the SI.
An exploratory OPES variant
We present now a new OPES variant called OPES-explore which, compared to the original OPES formulation, leads to a faster exploration of the phase space at the cost of a slower convergence. We have recalled that the term allows OPES to quickly adapt the bias when a metastable state is found in a previously unexplored region of CV space. However, if the CVs used are suboptimal, it may happen that a new metastable state is found in an already explored region.18,19 In such a case, the term remains constant and is therefore ineffective in accelerating the exit time. Instead, to encourage a rapid exit, one would need a method that allows the bias to significantly change shape again. Fortunately, it is possible to achieve this exploratory behaviour simply by making a minimal change to the OPES protocol, which gives rise to the OPES-explore variant.
In formulating OPES-explore, we restrict ourselves to the case of using as target the well-tempered distribution, , Eq. (2). In OPES, the bias is expressed as a function of , the on-the-fly estimate of the unknown equilibrium distribution . At the beginning of the simulation this estimate is not reliable, but it improves over time and converges in a self-consistent way. In OPES-explore instead, one builds the bias starting from the on-the-fly estimate of the distribution that is being sampled in the biased simulation:
where is the CVs value sampled at step . As the simulation converges, approaches the target well-tempered distribution . Thus, analogously to Sec. 2, we use the approximation and write the bias according to Eq. (1):
where and have been added for the same reasons as in Eq. (5). We notice that the expressions in Eqs. (3) and (7), which define the probability estimates used in the two OPES schemes, converge respectively to and only within the self-consistent scheme where the simulation runs with a bias that is updated on-the-fly according to Eqs. (5) and (8) respectively. Both OPES variants are applications of the general Eq. (1), but OPES estimates on-the-fly and uses it to calculate the bias, while OPES-explore does the same but with .
The free energy surface as a function of the CVs can be estimated in two distinct ways, either directly from the probability estimate, , or via importance sampling reweighting, e.g. using a weighted kernel density estimation,
In standard OPES these two estimates are equivalent, while in OPES-explore (similarly to MetaD) they can differ significantly in the first part of the simulation until they eventually converge to the same estimate.
In figure 1 we contrast an OPES and OPES-explore simulation of alanine dipeptide in vacuum, which has become a standard test for enhanced sampling methods. Both simulations have the same input parameters and use the adaptive bandwidth scheme described in the SI. The bias is initially quite coarse, but the width of the kernels reduces as the simulation proceeds and the details of the FES are increasingly better described. It can clearly be seen that the OPES-explore variant employs fewer kernels compared to the original OPES. This is due to the fact that in OPES-explore the kernel density estimation is used for that is a smoothed version of , and thus requires less details. This more compact representation can be useful especially in higher dimensions, where the number of kernels can greatly increase despite the compression algorithm. However, as a drawback it can result in a less accurate bias estimate, especially for large values of .
Fewer transitions can lead to better convergence
The difference in performance between OPES and OPES-explore cannot be judged from the alanine dipeptide example, because in this case the CVs chosen are extremely efficient. In order to highlight the difference between the two methods, we study a simple two-dimensional model potential that is known as the Müller potential,20 see Figure 2a, using the coordinate as collective variable. This is a clear example
Figure 2. (a) The Müller potential energy surface, . (b) The free energy surface along the coordinate, , with and without the addition of the bias potential , where . (c) The potential energy modified by the bias potential, . It can be seen that, despite the almost flat profile along , the transition region between the states remains at high energy.
Figure 1. Time evolution of a typical simulation of alanine dipeptide in vacuum using the two OPES variants with the dihedral angles and as CVs. For each method, the compressed kernels are shown on the left with the point size indicating the adaptive bandwidth, and the corresponding free energy estimate on the right. (a) In the original OPES, kernels make up the unbiased distribution estimate and , while (b) in OPES-explore kernels make up the sampled distribution estimate and . All are shifted to have zero minimum. Notice how OPES-explore requires fewer kernels and visits higher FES regions.
of suboptimal CV, since it can discriminate the metastable states, but not the transition state.
For two-dimensional systems the free energy along the CV, , can be computed precisely with numerical integration, Figure 2b. From , the free energy difference between the two metastable states can be calculated as
While it is possible to distinguish better the two states by using also the coordinate, this does not result in a significant difference in the value (see SI, § 13). On the other hand, does a poor job of identifying the transition state, which is around and , and not at as it would seem from . As a consequence, it is not possible to significantly increase the transition rate between the states using a static bias that is a function of only.
To show this, we consider the effect of adding to the system the converged well-tempered bias , with . In Figure 2b, we can see the effect of the bias on the FES along , which becomes almost completely flat. However, when we consider the full 2D landscape, Figure 2c, we can see that such bias does not really remove the barrier between the two states. From the height of the barrier at the transition state, one can roughly estimate that adding improves the transition rate of about one order of magnitude. Nevertheless, transitions remain quite rare, around one every uncorrelated samples (see SI, § 13).
We want to compare the two OPES variants and well-tempered metadynamics in this challenging setting, where CVs are suboptimal and the total simulation time is not enough to reach full convergence. This type of situation is not uncommon in practical applications, and it is thus of great interest. Given enough time, all the method considered converge to the same bias potential and sample the same target distribution, but we shall see that before reaching this limit they behave very differently.
fig:3a shows a typical run of the Müller potential obtained by biasing the coordinate
with OPES, OPES-explore or MetaD. As a simple way to visualize the evolution of the bias, we also report in Figure 3b the estimate obtained directly from the applied bias, by using in Eq. (10). We can see a qualitative difference between OPES and the other two methods.
Figure 3. Typical simulations of the Müller potential using different methods for biasing the coordinate. Given more time, the three methods will converge to the same bias potential and will sample the same target distribution. In (a) is the trajectory along the CV and in (b) is the corresponding , Eq. (10), calculated using the FES estimate obtained directly from the applied bias, . The correct value is highlighted by a blue stripe 1 thick.
OPES reaches a quasi-static bias that is very close to the converged one, but samples a distribution that is far from the well-tempered one, where the two basins would be about equally populated. On the other hand, the distribution sampled by OPES-explore is closer to the target well-tempered one, but its bias is far from converged, and makes ample oscillations around the correct value. Metadynamics behaves similarly to OPES-explore. This is the exploration-convergence tradeoff described in the introduction. Since the CV is suboptimal, even when using the converged bias , to see a transition occur one has to wait for an average number of steps , which is more than the total length of the simulation. However, it is possible to greatly accelerate transitions by using a time-dependent bias that forces the system into higher energy pathways, that are not accessible at equilibrium.
In OPES-explore the bias is based on the estimate of the sampled probability , and pushes to make it similar to the almost flat well-tempered target. This means that in order to have a quasi-static bias, should both be almost flat and not change significantly as the simulation proceeds. Clearly, this cannot happen unless the simulation is longer than , otherwise most of the time would be spent in the same basin and would be far from flat. On the contrary, in OPES the bias is based on the reweighted estimate , and thus it can reach a quasi-static regime even before sampling the target distribution.
In figure 4a we show the estimate averaged over 25 independent runs, all starting from the main basin . We can see that on average OPES provides the best estimate at any in spite of the fact that it induces far less transitions. In fact, most of the time only one full back-and-forth transition is observed (see SI). One should notice that after a single transition the estimate is far from being accurate (see Figure 3b) but, since the bias quickly becomes quasi-static, it is possible to collect equilibrium samples and reliably reweight them, and the average estimate becomes more accurate the more simulations are run.
Instead in OPES-explore and MetaD, despite starting from independent initial conditions, the runs are highly correlated, due to the transitions being mostly driven by the strong changes in the bias rather than the natural fluctuations of the system. As a further consequence of this, a systematic error is present in the average estimate, even if is further averaged over time, to remove the oscillatory behaviour of OPES-explore and MetaD. Such systematic error depends on the characteristic of the system and the chosen CVs, and is hard to predict weather it will be relevant or small. Nevertheless, one can be sure that it reduces over time as the bias converges.24
Estimates of using different reweighting schemes are shown in Figure 4b. For OPES and OPES-explore the simple (9) has been used, while for MetaD we consider two of the most popular reweighting schemes, namely last-bias reweighting19,23 and bias-offset reweighting.21,22 As expected, the reweighting estimate of OPES is virtually identical to the direct estimate obtained from the bias, while for the other two methods the two estimates differ. The reweighting of OPES-explore has very small statistical uncertainty, which further highlights the presence of a systematic error in the free energy difference estimate. Like others before us,22,25,26 we observe empirically that the last-bias reweighting for MetaD tends to always be in agreement with the direct estimate, even when the simulation is far from converged, while the bias-offset reweighting provides a very unreliable estimate if the MetaD bias has not reached a quasi-static regime and the initial part of the simulation is not discarded. Once again, it must be noted that the simulations considered here are not fully converged, otherwise all the different estimates of the various methods would have yielded the correct result, without systematic errors. However, for most practical purposes they behave very differently, thus it is important to choose be-
Figure 4. Estimate of the free energy difference for the Müller potential obtained by averaging 25 independent runs for each biasing method. The standard deviation is also shown for each estimate. Given more time, all these estimates will converge to the correct . All simulations start from the main basin, , but with different initial conditions. In (a) is the estimate obtained directly from the applied bias, as in Figure 3b, while in (b) is the corresponding estimate obtained via reweighting. For metadynamics two different reweighting schemes are considered, bias-offset 21,22 and last-bias reweighting. 19,23 The correct value is highlighted by a blue stripe 1 thick.
tween an exploration-focused or a convergence-focused enhanced sampling method, depending on the specific aim of the simulation.
Sometimes exploration is what matters
In the examples of the previous paragraph, it was shown in that OPES converges to a quasi-static bias faster than OPES-explore and provides more accurate FES estimates. However, FES estimation is not the only goal of an enhanced sampling simulation. In complex systems where good CVs are not available, convergence can remain out of reach, still one might be interested in exploring the phase space and find all the relevant metastable basins. In such situation, OPES-explore can be a useful tool.
We consider here as test system alanine tetrapeptide in vacuum, as in Ref. 4. It has three dihedral angles, each of them can change from positive to negative values and vice versa with a relatively low probability. This leads to distinct metastable basins, each corresponding to a different combination of angles signs, as shown in Figure 5. Here we are not interested in estimating the FES, but rather we want to compare the ability of different methods to explore this space and discover all metastable states.

Figure 5. The eight metastable basins of alanine tetrapeptide in vacuum sampled via OPES-explore by biasing the three angles, a suboptimal set of CVs. Each basin is identified by the sign of the three angles, for a total of possible combinations. The most stable basin has , while for the least stable .
Figure 6 shows the number of explored basins averaged over 10 independent simulations for each enhanced sampling method. The simulations in the top panel (Figure 6a) use as CVs the angles, , which are good CVs, while in the bottom (Figure 6b) the suboptimal angles are used, . In all methods, the exploration time increases approximately by two orders of magnitude when suboptimal CVs are used (please note the horizontal logarithmic scale). As expected, OPES and OPES-explore have similar exploration speed when using good CVs, while with suboptimal CVs OPES struggles to find all the metastable basins. This is because the same region of CV space might correspond to two different metastable basins, or to a basin and a transition state, as for the Müller potential. 18,19 In this situation, the previously estimated bias must change considerably for the simulation to escape quickly the current metastable state.

Figure 6. Exploration time of the eight metastable basins of alanine tetrapeptide over 100 ns. The lines are an average over 10 independent runs for each method, showing the total number of visited basins. In (a) the bias is a function of the three angles, , while in (b) the three angles are used, . See SI for results with different input parameters and other MetaD variants, such as parallel-bias MetaD.11
The exploration speed of MetaD depends critically on the input parameters and requires a trial-and-error tuning. We report here only the outcome of MetaD simulations in which a standard choice of the input parameters has been made. As can be seen in Figure 6, in these simulations the exploration speed is roughly one order of magnitude slower than that of OPES-explore. However, the performance of MetaD simulations can be improved by using different settings, as shown in the SI. In the SI we also report and briefly discuss results obtained with non-tempered metadynamics,2 adaptive-Gaussians metadynamics 23 and parallel-bias metadynamics. 11 None of these MetaD variants significantly improve the exploration speed, and some make it even worse.
Finally, in the SI we show how a preliminary OPES-explore run can be combined with a multithermal OPES simulation5,6 to sample efficiently alanine tetrapeptide and reach a converged FES, even without explicitly biasing the angles.
Conclusion
We have shown with the help of model systems that there is an exploration-convergence trade-off in adaptive-bias methods when suboptimal CVs are used. This tradeoff should not be confused with the exit time problem, that is present also with optimal CVs, and is discussed in § 2 and Refs. 16,17. Contrary to the exit time problem, the exploration-convergence tradeoff cannot be solved and is an intrinsic limitation of CV-based adaptive-bias methods, that is a consequence of suboptimal CVs. We believe the best way to handle this tradeoff is to have separate methods that clearly focus on one or the other aspect, so that they can be used depending on the application. In a convergence-focused method the bias soon becomes quasi-static to allow for accurate reweighting and free energy estimation. However, with suboptimal CVs this leads to a slow transition rate and a long time is required to sample the target distribution. As discussed, even if one knows the true and directly applies the converged bias, one would not obtain a faster exploration. In an exploration-focused method, it is possible to improve the exploration speed by letting the bias change substantially even in a CV region that has already been visited. While this may increase the number of transitions, it comes at the cost of a less accurate estimate of the free energy.
The original OPES method focuses on fast convergence to provide an accurate estimate of the free energy surface and reweighted observables. As a consequence, it is very sensitive to the quality of the CVs (see e.g. Figure 3a) and any improvement in the CVs results in a clear acceleration of the transition rate. This is a particularly useful property when developing machine learning-based CVs, and in fact OPES has already been used several times in this context. 27–32
In other situations, improving the CVs may require first a better exploration of the phase space. 28,33–35 Furthermore, one may be interested simply in exploring the metastable states of a system rather than estimating an accurate FES. 36–39 For this reason, we have introduced a variant of the OPES method, OPES-explore, that focuses on quickly sampling the target distribution and exploring the phase space.
We have shown that also well-tempered metadynamics is an exploration-focused method. One of the main advantages of OPES-explore over MetaD is that it is easier to use, since it requires fewer input parameters and it has a more straightforward reweighting scheme (but more advanced ones can also be used25,40). Another important difference between the two methods is that OPES-explore, similarly to OPES, by default provides a maximum threshold to the applied bias potential, thus it avoids unreasonably high free energy regions. To obtain the same effect with MetaD, one typically has to define some ad hoc static bias walls by trial and error. This last feature of OPES-explore has been recently leveraged by Raucci et al. to systematically discover reaction pathways in chemical processes. 41
Finally, we should clarify that OPES-explore, just as metadynamics, might not be able to exit any metastable state if the CVs are too poor, 19,42 and its improved exploration capability can only be harnessed if the CVs are close enough to the correct ones to make such transitions possible. The speed and small number of input parameters of OPES-explore are extremely helpful for quickly testing several candidate CVs, to find out which can drive transitions and discard the bad ones.
We believe that OPES-explore is an important addition to the OPES family of methods and will become a useful tool for researchers as it pushes forward the trend for more robust and reliable enhanced sampling methods.
Acknowledgement We thank Valerio Rizzi and Umberto Raucci for useful discussions.
M.I. acknowledges support from the Swiss National Science Foundation through an Early Postdoc.Mobility fellowship. Calculations were carried out on Euler cluster at ETH Zurich and on workstations provided by USI Lugano.
Data availability
An open-source implementation of the OPES and OPES-explore methods is available in the enhanced sampling library PLUMED from version 2.8. 43 All the data and input files needed to reproduce the simulations presented in this paper are available on PLUMED-NEST (www.plumed-nest.org), the public repository of the PLUMED consortium, 44 as plumID:22.003.
Supporting Information Available
Description of the adaptive bandwidth algorithm, computational details regarding the Müller potential and further biased trajectories, exploration speed for alanine tetrapeptide using other methods, and description of a multithermal-multiumbrella simulation to improve upon the OPES-explore run.
References
(1) Mezei, M. Adaptive umbrella sampling: Self-consistent determination of the non-Boltzmann bias. Journal of Computational Physics 1987, 68, 237–248.
(2) Laio, A.; Parrinello, M. Escaping free-energy minima. Proceedings of the National Academy of Sciences 2002, 99, 12562–12566.
(3) Barducci, A.; Bussi, G.; Parrinello, M. Well-Tempered Metadynamics: A Smoothly Converging and Tunable Free-Energy Method. Physical Review Letters 2008, 100, 020603.
(4) Invernizzi, M.; Parrinello, M. Rethinking Metadynamics: From Bias Potentials
Supporting Information: Exploration vs Convergence Speed in Adaptive-bias Enhanced Sampling
Michele Invernizzi; Michele Parrinello
Adaptive kernel bandwidth
Inspired by the adaptive Gaussian implementation of metadynamics, S1 we introduce a similar feature that can be used in both OPES and OPES-explore. Typically, in OPES the initial kernel bandwidth (see Eq. (4) in the main text) is chosen as the square root of the CVs variance, obtained from a short unbiased run. We can however estimate its value adaptively during the simulation, by taking an exponentially decaying running averageS2
Where the index indicates the simulation step, and should not be confused with the index that instead indicates the iteration step, or how many times the bias has been updated. Typically one iteration takes hundreds of simulation steps. The variance at simulation step is computed as . The default value for the parameter is set to 10 times one iteration pace.
Since what has been computed is the variance in the sampled ensemble, it can be directly used to set the initial kernel bandwidth in OPES-explore:
In OPES instead, the kernels are used to reconstruct the unbiased probability density. Thus, the sampled variance must be rescaled by the bias factor :
This expression is then used in Eq. (4) of the main text, with the caveat that for OPES-explore , since all kernels have same weight. Contrary to adaptive-Gaussians metadynamics, S1 using the adaptive bandwidth in OPES does not introduce artifacts in the bias, and the self-consistency of the method is preserved.
The proposed adaptive bandwidth is still a global bandwidth, and does not locally adapt to the features of the underlying FES. For this reason, if a good guess of the initial kernel bandwidth is available, it can lead to similar or even better performance than when using an adaptive bandwidth. To this end, one can run a preliminary OPES-explore run with adaptive bandwidth and use it to estimate a good bandwidth value for a production run with OPES. The initial bandwidth should then be set to
Simulation details
The OPES and OPES-explore methods are implemented in PLUMED v2.8.S3 and can be found at www.plumed.org/doc-v2.8/user-doc/html/_o_p_e_s.html. The Langevin dynamics simulations with the Müller potential are carried out using PLUMED alone, while the alanine dipeptide and tetrapeptide simulations are done with GROMACS 2019{sup}S4 compiled with the PLUMED plugin. All the input files for the simulations in the paper can be found on PLUMED-NEST{sup}S5 at www.plumed-nest.org/eggs/22/003 or alternatively at www.github.com/invemichele/OPES-explore.
Müller potential free energy difference
For simple 2D systems like the Müller potential (Figure S1), it is possible to compute accurately the free energies, for instance via numerical integration. When calculating these free energies, both from numerical integration of from sampling biased simulations, we consider only the region of the plane shown in Figure S1, thus and . In the biased simulations we add a repulsive potential outside this region, to keep the simulation confined (see input files, § 12). Thus, we consider the following fee energy surface along :

Figure S1. The Müller potential. The two dashed lines represent two possible partitions that define the metastable basins, one using only and the other (more accurate) using both and . Both result in very similar values.
while the free energy difference between the metastable basins A and B is:
In Eq. (10) of the main text, we have used the coordinate alone to identify the states, setting , and B by . With this definition one obtains that . If the coordinate is also considered, one can define more accurately the two basins, for instance using as separator the line , see Figure S1, thus and . Even so, this results in a very similar . Thus, although is a rather suboptimal CV, it can be used to estimate the free energy difference between the basins with good accuracy.
On the other hand, is quite bad when it comes to identify the transition state, and as a consequence it cannot be used to define a static bias that efficiently accelerates transitions between the metastable states. This is shown in Figure 2c of the main text. When adding the converged well-tempered potential , the barrier at the transition state is only lowered from to . As a back of the envelope estimate, in the unbiased system we expect to sample the transition state once every uncorrelated samples. Since to move from one state to the other one must pass through the transition state, this also gives a rough estimate of the transition rate. When running a simulation with the static bias , one should expect on average one transition every uncorrelated samples, which is approximately what we find (see Figure S5). Note that “step” in x axis of these figures refers to the OPES (or MetaD) iterative step, that happens with a pace of 500 simulation steps, thus they can be approximately considered as loosely correlated samples.

Figure S5. All the 25 independent trajectory of the Müller potential obtained by biasing (a) with the OPES method and (b) with the converged static bias , thus sampling the potential energy shown in Figure 2c of the main text.
Finally, for comparison we show the effect of

Figure S2. Some other CV trajectories and corresponding estimates of free energy difference for the Müller potential, analogous of Figure 3 of the main text. The average estimate over all the 25 runs is also shown for reference, same as Figure 4a.

Figure S3. Some other CV trajectories and corresponding estimates of free energy difference for the Müller potential, analogous of Figure 3 of the main text. The average estimate over all the 25 runs is also shown for reference, same as Figure 4a.

Figure S4. Some other CV trajectories and corresponding estimates of free energy difference for the Müller potential, analogous of Figure 3 of the main text. The average estimate over all the 25 runs is also shown for reference, same as Figure 4a.
biasing instead of . The coordinate is a much better CV, and can identify the transition region as well as the metastable states. We can see from Figure S6 that the barrier in is higher than the one in , Figure 2b of the main text, as expected when the CV describes a slower mode. In Figure S7 we can see that when adding bias along the barrier is greatly reduced, contrary to what happens when biasing , Figure S7 or Figure 2c of the main text.

Figure S6. The free energy surface of Müller potential along the coordinate. The effect of adding a converged well tempered potential is also show, analogously to Figure 2b of the main text.

Figure S7. The effect of different bias potentials on the Müller system. In (a) the effect of biasing is shown, in (b) no bias is added (same as Figure 2a of the main text) and in (c) the bias is added along (same as Figure 2c of the main text). The barrier between the metastable states is much lower when a good CV like is biased, and this will result in much more transitions in a given simulation time.
Alanine tetrapeptide exploration
Alanine tetrapeptide in vacuum has eight distinct metastable states, identifiable by the values of its three dihedral angles. In Figure 6 of the main text, we show the time required for visiting all these states using different enhanced sampling methods initialized with a standard choice of parameters. Here we further investigate the exploration time of other metadynamics variants, and different sets of input parameters. For all of the combinations, we tested the use of both good CVs (the three angles) and suboptimal CVs (the three angles). The deposition pace has not been investigated, and PACE = 500 is used in all the simulations. For

Figure S10. Same as Figure S8, but with other methods. OPES-explore and PBMetaD are kept for reference, and non-tempered PBMetaD and adaptive-Gaussian PBMetaD are shown.

Figure S11. Same as Figure S8, but with other methods. OPES and OPES-explore are kept for reference, and also a modified version without the term is shown.
simplicity we label the parameters as “standard” or “aggressive”. For OPES and OPES-explore the adaptive bandwidth algorithm is always used, and the only difference between “standard” and “aggressive” parameters is the value of the barrier, that is taken to be BARRIER = 50 and BARRIER = 70 respectively. We find that in metadynamics the most critical parameter for exploration speed is the initial Gaussian height, and choose HEIGHT = 1.2 as a “standard” value, and HEIGHT = 12 as “aggressive” value.
In figure S8, we show the same results of Figure 6 of the main text, plus the popular parallel-bias metadynamics (PBMetaD).S6 For both MetaD and PBMetaD we use BIASFACTOR = 20 and SIGMA = 0.35, 0.35, 0.35 . Figure S9 and S10 report different possible choices for these two parameters. We consider the non-tempered MetaD/PBMetaDS7 (NONT) that corresponds to a bias factor and it is known to not converge,S8 and the adaptive-Gaussian MetaD/PBMetaDS1 (ADA), with ADAPTIVE SIGMA = DIFF and SIGMA = 500.
We can see from Figure S9 that for MetaD the most critical parameter with respect to exploration speed is the Gaussian height. By increasing it of an order of magnitude compared to the usual value, we obtain an exploration speed similar to OPES-explore. However, it should be noted that a Gaussian height of 12 kJ/mol is a rather unusual choice for a biomolecule, and in other systems, e.g. with non-periodic CVs, such a high value would probably create instabilities and other difficulties. Perhaps surprisingly, increasing the bias factor up to non-tempered MetaD only brings a small improvement. This is due to the fact that the CV space is quite large (the bias is three-dimensional), and the simulation does not have time to return often to the regions already explored, so the well-tempered factor does not drastically reduce the hill heights. The use of an adaptive-Gaussian scheme always worsen the performance, but it is be the best available option in those cases where a good SIGMA value is not known.

Figure S9. Same as Figure S8, but with other methods. OPES-explore and MetaD are kept for reference, and non-tempered MetaD and adaptive-Gaussian MetaD are shown.

Figure S8. Exploration time of the eight metastable basins of alanine tetrapeptide over 20 ns. As for Figure 6 of the main text, the lines are an average over 10 independent runs. In (a) and (b) the bias is a function of the three angles, while in (c) and (d) the three angles are used. See Sec. S4 for definition of “standard”, (a)-(c), and “aggressive”, (b)-(d), parameters.
Figure S10 reports the results for parallel-bias metadynamics, a variant of MetaD that is often used when dealing with high-dimensional CVs. The target distribution sampled by PBMetaD is the same of bias-exchange metadynamics,S9 and it concentrates the sampling in a smaller volume of CV space when compared to the well-tempered distribution, allowing for higher efficiency. When biasing the variables, we find that PBMetaD has an exploration speed similar to MetaD, while its convergence speed improves (not shown). However, when biasing alanine tetrapeptide with the suboptimal angles, PBMetaD never manages to visit all the metastable basins, regardless of the chosen input parameters. We cannot say if this very slow exploration is due to the specific target distribution of PBMetaD or to the details of how the method works.
Alanine tetrapeptide convergence
While OPES-explore can be used to visit relatively quickly all the metastable basins even with the suboptimal CVs, it would require a much longer simulation to get a converged FES estimate. Nevertheless, it is possible to use the information obtained from the exploratory run, to perform another OPES simulation with a combined multithermal and bias, and quickly converge even without using the good CVs.
At higher temperatures, alanine tetrapeptide easily moves between those states that at 300K are metastable, and thus a multithermal simulation can be used to overcome the sampling problem. However, a multithermal simulation alone is not extremely efficient, and leaves room for improvement.S10 Thus we want to combine a multithermal target distribution, with a multiumbrella distributionS11 on the angles, where the centres and widths of the umbrellas are taken to be the same as the compressed kernels obtained from the OPES-explore run. To sample this target distribution one could use an Hamiltonian replica exchange scheme,S12 but it would require a very big number of parallel simulations. In the input files provided (Sec. S2) we show how this can be easily done with OPESS11,S13 in a single simulation that can provide an efficient FES estimation even if the good CVs are unknown.
The advantage of using OPES with such expanded ensemble target instead of e.g. parallel tempering metadynamicsS14 or integrated tempering metadynamics,S15 is a faster convergence of the reweighted observables, since those MetaD-based methods focus instead on quickly sampling the target distribution, and do not have straightforward reweighting schemes.
References
- [1]Branduardi, D.; Bussi, G.; Parrinello, M. Metadynamics with Adaptive Gaussians. Journal of Chemical Theory and Computation 2012, 8, 2247–2254.DOI
- [2]Welford, B. P. Note on a Method for Calculating Corrected Sums of Squares and Products. Technometrics 1962, 4, 419–420.
- [3]Tribello, G. A.; Bonomi, M.; Branduardi, D.; Camilloni, C.; Bussi, G. PLUMED 2: New feathers for an old bird. Computer Physics Communications 2014, 185, 604–613.
- [4]Abraham, M. J.; Murtola, T.; Schulz, R.; Páll, S.; Smith, J. C.; Hess, B.; Lindahl, E. GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers. Software X 2015, 1-2, 19–25.DOI
- [5]The PLUMED consortium, Promoting transparency and reproducibility in enhanced molecular simulations. Nature Methods 2019, 16, 670–673.DOI
- [6]Pfaendtner, J.; Bonomi, M. Efficient Sampling of High-Dimensional Free-Energy Landscapes with Parallel Bias Metadynamics. Journal of Chemical Theory and Computation 2015, 11, 5062–5067.DOI
- [7]Laio, A.; Parrinello, M. Escaping free-energy minima. Proceedings of the National Academy of Sciences 2002, 99, 12562–12566.DOI
- [8]Dama, J. F.; Parrinello, M.; Voth, G. A. Well-Tempered Metadynamics Converges Asymptotically. Physical Review Letters 2014, 112, 240602.pubmed.ncbi.nlm.nih.gov/24996077
- [9]Piana, S.; Laio, A. A Bias-Exchange Approach to Protein Folding. The Journal of Physical Chemistry B 2007, 111, 4553–4559.pubmed.ncbi.nlm.nih.gov/17419610
- [10]Bonati, L.; Piccini, G.; Parrinello, M. Deep learning the slow modes for rare events sampling. Proceedings of the National Academy of Sciences 2021, 118, e2113533118.DOI
- [11]Invernizzi, M.; Piaggi, P. M.; Parrinello, M. Unified Approach to Enhanced Sampling. Physical Review X 2020, 10, 41034.DOI
- [12]Sugita, Y.; Kitao, A.; Okamoto, Y. Multidimensional replica-exchange method for free-energy calculations. The Journal of Chemical Physics 2000, 113, 6042–6051.
- [13]Invernizzi, M. OPES: On-the-fly Probability Enhanced Sampling Method. Il Nuovo Cimento C 2021, 44, 112.DOI
- [14]Bussi, G.; Gervasio, F. L.; Laio, A.; Parrinello, M. Free-Energy Landscape for β Hairpin Folding from Combined Parallel Tempering and Metadynamics. Journal of the American Chemical Society 2006, 128, 13435–13441.pubmed.ncbi.nlm.nih.gov/17031956
- [15]Yang, Y. I.; Niu, H.; Parrinello, M. Combining Metadynamics and Integrated Tempering Sampling. The Journal of Physical Chemistry Letters 2018, 9, 6426–6430.DOI



