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.

a set of wavefunctions in Fourier spaceB i (G) = ∑ jA j (G)S ji . (264)Again this kernel can be executed by using the optimized blas matrix multiplyroutines.MODULE RotationCALL SGEMM(’N’,’N’,2*N PW ,N b ,N b ,1,ca(1,1),2*N PW ,&& smat,N b ,0,cb(1,1),2*N PW )The overlap calculation of the projectors of the nonlinear pseudopotential withthe wavefunctions in Fourier space scales as N p N b N PW . As the projectors arestored as real quantities, the imaginary prefactor <strong>and</strong> the structure factor haveto be applied before the inner product can be calculated. The following pseudocode calculates M projectors at a time, making use of the special structure of theprefactor. This allows again to do all calculations with real quantities. The codeassumes that the total number of projectors is a multiple of M. A generalizationof the code to other cases is straightforward. By using batches of projectors theoverlap can be calculated using matrix multiplies. The variable lp(i) holds theangular momentum of projector i.MODULE FNLFOR i=1:N p ,MIF (MOD(lp(i),2) == 0) THENFOR j=0:M-1pf = -1**(lp(i+j)/2)FOR k=1:N PWt = pro(k) * pfer = REAL[eigr(k,iat(i+j))]ei = IMAG[eigr(k,iat(i+j))]scr(k,j) = CMPLX[t * er,t * ei]ENDENDELSEFOR j=0:M-1pf = -1**(lp(i+j)/2+1)FOR k=1:N PWt = pro(k) * pfer = REAL[eigr(k,iat(i+j))]ei = IMAG[eigr(k,iat(i+j))]scr(k,j) = CMPLX[-t * ei,t * er]ENDENDEND IFscr(1,0:M-1) = scr(1,0:M-1)/280

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

Saved successfully!

Ooh no, something went wrong!