From 8ee9f7ed9b6a348ae9835309aca8ea8d784fcfe0 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 7 May 2018 15:51:02 +0200 Subject: [PATCH] truncate_wf_spin --- plugins/Bk/dressing.irp.f | 2 + plugins/QMC/truncate_wf_spin.irp.f | 83 ++++++++++---------- plugins/dress_zmq/dress_stoch_routines.irp.f | 2 +- 3 files changed, 44 insertions(+), 43 deletions(-) diff --git a/plugins/Bk/dressing.irp.f b/plugins/Bk/dressing.irp.f index 0fbefda5..d0e7c2d3 100644 --- a/plugins/Bk/dressing.irp.f +++ b/plugins/Bk/dressing.irp.f @@ -53,7 +53,9 @@ subroutine dress_with_alpha_buffer(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minili do i_state=1,N_states hdress = c_alpha(i_state) * i_h_alpha sdress = c_alpha(i_state) * i_s_alpha + !$OMP ATOMIC delta_ij_loc(i_state,j,1) = delta_ij_loc(i_state,j,1) + hdress + !$OMP ATOMIC delta_ij_loc(i_state,j,2) = delta_ij_loc(i_state,j,2) + sdress enddo enddo diff --git a/plugins/QMC/truncate_wf_spin.irp.f b/plugins/QMC/truncate_wf_spin.irp.f index 68e903c1..585171d0 100644 --- a/plugins/QMC/truncate_wf_spin.irp.f +++ b/plugins/QMC/truncate_wf_spin.irp.f @@ -65,53 +65,52 @@ subroutine run enddo !$OMP END PARALLEL DO endif - if (ci_threshold > norm_sort(j)) then - cycle + if (ci_threshold <= norm_sort(j)) then + exit endif - - u_0(1:N_det,1:N_states) = psi_bilinear_matrix_values(1:N_det,1:N_states) - v_0(1:N_det,1:N_states) = 0.d0 - u_t(1:N_states,1:N_det) = 0.d0 - v_t(1:N_states,1:N_det) = 0.d0 - s_t(1:N_states,1:N_det) = 0.d0 - call dtranspose( & - u_0, & - size(u_0, 1), & - u_t, & - size(u_t, 1), & - N_det, N_states) - print *, 'Computing H|Psi> ...' - call H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_states,N_det,1,N_det,0,1) - print *, 'Done' - call dtranspose( & - v_t, & - size(v_t, 1), & - v_0, & - size(v_0, 1), & - N_states, N_det) - - double precision, external :: u_dot_u, u_dot_v - do i=1,N_states - e_0(i) = u_dot_v(u_0(1,i),v_0(1,i),N_det)/u_dot_u(u_0(1,i),N_det) - print *, 'E = ', e_0(i) + nuclear_repulsion - enddo - - m = 0 - do k=1,n_det - if (sum(psi_bilinear_matrix_values(k,1:N_states)) /= 0.d0) then - m = m+1 - endif - enddo - - do k=1,N_states - E = E_0(k) + nuclear_repulsion - enddo - print *, 'Number of determinants:', m - exit enddo + + m = 0 + do k=1,n_det + if (sum(psi_bilinear_matrix_values(k,1:N_states)) /= 0.d0) then + m = m+1 + endif + enddo + + do k=1,N_states + E = E_0(k) + nuclear_repulsion + enddo + print *, 'Number of determinants:', m call wf_of_psi_bilinear_matrix(.True.) call save_wavefunction + u_0(1:N_det,1:N_states) = psi_bilinear_matrix_values(1:N_det,1:N_states) + v_0(1:N_det,1:N_states) = 0.d0 + u_t(1:N_states,1:N_det) = 0.d0 + v_t(1:N_states,1:N_det) = 0.d0 + s_t(1:N_states,1:N_det) = 0.d0 + call dtranspose( & + u_0, & + size(u_0, 1), & + u_t, & + size(u_t, 1), & + N_det, N_states) + print *, 'Computing H|Psi> ...' + call H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_states,N_det,1,N_det,0,1) + print *, 'Done' + call dtranspose( & + v_t, & + size(v_t, 1), & + v_0, & + size(v_0, 1), & + N_states, N_det) + + double precision, external :: u_dot_u, u_dot_v + do i=1,N_states + e_0(i) = u_dot_v(u_0(1,i),v_0(1,i),N_det)/u_dot_u(u_0(1,i),N_det) + print *, 'E(',i,') = ', e_0(i) + nuclear_repulsion + enddo + deallocate (iorder, norm_sort) end diff --git a/plugins/dress_zmq/dress_stoch_routines.irp.f b/plugins/dress_zmq/dress_stoch_routines.irp.f index f1406b7b..6bee7256 100644 --- a/plugins/dress_zmq/dress_stoch_routines.irp.f +++ b/plugins/dress_zmq/dress_stoch_routines.irp.f @@ -369,7 +369,7 @@ end function ! gen_per_cp : number of generators per checkpoint END_DOC comb_teeth = 64 - N_cps_max = 64 + N_cps_max = 256 gen_per_cp = (N_det_generators / N_cps_max) + 1 END_PROVIDER