In DFT, we group atoms according to chemical species in the input files. For example if the structure has 2 Ni atoms and 2 Fe atoms in pyiron in the order of Ni, Fe, Ni, Fe, we sort the atoms by the alphabetical order of the chemical symbols, meaning in this example the order should be 2, 0, 3, 1 (first Fe, and then Ni). I realized that by simply applying np.argsort, the order within the same chemical symbol is not uniquely defined, meaning in the example here, we might end up with 3, 1, 2, 0 or any other permutation. This fix forces the ordering within the same chemical symbol by applying a small ramp on the enumeration.
In DFT, we group atoms according to chemical species in the input files. For example if the structure has 2 Ni atoms and 2 Fe atoms in pyiron in the order of Ni, Fe, Ni, Fe, we sort the atoms by the alphabetical order of the chemical symbols, meaning in this example the order should be 2, 0, 3, 1 (first Fe, and then Ni). I realized that by simply applying
np.argsort
, the order within the same chemical symbol is not uniquely defined, meaning in the example here, we might end up with 3, 1, 2, 0 or any other permutation. This fix forces the ordering within the same chemical symbol by applying a small ramp on the enumeration.