subroutine Add_RDM_HFConnections_Norm(spawn, one_rdms, iLutJ, nJ, AvSignJ, AvSignHF, walkExcitLevel, IterRDM)
! This is called when we run over all TotWalkers in CurrentDets.
! It is called for each CurrentDet which is a single or double of the HF.
! It explicitly adds in the HF - S/D connection, as if the HF were D_i and
! the single or double D_j. This is the standard full space RDM calc (No HPHF).
! In this case the diagonal elements wll already be taken care of.
use FciMCData, only: HFDet_True
use rdm_data, only: one_rdm_t
type(rdm_spawn_t), intent(inout) :: spawn
type(one_rdm_t), intent(inout) :: one_rdms(:)
integer(n_int), intent(in) :: iLutJ(0:NIfTot)
integer, intent(in) :: nJ(nel)
real(dp), intent(in) :: AvSignJ(:), AvSignHF(:)
integer, intent(in) :: walkExcitLevel
integer, intent(in) :: IterRDM(:)
#ifdef DEBUG_
character(*), parameter :: this_routine = "Add_RDM_HFConnections_Norm"
#endif
integer(n_int) :: iUnused
! If we have a single or double, add in the connection to the HF,
! symmetrically.
if ((walkExcitLevel == 1) .or. (walkExcitLevel == 2)) then
call Add_RDM_From_IJ_Pair(spawn, one_rdms, HFDet_True, nJ, AvSignHF(2::2), IterRDM*AvSignJ(1::2))
call Add_RDM_From_IJ_Pair(spawn, one_rdms, nJ, HFDet_True, AvSignJ(2::2), IterRDM*AvSignHF(1::2))
end if
! Eliminate compiler warnings.
iUnused = ilutJ(0)
end subroutine Add_RDM_HFConnections_Norm