Skip to content

Commit

Permalink
transfered changes from 28 to new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudz committed Jun 26, 2024
1 parent 2c2f2fd commit 5a0862c
Show file tree
Hide file tree
Showing 6 changed files with 1,110 additions and 3 deletions.
62 changes: 62 additions & 0 deletions src/nomad_simulations/schema_packages/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# limitations under the License.
#

import numpy as np
from typing import TYPE_CHECKING, List, Optional

from nomad.datamodel.data import ArchiveSection
Expand All @@ -27,6 +28,7 @@
from structlog.stdlib import BoundLogger

from nomad_simulations.schema_packages.model_system import ModelSystem
from nomad_simulations.model_method import ModelMethod
from nomad_simulations.schema_packages.numerical_settings import SelfConsistency
from nomad_simulations.schema_packages.physical_property import PhysicalProperty
from nomad_simulations.schema_packages.properties import (
Expand All @@ -42,6 +44,9 @@
HoppingMatrix,
Permittivity,
XASSpectrum,
TotalEnergy,
TotalForce,
Temperature,
)


Expand All @@ -67,6 +72,15 @@ class Outputs(ArchiveSection):
a_eln=ELNAnnotation(component='ReferenceEditQuantity'),
)

model_method_ref = Quantity(
type=ModelMethod,
description="""
Reference to the `ModelMethod` section to which the output property references to
and on which the simulation is performed.
""",
a_eln=ELNAnnotation(component='ReferenceEditQuantity'),
)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# List of properties
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Expand Down Expand Up @@ -103,6 +117,12 @@ class Outputs(ArchiveSection):

xas_spectra = SubSection(sub_section=XASSpectrum.m_def, repeats=True)

total_energy = SubSection(sub_section=TotalEnergy.m_def, repeats=True)

total_force = SubSection(sub_section=TotalForce.m_def, repeats=True)

temperature = SubSection(sub_section=Temperature.m_def, repeats=True)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Expand Down Expand Up @@ -284,3 +304,45 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
physical_property=phys_property,
logger=logger,
)

class WorkflowOutputs(Outputs):
"""
This section contains output properties that depend on a single system, but were
calculated as part of a workflow. Examples include geometry optimization and molecular dynamics.
"""

step = Quantity(
type=np.int32,
description="""
The step number with respect to the workflow.
""",
)

# workflow_ref = Quantity(
# type=SimulationWorkflow,
# description="""
# Reference to the `SelfConsistency` section that defines the numerical settings to converge the
# output property.
# """,
# )

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


class TrajectoryOutputs(WorkflowOutputs):
"""
This section contains output properties that depend on a single system, but were
calculated as part of a workflow. Examples include geometry optimization and molecular dynamics.
"""

time = Quantity(
type=np.float64,
unit='ps',
description="""
The elapsed simulated physical time since the start of the trajectory.
""",
)

def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)
13 changes: 11 additions & 2 deletions src/nomad_simulations/schema_packages/properties/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@

from .band_gap import ElectronicBandGap
from .band_structure import ElectronicBandStructure, ElectronicEigenvalues
from .energies import ChemicalPotential, FermiLevel
from .energies import (
FermiLevel,
ChemicalPotential,
TotalEnergy,
Energy,
ClassicalEnergy,
QuantumEnergy,
)
from .forces import TotalForce, Force
from .thermodynamics import Temperature
from .fermi_surface import FermiSurface
from .hopping_matrix import CrystalFieldSplitting, HoppingMatrix
from .permittivity import Permittivity
Expand All @@ -28,4 +37,4 @@
ElectronicDensityOfStates,
SpectralProfile,
XASSpectrum,
)
)
Loading

0 comments on commit 5a0862c

Please sign in to comment.