Skip to content

Commit 9e941ba

Browse files
Added parsing of masses and (partial) charges for MD
1 parent 5d05d7a commit 9e941ba

File tree

2 files changed

+196
-105
lines changed

2 files changed

+196
-105
lines changed

src/nomad_simulations/schema_packages/atoms_state.py

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -620,10 +620,10 @@ class ElectronicState(Entity):
620620
section_def=BaseSpinOrbitalState.m_def,
621621
description="""
622622
The actual quantum state descriptor at this level of the hierarchy.
623-
This `BaseSpinOrbitalState` (typically `SphericalSymmetryState`) defines the
623+
This `BaseSpinOrbitalState` (typically `SphericalSymmetryState`) defines the
624624
quantum numbers and properties of the state in a modular fashion.
625625
Child states in `sub_states` may inherit quantum numbers from this parent descriptor.
626-
626+
627627
For example, if parent has `spin_orbit_state=SphericalSymmetryState(n=3, l=2)`,
628628
a child might only specify `spin_orbit_state=SphericalSymmetryState(ml=-2)`,
629629
with n=3, l=2 implied from the parent.
@@ -637,7 +637,7 @@ class ElectronicState(Entity):
637637
- For single orbitals: typically 1 (if ml, ms specified) or 2*l+1 (orbital only)
638638
- For manifolds: sum of constituent state degeneracies
639639
- For symmetry-adapted states: dimension of irreducible representation
640-
640+
641641
Can be computed from `spin_orbit_state` or summed from `sub_states`.
642642
For correlated systems, represents the many-body state degeneracy.
643643
""",
@@ -647,11 +647,11 @@ class ElectronicState(Entity):
647647
type=positive_float(),
648648
description="""
649649
Electronic occupation of this state or manifold.
650-
650+
651651
- For decomposable states: sum of occupations in `sub_states`
652652
- For correlated systems: effective occupation from many-body calculation (can be fractional)
653653
- For non-interacting: integer or follows Fermi-Dirac distribution
654-
654+
655655
Note: For correlated electrons, fractional occupation does NOT mean partial occupancy
656656
of individual orbitals, but rather reflects the many-body quantum state.
657657
""",
@@ -674,17 +674,17 @@ def n_sub_states(self) -> int:
674674
repeats=True,
675675
description="""
676676
Hierarchical decomposition of this electronic state into finer-grained components.
677-
677+
678678
The decomposition can follow different schemes depending on physics context:
679679
- **Orbital decomposition**: Split by ml quantum number (e.g., p → px, py, pz)
680680
- **Spin decomposition**: Split by ms quantum number (e.g., orbital → spin up/down)
681681
- **Symmetry decomposition**: Split by crystal field irreps (e.g., d → t2g, eg)
682682
- **Coupling scheme**: Split by j,mj for j-j coupling vs. ml,ms for L-S coupling
683-
683+
684684
Multiple decomposition schemes can coexist for the same electrons - choose the one
685685
appropriate for your analysis. For strongly correlated systems where electrons cannot
686686
be assigned to individual orbitals, this may be empty or contain only a reference basis.
687-
687+
688688
Child states inherit quantum number information from parent's `spin_orbit_state`,
689689
only specifying additional refinements (e.g., parent has l=2, child adds ml=-1).
690690
""",
@@ -694,26 +694,26 @@ def n_sub_states(self) -> int:
694694
section_def=BaseSpinOrbitalState.m_def, # @EBB2675: do you see numerical_settings.basis_set also fit here?
695695
repeats=True,
696696
description="""
697-
References to basis orbitals (as `BaseSpinOrbitalState` instances) used to construct
697+
References to basis orbitals (as `BaseSpinOrbitalState` instances) used to construct
698698
this state as a linear combination.
699-
699+
700700
Used when this electronic state cannot be described by a single quantum state but rather
701701
as a superposition of simpler orbital states:
702702
- Hybrid orbitals: sp³ = linear combination of s, px, py, pz orbitals
703703
- Molecular orbitals: LCAO construction from atomic orbitals
704704
- Wannier functions: linear combination of Bloch states
705705
- Symmetry-adapted linear combinations (SALC)
706-
706+
707707
Each entry is a simple quantum state (e.g., `SphericalSymmetryState(n=2, l=0)` for 2s,
708-
`SphericalSymmetryState(n=2, l=1, ml=1)` for 2px, etc.) without the navigation
708+
`SphericalSymmetryState(n=2, l=1, ml=1)` for 2px, etc.) without the navigation
709709
structure of `ElectronicState`.
710-
710+
711711
The actual expansion coefficients should be stored in the relevant electronic eigenvalue
712712
sections (e.g., `BandStructure.eigenvectors`, `DOSElectronicNew.value_projection`, etc.)
713-
rather than duplicated here. This field provides the ordered basis set definition that
713+
rather than duplicated here. This field provides the ordered basis set definition that
714714
those coefficients correspond to.
715-
716-
If this state has a simple symmetry description (`spin_orbit_state`), this field
715+
716+
If this state has a simple symmetry description (`spin_orbit_state`), this field
717717
is typically empty. It's primarily for composite states that lack simple quantum number labels.
718718
""",
719719
)
@@ -1114,6 +1114,27 @@ class AtomsState(ParticleState):
11141114
""",
11151115
)
11161116

1117+
mass = Quantity(
1118+
type=np.float64,
1119+
unit='kg',
1120+
description="""
1121+
Atomic mass of the atom. It mostly comes from the combined mass of the protons and
1122+
neutrons in the nucleus, with minor contributions from the electrons and nuclear
1123+
binding energy. In molecular dynamics force fields, the mass is often treated as
1124+
a fixed parameter for each element, and can deviate from the actual atomic mass.
1125+
""",
1126+
)
1127+
1128+
partial_charge = Quantity(
1129+
type=np.float64,
1130+
unit='elementary_charge',
1131+
description="""
1132+
Partial charge of the atom as used in classical force fields. Unlike `charge`,
1133+
which is an integer formal charge, this is an arbitrary float-valued point charge
1134+
assigned to the atom site by the force field (e.g., CHARMM, AMBER, GROMACS).
1135+
""",
1136+
)
1137+
11171138
spin = Quantity(
11181139
type=np.int32,
11191140
default=0,

0 commit comments

Comments
 (0)