anchor.diff:            i_H_psi_value = i_H_psi_value + i_H_psi_value2
           end if
   
  -
  -        integer :: c1, c2
  -        double precision :: hij
  -        c1 = ptr_futur_tmicrolist(p1)
  -        c2 = ptr_futur_tmicrolist(p2)
  -        do while(.true.)
  -          if(c1 >= ptr_tmicrolist(p1+1) .or. c2 >= ptr_tmicrolist(p2+1)) then
  -            if(ptr_tmicrolist(p1+1) /= c1) then
  -              call i_H_psi(exc_det,tmicrolist(1,1,c1),psi_coef_tmicrolist(c1, 1),N_int, ptr_tmicrolist(p1+1)-c1 ,psi_selectors_size*3,N_states,i_H_psi_value2)
  -              i_H_psi_value = i_H_psi_value + i_H_psi_value2
  +        if(.false.) then ! DET DRIVEN
  +          integer :: c1, c2
  +          double precision :: hij
  +          c1 = ptr_futur_tmicrolist(p1)
  +          c2 = ptr_futur_tmicrolist(p2)
  +          do while(.true.)
  +            if(c1 >= ptr_tmicrolist(p1+1) .or. c2 >= ptr_tmicrolist(p2+1)) then
  +              if(ptr_tmicrolist(p1+1) /= c1) then
  +                call i_H_psi(exc_det,tmicrolist(1,1,c1),psi_coef_tmicrolist(c1, 1),N_int, ptr_tmicrolist(p1+1)-c1 ,psi_selectors_size*3,N_states,i_H_psi_value2)
  +                i_H_psi_value = i_H_psi_value + i_H_psi_value2
  +              end if
  +
  +              if(ptr_tmicrolist(p2+1) /= c2) then
  +                call i_H_psi(exc_det,tmicrolist(1,1,c2),psi_coef_tmicrolist(c2, 1),N_int, ptr_tmicrolist(p2+1)-c2 ,psi_selectors_size*3,N_states,i_H_psi_value2)
  +                i_H_psi_value = i_H_psi_value + i_H_psi_value2
  +              endif
  +
  +              exit
  +            endif
  +
  +            if(idx_tmicrolist(c1) < idx_tmicrolist(c2)) then
  +              call i_H_j(exc_det,tmicrolist(1,1,c1),N_int,hij)
  +              do j = 1, N_states
  +                i_H_psi_value(j) = i_H_psi_value(j) + psi_coef_tmicrolist(c1,j)*hij
  +              enddo
  +              c1 += 1
  +            else
  +              call i_H_j(exc_det,tmicrolist(1,1,c2),N_int,hij)
  +              do j = 1, N_states
  +                i_H_psi_value(j) = i_H_psi_value(j) + psi_coef_tmicrolist(c2,j)*hij
  +              enddo
  +              if(idx_tmicrolist(c1) == idx_tmicrolist(c2)) c1 = c1 + 1
  +              c2 += 1
               end if
  -
  -            if(ptr_tmicrolist(p2+1) /= c2) then
  -              call i_H_psi(exc_det,tmicrolist(1,1,c2),psi_coef_tmicrolist(c2, 1),N_int, ptr_tmicrolist(p2+1)-c2 ,psi_selectors_size*3,N_states,i_H_psi_value2)
  -              i_H_psi_value = i_H_psi_value + i_H_psi_value2
  -            endif
  -
  -            exit
  -          endif
  -
  -          if(idx_tmicrolist(c1) < idx_tmicrolist(c2)) then
  -            call i_H_j(exc_det,tmicrolist(1,1,c1),N_int,hij)
  -            do j = 1, N_states
  -              i_H_psi_value(j) = i_H_psi_value(j) + psi_coef_tmicrolist(c1,j)*hij
  -            enddo
  -            c1 += 1
  -          else
  -            call i_H_j(exc_det,tmicrolist(1,1,c2),N_int,hij)
  -            do j = 1, N_states
  -              i_H_psi_value(j) = i_H_psi_value(j) + psi_coef_tmicrolist(c2,j)*hij
  -            enddo
  -            if(idx_tmicrolist(c1) == idx_tmicrolist(c2)) c1 = c1 + 1
  -            c2 += 1
  -          end if
  -        enddo
  +          enddo
  +        end if
   
           double precision :: Hii, diag_H_mat_elem_fock
           Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),exc_det,fock_diag_tmp,N_int)
  
positive.code:         do j=1,n_element(s,idx(0))
            k = list(j,s,idx(0)) + mo_tot_num * (s-1)
            if(nt == 4) N_microlist(k) = N_microlist(k) + 1
            if(nt == 3) N_tmicrolist(k) = N_tmicrolist(k) + 1
          end do
        end do
      endif
  
negative.code:   ns1 = mo_tot_num*(s1-1)
    ns2 = mo_tot_num*(s2-1)
    
    !mat = 0d0 
    if(s1 == s2) then
      hmi = min(h1, h2)
      hma = max(h1, h2)
  