Skip to content

Commit 80662eb

Browse files
committed
PwOutput: Add fermi_energy_up and fermi_energy_down
Parse the spin-up and spin-down Fermi energies from the XML `two_fermi_energies` element for spin-polarized calculations (`tot_magnetization` set in `SYSTEM`). Values are converted from Hartree to eV, consistent with `fermi_energy`. Adds a `tot_magnetization` test fixture (QE v7.5) with a cleaned-up stdout following the fixture cleanup convention.
1 parent 91aae42 commit 80662eb

File tree

5 files changed

+861
-0
lines changed

5 files changed

+861
-0
lines changed

src/qe_tools/outputs/pw.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,28 @@ class _PwMapping:
8181
)
8282
"""Fermi energy in eV."""
8383

84+
fermi_energy_up: float = Spec(
85+
(
86+
"xml.output.band_structure.two_fermi_energies",
87+
lambda energies: energies[0] * CONSTANTS.hartree_to_ev,
88+
)
89+
)
90+
"""Fermi energy of spin-up channel in eV.
91+
92+
Only available when ``tot_magnetization`` is set in ``SYSTEM``.
93+
"""
94+
95+
fermi_energy_down: float = Spec(
96+
(
97+
"xml.output.band_structure.two_fermi_energies",
98+
lambda energies: energies[1] * CONSTANTS.hartree_to_ev,
99+
)
100+
)
101+
"""Fermi energy of spin-down channel in eV.
102+
103+
Only available when ``tot_magnetization`` is set in ``SYSTEM``.
104+
"""
105+
84106
total_energy: float = Spec(
85107
(
86108
"xml.output.total_energy.etot",

0 commit comments

Comments
 (0)