Action: LOGMFD
| Module | logmfd |
|---|---|
| Description | Usage |
| Used to perform LogMFD, LogPD, and TAMD/d-AFED. |
Details and examples
Used to perform LogMFD, LogPD, and TAMD/d-AFED.
LogMFD
Consider a physical system of particles, for which the Hamiltonian is given as
where , (), and are the position, momentum, and mass of particle respectively, and is the potential energy function for . The free energy as a function of a set of collective variables (CVs) is given as
where are the CVs, is Boltzmann constant, , and is the spring constant which is large enough to invoke
In mean-force dynamics, are treated as fictitious dynamical variables, which are associated with the following Hamiltonian,
where and are the momentum and mass of , respectively, and is the potential function for . We assume that is a functional of ; . The simplest form of is , which corresponds to the TAMD/d-AFED methods that are discussed in the first two papers cited below (or the extended Lagrangian dynamics in the limit of the adiabatic decoupling between and ). In the case of LogMFD, the following form of is introduced and discussed in the third paper cited below.
where (ALPHA) and (GAMMA) are positive parameters. The logarithmic form of ensures the dynamics of on a much smoother energy surface [i.e., ] than , thus enhancing the sampling in the -space. The parameters and determine the degree of flatness of , but adjusting only is normally sufficient to have a relatively flat surface (with keeping the relation ).
The equation of motion for in LogMFD (no thermostat) is
where is evaluated as a canonical average under the condition that is fixed;
where
The mean-force (MF) is practically evaluated by performing a shot-time canonical MD run of steps each time is updated according to the equation of motion for .
If the canonical average for the MF is effectively converged, the dynamical variables and are decoupled and they evolve adiabatically, which can be exploited for the on-the-fly evaluation of . I.e., should be a constant of motion in this case, thus can be evaluated each time is updated as
This means that can be constructed without post processing (on-the-fly free energy reconstruction). Note that the on-the-fly free energy reconstruction is also possible in TAMD/d-AFED if the Hamiltonian-like conserved quantity is available (e.g., the Nose-Hoover type dynamics).
LogPD
The accuracy in the MF is critical to the on-the-fly free energy reconstruction. To improve the evaluation of the MF, parallel-dynamics (PD) is incorporated into LogMFD, leading to logarithmic parallel-dynamics (LogPD) that is discussed in the fourth paper in the reference section.
In PD, the MF is evaluated by a non-equilibrium path-ensemble based on the Crooks-Jarzynski non-equilibrium work relation. To this end, multiple replicas of the MD system which run in parallel are introduced. The CVs [] in each replica is restrained to the same value of . A canonical MD run with steps is performed in each replica, then the MF on is evaluated using the MD trajectories from all replicas. The MF is practically calculated as
where indicates the -configuration at time step in the -step shot-time MD run in the th replica among replicas. is given as
where
and is the th CV in the th replica.
comes from the Crooks-Jarzynski non-equilibrium work relation by which we can evaluate an equilibrium ensemble average from a set of non-equilibrium trajectories. Note that, to avoid possible numerical errors in the exponential function, the following form of is instead used in PLUMED,
where
With the MF evaluated using the PD approach, free energy profiles can be reconstructed more efficiently (requiring less elapsed computing time) in LogPD than with a single MD system in LogMFD. In the case that there exist more than one stable state separated by high energy barriers in the hidden subspace orthogonal to the CV-subspace, LogPD is particularly of use to incorporate all the contributions from such hidden states with appropriate weights (in the limit ).
Note that LogPD calculations should always be initiated with an equilibrium -configuration in each replica, because the Crooks-Jarzynski non-equilibrium work relation is invoked. Also note that LogPD is currently available only with Gromacs, while LogMFD can be performed with LAMMPS, Gromacs, Quantum Espresso, NAMD, and so on.
Using LogMFD/PD with a thermostat
Introducing a thermostat on is often recommended in LogMFD/PD to maintain the adiabatic decoupling between and . In the framework of the LogMFD approach, the Nose-Hoover type thermostat and the Gaussian isokinetic (velocity scaling) thermostat can be used to control the kinetic energy of .
Nose-Hoover LogMFD/PD
The equation of motion for coupled to a Nose-Hoover thermostat variable (single heat bath) is
The equation of motion for is
where is the number of the CVs. Since the following pseudo-Hamiltonian is a constant of motion in Nose-Hoover LogMFD/PD,
is obtained at each MFD step as
Velocity scaling LogMFD/PD
The velocity scaling algorithm (which is equivalent to the Gaussian isokinetic dynamics in the limit ) can also be employed to control the velocity of , .
The following algorithm is introduced to perform the isokinetic LogMFD calculations that are discussed in the fifth paper cited belo;
Note that is assumed to be initially given, which meets the following relation,
It should be stressed that, in the same way as in the NVE and Nose-Hoover LogMFD/PD, can be evaluated at each MFD step (on-the-fly free energy reconstruction) in Velocity Scaling LogMFD/PD.
Examples
Example-LoGMFD Example of LogMFD
The following input file is called plumed.dat and tells plumed to restrain collective variables to the fictitious dynamical variables in LogMFD/PD.
UNITSThis command sets the internal units for the code. More details TIMEthe units of time=fs LENGTHthe units of lengths=1.0 ENERGYthe units of energy=kcal/mol MASSthe units of masses=1.0 CHARGEthe units of charges=1.0 phi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=5,7,9,15 psi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=7,9,15,17 # LogMFD LOGMFDUsed to perform LogMFD, LogPD, and TAMD/d-AFED. More details ... LABELa label for the action so that its output can be referenced in the input to other actions=logmfd ARGthe labels of the scalars on which the bias will act=phi,psi KAPPASpring constant of the harmonic restraining potential=1000.0,1000.0 DELTA_TTime step for the fictitious dynamical variables (DELTA_T=1 often works)=1.0 INTERVALPeriod of MD steps (N_m) to update fictitious dynamical variables=200 TEMPTarget temperature for the fictitious dynamical variables in LogMFD/PD=300.0 FLOGThe initial free energy value in the LogMFD/PD run=2.0 MFICTMasses of each fictitious dynamical variable=5000000,5000000 VFICTThe initial velocities of the fictitious dynamical variables=3.5e-4,3.5e-4 ALPHAAlpha parameter for LogMFD=4.0 THERMOSTATType of thermostat for the fictitious dynamical variables=NVE FICT_MAXMaximum values reachable for the fictitious dynamical variables=3.15,3.15 FICT_MINMinimum values reachable for the fictitious dynamical variables=-3.15,-3.15 ... LOGMFD
To submit this simulation with Gromacs, use the following command line to execute a LogMFD run with Gromacs-MD. Here topol.tpr is the input file which contains atomic coordinates and Gromacs parameters.
gmx_mpi mdrun -s topol.tpr -plumed
This command will output files named logmfd.out and replica.out.
The output file logmfd.out records free energy and all fictitious dynamical variables at every MFD step.
# LogMFD
# CVs : phi psi
# Mass for CV particles : 5000000.000000 5000000.000000
# Mass for thermostat : 11923.224809
# 1:iter_mfd, 2:Flog, 3:2*Ekin/gkb[K], 4:eta, 5:Veta,
# 6:phi_fict(t), 7:phi_vfict(t), 8:phi_force(t),
# 9:psi_fict(t), 10:psi_vfict(t), 11:psi_force(t),
0 2.000000 308.221983 0.000000 0.000000 -2.442363 0.000350 5.522717 2.426650 0.000350 7.443177
1 1.995466 308.475775 0.000000 0.000000 -2.442013 0.000350 -4.406246 2.427000 0.000350 11.531345
2 1.992970 308.615664 0.000000 0.000000 -2.441663 0.000350 -3.346513 2.427350 0.000350 15.763196
3 1.988619 308.859946 0.000000 0.000000 -2.441313 0.000350 6.463092 2.427701 0.000351 6.975422
...
The output file replica.out records all collective variables at every MFD step.
Replica No. 0 of 1.
# 1:iter_mfd, 2:work, 3:weight,
# 4:phi(q)
# 5:psi(q)
0 0.000000e+00 1.000000e+00 -2.436841 2.434093
1 -4.539972e-03 1.000000e+00 -2.446420 2.438531
2 -7.038516e-03 1.000000e+00 -2.445010 2.443114
3 -1.139672e-02 1.000000e+00 -2.434850 2.434677
...
Example of LogPD
Use the following command line to execute a LogPD run using two MD replicas (note that only Gromacs is currently available for LogPD). Here 0/topol.tpr and 1/topol.tpr are the input files, each containing the atomic coordinates for the corresponding replica and Gromacs parameters. All the directories, 0/ and 1/, should contain the same plumed.dat.
mpirun -np 2 gmx_mpi mdrun -s topol -plumed -multidir 0 1
This command will output files named logmfd.out in 0/, and replica.out.0 and replica.out.1 in 0/ and 1/, respectively.
The output file logmfd.out records free energy and all fictitious dynamical variables at every MFD step.
# LogPD, replica parallel of LogMFD
# number of replica : 2
# CVs : phi psi
# Mass for CV particles : 5000000.000000 5000000.000000
# Mass for thermostat : 11923.224809
# 1:iter_mfd, 2:Flog, 3:2*Ekin/gkb[K], 4:eta, 5:Veta,
# 6:phi_fict(t), 7:phi_vfict(t), 8:phi_force(t),
# 9:psi_fict(t), 10:psi_vfict(t), 11:psi_force(t),
0 2.000000 308.221983 0.000000 0.000000 -2.417903 0.000350 4.930899 2.451475 0.000350 -3.122024
1 1.999367 308.257404 0.000000 0.000000 -2.417552 0.000350 0.851133 2.451825 0.000350 -1.552718
2 1.999612 308.243683 0.000000 0.000000 -2.417202 0.000350 -1.588175 2.452175 0.000350 1.601274
3 1.999608 308.243922 0.000000 0.000000 -2.416852 0.000350 4.267745 2.452525 0.000350 -4.565621
...
The output file replica.out.0 records all collective variables and the Jarzynski weight of replica No.0 at every MFD step.
# Replica No. 0 of 2.
# 1:iter_mfd, 2:work, 3:weight,
# 4:phi(q)
# 5:psi(q)
0 0.000000e+00 5.000000e-01 -2.412607 2.446191
1 -4.649101e-06 4.994723e-01 -2.421403 2.451318
2 1.520985e-03 4.983996e-01 -2.420269 2.455049
3 1.588855e-03 4.983392e-01 -2.411081 2.447394
...
The output file replica.out.1 records all collective variables and the Jarzynski weight of replica No.1 at every MFD step.
# Replica No. 1 of 2.
# 1:iter_mfd, 2:work, 3:weight,
# 4:phi(q)
# 5:psi(q)
0 0.000000e+00 5.000000e-01 -2.413336 2.450516
1 -1.263077e-03 5.005277e-01 -2.412009 2.449229
2 -2.295444e-03 5.016004e-01 -2.417322 2.452512
3 -2.371507e-03 5.016608e-01 -2.414078 2.448521
...
Input
The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.
| Keyword | Type | Description |
|---|---|---|
| ARG | scalar | the labels of the scalars on which the bias will act |
Output components
This action calculates the values in the following table. These values can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the value required from the list below.
| Name | Type | Description |
|---|---|---|
| bias | scalar | the instantaneous value of the bias potential |
| _fict | scalar | For example, the fictitious collective variable for LogMFD is specified as ARG=dist12 and LABEL=logmfd in LOGMFD section in Plumed input file, the associated fictitious dynamical variable can be specified as PRINT ARG=dist12,logmfd |
| _vfict | scalar | For example, the fictitious collective variable for LogMFD is specified as ARG=dist12 and LABEL=logmfd in LOGMFD section in Plumed input file, the velocity of the associated fictitious dynamical variable can be specified as PRINT ARG=dist12,logmfd |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| ARG | input | none | the labels of the scalars on which the bias will act |
| INTERVAL | compulsory | none | Period of MD steps (N_m) to update fictitious dynamical variables |
| DELTA_T | compulsory | none | Time step for the fictitious dynamical variables (DELTA_T=1 often works) |
| THERMOSTAT | compulsory | none | Type of thermostat for the fictitious dynamical variables |
| KAPPA | compulsory | none | Spring constant of the harmonic restraining potential |
| FICT_MAX | compulsory | none | Maximum values reachable for the fictitious dynamical variables |
| FICT_MIN | compulsory | none | Minimum values reachable for the fictitious dynamical variables |
| FLOG | compulsory | none | The initial free energy value in the LogMFD/PD run |
| NUMERICAL_DERIVATIVESThis keyword do not have examples | optional | false | calculate the derivatives for these quantities numerically |
| TEMP | optional | not used | Target temperature for the fictitious dynamical variables in LogMFD/PD |
| TAMDThis keyword do not have examples | optional | not used | When TAMD=1, TAMD/d-AFED calculations can be performed instead of LogMFD |
| ALPHA | optional | not used | Alpha parameter for LogMFD |
| GAMMAThis keyword do not have examples | optional | not used | Gamma parameter for LogMFD |
| FICTThis keyword do not have examples | optional | not used | The initial values of the fictitious dynamical variables |
| VFICT | optional | not used | The initial velocities of the fictitious dynamical variables |
| MFICT | optional | not used | Masses of each fictitious dynamical variable |
| XETAThis keyword do not have examples | optional | not used | The initial eta variable of the Nose-Hoover thermostat for the fictitious dynamical variables |
| VETAThis keyword do not have examples | optional | not used | The initial velocity of eta variable |
| METAThis keyword do not have examples | optional | not used | Mass of eta variable |
| WORKThis keyword do not have examples | optional | not used | The initial value of the work done by fictitious dynamical variables in each replica |
| TEMPPDThis keyword do not have examples | optional | not used | Temperature of the Boltzmann factor in the Jarzynski weight in LogPD (Gromacs only) |
References
More information about how this action can be used is available in the following articles:
- J. B. Abrams, M. E. Tuckerman, Efficient and Direct Generation of Multidimensional Free Energy Surfaces via Adiabatic Dynamics without Coordinate Transformations. The Journal of Physical Chemistry B. 112, 15742–15757 (2008)
- L. Maragliano, E. Vanden-Eijnden, A temperature accelerated method for sampling free energy and determining reaction pathways in rare events simulations. Chemical Physics Letters. 426, 168–175 (2006)
- T. Morishita, S. G. Itoh, H. Okumura, M. Mikami, Free-energy calculation via mean-force dynamics using a logarithmic energy landscape. Physical Review E. 85 (2012)
- T. Morishita, Y. Yonezawa, A. M. Ito, Free Energy Reconstruction from Logarithmic Mean-Force Dynamics Using Multiple Nonequilibrium Trajectories. Journal of Chemical Theory and Computation. 13, 3106–3119 (2017)
- T. Morishita, T. Nakamura, W. Shinoda, A. M. Ito, Isokinetic approach in logarithmic mean-force dynamics for on-the-fly free energy reconstruction. Chemical Physics Letters. 706, 633–640 (2018)