diff --git a/aiida_kkr/tools/jij_tools.py b/aiida_kkr/tools/jij_tools.py index 8183a4fb..02c7642c 100644 --- a/aiida_kkr/tools/jij_tools.py +++ b/aiida_kkr/tools/jij_tools.py @@ -334,6 +334,11 @@ def parse_jij_calc_data( jijs_shells_x, jijs_shells_y, jijs_shells_z, shells, cell, get_sites(structure), alat, verbose=verbose ) + # sort arrays + isort = np.lexsort(jijs_expanded[:, :5][:, ::-1].transpose()) + jijs_expanded = jijs_expanded[isort] + positions_expanded = positions_expanded[isort] + # create an auxiliary structure that contains only the sites which are used in the Jij step # (i.e. we drop all sites where we don't have couplings) struc_jij_sites, mappings_back, mu_s = get_jij_structure(structure, jijs_expanded, jij_calc) diff --git a/tests/workflows/test_jij_wc/test_jij.npz b/tests/workflows/test_jij_wc/test_jij.npz index a526dac9..c868a693 100644 Binary files a/tests/workflows/test_jij_wc/test_jij.npz and b/tests/workflows/test_jij_wc/test_jij.npz differ diff --git a/tests/workflows/test_jij_wc/test_jij_soc.npz b/tests/workflows/test_jij_wc/test_jij_soc.npz index 6a84528c..cf4ad51c 100644 Binary files a/tests/workflows/test_jij_wc/test_jij_soc.npz and b/tests/workflows/test_jij_wc/test_jij_soc.npz differ