Bug advisory and workaround: alchemical FEP with IDWS can give wrong comparison energies

From: Jérôme Hénin (jerome.henin_at_ibpc.fr)
Date: Fri Nov 05 2021 - 11:12:18 CDT

Hi all,

Please be aware of a bug in current NAMD versions that can affect alchemical free energies computed using IDWS-style alchemical perturbations. Below I give workarounds to get correct free energy values from existing data affected by the issue, and to make any new simulation exempt from the issue.

Affected versions of NAMD:
2.14, 3.x (non-CUDA version), and development versions until now.

Condition triggering the issue:
The issue occurs if multiple time-step is used and alchOutFreq is greater than, but not a multiple of, fullElectFreq.
Unfortunately, the current default value of alchOutFreq (5) is likely to fulfill this condition.

Symptoms:
In this situation, some of the energy differences are computed erroneously - specifically, dE values computed at time steps that are not multiples of the outer time step include long-range dE values for the wrong target lambda.
More generally, even without IDWS, alchOutFreq should probably always be a multiple of fullElectFreq to ensure that comparison energies are as accurate as possible, and do not include stale long-range terms.

Fix and workaround:
For future simulations: define alchOutFreq as either 1 or a multiple of fullElectFreq.
For existing simulations: re-analyze, discarding any data point from the fepout file where the time step number is not a multiple of fullElectFreq.

Diagnosis:
In doubt, the issue can be diagnosed for a specific dataset by histogramming forward and backward values of the electrostatic dE for an individual IDWS window. The bug will result in a characteristic bimodal distribution.

I will submit a code patch very soon to fix this in a final way. In the meantime, please circulate the information to users who might be affected.
Thanks to Ezry St. Iago-McRae (Brannigan lab, Rutgers Camden) for reporting the issue.

Jérôme

This archive was generated by hypermail 2.1.6 : Fri Dec 31 2021 - 23:17:12 CST