next up previous contents index
Next: Exchange and Correlation Functionals Up: Implementation Previous: Density and Force Calculations   Contents   Index

Saving Computer Time

In an implementation of the plane wave/pseudopotential method it is possible to use the special structure of the wavefunctions to save computer time. If the Kohn-Sham orbitals are only calculated at the $ \Gamma$ -point then the wavefunctions can be taken as real quantities. The plane wave expansion coefficients of real functions have to following symmetry property

$\displaystyle c(-{\bf G}) = c^\star({\bf G}) \enspace ,$ (235)

and $ c({\bf0})$ is real. Therefore it is possible to store only half of the coefficients and recalculate the others whenever needed. In addition the symmetry can be used in calculating overlap integrals

$\displaystyle \langle \Phi_i \mid \Phi_j \rangle = \sum_{\bf G} c_i^\star({\bf G}) c_j({\bf G}) \enspace .$ (236)

The sum can be restricted to half of the G-vectors

$\displaystyle \langle \Phi_i \mid \Phi_j \rangle = c_i({\bf0}) c_j({\bf0}) + \sum^{'}_{\bf G} 2 \;$   Re$\displaystyle ( c_i^\star({\bf G}) c_j({\bf G}) ) \enspace .$ (237)

This sum can be implemented efficiently using real arithmetic avoiding multiplication of complex numbers.

Another direct use of the symmetry of the wavefunctions can be made when using Fourier transforms. The Fourier transform pair is defined by

$\displaystyle F(\omega)$ $\displaystyle =$ $\displaystyle \int_{- \infty}^{\infty} f(t) e^{i \omega t} dt$  
$\displaystyle f(t)$ $\displaystyle =$ $\displaystyle {1 \over 2 \pi} \int_{- \infty}^{\infty} F(\omega)
e^{-i \omega t} d \omega \enspace ,$  

where in our case t is the direct (real) space and $ \omega$ is reciprocal space (G - space). We want to make use of the special structure of our wavefunctions

$\displaystyle f(t)$   is real$\displaystyle \Rightarrow F(\omega) = F(-\omega)^* \enspace ,$ (238)

that allows to perform two transforms together. First we investigate a real to complex transform. We define a new function

$\displaystyle g(t) = f_1(t) + i f_2(t)
$

then we get for the transformed function
$\displaystyle G(\omega)$ $\displaystyle =$ $\displaystyle F_1(\omega) + i F_2(\omega)$  
$\displaystyle G(-\omega)$ $\displaystyle =$ $\displaystyle F_1(-\omega) + i F_2(-\omega)$  
  $\displaystyle =$ $\displaystyle F_1(\omega)^* + i F_2(\omega)^*$  

We can calculate the two new functions $ G(\omega) + G(-\omega)$ and $ G(\omega) - G(-\omega)$ .
$\displaystyle G(\omega) + G(-\omega)$ $\displaystyle =$ $\displaystyle F_1(\omega) + F_1(\omega)^* + i \left(
F_2(\omega) + F_2(\omega)^* \right)$  
  $\displaystyle =$ $\displaystyle 2 \;$   Re$\displaystyle \left[ F_1(\omega) \right] + 2 \; i \;$   Re$\displaystyle \left[ F_2(\omega) \right]$  
$\displaystyle G(\omega) - G(-\omega)$ $\displaystyle =$ $\displaystyle 2 \; i \;$   Im$\displaystyle \left[ F_1(\omega) \right] -
2 \;$   Im$\displaystyle \left[ F_2(\omega) \right]$  

and we find
$\displaystyle F_1(\omega)$ $\displaystyle =$ $\displaystyle {1 \over 2} \left( \mbox{Re} \left[ G(\omega) + G(-\omega)
\right] + i \mbox{Im} \left[ G(\omega) - G(-\omega) \right]
\right)$  
$\displaystyle F_2(\omega)$ $\displaystyle =$ $\displaystyle {1 \over 2} \left( \mbox{Im} \left[ G(\omega) + G(-\omega)
\right] + i \mbox{Re} \left[ G(\omega) - G(-\omega) \right]
\right)$  

For the complex to real transform we define

$\displaystyle G(\omega) = F_1(\omega) + i F_2(\omega)
$

then we get for the functions in direct (time) space
$\displaystyle g(t)$ $\displaystyle =$ $\displaystyle f_1(t) + i f_2(t)$  
$\displaystyle f_1(t)$ $\displaystyle =$ Re$\displaystyle \left[ g(t) \right]$  
$\displaystyle f_2(t)$ $\displaystyle =$ Im$\displaystyle \left[ g(t) \right]$  

Finally, we can take advantage of the fact that the wavefunction cutoff is only $ 1/4$ of the density cutoff. Therefore in reciprocal space only the values of grid points inside a sphere of radius N/4 are non-zero, where for simplicity we assume a simple cubic box with N$ ^3$ grid points. In a three dimensional FFT there will be many one dimensional transforms that can be avoided. In table 4 the amount of work for a full transform and a transform that makes use of the sparsity of the data set are compared. In both transforms the savings amount to about a factor of two.

Table 4: Comparison of number of one dimensional FFT's needed in a full transform and a transform making use of the sparsity of the data set in reciprocal space
Reciprocal space to direct space transform Direct space to reciprocal space transform
full transform sparse transform full transform sparse transform
N$ ^2$ $ {\pi \over 16}$ N$ ^2$ N$ ^2$ N$ ^2$
N$ ^2$ $ {1 \over 2}$ N$ ^2$ N$ ^2$ $ {1 \over 2}$ N$ ^2$
N$ ^2$ N$ ^2$ N$ ^2$ $ {\pi \over 16}$ N$ ^2$
3 N$ ^2$ $ \left( {3 \over 2} + {\pi \over 16} \right) $ N$ ^2$ 3 N$ ^2$ $ \left( {3 \over 2} + {\pi \over 16} \right) $ N$ ^2$



next up previous contents index
Next: Exchange and Correlation Functionals Up: Implementation Previous: Density and Force Calculations   Contents   Index
Costas Bekas 2008-09-04