12.07.2015 Views

Ab initio molecular dynamics: Theory and Implementation

Ab initio molecular dynamics: Theory and Implementation

Ab initio molecular dynamics: Theory and Implementation

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CALL SGEMM(’T’,’N’,M,N b ,2*N PW ,2,&& scr(1,0),2*N PW ,cr(1,1),2*N PW ,0,fnl(i,1),N p )ENDFourier transform routines are assumed to work on complex data <strong>and</strong> returnalso arrays with complex numbers. The transform of data with the density cutoff isshown in the next two pseudo code sections. It is assumed that a three dimensionalfast Fourier transform routine exists. This is in fact the case on most computerswhere optimized scientific libraries are available. The next two pseudo code segmentsshow the transform of the charge density from Fourier space to real space<strong>and</strong> back.MODULE INVFFTscr(1:N x ,1:N y ,1:N z ) = 0FOR i=1:N Dscr(ipg(1,i),ipg(2,i),ipg(3,i)) = rhog(i)scr(img(1,i),img(2,i),img(3,i)) = CONJG[rhog(i)]ENDCALL FFT3D("INV",scr)n(1:N x ,1:N y ,1:N z ) = REAL[scr(1:N x ,1:N y ,1:N z )]MODULE FWFFTscr(1:N x ,1:N y ,1:N z ) = n(1:N x ,1:N y ,1:N z )CALL FFT3D("FW",scr)FOR i=1:N Drhog(i) = scr(ipg(1,i),ipg(2,i),ipg(3,i))ENDSpecial kernels are presented for the calculation of the density <strong>and</strong> the applicationof the local potential. These are the implementation of the flow charts shown inFig. 8. The operation count of these routines is N b N log[N]. In most applicationsthese routines take most of the computer time. Only for the biggest applicationspossible on todays computers the cubic scaling of the orthogonalization <strong>and</strong> thenonlocal pseudopotential become dominant. A small prefactor <strong>and</strong> the optimizedimplementation of the overlap are the reasons for this.In the Fourier transforms of the wavefunction two properties are used to speedup the calculation. First, because the wavefunctions are real two transforms can bedone at the same time, <strong>and</strong> second, the smaller cutoff of the wavefunctions can beused to avoid some parts of the transforms. The use of the sparsity in the Fouriertransforms is not shown in the following modules. In an actual implementation amask will be generated <strong>and</strong> only transforms allowed by this mask will be executed.Under optimal circumstances a gain of almost a factor of two can be achieved.81

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!