create_ab_list_ua Subroutine

public subroutine create_ab_list_ua(nI, ilutI, src, cum_arr, cum_sum)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
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_ua(nI, ilutI, src, cum_arr, cum_sum)
        integer, intent(in) :: nI(nel)
        integer(n_int), intent(in) :: ilutI(0:niftot)
        integer, intent(in) :: src(2)
        real(dp), intent(out) :: cum_arr(nbasis), cum_sum

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

        ex(1, :) = src

        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.
                        ex(2, 1) = orba
                        ex(2, 2) = orbb
                        elem = abs(sltcnd_excit(nI, Excite_2_t(ex), .false.))
!                       elem = 1.0_dp
                    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_ua