anchor.diff:              ! First excitor 'seeds' the cluster:
               pos = int(genrand_real2()*tot_walkers) +1
               cdet%f = walker_dets(:,pos)
  -            cluster_pop = walker_population(1,pos)
  +            cluster_population = walker_population(1,pos)
               ! Now the rest...
               do i = 2, cluster_size
                   ! Select a position between in the excitors list.
                   pos = int(genrand_real2()*tot_walkers) + 1
  -                call collapse_cluster(walker_dets(:,pos), walker_population(1,pos), cdet%f, cluster_pop)
  -                if (cluster_pop == 0) exit
  +                call collapse_cluster(walker_dets(:,pos), walker_population(1,pos), cdet%f, cluster_population)
  +                if (cluster_population == 0) exit
               end do
   
  -            ! Normalisation factor for amplitudes...
  -            amplitude = real(cluster_pop,p)/(D0_population**(cluster_size-1)) ! TODO: don't accumulate D0 over report loops
  -
  -            ! TODO: sign change due to difference between determinant
  -            ! representation and excitors.
  -
  -            ! We chose excitors uniformly.
  -            !  -> prob. of each excitor is 1./(number of excitors on processor).
  -            ! Overall probability is the product of this times the number of
  -            ! ways the cluster could have been selected, ie
  -            !   n_s!/n_excitors^n_s
  -            pcluster = (pcluster*factorial(cluster_size))/(tot_walkers**cluster_size)
  +            excitation_level = get_excitation_level(f0, cdet%f)
  +            ! To contribute the cluster must be within a double excitation of
  +            ! the maximum excitation included in the CC wavefunction.
  +            if (excitation_level > truncation_level+2) cluster_population = 0
  +
  +            if (cluster_population /= 0) then
  +                ! Sign change due to difference between determinant
  +                ! representation and excitors and excitation level.
  +                call convert_excitor_to_determinant(cdet%f, excitation_level, cluster_population)
  +
  +                ! Normalisation factor for amplitudes...
  +                amplitude = real(cluster_population,p)/(D0_population**(cluster_size-1)) ! TODO: don't accumulate D0 over report loops
  +
  +                ! We chose excitors uniformly.
  +                !  -> prob. of each excitor is 1./(number of excitors on processor).
  +                ! Overall probability is the product of this times the number of
  +                ! ways the cluster could have been selected, ie
  +                !   n_s!/n_excitors^n_s
  +                pcluster = (pcluster*factorial(cluster_size))/(tot_walkers**cluster_size)
  +            end if
  +
           end select
   
           ! Fill in information about the cluster if required.
  -        if (valid_cluster) then
  +        if (cluster_population /= 0) then
               call decoder_ptr(cdet%f, cdet)
           else
               ! Simply set excitation level to a too high (fake) level to avoid
  
positive.code:         real(p), intent(out) :: amplitude, pcluster
  
          real(p) :: rand, psize
          integer :: cluster_size, i, pos, cluster_pop
          logical :: valid_cluster
  
          ! We shall accumulate the factors which comprise pcluster as we go.
          !   pcluster = n_sel p_size p_clust
          ! where
          !   n_sel   is the number of cluster selections made (by this
          !           processor?);
          !   p_size  is the probability of choosing a cluster of that size;
          !   p_clust is the probability of choosing a specific cluster given
          !           the choice of size.
  
negative.code: ! Due to the similarities with FCIQMC, we can re-use lots of the same routines
  ! (especially the spawning, death and annihilation).  As a result, the structure
  ! of do_ccmc is remarkably similar to the other do_*mc routines.
  
  ! Numerous discussions with Alex Thom gratefully acknowledged...
  
  use const, only: i0, lint, p
  
  