internal_zmatrix_gamma Subroutine

public subroutine internal_zmatrix_gamma(cbw, m_matrix_orig_local, u_matrix_opt, rmtrx, wb, indxnfroz, ndimfroz, ndimwin, nnlist, nkp, nntot, num_bands, num_wann, timing_level, timer)

Uses

  • proc~~internal_zmatrix_gamma~~UsesGraph proc~internal_zmatrix_gamma internal_zmatrix_gamma module~w90_constants w90_constants proc~internal_zmatrix_gamma->module~w90_constants module~w90_io w90_io proc~internal_zmatrix_gamma->module~w90_io module~w90_types w90_types proc~internal_zmatrix_gamma->module~w90_types module~w90_io->module~w90_constants module~w90_types->module~w90_constants

Compute Z-matrix (Gamma point routine)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout) :: cbw(:,:)
complex(kind=dp), intent(in) :: m_matrix_orig_local(:,:,:,:)
complex(kind=dp), intent(inout) :: u_matrix_opt(:,:,:)
real(kind=dp), intent(out) :: rmtrx(:,:)
real(kind=dp), intent(in) :: wb(:)
integer, intent(in) :: indxnfroz(:,:)
integer, intent(in) :: ndimfroz(:)
integer, intent(in) :: ndimwin(:)
integer, intent(in) :: nnlist(:,:)
integer, intent(in) :: nkp
integer, intent(in) :: nntot
integer, intent(in) :: num_bands
integer, intent(in) :: num_wann
integer, intent(in) :: timing_level
type(timer_list_type), intent(inout) :: timer

Calls

proc~~internal_zmatrix_gamma~~CallsGraph proc~internal_zmatrix_gamma internal_zmatrix_gamma proc~io_stopwatch_start io_stopwatch_start proc~internal_zmatrix_gamma->proc~io_stopwatch_start proc~io_stopwatch_stop io_stopwatch_stop proc~internal_zmatrix_gamma->proc~io_stopwatch_stop zgemm zgemm proc~internal_zmatrix_gamma->zgemm

Called by

proc~~internal_zmatrix_gamma~~CalledByGraph proc~internal_zmatrix_gamma internal_zmatrix_gamma proc~dis_extract_gamma dis_extract_gamma proc~dis_extract_gamma->proc~internal_zmatrix_gamma proc~dis_main dis_main proc~dis_main->proc~dis_extract_gamma proc~w90_disentangle~2 w90_disentangle proc~w90_disentangle~2->proc~dis_main proc~w90_disentangle w90_disentangle proc~w90_disentangle->proc~w90_disentangle~2 program~wannier wannier program~wannier->proc~w90_disentangle~2

Source Code

  subroutine internal_zmatrix_gamma(cbw, m_matrix_orig_local, u_matrix_opt, rmtrx, wb, indxnfroz, &
                                    ndimfroz, ndimwin, nnlist, nkp, nntot, num_bands, num_wann, &
                                    timing_level, timer)
    !================================================!
    !
    !! Compute Z-matrix (Gamma point routine)
    !
    !================================================!
    use w90_constants, only: dp, cmplx_0, cmplx_1
    use w90_io, only: io_stopwatch_start, io_stopwatch_stop
    use w90_types, only: timer_list_type

    implicit none

    ! arguments
    type(timer_list_type), intent(inout) :: timer

    integer, intent(in) :: timing_level
    integer, intent(in) :: num_bands, num_wann, nkp, nntot
    integer, intent(in) :: ndimwin(:)
    integer, intent(in) :: nnlist(:, :)
    integer, intent(in) :: ndimfroz(:)
    integer, intent(in) :: indxnfroz(:, :)

    real(kind=dp), intent(in) :: wb(:)
    real(kind=dp), intent(out) :: rmtrx(:, :)

    complex(kind=dp), intent(inout) :: cbw(:, :)
    complex(kind=dp), intent(in) :: m_matrix_orig_local(:, :, :, :)
    complex(kind=dp), intent(inout) :: u_matrix_opt(:, :, :)

    ! Internal variables
    integer :: l, m, n, p, q, nn, nkp2, ndimk
    complex(kind=dp) :: csum

    if (timing_level > 1) call io_stopwatch_start('dis: extract_gamma: zmatrix_gamma', timer)

    rmtrx = 0.0_dp
    ndimk = ndimwin(nkp) - ndimfroz(nkp)
    do nn = 1, nntot
      nkp2 = nnlist(nkp, nn)
      call zgemm('N', 'N', num_bands, num_wann, ndimwin(nkp2), cmplx_1, &
                 m_matrix_orig_local(:, :, nn, nkp), num_bands, u_matrix_opt(:, :, nkp2), num_bands, &
                 cmplx_0, cbw, num_bands)
      do n = 1, ndimk
        q = indxnfroz(n, nkp)
        do m = 1, n
          p = indxnfroz(m, nkp)
          csum = cmplx_0
          do l = 1, num_wann
            csum = csum + cbw(p, l)*conjg(cbw(q, l))
          end do
          rmtrx(m, n) = rmtrx(m, n) + wb(nn)*real(csum, dp)
          rmtrx(n, m) = rmtrx(m, n)
        end do
      end do
    end do

    if (timing_level > 1) call io_stopwatch_stop('dis: extract_gamma: zmatrix_gamma', timer)

    return
    !================================================!
  end subroutine internal_zmatrix_gamma