subroutine initialize_excit_table()
! This cannot be a member of the lattice class because that would introduce
! a circulat dependency on get_offdiag_helement_k_sp_hub
integer :: a, b, i, j, ex(2, 2)
! nI is not needed anywhere, it is a redundant argument in the k_space_hubbard module
integer :: nI(2)
real(dp) :: matEL
! the buffer for excitations is (number of states)^3
! strictly speaking, we do not need to distinguish spin orbs here for simple hubbard
! but for transcorrelated, it might matter
if (allocated(excit_cache)) deallocate(excit_cache)
allocate(excit_cache(nbasis, nbasis, nbasis))
! loop over all pairs of orbitals
do i = 1, nbasis
do j = 1, nbasis
nI = [i, j]
ex(1, :) = [i, j]
! and for each, check all possible excitations
do a = 1, nbasis
matEl = 0.0_dp
if (a /= i .and. a /= j) then
b = get_orb_from_kpoints(i, j, a)
if (b /= a .and. b /= i .and. b /= j) then
ex(2, :) = [a, b]
matEl = abs(get_offdiag_helement_k_sp_hub(nI, ex, .false.))
end if
end if
! most excitations will have a finite amplitude, so store all
excit_cache(i, j, a) = matEl
end do
end do
end do
end subroutine initialize_excit_table