Running LAMMPS as a client code to perform Grand Canonical Monte Carlo moves and VASP as a server code

Hello,

I am looking to use LAMMPS as a client code to perform grand canonical Monte Carlo (GCMC), and VASP as a server code to calculate the energies of each GCMC trial configuration.

In essence, I want LAMMPS to generate the trial configuration by adding/deleting atoms, send the configuration to VASP to calculate the energy using first principles, and VASP then sends the energy back to LAMMPS, which will accept/reject the trial configuration.

Is this possible?

From the documentation, I see that there is a lammps_vasp example in which LAMMPS is the client code that performs MD timestepping. It uses the fix client/md command. But I find no source files that use LAMMPS as a client code with the mc protocol. So I was wondering if I need to define a new fix client/mc command in the src/MESSAGE directory?

Thank you!

Regards,

Vrindaa

Hello,

I am looking to use LAMMPS as a client code to perform grand canonical Monte Carlo (GCMC), and VASP as a server code to calculate the energies of each GCMC trial configuration.

In essence, I want LAMMPS to generate the trial configuration by adding/deleting atoms, send the configuration to VASP to calculate the energy using first principles, and VASP then sends the energy back to LAMMPS, which will accept/reject the trial configuration.

Is this possible?

Not as such and not without significant programming.

There is no client/server integration of fix gcmc, so you would have to implement your own variant of it using the client-server protocol version of it and you would have to write a corresponding wrapper around VASP (or modify VASP accordingly) to communicate the changes and thus create a new input for running a suitable single point calculation from which you can retrieve the energy.

Axel.

There is an example provided of using LAMMPS as a server code with a (simple) MC code as the client.
To use LAMMPS as the client, and VASP as the server for MC (as opposed to MD) then as Axel said,
you need to define the protocol (already explained in your email) and right client-side (in LAMMPS).
For the server side, you could re-use most (if not all) of the VASP server wrapper provided (for MD).
Since you are just passing a config and want the energy back (ignore forces), same as the MD client/server
case is doing.

If you get this to work, please contribute it to the LAMMPS distro. It would be a nice example to add.

Steve

Dear Steve and Axel,

Thank you for your helpful advice! I just wanted to drop in a quick note that I am working on it, and am using the developer manual and the fix_client_md files and the examples to understand how to go about it. I will let you know once I get it to work and am done testing it!

Thank you again!

Regards,

Vrindaa