Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ElectronicGreensFunction and ElectronicSelfEnergy properties #109

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
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,18 @@ indent-width = 4
[tool.ruff.lint]
select = [
"E", # pycodestyle
"W", # pycodestyle
"PL", # pylint
"F", # Pyflakes
"UP", # pyupgrade
"I", # isort
]

ignore = [
"F401", # Module imported but unused
"E501", # Line too long ({width} > {limit} characters)
"E701", # Multiple statements on one line (colon)
"E731", # Do not assign a lambda expression, use a def
"E402", # Module level import not at top of file
"F401",
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments in function definition
Expand Down
23 changes: 23 additions & 0 deletions src/nomad_simulations/schema_packages/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@
ElectronicBandStructure,
ElectronicDensityOfStates,
ElectronicEigenvalues,
ElectronicGreensFunction,
ElectronicSelfEnergy,
FermiLevel,
FermiSurface,
HoppingMatrix,
HybridizationFunction,
KineticEnergy,
Occupancy,
Permittivity,
PotentialEnergy,
QuasiparticleWeight,
Temperature,
TotalEnergy,
TotalForce,
Expand Down Expand Up @@ -112,6 +117,24 @@ class Outputs(ArchiveSection):
sub_section=ElectronicBandStructure.m_def, repeats=True
)

occupancies = SubSection(sub_section=Occupancy.m_def, repeats=True)

electronic_greens_functions = SubSection(
sub_section=ElectronicGreensFunction.m_def, repeats=True
)

electronic_self_energies = SubSection(
sub_section=ElectronicSelfEnergy.m_def, repeats=True
)

hybridization_functions = SubSection(
sub_section=HybridizationFunction.m_def, repeats=True
)

quasiparticle_weights = SubSection(
sub_section=QuasiparticleWeight.m_def, repeats=True
)

permittivities = SubSection(sub_section=Permittivity.m_def, repeats=True)

absorption_spectra = SubSection(sub_section=AbsorptionSpectrum.m_def, repeats=True)
Expand Down
8 changes: 7 additions & 1 deletion src/nomad_simulations/schema_packages/properties/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.

from .band_gap import ElectronicBandGap
from .band_structure import ElectronicBandStructure, ElectronicEigenvalues
from .band_structure import ElectronicBandStructure, ElectronicEigenvalues, Occupancy
from .energies import (
EnergyContribution,
FermiLevel,
Expand All @@ -27,6 +27,12 @@
)
from .fermi_surface import FermiSurface
from .forces import BaseForce, ForceContribution, TotalForce
from .greens_function import (
ElectronicGreensFunction,
ElectronicSelfEnergy,
HybridizationFunction,
QuasiparticleWeight,
)
from .hopping_matrix import CrystalFieldSplitting, HoppingMatrix
from .permittivity import Permittivity
from .spectral_profile import (
Expand Down
58 changes: 56 additions & 2 deletions src/nomad_simulations/schema_packages/properties/band_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from nomad.metainfo import Context, Section
from structlog.stdlib import BoundLogger

from nomad_simulations.schema_packages.atoms_state import AtomsState, OrbitalsState
from nomad_simulations.schema_packages.numerical_settings import KSpace
from nomad_simulations.schema_packages.physical_property import (
PhysicalProperty,
Expand Down Expand Up @@ -92,8 +93,8 @@ class ElectronicEigenvalues(BaseElectronicEigenvalues):
shape=['*', 'n_bands'],
description="""
Occupation of the electronic eigenvalues. This is a number depending whether the `spin_channel` has been set or not.
If `spin_channel` is set, then this number is between 0 and 2, where 0 means that the state is unoccupied and 2 means
that the state is fully occupied; if `spin_channel` is not set, then this number is between 0 and 1. The shape of
If `spin_channel` is set, then this number is between 0 and 1, where 0 means that the state is unoccupied and 1 means
that the state is fully occupied; if `spin_channel` is not set, then this number is between 0 and 2. The shape of
this quantity is defined as `[K.n_points, K.dimensionality, n_bands]`, where `K` is a `variable` which can
be `KMesh` or `KLinePath`, depending whether the simulation mapped the whole Brillouin zone or just a specific
path.
Expand Down Expand Up @@ -340,3 +341,56 @@ def __init__(

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)


class Occupancy(PhysicalProperty):
"""
Electrons occupancy of an atom per orbital and spin. This is a number defined between 0 and 1 for
spin-polarized systems, and between 0 and 2 for non-spin-polarized systems. This property is
important when studying if an orbital or spin channel are fully occupied, at half-filling, or
fully emptied, which have an effect on the electron-electron interaction effects.
"""

iri = 'http://fairmat-nfdi.eu/taxonomy/Occupancy'

atoms_state_ref = Quantity(
type=AtomsState,
description="""
Reference to the `AtomsState` section in which the occupancy is calculated.
""",
)

orbitals_state_ref = Quantity(
type=OrbitalsState,
description="""
Reference to the `OrbitalsState` section in which the occupancy is calculated.
""",
)

spin_channel = Quantity(
type=np.int32,
description="""
Spin channel of the corresponding electronic property. It can take values of 0 and 1.
""",
)

value = Quantity(
type=np.float64,
description="""
Value of the electronic occupancy in the atom defined by `atoms_state_ref` and the orbital
defined by `orbitals_state_ref`. the orbital. If `spin_channel` is set, then this number is
between 0 and 1, where 0 means that the state is unoccupied and 1 means that the state is
fully occupied; if `spin_channel` is not set, then this number is between 0 and 2.
""",
)

def __init__(
self, m_def: 'Section' = None, m_context: 'Context' = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
self.name = self.m_def.name

# TODO add extraction from `ElectronicEigenvalues.occupation`

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)
Loading