get_lu_table_size Subroutine

private subroutine get_lu_table_size(this)

Type Bound

lattice

Arguments

Type IntentOptional Attributes Name
class(lattice) :: this

Contents

Source Code


Source Code

    subroutine get_lu_table_size(this)
        implicit none
        class(lattice) :: this
        integer :: i, j, ki(sdim), kj(sdim), ka(sdim), nsites, m, a, k_sum(sdim)
        integer :: k, b, kk(sdim), kb(sdim)

        this%kmin = 0
        this%kmax = 0
        ! determine the maximum/minimum indices that appear in the lu table
        ! the lu table shall contain all reachable momenta ki + kj - ka
        nsites = this%get_nsites()
        ! for 2-body transcorrelation we need 5 momenta in total
        if (t_trans_corr_2body .and. t_k_space_hubbard) then
            do i = 1, nsites
                ki = this%get_k_vec(i)
                do j = 1, nsites
                    kj = this%get_k_vec(j)
                    do k = 1, nsites
                        kk = this%get_k_vec(k)
                        do a = 1, nsites
                            ka = this%get_k_vec(a)
                            do b = 1, nsites
                                kb = this%get_k_vec(b)

                                k_sum = ki + kj + kk - ka - kb

                                do m = 1, sdim
                                    if (k_sum(m) < this%kmin(m)) this%kmin(m) = k_sum(m)
                                    if (k_sum(m) > this%kmax(m)) this%kmax(m) = k_sum(m)
                                end do
                            end do
                        end do
                    end do
                end do
            end do
        else
            do i = 1, nsites
                ki = this%get_k_vec(i)
                do j = 1, nsites
                    kj = this%get_k_vec(j)
                    do a = 1, nsites
                        ka = this%get_k_vec(a)
                        k_sum = ki + kj - ka
                        do m = 1, sdim
                            if (k_sum(m) < this%kmin(m)) this%kmin(m) = k_sum(m)
                            if (k_sum(m) > this%kmax(m)) this%kmax(m) = k_sum(m)
                        end do
                    end do
                end do
            end do
        end if

    end subroutine get_lu_table_size