Skip to content

Commit

Permalink
expanded thermodynamics
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudz committed Jun 28, 2024
1 parent 185722b commit b567172
Show file tree
Hide file tree
Showing 6 changed files with 306 additions and 154 deletions.
1 change: 1 addition & 0 deletions src/nomad_simulations/schema_packages/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ class WorkflowOutputs(Outputs):
""",
)

# TODO add this in when we link to nomad-simulations-workflow schema
# workflow_ref = Quantity(
# type=SimulationWorkflow,
# description="""
Expand Down
22 changes: 19 additions & 3 deletions src/nomad_simulations/schema_packages/properties/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,27 @@
EnergyContribution,
TotalEnergy,
KineticEnergy,
PotentialEnergy
PotentialEnergy,
)
from .forces import BaseForce, ForceContribution, TotalForce
from .thermodynamics import Enthalpy, Entropy, ChemicalPotential, Pressure, Virial, Temperature, Volume, Density, Hessian, HeatCapacityCV, HeatCapacityCP
from .thermodynamics import (
Pressure,
Volume,
Temperature,
HeatAdded,
WorkDone,
InternalEnergy,
Enthalpy,
Entropy,
GibbsFreeEnergy,
HelmholtzFreeEnergy,
ChemicalPotential,
HeatCapacityCV,
HeatCapacityCP,
Virial,
Density,
Hessian,
)
from .fermi_surface import FermiSurface
from .hopping_matrix import CrystalFieldSplitting, HoppingMatrix
from .permittivity import Permittivity
Expand All @@ -38,4 +55,3 @@
SpectralProfile,
XASSpectrum,
)

16 changes: 13 additions & 3 deletions src/nomad_simulations/schema_packages/properties/energies.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@
from nomad.datamodel.datamodel import EntryArchive
from structlog.stdlib import BoundLogger

from nomad_simulations.schema_packages.physical_property import PhysicalProperty, PropertyContribution
from nomad_simulations.schema_packages.physical_property import (
PhysicalProperty,
PropertyContribution,
)

##################
# Abstract classes
##################


class BaseEnergy(PhysicalProperty):
"""
Abstract physical property section describing some energy of a (sub)system.
Expand All @@ -49,6 +53,7 @@ class BaseEnergy(PhysicalProperty):
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)


class EnergyContribution(BaseEnergy, PropertyContribution):
"""
Abstract physical property section linking a property contribution to a contribution
Expand All @@ -58,10 +63,12 @@ class EnergyContribution(BaseEnergy, PropertyContribution):
def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)


####################################
# List of specific energy properties
####################################


class FermiLevel(BaseEnergy):
"""
Physical property section describing the Fermi level, i.e., the energy required to add or extract a charge from a material at zero temperature.
Expand All @@ -82,6 +89,7 @@ def __init__(
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)


#! The only issue with this structure is that total energy will never be a sum of its contributions,
#! since kinetic energy lives separately, but I think maybe this is ok?
class TotalEnergy(BaseEnergy):
Expand All @@ -100,7 +108,8 @@ def __init__(
def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)

#? Separate quantities for nuclear and electronic KEs?

# ? Separate quantities for nuclear and electronic KEs?
class KineticEnergy(BaseEnergy):
"""
Physical property section describing the kinetic energy of a (sub)system.
Expand All @@ -109,6 +118,7 @@ class KineticEnergy(BaseEnergy):
def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)


class PotentialEnergy(BaseEnergy):
"""
Physical property section describing the potential energy of a (sub)system.
Expand All @@ -119,7 +129,7 @@ def normalize(self, archive, logger) -> None:


#! I removed all previous contributions associated in some way with terms in the Hamiltonian.
#? Should the remaining contributions below be incorporated into some sort of workflow results if still relevant?
# ? Should the remaining contributions below be incorporated into some sort of workflow results if still relevant?


# class ZeroTemperatureEnergy(QuantumEnergy):
Expand Down
11 changes: 9 additions & 2 deletions src/nomad_simulations/schema_packages/properties/forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
import numpy as np

from nomad.metainfo import Quantity, Section, Context, SubSection
from nomad_simulations.schema_packages.physical_property import PhysicalProperty, PropertyContribution
from nomad_simulations.schema_packages.physical_property import (
PhysicalProperty,
PropertyContribution,
)

####################################################
# Abstract force classes
Expand All @@ -47,6 +50,7 @@
# Abstract classes
##################


class BaseForce(PhysicalProperty):
"""
Abstract physical property section describing some force of a (sub)system.
Expand All @@ -63,6 +67,7 @@ class BaseForce(PhysicalProperty):
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)


class ForceContribution(BaseForce, PropertyContribution):
"""
Abstract physical property section linking a property contribution to a contribution
Expand All @@ -77,6 +82,7 @@ def normalize(self, archive, logger) -> None:
# List of specific force properties
###################################


class TotalForce(BaseForce):
"""
Physical property section describing the total force of a (sub)system.
Expand All @@ -93,7 +99,8 @@ def __init__(
def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)

#? See questions about corresponding energies

# ? See questions about corresponding energies
# class FreeForce(Force):
# """
# Physical property section describing...
Expand Down
Loading

0 comments on commit b567172

Please sign in to comment.