mixedFullStopStochastic Subroutine

public subroutine mixedFullStopStochastic(ilut, csf_i, excitInfo, t)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(in) :: ilut(0:nifguga)
type(CSF_Info_t), intent(in) :: csf_i
type(ExcitationInformation_t), intent(in) :: excitInfo
integer(kind=n_int), intent(inout) :: t(0:nifguga)

Contents


Source Code

    subroutine mixedFullStopStochastic(ilut, csf_i, excitInfo, t)
        integer(n_int), intent(in) :: ilut(0:nifguga)
        type(CSF_Info_t), intent(in) :: csf_i
        type(ExcitationInformation_t), intent(in) :: excitInfo
        integer(n_int), intent(inout) :: t(0:nifguga)
        character(*), parameter :: this_routine = "mixedFullStopStochastic"

        integer :: ende, deltaB
        real(dp) :: bVal, tempWeight_0, tempWeight_1

        ASSERT(.not. isThree(ilut, excitInfo%fullEnd))
        ASSERT(.not. isZero(ilut, excitInfo%fullEnd))
        ! no 3 allowed at end or else it would be single-excitation-like

        ende = excitInfo%fullEnd
        bVal = csf_i%B_real(ende)

        deltaB = getDeltaB(t)

        ! NOTE: also remember for mixed full-stops there has to be a switch at
        ! some point of the double overlap region or else it is single-excitation
        ! like... so only consider x1 matrix element here..

        ! combine deltaB and stepvalue info here to reduce if statements
        ! asserts dont work anymore with new select case statements
        ! do it out here:
#ifdef DEBUG_
        if (csf_i%stepvector(ende) == 1) then
            ASSERT(deltaB /= 2)
        end if
        if (csf_i%stepvector(ende) == 2) then
            ASSERT(deltaB /= -2)
        end if
#endif

        select case (deltaB + csf_i%stepvector(ende))
        case (1)
            ! d=1 + b=0 : 1
            ! ! +2 branch not allowed here
            ! not sure if i can access only the x1 element down there..
            call getMixedFullStop(1, 1, 0, bVal, tempWeight_0, tempWeight_1)

        case (-1)
            ! d=1 + b=-2 : -1
            ! deltaB = -2
            ! switch 1 -> 2
            set_orb(t, 2 * ende)
            clr_orb(t, 2 * ende - 1)

            ! matrix element is 1 in this case
            tempWeight_1 = 1.0_dp
            tempWeight_0 = 0.0_dp

        case (2)
            ! d=2 + b=0 : 2

            call getMixedFullStop(2, 2, 0, bVal, tempWeight_0, tempWeight_1)

        case (4)
            ! d=2 + b=2 : 4
            ! deltab = 2
            ! switch 2 -> 1
            set_orb(t, 2 * ende - 1)
            clr_orb(t, 2 * ende)

            tempWeight_1 = 1.0_dp
            tempWeight_0 = 0.0_dp
        end select

        ! thats kind of stupid what i did here...
        ! check if x0-matrix element is non-zero which is an indicator that
        ! no switch happened in the double overlap region

        ! just for completion reasons still update the x0 matrix element here
        ! although it should be 0 anyway..
        call update_matrix_element(t, tempWeight_0, 1)
        call update_matrix_element(t, tempWeight_1, 2)

        ! todo... have to write some excitation cancellation function...
        ! to get back to the start of an excitation or somehow ensure that
        ! switch happens...
    end subroutine mixedFullStopStochastic