10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 20:35:19 +01:00

Corrected bug for multi-state MRCC

This commit is contained in:
Anthony Scemama 2016-11-15 10:32:57 +01:00
parent 80d0a9420e
commit c366c201eb
2 changed files with 10 additions and 4 deletions

View File

@ -684,6 +684,8 @@ END_PROVIDER
do pp = hh_shortcut(hh), hh_shortcut(hh+1)-1
if(is_active_exc(pp)) cycle
lref = 0
AtB(pp) = 0.d0
X(pp) = 0.d0
do II=1,N_det_ref
call apply_hole_local(psi_ref(1,1,II), hh_exists(1, hh), myMask, ok, N_int)
if(.not. ok) cycle
@ -693,12 +695,12 @@ END_PROVIDER
if(ind == -1) cycle
ind = psi_non_ref_sorted_idx(ind)
call get_phase(myDet(1,1), psi_ref(1,1,II), phase, N_int)
X(pp) += psi_ref_coef(II,s)**2
X(pp) = X(pp) + psi_ref_coef(II,s)*psi_ref_coef(II,s)
AtB(pp) += psi_non_ref_coef(ind, s) * psi_ref_coef(II, s) * phase
lref(II) = ind
if(phase < 0d0) lref(II) = -ind
if(phase < 0.d0) lref(II) = -ind
end do
X(pp) = AtB(pp) / X(pp)
X(pp) = AtB(pp)
do II=1,N_det_ref
if(lref(II) > 0) then
rho_mrcc_init(lref(II)) = psi_ref_coef(II,s) * X(pp)
@ -709,7 +711,7 @@ END_PROVIDER
end do
end do
deallocate(lref)
x_new = x
double precision :: factor, resold

View File

@ -97,6 +97,10 @@ END_PROVIDER
endif
enddo
N_det_non_ref = i_non_ref
if (N_det_non_ref < 1) then
print *, 'Error : All determinants are in the reference'
stop -1
endif
END_PROVIDER
BEGIN_PROVIDER [ integer(bit_kind), psi_non_ref_restart, (N_int,2,psi_det_size) ]