pwtools.crys.recip_cell

pwtools.crys.recip_cell(cell)[source]

Reciprocal lattice vectors {a,b,c}* = 2*pi / V * {b,c,a} x {c,a,b}.

The reciprocal volume is (2*pi)**3/V. The length unit of the reciprocal vectors is 1/(length unit of cell), e.g. 1/Angstrom.

Parameters:

cell (array, shape (3,3)) – Matrix with basis vectors as rows.

Returns:

rcell – Reciprocal vectors as rows.

Return type:

array (3,3)

Examples

>>> # the length of recip. cell vectors for a cubic cell of 1 Ang side
>>> # length is 2*pi -> reciprocal length unit is 1/Ang
>>> crys.recip_cell(identity(3))/2/pi
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> crys.recip_cell(identity(3)*2)/2/pi
array([[ 0.5,  0. ,  0. ],
       [ 0. ,  0.5,  0. ],
       [ 0. ,  0. ,  0.5]])