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 cell and atoms and 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]) to interpret the cell alone (effectively assuming that the cell is 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_dataSpglibData
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 types to distinguish the atoms. To see how wulfric deduces types from given atoms see wulfric.get_spglib_types().