pw90common_fourier_R_to_k_new_second_d Subroutine

public subroutine pw90common_fourier_R_to_k_new_second_d(kpt, OO_R, num_wann, ws_region, wannier_data, real_lattice, mp_grid, ws_distance, wigner_seitz, error, comm, OO, OO_da, OO_dadb)

Uses

  • proc~~pw90common_fourier_r_to_k_new_second_d~~UsesGraph proc~pw90common_fourier_r_to_k_new_second_d pw90common_fourier_R_to_k_new_second_d module~w90_comms w90_comms proc~pw90common_fourier_r_to_k_new_second_d->module~w90_comms module~w90_constants w90_constants proc~pw90common_fourier_r_to_k_new_second_d->module~w90_constants module~w90_postw90_types w90_postw90_types proc~pw90common_fourier_r_to_k_new_second_d->module~w90_postw90_types module~w90_types w90_types proc~pw90common_fourier_r_to_k_new_second_d->module~w90_types module~w90_ws_distance w90_ws_distance proc~pw90common_fourier_r_to_k_new_second_d->module~w90_ws_distance module~w90_comms->module~w90_constants module~w90_error_base w90_error_base module~w90_comms->module~w90_error_base module~w90_postw90_types->module~w90_comms module~w90_postw90_types->module~w90_constants module~w90_types->module~w90_constants module~w90_ws_distance->module~w90_constants module~w90_error w90_error module~w90_ws_distance->module~w90_error module~w90_error->module~w90_comms module~w90_error->module~w90_error_base

For OO: For : where R_{x,y,z} are the Cartesian components of R For : where R_{xi,yi,zi} are the Cartesian components of R

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: kpt(3)
complex(kind=dp), intent(in) :: OO_R(:,:,:)
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
type(wigner_seitz_type), intent(in) :: wigner_seitz
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm
complex(kind=dp), intent(out), optional :: OO(:,:)
complex(kind=dp), intent(out), optional :: OO_da(:,:,:)
complex(kind=dp), intent(out), optional :: OO_dadb(:,:,:,:)

Called by

proc~~pw90common_fourier_r_to_k_new_second_d~~CalledByGraph proc~pw90common_fourier_r_to_k_new_second_d pw90common_fourier_R_to_k_new_second_d proc~wham_get_eig_uu_hh_aa_sc wham_get_eig_UU_HH_AA_sc proc~wham_get_eig_uu_hh_aa_sc->proc~pw90common_fourier_r_to_k_new_second_d proc~berry_get_kdotp berry_get_kdotp proc~berry_get_kdotp->proc~wham_get_eig_uu_hh_aa_sc proc~berry_get_sc_klist berry_get_sc_klist proc~berry_get_sc_klist->proc~wham_get_eig_uu_hh_aa_sc proc~berry_main berry_main proc~berry_main->proc~berry_get_kdotp proc~berry_main->proc~berry_get_sc_klist program~postw90 postw90 program~postw90->proc~berry_main

Source Code

  subroutine pw90common_fourier_R_to_k_new_second_d(kpt, OO_R, num_wann, ws_region, wannier_data, &
                                                    real_lattice, mp_grid, ws_distance, &
                                                    wigner_seitz, error, comm, OO, OO_da, OO_dadb)
    !================================================!
    !
    !! For OO:
    !! $$O_{ij}(k) = \sum_R e^{+ik.R}.O_{ij}(R)$$
    !! For $$OO_{dx,dy,dz}$$:
    !! $$\sum_R [i.R_{dx,dy,dz}.e^{+ik.R}.O_{ij}(R)]$$
    !! where R_{x,y,z} are the Cartesian components of R
    !! For $$OO_{dx1,dy1,dz1;dx2,dy2,dz2}$$:
    !! $$-\sum_R [R_{dx1,dy1,dz1}.R_{dx2,dy2,dz2}.e^{+ik.R}.O_{ij}(R)]$$
    !! where R_{xi,yi,zi} are the Cartesian components of R
    !
    !================================================!

    use w90_constants, only: dp, cmplx_0, cmplx_i, twopi
    use w90_types, only: ws_region_type, wannier_data_type, ws_distance_type
    use w90_ws_distance, only: ws_translate_dist
    use w90_postw90_types, only: wigner_seitz_type
    use w90_comms, only: w90_comm_type

    implicit none

    ! 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) :: kpt(3), real_lattice(3, 3)

    complex(kind=dp), intent(in) :: OO_R(:, :, :)
    complex(kind=dp), optional, intent(out) :: OO(:, :)
    complex(kind=dp), optional, intent(out) :: OO_da(:, :, :)
    complex(kind=dp), optional, intent(out) :: OO_dadb(:, :, :, :)

    ! local variables
    integer          :: ir, i, j, ideg, a, b
    real(kind=dp)    :: rdotk
    complex(kind=dp) :: phase_fac
    if (present(OO)) OO = cmplx_0
    if (present(OO_da)) OO_da = cmplx_0
    if (present(OO_dadb)) OO_dadb = cmplx_0
    do ir = 1, wigner_seitz%nrpts_pw90
! [lp] Original code, without IJ-dependent shift:
      rdotk = twopi*dot_product(kpt(:), wigner_seitz%irvec_pw90(:, ir))
      phase_fac = cmplx(cos(rdotk), sin(rdotk), dp)
      if (present(OO)) OO(:, :) = OO(:, :) + phase_fac*OO_R(:, :, ir)
      if (present(OO_da)) then
        do a = 1, 3
          OO_da(:, :, a) = OO_da(:, :, a) + cmplx_i*wigner_seitz%crvec_pw90(a, ir)*phase_fac &
                           *OO_R(:, :, ir)
        end do
      end if
      if (present(OO_dadb)) then
        do a = 1, 3
          do b = 1, 3
            OO_dadb(:, :, a, b) = OO_dadb(:, :, a, b) - &
                                  wigner_seitz%crvec_pw90(a, ir)*wigner_seitz%crvec_pw90(b, ir)*phase_fac &
                                  *OO_R(:, :, ir)
          end do
        end do
      end if
    end do

  end subroutine pw90common_fourier_R_to_k_new_second_d