[lammps-users] Ask help for nesting two runs, inner one is as fast as electron, outer one is classical md

Dear Lammps Friends,

Now I am thinking about how to nest two simulation runs, the inner one is for the light oscillator using the PIMD, which is expected to be as fast as electrons in the ab-initio MD, and the outer run is the ordinary MD simulation. In other words I want to nest PIMD run inside MD run.
So I would like to know if the functionality already exists? Or Is it a good idea to do this is Lammps? Will it be parallel?
If anyone is interested in this idea, please contact me and then we can have more discussion.
Any suggestion would be appreciated.

Best regards,

Hi Yu,

This is an interesting question. I have not heard of anyone doing this before. The good news is, I think it should be possible to do this without too much effort. In fact, there are probably multiple ways to do it, each with pro’s and con’s. If the dominant computational cost is the PIMD calculation that provides the force calculation to the outer LAMMPS model, then you could set it up using pair_style python, see examples/python. The python force calculation would just be a wrapper on a call to a LAMMPS executable that would invoke PIMD.

Regardless which method is used, I recommend testing it first for correctness on a simple example, similar to in.pair_python_melt.


One additional comment. The biggest technical problem is preventing the two instances of LAMMPS from stepping on each other. In general, LAMMPS is thread-safe, so this should not happen. However, for things like PIMD, it might still happen. So a good strategy would be to build the outer LAMMPS with PYTHON package installed and the REPLICA package not installed, and the inner LAMMPS would be built opposite to that.