TestInitiator_pure_space Function

public function TestInitiator_pure_space(ilut, nI, site_idx, initiator_before, run) result(initiator)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(inout) :: ilut(0:NIfTot)
integer, intent(in) :: nI(nel)
integer, intent(in) :: site_idx
logical, intent(in) :: initiator_before
integer, intent(in) :: run

Return Value logical


Contents


Source Code

    function TestInitiator_pure_space(ilut, nI, site_idx, initiator_before, run) result(initiator)

        integer(n_int), intent(inout) :: ilut(0:NIfTot)
        integer, intent(in) :: nI(nel), site_idx, run
        logical, intent(in) :: initiator_before

        logical :: initiator

        ! Has this already been marked as a determinant in the static space?
        initiator = test_flag(ilut, flag_static_init(run)) .or. (check_determ_flag(ilut, run) .and. t_core_inits)

        ! If not, then it may be new, so check.
        ! Deterministic states are always in CurrentDets, so don't need to
        ! check if it's a new state in the deterministic space.
        if (.not. initiator) then
            if (is_in_initiator_space(ilut, nI)) then
                initiator = .true.
                call set_flag(CurrentDets(:, site_idx), flag_static_init(run))
            end if
        end if

        if (initiator .and. (.not. initiator_before)) then
            NoAddedInitiators = NoAddedInitiators + 1_int64
        else if ((.not. initiator) .and. initiator_before) then
            NoAddedInitiators = NoAddedInitiators - 1_int64
        end if

    end function TestInitiator_pure_space