2014-05-28 23:12:00 +02:00
|
|
|
program cisd
|
|
|
|
implicit none
|
|
|
|
integer :: i,k
|
|
|
|
|
|
|
|
|
2014-05-29 01:38:46 +02:00
|
|
|
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:)
|
2014-05-28 23:12:00 +02:00
|
|
|
integer :: N_st, degree
|
|
|
|
N_st = N_states
|
2014-05-29 01:38:46 +02:00
|
|
|
allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st))
|
2014-06-03 19:14:12 +02:00
|
|
|
character*(64) :: perturbation
|
2014-05-28 23:12:00 +02:00
|
|
|
|
|
|
|
pt2 = 1.d0
|
|
|
|
diag_algorithm = "Lapack"
|
2014-06-27 10:16:40 +02:00
|
|
|
! do while (maxval(abs(pt2(1:N_st))) > 1.d-4)
|
2014-07-09 22:44:42 +02:00
|
|
|
do while (N_det < n_det_max_fci.and.maxval(abs(pt2(1:N_st))) > pt2_max)
|
2014-05-28 23:12:00 +02:00
|
|
|
call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st)
|
2014-07-16 14:03:05 +02:00
|
|
|
if (N_det > n_det_max_fci) then
|
2014-07-16 15:31:02 +02:00
|
|
|
psi_det = psi_det_sorted
|
|
|
|
psi_coef = psi_coef_sorted
|
2014-07-16 14:03:05 +02:00
|
|
|
N_det = n_det_max_fci
|
2014-07-16 15:31:02 +02:00
|
|
|
soft_touch N_det psi_det psi_coef
|
2014-07-16 14:03:05 +02:00
|
|
|
endif
|
2014-05-28 23:12:00 +02:00
|
|
|
call diagonalize_CI
|
2014-06-07 22:07:50 +02:00
|
|
|
call save_wavefunction
|
2014-05-28 23:12:00 +02:00
|
|
|
print *, 'N_det = ', N_det
|
|
|
|
print *, 'N_states = ', N_states
|
|
|
|
print *, 'PT2 = ', pt2
|
|
|
|
print *, 'E = ', CI_energy
|
|
|
|
print *, 'E+PT2 = ', CI_energy+pt2
|
2014-05-29 01:38:46 +02:00
|
|
|
print *, '-----'
|
2014-05-28 23:12:00 +02:00
|
|
|
if (abort_all) then
|
|
|
|
exit
|
|
|
|
endif
|
|
|
|
enddo
|
2014-07-09 00:41:08 +02:00
|
|
|
N_det = min(n_det_max_fci,N_det)
|
|
|
|
if(do_pt2_end)then
|
|
|
|
threshold_selectors = 1.d0
|
2014-07-16 14:03:05 +02:00
|
|
|
threshold_generators = 0.999d0
|
2014-07-09 00:41:08 +02:00
|
|
|
touch N_det psi_det psi_coef
|
|
|
|
call diagonalize_CI
|
|
|
|
call H_apply_FCI_PT2(pt2, norm_pert, H_pert_diag, N_st)
|
|
|
|
|
|
|
|
print *, 'Final step'
|
|
|
|
!! call remove_small_contributions
|
|
|
|
!! call diagonalize_CI
|
|
|
|
print *, 'N_det = ', N_det
|
|
|
|
print *, 'N_states = ', N_states
|
|
|
|
print *, 'PT2 = ', pt2
|
|
|
|
print *, 'E = ', CI_energy
|
|
|
|
print *, 'E+PT2 = ', CI_energy+pt2
|
|
|
|
print *, '-----'
|
|
|
|
endif
|
2014-05-28 23:12:00 +02:00
|
|
|
deallocate(pt2,norm_pert)
|
|
|
|
end
|