create_ab_list_ueg Subroutine

public subroutine create_ab_list_ueg(ilutI, src, cum_arr, cum_sum)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(in) :: ilutI(0:niftot)
integer, intent(in) :: src(2)
real(kind=dp), intent(out) :: cum_arr(nbasis)
real(kind=dp), intent(out) :: cum_sum

Contents

Source Code


Source Code

    subroutine create_ab_list_ueg(ilutI, src, cum_arr, cum_sum)
        integer(n_int), intent(in) :: ilutI(0:niftot)
        integer, intent(in) :: src(2)
        real(dp), intent(out) :: cum_arr(nbasis), cum_sum

        integer :: ispn, orba, orbb
        real(dp) :: elem, testE

        ispn = get_ispn(src)

        cum_sum = 0.0_dp
        do orba = 1, nbasis

            ! TODO: Symmetry restrictions on A (if parallel, can't pick opp)
            elem = 0.0_dp
            if (IsNotOcc(ilutI, orba) .and. &
                (.not. ((iSpn == 1 .and. .not. is_beta(orba)) .or. &
                        (iSpn == 3 .and. is_beta(orba))))) then

                if (is_allowed_ueg_k_vector(src(1), src(2), orba)) then

                    orbb = get_orb_from_kpoints(src(1), src(2), orba)

                    ! n.b. we enforce strict selection a-b, not b-a
                    if (orbb > orba .and. IsNotOcc(ilutI, orbb)) then

                        ! We don't need to worry about which a,b is which, as
                        ! we don't care about the overall sign.
                        elem = abs(sltcnd_2_kernel( &
                                   Excite_2_t(src1=src(1), src2=src(2), tgt1=orba, tgt2=orbb)))
                    end if
                end if
            end if

            ! Increment the cumulative sum
            cum_sum = cum_sum + elem
            cum_arr(orba) = cum_sum

        end do

    end subroutine create_ab_list_ueg