From 8a966ed73224281140be82a51a7fa3d190b3ed1f Mon Sep 17 00:00:00 2001 From: Manu Date: Sat, 16 Aug 2014 19:00:29 +0200 Subject: [PATCH] Bug fixed in perturbation_projected_sc2 --- src/CISD_SC2_selected/cisd_sc2_selection.irp.f | 6 ++---- src/Perturbation/pert_sc2.irp.f | 9 +++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/CISD_SC2_selected/cisd_sc2_selection.irp.f b/src/CISD_SC2_selected/cisd_sc2_selection.irp.f index 0f5ee574..8c90c755 100644 --- a/src/CISD_SC2_selected/cisd_sc2_selection.irp.f +++ b/src/CISD_SC2_selected/cisd_sc2_selection.irp.f @@ -11,7 +11,7 @@ program cisd_sc2_selected allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st),E_old(N_st)) pt2 = 1.d0 - perturbation = "epstein_nesbet_sc2_projected" + perturbation = "epstein_nesbet_sc2" E_old(1) = HF_energy davidson_threshold = 1.d-6 if (N_det > n_det_max_cisd_sc2) then @@ -81,9 +81,6 @@ program cisd_sc2_selected print *, 'PT2(SC2) = ', pt2(i) print *, 'E(SC2) = ', CI_SC2_energy(i) print *, 'E_before(SC2)+PT2(SC2) = ', (CI_SC2_energy(i)+pt2(i)) - if(i==1)then - print *, 'E(SC2)+PT2(projctd)SC2 = ', (CI_SC2_energy(i)+H_pert_diag(i)) - endif print*,'greater coeficient of the state : ',dabs(psi_coef(imax,i)) call get_excitation_degree(ref_bitmask,psi_det(1,1,imax),degree,N_int) @@ -92,5 +89,6 @@ program cisd_sc2_selected enddo print*,'coucou' endif + call save_wavefunction deallocate(pt2,norm_pert,H_pert_diag) end diff --git a/src/Perturbation/pert_sc2.irp.f b/src/Perturbation/pert_sc2.irp.f index 9f60d268..e4e4dbfc 100644 --- a/src/Perturbation/pert_sc2.irp.f +++ b/src/Perturbation/pert_sc2.irp.f @@ -35,8 +35,11 @@ subroutine pt2_epstein_nesbet_SC2_projected(det_pert,c_pert,e_2_pert,H_pert_diag integer :: i,j,degree,l double precision :: diag_H_mat_elem,accu_e_corr,hij,h0j,h,delta_E double precision :: repeat_all_e_corr,accu_e_corr_tmp,e_2_pert_fonda + ASSERT (Nint == N_int) ASSERT (Nint > 0) + + double precision :: tmp call i_H_psi_SC2(det_pert,psi_selectors,psi_selectors_coef,Nint,N_det_selectors,psi_selectors_size,N_st,i_H_psi_array,idx_repeat) accu_e_corr = 0.d0 !$IVDEP @@ -45,10 +48,8 @@ subroutine pt2_epstein_nesbet_SC2_projected(det_pert,c_pert,e_2_pert,H_pert_diag enddo h = diag_H_mat_elem(det_pert,Nint) + accu_e_corr - delta_E = (CI_SC2_electronic_energy(1) - h) - delta_E = 1.d0/delta_E - c_pert(1) = i_H_psi_array(1) * delta_E + c_pert(1) = i_H_psi_array(1) /(CI_SC2_electronic_energy(1) - h) e_2_pert(1) = i_H_psi_array(1) * c_pert(1) do i =2,N_st @@ -76,7 +77,7 @@ subroutine pt2_epstein_nesbet_SC2_projected(det_pert,c_pert,e_2_pert,H_pert_diag if(degree==4)then ! call i_H_j(ref_bitmask,det_pert,Nint,h0j) - H_pert_diag(1) = c_pert(1) * h0j/coef_hf_selector + H_pert_diag(1) = e_2_pert(1) e_2_pert_fonda = H_pert_diag(1) do i = 1, N_st do j = 1, idx_repeat(0)