subroutine setup_tmat_k_space(in_lat)
! routine which sets up the (diagonal) t-matrix in the k-space
! the dimensionality and connectivity of nearest and next-nearest
! neighbors influences that!
class(lattice), intent(in), optional :: in_lat
character(*), parameter :: this_routine = "setup_tmat_k_space"
if (present(in_lat)) then
if (all(nBasisMax == 0)) then
call setup_nbasismax(in_lat)
end if
if (.not. associated(G1)) then
call setup_g1(in_lat)
end if
! else assume it is already setup correctly
if (.not. associated(tmat2d)) then
! call the already implemented hubbard tmat calculator..
! for now only.. in the future we should do this standalone
call CALCTMATHUB(in_lat%get_nsites() * 2, nBasisMax, bhub, &
ttilt, G1,.not. in_lat%is_k_space(), in_lat%is_periodic())
end if
else
call Stop_All(this_routine, "not yet implemented!")
end if
end subroutine setup_tmat_k_space