gen_all_excits_r_space_hubbard Subroutine

public subroutine gen_all_excits_r_space_hubbard(nI, n_excits, det_list)


Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer, intent(out) :: n_excits
integer(kind=n_int), intent(out), allocatable :: det_list(:,:)


Source Code

    subroutine gen_all_excits_r_space_hubbard(nI, n_excits, det_list)
        ! for the purpose of excitation generation and time-step and
        ! pDoubles determination create a routine to create all possible
        ! excitations for a given determinant nI
        ! the system specific variables need to be determined already
        ! before!
        integer, intent(in) :: nI(nel)
        integer, intent(out) :: n_excits
        integer(n_int), intent(out), allocatable :: det_list(:, :)

        integer :: save_excits, n_doubles
        integer(n_int), allocatable :: double_dets(:, :), temp_dets(:, :)

        call gen_all_singles_rs_hub(nI, n_excits, det_list)

        ! if we have hopping transcorr we also have to compute the
        ! possible doubles
        ! we know does are different than any single
        if (t_trans_corr_hop) then
            save_excits = n_excits

            call gen_all_doubles_rs_hub_hop_transcorr(nI, n_doubles, double_dets)

            n_excits = n_excits + n_doubles

            allocate(temp_dets(0:niftot, save_excits), source=det_list(:, 1:save_excits))


            allocate(det_list(0:niftot, n_excits))

            det_list(:, 1:save_excits) = temp_dets

            det_list(:, save_excits + 1:n_excits) = double_dets

        end if

        call sort(det_list, ilut_lt, ilut_gt)

        ! if we have HPHF turned on we want to "spin-purify" the excitation
        ! list
        if (tHPHF) then
            save_excits = n_excits

            if (allocated(temp_dets)) deallocate(temp_dets)

            allocate(temp_dets(0:NIfTot, size(det_list, 2)), source=det_list)

            call spin_purify(save_excits, temp_dets, n_excits, det_list)

        end if
    end subroutine gen_all_excits_r_space_hubbard