Skip to content

Commit

Permalink
sort atom id in dumps of SNA descriptors
Browse files Browse the repository at this point in the history
By default, dump files of LAMMPs has an indeterminate order for atoms. To constrain the sequence of atom to be consistent with that of a structure, "dump_modify 1 sort id" should be added for LAMMPS input files. An alternative way is to also dump the atom ids into the dump files, so that the calculated atomic descriptors can be correctly allocated to atoms. 

In calculator templates of maml,  "dump_modify 1 sort id" is used consistently, and only the "SpectralNeighborAnalysis" misses this line of command. So in this commit, this dump_modify is added to "SpectralNeighborAnalysis".

Interestingly, for small cells, LAMMPS dumps the atoms with sorted id by default, while the ids are unsorted for large cells. This behavior is seemingly not described in LAMMPS documentation, and it is unclear where is the border for "large" and "small". This is why that our previous works on SNAP did not have problem, as the dumped atoms for the small training structures were likely sorted by default.
  • Loading branch information
JiQi535 authored Mar 28, 2022
1 parent 741b877 commit 6979a88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions maml/apps/pes/_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,13 @@ class SpectralNeighborAnalysis(LMPStaticCalculator):
"compute snad all snad/atom ",
"compute snav all snav/atom ",
"dump 1 all custom 1 dump.element element",
"dump_modify 1 sort id",
"dump 2 all custom 1 dump.sna c_sna[*]",
"dump_modify 2 sort id",
"dump 3 all custom 1 dump.snad c_snad[*]",
"dump_modify 3 sort id",
"dump 4 all custom 1 dump.snav c_snav[*]",
"dump_modify 4 sort id",
]

def __init__(self, rcutfac, twojmax, element_profile, quadratic=False, **kwargs):
Expand Down

0 comments on commit 6979a88

Please sign in to comment.