Dear QE developers,<br><br>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. <br><br>(1) Firstly, I modified the /PW/stres_nonloc_dft.f90 file. I defined the rho_valence(:, :) <span class="contentTitle"></span>and replaced the "rho" in the " CALL stress_vdW_DF(rho, rho_core, sigma_nonloc_dft)" with "rho_valence", namely<br>
<br>#################################<br> real(DP), intent(in) :: rho (dfftp%nnr, nspin), rho_core (dfftp%nnr)<br> real(DP), intent(inout) :: sigma_nonloc_dft (3, 3)<br> integer ::nspin, inlc<br> real(DP), allocatable :: rho_valence(:, :)<br>
integer :: l, m, i<br><br> allocate(rho_valence(dfftp%nnr, 1))<br><br> sigma_nonloc_dft(:,:) = 0.d0<br> inlc = get_inlc()<br><br><br> if (inlc==1 .or. inlc==2) then<br> if (nspin>4) call errore('stres_vdW_DF', &<br>
'vdW+DF non implemented in non-collinear magnetic calculations',1)<br> ! get the valence charge density<br> do i=1, nspin<br> rho_valence(:,1)=rho_valence(:,1)+rho(:,i)<br> end do<br>
CALL stress_vdW_DF(rho_valence, rho_core, sigma_nonloc_dft)<br><br> end if<br><br> return<br>deallocate(rho_valence)<br>end subroutine stres_nonloc_dft<br>#################################<br><br>(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.<br>
<br><br>#################################<br> !! Delta rho in real space<br> do i=1,nspin<br> CALL invfft ('Dense', drho(:,i), dfftp)<br> drho_real(:) = drho_real(:)+REAL( drho(:,i) )<br> end do<br>
#################################<br><br>My question is: Are there other parts need to <span class="" id="tran_2_11">modify?<br><br>Best Regards,<br>WANG<br></span>