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

44 lines
1.2 KiB
Fortran
Raw Normal View History

2015-11-20 12:27:20 +01:00
program mp2_wf
2016-11-17 23:28:37 +01:00
no_vvvv_integrals = .True.
SOFT_TOUCH no_vvvv_integrals
call run
end
subroutine run
2015-11-20 12:27:20 +01:00
implicit none
BEGIN_DOC
! Save the MP2 wave function
END_DOC
integer :: i,k
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:)
integer :: N_st, iter
N_st = N_states
allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st))
pt2 = 1.d0
2016-01-02 21:45:28 +01:00
selection_criterion_factor = 0.d0
2015-11-20 12:27:20 +01:00
TOUCH selection_criterion_min selection_criterion selection_criterion_factor
call H_apply_mp2_selection(pt2, norm_pert, H_pert_diag, N_st)
2017-05-31 02:03:29 +02:00
touch N_det psi_det psi_coef
2015-11-20 12:27:20 +01:00
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
2015-11-20 19:51:56 +01:00
touch N_det psi_det psi_coef
2017-05-31 02:03:29 +02:00
do i=N_det,1,-1
2017-05-31 02:34:54 +02:00
if (dabs(psi_coef(i,1)) <= 1.d-8) then
2017-05-31 02:03:29 +02:00
N_det -= 1
endif
enddo
2015-11-20 12:27:20 +01:00
print*,'N_det = ',N_det
print*,'-----'
print *, 'PT2 = ', pt2(1)
print *, 'E = ', HF_energy
print *, 'E_before +PT2 = ', HF_energy+pt2(1)
N_det = min(N_det,N_det_max)
2017-05-31 02:34:54 +02:00
touch N_det psi_det psi_coef
2015-11-20 12:27:20 +01:00
call save_wavefunction
call ezfio_set_mp2_energy(HF_energy+pt2(1))
deallocate(pt2,norm_pert,H_pert_diag)
end