wham_get_eig_deleig Subroutine

public subroutine wham_get_eig_deleig(dis_manifold, kpt_latt, pw90_band_deriv_degen, ws_region, print_output, wannier_data, ws_distance, wigner_seitz, delHH, HH, HH_R, u_matrix, UU, v_matrix, del_eig, eig, eigval, kpt, real_lattice, scissors_shift, mp_grid, num_bands, num_kpts, num_wann, num_valence_bands, effective_model, have_disentangled, seedname, stdout, timer, error, comm)

Uses

  • proc~~wham_get_eig_deleig~~UsesGraph proc~wham_get_eig_deleig wham_get_eig_deleig module~w90_comms w90_comms proc~wham_get_eig_deleig->module~w90_comms module~w90_constants w90_constants proc~wham_get_eig_deleig->module~w90_constants module~w90_get_oper w90_get_oper proc~wham_get_eig_deleig->module~w90_get_oper module~w90_postw90_common w90_postw90_common proc~wham_get_eig_deleig->module~w90_postw90_common module~w90_postw90_types w90_postw90_types proc~wham_get_eig_deleig->module~w90_postw90_types module~w90_types w90_types proc~wham_get_eig_deleig->module~w90_types module~w90_utility w90_utility proc~wham_get_eig_deleig->module~w90_utility module~w90_comms->module~w90_constants module~w90_error_base w90_error_base module~w90_comms->module~w90_error_base module~w90_get_oper->module~w90_comms module~w90_get_oper->module~w90_constants module~w90_error w90_error module~w90_get_oper->module~w90_error module~w90_io w90_io module~w90_get_oper->module~w90_io module~w90_postw90_common->module~w90_constants module~w90_postw90_common->module~w90_error module~w90_postw90_types->module~w90_comms module~w90_postw90_types->module~w90_constants module~w90_types->module~w90_constants module~w90_utility->module~w90_comms module~w90_utility->module~w90_constants module~w90_error->module~w90_comms module~w90_error->module~w90_error_base module~w90_io->module~w90_constants

Given a k point, this function returns eigenvalues E and derivatives of the eigenvalues dE/dk_a, using wham_get_deleig_a

Arguments

Type IntentOptional Attributes Name
type(dis_manifold_type), intent(in) :: dis_manifold
real(kind=dp), intent(in) :: kpt_latt(:,:)
type(pw90_band_deriv_degen_type), intent(in) :: pw90_band_deriv_degen
type(ws_region_type), intent(in) :: ws_region
type(print_output_type), intent(in) :: print_output
type(wannier_data_type), intent(in) :: wannier_data
type(ws_distance_type), intent(inout) :: ws_distance
type(wigner_seitz_type), intent(inout) :: wigner_seitz
complex(kind=dp), intent(out) :: delHH(:,:,:)

the delHH matrix (derivative of H) at kpt

complex(kind=dp), intent(out) :: HH(:,:)

the Hamiltonian matrix at kpt

complex(kind=dp), intent(inout), allocatable :: HH_R(:,:,:)
complex(kind=dp), intent(in) :: u_matrix(:,:,:)
complex(kind=dp), intent(out) :: UU(:,:)

the rotation matrix that gives the eigenvectors of HH

complex(kind=dp), intent(in) :: v_matrix(:,:,:)
real(kind=dp), intent(out) :: del_eig(num_wann,3)

the calculated derivatives of the eigenvalues at kpt [first component: band; second component: 1,2,3 for the derivatives along the three k directions]

real(kind=dp), intent(out) :: eig(num_wann)

the calculated eigenvalues at kpt

real(kind=dp), intent(in) :: eigval(:,:)
real(kind=dp), intent(in) :: kpt(3)

the three coordinates of the k point vector (in relative coordinates)

real(kind=dp), intent(in) :: real_lattice(3,3)
real(kind=dp), intent(in) :: scissors_shift
integer, intent(in) :: mp_grid(3)
integer, intent(in) :: num_bands
integer, intent(in) :: num_kpts
integer, intent(in) :: num_wann
integer, intent(in) :: num_valence_bands
logical, intent(in) :: effective_model
logical, intent(in) :: have_disentangled
character(len=50), intent(in) :: seedname
integer, intent(in) :: stdout
type(timer_list_type), intent(inout) :: timer
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~wham_get_eig_deleig~~CallsGraph proc~wham_get_eig_deleig wham_get_eig_deleig proc~get_hh_r get_HH_R proc~wham_get_eig_deleig->proc~get_hh_r proc~pw90common_fourier_r_to_k pw90common_fourier_R_to_k proc~wham_get_eig_deleig->proc~pw90common_fourier_r_to_k proc~utility_diagonalize utility_diagonalize proc~wham_get_eig_deleig->proc~utility_diagonalize proc~wham_get_deleig_a wham_get_deleig_a proc~wham_get_eig_deleig->proc~wham_get_deleig_a interface~comms_bcast comms_bcast proc~get_hh_r->interface~comms_bcast proc~fourier_q_to_r fourier_q_to_R proc~get_hh_r->proc~fourier_q_to_r proc~get_win_min get_win_min proc~get_hh_r->proc~get_win_min proc~io_stopwatch_start io_stopwatch_start proc~get_hh_r->proc~io_stopwatch_start proc~io_stopwatch_stop io_stopwatch_stop proc~get_hh_r->proc~io_stopwatch_stop proc~mpirank mpirank proc~get_hh_r->proc~mpirank proc~operator_wigner_setup operator_wigner_setup proc~get_hh_r->proc~operator_wigner_setup proc~set_error_fatal set_error_fatal proc~get_hh_r->proc~set_error_fatal proc~set_error_file set_error_file proc~get_hh_r->proc~set_error_file proc~set_error_input set_error_input proc~get_hh_r->proc~set_error_input proc~utility_diagonalize->proc~set_error_fatal zhpevx zhpevx proc~utility_diagonalize->zhpevx proc~wham_get_deleig_a->proc~utility_diagonalize proc~utility_rotate utility_rotate proc~wham_get_deleig_a->proc~utility_rotate proc~utility_rotate_diag utility_rotate_diag proc~wham_get_deleig_a->proc~utility_rotate_diag proc~comms_bcast_char comms_bcast_char interface~comms_bcast->proc~comms_bcast_char proc~comms_bcast_cmplx comms_bcast_cmplx interface~comms_bcast->proc~comms_bcast_cmplx proc~comms_bcast_int comms_bcast_int interface~comms_bcast->proc~comms_bcast_int proc~comms_bcast_logical comms_bcast_logical interface~comms_bcast->proc~comms_bcast_logical proc~comms_bcast_real comms_bcast_real interface~comms_bcast->proc~comms_bcast_real proc~comms_sync_error comms_sync_error proc~set_error_fatal->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_fatal->proc~set_base_error proc~set_error_file->proc~comms_sync_error proc~set_error_file->proc~set_base_error proc~set_error_input->proc~comms_sync_error proc~set_error_input->proc~set_base_error proc~utility_matmul_diag utility_matmul_diag proc~utility_rotate_diag->proc~utility_matmul_diag proc~utility_zgemm_new utility_zgemm_new proc~utility_rotate_diag->proc~utility_zgemm_new proc~comms_bcast_char->proc~comms_sync_error proc~comms_no_sync_bcast_char comms_no_sync_bcast_char proc~comms_bcast_char->proc~comms_no_sync_bcast_char proc~comms_bcast_cmplx->proc~comms_sync_error proc~comms_no_sync_bcast_cmplx comms_no_sync_bcast_cmplx proc~comms_bcast_cmplx->proc~comms_no_sync_bcast_cmplx proc~comms_bcast_int->proc~comms_sync_error proc~comms_no_sync_bcast_int comms_no_sync_bcast_int proc~comms_bcast_int->proc~comms_no_sync_bcast_int proc~comms_bcast_logical->proc~comms_sync_error proc~comms_no_sync_bcast_logical comms_no_sync_bcast_logical proc~comms_bcast_logical->proc~comms_no_sync_bcast_logical proc~comms_bcast_real->proc~comms_sync_error proc~comms_no_sync_bcast_real comms_no_sync_bcast_real proc~comms_bcast_real->proc~comms_no_sync_bcast_real zgemm zgemm proc~utility_zgemm_new->zgemm

Called by

proc~~wham_get_eig_deleig~~CalledByGraph proc~wham_get_eig_deleig wham_get_eig_deleig proc~berry_get_kdotp berry_get_kdotp proc~berry_get_kdotp->proc~wham_get_eig_deleig proc~berry_get_kubo_k berry_get_kubo_k proc~berry_get_kubo_k->proc~wham_get_eig_deleig proc~berry_get_sc_klist berry_get_sc_klist proc~berry_get_sc_klist->proc~wham_get_eig_deleig proc~berry_get_shc_klist berry_get_shc_klist proc~berry_get_shc_klist->proc~wham_get_eig_deleig proc~calctdfanddos calcTDFandDOS proc~calctdfanddos->proc~wham_get_eig_deleig proc~dos_main dos_main proc~dos_main->proc~wham_get_eig_deleig proc~geninterp_main geninterp_main proc~geninterp_main->proc~wham_get_eig_deleig proc~gyrotropic_get_k_list gyrotropic_get_k_list proc~gyrotropic_get_k_list->proc~wham_get_eig_deleig proc~k_slice k_slice proc~k_slice->proc~wham_get_eig_deleig proc~k_slice->proc~berry_get_shc_klist proc~berry_main berry_main proc~berry_main->proc~berry_get_kdotp proc~berry_main->proc~berry_get_kubo_k proc~berry_main->proc~berry_get_sc_klist proc~berry_main->proc~berry_get_shc_klist proc~boltzwann_main boltzwann_main proc~boltzwann_main->proc~calctdfanddos proc~gyrotropic_main gyrotropic_main proc~gyrotropic_main->proc~gyrotropic_get_k_list proc~k_path k_path proc~k_path->proc~berry_get_shc_klist program~postw90 postw90 program~postw90->proc~dos_main program~postw90->proc~geninterp_main program~postw90->proc~k_slice program~postw90->proc~berry_main program~postw90->proc~boltzwann_main program~postw90->proc~gyrotropic_main program~postw90->proc~k_path

Source Code

  subroutine wham_get_eig_deleig(dis_manifold, kpt_latt, pw90_band_deriv_degen, ws_region, &
                                 print_output, wannier_data, ws_distance, wigner_seitz, delHH, HH, &
                                 HH_R, u_matrix, UU, v_matrix, del_eig, eig, eigval, kpt, &
                                 real_lattice, scissors_shift, mp_grid, num_bands, num_kpts, &
                                 num_wann, num_valence_bands, effective_model, have_disentangled, &
                                 seedname, stdout, timer, error, comm)
    !================================================!
    !
    !! Given a k point, this function returns eigenvalues E and
    !! derivatives of the eigenvalues dE/dk_a, using wham_get_deleig_a
    !
    !================================================!

    use w90_constants, only: dp
    use w90_postw90_types, only: pw90_band_deriv_degen_type, wigner_seitz_type
    use w90_comms, only: w90_comm_type, mpirank
    use w90_constants, only: dp, cmplx_0
    use w90_get_oper, only: get_HH_R
    use w90_types, only: dis_manifold_type, print_output_type, wannier_data_type, &
                         ws_region_type, ws_distance_type, timer_list_type
    use w90_postw90_common, only: pw90common_fourier_R_to_k_new_second_d, &
                                  pw90common_fourier_R_to_k
    use w90_utility, only: utility_diagonalize

    implicit none

    ! arguments
    type(dis_manifold_type), intent(in) :: dis_manifold
    real(kind=dp), intent(in) :: kpt_latt(:, :)
    type(pw90_band_deriv_degen_type), intent(in) :: pw90_band_deriv_degen
    type(print_output_type), intent(in) :: print_output
    type(ws_region_type), intent(in) :: ws_region
    type(w90_comm_type), intent(in) :: comm
    type(wannier_data_type), intent(in) :: wannier_data
    type(wigner_seitz_type), intent(inout) :: wigner_seitz
    type(ws_distance_type), intent(inout) :: ws_distance
    type(timer_list_type), intent(inout) :: timer
    type(w90_error_type), allocatable, intent(out) :: error

    integer, intent(in) :: num_wann, num_kpts, num_bands, num_valence_bands
    integer, intent(in) :: mp_grid(3)
    integer, intent(in) :: stdout

    real(kind=dp), intent(in) :: kpt(3)!! the three coordinates of the k point vector (in relative coordinates)
    real(kind=dp), intent(out) :: eig(num_wann)!! the calculated eigenvalues at kpt
    real(kind=dp), intent(out) :: del_eig(num_wann, 3)
    !! the calculated derivatives of the eigenvalues at kpt [first component: band; second component: 1,2,3
    !! for the derivatives along the three k directions]
    real(kind=dp), intent(in) :: eigval(:, :)
    real(kind=dp), intent(in) :: real_lattice(3, 3)
    real(kind=dp), intent(in) :: scissors_shift

    complex(kind=dp), intent(out)   :: HH(:, :)
    !! the Hamiltonian matrix at kpt
    complex(kind=dp), intent(out) :: delHH(:, :, :)
    !! the delHH matrix (derivative of H) at kpt
    complex(kind=dp), intent(out)   :: UU(:, :)
    !! the rotation matrix that gives the eigenvectors of HH
    complex(kind=dp), intent(in) :: u_matrix(:, :, :), v_matrix(:, :, :)
    complex(kind=dp), allocatable, intent(inout) :: HH_R(:, :, :) !  <0n|r|Rm>

    character(len=50), intent(in)  :: seedname
    logical, intent(in) :: have_disentangled
    logical, intent(in) :: effective_model

    ! I call it to be sure that it has been called already once,
    ! and that HH_R contains the actual matrix.
    ! Further calls should return very fast.
    call get_HH_R(dis_manifold, kpt_latt, print_output, wigner_seitz, HH_R, u_matrix, v_matrix, &
                  eigval, real_lattice, scissors_shift, num_bands, num_kpts, num_wann, &
                  num_valence_bands, effective_model, have_disentangled, seedname, ws_distance, ws_region, &
                  stdout, timer, error, comm)
    if (allocated(error)) return

    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_fourier_R_to_k(ws_region, wannier_data, ws_distance, wigner_seitz, &
                                   delHH(:, :, 1), HH_R, kpt, real_lattice, mp_grid, 1, num_wann, &
                                   error, comm)
    if (allocated(error)) return
    call pw90common_fourier_R_to_k(ws_region, wannier_data, ws_distance, wigner_seitz, &
                                   delHH(:, :, 2), HH_R, kpt, real_lattice, mp_grid, 2, num_wann, &
                                   error, comm)
    if (allocated(error)) return
    call pw90common_fourier_R_to_k(ws_region, wannier_data, ws_distance, wigner_seitz, &
                                   delHH(:, :, 3), HH_R, kpt, real_lattice, mp_grid, 3, num_wann, &
                                   error, comm)
    if (allocated(error)) return
    call wham_get_deleig_a(del_eig(:, 1), eig, delHH(:, :, 1), UU, num_wann, &
                           pw90_band_deriv_degen, error, comm)
    if (allocated(error)) return
    call wham_get_deleig_a(del_eig(:, 2), eig, delHH(:, :, 2), UU, num_wann, &
                           pw90_band_deriv_degen, error, comm)
    if (allocated(error)) return
    call wham_get_deleig_a(del_eig(:, 3), eig, delHH(:, :, 3), UU, num_wann, &
                           pw90_band_deriv_degen, error, comm)
    if (allocated(error)) return

  end subroutine wham_get_eig_deleig