Computes the spin magnetic moment by Wannier interpolation at the specified k-point
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | kpt(3) | |||
| real(kind=dp), | intent(in) | :: | ef | |||
| real(kind=dp), | intent(out) | :: | spn_k(3) | |||
| integer, | intent(in) | :: | num_wann | |||
| type(ws_region_type), | intent(in) | :: | ws_region | |||
| type(wannier_data_type), | intent(in) | :: | wannier_data | |||
| real(kind=dp), | intent(in) | :: | real_lattice(3,3) | |||
| integer, | intent(in) | :: | mp_grid(3) | |||
| type(ws_distance_type), | intent(inout) | :: | ws_distance | |||
| complex(kind=dp), | intent(inout), | allocatable | :: | HH_R(:,:,:) | ||
| complex(kind=dp), | intent(inout), | allocatable | :: | SS_R(:,:,:,:) | ||
| type(wigner_seitz_type), | intent(in) | :: | wigner_seitz | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine spin_get_moment_k(kpt, ef, spn_k, num_wann, ws_region, wannier_data, real_lattice, & mp_grid, ws_distance, HH_R, SS_R, wigner_seitz, error, comm) !================================================! !! Computes the spin magnetic moment by Wannier interpolation !! at the specified k-point !================================================! use w90_constants, only: dp, cmplx_i use w90_utility, only: utility_diagonalize, utility_rotate_diag use w90_types, only: print_output_type, wannier_data_type, ws_region_type, & ws_distance_type use w90_postw90_common, only: pw90common_fourier_R_to_k, pw90common_get_occ use w90_postw90_types, only: wigner_seitz_type use w90_comms, only: w90_comm_type ! arguments type(ws_region_type), intent(in) :: ws_region type(wannier_data_type), intent(in) :: wannier_data type(wigner_seitz_type), intent(in) :: wigner_seitz type(ws_distance_type), intent(inout) :: ws_distance type(w90_error_type), allocatable, intent(out) :: error type(w90_comm_type), intent(in) :: comm integer, intent(in) :: mp_grid(3) integer, intent(in) :: num_wann real(kind=dp), intent(in) :: ef real(kind=dp), intent(in) :: kpt(3) real(kind=dp), intent(in) :: real_lattice(3, 3) real(kind=dp), intent(out) :: spn_k(3) complex(kind=dp), allocatable, intent(inout) :: HH_R(:, :, :) ! <0n|r|Rm> complex(kind=dp), allocatable, intent(inout) :: SS_R(:, :, :, :) ! <0n|sigma_x,y,z|Rm> ! local variables ! Physics complex(kind=dp), allocatable :: HH(:, :) complex(kind=dp), allocatable :: SS(:, :, :) complex(kind=dp), allocatable :: UU(:, :) real(kind=dp) :: spn_nk(num_wann, 3) ! Misc/Dummy integer :: i, is real(kind=dp) :: eig(num_wann), occ(num_wann) allocate (HH(num_wann, num_wann)) allocate (UU(num_wann, num_wann)) allocate (SS(num_wann, num_wann, 3)) call pw90common_fourier_R_to_k(ws_region, wannier_data, ws_distance, wigner_seitz, HH, HH_R, & kpt, real_lattice, mp_grid, 0, num_wann, error, comm) if (allocated(error)) return call utility_diagonalize(HH, num_wann, eig, UU, error, comm) if (allocated(error)) return call pw90common_get_occ(ef, eig, occ, num_wann) spn_k(1:3) = 0.0_dp do is = 1, 3 call pw90common_fourier_R_to_k(ws_region, wannier_data, ws_distance, wigner_seitz, & SS(:, :, is), SS_R(:, :, :, is), kpt, real_lattice, mp_grid, & 0, num_wann, error, comm) if (allocated(error)) return spn_nk(:, is) = aimag(cmplx_i*utility_rotate_diag(SS(:, :, is), UU, num_wann)) do i = 1, num_wann spn_k(is) = spn_k(is) + occ(i)*spn_nk(i, is) end do end do end subroutine spin_get_moment_k