From 81628a6ae0f67f61d1411f75c39f715c28cecfc2 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 2 Sep 2020 10:47:29 +0200 Subject: [PATCH] Printing overlap --- src/cipsi/pt2_stoch_routines.irp.f | 15 ++++++++++++--- src/cipsi/selection.irp.f | 16 ++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/cipsi/pt2_stoch_routines.irp.f b/src/cipsi/pt2_stoch_routines.irp.f index f268430f..f0bd8847 100644 --- a/src/cipsi/pt2_stoch_routines.irp.f +++ b/src/cipsi/pt2_stoch_routines.irp.f @@ -314,9 +314,18 @@ subroutine ZMQ_pt2(E, pt2_data, pt2_data_err, relative_error, N_in) print '(A)', '========== ================= =========== =============== =============== =================' - pt2_overlap(:,pt2_stoch_istate) = pt2_data % overlap(:,pt2_stoch_istate) -print *, 'Overlap' + do k=1,N_states + 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 *, 'Overlap after orthogonalization' +print *, pt2_overlap(pt2_stoch_istate,:) print *, '-------' 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 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. ( & (do_exit .and. (dabs(pt2_data_err % pt2(pt2_stoch_istate)) / & (1.d-20 + dabs(pt2_data % pt2(pt2_stoch_istate)) ) <= relative_error))) ) then diff --git a/src/cipsi/selection.irp.f b/src/cipsi/selection.irp.f index 9390a9bf..071d9294 100644 --- a/src/cipsi/selection.irp.f +++ b/src/cipsi/selection.irp.f @@ -780,17 +780,17 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d endif 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 do istate=1,N_states do jstate=1,istate-1 - if ( (pt2_overlap(istate,jstate) == 0.d0).or.(pt2_overlap(jstate,jstate) == 0.d0) ) cycle - coef(istate) = coef(istate) - pt2_overlap(istate,jstate)/pt2_overlap(jstate,jstate) * coef(jstate) + if ( (pt2_overlap(jstate,istate) == 0.d0).or.(pt2_overlap(jstate,jstate) == 0.d0) ) cycle + 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