real(dp) function sum_hop_transcorr_factor_orb(i, j, k, l)
! function to perform the summation over the four hopping
! transcorrelation factors in the 2-body term of the hopping
! transcorrelated real-space hubbard model
integer, intent(in) :: i, j, k, l
#ifdef DEBUG_
character(*), parameter :: this_routine = "sum_hop_transcorr_factor_orb"
#endif
integer :: r1(3), r2(3), r3(3), r4(3)
integer :: ind_1(3), ind_2(3), ind_3(3), ind_4(3)
integer m, m_vec(3)
ASSERT(associated(lat))
sum_hop_transcorr_factor_orb = 0.0_dp
r1 = lat%get_r_vec(i)
r2 = lat%get_r_vec(j)
r3 = lat%get_r_vec(k)
r4 = lat%get_r_vec(l)
if (allocated(hop_transcorr_factor_cached_vec)) then
do m = 1, lat%get_nsites()
m_vec = lat%get_r_vec(m)
ind_1 = r1 - m_vec
ind_2 = r2 - m_vec
ind_3 = m_vec - r3
ind_4 = m_vec - r4
sum_hop_transcorr_factor_orb = sum_hop_transcorr_factor_orb + &
hop_transcorr_factor_cached_vec(ind_1(1), ind_1(2), ind_1(3)) * &
hop_transcorr_factor_cached_vec(ind_2(1), ind_2(2), ind_2(3)) * &
hop_transcorr_factor_cached_vec_m(ind_3(1), ind_3(2), ind_3(3)) * &
hop_transcorr_factor_cached_vec_m(ind_4(1), ind_4(2), ind_4(3))
end do
else
do m = 1, lat%get_nsites()
! i need a routine to give me the real-space coordinates/vector
! and i also need to store that now!
m_vec = lat%get_r_vec(m)
sum_hop_transcorr_factor_orb = sum_hop_transcorr_factor_orb + &
hop_transcorr_factor(trans_corr_param, r1 - m_vec) * &
hop_transcorr_factor(trans_corr_param, r2 - m_vec) * &
hop_transcorr_factor(-trans_corr_param, m_vec - r3) * &
hop_transcorr_factor(-trans_corr_param, m_vec - r4)
end do
end if
end function sum_hop_transcorr_factor_orb