spin_get_S Subroutine

public subroutine spin_get_S(kpt, S)

Uses

  • proc~~spin_get_s~~UsesGraph proc~spin_get_s spin_get_S module~w90_postw90_common w90_postw90_common proc~spin_get_s->module~w90_postw90_common module~w90_utility w90_utility proc~spin_get_s->module~w90_utility module~w90_constants w90_constants proc~spin_get_s->module~w90_constants module~w90_get_oper w90_get_oper proc~spin_get_s->module~w90_get_oper module~w90_io w90_io proc~spin_get_s->module~w90_io module~w90_parameters w90_parameters proc~spin_get_s->module~w90_parameters module~w90_postw90_common->module~w90_constants module~w90_comms w90_comms module~w90_postw90_common->module~w90_comms module~w90_utility->module~w90_constants module~w90_get_oper->module~w90_constants module~w90_io->module~w90_constants module~w90_parameters->module~w90_constants module~w90_parameters->module~w90_io module~w90_comms->module~w90_constants module~w90_comms->module~w90_io

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: kpt(3)
real(kind=dp), intent(out) :: S(num_wann,3)

Calls

proc~~spin_get_s~~CallsGraph proc~spin_get_s spin_get_S proc~utility_diagonalize utility_diagonalize proc~spin_get_s->proc~utility_diagonalize proc~pw90common_fourier_r_to_k pw90common_fourier_R_to_k proc~spin_get_s->proc~pw90common_fourier_r_to_k proc~utility_rotate_diag utility_rotate_diag proc~spin_get_s->proc~utility_rotate_diag proc~io_error io_error proc~utility_diagonalize->proc~io_error proc~utility_zgemm_new utility_zgemm_new proc~utility_rotate_diag->proc~utility_zgemm_new proc~utility_matmul_diag utility_matmul_diag proc~utility_rotate_diag->proc~utility_matmul_diag

Called by

proc~~spin_get_s~~CalledByGraph proc~spin_get_s spin_get_S proc~gyrotropic_get_k_list gyrotropic_get_k_list proc~gyrotropic_get_k_list->proc~spin_get_s proc~gyrotropic_main gyrotropic_main proc~gyrotropic_main->proc~gyrotropic_get_k_list

Contents

Source Code


Source Code

  subroutine spin_get_S(kpt, S)
    !===========================================================!
    !                                                           !
    ! Computes <psi_{nk}^(H)|S|psi_{nk}^(H)> (n=1,...,num_wann) !
    ! where S = (S_x,S_y,S_z) is the vector of Pauli matrices   !
    !                                                           !
    !========================================================== !

    use w90_constants, only: dp, pi, cmplx_0, cmplx_i
    use w90_io, only: io_error
    use w90_utility, only: utility_diagonalize, utility_rotate_diag
    use w90_parameters, only: num_wann
    use w90_postw90_common, only: pw90common_fourier_R_to_k
    use w90_get_oper, only: HH_R, SS_R

    ! Arguments
    !
    real(kind=dp), intent(in)  :: kpt(3)
    real(kind=dp), intent(out) :: S(num_wann, 3)

    ! Physics
    !
    complex(kind=dp), allocatable :: HH(:, :)
    complex(kind=dp), allocatable :: UU(:, :)
    complex(kind=dp), allocatable :: SS(:, :, :)
    real(kind=dp)                 :: eig(num_wann)

    ! Misc/Dummy
    !
    integer :: i

    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(kpt, HH_R, HH, 0)
    call utility_diagonalize(HH, num_wann, eig, UU)

    do i = 1, 3
      call pw90common_fourier_R_to_k(kpt, SS_R(:, :, :, i), SS(:, :, i), 0)
      S(:, i) = real(utility_rotate_diag(SS(:, :, i), UU, num_wann), dp)
    enddo

  end subroutine spin_get_S