Computes
S_i are the Pauli matrices and n=(n_x,n_y,n_z) is the unit vector along the chosen spin quantization axis
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ws_region_type), | intent(in) | :: | ws_region | |||
| type(pw90_spin_mod_type), | intent(in) | :: | pw90_spin | |||
| type(wannier_data_type), | intent(in) | :: | wannier_data | |||
| type(ws_distance_type), | intent(inout) | :: | ws_distance | |||
| type(wigner_seitz_type), | intent(in) | :: | wigner_seitz | |||
| complex(kind=dp), | intent(inout), | allocatable | :: | HH_R(:,:,:) | ||
| complex(kind=dp), | intent(inout), | allocatable | :: | SS_R(:,:,:,:) | ||
| real(kind=dp), | intent(in) | :: | kpt(3) | |||
| real(kind=dp), | intent(in) | :: | real_lattice(3,3) | |||
| real(kind=dp), | intent(out) | :: | spn_nk(num_wann) | |||
| integer, | intent(in) | :: | mp_grid(3) | |||
| integer, | intent(in) | :: | num_wann | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine spin_get_nk(ws_region, pw90_spin, wannier_data, ws_distance, wigner_seitz, HH_R, & SS_R, kpt, real_lattice, spn_nk, mp_grid, num_wann, error, comm) !================================================! ! !! Computes <psi_{mk}^(H)|S.n|psi_{mk}^(H)> (m=1,...,num_wann) !! where S.n = n_x.S_x + n_y.S_y + n_z.Z_z !! !! S_i are the Pauli matrices and n=(n_x,n_y,n_z) is the unit !! vector along the chosen spin quantization axis ! !================================================ ! use w90_constants, only: dp, pi 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_types, only: pw90_spin_mod_type, wigner_seitz_type use w90_postw90_common, only: pw90common_fourier_R_to_k use w90_comms, only: w90_comm_type ! arguments type(pw90_spin_mod_type), intent(in) :: pw90_spin 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) :: num_wann integer, intent(in) :: mp_grid(3) real(kind=dp), intent(in) :: kpt(3) real(kind=dp), intent(out) :: spn_nk(num_wann) real(kind=dp), intent(in) :: real_lattice(3, 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 :: UU(:, :) complex(kind=dp), allocatable :: SS(:, :, :), SS_n(:, :) ! Misc/Dummy integer :: is real(kind=dp) :: eig(num_wann), alpha(3), conv allocate (HH(num_wann, num_wann)) allocate (UU(num_wann, num_wann)) allocate (SS(num_wann, num_wann, 3)) allocate (SS_n(num_wann, num_wann)) 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 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 end do ! Unit vector along the magnetization direction conv = 180.0_dp/pi alpha(1) = sin(pw90_spin%axis_polar/conv)*cos(pw90_spin%axis_azimuth/conv) alpha(2) = sin(pw90_spin%axis_polar/conv)*sin(pw90_spin%axis_azimuth/conv) alpha(3) = cos(pw90_spin%axis_polar/conv) ! Vector of spin matrices projected along the quantization axis SS_n(:, :) = alpha(1)*SS(:, :, 1) + alpha(2)*SS(:, :, 2) + alpha(3)*SS(:, :, 3) spn_nk(:) = real(utility_rotate_diag(SS_n, UU, num_wann), dp) end subroutine spin_get_nk