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

Merge branch 'dev' into csf

This commit is contained in:
Anthony Scemama 2021-02-17 23:39:22 +01:00
commit 0704eb3091
6 changed files with 24 additions and 35 deletions

8
configure vendored
View File

@ -319,8 +319,8 @@ EOF
rm ${QP_ROOT}/external/opam_installer.sh rm ${QP_ROOT}/external/opam_installer.sh
# source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true # source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
# #
# opam switch create ocaml-base-compiler.4.10.0 # opam switch create ocaml-base-compiler.4.11.1
opam init --verbose --yes --compiler=4.10.0 --disable-sandboxing opam init --verbose --yes --compiler=4.11.1 --disable-sandboxing
eval $(opam env) eval $(opam env)
opam install -y ${OCAML_PACKAGES} || exit 1 opam install -y ${OCAML_PACKAGES} || exit 1
@ -339,9 +339,9 @@ EOF
EOF EOF
rm ${QP_ROOT}/external/opam_installer.sh rm ${QP_ROOT}/external/opam_installer.sh
# source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true # source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
# opam switch create ocaml-base-compiler.4.10.0 || exit 1 # opam switch create ocaml-base-compiler.4.11.1 || exit 1
opam init --verbose --yes --compiler=4.10.0 --disable-sandboxing opam init --verbose --yes --compiler=4.11.1 --disable-sandboxing
eval $(opam env) eval $(opam env)
execute << EOF execute << EOF
opam install -y \${OCAML_PACKAGES} || exit 1 opam install -y \${OCAML_PACKAGES} || exit 1

View File

@ -352,9 +352,9 @@ subroutine ZMQ_pt2(E, pt2_data, pt2_data_err, relative_error, N_in)
state_average_weight(:) = state_average_weight_save(:) state_average_weight(:) = state_average_weight_save(:)
TOUCH state_average_weight TOUCH state_average_weight
call update_pt2_and_variance_weights(pt2_data, N_states)
endif endif
call update_pt2_and_variance_weights(pt2_data, N_states)
end subroutine end subroutine

View File

@ -33,43 +33,27 @@ subroutine update_pt2_and_variance_weights(pt2_data, N_st)
double precision :: avg, element, dt, x double precision :: avg, element, dt, x
integer :: k integer :: k
integer, save :: i_iter=0
integer, parameter :: i_itermax = 1
double precision, allocatable, save :: memo_variance(:,:), memo_pt2(:,:)
pt2(:) = pt2_data % pt2(:) pt2(:) = pt2_data % pt2(:)
variance(:) = pt2_data % variance(:) variance(:) = pt2_data % variance(:)
if (i_iter == 0) then avg = sum(pt2(1:N_st)) / dble(N_st) + 1.d-32 ! Avoid future division by zero
allocate(memo_variance(N_st,i_itermax), memo_pt2(N_st,i_itermax))
memo_pt2(:,:) = 1.d0
memo_variance(:,:) = 1.d0
endif
i_iter = i_iter+1 dt = 2.d0 !* selection_factor
if (i_iter > i_itermax) then
i_iter = 1
endif
dt = 2.0d0
avg = sum(pt2(1:N_st)) / dble(N_st) - 1.d-32 ! Avoid future division by zero
do k=1,N_st do k=1,N_st
element = exp(dt*(pt2(k)/avg -1.d0)) element = exp(dt*(pt2(k)/avg - 1.d0))
element = min(2.0d0 , element) element = min(2.0d0 , element)
element = max(0.5d0 , element) element = max(0.5d0 , element)
memo_pt2(k,i_iter) = element pt2_match_weight(k) *= element
pt2_match_weight(k) *= product(memo_pt2(k,:))
enddo enddo
avg = sum(variance(1:N_st)) / dble(N_st) + 1.d-32 ! Avoid future division by zero avg = sum(variance(1:N_st)) / dble(N_st) + 1.d-32 ! Avoid future division by zero
do k=1,N_st do k=1,N_st
element = exp(dt*(variance(k)/avg -1.d0)) element = exp(dt*(variance(k)/avg -1.d0))
element = min(2.0d0 , element) element = min(2.0d0 , element)
element = max(0.5d0 , element) element = max(0.5d0 , element)
memo_variance(k,i_iter) = element variance_match_weight(k) *= element
variance_match_weight(k) *= product(memo_variance(k,:))
enddo enddo
if (N_det < 100) then if (N_det < 100) then

View File

@ -4,7 +4,7 @@ subroutine run_slave_cipsi
! Helper program for distributed parallelism ! Helper program for distributed parallelism
END_DOC END_DOC
call omp_set_nested(.false.) call omp_set_max_active_levels(1)
distributed_davidson = .False. distributed_davidson = .False.
read_wf = .False. read_wf = .False.
SOFT_TOUCH read_wf distributed_davidson SOFT_TOUCH read_wf distributed_davidson
@ -171,9 +171,9 @@ subroutine run_slave_main
call write_double(6,(t1-t0),'Broadcast time') call write_double(6,(t1-t0),'Broadcast time')
!--- !---
call omp_set_nested(.True.) call omp_set_max_active_levels(8)
call davidson_slave_tcp(0) call davidson_slave_tcp(0)
call omp_set_nested(.False.) call omp_set_max_active_levels(1)
print *, mpi_rank, ': Davidson done' print *, mpi_rank, ': Davidson done'
!--- !---

View File

@ -699,9 +699,14 @@ BEGIN_PROVIDER [ integer, dominant_cfg, (N_states) ]
! Configuration of the determinants with the largest weight, for each state ! Configuration of the determinants with the largest weight, for each state
END_DOC END_DOC
integer :: k integer :: k
do k=1,N_states dominant_cfg(1) = det_to_configuration(dominant_det(1))
dominant_cfg(k) = det_to_configuration(dominant_det(k)) if (N_det < N_states) then
enddo dominant_cfg(:) = dominant_cfg(1)
else
do k=1,N_states
dominant_cfg(k) = det_to_configuration(dominant_det(k))
enddo
endif
END_PROVIDER END_PROVIDER