sum_spin_transcorr_factor_vec Function

private function sum_spin_transcorr_factor_vec(r1, r2)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: r1(3)
integer, intent(in) :: r2(3)

Return Value real(kind=dp)


Contents


Source Code

    real(dp) function sum_spin_transcorr_factor_vec(r1, r2)
        ! function to perform the summation over the two spin-hopping
        ! transcorrelation factors in the modified 1-body term in the
        ! spin-dependent hopping trancorrelated real-space hubbard model
        integer, intent(in) :: r1(3), r2(3)
#ifdef DEBUG_
        character(*), parameter :: this_routine = "sum_spin_transcorr_factor_vec"
#endif
        integer :: i, m_vec(3), ind_1(3), ind_2(3)

        ASSERT(associated(lat))

        sum_spin_transcorr_factor_vec = 0.0_dp

        if (allocated(hop_transcorr_factor_cached_vec)) then
            do i = 1, lat%get_nsites()
                m_vec = lat%get_r_vec(i)

                ind_1 = r1 - m_vec
                ind_2 = m_vec - r2

                sum_spin_transcorr_factor_vec = sum_spin_transcorr_factor_vec + &
                                                hop_transcorr_factor_cached_vec(ind_1(1), ind_1(2), ind_1(3)) * &
                                                hop_transcorr_factor_cached_vec_m(ind_2(1), ind_2(2), ind_2(3))

            end do
        else
            do i = 1, lat%get_nsites()

                m_vec = lat%get_r_vec(i)
                ! the exponential factor is actually the same!
                sum_spin_transcorr_factor_vec = sum_spin_transcorr_factor_vec + &
                                                hop_transcorr_factor(trans_corr_param, r1 - m_vec) * &
                                                hop_transcorr_factor(-trans_corr_param, m_vec - r2)

            end do
        end if

    end function sum_spin_transcorr_factor_vec