anchor.diff:    one_body_dm_mo_alpha = 0.d0
     one_body_dm_mo_beta  = 0.d0
     !$OMP PARALLEL DEFAULT(NONE)                                         &
  -    !$OMP PRIVATE(j,k,l,m,occ,ck, cl, ckl,phase,h1,h2,p1,p2,s1,s2, degree,exc, &
  +    !$OMP PRIVATE(j,k,k_a,k_b,l,m,occ,ck, cl, ckl,phase,h1,h2,p1,p2,s1,s2, degree,exc, &
       !$OMP  tmp_a, tmp_b, n_occ, krow, kcol, lrow, lcol, tmp_det, tmp_det2)&
       !$OMP SHARED(psi_det,psi_coef,N_int,N_states,elec_alpha_num,&
       !$OMP  elec_beta_num,one_body_dm_mo_alpha,one_body_dm_mo_beta,N_det,&
  
positive.code:    ! Alpha and beta one-body density matrix for each state
     END_DOC
  
     integer                        :: j,k,l,m
     integer                        :: occ(N_int*bit_kind_size,2)
     double precision               :: ck, cl, ckl
     double precision               :: phase
  
negative.code:   enddo
    !$OMP END DO NOWAIT
    !$OMP CRITICAL
    one_body_dm_mo_beta(:,:,:)  = one_body_dm_mo_beta(:,:,:)  + tmp_b(:,:,:)
    !$OMP END CRITICAL
  
    deallocate(tmp_b)
    !$OMP END PARALLEL
  
  END_PROVIDER
  