Defining atom types and sw pair_coeff in LAMMPS

I am trying to run a hybrid simulation with a combination of tables and 3-body potentials. However, I was running into trouble implementing the sw potential (the code works fine without the sw-potential). Specifically, when I run the following code, I get “ERROR: Incorrect args for pair coefficients (src/pair_hybrid_overlay.cpp:77)”. My understanding is this is because I do not map the atom types (2, 3) to the atom labels (X, Y). Therefore, I added in the commented out line “labelmap atom 1 C 2 X 3 Y”. However, this throws the error “ERROR: Unknown command: labelmap atom 1 C 2 X 3 Y (src/input.cpp:279)”. From what I can tell from the documentation, I am using the labelmap command correctly, but this is clearly not the case. So how is labelmap supposed to work? Or is there something else I am missing?

# self interactions for type 2 ---------------------------------------------------------
variable	   eps2	string	table1.xvg
# 3-body interactions for type 2-3 -------------------------------------------------------------
variable	   sw_table	string	sw_table1.xvg
variable	   table_folder string  path_to_2body_tables/
variable	   sw_folder string  path_to_2body_swtables/
variable	   t	equal	1
variable	   dt	equal	1

units          real   # units of energy kcal/mol, distance angstrom and time if femtosecond
atom_style     full   # do not change
boundary       p p p  # periodic boundary conditions in x y z 

pair_style     hybrid/overlay sw table linear 3601

read_data      conf1.data  # contains the positions and masses and other information

# labelmap atom 1 C 2 X 3 Y

newton         on               # do not change

# interactions involving type 1---------------------------------------------------------
pair_coeff     1  1  table ${table_folder}table_11.xvg tab11 4.0 
pair_coeff     1  2  table ${table_folder}table_12.xvg tab12 4.0
pair_coeff     1  3  table ${table_folder}table_13.xvg tab13 4.0
# type 3 interactions ---------------------------------------------------------
pair_coeff     3  3  table ${table_folder}${eps2} tab33 4.0 
# type 2-3 interactions ---------------------------------------------------------
pair_coeff     2  3  sw ${sw_folder}${sw_table} X Y
Summary

This text will be hidden

labelmap is the wrong command. And your pair_coeff syntax is incorrect.

For any sw potential (that has not disabled the 3-body term) the pair_coeff assignment must start with * *. Always. Then you provide the potential file name and then to provide as many strings as you have atom types in your system to match the (numeric) LAMMPS atom types to the potential parameters with symbolic atom types in the potential file.

When using sw in a hybrid pair style two things change:

  1. The potential parameter assignment now starts with pair_coeff * * sw
  2. You can use a NULL mapping for atom types that are not supposed to be handled by sw

Thus the setting that you are using in your input is impossible. If you would have:

pair_coeff * * sw ${sw_folder}${sw_table} NULL X Y
this is covering the case of types 2-2, 2-3, and 3-3. In fact, these are also the eight 3-body terms to consider that you cannot explicitly enter, but that are computed anyway: 2-2-2, 2-2-3 , 2-3-2, 2-3-3, 3-2-2, 3-2-3, 3-3-2, 3-3-3

It is exactly because of the 3-body terms that you are not allow to do pairwise assignments of atom types in pair_coeff, but must use the * * form.

Thank you for your prompt response. I understand now, and updating that line fixed it.