10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-27 06:43:48 +01:00
quantum_package/plugins/eginer/CISD_selected/cisd_selected.irp.f

46 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))
enddo
E_old = CI_energy
2015-12-01 23:06:52 +01:00
call save_wavefunction
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
2015-12-01 23:06:52 +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)
end