perturbopy.postproc.utils.lattice.cryst2cart

perturbopy.postproc.utils.lattice.cryst2cart(point_array, lat, recip_lat, forward=True, real_space=True)

Method to convert points in real space or reciprocal space between crystal and cartesian coordinates, given the crystal lattice. Real space points in cartesian units have units of alat. Reciprocal points in cartesian coordinates have units of 2pi/alat.

Parameters:
  • point_array (array) – 3xN Array of vectors [v1, v2, v3 …] to be converted

  • lat (array) – 3x3 array of lattice vectors [v1, v2, v3] in units of alat

  • recip_lat (array) – 3x3 array of reciprocal lattice vectors [v1, v2, v3 in units of 2pi/a

  • forward (bool, optional) – If true, vectors will be converted from crystal to cartesian coordinates. If false, vectors will be converted from cartesian to crystal coordinates

  • real_space (bool, optional) – If true, vectors are assumed to be in real space (i.e. atomic positions). If false, vectors are assumed to be in reciprocal space (i.e. reciprocal points).

Returns:

converted_point_array – Array containing the converted vectors [v1, v2, v3, …]

Return type:

array