anchor.diff:    ASSERT (Nint == N_int)
     ASSERT (n>0)
     PROVIDE ref_bitmask_energy davidson_criterion
  +
  +  allocate (shortcut(0:n+1), sort_idx(n), sorted(Nint,n), version(Nint,n))
     v_0 = 0.d0
   
     call sort_dets_ab_v(keys_tmp, sorted, sort_idx, shortcut, version, n, Nint)
  
positive.code:   integer                        :: i,j,k,l, jj,ii
    integer                        :: i0, j0
    
    integer                        :: shortcut(0:n+1), sort_idx(n)
    integer(bit_kind)              :: sorted(Nint,n), version(Nint,n)
    integer(bit_kind)              :: sorted_i(Nint)
    
    
    integer                        :: sh, sh2, ni, exa, ext, org_i, org_j, endi
    double precision               :: local_threshold
  
negative.code:   do i=1,n
      v_0(i) += H_jj(i) * u_0(i)
    enddo
    deallocate (shortcut, sort_idx, sorted, version)
  end
  
  