spglib.reduce module

spglib.reduce module#

Lattice reduction operations.

spglib.reduce.delaunay_reduce(lattice, eps=1e-05)[source]#

Run Delaunay reduction. When the search failed, None is returned.

The transformation from original basis vectors \(( \mathbf{a} \; \mathbf{b} \; \mathbf{c} )\) to final basis vectors \(( \mathbf{a}' \; \mathbf{b}' \; \mathbf{c}' )\) is achieved by linear combination of basis vectors with integer coefficients without rotating coordinates. Therefore the transformation matrix is obtained by \(\mathbf{P} = ( \mathbf{a} \; \mathbf{b} \; \mathbf{c} ) ( \mathbf{a}' \; \mathbf{b}' \; \mathbf{c}' )^{-1}\) and the matrix elements have to be almost integers.

The algorithm is found in the international tables for crystallography volume A.

Parameters#

lattice: ndarray, (3, 3)

Lattice parameters in the form of

[[a_x, a_y, a_z],
    [b_x, b_y, b_z],
    [c_x, c_y, c_z]]
eps: float

Tolerance parameter, but unlike symprec the unit is not a length. Tolerance to check if volume is close to zero or not and if two basis vectors are orthogonal by the value of dot product being close to zero or not.

Returns#

delaunay_lattice: ndarray, (3, 3)

Reduced lattice parameters are given as a numpy ‘double’ array:

[[a_x, a_y, a_z],
 [b_x, b_y, b_z],
 [c_x, c_y, c_z]]

Notes#

Added in version 1.9.4.

spglib.reduce.niggli_reduce(lattice, eps=1e-05)[source]#

Run Niggli reduction. When the search failed, None is returned.

The transformation from original basis vectors \(( \mathbf{a} \; \mathbf{b} \; \mathbf{c} )\) to final basis vectors \(( \mathbf{a}' \; \mathbf{b}' \; \mathbf{c}' )\) is achieved by linear combination of basis vectors with integer coefficients without rotating coordinates. Therefore the transformation matrix is obtained by \(\mathbf{P} = ( \mathbf{a} \; \mathbf{b} \; \mathbf{c} ) ( \mathbf{a}' \; \mathbf{b}' \; \mathbf{c}' )^{-1}\) and the matrix elements have to be almost integers.

The algorithm detail is found at https://atztogo.github.io/niggli/ and the references are there in.

Parameters#

lattice: ndarray

Lattice parameters in the form of

[[a_x, a_y, a_z],
[b_x, b_y, b_z],
[c_x, c_y, c_z]]
eps: float

Tolerance parameter, but unlike symprec the unit is not a length. This is used to check if difference of norms of two basis vectors is close to zero or not and if two basis vectors are orthogonal by the value of dot product being close to zero or not. The detail is shown at https://atztogo.github.io/niggli/.

Returns#

niggli_lattice: ndarray, (3, 3)
if the Niggli reduction succeeded:

Reduced lattice parameters are given as a numpy ‘double’ array:

[[a_x, a_y, a_z],
[b_x, b_y, b_z],
[c_x, c_y, c_z]]

otherwise None is returned.

Notes#

Added in version 1.9.4.