mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-25 14:01:46 +02:00
Bug fixed in perturbation_projected_sc2
This commit is contained in:
parent
6f805d17d5
commit
8a966ed732
@ -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))
|
allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st),E_old(N_st))
|
||||||
|
|
||||||
pt2 = 1.d0
|
pt2 = 1.d0
|
||||||
perturbation = "epstein_nesbet_sc2_projected"
|
perturbation = "epstein_nesbet_sc2"
|
||||||
E_old(1) = HF_energy
|
E_old(1) = HF_energy
|
||||||
davidson_threshold = 1.d-6
|
davidson_threshold = 1.d-6
|
||||||
if (N_det > n_det_max_cisd_sc2) then
|
if (N_det > n_det_max_cisd_sc2) then
|
||||||
@ -81,9 +81,6 @@ program cisd_sc2_selected
|
|||||||
print *, 'PT2(SC2) = ', pt2(i)
|
print *, 'PT2(SC2) = ', pt2(i)
|
||||||
print *, 'E(SC2) = ', CI_SC2_energy(i)
|
print *, 'E(SC2) = ', CI_SC2_energy(i)
|
||||||
print *, 'E_before(SC2)+PT2(SC2) = ', (CI_SC2_energy(i)+pt2(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))
|
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)
|
call get_excitation_degree(ref_bitmask,psi_det(1,1,imax),degree,N_int)
|
||||||
@ -92,5 +89,6 @@ program cisd_sc2_selected
|
|||||||
enddo
|
enddo
|
||||||
print*,'coucou'
|
print*,'coucou'
|
||||||
endif
|
endif
|
||||||
|
call save_wavefunction
|
||||||
deallocate(pt2,norm_pert,H_pert_diag)
|
deallocate(pt2,norm_pert,H_pert_diag)
|
||||||
end
|
end
|
||||||
|
@ -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
|
integer :: i,j,degree,l
|
||||||
double precision :: diag_H_mat_elem,accu_e_corr,hij,h0j,h,delta_E
|
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
|
double precision :: repeat_all_e_corr,accu_e_corr_tmp,e_2_pert_fonda
|
||||||
|
|
||||||
ASSERT (Nint == N_int)
|
ASSERT (Nint == N_int)
|
||||||
ASSERT (Nint > 0)
|
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)
|
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
|
accu_e_corr = 0.d0
|
||||||
!$IVDEP
|
!$IVDEP
|
||||||
@ -45,10 +48,8 @@ subroutine pt2_epstein_nesbet_SC2_projected(det_pert,c_pert,e_2_pert,H_pert_diag
|
|||||||
enddo
|
enddo
|
||||||
h = diag_H_mat_elem(det_pert,Nint) + accu_e_corr
|
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)
|
e_2_pert(1) = i_H_psi_array(1) * c_pert(1)
|
||||||
|
|
||||||
do i =2,N_st
|
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
|
if(degree==4)then
|
||||||
! <psi|delta_H|psi>
|
! <psi|delta_H|psi>
|
||||||
call i_H_j(ref_bitmask,det_pert,Nint,h0j)
|
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)
|
e_2_pert_fonda = H_pert_diag(1)
|
||||||
do i = 1, N_st
|
do i = 1, N_st
|
||||||
do j = 1, idx_repeat(0)
|
do j = 1, idx_repeat(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user