Metadynamics: Difference between revisions

From PMFLib Wiki
Jump to navigation Jump to search
(Created page with "Navigation: Documentation / Methods / Metadynamics ---- __NOEDITSECTION__ __NOTOC__ ==Contents== * MTD:Description * MTD:Controls...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
* [[MTD:Post-processing]]
* [[MTD:Post-processing]]
* [[MTD:Multiple walkers approach]]
* [[MTD:Multiple walkers approach]]
* [[MTD:Examples]]
* [[MTD:Utilities]]
* [[MTD:Utilities]]
* [[MTD:Examples]]


==Description==
===Free Energy from Metadynamics Simulations===
Metadynamics introduces a history-dependent potential, which is composed of Gaussian functions added in regular intervals. This potential is employed as a bias in molecular dynamics simulation to suppress visiting already sampled regions.
<center><math>V_{MTD}(\boldsymbol \xi) = \sum_{t=1}^{T_{MTD}} h_t exp \left( - \frac{1}{2} \frac{(\boldsymbol \xi - \boldsymbol \xi_t)^2}{\boldsymbol \sigma} \right) </math> ... (8)</center>
As a result, the system evolves by free diffusions alongside biased collective variables.  Moreover, the history-dependent potential converges to the negative value of the free energy in a limit of infinitesimally long metadynamics simulation.


==Description==
===Theory===




== Single mode ==
The application of the history dependent potential thus leads to the modified equations of motions:
Single mode of metadynamics follows same common rules as all other PMFLib methods (same definition of CVs, same syntax). It has peculiar sections


SubSection [mtd] in {PMFLIB} section with general metadynamics setup common for whole run (example follows):
<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>
  [mtd]
  fmode  1                                                                                                                                 
  fserverkey server.key                                                                                                                     
  fsample 100                                                                                                                               
  fheight 0.01                                                                                                                             
  frestart on


Section {MTD} defining particular configuration for each CV (example follows):
where <math>m_i</math> is mass of atom i, <math>\bold r_i</math> is atom position, and <math>t</math> is time.
  {MTD}                                                                                                                                     
  [CV]                                                                                                                                     
  name d1                                                                                                                                   
  min_value    5.0                                                                                                                         
  max_value  30.0                                                                                                                         
  nbins      100                                                                                                                           
  width        0.5


== Multiple walker mode ==
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]].
Server has to be run and available during all calculation (submit to apropriate queue). Any number of clients that connect to server with results.


; Server
===Sampling Space Discretization===
'''mtd-admin''' - Admin program, is able to connect to server and submit commands to server. Available commands are:
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:
  info    = prints information about registered clients
  flush    = saves accumulated MTD data on server side
  get      = gets accumulated MTD data and saves them locally
  shutdown = stops server execution
  errors  = prints errors from server stack
See mtd-admin help for more info.


<center><math>\frac{\partial G(\boldsymbol \xi^{*})}{\partial \boldsymbol \xi} = - {\langle \bold F_{ICF} \rangle}_{\boldsymbol \xi=\boldsymbol \xi^{*} \pm \bold h/2} </math> ... (5)</center>


'''mtd-server''' - is multiple walker metadynamics server program. It requires input file with sections and keywords mentioned below:
with the standard error:


Section [server]
<center><math>\sigma_e \left( \frac{\partial G(\boldsymbol \xi^{*})}{\partial \boldsymbol \xi} \right) = \sqrt{ \frac {N_{corr}} {N_b} } \sigma(\bold F_{ICF})_ {\boldsymbol \xi=\boldsymbol \xi^{*} \pm \bold h/2} </math> ... (6)</center>
:Server key file name  (serverkey)              = server.key
:Do not automatically shutdown (donotshutdown)  =  false                (default)
:Listening queue length (maxqueuelen)           =     30                (default)
:Max number of worker threads (maxthreads)     =     5                (default)


where the standard deviation is given by:


Section [watcher]
<center><math>\sigma(\bold F_{ICF})_ {\boldsymbol \xi=\boldsymbol \xi^{*} \pm \bold h/2} = \sqrt { \frac{1}{N_b} \sum_{i=1}^{N_b} \left( F_{ICF}(\boldsymbol \xi_i) - \overline {F_{ICF}} \right)^2 \vert _{\boldsymbol \xi=\boldsymbol \xi^{*} \pm \bold h/2}  }</math> ... (7)</center>
:Watcher service is enabled (enabled)           =   true                (default)
:Flush dead clients interval (deadinterval) [s] =   3600                (default)
:Flush error stack interval (errorinterval) [s] =    30                (default)
:Error log file (logname)                       = errors.log            (default)


Section [files]
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.
:Input history potential (input)  = none                              (default)
:Output history potential (output) = _mtdserver.rst                    (default)


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.


; Client
===Well-temepered Metadynamics===
Client setup is analogous to one in single mode, it contains section [mtd] and extra definition section [mtd-walker] with keyword fserverkey and server key file has to be accesible to client (via it can connect to client):


  [mtd-walker]
==References==
  fserverkey server.key
<references />

Latest revision as of 16:04, 22 July 2021

Navigation: Documentation / Methods / Metadynamics


Contents

Description

Free Energy from Metadynamics Simulations

Metadynamics introduces a history-dependent potential, which is composed of Gaussian functions added in regular intervals. This potential is employed as a bias in molecular dynamics simulation to suppress visiting already sampled regions.

... (8)

As a result, the system evolves by free diffusions alongside biased collective variables. Moreover, the history-dependent potential converges to the negative value of the free energy in a limit of infinitesimally long metadynamics simulation.


The application of the history dependent potential 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.

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.

Well-temepered Metadynamics

References