mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
Compiles
This commit is contained in:
parent
a1c9ec2503
commit
6455b281ff
@ -333,7 +333,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in)
|
|||||||
pt2(k) = 0.d0
|
pt2(k) = 0.d0
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call update_pt2_and_variance_weights(pt2, variance, norm)
|
call update_pt2_and_variance_weights(pt2, variance, norm, N_states)
|
||||||
|
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ BEGIN_PROVIDER [ double precision, pt2_match_weight, (N_states) ]
|
|||||||
! Weights adjusted along the selection to make the PT2 contributions
|
! Weights adjusted along the selection to make the PT2 contributions
|
||||||
! of each state coincide.
|
! of each state coincide.
|
||||||
END_DOC
|
END_DOC
|
||||||
pt2_match_weight = 1.d0
|
pt2_match_weight(:) = 1.d0
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, variance_match_weight, (N_states) ]
|
BEGIN_PROVIDER [ double precision, variance_match_weight, (N_states) ]
|
||||||
@ -15,10 +15,10 @@ BEGIN_PROVIDER [ double precision, variance_match_weight, (N_states) ]
|
|||||||
! Weights adjusted along the selection to make the variances
|
! Weights adjusted along the selection to make the variances
|
||||||
! of each state coincide.
|
! of each state coincide.
|
||||||
END_DOC
|
END_DOC
|
||||||
variance_match_weight = 1.d0
|
variance_match_weight(:) = 1.d0
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
subroutine update_pt2_and_variance_weights(pt2, variance, norm, N_states)
|
subroutine update_pt2_and_variance_weights(pt2, variance, norm, N_st)
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Updates the rPT2- and Variance- matching weights.
|
! Updates the rPT2- and Variance- matching weights.
|
||||||
@ -36,12 +36,12 @@ subroutine update_pt2_and_variance_weights(pt2, variance, norm, N_states)
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
avg = sum(rpt2(1:N_st)) / dble(N_st)
|
avg = sum(rpt2(1:N_st)) / dble(N_st)
|
||||||
do k=1,N_states
|
do k=1,N_st
|
||||||
pt2_match_weight(k) *= (rpt2(k)/avg)**2
|
pt2_match_weight(k) *= (rpt2(k)/avg)**2
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
avg = sum(variance(1:N_st)) / dble(N_st)
|
avg = sum(variance(1:N_st)) / dble(N_st)
|
||||||
do k=1,N_states
|
do k=1,N_st
|
||||||
variance_match_weight(k) *= (variance(k)/avg)**2
|
variance_match_weight(k) *= (variance(k)/avg)**2
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -54,10 +54,10 @@ BEGIN_PROVIDER [ double precision, selection_weight, (N_states) ]
|
|||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Weights used in the selection criterion
|
! Weights used in the selection criterion
|
||||||
END_DOC
|
END_DOC
|
||||||
select (weight_selection)
|
select case (weight_selection)
|
||||||
|
|
||||||
case (0)
|
case (0)
|
||||||
selection_weight(1:N_states) = weight_one_e_dm(1:N_states)
|
selection_weight(1:N_states) = state_average_weight(1:N_states)
|
||||||
|
|
||||||
case (1)
|
case (1)
|
||||||
selection_weight(1:N_states) = c0_weight(1:N_states)
|
selection_weight(1:N_states) = c0_weight(1:N_states)
|
||||||
@ -682,11 +682,13 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
|
|||||||
variance(istate) = variance(istate) + alpha_h_psi * alpha_h_psi
|
variance(istate) = variance(istate) + alpha_h_psi * alpha_h_psi
|
||||||
norm(istate) = norm(istate) + coef * coef
|
norm(istate) = norm(istate) + coef * coef
|
||||||
|
|
||||||
! if (h0_type == "Variance") then
|
if (weight_selection /= 5) then
|
||||||
! sum_e_pert = sum_e_pert - alpha_h_psi * alpha_h_psi * selection_weight(istate)
|
! Energy selection
|
||||||
! else
|
|
||||||
sum_e_pert = sum_e_pert + e_pert * selection_weight(istate)
|
sum_e_pert = sum_e_pert + e_pert * selection_weight(istate)
|
||||||
! endif
|
else
|
||||||
|
! Variance selection
|
||||||
|
sum_e_pert = sum_e_pert - alpha_h_psi * alpha_h_psi * selection_weight(istate)
|
||||||
|
endif
|
||||||
end do
|
end do
|
||||||
if(pseudo_sym)then
|
if(pseudo_sym)then
|
||||||
if(dabs(mat(1, p1, p2)).lt.thresh_sym)then
|
if(dabs(mat(1, p1, p2)).lt.thresh_sym)then
|
||||||
|
@ -85,7 +85,11 @@ subroutine ZMQ_selection(N_in, pt2, variance, norm)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
integer :: nproc_target
|
integer :: nproc_target
|
||||||
|
if (N_det < 3*nproc) then
|
||||||
|
nproc_target = N_det/3
|
||||||
|
else
|
||||||
nproc_target = nproc
|
nproc_target = nproc
|
||||||
|
endif
|
||||||
double precision :: mem
|
double precision :: mem
|
||||||
mem = 8.d0 * N_det * (N_int * 2.d0 * 3.d0 + 3.d0 + 5.d0) / (1024.d0**3)
|
mem = 8.d0 * N_det * (N_int * 2.d0 * 3.d0 + 3.d0 + 5.d0) / (1024.d0**3)
|
||||||
call write_double(6,mem,'Estimated memory/thread (Gb)')
|
call write_double(6,mem,'Estimated memory/thread (Gb)')
|
||||||
@ -131,13 +135,7 @@ subroutine ZMQ_selection(N_in, pt2, variance, norm)
|
|||||||
norm(k) = norm(k) * f(k)
|
norm(k) = norm(k) * f(k)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
! Adjust PT2 weights for next selection
|
call update_pt2_and_variance_weights(pt2, variance, norm, N_states)
|
||||||
double precision :: pt2_avg
|
|
||||||
pt2_avg = sum(pt2) / dble(N_states)
|
|
||||||
do k=1,N_states
|
|
||||||
pt2_match_weight(k) *= (pt2(k)/pt2_avg)**2
|
|
||||||
enddo
|
|
||||||
SOFT_TOUCH pt2_match_weight
|
|
||||||
|
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user