From 750ec9ca00559eced5f08ece573bd583f5aa8c2b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 19 Apr 2023 09:31:36 +0200 Subject: [PATCH 1/5] Fix f77zmq --- configure | 2 +- external/qp2-dependencies | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 5b50d0d7..d3377093 100755 --- a/configure +++ b/configure @@ -232,7 +232,7 @@ EOF execute << EOF cd "\${QP_ROOT}"/external - tar --gunzip --extract --file qp2-dependencies/f77-zmq-4.3.2.tar.gz + tar --gunzip --extract --file qp2-dependencies/f77-zmq-4.3.?.tar.gz cd f77-zmq-* ./configure --prefix=\$QP_ROOT export ZMQ_H="\$QP_ROOT"/include/zmq.h diff --git a/external/qp2-dependencies b/external/qp2-dependencies index ce14f57b..fd43778e 160000 --- a/external/qp2-dependencies +++ b/external/qp2-dependencies @@ -1 +1 @@ -Subproject commit ce14f57b50511825a9fedb096749200779d3f4d4 +Subproject commit fd43778e12bb5858c4c780c34346be0f158b8cc7 From d3b76e5957aadc11f2090084491e8b90bb6a50ff Mon Sep 17 00:00:00 2001 From: eginer Date: Fri, 14 Apr 2023 10:56:07 +0200 Subject: [PATCH 2/5] changed h_p to h --- external/qp2-dependencies | 2 +- src/davidson/diagonalization_hs2_dressed.irp.f | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/external/qp2-dependencies b/external/qp2-dependencies index fd43778e..e0d0e02e 160000 --- a/external/qp2-dependencies +++ b/external/qp2-dependencies @@ -1 +1 @@ -Subproject commit fd43778e12bb5858c4c780c34346be0f158b8cc7 +Subproject commit e0d0e02e9f5ece138d1520106954a881ab0b8db2 diff --git a/src/davidson/diagonalization_hs2_dressed.irp.f b/src/davidson/diagonalization_hs2_dressed.irp.f index 8117f320..d37b7386 100644 --- a/src/davidson/diagonalization_hs2_dressed.irp.f +++ b/src/davidson/diagonalization_hs2_dressed.irp.f @@ -465,8 +465,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_ integer :: lwork, info double precision, allocatable :: work(:) -! y = h - y = h_p + y = h lwork = -1 allocate(work(1)) call dsygv(1,'V','U',shift2,y,size(y,1), & From ba2e783e8c6531ddeda40ac72d223a1d1ee67dcc Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 4 May 2023 11:41:17 +0200 Subject: [PATCH 3/5] Fix pt2_max extra iterations --- src/cipsi/cipsi.irp.f | 8 +------- src/cipsi/stochastic_cipsi.irp.f | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/cipsi/cipsi.irp.f b/src/cipsi/cipsi.irp.f index 5225c6df..3b344f62 100644 --- a/src/cipsi/cipsi.irp.f +++ b/src/cipsi/cipsi.irp.f @@ -130,13 +130,7 @@ subroutine run_cipsi if (qp_stop()) exit enddo - if (.not.qp_stop()) then - if (N_det < N_det_max) then - call diagonalize_CI - call save_wavefunction - call save_energy(psi_energy_with_nucl_rep, zeros) - endif - + if ((.not.qp_stop()).and.(N_det > N_det_max)) then if (do_pt2) then call pt2_dealloc(pt2_data) call pt2_dealloc(pt2_data_err) diff --git a/src/cipsi/stochastic_cipsi.irp.f b/src/cipsi/stochastic_cipsi.irp.f index 35e80eb8..6a14fbf3 100644 --- a/src/cipsi/stochastic_cipsi.irp.f +++ b/src/cipsi/stochastic_cipsi.irp.f @@ -119,13 +119,7 @@ subroutine run_stochastic_cipsi if (qp_stop()) exit enddo - if (.not.qp_stop()) then - if (N_det < N_det_max) then - call diagonalize_CI - call save_wavefunction - call save_energy(psi_energy_with_nucl_rep, zeros) - endif - + if ((.not.qp_stop()).and.(N_det > N_det_max)) then call pt2_dealloc(pt2_data) call pt2_dealloc(pt2_data_err) call pt2_alloc(pt2_data, N_states) From e8782546c1387bfc030f5e659d6a914d038d280f Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 4 May 2023 11:54:29 +0200 Subject: [PATCH 4/5] Better fix for pt2_max --- src/cipsi/cipsi.irp.f | 8 +++++++- src/cipsi/stochastic_cipsi.irp.f | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/cipsi/cipsi.irp.f b/src/cipsi/cipsi.irp.f index 3b344f62..f3a77609 100644 --- a/src/cipsi/cipsi.irp.f +++ b/src/cipsi/cipsi.irp.f @@ -130,7 +130,13 @@ subroutine run_cipsi if (qp_stop()) exit enddo - if ((.not.qp_stop()).and.(N_det > N_det_max)) then + ! If stopped because N_det > N_det_max, do an extra iteration to compute the PT2 + if ((.not.qp_stop()).and. & + (N_det > N_det_max) .and. & + (maxval(abs(pt2_data % pt2(1:N_states))) > pt2_max) .and. & + (maxval(abs(pt2_data % variance(1:N_states))) > variance_max) .and.& + (correlation_energy_ratio <= correlation_energy_ratio_max) & + ) then if (do_pt2) then call pt2_dealloc(pt2_data) call pt2_dealloc(pt2_data_err) diff --git a/src/cipsi/stochastic_cipsi.irp.f b/src/cipsi/stochastic_cipsi.irp.f index 6a14fbf3..0b9a3548 100644 --- a/src/cipsi/stochastic_cipsi.irp.f +++ b/src/cipsi/stochastic_cipsi.irp.f @@ -119,7 +119,13 @@ subroutine run_stochastic_cipsi if (qp_stop()) exit enddo - if ((.not.qp_stop()).and.(N_det > N_det_max)) then + ! If stopped because N_det > N_det_max, do an extra iteration to compute the PT2 + if ((.not.qp_stop()).and. & + (N_det > N_det_max) .and. & + (maxval(abs(pt2_data % pt2(1:N_states))) > pt2_max) .and. & + (maxval(abs(pt2_data % variance(1:N_states))) > variance_max) .and.& + (correlation_energy_ratio <= correlation_energy_ratio_max) & + ) then call pt2_dealloc(pt2_data) call pt2_dealloc(pt2_data_err) call pt2_alloc(pt2_data, N_states) From c96e7c754e609fbc7391451a2d6e9588997b5958 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 5 May 2023 12:25:37 +0200 Subject: [PATCH 5/5] mo_num -> n_core_inact_act_orb in RDMs --- src/two_body_rdm/two_e_dm_mo.irp.f | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/two_body_rdm/two_e_dm_mo.irp.f b/src/two_body_rdm/two_e_dm_mo.irp.f index 7e35fc7b..6bd115a2 100644 --- a/src/two_body_rdm/two_e_dm_mo.irp.f +++ b/src/two_body_rdm/two_e_dm_mo.irp.f @@ -16,13 +16,13 @@ BEGIN_PROVIDER [double precision, two_e_dm_mo, (mo_num,mo_num,mo_num,mo_num)] two_e_dm_mo = 0.d0 integer :: i,j,k,l,iorb,jorb,korb,lorb,istate - do l=1,mo_num + do l=1,n_core_inact_act_orb lorb = list_core_inact_act(l) - do k=1,mo_num + do k=1,n_core_inact_act_orb korb = list_core_inact_act(k) - do j=1,mo_num + do j=1,n_core_inact_act_orb jorb = list_core_inact_act(j) - do i=1,mo_num + do i=1,n_core_inact_act_orb iorb = list_core_inact_act(i) two_e_dm_mo(iorb,jorb,korb,lorb) = state_av_full_occ_2_rdm_spin_trace_mo(i,j,k,l) enddo