subroutine get_transition_density(trden, bvec_mo, nbf, nocca, noccb, &
nstates)
! compute transition density between ground state and excited states
use precision, only: dp
use tdhf_lib, only: iatogen
use messages, only: show_message, with_abort
implicit none
real(kind=dp), intent(out), dimension(:,:,:,:) :: trden
real(kind=dp), intent(in), dimension(:,:) :: bvec_mo
integer, intent(in) :: nbf, nocca, noccb, nstates
real(kind=dp), allocatable :: tmp(:,:)
integer :: jst, ok
allocate(tmp(nbf,nbf), &
source=0.0d0, stat=ok)
if (ok /= 0) call show_message('Cannot allocate memory', WITH_ABORT)
! Compute transition dipole between the ground state and all excited
do jst = 1, nstates
! Compute transition density
! unpack X
call iatogen(bvec_mo(:,jst), trden(:,:,1,jst), nocca, noccb)
end do
end subroutine get_transition_density