subroutine calcDoubleExcitation_withWeight(ilut, csf_i, excitInfo, excitations, &
nExcits, posSwitches, negSwitches)
! subroutine to calculate the double excitations involving a weight
! generator, which is really similar so a normal single excitation
integer(n_int), intent(in) :: ilut(0:nifguga)
type(CSF_Info_t), intent(in) :: csf_i
type(ExcitationInformation_t), intent(in) :: excitInfo
integer(n_int), intent(out), allocatable :: excitations(:, :)
integer, intent(out) :: nExcits
real(dp), intent(in) :: posSwitches(nSpatOrbs), negSwitches(nSpatOrbs)
integer :: iEx, we
! just call excitations first
! have to change excitInfo so single excitations are calculated
! correctly
! in future
we = excitInfo%weight
call calcAllExcitations(ilut, csf_i, excitInfo, posSwitches, negSwitches, &
.false., excitations, nExcits)
! and then modify the matrix element if necessary
if ((excitInfo%weight /= excitInfo%fullStart) .and. (excitInfo%weight &
/= excitInfo%fullEnd)) then
if (isThree(ilut, we)) then
do iEx = 1, nExcits
call update_matrix_element(excitations(:, iEx), 2.0_dp, 1)
end do
end if
end if
! also use the deltaB value of the finished excitations to indicate
! the IC level for the remaining NECI code
do iEx = 1, nExcits
! is a single excitation in this case!
call setDeltaB(1, excitations(:, iEx))
end do
end subroutine calcDoubleExcitation_withWeight