Incorrect args for pair coefficients of lj/cut

Hi all,

I am new to Lammps and I want to use hybrid pair potential to run Lammps simulation for NiPt nanoalloy supported on CeO2 surface. The system consists of 4 elements - type 1: Ni, type 2: Pt, type 3: Ce, type 4: O. Below are my input lines. I want to use eam/alloy to describe the interactions of the alloy, use a reaxff potential to describe CeO2, and use LJ potential to describe the metal-surface interactions.

pair_style hybrid eam/alloy reax/c NULL checkqeq no lj/cut 10.0
pair_coeff * * eam/alloy potentials/NiPt.set Ni Pt NULL NULL
pair_coeff * * reax/c potentials/reaxff_model_CeO2 NULL NULL Ce O
pair_coeff 1 3 lj/cut 2.30971133642 2.92215
pair_coeff 1 4 lj/cut 3.26207239472 1.69271
pair_coeff 2 3 lj/cut 2.84082878893 3.029055
pair_coeff 2 4 lj/cut 4.01218499661 1.799615

However, when I run the program, I always get the error of “ERROR: Incorrect args for pair coefficients (…/pair_lj_cut.cpp:449)”. It is clear that the problem is only related to the pair_coeff for lj/cut. I have been trying to figure this out for a week now but no matter I change the parameters or add cutoff, I still get the same error. I am really confused and genuinely want to know what is wrong about my scrpit. I appreciate any help.

Best,
Shuang

there is not enough information here to give any specific advice.
please provide:

  • the exact LAMMPS version and platform that you are running on
  • the exact command line you are using
  • the complete output to the console, including the error message
  • the complete input script

axel.

Hi Axel,

Thanks for your reply. I am from DTU and I am using our Python package ASE to run Lammps as a calculator. Therefore the input is a Python script. I want to say that the Python script works fine when I use only eam/alloy or reax/c, but when I add the lines related to lj/cut, it always gives me error. The Lammps version I am using is the newest 2Jun2020. I am running it on Linux (CentOS) system. The Python script is as below:

from ase.io import *
from ase.calculators.lammpslib import LAMMPSlib
from ase.optimize import BFGS

atoms = read(‘NiPt_CeO2_test.traj’)
model_dir = ‘/home/energy/shuha/project/3-NiPt_CeO2’

header=[‘units real’,
‘atom_style charge’,
‘atom_modify map array sort 0 0’]

Lorentz-Berthelot rules to calculate eps_ij=(eps_iieps_jj)*0.5, sigma_ij=0.5(sigma_ii+sigma_jj) and cutoff=4sigma_ij

cmds = [‘pair_style hybrid eam/alloy reax/c NULL checkqeq no lj/cut 10.0’,
‘pair_coeff * * eam/alloy {}/NiPt.set Ni Pt NULL NULL’.format(model_dir),
‘pair_coeff * * reax/c {}/reaxff_model_CeO2 NULL NULL Ce O’.format(model_dir),
‘pair_coeff 1 3 lj/cut 2.30971133642 2.92215’
‘pair_coeff 1 4 lj/cut 3.26207239472 1.69271’
‘pair_coeff 2 3 lj/cut 2.84082878893 3.029055’
‘pair_coeff 2 4 lj/cut 4.01218499661 1.799615’]

calc = LAMMPSlib(lmpcmds = cmds, lammps_header=header, atom_types={‘Ni’:1,‘Pt’:2,‘Ce’:3,‘O’:4}, keep_alive=True, log_file=‘test.log’)

atoms.set_calculator(calc)
opt = BFGS(atoms, trajectory = ‘relaxation_test.traj’, logfile=None)
opt.run(fmax=0.1)
e = atoms.get_potential_energy()
f = atoms.get_forces()
print(e)
print(f)

The error is given in the log file ‘test.log’ as below:

LAMMPS (2 Jun 2020)
using 1 OpenMP thread(s) per MPI task
units real
atom_style charge
atom_modify map array sort 0 0
boundary p p p
box tilt large
region cell prism 0 23.2638 0 20.147041788560426 0 27.0 -11.631899999999995 0.0 0.0 units box
create_box 4 cell
Created triclinic box = (0 0 0) to (23.2638 20.147 27) with tilt (-11.6319 0 0)
1 by 1 by 1 MPI processor grid
echo none
ERROR: Incorrect args for pair coefficients (…/pair_lj_cut.cpp:449)
Last command: pair_coeff 1 3 lj/cut 2.30971133642 2.92215pair_coeff 1 4 lj/cut 3.26207239472 1.69271pair_coeff 2 3 lj/cut 2.84082878893 3.029055pair_coeff 2 4 lj/cut 4.01218499661 1.799615

Best,

Shuang

the reason for the problem is not LAMMPS but poor python programming.

please note the missing commas in the code segment below:

[…]

cmds = [‘pair_style hybrid eam/alloy reax/c NULL checkqeq no lj/cut 10.0’,
‘pair_coeff * * eam/alloy {}/NiPt.set Ni Pt NULL NULL’.format(model_dir),
‘pair_coeff * * reax/c {}/reaxff_model_CeO2 NULL NULL Ce O’.format(model_dir),
‘pair_coeff 1 3 lj/cut 2.30971133642 2.92215’
‘pair_coeff 1 4 lj/cut 3.26207239472 1.69271’
‘pair_coeff 2 3 lj/cut 2.84082878893 3.029055’
‘pair_coeff 2 4 lj/cut 4.01218499661 1.799615’]

[…]

this is confirmed by the “last command” output of the error message, which prints all pair_coeff commands joined as a single command, which is clearly wrong.

ERROR: Incorrect args for pair coefficients (…/pair_lj_cut.cpp:449)
Last command: pair_coeff 1 3 lj/cut 2.30971133642 2.92215pair_coeff 1 4 lj/cut 3.26207239472 1.69271pair_coeff 2 3 lj/cut 2.84082878893 3.029055pair_coeff 2 4 lj/cut 4.01218499661 1.799615

you basically wasted a week by looking in the wrong place for the cause of the error (i.e. LAMMPS and not yourself) and not paying sufficient attention to what LAMMPS is telling you. the “last command:” info is really quite telling and that is why we have LAMMPS print it.

axel.

please also note, that EAM potentials are generally parameterized for metal units not real, so if you have not converted you parameter file accordingly, you will ge bogus results. also the use of ReaxFF without charge equilibration is questionable.

axel.

Hi Axel,

Thanks for you reply. I just fixed the stupid mistake and the Python script works just fine now. I have successfully converted the parameters of EAM potentials to real units. However, one thing that still puzzles me is the parameters (epsilon and sigma) for lj/cut. I use the universal LJ potential according to this reference https://openkim.org/files/MO_959249795837_003/LennardJones612_UniversalShifted.params , the parameter for different atom types is calculated by Lorentz-Berthelot mixing rules.

In this reference, it is noted that the epsilons are in the units of eV and sigmas are in the units of Angstrom. My thought is that since I use real units for my hybrid potential, I need to also convert the units of epsilon to kcal/mol so that it is consistent with EAM and ReaxFF. However, if I multiply the epsilons by 23.06, the values will be so big that the relaxation gives wrong result. I found that most of the epsilon values that people use with real units are below 1, but the epsilons in the reference are mostly larger than 1. I found this also very strange.

Best,

Shuang

Hi Axel,

Thanks for you reply. I just fixed the stupid mistake and the Python script works just fine now. I have successfully converted the parameters of EAM potentials to real units. However, one thing that still puzzles me is the parameters (epsilon and sigma) for lj/cut. I use the universal LJ potential according to this reference https://openkim.org/files/MO_959249795837_003/LennardJones612_UniversalShifted.params , the parameter for different atom types is calculated by Lorentz-Berthelot mixing rules.

You need to read the description of what those parameters were created for:

This model was automatically fit using Lorentz-Berthelot mixing rules. It reproduces the dimer equilibrium separation (covalent radii) and the bond dissociation energies. It has not been fitted to other physical properties and its ability to model structures other than dimers is unknown.

Thus this is a completely unsuitable parameterization.

axel.