Structure#
- class libcasm.xtal.Structure(
- self: Structure,
- lattice: Lattice,
- atom_coordinate_frac: numpy.ndarray[numpy.float64[m, n]] = array([], shape=(0, 0), dtype=float64),
- atom_type: list[str] = [],
- atom_properties: dict[str, numpy.ndarray[numpy.float64[m, n]]] = {},
- mol_coordinate_frac: numpy.ndarray[numpy.float64[m, n]] = array([], shape=(0, 0), dtype=float64),
- mol_type: list[str] = [],
- mol_properties: dict[str, numpy.ndarray[numpy.float64[m, n]]] = {},
- global_properties: dict[str, numpy.ndarray[numpy.float64[m, n]]] = {},
Bases:
pybind11_object
A crystal structure
Structure may specify atom and / or molecule coordinates and properties:
lattice vectors
atom coordinates
atom type names
continuous atom properties
molecule coordinates
molecule type names
continuous molecule properties
continuous global properties
Atom representation is most widely supported in CASM methods. In some limited cases the molecule representation is used.
Notes
The positions of atoms or molecules in the crystal structure is defined by the lattice and atom coordinates or molecule coordinates. If included, strain and displacement properties, which are defined in reference to an ideal state, should be interpreted as the strain and displacement that takes the crystal from the ideal state to the state specified by the structure lattice and atom or molecule coordinates. The convention used by CASM is that displacements are applied first, and then the displaced coordinates and lattice vectors are strained.
See the CASM Degrees of Freedom (DoF) and Properties documentation for the full list of supported properties and their definitions.
Special Methods
Structure may be copied with
Structure.copy
, copy.copy, or copy.deepcopy.
Constructor
- Parameters:
lattice (Lattice) – The Lattice. Note: The lattice tolerance is not saved in Structure.
atom_coordinate_frac (array_like, shape (3, n)) – Atom positions, as columns of a matrix, in fractional coordinates with respect to the lattice vectors.
atom_type (list[str], size=n) – Atom type names.
atom_properties (dict[str, numpy.ndarray[numpy.float64[m, n]]], default={}) – Continuous properties associated with individual atoms, if present. Keys must be the name of a CASM-supported property type. Values are arrays with dimensions matching the standard dimension of the property type.
mol_coordinate_frac (array_like, shape (3, n)) – Molecule positions, as columns of a matrix, in fractional coordinates with respect to the lattice vectors.
mol_type (list[str], size=n) – Molecule type names.
mol_properties (dict[str, numpy.ndarray[numpy.float64[m, n]]], default={}) – Continuous properties associated with individual molecules, if present. Keys must be the name of a CASM-supported property type. Values are arrays with dimensions matching the standard dimension of the property type.
global_properties (dict[str, numpy.ndarray[numpy.float64[m, n]]], default={}) – Continuous properties associated with entire crystal, if present. Keys must be the name of a CASM-supported property type. Values are (m, 1) arrays with dimensions matching the standard dimension of the property type.
Methods
Returns the atom positions, as columns of a 2d array, in Cartesian coordinates.
Returns the atom positions, as columns of a 2d array, in fractional coordinates with respect to the lattice vectors.
Returns continuous properties associated with individual atoms, if present.
Returns a list with atom type names.
Returns a copy of the Structure.
Construct a Structure from a Python dict.
Construct a Structure from a JSON-formatted string.
Construct a Structure from a VASP POSCAR file
Construct a Structure from a VASP POSCAR string
Returns continuous properties associated with the entire crystal, if present.
Check if self is equivalent to structure2
Returns the lattice, as a copy
Returns the molecule positions, as columns of a 2d array, in Cartesian coordinates.
Returns the molecule positions, as columns of a 2d array, in fractional coordinates with respect to the lattice vectors.
Returns continuous properties associated with individual molecules, if present.
Returns a list with molecule type names.
Represent the Structure as a Python dict.
Represent the Structure as a JSON-formatted string.
Convert a Structure to a VASP POSCAR string