Skip to content

Resolve issues related to WangLandauEnsemble (#488 and #489)

Description

This MR fixes two bugs related to the WangLandauEnsemble:

  1. Issue #488 (closed): When restarting a converged WL simulation, without changing input parameters, the simulation runs even though the preset fill_factor_limit has already been reached.
  2. Issue #489 (closed): When running consequtive binned WL simulations while only changing properties that are not included among the ensemble parameters, the data containers are not updated as expected.

Comments

In order to fix problem 2, the self._reached_energy_window is now set after the _restart_ensemble function has been called and is, furthermore, determined by checking if self._potential falls inside the energy window. Earlier, self._reached_energy_window was set to False if energy_limit_left or energy_limit_right had been provided. Consequently, a number of initial trial steps were always performed, which were removed from the data container once the energy window had been reached. This is no longer the case since the value of self._reached_energy_window, after initiating the ensemble, may be True, even though the user has specified energy_limit_left and/or energy_limit_right. If this behaviour is undesired, another solution would be to set the self._reached_energy_window in the _restart_ensemble function.

Summary of changes

  • self._converged is initialised before calling super().__init__.
  • self._converged is set to (self._fill_factor <= self._fill_factor_limit) in _restart_ensemble.
  • A run function has been defined that, in turn, only calls super().run if self.converged is False. Otherwise a warning is logged.
  • self._reached_energy_window is initialised after super().__init__ has been called and is set to self._inside_energy_window(self._get_bin_index(self._potential)) instead of self._bin_left is None and self._bin_right is None.

Additional information

This merge request fixes the problems described in issues #488 (closed) and #489 (closed), which can, therefore, be closed once this MR has been resolved.

Closes #488 (closed) #489 (closed)

Edited by Paul Erhart

Merge request reports