[Pw_forum] Problem with modifying the QE code for the spin-polarized vdW-DF calculation

WANG Wei wonvein at gmail.com
Mon Aug 1 12:47:37 CEST 2011


Dear QE developers,

As well known,  the non-local vdW correlation is not defined for
spin-polarised systems. However, I noted that some codes (such as vasp,
Junolo) can evaluate the non-local vdW correlation energy on the sum of the
spin-up and spin-down densities. Is it a good approximation? Because my
systems consist of charged defects, I have to modify the  QE code to support
the spin-polarized vdW-DF calculation.

(1) Firstly, I modified the /PW/stres_nonloc_dft.f90 file. I defined the
rho_valence(:, :) and replaced the "rho" in the " CALL stress_vdW_DF(rho,
rho_core, sigma_nonloc_dft)" with "rho_valence", namely

#################################
  real(DP), intent(in)     :: rho (dfftp%nnr, nspin), rho_core (dfftp%nnr)
  real(DP), intent(inout)  :: sigma_nonloc_dft (3, 3)
  integer ::nspin, inlc
  real(DP), allocatable    :: rho_valence(:, :)
  integer :: l, m, i

  allocate(rho_valence(dfftp%nnr, 1))

  sigma_nonloc_dft(:,:) = 0.d0
  inlc = get_inlc()


 if (inlc==1 .or. inlc==2) then
     if (nspin>4) call errore('stres_vdW_DF', &
                  'vdW+DF non implemented in non-collinear magnetic
calculations',1)
     ! get the valence charge density
       do i=1, nspin
          rho_valence(:,1)=rho_valence(:,1)+rho(:,i)
       end do
    CALL stress_vdW_DF(rho_valence, rho_core, sigma_nonloc_dft)

  end if

  return
deallocate(rho_valence)
end subroutine stres_nonloc_dft
#################################

(2) Secondly, I commented out all the "call errore('xc_vdW_DF','vdW
functional not implemented for spin polarized runs',
size(rho_valence,2)-1)".  Moreover, I also modified the subroutine
dv_drho_vdw.


#################################
    !! Delta rho in real space
    do i=1,nspin
    CALL invfft ('Dense', drho(:,i), dfftp)
    drho_real(:) = drho_real(:)+REAL( drho(:,i) )
    end do
#################################

My question is:  Are there other parts need to modify?

Best Regards,
WANG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20110801/1fdb77ac/attachment.html>


More information about the users mailing list