Skip to content

Commit

Permalink
SOF-7136: equality test for atom and orbital using lookup table shoul…
Browse files Browse the repository at this point in the history
…d be other way around
  • Loading branch information
pranabdas committed Dec 24, 2023
1 parent 31249d5 commit 3c58a2d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions express/parsers/apps/espresso/formats/txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,9 @@ def parse_hubbard_v(self) -> Dict[str, list]:

hp_data = re.findall(r"^{0}".format(RE_HP_DATA), hp_block, re.MULTILINE)

# get orbitalName from atomicSpecies (new_label), find it from Hubbard U parser
# get orbitalName from atomicSpecies (new_label), find it from Hubbard U
# parser. In Hubbard V block, the new atom labels are used, given by
# hp.x calculation instead of input atomic species labels
u_dict = self.parse_hubbard_u()["values"]
values = []

Expand All @@ -1026,12 +1028,12 @@ def parse_hubbard_v(self) -> Dict[str, list]:
"id": int(cols[0]),
"atomicSpecies": cols[1],
"orbitalName": next(
(item["orbitalName"] for item in u_dict if item["newLabel"] == cols[1]), "nl"
(item["orbitalName"] for item in u_dict if cols[1] == item["newLabel"]), "nl"
),
"id2": int(cols[2]),
"atomicSpecies2": cols[3],
"orbitalName2": next(
(item["orbitalName"] for item in u_dict if item["newLabel"] == cols[3]), "nl"
(item["orbitalName"] for item in u_dict if cols[3] == item["newLabel"]), "nl"
),
"distance": float(cols[4]),
"value": float(cols[5]),
Expand Down

0 comments on commit 3c58a2d

Please sign in to comment.