wulfric.crystal.get_conventional#

wulfric.crystal.get_conventional(cell, atoms, convention='HPKOT', spglib_data=None)[source]#

Return conventional cell and atoms associated with the given cell and atoms.

Parameters:
cell(3, 3) array-like

Matrix of a cell, rows are interpreted as vectors.

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 the cell alone (effectively assuming that the cell is a primitive one).

conventionstr, default "HPKOT"

Convention for the definition of the conventional cell. Case-insensitive. Supported:

spglib_dataSyntacticSugar, optional

If you need more control on the parameters passed to the spglib, then you can get spglib_data manually and pass it to this function. Use wulfric's interface to spglib as

spglib_data = wulfric.get_spglib_data(...)

using the same cell and atoms["positions"] that you are passing to this function.

Returns:
conventional_cell(3, 3) numpy.ndarray

Conventional cell.

conventional_atomsdict

Dictionary of atoms of the conventional cell. Has all the same keys as the original atoms. The values of each key are updated in such a way that conventional_cell with conventional_atoms describe the same crystal (and in the same spatial orientation) as cell with atoms. It has all keys as in atoms. Additional key "spglib_types" is added if it was not present in atoms.

Notes

spglib uses types to distinguish the atoms. To see how wulfric deduces the types for given atoms see wulfric.get_spglib_types().

If two atoms i and j have the same spglib_type (i.e. atoms["spglib_types"][i] == atoms["spglib_types"][j]), but they have different property that is stored in atoms[key] (i.e atoms[key][i] != atoms[key][j]), then those two atoms are considered equal. In the returned conventional_atoms the value of the conventional_atoms[key] are populated based on the last found atom in atoms with each for spglib_type. This rule do not apply to the "positions" key.

References

[1]

Hinuma, Y., Pizzi, G., Kumagai, Y., Oba, F. and Tanaka, I., 2017. Band structure diagram paths based on crystallography. Computational Materials Science, 128, pp.140-184.

[2]

Setyawan, W. and Curtarolo, S., 2010. High-throughput electronic band structure calculations: Challenges and tools. Computational materials science, 49(2), pp. 299-312.

[3]

Togo, A., Shinohara, K. and Tanaka, I., 2024. Spglib: a software library for crystal symmetry search. Science and Technology of Advanced Materials: Methods, 4(1), p.2384822.