anchor.diff:          type(excit)      :: connection_ki, connection_jk
           real(p)          :: psuccess, pspawn, pgen, hmatel
           type(det_info)   :: cdet_excit
  +
  +        integer(i0)      :: f_excit_2(basis_length)
  +
   
          ! specific to imperial code:
           !      -function that creates an excited determinant (create_excited_det)
  
positive.code: 
              end if
  
              ! 5. Calculate the excited determinant (can be up to degree 4)
              ! (i)   add up the number of excitations
              connection%nexcit = connection_ki%nexcit + connection_jk%nexcit
              ! (ii)  combine the annihilations
              connection%from_orb(:connection_ki%nexcit) = &
                                  connection_ki%from_orb(:connection_ki%nexcit)
  
              connection%from_orb(connection_ki%nexcit+1:connection%nexcit) = &
                                  connection_jk%from_orb(:connection_jk%nexcit)
  
              ! (iii) combine the creations
              connection%to_orb(:connection_ki%nexcit) = &
                                  connection_ki%to_orb(:connection_ki%nexcit)
  
              connection%to_orb(connection_ki%nexcit+1:connection%nexcit) = &
                                  connection_jk%to_orb(:connection_jk%nexcit)
              
              
  
  
negative.code:             ! 1.2 Generate the second random excitation 
              ! (i)  generate the first excited determinant  
              call create_excited_det_complete(cdet, connection_ki, cdet_excit)
  
  
  
              ! (ii) excite again
              call gen_excit_ptr(cdet_excit, Pgen_jk, connection_jk, hmatel_jk)
  
  