2021-07-31 01:17:07 +02:00
|
|
|
program dmc_dress
|
2021-07-28 17:24:03 +02:00
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! Program that extracts the lowest states of the Hamiltonian dressed by the QMC
|
|
|
|
! dressing vector stored in :option:`dmc_dressing dmc_delta_h`
|
|
|
|
!
|
|
|
|
END_DOC
|
|
|
|
read_wf = .True.
|
|
|
|
touch read_wf
|
2021-07-30 00:57:03 +02:00
|
|
|
call pre
|
2021-07-28 17:24:03 +02:00
|
|
|
call routine
|
2021-07-31 01:17:07 +02:00
|
|
|
! call save_wavefunction_general(N_det,N_states,psi_det_sorted,size(psi_coef_sorted,1),psi_coef_sorted)
|
2021-07-28 17:24:03 +02:00
|
|
|
end
|
|
|
|
|
2021-07-30 00:57:03 +02:00
|
|
|
subroutine pre
|
|
|
|
implicit none
|
|
|
|
double precision, allocatable :: left(:,:), right(:,:), tmp(:,:), res(:,:)
|
|
|
|
allocate (left(1,1:N_det), right(1:N_det,1), tmp(1:N_det,1), res(1,1))
|
|
|
|
left(1,1:N_det) = psi_coef(1:N_det,1)
|
|
|
|
right(1:N_det,1) = psi_coef(1:N_det,1)
|
|
|
|
|
|
|
|
tmp(1:N_det,1:1) = matmul(h_matrix_dressed(1:N_det,1:N_det), right(1:N_det,1:1))
|
|
|
|
res(1:1,1:1) = matmul(left(1:1,1:N_det), tmp(1:N_det,1:1))
|
|
|
|
print *, 'E_in = ', res(1,1)
|
2021-07-31 01:17:07 +02:00
|
|
|
print *, 'HPsi/c0 = ', tmp(1,1)/psi_coef(1,1)
|
2021-07-30 00:57:03 +02:00
|
|
|
end
|
2021-07-28 17:24:03 +02:00
|
|
|
subroutine routine
|
|
|
|
implicit none
|
|
|
|
psi_coef(1:N_det,1) = ci_eigenvectors_dressed(1:N_det,1)
|
|
|
|
print*,'N_det = ',N_det
|
2021-07-30 00:57:03 +02:00
|
|
|
print *, 'E = ', ci_energy_dressed(1) + nuclear_repulsion
|
2021-07-28 17:24:03 +02:00
|
|
|
SOFT_TOUCH psi_coef
|
|
|
|
end
|