Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix in SLWF+C from Jae-Mo-Lin. #206

Merged
merged 1 commit into from
Oct 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/wannierise.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1680,8 +1680,12 @@ end subroutine wann_phases
subroutine wann_omega(csheet, sheet, rave, r2ave, rave2, wann_spread)
!==================================================================!
! !
!! Calculate the Wannier Function spread
!! Calculate the Wannier Function spread !
! !
! Modified by Valerio Vitale for the SLWF+C method (PRB 90, 165125)!
! Jun 2018
! Based on a previous implementation by Charles T. Johnson
! and original implementation by Radu Miron
!===================================================================
use w90_parameters, only: num_wann, m_matrix, nntot, wb, bk, num_kpts, &
omega_invariant, timing_level, &
Expand Down Expand Up @@ -1868,12 +1872,12 @@ subroutine wann_omega(csheet, sheet, rave, r2ave, rave2, wann_spread)

call comms_allreduce(wann_spread%om_nu, 1, 'SUM')

wann_spread%om_nu = wann_spread%om_nu/real(num_kpts, dp)

do n = 1, slwf_num
wann_spread%om_nu = wann_spread%om_nu + lambda_loc*sum(ccentres_cart(n, :)**2)
end do

wann_spread%om_nu = wann_spread%om_nu/real(num_kpts, dp)

end if

wann_spread%om_tot = wann_spread%om_iod + wann_spread%om_d + wann_spread%om_nu
Expand Down Expand Up @@ -1953,6 +1957,10 @@ subroutine wann_domega(csheet, sheet, rave, cdodq)
! !
! Calculate the Gradient of the Wannier Function spread !
! !
! Modified by Valerio Vitale for the SLWF+C method (PRB 90, 165125)!
! Jun 2018
! Based on a previous implementation by Charles T. Johnson
! and original implementation by Radu Miron
!===================================================================
use w90_parameters, only: num_wann, wb, bk, nntot, m_matrix, num_kpts, &
timing_level, selective_loc, &
Expand Down Expand Up @@ -2137,10 +2145,10 @@ subroutine wann_domega(csheet, sheet, rave, cdodq)
(crt(m, n)*ln_tmp_loc(n, nn, nkp_loc) &
+ conjg(crt(n, m)*ln_tmp_loc(m, nn, nkp_loc))) &
*cmplx(0.0_dp, -0.5_dp, kind=dp)
cdodq_loc(m, n, nkp_loc) = &
cdodq_loc(m, n, nkp_loc) - wb(nn) &
*(crt(m, n)*rnkb_loc(n, nn, nkp_loc) + &
conjg(crt(n, m)*rnkb_loc(m, nn, nkp_loc)))*cmplx(0.0_dp, -0.5_dp, kind=dp)
cdodq_loc(m, n, nkp_loc) = cdodq_loc(m, n, nkp_loc) - wb(nn) &
*(crt(m, n)*rnkb_loc(n, nn, nkp_loc) &
+ conjg(crt(n, m)*rnkb_loc(m, nn, nkp_loc))) &
*cmplx(0.0_dp, -0.5_dp, kind=dp)
enddo
enddo
end if
Expand Down