aiida_atomistic.data.structure.models#
Classes#
A base model representing a structure in atomistic simulations. |
|
A mutable structure model that extends the StructureBaseModel class. |
|
A class representing an immutable structure model. |
Module Contents#
- class aiida_atomistic.data.structure.models.StructureBaseModel(/, **data: Any)[source]#
Bases:
pydantic.BaseModel
A base model representing a structure in atomistic simulations.
- Attributes:
pbc (Optional[List[bool]]): Periodic boundary conditions in the x, y, and z directions. cell (Optional[List[List[float]]]): The cell vectors defining the unit cell of the structure.
- sites: list[aiida_atomistic.data.structure.site.Site] = None[source]#
- hubbard: aiida_quantumespresso.common.hubbard.Hubbard | None = None[source]#
- check_minimal_requirements(data)[source]#
Validate the minimal requirements of the structure.
- Args:
data (dict): The input data for the structure. This is automatically passed by pydantic.
- Returns:
dict: The validated input data.
- Raises:
ValueError: If the structure does not meet the minimal requirements.
- cell_volume() float [source]#
Compute the volume of the unit cell.
- Returns:
float: The volume of the unit cell in cubic Angstroms.
- dimensionality() dict [source]#
Determine the dimensionality of the structure.
- Returns:
dict: A dictionary indicating the dimensionality of the structure.
- formula() str [source]#
Get the chemical formula of the structure.
- Returns:
str: The chemical formula of the structure.
- positions() numpy.ndarray [source]#
Return the positions of all sites in the structure as a numpy array.
- Returns:
np.ndarray: An array of shape (N, 3) where N is the number of sites.
- kind_names() List[str] [source]#
Return the list of kind names for all sites in the structure.
- Returns:
List[str]: A list of kind names corresponding to each site.
- symbols() List[str] [source]#
Return the list of chemical symbols for all sites in the structure.
- Returns:
List[str]: A list of chemical symbols corresponding to each site.
- masses() numpy.ndarray [source]#
Return the masses of all sites in the structure as a numpy array.
- Returns:
np.ndarray: An array of masses corresponding to each site.
- charges() numpy.ndarray [source]#
Return the charges of all sites in the structure as a numpy array.
- Returns:
np.ndarray: An array of charges corresponding to each site.
- magmoms() numpy.ndarray [source]#
Return the magnetic moments of all sites in the structure as a numpy array.
- Returns:
np.ndarray: An array of magnetic moments corresponding to each site.
- magnetizations() numpy.ndarray [source]#
Return the magnetizations of all sites in the structure as a numpy array.
- Returns:
np.ndarray: An array of magnetizations corresponding to each site.
- weights() List[Tuple[float, Ellipsis]] [source]#
Return the weights of all sites in the structure as a list of tuples.
- Returns:
List[Tuple[float, …]]: A list of weight tuples corresponding to each site.
- kinds() aiida_atomistic.data.structure.site.FrozenList[aiida_atomistic.data.structure.kind.Kind] [source]#
Return the reduced set of kinds, grouping sites that share all properties except positions and site_indices.
- class aiida_atomistic.data.structure.models.MutableStructureModel(/, **data: Any)[source]#
Bases:
StructureBaseModel
A mutable structure model that extends the StructureBaseModel class.
- Attributes:
_mutable (bool): Flag indicating whether the structure is mutable or not. sites (List[Site]): List of immutable sites in the structure.
- class aiida_atomistic.data.structure.models.ImmutableStructureModel(/, **data: Any)[source]#
Bases:
StructureBaseModel
A class representing an immutable structure model.
This class inherits from StructureBaseModel and provides additional functionality for handling immutable structures.
- Attributes:
_mutable (bool): Flag indicating whether the structure is mutable or not. sites (List[Site]): List of immutable sites in the structure.
- Config:
from_attributes (bool): Flag indicating whether to load attributes from the input data. frozen (bool): Flag indicating whether the model is frozen or not. arbitrary_types_allowed (bool): Flag indicating whether arbitrary types are allowed or not.
- sites: list[aiida_atomistic.data.structure.site.FrozenSite] | None = None[source]#