9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 11:33:29 +01:00

Printing overlap

This commit is contained in:
Anthony Scemama 2020-09-02 10:47:29 +02:00
parent 7b6c0e13eb
commit 81628a6ae0
2 changed files with 20 additions and 11 deletions

View File

@ -314,9 +314,18 @@ subroutine ZMQ_pt2(E, pt2_data, pt2_data_err, relative_error, N_in)
print '(A)', '========== ================= =========== =============== =============== =================' print '(A)', '========== ================= =========== =============== =============== ================='
pt2_overlap(:,pt2_stoch_istate) = pt2_data % overlap(:,pt2_stoch_istate) do k=1,N_states
print *, 'Overlap' pt2_overlap(pt2_stoch_istate,k) = pt2_data % overlap(k,pt2_stoch_istate)
enddo
! ! The overlap is not exactly zero because of the guiding function.
! ! Remove the bias
! do k=1,pt2_stoch_istate-1
! pt2_overlap(k,pt2_stoch_istate) -= pt2_data % overlap(k,pt2_stoch_istate)
! enddo
print *, 'Overlap before orthogonalization'
print *, pt2_overlap(:,pt2_stoch_istate) print *, pt2_overlap(:,pt2_stoch_istate)
print *, 'Overlap after orthogonalization'
print *, pt2_overlap(pt2_stoch_istate,:)
print *, '-------' print *, '-------'
SOFT_TOUCH pt2_overlap SOFT_TOUCH pt2_overlap
@ -520,7 +529,7 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2_data, pt2_data_
if ((time - time1 > 1.d0) .or. (n==N_det_generators)) then if ((time - time1 > 1.d0) .or. (n==N_det_generators)) then
time1 = time time1 = time
print '(G10.3, 2X, F16.10, 2X, G10.3, 2X, G14.6, 2X, G14.6, 2X, F10.4, A10)', c, avg+E, eqt, avg2, avg3(pt2_stoch_istate), time-time0, '' print '(G10.3, 2X, F16.10, 2X, G10.3, 2X, G14.6, 2X, G14.6, 2X, F10.4)', c, avg+E, eqt, avg2, avg3(pt2_stoch_istate), time-time0
if (stop_now .or. ( & if (stop_now .or. ( &
(do_exit .and. (dabs(pt2_data_err % pt2(pt2_stoch_istate)) / & (do_exit .and. (dabs(pt2_data_err % pt2(pt2_stoch_istate)) / &
(1.d-20 + dabs(pt2_data % pt2(pt2_stoch_istate)) ) <= relative_error))) ) then (1.d-20 + dabs(pt2_data % pt2(pt2_stoch_istate)) ) <= relative_error))) ) then

View File

@ -780,17 +780,17 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
endif endif
enddo enddo
do istate=1,N_states
do jstate=1,N_states
pt2_data % overlap(jstate,istate) += coef(jstate) * coef(istate)
enddo
enddo
! Gram-Schmidt using input overlap matrix ! Gram-Schmidt using input overlap matrix
do istate=1,N_states do istate=1,N_states
do jstate=1,istate-1 do jstate=1,istate-1
if ( (pt2_overlap(istate,jstate) == 0.d0).or.(pt2_overlap(jstate,jstate) == 0.d0) ) cycle if ( (pt2_overlap(jstate,istate) == 0.d0).or.(pt2_overlap(jstate,jstate) == 0.d0) ) cycle
coef(istate) = coef(istate) - pt2_overlap(istate,jstate)/pt2_overlap(jstate,jstate) * coef(jstate) coef(istate) = coef(istate) - pt2_overlap(jstate,istate)/pt2_overlap(jstate,jstate) * coef(jstate)
enddo
enddo
do istate=1, N_states
do jstate=1,N_states
pt2_data % overlap(jstate,istate) += coef(jstate) * coef(istate)
enddo enddo
enddo enddo