subroutine wham_get_eig_UU_HH_AA_sc_TB_conv(kpt, eig, UU, HH, HH_da, HH_dadb)
!========================================================!
! !
! modified version of wham_get_eig_UU_HH_AA_sc, calls routines
! satisfying the TB phase convention
! !
!========================================================!
use w90_parameters, only: num_wann
use w90_get_oper, only: HH_R, get_HH_R, AA_R, get_AA_R
use w90_postw90_common, only: pw90common_fourier_R_to_k_new_second_d, &
pw90common_fourier_R_to_k_new_second_d_TB_conv
use w90_utility, only: utility_diagonalize
real(kind=dp), dimension(3), intent(in) :: kpt
real(kind=dp), intent(out) :: eig(num_wann)
complex(kind=dp), dimension(:, :), intent(out) :: UU
complex(kind=dp), dimension(:, :), intent(out) :: HH
complex(kind=dp), dimension(:, :, :), intent(out) :: HH_da
complex(kind=dp), dimension(:, :, :, :), intent(out) :: HH_dadb
integer :: i
call get_HH_R
call get_AA_R
call pw90common_fourier_R_to_k_new_second_d_TB_conv(kpt, HH_R, AA_R, OO=HH, &
OO_da=HH_da(:, :, :), &
OO_dadb=HH_dadb(:, :, :, :))
call utility_diagonalize(HH, num_wann, eig, UU)
end subroutine wham_get_eig_UU_HH_AA_sc_TB_conv