Next: Harmonic restraints Up: Biasing and analysis methods Previous: Adaptive Biasing Force   Contents   Index

Subsections

The metadynamics method uses a history-dependent potential [45] that generalizes to any type of colvars the conformational flooding [46] and local elevation [47] methods, originally formulated to use as colvars the principal components of a covariance matrix or a set of dihedral angles, respectively. The metadynamics potential on the colvars is defined as:

 (13.20)

where is the history-dependent potential acting on the current values of the colvars , and depends only parametrically on the previous values of the colvars. is constructed as a sum of -dimensional repulsive Gaussian hills'', whose height is a chosen energy constant , and whose centers are the previously explored configurations . Each Gaussian functions has a width of approximately along the direction of the -th colvar.

During the simulation, the system evolves towards the nearest minimum of the effective'' potential of mean force , which is the sum of the real'' underlying potential of mean force and the the metadynamics potential . Therefore, at any given time the probability of observing the configuration is proportional to : this is also the probability that a new Gaussian hill'' is added at that configuration. If the simulation is run for a sufficiently long time, each local minimum is canceled out by the sum of the Gaussian hill'' functions. At that stage the the effective'' potential of mean force is constant, and is an accurate estimator of the real'' potential of mean force , save for an additive constant:

 (13.21)

Assuming that the set of collective variables includes all relevant degrees of freedom, the predicted error of the estimate is a simple function of the correlation times of the colvars , and of the user-defined parameters , and [48]. In typical applications, a good rule of thumb can be to choose the ratio much smaller than , where is the longest among 's correlation times: then dictates the resolution of the calculated PMF.

To enable a metadynamics calculation, a metadynamics block must be defined in the colvars configuration file. Its only mandatory keyword is the colvars option listing all the variables involved: multidimensional PMFs are obtained by the same metadynamics instance applied to all the colvars.

The parameters and are specified by the keywords hillWeight and newHillFrequency, respectively. The values of these options are optimal for colvars with correlation times in the range of a few thousand simulation steps, typical of many biomolecular simulations:

• hillWeight Height of each hill (kcal/mol)
Acceptable values: positive decimal
Default value: 0.01
Description: This option sets the height of the hills that are added during this run. Lower values provide more accurate sampling at the price of longer simulation times to complete a PMF calculation.

• newHillFrequency Frequency of hill creation
Acceptable values: positive integer
Default value: 1000
Description: This option sets the number of integration steps after which a new hill is added to the metadynamics potential. Its value determines the parameter in eq. 13.21. Higher values provide more accurate sampling at the price of longer simulation times to complete a PMF calculation.

It is the user's responsibility to either leave hillWeight and newHillFrequency at their default values, or to change them to match the specifics of each system. The parameter is instead defined as approximately half the width of the corresponding colvar (see 13.2.1).

### Output files

When interpolating grids are enabled (default behavior), the PMF is written every colvarsRestartFrequency steps to the file outputName.pmf. The following two options allow to control this behavior and to visually track statistical convergence:

• writeFreeEnergyFile Periodically write the PMF for visualization
Acceptable values: boolean
Default value: on
Description: When useGrids and this option are on, the PMF is written every colvarsRestartFrequency steps.

• saveFreeEnergyFile Keep all the PMF files
Acceptable values: boolean
Default value: off
Description: When writeFreeEnergyFile and this option are on, the step number is included in the file name. Activating this option can be useful to follow more closely the convergence of the simulation, by comparing PMFs separated by short times.

Note: when Gaussian hills are deposited near lowerBoundary or upperBoundary (see 13.2.1) and interpolating grids are used (default behavior), their truncation can give rise to accumulating errors. In these cases, as a measure of fault-tolerance all Gaussian hills near the boundaries are included in the output state file, and are recalculated analytically whenever the colvar falls outside the grid's boundaries. (Such measure protects the accuracy of the calculation, and can only be disabled by hardLowerBoundary or hardUpperBoundary.) To avoid gradual loss of performance and growth of the state file, either one of the following solutions is recommended:

• enabling the option expandBoundaries, so that the grid's boundaries are automatically recalculated whenever necessary; the resulting .pmf will have its abscissas expanded accordingly;
• setting lowerWall and upperWall well within the interval delimited by lowerBoundary and upperBoundary.

### Performance tuning

The following options control the computational cost of metadynamics calculations, but do not affect results. Default values are chosen to minimize such cost with no loss of accuracy.

• useGrids Interpolate the hills with grids
Acceptable values: boolean
Default value: on
Description: This option discretizes all hills for improved performance, accumulating their energy and their gradients on two separate grids of equal spacing. Grids are defined by the values of lowerBoundary, upperBoundary and width for each colvar. Currently, this option is implemented for all types of variables except the non-scalar types (distanceDir or orientation). If expandBoundaries is defined in one of the colvars, grids are automatically expanded along the direction of that colvar.

• hillWidth Relative width of the hills
Acceptable values: positive decimal
Default value:
Description: Along each colvar, the width of each Gaussian hill ( ) is given by the product between this number and the colvar's width. The default value gives hills whose volume is the product of times the width of all colvars. For a smoother visualization of the free energy plot, decrease width and increase hillWidth in the same proportion. Note: when useGrids is on (default in most cases), values smaller than 1 should be avoided to avoid discretization errors.

• rebinGrids Recompute the grids when reading a state file
Acceptable values: boolean
Default value: off
Description: When restarting from a state file, the grid's parameters (boundaries and widths) saved in the state file override those in the configuration file. Enabling this option forces the grids to match those in the current configuration file.

The following options define the configuration for the well-tempered'' metadynamics approach [49]:

Acceptable values: boolean
Default value: off
Description: If enabled, this flag causes well-tempered metadynamics as described by Barducci et al.[49] to be performed, rather than standard metadynamics. The parameter biasTemperature is then required.

• biasTemperature Temperature bias for well-tempered metadynamics
Acceptable values: positive decimal
Description: When running metadynamics in the long time limit, collective variable space is sampled to a modified temperature . In conventional metadynamics, the temperature boost'' would constantly increases with time. Instead, in well-tempered metadynamics must be defined by the user via biasTemperature. If dumpFreeEnergyFile is enabled, the written PMF includes the scaling factor [49]. A careful choice of determines the sampling and convergence rate, and is hence crucial to the success of a well-tempered metadynamics simulation.

The following options define metadynamics calculations with more than one replica:

Acceptable values: boolean
Default value: off
Description: If this option is on, multiple (independent) replica of the same system can be run at the same time, and their hills will be combined to obtain a single PMF [50]. Replicas are identified by the value of replicaID. Communication is done by files: each replica must be able to read the files created by the others, whose paths are communicated through the file replicasRegistry. This file, and the files listed in it, are read every replicaUpdateFrequency steps. Every time the colvars state file is written (colvarsRestartFrequency), the file:
outputName.colvars.name.replicaID.state'' is also written, containing the state of the metadynamics bias for replicaID. In the time steps between colvarsRestartFrequency, new hills are temporarily written to the file:
outputName.colvars.name.replicaID.hills'', which serves as communication buffer. These files are only required for communication, and may be deleted after a new MD run is started with a different outputName.

• replicaID Set the identifier for this replica
Acceptable values: string
Description: If multipleReplicas is on, this option sets a unique identifier for this replica. All replicas should use identical collective variable configurations, except for the value of this option.

• replicasRegistry Multiple replicas database file
Acceptable values: UNIX filename
Default value: name.replica_files.txt''
Description: If multipleReplicas is on, this option sets the path to the replicas' database file.

• replicaUpdateFrequency How often hills are communicated between replicas
Acceptable values: positive integer
Default value: newHillFrequency
Description: If multipleReplicas is on, this option sets the number of steps after which each replica (re)reads the other replicas' files. The lowest meaningful value of this number is newHillFrequency. If access to the file system is significantly affecting the simulation performance, this number can be increased, at the price of reduced synchronization between replicas. Values higher than colvarsRestartFrequency may not improve performance significantly.

• dumpPartialFreeEnergyFile Periodically write the contribution to the PMF from this replica
Acceptable values: boolean
Default value: on
Description: When multipleReplicas is on, tje file outputName.pmf contains the combined PMF from all replicas. Enabling this option produces an additional file outputName.partial.pmf, which can be useful to quickly monitor the contribution of each replica to the PMF. The requirements for this option are the same as dumpFreeEnergyFile.

### Compatibility and post-processing

The following options may be useful only for applications that go beyond the calculation of a PMF by metadynamics:
• name Name of this metadynamics instance
Acceptable values: string
Default value: meta'' + rank number
Description: This option sets the name for this metadynamics instance. While it is not advisable to use more than one metadynamics instance within the same simulation, this allows to distinguish each instance from the others. If there is more than one metadynamics instance, the name of this bias is included in the metadynamics output file names, such as e.g. the .pmf file.

• keepHills Write each individual hill to the state file
Acceptable values: boolean
Default value: off
Description: When useGrids and this option are on, all hills are saved to the state file in their analytic form, alongside their grids. This makes it possible to later use exact analytic Gaussians for rebinGrids. To only keep track of the history of the added hills, writeHillsTrajectory is preferable.

• writeHillsTrajectory Write a log of new hills
Description: If this option is on, a logfile is written by the metadynamics bias, with the name outputName.colvars. name .hills.traj'', which can be useful to follow the time series of the hills. When multipleReplicas is on, its name changes to
outputName.colvars. name . replicaID .hills.traj''. This file can be used to quickly visualize the positions of all added hills, in case newHillFrequency does not coincide with colvarsRestartFrequency.