@cached<EOL><INDENT>def reciprocal(self):<DEDENT>
U, S, Vt = np.linalg.svd(self.matrix*self.active)<EOL>Sinv = np.zeros(S.shape, float)<EOL>for i in range(<NUM_LIT:3>):<EOL><INDENT>if abs(S[i]) < self.eps:<EOL><INDENT>Sinv[i] = <NUM_LIT:0.0><EOL><DEDENT>else:<EOL><INDENT>Sinv[i] = <NUM_LIT:1.0>/S[i]<EOL><DEDENT><DEDENT>return np.dot(U*Sinv, Vt)*self.active<EOL>
The reciprocal of the unit cell

           In case of a three-dimensional periodic system, this is trivially the
           transpose of the inverse of the cell matrix. This means that each
           column of the matrix corresponds to a reciprocal cell vector. In case
           of lower-dimensional periodicity, the inactive columns are zero, and
           the active columns span the same sub space as the original cell
           vectors.