[lammps-users] Mix pair coefficients automatically when using Hybrid force field

Dear Lammps users,

I wonder if it is possible to mix the pair coefficients automatically when using the hybrid force field. For example, when I use the buck/coul/long force field and lj/cut/coul/long, it gives an error as ““All pair coeffs are not set””.

Also, is it possible to explicitly assign the A and B for lennard-jones potential in lammps?

Regards,
Michael

Dear Lammps users,

I wonder if it is possible to mix the pair coefficients automatically when using the hybrid force field. For example, when I use the buck/coul/long force field and lj/cut/coul/long, it gives an error as ““All pair coeffs are not set””.

the rules for when mixing is possible and when not are explained in documentation of the hybrid pair style. this can be subtle, so please read it very carefully and pay attention to the differences between pair style hybrid and pair style hybrid/overlay.

Also, is it possible to explicitly assign the A and B for lennard-jones potential in lammps?

what you can assign for the regular lj/cut pair style (epsilon and sigma) is documented in the manual. all usable features are documented. that means if what you look for is not there, you cannot do it (directly). the only pair lennard-jones-like pair style that allows entering A and B is called lennard/mdf. of course, for pairwise additive potentials, you can always use pair style table…

axel.

Axel.

Please always report which LAMMPS version you are using and provide the input file.

Axel

Please use a portable compression file format like .tar.gz or .zip.
If you want help, you have to make it easy to help you. LAMMPS developers work almost exclusively on Linux. In my case it would be extremely tedious to have to boot into a windows machine only to extract files from an archive. I boot into windows only once every few weeks and usually the machine then comes to a crawl while the windows update runs in the background.

Thanks for your cooperation,
Axel

Dear Axel,

Many thanks for your email.
I read in the manual that “For atom type pairs I,J and I != J, if the sub-style assigned to I,I and J,J is the same, and if the sub-style allows for mixing, then the coefficients for I,J can be mixed. This means you do not have to specify a pair_coeff command for I,J since the I,J type pair will be assigned automatically to the sub-style defined for both I,I and J,J and its coefficients generated by the mixing rule used by that sub-style. For the hybrid/overlay style, there is an additional requirement that both the I,I and J,J pairs are assigned to a single sub-style. See the “pair_modify” command for details of mixing rules. See the See the doc page for the sub-style to see if allows for mixing.”.

I used the hybrid command. However, it does not work for the automatic mixing. Could you please give some advice?

Regards,
Michael

Dear Axel,

I am using the lammps-3Mar20 version. Please check the attached file for the input files. I prepared it with a third party software (moltemplate). The “system.in” is the .in file.

I also read your previous advice in this link (https://lammps.sandia.gov/threads/msg83028.html). It was recommended to illustrate the mixing explictly.

Thanks,
Michael

inputfiles.7z (235 KB)

well, this is a very confusing input. your are changing styles many times in quick succession without really using them.
this is chaos and not a good way to do science. so the first step is that you need to clean this mess up and trim it down to what is supposed to be used.

it looks the final pair style setting is:
pair_style hybrid buck/coul/long 6 12.0 lj/charmm/coul/long 9 12 12

and the corresponding pair_coeff settings are (i have reordered them for easier reading):

system.in.settings: pair_coeff 1 1 buck/coul/long 141717.5705 0.271511 0
system.in.settings: pair_coeff 1 2 buck/coul/long 2760000000 0.120000 0

system.in.settings: pair_coeff 1 3 buck/coul/long 141717.5705 0.271511 0
system.in.settings: pair_coeff 2 2 buck/coul/long 141717.5705 0.271511 0
system.in.settings: pair_coeff 3 3 buck/coul/long 1468324.577 0.198913 641.677184
system.in.settings: pair_coeff 3 4 buck/coul/long 288292.468059 0.215172 278.075175
system.in.settings: pair_coeff 3 5 buck/coul/long 9115.382011 0.230006 0

system.in.settings: pair_coeff 1 4 lj/charmm/coul/long 0.023 3.25

system.in.settings: pair_coeff 4 4 lj/charmm/coul/long 0.1553 3.166
system.in.settings: pair_coeff 5 5 lj/charmm/coul/long 0.0 2.058
system.in.settings: pair_coeff 6 6 lj/charmm/coul/long 0.066 3.5
system.in.settings: pair_coeff 7 7 lj/charmm/coul/long 0.066 3.5
system.in.settings: pair_coeff 8 8 lj/charmm/coul/long 0.03 2.5
system.in.settings: pair_coeff 9 9 lj/charmm/coul/long 0.105 3.75
system.in.settings: pair_coeff 10 10 lj/charmm/coul/long 0.21 2.96
system.in.settings: pair_coeff 11 11 lj/charmm/coul/long 0.17 3.0
system.in.settings: pair_coeff 12 12 lj/charmm/coul/long 0.0 0.0
system.in.settings: pair_coeff 13 13 lj/charmm/coul/long 0.71 4.02
system.in.settings: pair_coeff 14 14 lj/charmm/coul/long 0.0005 4.07
system.in.settings: pair_coeff 15 15 lj/charmm/coul/long 0.449657 2.412031
system.in.settings: pair_coeff 16 16 lj/charmm/coul/long 0.17 3.25
system.in.settings: pair_coeff 17 17 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 18 18 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 19 19 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 20 20 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 21 21 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 22 22 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 23 23 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 24 24 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 25 25 lj/charmm/coul/long 0.07 3.55
system.in.settings: pair_coeff 26 26 lj/charmm/coul/long 0.03 2.42
system.in.settings: pair_coeff 27 27 lj/charmm/coul/long 0.03 2.42
system.in.settings: pair_coeff 28 28 lj/charmm/coul/long 0.03 2.42
system.in.settings: pair_coeff 29 29 lj/charmm/coul/long 0.03 2.42
system.in.settings: pair_coeff 30 30 lj/charmm/coul/long 0.03 2.42
system.in.settings: pair_coeff 31 31 lj/charmm/coul/long 0.03 2.42
system.in.settings: pair_coeff 32 32 lj/charmm/coul/long 0.03 2.42
system.in.settings: pair_coeff 33 33 lj/charmm/coul/long 0.0559 2.8
system.in.settings: pair_coeff 34 34 lj/charmm/coul/long 0.1597 3.028

this is definitely incomplete. while you can have mixing between types that have the same substyle, there are many combinations missing.
i.e. while you can have mixing between 434 and 434, there is no pair style defined for 13 with 434 with the exception of the pairs 1 4, 3 4 and 3 5.
there is no mixing possible between different pair styles, so you have to explicitly specify those interactions (and parameterize them, if there are parameters missing).
also, it is not at all straight forward to determine what type of potential function should be used for those. on top of that, there is no mixing for any buckingham potential (the documentation for those pair styles explicitly says that, so you are already missing the combination 2 3 in between the buckingham interactions.

in short, LAMMPS quite rightfully so tells you that you are missing interactions, and quite a few of them. there is no “magical way” to make those suddenly appear.
in addition you have the problem of having inconsistent interactions due to using a hybrid pair style, and then you have some “stray” settings that don’t even match with the general setup.

bottom line, this is confusing and in dire need for cleaning up, and even more importantly you need a long chat with somebody that can explain the physics of your model and teach you how to properly use parameterizations and to properly test them. this is far beyond the scope of the mailing list. the fact that tools exist that allow you to “glue” parameters and settings and style together does not mean that they produce meaningful inputs.

Axel.

Thanks a lot, Axel. I’ll try to cleanup the files and sort out the problem. Really appreciate your help on the weekend.

Kind Regards,
Yongqiang

I also strongly suggest to begin with a smaller/simpler system with fewer atom types. just to gain practice. and do some more research on finding a set of parameters that is suitable for the entire system so you won’t have to mix and match different potential functions with pair style hybrid (never a good choice, just sometimes there are no better alternatives).

having a cleaned up and consistent input deck and a smaller problem will make it much easier to manually verify whether your input is correct.
for this one it was very easy to tell that it was not correct once you ignore all the needless and pointless parts and reorder the coefficient settings.
you are making your own life needlessly more complicated.

axel.

Thank you very much, Axel. I found some force fields using Lennard jones potential instead of Buckingham potential.
However, they have C6 as a value of 0 or negative ones. They got these values during fitting parameters with gromacs. It makes it difficult to get the epsilon and sigma and use it in the lammps. I should try the pair stable or other functions to use the A and B directly instead of hybrid force field.

Regards,
Michael