Skip to content

Commit

Permalink
revert reordered energy levels
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury committed Jul 16, 2024
1 parent 56100b8 commit 066b02d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pymatgen/analysis/magnetism/jahnteller.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _get_number_of_d_electrons(species: Species) -> float:

# taken from get_crystal_field_spin
elec = species.element.full_electronic_structure
if len(elec) < 4 or elec[-2][1] != "s" or elec[-1][1] != "d":
if len(elec) < 4 or elec[-1][1] != "s" or elec[-2][1] != "d":
raise AttributeError(f"Invalid element {species.symbol} for crystal field calculation.")
n_electrons = int(elec[-1][2] + elec[-2][2] - species.oxi_state) # type: ignore[operator]
if n_electrons < 0 or n_electrons > 10:
Expand Down
4 changes: 2 additions & 2 deletions tests/io/vasp/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,8 @@ def test_nelectrons(self):
assert self.psingle_Fe.nelectrons == 8

def test_electron_config(self):
assert self.psingle_Mn_pv.electron_configuration == [(3, "d", 5), (4, "s", 2), (3, "p", 6)]
assert self.psingle_Fe.electron_configuration == [(3, "d", 6), (4, "s", 2)]
assert self.psingle_Mn_pv.electron_configuration == [(4, "s", 2), (3, "d", 5), (3, "p", 6)]
assert self.psingle_Fe.electron_configuration == [(4, "s", 2), (3, "d", 6)]

def test_attributes(self):
for key, val in self.Mn_pv_attrs.items():
Expand Down

0 comments on commit 066b02d

Please sign in to comment.