anchor.diff:      do s = 1, 2
         do j=1,n_element(s,i)
           nt = list(j,s,i) + mo_tot_num * (s-1)
  +        pweni += 1
  +        pwen(pweni) = nt
           if(n_element(1,i) + n_element(2,i) == 4) then
  -          pweni += 1
  -          pwen(pweni) = nt
  -        
             idx_microlist(cur_microlist(nt)) = idx(i)
             do k=1,Nint
               microlist(k,1,cur_microlist(nt)) = minilist(k,1,idx(i))
  
positive.code:   integer :: i,j,k,s,nt,nt2
    integer, allocatable :: n_element(:,:), idx(:), list(:,:,:)
    integer :: cur_microlist(0:mo_tot_num*2+1), cur_tmicrolist(0:mo_tot_num*2+1)
    integer(bit_kind) :: key_mask_neg(Nint,2), mobileMask(Nint,2)
    integer :: mo_tot_num_2, pwen(4), pweni
    logical,intent(out) :: isinwf(mo_tot_num*2, mo_tot_num*2)
    double precision, intent(out) :: d0s(mo_tot_num, mo_tot_num, N_states)
    double precision :: integ(mo_tot_num, mo_tot_num)
    logical :: banned(mo_tot_num*2), banned_pair(mo_tot_num*2, mo_tot_num*2)
    banned = .false.
    banned_pair = .false.
  
  
negative.code:           i_H_psi_value = i_H_psi_value + i_H_psi_value2
          end if
  
          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
            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)
  