mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-25 13:53:49 +01:00
removed limit to deterministic set size
This commit is contained in:
parent
f45fc46b4f
commit
3044e7e72a
@ -323,7 +323,7 @@ subroutine pt2_collector(zmq_socket_pull, E, b, tbc, comb, Ncomb, computed, pt2_
|
|||||||
eqt = 0.d0
|
eqt = 0.d0
|
||||||
endif
|
endif
|
||||||
call wall_time(time)
|
call wall_time(time)
|
||||||
if ( (dabs(eqt/avg) < relative_error) .or. (dabs(eqt) < absolute_error) .and. Nabove(tooth) >= 30) then
|
if ( ((dabs(eqt/avg) < relative_error) .or. (dabs(eqt) < absolute_error)) .and. Nabove(tooth) >= 30) then
|
||||||
! Termination
|
! Termination
|
||||||
pt2(pt2_stoch_istate) = avg
|
pt2(pt2_stoch_istate) = avg
|
||||||
error(pt2_stoch_istate) = eqt
|
error(pt2_stoch_istate) = eqt
|
||||||
|
@ -13,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ]
|
|||||||
N_det_generators = N_det
|
N_det_generators = N_det
|
||||||
do i=1,N_det
|
do i=1,N_det
|
||||||
norm = norm + psi_average_norm_contrib_sorted(i)
|
norm = norm + psi_average_norm_contrib_sorted(i)
|
||||||
if (norm >= threshold_generators) then
|
if (norm > threshold_generators+1d-10) then
|
||||||
N_det_generators = i
|
N_det_generators = i
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
|
@ -227,6 +227,7 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2,
|
|||||||
|
|
||||||
pullLoop : do while (loop)
|
pullLoop : do while (loop)
|
||||||
call pull_dress_results(zmq_socket_pull, ind, cur_cp, delta_loc, int_buf, double_buf, det_buf, N_buf, task_id, dress_mwen)
|
call pull_dress_results(zmq_socket_pull, ind, cur_cp, delta_loc, int_buf, double_buf, det_buf, N_buf, task_id, dress_mwen)
|
||||||
|
!print *, cur_cp, ind
|
||||||
if(floop) then
|
if(floop) then
|
||||||
call wall_time(time)
|
call wall_time(time)
|
||||||
print *, "first_pull", time-time0
|
print *, "first_pull", time-time0
|
||||||
@ -436,7 +437,7 @@ END_PROVIDER
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!
|
!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
if(.FALSE.) then
|
if(.TRUE.) then
|
||||||
do l=first_suspect,N_det_generators
|
do l=first_suspect,N_det_generators
|
||||||
if((.not. computed(l))) then
|
if((.not. computed(l))) then
|
||||||
N_dress_jobs+=1
|
N_dress_jobs+=1
|
||||||
@ -620,7 +621,6 @@ subroutine add_comb(com, computed, cp, N, tbc)
|
|||||||
|
|
||||||
!DIR$ FORCEINLINE
|
!DIR$ FORCEINLINE
|
||||||
call get_comb(com, dets)
|
call get_comb(com, dets)
|
||||||
|
|
||||||
k=N+1
|
k=N+1
|
||||||
do i = 1, comb_teeth
|
do i = 1, comb_teeth
|
||||||
l = dets(i)
|
l = dets(i)
|
||||||
@ -681,10 +681,11 @@ END_PROVIDER
|
|||||||
norm_left = 1d0
|
norm_left = 1d0
|
||||||
|
|
||||||
comb_step = 1d0/dfloat(comb_teeth)
|
comb_step = 1d0/dfloat(comb_teeth)
|
||||||
|
!print *, "comb_step", comb_step
|
||||||
first_det_of_comb = 1
|
first_det_of_comb = 1
|
||||||
do i=1,min(100,N_det_generators)
|
do i=1,N_det_generators ! min(100,N_det_generators)
|
||||||
|
first_det_of_comb = i
|
||||||
if(dress_weight(i)/norm_left < comb_step) then
|
if(dress_weight(i)/norm_left < comb_step) then
|
||||||
first_det_of_comb = i
|
|
||||||
exit
|
exit
|
||||||
end if
|
end if
|
||||||
norm_left -= dress_weight(i)
|
norm_left -= dress_weight(i)
|
||||||
|
@ -100,7 +100,7 @@ BEGIN_PROVIDER [ double precision, delta_ij_tmp, (N_states,N_det_delta_ij,2) ]
|
|||||||
! else
|
! else
|
||||||
! errr = 1d-4
|
! errr = 1d-4
|
||||||
! end if
|
! end if
|
||||||
relative_error = 5.d-5
|
relative_error = 0d0 ! 5.d-5
|
||||||
|
|
||||||
call write_double(6,relative_error,"Convergence of the stochastic algorithm")
|
call write_double(6,relative_error,"Convergence of the stochastic algorithm")
|
||||||
|
|
||||||
|
@ -137,3 +137,22 @@ subroutine sort_selection_buffer(b)
|
|||||||
b%cur = nmwen
|
b%cur = nmwen
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
subroutine truncate_to_mini(b)
|
||||||
|
use selection_types
|
||||||
|
implicit none
|
||||||
|
|
||||||
|
type(selection_buffer), intent(inout) :: b
|
||||||
|
|
||||||
|
do
|
||||||
|
if(b%cur == 0) exit
|
||||||
|
if(b%val(b%cur) <= b%mini) exit
|
||||||
|
b%cur -= 1
|
||||||
|
end do
|
||||||
|
end subroutine
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,22 +52,26 @@ subroutine generator_done(i_gen, int_buf, double_buf, det_buf, N_buf, iproc)
|
|||||||
integer :: i
|
integer :: i
|
||||||
|
|
||||||
call sort_selection_buffer(sb(iproc))
|
call sort_selection_buffer(sb(iproc))
|
||||||
det_buf(:,:,:sb(iproc)%cur) = sb(iproc)%det(:,:,:sb(iproc)%cur)
|
|
||||||
double_buf(:sb(iproc)%cur) = sb(iproc)%val(:sb(iproc)%cur)
|
|
||||||
double_buf(sb(iproc)%cur+1:sb(iproc)%cur+N_states) = slave_sum_alpha2(:,iproc)
|
|
||||||
N_buf(1) = 1
|
|
||||||
N_buf(2) = sb(iproc)%cur+N_states
|
|
||||||
N_buf(3) = sb(iproc)%cur
|
|
||||||
|
|
||||||
if(sb(iproc)%cur > 0) then
|
if(sb(iproc)%cur > 0) then
|
||||||
!$OMP CRITICAL
|
!$OMP CRITICAL
|
||||||
call merge_selection_buffers(sb(iproc), mini_sb)
|
call merge_selection_buffers(sb(iproc), mini_sb)
|
||||||
!call sort_selection_buffer(mini_sb)
|
!call sort_selection_buffer(mini_sb)
|
||||||
do i=1,Nproc
|
do i=1,Nproc
|
||||||
sb(i)%mini = min(sb(i)%mini, mini_sb%mini)
|
mini_sb%mini = min(sb(i)%mini, mini_sb%mini)
|
||||||
|
end do
|
||||||
|
do i=1,Nproc
|
||||||
|
sb(i)%mini = mini_sb%mini
|
||||||
end do
|
end do
|
||||||
!$OMP END CRITICAL
|
!$OMP END CRITICAL
|
||||||
end if
|
end if
|
||||||
|
call truncate_to_mini(sb(iproc))
|
||||||
|
det_buf(:,:,:sb(iproc)%cur) = sb(iproc)%det(:,:,:sb(iproc)%cur)
|
||||||
|
double_buf(:sb(iproc)%cur) = sb(iproc)%val(:sb(iproc)%cur)
|
||||||
|
double_buf(sb(iproc)%cur+1:sb(iproc)%cur+N_states) = slave_sum_alpha2(:,iproc)
|
||||||
|
N_buf(1) = 1
|
||||||
|
N_buf(2) = sb(iproc)%cur+N_states
|
||||||
|
N_buf(3) = sb(iproc)%cur
|
||||||
|
|
||||||
sb(iproc)%cur = 0
|
sb(iproc)%cur = 0
|
||||||
slave_sum_alpha2(:,iproc) = 0d0
|
slave_sum_alpha2(:,iproc) = 0d0
|
||||||
|
Loading…
Reference in New Issue
Block a user