anchor.diff:  
               ! 3. Return generation probability and conecting matrix element.
   
  -            pgen = calc_pgen_ueg_no_renorm(sys, max_na)
  +            pgen = calc_pgen_ueg_no_renorm(sys, max_na, ij_spin)
   
               call find_excitation_permutation2(cdet%f, connection)
               hmatel = slater_condon2_ueg_excit(sys, connection%from_orb(1), connection%from_orb(2), &
  
positive.code:             ! Ok, b is now completely defined.
              kb = ij_k - basis_fns(a)%l
  
              ! Now, we have to be careful!
              ! max_na is the maximum number of ways of choosing a.
              ! However, we then use it to calculate the number of ways of
              ! generating this unique excitation.  As the UEG is a one-band
              ! model (and hence b is uniquely defined), then if a and b are of
              ! the same spin, they were both possible choices for a.  We hence
              ! need to half max_na in order to give the number of unique possible
              ! excitations given the choice of i and j.
              select case(ij_spin)
              case(2)
                  b = ueg_basis_index(kb, 1)
                  max_na = max_na / 2
              case(0)
                  b = ueg_basis_index(kb, -1)
              case(-2)
                  b = ueg_basis_index(kb, -1)
                  max_na = max_na / 2
              end select
  
              ! Excitation is forbidden if b is already occupied!
  
negative.code: 
  !--- Excitation generation probabilities ---
  
      pure function calc_pgen_ueg_no_renorm(sys, max_na, ij_spin) result(pgen)
  
          ! NOTE: this assumes that the corresponding excitation (i,j)->(a,b) is
          ! actually allowed.  Cases where this is not true must be explicitly
          ! handled.
  
          ! In:
  