Skip to content

Action: VES_DELTA_F

Module ves
Description Usage
Implementation of VES Delta F method used in 0 tutorialsused in 1 eggs

Details and examples

Implementation of VES Delta F method

Implementation of VES method discussed in the paper cited below (step two only).

Notice that this is a stand-alone bias Action, it does not need any of the other VES module components

First you should create some estimate of the local free energy basins of your system, using e.g. multiple METAD short runs, and combining them with the sum_hills utility. Once you have them, you can use this bias Action to perform the VES optimization part of the method.

These local basins are used to model the global free energy. In particular, given the conditional probabilities and the probabilities of being in a given basin , we can write:

We use this free energy model and the chosen bias factor to build the bias potential: . Or, more explicitly: where the parameters are the free energy differences (see below) from the basin.

By default the are shifted so that for all . In this case the optimization parameters are the difference in height between the minima of the basins. Using the keyword NORMALIZE, you can also decide to normalize the local free energies so that . In this case the parameters will represent not the difference in height (which depends on the chosen CVs), but the actual free energy difference, .

However, as discussed in the paper cited below, a better estimate of should be obtained through the reweighting procedure.

Examples

The following performs the optimization of the free energy difference between two metastable basins:

Click on the labels of the actions for more information on what each action computes
tested on2.11
#SETTINGS INPUTFILES=regtest/ves/rt-VesDeltaF/fesA.data,regtest/ves/rt-VesDeltaF/fesB.data

cv: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=7,9,15,17 ves: VES_DELTA_FImplementation of VES Delta F method More details ... ARGthe labels of the scalars on which the bias will act=cv TEMPtemperature is compulsory, but it can be sometimes fetched from the MD engine=300 FILE_F0names of files containing local free energies and derivatives=
regtest/ves/rt-VesDeltaF/fesA.data
Click here to see an extract from this file.
×

FILE: regtest/ves/rt-VesDeltaF/fesA.data

#! FIELDS psi file.free der_psi
#! SET min_psi -pi
#! SET max_psi pi
#! SET nbins_psi  100
#! SET periodic_psi true
-3.141592654 4.36802 19.5097
-3.078760801 5.66848 21.6909
-3.015928947 7.09647 23.577
-2.953097094 8.63333 25.1473
-2.890265241 10.2594 26.3832
-2.827433388 11.9491 27.2957
-2.764601535 13.6875 27.878
-2.701769682 15.4504 28.1108
-2.638937829 17.2183 27.998
-2.576105976 18.9704 27.5472
-2.513274123 20.6831 26.739
-2.450442270 22.3346 25.5954
-2.387610417 23.903 24.126
-2.324778564 25.3684 22.3417
-2.261946711 26.713 20.2807
-2.199114858 27.9204 18.0017
-2.136283004 28.9803 15.5759
-2.073451151 29.8843 13.0377
-2.010619298 30.6275 10.4809
-1.947787445 31.2094 7.97975
-1.884955592 31.6378 5.58326
-1.822123739 31.9191 3.34091
-1.759291886 32.0659 1.29197
-1.696460033 32.0909 -0.546121
-1.633628180 32.0061 -2.16705
-1.570796327 31.8246 -3.63398
-1.507964474 31.5533 -5.00699
-1.445132621 31.1952 -6.33818
-1.382300768 30.757 -7.67212
-1.319468915 30.2303 -9.13268
-1.256637061 29.6098 -10.6657
-1.193805208 28.8871 -12.3343
-1.130973355 28.0558 -14.1094
-1.068141502 27.113 -15.8889
-1.005309649 26.0583 -17.6194
-0.942477796 24.8968 -19.2133
-0.879645943 23.6455 -20.5374
-0.816814090 22.3214 -21.4909
-0.753982237 20.9488 -22.031
-0.691150384 19.5565 -22.119
-0.628318531 18.1758 -21.7332
-0.565486678 16.8313 -20.9121
-0.502654825 15.551 -19.7453
-0.439822972 14.3494 -18.3384
-0.376991118 13.2428 -16.7921
-0.314159265 12.2351 -15.2363
-0.251327412 11.3231 -13.7418
-0.188495559 10.4994 -12.4468
-0.125663706 9.75187 -11.3496
-0.062831853 9.06424 -10.4961
-0.000000000 8.42119 -9.89032
0.062831853 7.81152 -9.48682
0.125663706 7.22276 -9.21098
0.188495559 6.64891 -9.01897
0.251327412 6.0864 -8.84767
0.314159265 5.5358 -8.64894
0.376991118 4.99797 -8.3951
0.439822972 4.47921 -8.0791
0.502654825 3.98304 -7.68146
0.565486678 3.51512 -7.23543
0.628318531 3.07615 -6.71765
0.691150384 2.67296 -6.12193
0.753982237 2.30995 -5.43588
0.816814090 1.99232 -4.63102
0.879645943 1.73124 -3.67658
0.942477796 1.53525 -2.57049
1.005309649 1.41503 -1.31348
1.068141502 1.37633 0.0480893
1.130973355 1.42397 1.49578
1.193805208 1.56346 2.88609
1.256637061 1.78476 4.17562
1.319468915 2.08019 5.21984
1.382300768 2.43492 5.96508
1.445132621 2.82268 6.3463
1.507964474 3.22301 6.3284
1.570796327 3.61129 5.89999
1.633628180 3.9608 5.13243
1.696460033 4.24924 4.0368
1.759291886 4.46377 2.71234
1.822123739 4.59074 1.22175
1.884955592 4.61911 -0.362186
1.947787445 4.5464 -1.98735
2.010619298 4.37105 -3.59819
2.073451151 4.09788 -5.14685
2.136283004 3.73282 -6.52348
2.199114858 3.28891 -7.65024
2.261946711 2.78258 -8.43748
2.324778564 2.24285 -8.79735
2.387610417 1.69428 -8.65231
2.450442270 1.17126 -7.98615
2.513274123 0.709248 -6.75935
2.576105976 0.340709 -5.02147
2.638937829 0.0954356 -2.82987
2.701769682 0 -0.28181
2.764601535 0.0737266 2.54129
2.827433388 0.32921 5.49973
2.890265241 0.772135 8.50981
2.953097094 1.40582 11.4956
3.015928947 2.22234 14.3695
3.078760801 3.21387 17.0604
FILE_F1names of files containing local free energies and derivatives=
regtest/ves/rt-VesDeltaF/fesB.data
Click here to see an extract from this file.
×

FILE: regtest/ves/rt-VesDeltaF/fesB.data

#! FIELDS psi file.free der_psi
#! SET min_psi -pi
#! SET max_psi pi
#! SET nbins_psi  100
#! SET periodic_psi true
-3.141592654 24.9001 -12.4829
-3.078760801 24.1294 -11.9644
-3.015928947 23.3938 -11.3701
-2.953097094 22.695 -10.7745
-2.890265241 22.0342 -10.2047
-2.827433388 21.4062 -9.71451
-2.764601535 20.807 -9.30837
-2.701769682 20.2302 -9.00028
-2.638937829 19.6696 -8.78005
-2.576105976 19.1209 -8.63393
-2.513274123 18.5759 -8.59237
-2.450442270 18.0313 -8.63986
-2.387610417 17.4814 -8.78598
-2.324778564 16.919 -9.04524
-2.261946711 16.3357 -9.44393
-2.199114858 15.722 -9.99923
-2.136283004 15.0703 -10.6815
-2.073451151 14.3734 -11.4836
-2.010619298 13.6216 -12.3518
-1.947787445 12.815 -13.2455
-1.884955592 11.9541 -14.0905
-1.822123739 11.0428 -14.8513
-1.759291886 10.0886 -15.4542
-1.696460033 9.10087 -15.8611
-1.633628180 8.09497 -16.0558
-1.570796327 7.08681 -15.9864
-1.507964474 6.08939 -15.6574
-1.445132621 5.12213 -15.043
-1.382300768 4.20099 -14.1569
-1.319468915 3.34498 -13.0106
-1.256637061 2.56956 -11.6307
-1.193805208 1.88594 -10.0709
-1.130973355 1.30393 -8.39028
-1.068141502 0.830894 -6.65071
-1.005309649 0.468031 -4.92215
-0.942477796 0.211516 -3.24192
-0.879645943 0.0589191 -1.67105
-0.816814090 0 -0.192845
-0.753982237 0.0309925 1.17273
-0.691150384 0.143613 2.42556
-0.628318531 0.334286 3.60782
-0.565486678 0.595249 4.693
-0.502654825 0.924157 5.7471
-0.439822972 1.31982 6.74951
-0.376991118 1.77583 7.71122
-0.314159265 2.29182 8.6417
-0.251327412 2.86516 9.53132
-0.188495559 3.49271 10.375
-0.125663706 4.17193 11.165
-0.062831853 4.89911 11.9072
-0.000000000 5.67268 12.5744
0.062831853 6.48706 13.1863
0.125663706 7.33826 13.7804
0.188495559 8.22562 14.3586
0.251327412 9.14976 14.9426
0.314159265 10.1125 15.5728
0.376991118 11.1167 16.2797
0.439822972 12.1672 17.0723
0.502654825 13.271 17.9157
0.565486678 14.4278 18.802
0.628318531 15.6397 19.654
0.691150384 16.9024 20.401
0.753982237 18.2072 20.9598
0.816814090 19.5399 21.2653
0.879645943 20.8815 21.2804
0.942477796 22.2133 20.9669
1.005309649 23.5157 20.3083
1.068141502 24.7665 19.3463
1.130973355 25.9489 18.1207
1.193805208 27.047 16.698
1.256637061 28.0506 15.1303
1.319468915 28.9531 13.4843
1.382300768 29.7512 11.8194
1.445132621 30.446 10.1914
1.507964474 31.0399 8.65818
1.570796327 31.5409 7.22958
1.633628180 31.9557 5.94397
1.696460033 32.2931 4.78302
1.759291886 32.5633 3.77164
1.822123739 32.7745 2.88276
1.884955592 32.9318 2.10754
1.947787445 33.0428 1.39361
2.010619298 33.1104 0.724416
2.073451151 33.136 0.0872836
2.136283004 33.1209 -0.595123
2.199114858 33.0605 -1.32962
2.261946711 32.9513 -2.15558
2.324778564 32.7871 -3.08378
2.387610417 32.5618 -4.10772
2.450442270 32.2677 -5.24442
2.513274123 31.8988 -6.4613
2.576105976 31.4527 -7.71975
2.638937829 30.9272 -8.96439
2.701769682 30.3252 -10.1401
2.764601535 29.6525 -11.181
2.827433388 28.9206 -12.0292
2.890265241 28.142 -12.6402
2.953097094 27.3345 -12.9763
3.015928947 26.5149 -13.0384
3.078760801 25.6988 -12.8616
BIASFACTOR the gamma bias factor used for well-tempered target p(s)=10.0 M_STEP the mu step used for the Omega functional minimization=0.1 AV_STRIDE number of simulation steps between alpha updates=500 PRINT_STRIDE stride for printing to ALPHA_FILE=100 ... PRINTPrint quantities to a file. More details FMT the format that should be used to output real numbers=%g STRIDE the frequency with which the quantities of interest should be output=500 FILEthe name of the file on which to output these quantities=Colvar.data ARGthe labels of the values that you would like to print to the file=cv,ves.bias,ves.rct

The local FES files can be obtained as described in Sec. 4.2 of the paper cited below, i.e. for example: - run 4 independent metad runs, all starting from basin A, and kill them as soon as they make the first transition (see e.g. COMMITTOR) - cat HILLS* > all_HILLS - plumed sum_hills --hills all_HILLS --outfile all_fesA.dat --mintozero --min 0 --max 1 --bin 100 - awk -v n_rep=4 '{if($1!="#!" && $1!="") {for(i=1+(NF-1)/2; i<=NF; i++) $i/=n_rep;} print $0}' all_fesA.dat > fesA.data

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
rct scalar the reweighting factor c(t)
work scalar the work done by the bias in one AV_STRIDE

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
FILE_F compulsory none names of files containing local free energies and derivatives
BIASFACTOR compulsory 0 the gamma bias factor used for well-tempered target p(s)
M_STEP compulsory 1.0 the mu step used for the Omega functional minimization
AV_STRIDE compulsory 500 number of simulation steps between alpha updates
ALPHA_FILEThis keyword do not have examples compulsory ALPHA file name for output minimization parameters
NUMERICAL_DERIVATIVESThis keyword do not have examples optional false calculate the derivatives for these quantities numerically
TEMP optional not used temperature is compulsory, but it can be sometimes fetched from the MD engine
NORMALIZEThis keyword do not have examples optional false normalize all local free energies so that alpha will be (approx) Delta F
NO_MINTOZEROThis keyword do not have examples optional false leave local free energies as provided, without shifting them to zero min
TG_STRIDEThis keyword do not have examples optional not used number of AV_STRIDE between updates of target p(s) and reweighing factor c(t)
TAU_MEANThis keyword do not have examples optional not used exponentially decaying average for alpha (rescaled using AV_STRIDE)
INITIAL_ALPHAThis keyword do not have examples optional not used an initial guess for the bias potential parameter alpha
DAMPING_OFFThis keyword do not have examples optional false do not use an AdaGrad-like term to rescale M_STEP
PRINT_STRIDE optional not used stride for printing to ALPHA_FILE
FMTThis keyword do not have examples optional not used specify format for ALPHA_FILE
SERIALThis keyword do not have examples optional false perform the calculation in serial even if multiple tasks are available
MULTIPLE_WALKERSThis keyword do not have examples optional false use multiple walkers connected via MPI for the optimization
RESTARTThis keyword do not have examples optional not used allows per-action setting of restart (YES/NO/AUTO)

References

More information about how this action can be used is available in the following articles: