1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 14:43:41 +01:00

Fixed dressing

This commit is contained in:
Anthony Scemama 2021-07-30 00:57:03 +02:00
parent 2eee95ba68
commit e9bd3ee096
2 changed files with 18 additions and 4 deletions

View File

@ -7,13 +7,26 @@ program diagonalize_h
END_DOC
read_wf = .True.
touch read_wf
call pre
call routine
call save_wavefunction_general(N_det,N_states,psi_det_sorted,size(psi_coef_sorted,1),psi_coef_sorted)
end
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)
end
subroutine routine
implicit none
psi_coef(1:N_det,1) = ci_eigenvectors_dressed(1:N_det,1)
print*,'N_det = ',N_det
print *, 'E = ', ci_energy_dressed(1) + nuclear_repulsion
SOFT_TOUCH psi_coef
end

View File

@ -3,21 +3,22 @@
implicit none
BEGIN_DOC
! \Delta_{state-specific}. \Psi
! Diagonal element is divided by 2 because Delta = D + D^t
END_DOC
integer :: i,ii,k,j, l
double precision :: f, tmp
double precision, external :: u_dot_v
logical, external :: detEq
dressing_column_h(:,:) = 0.d0
dressing_column_s(:,:) = 0.d0
l = dressed_column_idx(1)
do j = 1, n_det
dressing_column_h(j,1) = 0.5d0*dmc_delta_h(j)
dressing_column_h(l,1) -= 0.5d0 * psi_coef(j,1) * dmc_delta_h(j) /psi_coef(l,1)
dressing_column_h(j,1) = dmc_delta_h(j)
dressing_column_h(l,1) -= psi_coef(j,1) * dmc_delta_h(j) /psi_coef(l,1)
enddo
dressing_column_h(l,1) = dressing_column_h(l,1) * 0.5d0
END_PROVIDER