10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-12 00:54:07 +01:00
quantum_package/src/Full_CI/full_ci.irp.f

76 lines
2.1 KiB
FortranFixed
Raw Normal View History

2014-09-06 00:51:55 +02:00
program full_ci
2014-05-28 23:12:00 +02:00
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))
character*(64) :: perturbation
2014-05-28 23:12:00 +02:00
pt2 = 1.d0
diag_algorithm = "Lapack"
2014-07-29 12:11:26 +02:00
if (N_det > n_det_max_fci) then
call diagonalize_CI
call save_wavefunction
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
N_det = n_det_max_fci
soft_touch N_det psi_det psi_coef
call diagonalize_CI
call save_wavefunction
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-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-10-15 15:19:34 +02:00
PROVIDE psi_coef
PROVIDE psi_det
PROVIDE psi_det_sorted
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
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
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