anchor.diff:  end
   
   
  -! BEGIN_PROVIDER [ double precision, hij_cache_, (N_det,Nproc) ]
  -!&BEGIN_PROVIDER [ double precision, sij_cache_, (N_det,Nproc) ]
    BEGIN_PROVIDER [ double precision, fock_diag_tmp_, (2,mo_tot_num+1,Nproc) ]
   &BEGIN_PROVIDER [ integer, current_generator_, (Nproc) ]
     implicit none
  -!  allocate(fock_diag_tmp(2,mo_tot_num+1))
     current_generator_(:) = 0
    END_PROVIDER
   
  
negative.code:   double precision :: hii, hij, sij, delta_e
    double precision, external :: diag_H_mat_elem_fock
    integer                        :: i,j,k,l,m, l_sd
    double precision, save :: tot = 0d0
    double precision :: de(N_states), val, tmp
    
    stop "shiftedbk currently does not work"
  
    if(current_generator_(iproc) /= i_gen) then
      current_generator_(iproc) = i_gen
      call build_fock_tmp(fock_diag_tmp_(1,1,iproc),psi_det_generators(1,1,i_gen),N_int)
    end if
  
    hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_gen),alpha,fock_diag_tmp_(1,1,iproc),N_int)
    do i=1,N_states
      de(i) = (E0_denominator(i) - hii)
    end do
    
    do i=1,N_states
      val = 0D0
      do l_sd=1,n_minilist
        call i_h_j_s2(alpha,det_minilist(1,1,l_sd),N_int,hij, sij)
        val += hij
      end do
      val = 2d0 * val
      tmp = dsqrt(de(i)**2 + val**2)
      if(de(i) < 0d0) tmp = -tmp
      delta_ij_loc(i, minilist(l_sd), 1) += 0.5d0 * (tmp - de(i)) ! * psi_coef(minilist(l_sd), i)
    end do
  end subroutine
  
  