[lammps-users] Monte Carlo on LAMMPS

Dear Steve and users

I was wondering how suitable could be LAMMPS for the integration (implementation) of Monte Carlo steps? I believe that the microcanonical (NVE), canonical (NVT) and isobaric-isothermal (NPT) ensembles should not be difficult to implement, but I am not sure about grand-canonical (u,V,T) since the number of particles fluctuates.

Can you please comment how would one could implement Monte Carlo steps, if possible? How would you handle the neighbor lists recreation? and the insertion and removal of particles? I have already experience implementing different fixes as presented in the LAMMPS documentation.

Thank you in advance, Javier

Hi, Javier.

It’s not hard to implement Monte Carlo in LAMMPS. Fix bond/swap, for example, already does this. There are of course issues like the ones you describe with changing the numbers of particles. My own experience is that one of the more limiting factors is that Monte Carlo is (very, and rather generally) hard to parallelize. For a general method, one has to:

  1. Pause the MD run

  2. Gather the necessary atomic information onto the processor(s) which do the MC.

  3. Do the MC “moves”

  4. Distribute the new information back to all processors.

  5. Resume the MD run.

I think the above 5 steps would be necessary for GCMC. So, if the MC is not parallel and you do the MC moves every f MD timesteps, this reduces parallel efficiency by O(1/f).

You may have ways around that, but just thought I’d put in my two cents.

Best,
Rob

Dear Steve and users

I was wondering how suitable could be LAMMPS for the integration
(implementation) of Monte Carlo steps? I believe that the microcanonical

to do "proper" monte carlo, or just occasionally in between regular MD?

(NVE), canonical (NVT) and isobaric-isothermal (NPT) ensembles should not be
difficult to implement, but I am not sure about grand-canonical (u,V,T)
since the number of particles fluctuates.

LAMMPS _can_ handle a varying number of particles. see fix deposit,
but it gets very tricky if you want to add molecules with
bonds/angles/dihedrals.

Can you please comment how would one could implement Monte Carlo steps, if

monte carlo steps move particles, so they should be implemented
as a "fix". see the documentation about adding new modules to lammps.

possible? How would you handle the neighbor lists recreation? and the

for MC moves, it is not different from is needed for fix nve/npt/nvt/nph.

insertion and removal of particles? I have already experience implementing
different fixes as presented in the LAMMPS documentation.

the biggest problem is that for each MC step you'd have to re-compute
the total energy (i.e. trigger the force calculation) this has to be done in
parallel and requires communication, and that raises the level of communication
significantly from "once per moving all atoms" to "once per moving one atom".

thus it is generally considered more efficient to run MC only in
serial, and then
run it in an embarrassingly parallel way (i.e. created n decorrelated initial
configurations and then run an MC trajectory for each of them).

cheers,
    axel.