wulfric.validate_spglib_data#

wulfric.validate_spglib_data(cell, atoms, spglib_data) None[source]#

Validate that cell and atoms["positions"] match the ones on which spglib_data was created.

In details, it check that

  • cell is the same as spglib_data.original_cell

  • atoms["positions"] are the same as spglib_data.original_positions

  • wulfric.get_spglib_types(atoms=atoms) is the same as spglib_data.original_types.

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

  • "species" : (N, ) list of str, optional

  • "spglib_types" : (N, ) list of int, optional

spglib_datadict

A dictionary with the added syntactic sugar (i.e. with the dot access to the keys), that is produced via call to get_spglib_data().

Raises:
ValueError

If cell and atoms do not match spglib_data.