aiida.tools.data.structure package

Various utilities to deal with StructureData instances or create new ones (e.g. convert format to/from SPGLIB, create a StructureData from a different format, …)

aiida.tools.data.structure.spglib_tuple_to_structure(structure_tuple, kind_info=None, kinds=None)[source]

Convert a tuple of the format (cell, scaled_positions, element_numbers) to an AiiDA structure.

Unless the element_numbers are identical to the Z number of the atoms, you should pass both kind_info and kinds, with the same format as returned by get_tuple_from_aiida_structure.

Parameters
  • structure_tuple – the structure in format (structure_tuple, kind_info)

  • kind_info – a dictionary mapping the kind_names to the numbers used in element_numbers. If not provided, assumes {element_name: element_Z}

  • kinds – a list of the kinds of the structure.

aiida.tools.data.structure.structure_to_spglib_tuple(structure)[source]

Convert an AiiDA structure to a tuple of the format (cell, scaled_positions, element_numbers).

Parameters

structure – the AiiDA structure

Returns

(structure_tuple, kind_info, kinds) where structure_tuple is a tuple of format (cell, scaled_positions, element_numbers); kind_info is a dictionary mapping the kind_names to the numbers used in element_numbers. When possible, it uses the Z number of the element, otherwise it uses numbers > 1000; kinds is a list of the kinds of the structure.