diff --git a/src/nomad_simulations/schema_packages/model_method.py b/src/nomad_simulations/schema_packages/model_method.py index ac5daa82..74c3e02e 100644 --- a/src/nomad_simulations/schema_packages/model_method.py +++ b/src/nomad_simulations/schema_packages/model_method.py @@ -429,19 +429,35 @@ class TB(ModelMethodElectronic): a_eln=ELNAnnotation(component='EnumEditQuantity'), ) - # ? these 2 quantities will change when `BasisSet` is defined - n_orbitals = Quantity( + # ? these 4 quantities will change when `BasisSet` is defined + n_orbitals_per_atom = Quantity( + type=np.int32, + description=""" + Number of orbitals per atom in the unit cell used as a basis to obtain the `TB` model. + """, + ) + + n_atoms_per_unit_cell = Quantity( type=np.int32, description=""" - Number of orbitals used as a basis to obtain the `TB` model. + Number of atoms per unit cell relevant for the `TB` model. + """, + ) + + n_total_orbitals = Quantity( + type=np.int32, + description=""" + Total number of orbitals used as a basis to obtain the `TB` model. This is related with + `n_orbitals_per_atom` and `n_atoms_per_unit_cell` as: + `n_total_orbitals` = `n_orbitals_per_atom` * `n_atoms_per_unit_cell` """, ) orbitals_ref = Quantity( type=OrbitalsState, - shape=['n_orbitals'], + shape=['n_orbitals_per_atom'], description=""" - References to the `OrbitalsState` sections that contain the orbitals information which are + References to the `OrbitalsState` sections that contain the orbitals per atom in the unit cell information which are relevant for the `TB` model. Example: hydrogenated graphene with 3 atoms in the unit cell. The full list of `AtomsState` would @@ -560,9 +576,15 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: model_systems=model_systems, logger=logger ) if orbitals_ref is not None and len(orbitals_ref) > 0 and not self.orbitals_ref: - self.n_orbitals = len(orbitals_ref) + self.n_orbitals_per_atom = len(orbitals_ref) self.orbitals_ref = orbitals_ref + # Resolve `n_atoms_per_unit_cell` from `n_total_orbitals` and `n_orbitals_per_atom` + if self.n_orbitals_per_atom is not None and self.n_total_orbitals is not None: + self.n_atoms_per_unit_cell = ( + self.n_total_orbitals // self.n_orbitals_per_atom + ) + class Wannier(TB): """