wulfric.get_spglib_data#
- wulfric.get_spglib_data(cell, atoms, spglib_symprec=1e-05, spglib_angle_tolerance=-1)[source]#
Interface to spglib.
The idea is that this is the only way to access the data from spglib. In that way one can associate a dataset with a given
cellandatomsand re-use it when necessary.- Parameters:
- cell(3, 3) array-like
Matrix of a cell, rows are interpreted as vectors. In the language of spglib the same concept is usually called "basis vectors" or "lattice".
- atomsdict
Dictionary with N atoms. Expected keys:
"positions" : (N, 3) array-like Positions of the atoms in the basis of lattice vectors (
cell). In other words - relative coordinates of atoms."names" : (N, ) list of str, optional See Notes
"species" : (N, ) list of str, optional See Notes
"spglib_types" (N, ) list of int, optional See Notes
Hint
Pass
atoms = dict(positions=[[0, 0, 0]], spglib_types=[1])if you would like to interpret thecellalone (effectively assuming that thecellis a primitive one).- spglib_symprecfloat, default \(10^{-5}\)
Directly passed to spglib. Tolerance parameter for the symmetry search.
- spglib_angle_tolerancefloat, default -1
Directly passed to spglib. Tolerance parameter for the symmetry search.
- Returns:
- spglib_datadict
A dictionary with the added syntactic sugar (i.e. with the dot access to the keys).
Data that are included:
spglib_data.original_cellSame as the given
cellspglib_data.original_positionsSame as the given
atoms["positions"]spglib_data.original_typesSame as
wulfric.get_spglib_types(atoms=atoms)for givenatoms.spglib_data.space_group_numberNumber of the space group.
1 <= spglib_data.space_group_number <= 230.spglib_data.crystal_familyCrystal family.
"c" for cubic
"h" for hexagonal
"t" for tetragonal
"o" for orhorhombic
"m" for monoclinic
"a" for triclinic
spglib_data.centring_typeCentring type.
"P" for primitive
"A" for side centered
"C" for side centered
"I" for body-centered
"R" for rhombohedral centring
"F" for all faces centered
spglib_data.conventional_cellConventional cell associated with the given structure in the same spatial orientation. In other words, it is a choice of the cell for the same crystal. It can contain more than one lattice point. Same as
std_latticeof spglib dataset but rotated back with thestd_rotation_matrixof spglib dataset.spglib_data.conventional_positionsN relative positions of the atoms in the basis of
spglib_data.conventional_cell. Same asstd_positionsof spglib dataset.spglib_data.conventional_typesN types of the atoms. Same as
std_typesof spglib dataset.spglib_data.primitive_cellPrimitive cell associated with the given structure in the same spatial orientation. In other words, it is a choice of the cell for the same crystal. It contains exactly one lattice point. Same as
primitive_latticereturned by spglib.find_primitive(), but rotated back with thestd_rotation_matrixof spglib dataset.spglib_data.primitive_positionsM relative positions of the atoms in the basis of
spglib_data.primitive_cell. Same asprimitive_positionsreturned by spglib.find_primitive().spglib_data.primitive_typesM types of the atoms. Same as
primitive_typesreturned by spglib.find_primitive().spglib_data.symprecangle_toleranceTolerance parameter that was used to call spglib.
spglib_data.angle_toleranceTolerance parameter that was used to call spglib.
- Raises:
- ValueError
If some input data are not what is expected.
- TypeError
If some input data are not what is expected.
- RuntimeError
If spglib fail to detect symmetry.
Notes
spglib uses
typesto distinguish the atoms. To see how wulfric deducestypesfrom givenatomsseewulfric.get_spglib_types().