anchor.diff:  
       end subroutine stochastic_ccmc_death
   
  -    subroutine collapse_cluster(excitor, excitor_population, cluster_excitor, cluster_population)
  +    subroutine collapse_cluster(excitor, excitor_population, cluster_excitor, cluster_population, allowed)
   
           ! Collapse two excitors.  The result is returned in-place.
   
           ! In:
           !    excitor: bit string of the Slater determinant formed by applying
  -        !        the excitor to the reference determinant.
  -        !    excitor_population: number of excips on the excitor.
  +        !        the excitor, e1, to the reference determinant.
  +        !    excitor_population: number of excips on the excitor e1.
           ! In/Out:
           !    cluster_excitor: bit string of the Slater determinant formed by applying
  -        !        the excitor to the reference determinant.
  -        !    cluster_population: number of excips on the 'cluster' excitor.
  -
  -        ! On input, cluster excitor refers to an existing excitor.  On output,
  +        !        the excitor, e2, to the reference determinant.
  +        !    cluster_population: number of excips on the 'cluster' excitor, e2.
  +        ! Out:
  +        !    allowed: true if excitor e1 can be applied to excitor e2 (i.e. e1
  +        !    and e2 do not involve exciting from/to the any identical
  +        !    spin-orbitals).
  +
  +        ! On input, cluster excitor refers to an existing excitor, e2.  On output,
           ! cluster excitor refers to the excitor formed from applying the excitor
  -        ! to the cluster.
  +        ! e1 to the cluster e2.
  +        ! ***WARNING***: if allowed is false then cluster_excitor and
  +        ! cluster_population are *not* updated.
   
           use basis, only: basis_length, basis_lookup
           use excitations, only: excit_mask
  
positive.code:         integer(i0), intent(in) :: excitor(basis_length)
          integer, intent(in) :: excitor_population
          integer(i0), intent(inout) :: cluster_excitor(basis_length)
          integer, intent(inout) :: cluster_population
  
          integer :: ibasis, ibit
          integer(i0) :: excitor_excitation(basis_length), excitor_annihilation(basis_length), excitor_creation(basis_length)
  
negative.code:                     cdet%f = walker_dets(:,pos)
                      cluster_population = walker_population(1,pos)
                  else
                      call collapse_cluster(walker_dets(:,pos), walker_population(1,pos), cdet%f, cluster_population, allowed)
                      if (.not.allowed) exit
                  end if
                  if (walker_population(1,pos) <= initiator_population) cdet%initiator_flag = 1
                  ! Probability of choosing this excitor = pop/tot_pop.
                  cluster%pselect = (cluster%pselect*abs(walker_population(1,pos)))/tot_excip_pop
                  cluster%excitors(i)%f => walker_dets(:,pos)
              end do
  
              if (allowed) cluster%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 (cluster%excitation_level > truncation_level+2) allowed = .false.
  
              if (allowed) then
                  ! We chose excitors with a probability proportional to their
                  ! occupation.  However, because (for example) the cluster t_X t_Y
                  ! and t_Y t_X collapse onto the same excitor (where X and Y each
                  ! label an excitor), the probability of selecting a given cluster is
                  ! proportional to the number of ways the cluster could have been
                  ! formed.  (One can view this factorial contribution as the
                  ! factorial prefactors in the series expansion of e^T---see Eq (8)
                  ! in the module-level comments.)
                  cluster%pselect = cluster%pselect*factorial(cluster%nexcitors)
  
                  ! Sign change due to difference between determinant
                  ! representation and excitors and excitation level.
                  call convert_excitor_to_determinant(cdet%f, cluster%excitation_level, cluster%cluster_to_det_sign)
  
                  ! Normalisation factor for cluster%amplitudes...
                  cluster%amplitude = cluster_population/(D0_normalisation**(cluster%nexcitors-1))
              else
                  ! Simply set excitation level to a too high (fake) level to avoid
                  ! this cluster being used.
  