Adaptive Biasing Force Method: Difference between revisions

From PMFLib Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(16 intermediate revisions by one other user not shown)
Line 2: Line 2:
----
----
__NOEDITSECTION__
__NOEDITSECTION__
==Contents==
<div style="float:right;">__TOC__</div>
==Chapters==
* [[Adaptive Biasing Force Method#Description|ABF:Description]]
* [[Adaptive Biasing Force Method#Description|ABF:Description]]
* [[ABF:Controls]]
* [[ABF:Controls]]
Line 8: Line 9:
* [[ABF:Post-processing]]
* [[ABF:Post-processing]]
* [[ABF:Multiple walkers approach]]
* [[ABF:Multiple walkers approach]]
* [[ABF:Utilities]]
* [[ABF:Examples]]
* [[ABF:Examples]]


==Description==
==Description==
===Free Energy from Unconstrained MD Simulations===
===Free Energy from Unconstrained MD Simulations===
The Adaptive Biasing Force (ABF) Method calculates the free energy as a function of selected collective variables from unconstrained molecular dynamics (MD) simulations. The method does not provide the free energy directly, but instead, it provides the free energy gradient <math>\frac{\partial G(\boldsymbol \xi)}{\partial \boldsymbol \xi}</math>, which must be integrated to get the free energy:
The Adaptive Biasing Force (ABF) method calculates the free energy as a function of selected collective variables from unconstrained molecular dynamics (MD) simulations. The method does not provide the free energy directly, but instead, it provides the free energy gradient <math>\frac{\partial G(\boldsymbol \xi)}{\partial \boldsymbol \xi}</math>, which must be integrated to get the free energy:
   
   
<center><math>\Delta G = G(\boldsymbol \xi_2) - G(\boldsymbol \xi_1) = \int_{\boldsymbol \xi_1}^{\boldsymbol \xi_2} \frac{\partial G(\boldsymbol \xi)} {\partial \boldsymbol \xi} \boldsymbol d \xi </math> ... (1)</center>
<center><math>\Delta G = G(\boldsymbol \xi_2) - G(\boldsymbol \xi_1) = \int_{\boldsymbol \xi_1}^{\boldsymbol \xi_2} \frac{\partial G(\boldsymbol \xi)} {\partial \boldsymbol \xi} \boldsymbol d \xi </math> ... (1)</center>
Line 22: Line 21:
<center><math>\frac{\partial G(\boldsymbol \xi^{*})}{\partial \boldsymbol \xi} = - {\langle \bold F_{ICF} \rangle}_{\boldsymbol \xi=\boldsymbol \xi^{*}} </math> ... (2)</center>
<center><math>\frac{\partial G(\boldsymbol \xi^{*})}{\partial \boldsymbol \xi} = - {\langle \bold F_{ICF} \rangle}_{\boldsymbol \xi=\boldsymbol \xi^{*}} </math> ... (2)</center>


with the instantaneous collective force calculated from the time evolution of the collective variable:
with the instantaneous collective force calculated from the time evolution of the collective variable:<ref name="darve2008">Darve, E.; Rodríguez-Gómez, D.; Pohorille, A. Adaptive Biasing Force Method for Scalar and Vector Free Energy Calculations. ''J. Chem. Phys.'' '''2008''', ''128 (14)'', 144120. [https://doi.org/10.1063/1.2829861 doi:10.1063/1.2829861].</ref>


<center><math>\bold F_{ICF} = \frac {d} {dt} \left( \bold Z^{-1} \frac{d \boldsymbol \xi} {dt} \right)</math> ... (3)</center>
<center><math>\bold F_{ICF} = \frac {d} {dt} \left( \bold Z^{-1} \frac{d \boldsymbol \xi} {dt} \right)</math> ... (3)</center>
Line 30: Line 29:
<center><math>[Z]_{ij}=\sum_{k=1}^{N_{atoms}} \frac{1}{m_k} \frac{\partial \xi_i}{\partial \bold x_k} \frac{\partial \xi_j}{\partial \bold x_k}</math> ... (4)</center>
<center><math>[Z]_{ij}=\sum_{k=1}^{N_{atoms}} \frac{1}{m_k} \frac{\partial \xi_i}{\partial \bold x_k} \frac{\partial \xi_j}{\partial \bold x_k}</math> ... (4)</center>


The analytical calculation of instantaneous collective force by Equation 3 requires the second derivatives of collective variables with respect to Cartesian coordinates. Since this can be prohibitive for complex collective variables such as the simple base-pair parameters, Equation 3 is evaluated numerically by a finite-difference approach, as suggested by Darve et al.
The analytical calculation of instantaneous collective force by Equation 3 requires the second derivatives of collective variables with respect to Cartesian coordinates. Since this can be prohibitive for complex collective variables such as the simple base-pair parameters, Equation 3 is evaluated numerically by a [[Adaptive Biasing Force Method#Instantaneous Collective Forces|finite-difference approach]].


===Sampling Space Discretization===
===Sampling Space Discretization===
Line 46: Line 45:


where <math>\bold h</math> is the interval size also called a bin, <math>N_b</math> is the number of samples collected in a bin centered at <math>\boldsymbol \xi^{*}</math>, and <math>N_{corr}</math> is a statistical inefficiency due to correlation in time series.
where <math>\bold h</math> is the interval size also called a bin, <math>N_b</math> is the number of samples collected in a bin centered at <math>\boldsymbol \xi^{*}</math>, and <math>N_{corr}</math> is a statistical inefficiency due to correlation in time series.
Therefore, each CV involved in ABF simulations must be discretized by specifying an interval in which the sampling is performed and the number of intervals (bins) for discretization, for further details, see [[ABF:Collective variables]]. The increasing number of bins improves the accuracy of Equation 5 and subsequently the quality of the integrated free energy (Equation 1) but it also increases the noise because of a smaller number of samples collected in a bin. A reasonable compromise is the number of bins, which leads to 0.1 Å or 1-2° bin widths.


===Adaptive Bias===
===Adaptive Bias===
ABF introduces an adaptive bias, which improves the sampling of rare events. The bias removes barriers or higher free energy regions in the space described by predefined collective variables <math>\boldsymbol \xi</math>. As a result, the system evolves alongside these collective variables by free diffusions. The bias is derived from the free energy, which is projected in the form of biasing force <math>\bold F_{bias}</math> to the Cartesian space and removed from force <math>\bold F_{pot}</math> originated from interatomic interaction potential (V(x)). The application of the bias thus leads to the modified equations of motions:
ABF introduces an adaptive bias, which improves the sampling of rare events. The bias removes barriers or higher free energy regions in the space described by predefined collective variables <math>\boldsymbol \xi</math>. As a result, the system evolves by free diffusion alongside these collective variables. The bias is derived from the free energy, which is projected in the form of biasing force <math>\bold F_{bias}</math> to the Cartesian space and removed from force <math>\bold F_{pot}</math> originated from inter-atomic interaction potential <math>V(\bold R)</math>. The application of the bias thus leads to the modified equations of motions:


<center><math>m_{i}  \frac { d^2 \bold r_i }{dt^2} = \bold F_{pot,i}(\bold r_i) - \bold F_{bias,i}(\bold r_i) = - \frac{\partial V(\bold R)} {\partial \bold r_i} - \frac{\partial G(\boldsymbol \xi^{*})}{\partial \boldsymbol \xi} \frac{\partial \boldsymbol \xi}{\partial \bold r_i}</math> ... (8)</center>
<center><math>m_{i}  \frac { d^2 \bold r_i }{dt^2} = \bold F_{pot,i}(\bold r_i) - \bold F_{bias,i}(\bold r_i) = - \frac{\partial V(\bold R)} {\partial \bold r_i} + \frac{\partial G(\boldsymbol \xi)}{\partial \boldsymbol \xi} \frac{\partial \boldsymbol \xi}{\partial \bold r_i}</math> ... (8)</center>


where <math>m_i</math> is mass of atom i, <math>\bold r_i</math> is atom position, and <math>t</math> is time.
where <math>m_i</math> is mass of atom i, <math>\bold r_i</math> is atom position, and <math>t</math> is time.


Since the biasing force is not known prior to the simulation, it is calculated during the simulation and adaptively applied. To accelerate sampling, the biasing force is applied even if an inadequate number of samples is collected in a bin. In this case, the biasing force is scaled in the early stages to avoid artifacts from applications of overestimated biasing forces. The biasing force can also be smoothed to decrease noise in collected data. For further details, see feimode in [[ABF:Controls]].
===Instantaneous Collective Forces===
PMFLib implements two algorithms to calculate Equation 3: simplified and original ABF algorithms. The original ABF algorithm is theoretically more accurate than the simplified one but it works only for MD without constraints. Therefore, the simplified algorithm is the default one as it is numerically more robust at all MD setups.


The free energy calculation is achieved by introducing a bias, which removes barriers or higher free energy regions alongside predefined collective variables . As a result, the system evolves alongside these collective variables by free diffusions. The bias is derived from the free energy (G(ξ)), which is projected in the form of biasing force (F_bias) to the Cartesian space and removed from force (F_pot) originated from interatomic interaction potential (V(x)). The application of the bias thus leads to the modified equations of motions:
====Simplified ABF Algorithm====
m_i (d^2 x_i)/(dt^2 )=F_(pot,i) (x_i )-F_(bias,i) (x_i )=-(∂V(x)/(∂x_i )-∂G(ξ)/∂ξ  ∂ξ/(∂x_i )) (1)
The simplified ABF algorithm (fmode=1) uses the result of the product rule for derivatives applied on Equation 3 leading into the two distinct contributions into the instantaneous collective forces:
where m_i is mass of atom i, x_i is atom position, t is time.
   
<center><math>\frac {d} {dt} \left( \bold Z^{-1} \frac{d \boldsymbol \xi} {dt} \right) \big|_{(t)} = \left( \bold Z^{-1}(t) \nabla \boldsymbol \xi (t) \right) \cdot \bold a(t) + \frac{d}{dt} \left( \bold Z^{-1}(t) \nabla \boldsymbol \xi (t)) \right) \cdot \bold v(t) = \bold F_{ICF,pot}(t) + \bold F_{ICF,kin}(t)</math> ... (9)</center>


The potential contribution <math>\bold F_{ICF,pot}(t)</math> is given:


<center><math>\bold F_{ICF,pot}(t) = \left( \bold Z^{-1}(t) \nabla \boldsymbol \xi (t) \right) \cdot \frac{\bold v(t+dt/2) - \bold v(t-dt/2)}{dt}</math> ... (10)</center>


It employs the accelerations <math>\bold a(t)</math> calculated back from the velocities:


The Adaptive Biasing Force (ABF) method calculates the derivative of the free energy (PMF) using the following formula:
<center><math>\bold a(t) = \frac{\bold v(t+dt/2) - \bold v(t-dt/2)}{dt}</math> ... (11)</center>,
<center><math>\frac{\partial A}{\partial \boldsymbol \xi} - {\left \langle { \frac{d}{d t} \left( \bold {Z_{\xi}}^{-1} \frac{d \boldsymbol \xi}{d t} \right) } \right \rangle}_{\xi}</math> .... (1)</center>
 
where &#958; is the set of collective variables, t is time, and Z<sub>&#958;</sub> is the matrix defined as
which ensures that effect of SHAKE and other constraints on acceleration is properly counted (see [[Molecular_Dynamics_Algorithms|the leap-frog integration algorithm]] for further details).
<center><math>\left [ \bold Z_{\xi} \right ]_{i,j} = \sum_{k=1}^{N}{ \frac{1}{m_k}\frac{\partial \xi_i}{\partial \bold x_k}\frac{\partial \xi_j}{\partial \bold x_k}}</math> .... (2)</center>
 
where m<sub>k</sub> is the mass of atom with cartesian coordinate x<sub>k</sub>.
The kinetic contribution <math>\bold F_{ICF,kin}(t-dt/2)</math> is calculated from numerical differentiation:
 
<center><math>\bold F_{ICF,kin}(t-dt/2) = \frac {\bold Z^{-1}(t) \nabla \boldsymbol \xi (t) - \bold Z^{-1}(t-dt) \nabla \boldsymbol \xi (t-dt)}{dt} \bold v(t-dt/2) </math> ... (12)</center>
 
Finally, to get <math>\bold F_{ICF,kin}</math> at the same time as <math>\bold F_{ICF,pot}</math>, two values are averaged:
 
<center><math>\bold F_{ICF,kin}(t) = \frac {\bold F_{ICF,kin}(t+dt/2) + \bold F_{ICF,kin}(t-dt/2) }{2}</math> ... (13)</center>
 
The algorithm uses a history of values collected in two consecutive time steps. But, the first result is available from the fourth time step to be compatible with the original algorithm.
 
 
====Original ABF Algorithm====
The original ABF algorithm (fmode=2) implements the algorithm presented by Darve ''at al''.<ref name="darve2008"/><ref name="darve2007">Darve, E. Thermodynamic Integration Using Constrained and Unconstrained Dynamics. In Free Energy Calculations Theory and Applications in Chemistry and Biology; Springer Series in CHEMICAL PHYSICS; Springer: Berlin, 2007; Vol. 86, pp 119–170.</ref>. This algorithm should not be used when SHAKE is enabled because the accelerations entering into the calculations are not corrected for constraints. The algorithm uses a history of values collected in four consecutive time steps. Thus, the first result is available from the fourth time step.
<center><math>\frac {d} {dt} \left( \bold Z^{-1} \frac{d \boldsymbol \xi} {dt} \right) \big|_{(t)} = \frac{1}{2} \left( \frac{\bold p^+_{\xi}(t+dt) - \bold p^+_{\xi}(t) } {dt} \frac{\bold p^-_{\xi}(t+dt) - \bold p^-_{\xi}(t) } {dt} \right)</math> ... (14)</center>


The averages over &#958; are collected from unconstrained molecular dynamics. The free energy derivatives are practically calculated over discretized ranges of collective variables (CVs). Each CV<sub>i</sub> is discretized into M<sub>i</sub> bins leading into one-dimensional bins for one CV, two-dimensional bins for two CVs, etc. In each such bin, the vector of PMF is accumulated using the formula (1). For one CV this can be written as
where


<center><math>\frac{\partial A}{\partial \xi} \bigg|_{(\xi_{i}+\xi_{i+1})/2}  =  - {\left \langle { \frac{d}{d t} \left( {Z_{\xi}}^{-1} \frac{d \xi}{d t} \right) } \right \rangle}_{ ( \xi_{i},\xi_{i+1} \rangle }</math> .... (3)</center>
<center><math>\bold p^+_{\xi}(t) = \bold Z^{-1}(t) \nabla \boldsymbol \xi(t) \cdot \left[ \bold v(t+dt/2) - \frac{dt}{6} \bold a(t+dt) \right]</math> ... (15)</center>


In the ABF simulations, the estimated PMF is used to bias molecular dynamics simulations to improve sampling in the regions exhibiting large free energy barriers.
<center><math>\bold p^-_{\xi}(t) = \bold Z^{-1}(t) \nabla \boldsymbol \xi(t) \cdot \left[ \bold v(t-dt/2) + \frac{dt}{6} \bold a(t-dt) \right]</math> ... (16)</center>


==References==
==References==
<references />
<references />

Latest revision as of 13:51, 2 August 2021

Navigation: Documentation / Methods / Adaptive Biasing Force Method


Chapters

Description

Free Energy from Unconstrained MD Simulations

The Adaptive Biasing Force (ABF) method calculates the free energy as a function of selected collective variables from unconstrained molecular dynamics (MD) simulations. The method does not provide the free energy directly, but instead, it provides the free energy gradient , which must be integrated to get the free energy:

... (1)

The free energy gradient is calculated as a mean of instantaneous collective force :

... (2)

with the instantaneous collective force calculated from the time evolution of the collective variable:[1]

... (3)

where is the matrix in the form:

... (4)

The analytical calculation of instantaneous collective force by Equation 3 requires the second derivatives of collective variables with respect to Cartesian coordinates. Since this can be prohibitive for complex collective variables such as the simple base-pair parameters, Equation 3 is evaluated numerically by a finite-difference approach.

Sampling Space Discretization

Due to numerical reasons, mean forces are collected on a regular grid. The averaging of instantaneous collective force is then done in small intervals centered at discrete CV values:

... (5)

with the standard error:

... (6)

where the standard deviation is given by:

... (7)

where is the interval size also called a bin, is the number of samples collected in a bin centered at , and is a statistical inefficiency due to correlation in time series.

Therefore, each CV involved in ABF simulations must be discretized by specifying an interval in which the sampling is performed and the number of intervals (bins) for discretization, for further details, see ABF:Collective variables. The increasing number of bins improves the accuracy of Equation 5 and subsequently the quality of the integrated free energy (Equation 1) but it also increases the noise because of a smaller number of samples collected in a bin. A reasonable compromise is the number of bins, which leads to 0.1 Å or 1-2° bin widths.

Adaptive Bias

ABF introduces an adaptive bias, which improves the sampling of rare events. The bias removes barriers or higher free energy regions in the space described by predefined collective variables . As a result, the system evolves by free diffusion alongside these collective variables. The bias is derived from the free energy, which is projected in the form of biasing force to the Cartesian space and removed from force originated from inter-atomic interaction potential . The application of the bias thus leads to the modified equations of motions:

... (8)

where is mass of atom i, is atom position, and is time.

Since the biasing force is not known prior to the simulation, it is calculated during the simulation and adaptively applied. To accelerate sampling, the biasing force is applied even if an inadequate number of samples is collected in a bin. In this case, the biasing force is scaled in the early stages to avoid artifacts from applications of overestimated biasing forces. The biasing force can also be smoothed to decrease noise in collected data. For further details, see feimode in ABF:Controls.

Instantaneous Collective Forces

PMFLib implements two algorithms to calculate Equation 3: simplified and original ABF algorithms. The original ABF algorithm is theoretically more accurate than the simplified one but it works only for MD without constraints. Therefore, the simplified algorithm is the default one as it is numerically more robust at all MD setups.

Simplified ABF Algorithm

The simplified ABF algorithm (fmode=1) uses the result of the product rule for derivatives applied on Equation 3 leading into the two distinct contributions into the instantaneous collective forces:

... (9)

The potential contribution is given:

... (10)

It employs the accelerations calculated back from the velocities:

... (11)

,

which ensures that effect of SHAKE and other constraints on acceleration is properly counted (see the leap-frog integration algorithm for further details).

The kinetic contribution is calculated from numerical differentiation:

... (12)

Finally, to get at the same time as , two values are averaged:

... (13)

The algorithm uses a history of values collected in two consecutive time steps. But, the first result is available from the fourth time step to be compatible with the original algorithm.


Original ABF Algorithm

The original ABF algorithm (fmode=2) implements the algorithm presented by Darve at al.[1][2]. This algorithm should not be used when SHAKE is enabled because the accelerations entering into the calculations are not corrected for constraints. The algorithm uses a history of values collected in four consecutive time steps. Thus, the first result is available from the fourth time step.

... (14)

where

... (15)
... (16)

References

  1. 1.0 1.1 Darve, E.; Rodríguez-Gómez, D.; Pohorille, A. Adaptive Biasing Force Method for Scalar and Vector Free Energy Calculations. J. Chem. Phys. 2008, 128 (14), 144120. doi:10.1063/1.2829861.
  2. Darve, E. Thermodynamic Integration Using Constrained and Unconstrained Dynamics. In Free Energy Calculations Theory and Applications in Chemistry and Biology; Springer Series in CHEMICAL PHYSICS; Springer: Berlin, 2007; Vol. 86, pp 119–170.