Dear LAMMPS developers,
I have been working on obtaining neighbor lists for each atom in a 2D system using the example provided at 2.3.10. Neighbor list access — LAMMPS documentation. According to the documentation, the command tags = lmp.extract_atom('id') is used to store the atom IDs in the tags array, which range from 1 to N, where N represents the number of atoms in the specified system. In the for loop, the command idx, nlist = nl.get(i) reads the idx from 0 to N-1 within the Python loop. So, for any atom, if its ID is N, then its idx value in the loop is N-1.
I followed the same example to find the neighbor lists for each atom in my 2D system. I processed the data using the details of atom IDs and their corresponding idx values to identify neighbors belonging to specific atom types. Everything was working well with this approach, and I used these details successfully for further calculations. I was using LAMMPS version 3 Nov 2022 until recently when I updated to LAMMPS version 2 Aug 2023.
When I ran the same code with the latest version, the neighbor list changed. The sequential order of atoms given in the input structure was different when calculating the neighbor lists. Additionally, for some atoms, the condition “if the atom ID is N, then its idx value in the loop is N-1” was not satisfied. Consequently, I am unable to correctly identify the neighbors of each atom belonging to a specific atom type.
For example, in my system of 14 atoms, the sequential order of atom IDs changed to 1 2 3 4 5 9 14 6 7 8 10 11 12 13, instead of 1 2 3 4 5 6 7 8 9 10 11 12 13 14 when calculating the neighbor lists. However, their idx values in the loop remained as 0 1 2 3 4 5 6 7 8 9 10 11 12 13.
It appears that the example code provided at 2.3.10. Neighbor list access — LAMMPS documentation yields consistent neighbor lists when run in both versions of LAMMPS. However, the code I used to obtain neighbor lists with the ‘zero’ pair_style (and ‘rebo’ pair_style) produced different results.
I hope this explanation clarifies the issue. Please help me in understanding and resolving this problem.
Thank you in advance.