Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
'packaging',
'xmlschema',
'glom~=24.11',
'dough==0.3.0',
'dough==0.4.0',
]

[project.urls]
Expand All @@ -40,14 +40,16 @@ Source = 'https://github.com/aiidateam/qe-tools'
[project.optional-dependencies]
ase = [
"ase",
"pint"
]
pymatgen = [
"pymatgen"
]
aiida = [
"aiida-core"
]
pint = [
"dough[pint]",
]
docs = [
"mkdocs",
"mkdocs-material"
Expand Down
13 changes: 7 additions & 6 deletions src/qe_tools/outputs/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from glom import Spec

from dough import Unit
from dough.converters import BaseConverter
from dough.outputs import BaseOutput, output_mapping

Expand All @@ -32,23 +33,23 @@ def _determine_spin_type(spin: dict) -> str:
class _DosMapping:
"""Typed outputs of a dos.x calculation."""

energy: Annotated[list, Spec("dos.energy")]
energy: Annotated[list, Spec("dos.energy"), Unit("eV")]
"""Energy grid in eV."""

dos: Annotated[list, Spec("dos.dos")]
dos: Annotated[list, Spec("dos.dos"), Unit("1/eV")]
"""Total density of states (states/eV). Not available for spin-polarised calculations."""

dos_up: Annotated[list, Spec("dos.dos_up")]
dos_up: Annotated[list, Spec("dos.dos_up"), Unit("1/eV")]
"""Spin-up DOS (states/eV). Not available for non-spin-polarised calculations."""

dos_down: Annotated[list, Spec("dos.dos_down")]
dos_down: Annotated[list, Spec("dos.dos_down"), Unit("1/eV")]
"""Spin-down DOS (states/eV). Not available for non-spin-polarised calculations."""

fermi_energy: Annotated[float, Spec("dos.fermi_energy")]
fermi_energy: Annotated[float, Spec("dos.fermi_energy"), Unit("eV")]
"""Fermi energy in eV."""

integrated_dos: Annotated[list, Spec("dos.integrated_dos")]
"""Integrated DOS."""
"""Integrated DOS (# of states)."""

full_dos: Annotated[dict, Spec("dos")]
"""Full parsed DOS dictionary."""
Expand Down
11 changes: 11 additions & 0 deletions src/qe_tools/outputs/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from glom import Coalesce, Spec

from dough import Unit
from dough.converters import BaseConverter
from dough.outputs import BaseOutput, output_mapping

Expand Down Expand Up @@ -35,6 +36,7 @@ class _PwParametersMapping:
lambda ecut: ecut * CONSTANTS.hartree_to_ev,
)
),
Unit("eV"),
]
"""Kinetic-energy cutoff for wavefunctions in eV."""

Expand All @@ -46,6 +48,7 @@ class _PwParametersMapping:
lambda ecut: ecut * CONSTANTS.hartree_to_ev,
)
),
Unit("eV"),
]
"""Kinetic-energy cutoff for the charge density and potential in eV."""

Expand Down Expand Up @@ -107,6 +110,7 @@ class _PwParametersMapping:
lambda d: d * CONSTANTS.hartree_to_ev,
)
),
Unit("eV"),
]
"""Smearing width in eV."""

Expand Down Expand Up @@ -185,6 +189,7 @@ class _PwMapping:
],
)
),
Unit("eV/angstrom"),
]
"""Forces on atoms in eV/Å, shape [n_atoms][3]."""

Expand All @@ -202,6 +207,7 @@ class _PwMapping:
],
)
),
Unit("GPa"),
]
"""Stress tensor in GPa, shape [3][3]."""

Expand All @@ -213,6 +219,7 @@ class _PwMapping:
lambda energy: energy * CONSTANTS.hartree_to_ev,
)
),
Unit("eV"),
]
"""Fermi energy in eV."""

Expand All @@ -224,6 +231,7 @@ class _PwMapping:
lambda energies: energies[0] * CONSTANTS.hartree_to_ev,
)
),
Unit("eV"),
]
"""Fermi energy of spin-up channel in eV.

Expand All @@ -238,6 +246,7 @@ class _PwMapping:
lambda energies: energies[1] * CONSTANTS.hartree_to_ev,
)
),
Unit("eV"),
]
"""Fermi energy of spin-down channel in eV.

Expand Down Expand Up @@ -278,6 +287,7 @@ class _PwMapping:
],
)
),
Unit("1/angstrom"),
]
"""Cartesian coordinates of the k-points in 1/Å, shape `[n_kpoints][3]`."""

Expand All @@ -300,6 +310,7 @@ class _PwMapping:
lambda energy: energy * CONSTANTS.hartree_to_ev,
)
),
Unit("eV"),
]
"""Total energy in eV."""

Expand Down
Loading