Skip to content

Commit

Permalink
Move out SpinChannel and MometumTransfer to variables.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Daelman committed Nov 17, 2024
1 parent d8a5d9f commit 8d1bf01
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
29 changes: 3 additions & 26 deletions src/nomad_simulations/schema_packages/properties/band_gap.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,17 @@
from typing import TYPE_CHECKING, Optional
from typing import TYPE_CHECKING

import numpy as np
import pint
from nomad.units import ureg
from nomad.metainfo import MEnum, Quantity
from nomad.metainfo.dataset import MDataset, Dataset
from nomad.datamodel import EntryArchive
from nomad.metainfo.dataset import MDataset
from nomad.datamodel.metainfo.physical_properties import PhysicalProperty
from ..variables import SpinChannel, MomentumTransfer

if TYPE_CHECKING:
from nomad.datamodel.datamodel import EntryArchive
from structlog.stdlib import BoundLogger


class SpinChannel(MDataset):
m_def = Dataset(
type=MEnum('up', 'down', 'all'), # ? alpha, beta
)


class MomentumTransfer(MDataset):
m_def = Dataset(
type=np.float64,
shape=[2, 3],
unit='1/meter',
description="""
The change in momentum for any (quasi-)particle, e.g. electron, hole,
traversing the band gap.
For example, the momentum transfer in bulk Si happens
between the Γ and X points in the Brillouin zone; thus:
`momentum_transfer = [[0, 0, 0], [0.5, 0.5, 0]]`.
""",
)


class ElectronicBandGap(MDataset): # ? add optical band gap
m_def = PhysicalProperty(
type=np.float64,
Expand Down
26 changes: 25 additions & 1 deletion src/nomad_simulations/schema_packages/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import numpy as np
from nomad.datamodel.data import ArchiveSection
from nomad.metainfo import Quantity
from nomad.metainfo import MEnum, Quantity
from nomad.metainfo.dataset import MDataset, Dataset
from nomad.datamodel.metainfo.physical_properties import PhysicalProperty

if TYPE_CHECKING:
from nomad.datamodel.datamodel import EntryArchive
Expand All @@ -17,6 +19,28 @@
)


class SpinChannel(MDataset):
m_def = Dataset(
type=MEnum('up', 'down', 'all'), # ? alpha, beta
)


class MomentumTransfer(MDataset):
m_def = Dataset(
type=np.float64,
shape=[2, 3],
unit='1/meter',
description="""
The change in momentum for any (quasi-)particle, e.g. electron, hole,
traversing the band gap.
For example, the momentum transfer in bulk Si happens
between the Γ and X points in the Brillouin zone; thus:
`momentum_transfer = [[0, 0, 0], [0.5, 0.5, 0]]`.
""",
)


class Variables(ArchiveSection):
"""
Variables over which the physical property varies, and they are defined as grid points, i.e., discretized
Expand Down
5 changes: 2 additions & 3 deletions tests/properties/test_band_gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
from nomad.datamodel import EntryArchive
from nomad.units import ureg

from nomad_simulations.schema_packages.properties.band_gap import (
ElectronicBandGap,
from nomad_simulations.schema_packages.variables import (
SpinChannel,
MomentumTransfer,
)
# from nomad_simulations.schema_packages.variables import Temperature
from nomad_simulations.schema_packages.properties import ElectronicBandGap

from . import logger

Expand Down

0 comments on commit 8d1bf01

Please sign in to comment.