How to differentiate atoms of the same element in a supercell efficiently in Lammps data file?

Dear Lammps users:

I’m a theoretical physics graduate student who’s new to the Lammps software.
I want to reproduce the results of a paper(DOI:10.1103/PhysRevB.109.054103) which utilized Lammps for hysteresis simulation of a spin crossover material.

The method used in the article is to perform molecular dynamics simulation on the 101010 [Fe(pyrazine)] [Ni(CN)4] supercell. This method requires assigning force field constants to the two-body bond potential, three-body angle potential, four-body dihedral angle potential etc, but the force constants required for the potentials composed of the same atomic composition are different. For example(see the screenshot: https://imgur.com/a/4fBYjoy), the two-body bond potential force constant of C and N in pyrazine is 780, while the two-body bond potential force constant of C and N between Fe and Ni atoms is 2512; in order to set the two force constants separately in the Lammps execution file, the two C-N bonds must be distinguished. According to the information I have collected so far, this seems to be achieved by distinguishing the C and N atoms in pyrazine from the C and N atoms in [Ni(CN)4], such as dividing the C and N atoms into two types C1 and C2, N1 and N2.

To achieve this goal, I first downloaded a CIF file of type [Fe(pyrazine)] [Ni(CN)4] from the online crystal database Crystallography Open Database (Crystallography Open Database: Information card for entry 4320033) and CCDC (Search Results - Access Structures). The molecular formula of the downloaded file is [Fe(pyrazine)] [Pt(CN)4].2H2O. Using Ovito to view it, I found that the CIF file distinguished C and N atoms as C1, C2 and N1, N2. I used Ovito to export the Lammps data file from the original CIF file. The data file also distinguishes the C and N atoms as C1,C2 and N1, N2; however, in order to delete the redundant O and C atoms in the original CIF file (there are 8 C atoms at the pyrazine position to meet the symmetry requirement, but there are only 4 in the actual molecule), replace Pt with Ni atoms and construct a 101010 supercell of [Fe(pyrazine)] [Ni(CN)4], I modified the CIF file in Materials studio, then converted the modified file into a new CIF file, finally imported it into Ovito. But the problem is that at this time, I found in Ovito that the modified CIF file no longer distinguishes C and N atoms, and the Lammps data file exported from the modified CIF file using Ovito does not distinguish C and N atoms either. I would like to ask how can I obtain the Lammps data file that distinguishes C and N atoms etc?

Thank you!

Try doing this:

  1. Determine the number of extra atom types you need to have.
  2. Load your LAMMPS data file, using the appropriate keywords to reserve space for extra atom types (check documentation).
  3. Create a Boolean variable that will select your desired atom group. For example, variable newN atom (type==8)&&(z>0) is 1 for all atoms of type 8 with x-coordinate larger than zero.
  4. Create a group using that variable, for example group newN variable newN.
  5. Set all atoms in that group to the new type: set group newN type 15.
  6. Use write_data to save the modified configuration as a new data file.

This allows you to set the types of a specifiable group of atoms. The new LAMMPS labelmap features should allow you to automatically reassign bond, angle and dihedral parameters as well, but I do not have personal experience with that.

1 Like

Thanks for your advice, and I would like to ask one follow-up question.
Are all the operations mentioned above all conducted by lammps commands? Or do I need to use some other programming languages as well, e.g. python?

Yes, they are.

If you still need to change the structure with a graphical editor, I suggest using GDIS to manipulate the CIF file. First, remove any symmetry group:


and remove any duplicate atoms by clicking and delete.
Then export the structure as a PDB to maintain the original atom label. You can can also access the atom labels from the Model: Editing tab of GDIS.

2 Likes

Step 1 is most certainly pen and paper (or however you choose to record your thoughts).

Step 2 involves adding keywords to the read_data command.

For Steps 3 and onwards the LAMMPS commands are given in the sample code snippets.

You will have to look up troubleshooting details in the documentation yourself. Of course, you can ask specific questions if you get stuck (but if they are answers you could have found yourself, vs waiting for someone on the Internet to randomly answer, then you will have lost yourself some time waiting). :slight_smile:

1 Like