lammps / lammps

Public development project of the LAMMPS MD software package
https://www.lammps.org
GNU General Public License v2.0
2.23k stars 1.71k forks source link

[Feature Request] hybrid monte carlo #565

Open EfremBraun opened 7 years ago

EfremBraun commented 7 years ago

I'd like to submit a feature request for Hybrid Monte Carlo (HMC) simulations. At present, one can do mixed MD/MC using a combination of 'fix gcmc' and a time integration fix. However, there's no way to accept/reject the MD moves that take place between the steps when 'fix gcmc' is invoked. I believe that such accept/reject rules are formally necessary to provide detailed balance for proper sampling. (Velocity re-randomization is also necessary, but this can be currently implemented by the user looping between 'velocity create' and 'run' commands.)

I'm not sure of the best implementation for this feature. I think it'd probably be best to add a keyword to 'fix gcmc' to do this, and then LAMMPS would save the state at the end of the Monte Carlo moves and compare it to the energy of the state when the Monte Carlo moves next begin.

I might be able to implement this myself, but I wanted to check first to see if this feature is already being developed and to see what else the developers or other users thought about this.

ajsilveira commented 7 years ago

In 2014 we implemented HMC in Lammps, whose latest version is available at https://github.com/atoms-ufrj/fix_hmc. It used to work with both rigid bodies and for flexible molecules. The reason for including both types of moves stems from the fact that HMC is highly inefficient for flexible molecules: "stiff" intramolecular interactions restrict the time step severely in order to achieve satisfactory acceptance rates. Sampling flexible molecules would involve two types of HMC moves: (1) rigid body moves (translation and rotation) with a bigger time step size (2) turn on the intramolecular interactions and employ a smaller time step size.

That fix_hmc won't work with latests versions of Lammps given that the images of atoms belonging to rigid bodies were treated differently. The required modifications to make fix_hmc compatible with newer version, however, are not difficult to make. Also, I haven't followed all the changes in Lammps since then, so I'm not sure whether other issues will appear or not.

We are also interested in releasing HMC in Lammps, so maybe we could do some complementary work on that.

Thanks,

Ana

akohlmey commented 7 years ago

@EfremBraun, @anasilveira any updates on this? FYI, if you want the LAMMPS developers to review your work before it is completed (and thus potentially avoid time consuming rewrites of segments that might conflict with the overall programming style or strategies), you can always submit a pull request before it is ready to merge. Just flag it as such with the "work_in_progress" label.

EfremBraun commented 7 years ago

@ajsilveira made good progress, but I've been slow on my promised review of her work, not having gotten back to her for 2 months (probably because I realized a better method than HMC for what I wanted to do, so it's been hard to generate as much interest in implementing a method I won't immediately need).

@ajsilveira, it sounds like a good idea to make the pull request with the work_in_progress label. Maybe another developer would be interested in reviewing the work faster than I can promise I'll do it in.

ajsilveira commented 7 years ago

@akohlmey right now I'm finishing my thesis, but I will be able to resume on this project in a few weeks. Thank you.