10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-08 23:23:57 +01:00
quantum_package/plugins/CISD_selected/cisd_selection.irp.f

47 lines
1.4 KiB
Fortran
Raw Normal View History

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(:)
integer :: N_st, iter
2014-05-27 17:30:44 +02:00
character*(64) :: perturbation
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))
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
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
if (abort_all) then
exit
endif
enddo
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
2014-05-28 23:12:00 +02:00
deallocate(pt2,norm_pert,H_pert_diag)
2015-03-19 21:14:52 +01:00
call save_wavefunction
end