From 5e1b0775761e333c2416a1f103d5c5dba1d096e2 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 14 Nov 2016 17:41:30 +0100 Subject: [PATCH] CAS_SD_ZMQ works with is_in_wavefunction --- plugins/CAS_SD_ZMQ/cassd_zmq.irp.f | 1 + plugins/CAS_SD_ZMQ/selection.irp.f | 12 +++++++++++- src/Determinants/H_apply.irp.f | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f b/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f index eb2d911f..01e57649 100644 --- a/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f +++ b/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f @@ -164,6 +164,7 @@ subroutine ZMQ_selection(N_in, pt2) if (N_in > 0) then call fill_H_apply_buffer_no_selection(b%cur,b%det,N_int,0) !!! PAS DE ROBIN call copy_H_apply_buffer_to_wf() +call remove_duplicates_in_psi_det if (s2_eig) then call make_s2_eigenfunction endif diff --git a/plugins/CAS_SD_ZMQ/selection.irp.f b/plugins/CAS_SD_ZMQ/selection.irp.f index 6e7ba359..39131520 100644 --- a/plugins/CAS_SD_ZMQ/selection.irp.f +++ b/plugins/CAS_SD_ZMQ/selection.irp.f @@ -202,6 +202,10 @@ subroutine fill_buffer_single(i_generator, sp, h1, bannedOrb, fock_diag_tmp, E0, if(vect(1, p1) == 0d0) cycle call apply_particle(mask, sp, p1, det, ok, N_int) +logical, external :: is_in_wavefunction +if (is_in_wavefunction(det,N_int)) then + cycle +endif Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),det,fock_diag_tmp,N_int) max_e_pert = 0d0 @@ -218,7 +222,9 @@ subroutine fill_buffer_single(i_generator, sp, h1, bannedOrb, fock_diag_tmp, E0, if(dabs(e_pert) > dabs(max_e_pert)) max_e_pert = e_pert end do - if(dabs(max_e_pert) > buf%mini) call add_to_selection_buffer(buf, det, max_e_pert) + if(dabs(max_e_pert) > buf%mini) then + call add_to_selection_buffer(buf, det, max_e_pert) + endif end do end subroutine @@ -669,6 +675,10 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d if(banned(p1,p2)) cycle if(mat(1, p1, p2) == 0d0) cycle call apply_particles(mask, s1, p1, s2, p2, det, ok, N_int) +logical, external :: is_in_wavefunction +if (is_in_wavefunction(det,N_int)) then + cycle +endif Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),det,fock_diag_tmp,N_int) diff --git a/src/Determinants/H_apply.irp.f b/src/Determinants/H_apply.irp.f index 88affa21..411fe703 100644 --- a/src/Determinants/H_apply.irp.f +++ b/src/Determinants/H_apply.irp.f @@ -258,12 +258,14 @@ subroutine remove_duplicates_in_psi_det(found_duplicates) k += 1 psi_det(:,:,k) = psi_det_sorted_bit (:,:,i) psi_coef(k,:) = psi_coef_sorted_bit(i,:) + else + call debug_det(psi_det_sorted_bit(1,1,i),N_int) + stop 'duplicates in psi_det' endif enddo N_det = k call write_bool(output_determinants,found_duplicates,'Found duplicate determinants') SOFT_TOUCH N_det psi_det psi_coef - stop 'duplicates in psi_det' endif deallocate (duplicate,bit_tmp) end