2014-05-24 02:39:18 +02:00
|
|
|
program cisd
|
|
|
|
implicit none
|
|
|
|
integer :: i,k
|
|
|
|
|
|
|
|
|
2014-05-30 18:07:04 +02:00
|
|
|
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:),E_old(:)
|
2014-05-24 02:39:18 +02:00
|
|
|
integer :: N_st, iter
|
2014-05-27 17:30:44 +02:00
|
|
|
character*(64) :: perturbation
|
2014-05-24 02:39:18 +02:00
|
|
|
N_st = N_states
|
2014-05-30 18:07:04 +02:00
|
|
|
allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st),E_old(N_st))
|
2014-05-24 02:39:18 +02:00
|
|
|
|
|
|
|
pt2 = 1.d0
|
2014-05-27 17:30:44 +02:00
|
|
|
perturbation = "epstein_nesbet"
|
2014-05-30 18:07:04 +02:00
|
|
|
E_old(1) = HF_energy
|
2014-07-16 14:03:05 +02:00
|
|
|
call diagonalize_CI
|
|
|
|
do i = 1, N_st
|
|
|
|
print*,'state ',i
|
|
|
|
print *, 'E = ', CI_energy(i)
|
|
|
|
enddo
|
|
|
|
E_old = CI_energy
|
2015-05-12 15:14:54 +02:00
|
|
|
do while (maxval(abs(pt2(1:N_st))) > pt2_max.and.n_det < N_det_max)
|
2014-05-30 18:07:04 +02:00
|
|
|
print*,'----'
|
|
|
|
print*,''
|
2014-05-27 17:30:44 +02:00
|
|
|
call H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st)
|
2014-05-26 21:42:16 +02:00
|
|
|
call diagonalize_CI
|
2015-03-19 21:14:52 +01:00
|
|
|
psi_det = psi_det_sorted
|
|
|
|
psi_coef = psi_coef_sorted
|
2014-06-04 17:22:09 +02:00
|
|
|
print*,'N_det = ',N_det
|
|
|
|
do i = 1, N_st
|
|
|
|
print*,'state ',i
|
|
|
|
print *, 'PT2 = ', pt2(i)
|
|
|
|
print *, 'E = ', CI_energy(i)
|
|
|
|
print *, 'E_before +PT2 = ', (E_old(i)+pt2(i))
|
2014-05-30 18:07:04 +02:00
|
|
|
! print *, 'E+PT2_new= ', (E_old(1)+1.d0*pt2(1)+H_pert_diag(1))/(1.d0 +norm_pert(1))
|
2014-06-04 17:22:09 +02:00
|
|
|
enddo
|
|
|
|
E_old = CI_energy
|
2014-05-26 22:40:42 +02:00
|
|
|
if (abort_all) then
|
|
|
|
exit
|
|
|
|
endif
|
2014-05-24 02:39:18 +02:00
|
|
|
enddo
|
2015-05-12 15:14:54 +02:00
|
|
|
N_det = min(N_det,N_det_max)
|
2015-03-19 21:14:52 +01:00
|
|
|
touch N_det psi_det psi_coef
|
|
|
|
call diagonalize_CI
|
2015-11-30 14:54:37 +01:00
|
|
|
call save_wavefunction
|
2015-09-22 09:47:07 +02:00
|
|
|
call ezfio_set_cisd_selected_energy(CI_energy)
|
|
|
|
call ezfio_set_cisd_selected_energy_pt2(CI_energy+pt2)
|
2015-11-30 14:54:37 +01:00
|
|
|
deallocate(pt2,norm_pert,H_pert_diag)
|
2014-05-24 02:39:18 +02:00
|
|
|
end
|