anchor.diff:          l = l+1
         endif
       enddo
  -    call fill_H_apply_buffer_no_selection(l-1, tmp_det, N_int, 1)
  -  enddo
  +    call fill_H_apply_buffer_no_selection(l-1, tmp_det, N_int, iproc)
  +  enddo
  +  !$OMP END DO NOWAIT
  +  deallocate(tmp_det)
  +  !$OMP END PARALLEL
     deallocate (tmp_det)
     call copy_H_apply_buffer_to_wf
     SOFT_TOUCH psi_det psi_coef N_det
  
positive.code:       endif
      enddo
    enddo
  
  END_PROVIDER
  
  
negative.code: !  Create a wave function from all possible alpha x beta determinants
    END_DOC
    integer                        :: i,j,k,l
    integer                        :: idx, iproc
    integer, external              :: get_index_in_psi_det_sorted_bit
    integer(bit_kind), allocatable :: tmp_det(:,:,:)
    logical, external              :: is_in_wavefunction
    integer, external              :: omp_get_thread_num
  
    !$OMP PARALLEL DEFAULT(NONE) SHARED(psi_coef_sorted_bit,N_det_beta_unique,&
        !$OMP N_det_alpha_unique, N_int, psi_det_alpha_unique, psi_det_beta_unique,&
        !$OMP N_det)                                                &
        !$OMP PRIVATE(i,j,k,l,tmp_det,idx,iproc)
    !$ iproc = omp_get_thread_num()
    allocate (tmp_det(N_int,2,N_det_alpha_unique))
    !$OMP DO
    do j=1,N_det_beta_unique
      l = 1
      do i=1,N_det_alpha_unique
  