sum_hills
This is part of the cltools module

sum_hills is a tool that allows one to to use plumed to post-process an existing hills/colvar file

Options
--help/-h ( default=off ) print this help
--help-debug ( default=off ) print special options that can be used to create regtests
--negbias ( default=off ) print the negative bias instead of the free energy (only needed with welltempered runs and flexible hills)
--nohistory ( default=off ) to be used with –stride: it splits the bias/histogram in pieces without previous history
--mintozero

( default=off ) it translate all the minimum value in bias/histogram to zero (usefull to compare results)

--hills specify the name of the hills file
--histo specify the name of the file for histogram a colvar/hills file is good
--stride specify the stride for integrating hills file (default 0=never)
--min the lower bounds for the grid
--max the upper bounds for the grid
--bin the number of bins for the grid
--spacing grid spacing, alternative to the number of bins
--idw specify the variables to be used for the free-energy/histogram (default is all). With –hills the other variables will be integrated out, with –histo the other variables won't be considered
--outfile specify the outputfile for sumhills
--outhisto specify the outputfile for the histogram
--kt specify temperature in energy units for integrating out variables
--sigma a vector that specify the sigma for binning (only needed when doing histogram
--fmt

specify the output format

Examples

a typical case is about the integration of a hills file:

plumed sum_hills  --hills PATHTOMYHILLSFILE 

The default name for the output file will be fes.dat Note that starting from this version plumed will automatically detect the number of the variables you have and their periodicity. Additionally, if you use flexible hills (multivariate gaussians), plumed will understand it from the HILLS file.

now sum_hills tool accepts als multiple files that will be integrated one after the other

plumed sum_hills  --hills PATHTOMYHILLSFILE1,PATHTOMYHILLSFILE2,PATHTOMYHILLSFILE3 

if you want to integrate out some variable you do

plumed sum_hills  --hills PATHTOMYHILLSFILE   --idw t1 --kt 0.6 

where with –idw you define the variables that you want all the others will be integrated out. –kt defines the temperature of the system in energy units. (be consistent with the units you have in your hills: plumed will not check this for you) If you need more variables then you may use a comma separated syntax

plumed sum_hills  --hills PATHTOMYHILLSFILE   --idw t1,t2 --kt 0.6  

You can define the output grid only with the number of bins you want while min/max will be detected for you

plumed sum_hills --bin 99,99 --hills PATHTOMYHILLSFILE   

or full grid specification

plumed sum_hills --bin 99,99 --min -pi,-pi --max pi,pi --hills PATHTOMYHILLSFILE   

You can of course use numbers instead of -pi/pi.

You can use a –stride keyword to have a dump each bunch of hills you read

plumed sum_hills --stride 300 --hills PATHTOMYHILLSFILE   

You can also have, in case of welltempered metadynamics, only the negative bias instead of the free energy through the keyword –negbias

plumed sum_hills --negbias --hills PATHTOMYHILLSFILE   

Here the default name will be negativebias.dat

From time to time you might need to use HILLS or a COLVAR file as it was just a simple set of points from which you want to build a free energy by using -(1/beta)log(P) then you use –histo

plumed sum_hills --histo PATHTOMYCOLVARORHILLSFILE  --sigma 0.2,0.2 --kt 0.6  

in this case you need a –kt to do the reweighting and then you need also some width (with the –sigma keyword) for the histogram calculation (actually will be done with gaussians, so it will be a continuous histogram) Here the default output will be histo.dat. Note that also here you can have multiple input files separated by a comma.

Additionally, if you want to do histogram and hills from the same file you can do as this

plumed sum_hills --hills --histo PATHTOMYCOLVARORHILLSFILE  --sigma 0.2,0.2 --kt 0.6  

The two files can be eventually the same

Another interesting thing one can do is monitor the difference in blocks as a metadynamics goes on. When the bias deposited is constant over the whole domain one can consider to be at convergence. This can be done with the –nohistory keyword

plumed sum_hills --stride 300 --hills PATHTOMYHILLSFILE  --nohistory 

and similarly one can do the same for an histogram file

plumed sum_hills --histo PATHTOMYCOLVARORHILLSFILE  --sigma 0.2,0.2 --kt 0.6 --nohistory 

just to check the hypothetical free energy calculated in single blocks of time during a simulation and not in a cumulative way

Output format can be controlled via the –fmt field

plumed sum_hills --hills PATHTOMYHILLSFILE  --fmt %8.3f 

where here we chose a float with length of 8 and 3 digits

The output can be named in a arbitrary way :

plumed sum_hills --hills PATHTOMYHILLSFILE  --outfile myfes.dat 

will produce a file myfes.dat which contains the free energy.

If you use stride, this keyword is the suffix

plumed sum_hills --hills PATHTOMYHILLSFILE  --outfile myfes_ --stride 100

will produce myfes_0.dat, myfes_1.dat, myfes_2.dat etc.

The same is true for the output coming from histogram

plumed sum_hills --histo HILLS --kt 2.5 --sigma 0.01 --outhisto myhisto.dat

is producing a file myhisto.dat while, when using stride, this is the suffix

plumed sum_hills --histo HILLS --kt 2.5 --sigma 0.01 --outhisto myhisto_ --stride 100 

that gives myhisto_0.dat, myhisto_1.dat, myhisto_3.dat etc..