Skip to content

Commit

Permalink
Sort Jij output arrays and adapt test
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed Nov 10, 2023
1 parent 708d7c5 commit 2e705df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aiida_kkr/tools/jij_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file modified tests/workflows/test_jij_wc/test_jij.npz
Binary file not shown.
Binary file modified tests/workflows/test_jij_wc/test_jij_soc.npz
Binary file not shown.

0 comments on commit 2e705df

Please sign in to comment.