Skip to content

Commit 616b791

Browse files
committed
Merge branch 'develop' into physical-property-tweaking
2 parents 573fe81 + 56afad7 commit 616b791

File tree

4 files changed

+450
-17
lines changed

4 files changed

+450
-17
lines changed

docs/general.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,56 @@ class SUPERCODEParser:
110110
# append `Simulation` as an `archive.data` section
111111
archive.data.append(simulation)
112112
```
113+
114+
## Homogenization and the role of Workflows
115+
116+
Workflows are a device for annotating the structure of a set of entries in a standardized way.
117+
A community can define a workflow schema, i.e. its standout sections, without any knowledge of the underlying entries.
118+
As such, workflows define a homogenized data format with rich semantics that act as the starting point wherefrom to explore the dataset.
119+
The actual workflow entry instance, meanwhile, handles the coordination between tasks and the underlying data.
120+
This mapping may be a mixture of (workflow) entries and sections.
121+
122+
Below are a few examples of actual mappings.
123+
Important to note is that these examples already presuppose a certain structure on the side of the referenced `archive.data` sections.
124+
In reality, workflow should be capable of hosting multiple underlying structures.
125+
126+
### Serial Updates to `ModelSystem`
127+
128+
Geometry optimizations or molecular dynamics simulations, for example, typically store their data in a single entry.
129+
Tasks trace the updates to the system, i.e. calculation or time steps, respectively.
130+
The actual modifications of these steps are stored in the `model_system` and `outputs`.
131+
<!-- @JFRudzinski pls double-check the order of the arrows -->
132+
133+
```
134+
entry_x#workflow2.task[0].input -> entry_y1#data.model_system[0]
135+
entry_x#workflow2.task[0].output -> entry_y2#data.outputs[0]
136+
...
137+
entry_x#workflow2.task[n].input -> entry_y1#data.model_system[n]
138+
entry_x#workflow2.task[n].output -> entry_y2#data.outputs[n]
139+
```
140+
141+
Note that `entry_x`, `entry_y1`, `entry_y2` will typically refer to the same entry, though this isn't a hard requirement.
142+
143+
#### Including SCF steps
144+
145+
!!! warning "Under construction"
146+
This section will be updated once its schema-side is settled on.
147+
148+
### Single-Point SCF Workflow
149+
150+
In the case of a single-point calculation, the emphasis clearly lies on the relaxation of the electronic structure.
151+
Now, each `outputs` section can wholesale be dedicated to following the SCF cycle.
152+
153+
```
154+
entry_x#workflow2.task[0].output -> entry_y#data.outputs[0]
155+
```
156+
157+
### Multi-step Electronic Workflows
158+
159+
There are two main design choices here:
160+
161+
1. the methodology and computed outputs are split along major subroutines.
162+
2. they are kept in a single entry. This is especially useful for legacy cases, where some subroutines were originally not distinguished.
163+
164+
In option 2, for any workflows at are not simply _serial_, there is no canonical way of ordering `outputs`.
165+
This burden remains with `workflow2.tasks`.

src/nomad_simulations/schema_packages/atoms_state.py

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,12 @@ class ParticleState(Entity):
551551
This can be extended to include any common quantities in the future.
552552
"""
553553

554-
pass
554+
label = Quantity(
555+
type=str,
556+
description="""
557+
User- or program-package-defined identifier for this particle.
558+
""",
559+
)
555560

556561

557562
class AtomsState(ParticleState):
@@ -660,5 +665,83 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
660665
self.atomic_number = self.resolve_atomic_number(logger=logger)
661666

662667

663-
class CoarseGrainedState(ParticleState):
664-
pass
668+
class CGBeadState(ParticleState):
669+
"""
670+
A section to define coarse-grained bead state information.
671+
"""
672+
673+
# ? What do we want to qualify as type identifier? What safety checks do we need?
674+
bead_symbol = Quantity(
675+
type=str,
676+
description="""
677+
Symbol(s) describing the (base) CG particle type. Equivalent to chemical_symbol
678+
for atomic elements.
679+
""",
680+
)
681+
682+
label = Quantity(
683+
type=str,
684+
description="""
685+
User- or program-package-defined identifier for this bead site.
686+
This could be used to store primary FF labels in cases where only a
687+
secondary specification is required. Otherwise, `alt_labels` are
688+
used to document more complex bead identifiers, e.g., bead interactions based
689+
on connectivity.
690+
""",
691+
)
692+
693+
alt_labels = Quantity(
694+
type=str,
695+
shape=['*'],
696+
description="""
697+
A list of bead labels for multifaceted bead characterization.
698+
""",
699+
)
700+
701+
mass = Quantity(
702+
type=np.float64,
703+
unit='kg',
704+
description="""
705+
Total mass of the particle.
706+
""",
707+
)
708+
709+
charge = Quantity(
710+
type=np.float64,
711+
unit='coulomb',
712+
description="""
713+
Total charge of the particle.
714+
""",
715+
)
716+
717+
# Other possible quantities
718+
# diameter: float
719+
# The diameter of each particle.
720+
# Default: 1.0
721+
# body: int
722+
# The composite body associated with each particle. The value -1
723+
# indicates no body.
724+
# Default: -1
725+
# moment_inertia: float
726+
# The moment_inertia of each particle (I_xx, I_yy, I_zz).
727+
# This inertia tensor is diagonal in the body frame of the particle.
728+
# The default value is for point particles.
729+
# Default: 0, 0, 0
730+
# scaled_positions: list of scaled-positions #! for cell if relevant
731+
# Like positions, but given in units of the unit cell.
732+
# Can not be set at the same time as positions.
733+
# Default: 0, 0, 0
734+
# orientation: float
735+
# The orientation of each particle. In scalar + vector notation,
736+
# this is (r, a_x, a_y, a_z), where the quaternion is q = r + a_xi + a_yj + a_zk.
737+
# A unit quaternion has the property: sqrt(r^2 + a_x^2 + a_y^2 + a_z^2) = 1.
738+
# Default: 0, 0, 0, 0
739+
# angmom: float #? for cell or here?
740+
# The angular momentum of each particle as a quaternion.
741+
# Default: 0, 0, 0, 0
742+
# image: int #! advance PBC stuff would go in cell I guess
743+
# The number of times each particle has wrapped around the box (i_x, i_y, i_z).
744+
# Default: 0, 0, 0
745+
746+
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
747+
super().normalize(archive, logger)

0 commit comments

Comments
 (0)