autoShiftFactorFunction Function

public pure function autoShiftFactorFunction(pos, run, pop) result(f)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: pos
integer, intent(in) :: run
real(kind=dp), intent(in) :: pop

Return Value real(kind=dp)


Contents


Source Code

    pure function autoShiftFactorFunction(pos, run, pop) result(f)
        ! Scale function for the shift based on the ratio of reject spawns
        ! Input: pos - position of given determinant in CurrentDets
        ! Input: run - run for which the factor is needed
        ! Input: pop - population of given determinant
        ! Output: f - scaling factor for the shift
        integer, intent(in) :: pos
        integer, intent(in) :: run
        real(dp), intent(in) :: pop
        real(dp) :: f, tot, acc, tmp

        unused_var(pop)

        tot = get_tot_spawns(pos, run)
        acc = get_acc_spawns(pos, run)

        if (test_flag(CurrentDets(:, pos), get_initiator_flag_by_run(run))) then
            tmp = 1.0
        else if (tot > AAS_Thresh) then
            tmp = acc / tot
        else
            tmp = 0.0
        end if
        !The factor is actually never zero, because at least the parent is occupied
        !As a heuristic, we use the connectivity of HF
        if (tmp < AAS_Cut) then
            tmp = AAS_Cut
        end if
        tmp = (tmp + AAS_Const) / (1 + AAS_Const)
        f = tmp**AAS_Expo

    end function autoShiftFactorFunction