10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 12:23:48 +01:00

Optimized ninja

This commit is contained in:
Anthony Scemama 2016-09-23 10:01:26 +02:00
parent 0112cf20f3
commit 9c50e4de2e
8 changed files with 23 additions and 15 deletions

View File

@ -212,7 +212,7 @@ subroutine dress_H_matrix_from_psi_det_input(psi_det_generators_input,Ndet_gener
integer :: n_state_good integer :: n_state_good
n_state_good = 0 n_state_good = 0
if(s2_eig)then if(s2_eig)then
call u_0_S2_u_0_nstates(s2,eigvectors,Ndet_generators,psi_det_generators_input,N_int,N_det_generators,size(eigvectors,1)) call u_0_S2_u_0(s2,eigvectors,Ndet_generators,psi_det_generators_input,N_int,N_det_generators,size(eigvectors,1))
do i = 1, Ndet_generators do i = 1, Ndet_generators
print*,'s2 = ',s2(i) print*,'s2 = ',s2(i)
print*,dabs(s2(i)-expected_s2) print*,dabs(s2(i)-expected_s2)

View File

@ -63,7 +63,7 @@ subroutine update_energy(energy)
CI_eigenvectors(k,j) = psi_coef(k,j) CI_eigenvectors(k,j) = psi_coef(k,j)
enddo enddo
enddo enddo
call u_0_S2_u_0_nstates(CI_eigenvectors_s2,CI_eigenvectors,N_det,psi_det,N_int) call u_0_S2_u_0(CI_eigenvectors_s2,CI_eigenvectors,N_det,psi_det,N_int)
if (.True.) then if (.True.) then
do k=1,size(ci_electronic_energy) do k=1,size(ci_electronic_energy)
ci_electronic_energy(k) = energy(k) ci_electronic_energy(k) = energy(k)

View File

@ -150,7 +150,7 @@ END_PROVIDER
call davidson_diag_mrcc(psi_det,CI_eigenvectors_dressed,CI_electronic_energy_dressed,& call davidson_diag_mrcc(psi_det,CI_eigenvectors_dressed,CI_electronic_energy_dressed,&
size(CI_eigenvectors_dressed,1),N_det,N_states_diag,N_int,output_determinants,mrcc_state) size(CI_eigenvectors_dressed,1),N_det,N_states_diag,N_int,output_determinants,mrcc_state)
call u_0_S2_u_0_nstates(CI_eigenvectors_s2_dressed,CI_eigenvectors_dressed,N_det,psi_det,N_int,& call u_0_S2_u_0(CI_eigenvectors_s2_dressed,CI_eigenvectors_dressed,N_det,psi_det,N_int,&
N_states_diag,size(CI_eigenvectors_dressed,1)) N_states_diag,size(CI_eigenvectors_dressed,1))
@ -166,7 +166,7 @@ END_PROVIDER
allocate (s2_eigvalues(N_det)) allocate (s2_eigvalues(N_det))
allocate(index_good_state_array(N_det),good_state_array(N_det)) allocate(index_good_state_array(N_det),good_state_array(N_det))
good_state_array = .False. good_state_array = .False.
call u_0_S2_u_0_nstates(s2_eigvalues,eigenvectors,N_det,psi_det,N_int,& call u_0_S2_u_0(s2_eigvalues,eigenvectors,N_det,psi_det,N_int,&
N_det,size(eigenvectors,1)) N_det,size(eigenvectors,1))
do j=1,N_det do j=1,N_det
! Select at least n_states states with S^2 values closed to "expected_s2" ! Select at least n_states states with S^2 values closed to "expected_s2"
@ -223,7 +223,7 @@ END_PROVIDER
deallocate(index_good_state_array,good_state_array) deallocate(index_good_state_array,good_state_array)
deallocate(s2_eigvalues) deallocate(s2_eigvalues)
else else
call u_0_S2_u_0_nstates(CI_eigenvectors_s2_dressed,eigenvectors,N_det,psi_det,N_int,& call u_0_S2_u_0(CI_eigenvectors_s2_dressed,eigenvectors,N_det,psi_det,N_int,&
min(N_det,N_states_diag),size(eigenvectors,1)) min(N_det,N_states_diag),size(eigenvectors,1))
! Select the "N_states_diag" states of lowest energy ! Select the "N_states_diag" states of lowest energy
do j=1,min(N_det,N_states_diag) do j=1,min(N_det,N_states_diag)

View File

@ -788,9 +788,17 @@ def create_build_ninja_global():
" command = module_handler.py clean --all", " command = module_handler.py clean --all",
" description = Cleaning all modules", ""] " description = Cleaning all modules", ""]
l_string += ["rule make_ocaml",
" command = make -C {0}/ocaml".format(QP_ROOT),
" pool = console",
" description = Compiling OCaml tools",
""]
l_string += ["build dummy_target: update_build_ninja_root", l_string += ["build dummy_target: update_build_ninja_root",
"build ocaml_target: make_ocaml",
"", "",
"build all: make_all dummy_target", "build all: make_all dummy_target ocaml_target",
"default all", "default all",
"", "",
"build clean: make_clean dummy_target", "build clean: make_clean dummy_target",

View File

@ -11,7 +11,7 @@ fi
cd ${QP_ROOT}/data cd ${QP_ROOT}/data
rm -f executables rm -f executables
EXES=$(find -L ${QP_ROOT}/src -executable -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort ) EXES=$(find -L ${QP_ROOT}/src -maxdepth 2 -depth -executable -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort )
for EXE in $EXES for EXE in $EXES
do do

View File

@ -56,7 +56,7 @@ END_PROVIDER
call davidson_diag(psi_det,CI_eigenvectors,CI_electronic_energy,& call davidson_diag(psi_det,CI_eigenvectors,CI_electronic_energy,&
size(CI_eigenvectors,1),N_det,N_states_diag,N_int,output_determinants) size(CI_eigenvectors,1),N_det,N_states_diag,N_int,output_determinants)
call u_0_S2_u_0_nstates(CI_eigenvectors_s2,CI_eigenvectors,N_det,psi_det,N_int,& call u_0_S2_u_0(CI_eigenvectors_s2,CI_eigenvectors,N_det,psi_det,N_int,&
N_states_diag,size(CI_eigenvectors,1)) N_states_diag,size(CI_eigenvectors,1))
@ -72,7 +72,7 @@ END_PROVIDER
allocate (s2_eigvalues(N_det)) allocate (s2_eigvalues(N_det))
allocate(index_good_state_array(N_det),good_state_array(N_det)) allocate(index_good_state_array(N_det),good_state_array(N_det))
good_state_array = .False. good_state_array = .False.
call u_0_S2_u_0_nstates(s2_eigvalues,eigenvectors,N_det,psi_det,N_int,& call u_0_S2_u_0(s2_eigvalues,eigenvectors,N_det,psi_det,N_int,&
N_det,size(eigenvectors,1)) N_det,size(eigenvectors,1))
do j=1,N_det do j=1,N_det
! Select at least n_states states with S^2 values closed to "expected_s2" ! Select at least n_states states with S^2 values closed to "expected_s2"
@ -129,7 +129,7 @@ END_PROVIDER
deallocate(index_good_state_array,good_state_array) deallocate(index_good_state_array,good_state_array)
deallocate(s2_eigvalues) deallocate(s2_eigvalues)
else else
call u_0_S2_u_0_nstates(CI_eigenvectors_s2,eigenvectors,N_det,psi_det,N_int,& call u_0_S2_u_0(CI_eigenvectors_s2,eigenvectors,N_det,psi_det,N_int,&
min(N_det,N_states_diag),size(eigenvectors,1)) min(N_det,N_states_diag),size(eigenvectors,1))
! Select the "N_states_diag" states of lowest energy ! Select the "N_states_diag" states of lowest energy
do j=1,min(N_det,N_states_diag) do j=1,min(N_det,N_states_diag)
@ -153,7 +153,7 @@ END_PROVIDER
psi_coef(i,j) = CI_eigenvectors(i,j) psi_coef(i,j) = CI_eigenvectors(i,j)
enddo enddo
enddo enddo
call u_0_H_u_0_nstates(e_array,psi_coef,n_det,psi_det,N_int,N_states_diag,psi_det_size) call u_0_H_u_0(e_array,psi_coef,n_det,psi_det,N_int,N_states_diag,psi_det_size)
! Browsing the "n_states_diag" states and getting the lowest in energy "n_states" ones that have the S^2 value ! Browsing the "n_states_diag" states and getting the lowest in energy "n_states" ones that have the S^2 value
! closer to the "expected_s2" set as input ! closer to the "expected_s2" set as input

View File

@ -1,4 +1,4 @@
subroutine u_0_H_u_0_nstates(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8) subroutine u_0_H_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8)
use bitmasks use bitmasks
implicit none implicit none
BEGIN_DOC BEGIN_DOC
@ -158,6 +158,6 @@ BEGIN_PROVIDER [ double precision, psi_energy, (N_states) ]
BEGIN_DOC BEGIN_DOC
! Energy of the current wave function ! Energy of the current wave function
END_DOC END_DOC
call u_0_H_u_0_nstates(psi_energy,psi_coef,N_det,psi_det,N_int,N_states,psi_det_size) call u_0_H_u_0(psi_energy,psi_coef,N_det,psi_det,N_int,N_states,psi_det_size)
END_PROVIDER END_PROVIDER

View File

@ -69,13 +69,13 @@ BEGIN_PROVIDER [ double precision, s2_values, (N_states) ]
! array of the averaged values of the S^2 operator on the various states ! array of the averaged values of the S^2 operator on the various states
END_DOC END_DOC
integer :: i integer :: i
call u_0_S2_u_0_nstates(s2_values,psi_coef,n_det,psi_det,N_int,N_states,psi_det_size) call u_0_S2_u_0(s2_values,psi_coef,n_det,psi_det,N_int,N_states,psi_det_size)
END_PROVIDER END_PROVIDER
subroutine u_0_S2_u_0_nstates(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8) subroutine u_0_S2_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8)
use bitmasks use bitmasks
implicit none implicit none
BEGIN_DOC BEGIN_DOC