From: Giacomo Fiorin (
Date: Fri Apr 24 2020 - 13:37:28 CDT

Hi Shashank, good point. I don't know how sum_hills would handle that, but
actually I'm not sure that it would necessarily needs to: if the walls are
stationary (i.e. their position or force constant don't change) they will
effectively be part of the PMF itself. Of course, you can always subtract
the walls' contributions from the PMF itself, with the caveat that
metadynamics convergence will not be as good along the walls. See notes at
the end of this section:

However, in your case you were planning on reweighting the trajectory along
a different variable, and how to handle the wall along the original
variable would be non trivial, particularly for steep walls. A common
approach would be again, to get the best converged PMF along variable 1,
truncate it to the region between the walls, and then project along
variable 2 using finite intervals for both variables. I haven't read the
Tiwary paper in enough detail to know how that method would handle it, but
it's worth trying.

One important detail: only starting with NAMD 2.13 you can get the energy
of each wall directly, because walls are not parameters of a variable but
are fully fledged biases:

If you have a working script for the Tiwary method it'd be a good idea to
bundle it in the Colvars repository, where there is a "colvartools" folder: I'd recommend adding comment lines with
your email address at the top, so that people may contact you with
questions in the future. Jérôme can comment on whether it is appropriate
to call it from the Dashboard GUI.

Another option is putting it in the VMD script library: since the script would
rely on VMD ultimately.

Whichever way you prefer, can you clarify why you only counted the
restraint energy and not the metadynamics one?

*cv load old.state*
*set file [open "biasA.dat" w]*
*set numframe [molinfo top get numframes]*
*for {set f 0} { $f <= $numframe } {incr f} {*
*cv frame $f*
*cv update*
*set mtd [cv bias metadynamics1 energy]*
*set bb [cv bias harm1 energy]*
*puts $file "[expr $f*0.1] [expr $bb + $mtd]”*

On Fri, Apr 24, 2020 at 12:20 AM Pant, Shashank <> wrote:

> Hi Giacomo,
> Thanks a lot for your detailed mail. It was indeed helpful.
> I followed your first suggestion of using "cv bias <name> energy” to
> extract out the bias and it worked fine. Essentially, I did the following:
> *cv load old.state*
> *set file [open "biasA.dat" w]*
> *set numframe [molinfo top get numframes]*
> *for {set f 0} { $f <= $numframe } {incr f} {*
> *cv frame $f*
> *cv update*
> *set bb [cv bias harm1 energy]*
> *puts $file "[expr $f*0.1] $bb”*
> *}*
> Regarding your question on sum_hills, I dont think it consider any
> external bias or additional bias in the system. For ex. If we applied a
> wall along a particular order parameter then sum_hill doesn't consider it
> in the calculations. So, its better to do a reweighing of those wall biases
> as well.
> I was thinking may be we should incorporate the re-weighing protocol in
> COLVARS and/or Dashboard. It will be really useful for everyone.
> Thanks
> Shashank
> On Apr 23, 2020, at 7:00 PM, Giacomo Fiorin <>
> wrote:
> cv bias <name> energy

Giacomo Fiorin
Associate Professor of Research, Temple University, Philadelphia, PA
Research collaborator, National Institutes of Health, Bethesda, MD