# get_guga_integral_contrib_spat Function

## public function get_guga_integral_contrib_spat(occ_orbs, orb_a, orb_b) result(cpt)

### Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: occ_orbs(2)
integer, intent(in) :: orb_a
integer, intent(in) :: orb_b

## Source Code

    function get_guga_integral_contrib_spat(occ_orbs, orb_a, orb_b) result(cpt)
integer, intent(in) :: occ_orbs(2), orb_a, orb_b
real(dp) :: cpt

integer :: ind(2)

ind = occ_orbs
! for now, since i dont know how to correctly do it, and for testing
! purposes just add a uniformly factor to all of the orbitals.

! do a input dependent switch to compare influence on the pgens..
if (tGen_guga_weighted) then

if (orb_b < 0) then

cpt = sqrt(abs_l1(UMat2D(max(ind(1),orb_a), min(ind(1),orb_a)))) &
+ sqrt(abs_l1(UMat2D(max(ind(2),orb_a), min(ind(2),orb_a))))
else

cpt = sqrt(abs(get_umat_el(ind(1),ind(2),orb_a,orb_b)) &
+ abs(get_umat_el(ind(1),ind(2),orb_b,orb_a)))

end if

else

if (orb_b < 0) then

cpt = 1.0_dp

else

if (t_guga_pchb) then
cpt = abs(get_umat_el(ind(1),ind(2),orb_a,orb_b)) +&
abs(get_umat_el(ind(1),ind(2),orb_b,orb_a))

else
cpt = sqrt(abs(get_umat_el(ind(1),ind(2),orb_a,orb_b)) +&
abs(get_umat_el(ind(1),ind(2),orb_b,orb_a)))
end if
end if
end if

end function get_guga_integral_contrib_spat