pair_style hybrid/overlay

Hello,

I want to use lammps to combine two potentials with parameter tuned by a predetermined parameter. As an example, I want to use tersoff and sw potential for silicon at the same time for the same group. Every step, the forces on the atoms in the group is computed independently for both potential. For every atom, a parameter which range from 0-1 is given. If the parameter for an atom is 1, the force calculated by sw potential is used. If the parameter is 0, the force calculated by tersoff potential is used. Between 0 and 1, a linear interpolation would be used for the two forces calculated by the two potentials. It seems that to implement this strategy, I have to write my own “hybrid/overlay” file. Is there any way that I can use the existing command to implement strategy? Thanks very much for your help.

Best!

Hao

Yes, you would have to write a new pair_hybrid style (or a fix style) to do that. You would not be able to use existing commands to to that. In your new style, you also need to define per-atom “predetermined parameter”.

Ray

Hello,

       I want to use lammps to combine two potentials with parameter tuned
by a predetermined parameter. As an example, I want to use tersoff and sw
potential for silicon at the same time for the same group. Every step, the
forces on the atoms in the group is computed independently for both
potential. For every atom, a parameter which range from 0-1 is given. If the
parameter for an atom is 1, the force calculated by sw potential is used. If
the parameter is 0, the force calculated by tersoff potential is used.
Between 0 and 1, a linear interpolation would be used for the two forces
calculated by the two potentials. It seems that to implement this strategy,
I have to write my own "hybrid/overlay" file.

Is there any way that I can use the existing command to implement strategy?

no. you need to make quite some significant modifications, as
individual sub-styles tally their forces directly into the per-atom
force arrays.
so basically, you need to have a holding space for accumulating the
scaled forces that you want to collect. then, after processing each
sub-style, you need to clear out the regular force array and after all
forces are accumulated, you need to copy the accumulated force into
the regular force array.

if you care about performance, you can try an alternate approach,
where you set up a multi-replica simulation, where you run a replica
for each configuration and then combine the forces between them with
the scaling factors applied with inter-replica communication and also
synchronize the positions during time integration similarly.

axel.

Thanks, Ray and Axel. I understand that the method you suggested. I would like to start with the first strategy. So I should write two files to implement this and at the final step to copy the force calculated in this file to the regular force array? Is that the way to do this?

Thanks, Ray and Axel. I understand that the method you suggested. I would
like to start with the first strategy. So I should write two files to

files??? that would be insanely inefficient!

implement this and at the final step to copy the force calculated in this
file to the regular force array? Is that the way to do this?

i already outlined the steps in my previous e-mail. you may have to
read some more LAMMPS source code and familiarize yourself with how
things are done to make more sense of it. but there really isn't more
to say without doing the complete implementation myself.

axel.