init_k_space_hubbard Subroutine

public subroutine init_k_space_hubbard()




Source Code

Source Code

    subroutine init_k_space_hubbard()

        character(*), parameter :: this_routine = "init_k_space_hubbard"
        real(dp) :: tau_opt

        if (iProcIndex == root) then
            print *, " new k-space hubbard implementation init:"
        end if

        ! i have to set the incorrect excitaiton generator flags to false
        tLatticeGens = .false.
        ! maybe i also need to turn off the hubbard keyword.. at this
        ! point
        thub = .false.

        tExch = .true.
        tNoBrillouin = .false.
        tUseBrillouin = .true.

        call check_k_space_hubbard_input()

        get_umat_el => get_umat_kspace

        call init_get_helement_k_space_hub()

        if (t_mixed_excits .and. .not. t_trans_corr_2body) then
            root_print "WARNING: mixed excit gen chosen, but no transcorrelation"
            root_print "    use uniform for doubles!"
            t_uniform_excits = .true.
        end if
        tau_opt = determine_optimal_time_step()

        if (tau < EPS) then
            call assign_value_to_tau(&
                clamp(lat_tau_factor * tau_opt, min_tau, max_tau), &
                'Initialization with optimal tau value')
            if (iProcIndex == root) then
                print *, "optimal time-step would be: ", tau_opt
                print *, "but tau specified in input!"
            end if
        end if

        ! [W.D. 7.3.2018]
        ! re-enable the tau-search and histogramming for the k-space
        ! hubbard model with transcorrelation
        ! since there the matrix elements are not equal for every
        ! excitation anymore and for the Gutzwiller correlation factor
        ! we also have additional pTriples and pParallel variables, which
        ! we might want to adapt on-the-fly as in the ab-initio calculations
        ! and I also want to check if i got the excitation weighting correct
        ! in the transcorrelated case or if i messed it up due to the
        ! non-hermitian character of the hamiltonian
        if (.not. (t_trans_corr_2body .or. t_trans_corr .or. tGUGA)) then
            if (tau_search_method /= possible_tau_search_methods%OFF) then
                call stop_all(this_routine, "tau-search should be switched off")
            end if
        end if

        if (associated(lat)) then
            call setup_nbasismax(lat)
            call setup_g1(lat)
            call setup_tmat_k_space(lat)
            call setup_kPointToBasisFn(lat)
        end if

        if (t_trans_corr_2body) then
            if (tHPHF) then
                call Stop_All(this_routine, "not yet implemented with HPHF")
            end if

            three_body_prefac = real(bhub, dp) * 2.0_dp * (cosh(trans_corr_param_2body) - 1.0_dp) / real(omega**2, dp)
            ! i also have to set some generation probability parameters..

            ! use pSingles for triples!
            ! BE CAREFUL and dont get confused!
            ! @Werner: does this make sense?
            if (allocated(pSinglesIn) .and. allocated(pDoublesIn)) then
                if (.not. (pSinglesIn + pDoublesIn .isclose. 1.0_dp)) then
                    call stop_all(this_routine, "pSinglesIn + pDoublesIn /= 1.0!")
                    pSingles = pSinglesIn
                    pDoubles = pDoublesIn
                end if
            else if (allocated(pSinglesIn) .and. (.not. allocated(pDoublesIn))) then
                pSingles = pSinglesIn
                pDoubles = 1.0_dp - pSingles
            else if (allocated(pDoublesIn) .and. (.not. allocated(pSinglesIn))) then
                pDoubles = pDoublesIn
                pSingles = 1.0_dp - pDoubles
                pDoubles = 0.8_dp
                pSingles = 1.0_dp - pDoubles
            end if

            if (allocated(pParallelIn)) then
                pParallel = pParallelIn
                pParallel = 0.5_dp
            end if

        end if

        if (.not. (t_trans_corr_2body .or. t_trans_corr)) then
            call initialize_excit_table()
        end if

    end subroutine init_k_space_hubbard