[lammps-users] (no subject)

I wish to understand the mechanism (hybrid MD/MC technique) behind fix atom/swap. Can someone suggest me some reading sources to understand this.

I don’t have a reference for you but the idea of mixing MD + MC is pretty general. Note
that “hybrid” often refers to something different. Which is making an MC move, running MD

to relax the system, then accepting/rejecting the MC move based on the post-MD equilibrated energy.

That is not what any of the methods in the MC package, including atom/swap, are doing.

To understand the MC portion of fix atom/swap, I suggest a careful reading of the doc page.
Then looking at the source code if you have further Qs.


Dear Steve,

I am trying to apply MC+MD to a bimetallic system. I would like to swap a random pair of different atom types and run MD for a short time and accept/reject the move based on the relaxed energy of the configurations after the MD run. However, there is no straightforward way of doing this. Currently, I am trying to run MD and reset the time step to the previous value in case the move is not accepted.

Do you have any suggestions about the possible approaches one may adopt for hybrid MC+MD?

Thank you.

Best regards,

That is something LAMMPS could do, but no one has written code to do it, or at least contributed it.

One way to do it inside LAMMPS is to write a new command, e.g. hybrid/mc, which
does the MC move, saves the state of the system, runs MD of N steps, accepts/rejects
the move, and restores the state if rejected. Several of the commands in the REPLICA package
do more complicated things than that, which include saving/restoring state.

One way to do it outside LAMMPS is have an external program that does the MC part.
And have it use LAMMPS as a lib to run N steps of MD and return before/after energies.
The new MDI package in LAMMPS is one relatively easy way to couple 2 codes in that manner.


Consider using the library interface via Python scripting. You can generate a “snapshot” of your system using write_restart (once without, once with the modification), run the first for a bit, record (possibly averaged for reduced noise) energies, store them in a variable and write out another restart, use the clear command, read the initial restart of the modified system, run for a bit, record the same (averaged?) energies, write out a fourth restart, then decide which simulation to continue, use clear again and load the chosen restart and continue until you want to repeat the procedure. If you feel ambitious, you can use mpi4py to do this in parallel, i.e. you split the world communicator and run lammps each on a subset. write out and read restarts as before, but then run in parallel and then use the same restart to continue after the MC evaluation.

Thanks Steve and Axel. I will try these options.

Best regards,