About useing pair_style dispersion/d3 command

When I tried to use pair_style dispersion/d3 to combine my machine learning potential for molecular dynamics simulations, I wrote the following line for the pair style:
pair_style hybrid/overlay nep nep nep nep nep dispersion/d3 zero pbe 12.0 6.0 , where “nep” is an external package for a machine learning potential that has been compiled into LAMMPS via NEP_CPU(GitHub - brucefan1983/NEP_CPU: CPU version of NEP) . However, I encountered an error during runtime:
ERROR: Pair_style dispersion/d3 needs 4 arguments (…/pair_dispersion_d3.cpp:133) .
The error indicates that the dispersion/d3 style requires 4 arguments, but I did provide four parameters (zero pbe 12.0 6.0 ) after dispersion/d3 . I would like to request assistance in resolving this issue.

This is due to an unfortunate choice of the authors of the dispersion/d3 pair style.
When using any hybrid pair styles, the arguments are “partitioned” into entries for the individual pair styles by scanning the command for names of valid pair styles. As it happens “zero” is a vaild pair style name and thus pair style hybrid will assign no arguments to the dispersion/d3 sub-style and assume that there also is a zero sub-style with three arguments.

Please submit a proper bug report at GitHub · Where software is built so we can discuss with the authors how to address this. If you choose a different damping scheme (zerom, bj, or bjm) the error should go away.

[Update]
After looking at the source code of the pair style, another workaround would be to use the keyword “ZERO” instead of “zero”.

Thank you very much, when I use ZERO or other damping functions (zerom, bj) the program works fine!

I have drafted a pull request that renames the keyword zero to original and also address a few other issues with the pair style: Address several issues with pair style dispersion/d3 by akohlmey · Pull Request #4485 · lammps/lammps · GitHub
I am now waiting for feedback from the original authors of the pair style.

1 Like