wulfric.cell.get_variation#

wulfric.cell.get_variation(cell, lattice_type=None, length_tolerance=1e-08, angle_tolerance=0.0001)[source]#

Return variation of the lattice as defined in the paper by Setyawan and Curtarolo [1].

Parameters:
cell(3, 3) array-like

Matrix of a primitive cell, rows are interpreted as vectors.

lattice_typestr, optional

One of the 14 lattice types that correspond to the provided cell, case-insensitive. If not provided, then computed automatically from cell. If provided, then it user's responsibility to ensure that lattice_type is correct.

length_tolerancefloat, default \(10^{-8}\)

Tolerance for length variables (lengths of the lattice vectors). Default value is chosen in the contexts of condense matter physics, assuming that length is given in Angstroms. Please choose appropriate tolerance for your problem.

angle_tolerancefloat, default \(10^{-4}\)

Tolerance for angle variables (angles of the lattice). Default value is chosen in the contexts of condense matter physics, assuming that angles are in degrees. Please choose appropriate tolerance for your problem.

Returns:
variationstr

Variation of the lattice defined by the cell.

References

[1]

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

Examples

>>> import wulfric as wulf
>>> # There is no variation of cubic lattice, therefore, just lattice type is
>>> # returned
>>> wulf.cell.get_variation([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
'CUB'
>>> cell = wulf.cell.get_cell_example("bct")
>>> wulf.cell.get_variation(cell)
'BCT1'
>>> # If lattice type is given and it is incorrect, then the behaviour is undefined.abs
>>> # It may return wrong result
>>> wulf.cell.get_variation(cell, lattice_type="cub")
'CUB'
>>> # Or give an error
>>> wulf.cell.get_variation(cell, lattice_type="mclc")
Traceback (most recent call last):
...
ValueError: alpha > 90 or or b > c with 0.0001 or 1e-08 tolerance:
...