wulfric.get_spglib_types#

wulfric.get_spglib_types(atoms)[source]#

Constructs spglib_types for the given atoms.

First satisfied rule is applied

  1. "spglib_types" in atoms

    Return atoms["spglib_types"].

  2. "species" in atoms.

    spglib_types are deduced from atoms["species"]. If two atoms have the same species, then they will have the same integer assigned to them in spglib_types.

  3. "names" in atoms

    Species are automatically deduced based on atom's names (via wulfric.crystal.get_atom_species()), and then the second rule is applied.

Parameters:
atomsdict

Dictionary with N atoms. At least one of the following keys is expected

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

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

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

Returns:
spglib_types(N, ) list of int

List of integer indices ready to be passed to spglib.