[gmx-developers] doing energy evaluations at alternate lambda values (i.e. for bennett acceptance ratio)

Mark Abraham Mark.Abraham at anu.edu.au
Thu Jan 4 02:28:00 CET 2007

David Mobley wrote:
> Dear all,
> We're attempting to modify mdrun to be able to write out the system
> total potential energy evaluated at a number of alternate lambda
> values during a free energy calculation, when energies are written to
> output. (The goal is to use this output for doing free energy
> calculations with Bennett Acceptance Ratio or other methods which
> require potential energies evaluated at a variety of alternate lambda
> values).
> I'm assuming this would be a straightforward (perhaps 20 minutes?)
> task for anyone who already knows the inner workings of the code, but
> since I'm not that familiar with it, it seems a bit more difficult for
> me. Is there anyone who wants to volunteer?
> If not, can anyone help by telling me the complete set of function
> calls that need to be done in the inner loop of do_md(), in order to
> safely:
> 1) Change the current lambda value to some other lambda'
> 2) Compute the new total energy
> 3) Restore lambda to its original value so the simulation can continue.

My feeling is that you should be able to take the call do do_force in 
do_md and loop over lambda values there. I followed down a few levels of 
functions (until my interest ran out) and I didn't see anything that 
ought to break .From having played with the assembly innerloop code, I 
can say that the lambda-interpolation is going on at that level , so I 
don't think you have any worries with breaking some data structure 
through toying with lambda at the do_md level.

Assuming you can do zero-step energy "singlepoints" on a given 
configuration at various lambda values to get data to check against, 
then at the call to do_force, write a simple for loop over whatever 
range of lambda you want to use, get the potential energy at each 
iterate and write it somewhere for comparison. That's a simple test to 
see if the method works.


More information about the gromacs.org_gmx-developers mailing list