kristal.geometry¶

Various utilities for working with atoms’ equivalence positions.

class kristal.geometry.equiv.FractionalCoordinateSystem(a, b, c, alpha, beta, gamma)

Class representing fractional coordinates system.

Variables: a (float) – length of first periodic vector. b (float) – length of second periodic vector. c (float) – length of second periodic vector. alpha (float) – an angle between second and third periodic vector. beta (float) – an angle between first and third periodic vector. gamma (float) – an angle between first and second periodic vector. a (float) – length of first periodic vector. b (float) – length of second periodic vector. c (float) – length of second periodic vector. alpha (float) – an angle between second and third periodic vector. beta (float) – an angle between first and third periodic vector. gamma (float) – an angle between first and second periodic vector.
change_of_basis_matrix()

Change of basis matrix from fractional to Cartesian coordinates.

Let $$(u, v, w)$$ be components of arbitrary vector in fractional coordinates. Components of this vector in Cartesian coordinates are given by

$\begin{split}\begin{bmatrix} x \\ y \\ z \end{bmatrix} = M \cdot \begin{bmatrix} u \\ v \\ w \end{bmatrix}\end{split}$

where $$M$$ is given by

$\begin{split}M = \begin{bmatrix} a & b \cos(\gamma) & c \cos(\beta) \\ 0 & b \sin(\gamma) & c \frac{\cos(\alpha) - \cos(\beta)\cos(\gamma)}{\sin(\gamma)} \\ 0 & 0 & \frac{V}{ab \sin(\gamma)} \end{bmatrix}\end{split}$

This method returns $$M$$ from the above equation.

inv_change_of_basis_matrix()

“Matrix changing basis from this system to Cartesian.

This is an inverse of a matrix $$M$$ returned by change_of_basis_matrix().

unit_cell_volume

Volume of the cell in this coordinates system.

Volume of the unit cell is defined as a volume of parallelepiped determined by periodic vectors and is given by:

$V = abc \sqrt{1 - \cos^2(\alpha) - \cos^2(\beta) - \cos^2(\gamma) + 2\cos(\alpha)\cos(\beta) \cos(\gamma)}$
kristal.geometry.equiv.cos2(x)

Shortcut for computing np.cos(x) ** 2.

kristal.geometry.equiv.sin2(x)

Shortcut for computing np.sin(x) ** 2.