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
cellandatoms.- 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 thecellalone (effectively assuming that thecellis a primitive one).- conventionstr, default "HPKOT"
Convention for the definition of the conventional cell. Case-insensitive. Supported:
- spglib_data
SpglibData, optional If you need more control on the parameters passed to the spglib, then you can get
spglib_datamanually and pass it to this function. Use wulfric's interface to spglib asspglib_data = wulfric.get_spglib_data(...)
using the same
cellandatoms["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 thatconventional_cellwithconventional_atomsdescribe the same crystal (and in the same spatial orientation) ascellwithatoms. It has all keys as inatoms. Additional key"spglib_types"is added if it was not present inatoms.
Notes
spglib uses
typesto distinguish the atoms. To see how wulfric deduces thetypesfor given atoms seewulfric.get_spglib_types().If two atoms
iandjhave the same spglib_type (i.e.atoms["spglib_types"][i] == atoms["spglib_types"][j]), but they have different property that is stored inatoms[key](i.eatoms[key][i] != atoms[key][j]), then those two atoms are considered equal. In the returnedconventional_atomsthe value of theconventional_atoms[key]are populated based on the last found atom inatomswith 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.