diff --git a/.travis.yml b/.travis.yml index 0e78a8c6..56c55504 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ python: script: - ./configure --production ./config/gfortran.cfg - source ./quantum_package.rc - - qp_install_module.py install Full_CI Hartree_Fock + - qp_install_module.py install Full_CI Hartree_Fock CAS_SD MRCC_CASSD - ninja - cd ocaml ; make ; cd - - cd testing_no_regression ; ./unit_test.py diff --git a/plugins/CAS_SD/README.rst b/plugins/CAS_SD/README.rst index 258410a1..c6707c3e 100644 --- a/plugins/CAS_SD/README.rst +++ b/plugins/CAS_SD/README.rst @@ -118,69 +118,101 @@ Documentation Undocumented -`h_apply_cas_sd `_ +`h_apply_cas_sd `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_cas_sd_diexc `_ +`h_apply_cas_sd_diexc `_ + Undocumented + + +`h_apply_cas_sd_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cas_sd_monoexc `_ +`h_apply_cas_sd_diexcp `_ + Undocumented + + +`h_apply_cas_sd_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cas_sd_pt2 `_ +`h_apply_cas_sd_pt2 `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_cas_sd_pt2_diexc `_ +`h_apply_cas_sd_pt2_diexc `_ + Undocumented + + +`h_apply_cas_sd_pt2_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cas_sd_pt2_monoexc `_ +`h_apply_cas_sd_pt2_diexcp `_ + Undocumented + + +`h_apply_cas_sd_pt2_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cas_sd_selected `_ +`h_apply_cas_sd_selected `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_cas_sd_selected_diexc `_ +`h_apply_cas_sd_selected_diexc `_ + Undocumented + + +`h_apply_cas_sd_selected_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cas_sd_selected_monoexc `_ +`h_apply_cas_sd_selected_diexcp `_ + Undocumented + + +`h_apply_cas_sd_selected_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cas_sd_selected_no_skip `_ +`h_apply_cas_sd_selected_no_skip `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_cas_sd_selected_no_skip_diexc `_ +`h_apply_cas_sd_selected_no_skip_diexc `_ + Undocumented + + +`h_apply_cas_sd_selected_no_skip_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cas_sd_selected_no_skip_monoexc `_ +`h_apply_cas_sd_selected_no_skip_diexcp `_ + Undocumented + + +`h_apply_cas_sd_selected_no_skip_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. diff --git a/plugins/Full_CI/README.rst b/plugins/Full_CI/README.rst index bc2307cd..949f97c5 100644 --- a/plugins/Full_CI/README.rst +++ b/plugins/Full_CI/README.rst @@ -27,137 +27,201 @@ Documentation Undocumented -`h_apply_fci `_ +`h_apply_fci `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_fci_diexc `_ +`h_apply_fci_diexc `_ + Undocumented + + +`h_apply_fci_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_fci_mono `_ +`h_apply_fci_diexcp `_ + Undocumented + + +`h_apply_fci_mono `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_fci_mono_diexc `_ +`h_apply_fci_mono_diexc `_ + Undocumented + + +`h_apply_fci_mono_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_fci_mono_monoexc `_ +`h_apply_fci_mono_diexcp `_ + Undocumented + + +`h_apply_fci_mono_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_fci_monoexc `_ +`h_apply_fci_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_fci_no_skip `_ +`h_apply_fci_no_skip `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_fci_no_skip_diexc `_ +`h_apply_fci_no_skip_diexc `_ + Undocumented + + +`h_apply_fci_no_skip_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_fci_no_skip_monoexc `_ +`h_apply_fci_no_skip_diexcp `_ + Undocumented + + +`h_apply_fci_no_skip_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_fci_pt2 `_ +`h_apply_fci_pt2 `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_fci_pt2_diexc `_ +`h_apply_fci_pt2_diexc `_ + Undocumented + + +`h_apply_fci_pt2_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_fci_pt2_monoexc `_ +`h_apply_fci_pt2_diexcp `_ + Undocumented + + +`h_apply_fci_pt2_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_pt2_mono_delta_rho `_ +`h_apply_pt2_mono_delta_rho `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_pt2_mono_delta_rho_diexc `_ +`h_apply_pt2_mono_delta_rho_diexc `_ + Undocumented + + +`h_apply_pt2_mono_delta_rho_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_pt2_mono_delta_rho_monoexc `_ +`h_apply_pt2_mono_delta_rho_diexcp `_ + Undocumented + + +`h_apply_pt2_mono_delta_rho_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_pt2_mono_di_delta_rho `_ +`h_apply_pt2_mono_di_delta_rho `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_pt2_mono_di_delta_rho_diexc `_ +`h_apply_pt2_mono_di_delta_rho_diexc `_ + Undocumented + + +`h_apply_pt2_mono_di_delta_rho_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_pt2_mono_di_delta_rho_monoexc `_ +`h_apply_pt2_mono_di_delta_rho_diexcp `_ + Undocumented + + +`h_apply_pt2_mono_di_delta_rho_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_select_mono_delta_rho `_ +`h_apply_select_mono_delta_rho `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_select_mono_delta_rho_diexc `_ +`h_apply_select_mono_delta_rho_diexc `_ + Undocumented + + +`h_apply_select_mono_delta_rho_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_select_mono_delta_rho_monoexc `_ +`h_apply_select_mono_delta_rho_diexcp `_ + Undocumented + + +`h_apply_select_mono_delta_rho_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_select_mono_di_delta_rho `_ +`h_apply_select_mono_di_delta_rho `_ Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -`h_apply_select_mono_di_delta_rho_diexc `_ +`h_apply_select_mono_di_delta_rho_diexc `_ + Undocumented + + +`h_apply_select_mono_di_delta_rho_diexcorg `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_select_mono_di_delta_rho_monoexc `_ +`h_apply_select_mono_di_delta_rho_diexcp `_ + Undocumented + + +`h_apply_select_mono_di_delta_rho_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. diff --git a/plugins/MRCC_Utils/README.rst b/plugins/MRCC_Utils/README.rst index 56b519f2..7e7088a2 100644 --- a/plugins/MRCC_Utils/README.rst +++ b/plugins/MRCC_Utils/README.rst @@ -374,7 +374,7 @@ Documentation Find A.C = B -`find_triples_and_quadruples `_ +`find_triples_and_quadruples `_ Undocumented @@ -400,6 +400,22 @@ Documentation Undocumented +`gen_det_idx `_ + Undocumented + + +`gen_det_shortcut `_ + Undocumented + + +`gen_det_sorted `_ + Undocumented + + +`gen_det_version `_ + Undocumented + + `get_pseudo_inverse `_ Find C = A^-1 @@ -781,10 +797,6 @@ Documentation Undocumented -`mrcc_dress_simple `_ - Undocumented - - `mrcc_iterations `_ Undocumented diff --git a/plugins/MRCC_Utils/mrcc_dress.irp.f b/plugins/MRCC_Utils/mrcc_dress.irp.f index f427c81f..ef87d52a 100644 --- a/plugins/MRCC_Utils/mrcc_dress.irp.f +++ b/plugins/MRCC_Utils/mrcc_dress.irp.f @@ -95,7 +95,20 @@ subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_ref, Ndet_non_ref,i_generator,n integer :: idx_miniList(N_det_non_ref), N_miniList - call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq) + +! N_miniList = 0 +! do i=i_generator-1,1,-1 +! k = popcnt(key_mask(1,1)) + popcnt(key_mask(1,2)) - popcnt(iand(key_mask(1,1), psi_det_generators(1,1,i))) - popcnt(iand(key_mask(1,2), psi_det_generators(1,2,i))) +! if(k == 0) then +! return +! end if +! if(k <= 2) then +! N_minilist += 1 +! miniList(:,:,N_minilist) = psi_det_generators(:,:,i) +! end if +! end do + + call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq,miniList,N_minilist) allocate (dIa_hla(N_states,Ndet_non_ref)) @@ -222,53 +235,67 @@ end -subroutine mrcc_dress_simple(delta_ij_non_ref_,Ndet_non_ref,i_generator,n_selected,det_buffer,Nint,iproc) - use bitmasks - implicit none - - integer, intent(in) :: i_generator,n_selected, Nint, iproc - integer, intent(in) :: Ndet_non_ref - double precision, intent(inout) :: delta_ij_non_ref_(Ndet_non_ref,Ndet_non_ref,*) - - integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected) - integer :: i,j,k,m - integer :: new_size - integer :: degree(psi_det_size) - integer :: idx(0:psi_det_size) - logical :: good - - integer(bit_kind) :: tq(Nint,2,n_selected) - integer :: N_tq, c_ref - integer :: connected_to_ref - - call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq) - - ! Compute / (E0 - Haa) - double precision :: hka, haa - double precision :: haj - double precision :: f(N_states) - - do i=1,N_tq - call get_excitation_degree_vector(psi_non_ref,tq(1,1,i),degree,Nint,Ndet_non_ref,idx) - call i_h_j(tq(1,1,i),tq(1,1,i),Nint,haa) - do m=1,N_states - f(m) = 1.d0/(ci_electronic_energy(m)-haa) - enddo - do k=1,idx(0) - call i_h_j(tq(1,1,i),psi_non_ref(1,1,idx(k)),Nint,hka) - do j=k,idx(0) - call i_h_j(tq(1,1,i),psi_non_ref(1,1,idx(j)),Nint,haj) - do m=1,N_states - delta_ij_non_ref_(idx(k), idx(j),m) += haj*hka* f(m) - delta_ij_non_ref_(idx(j), idx(k),m) += haj*hka* f(m) - enddo - enddo - enddo - enddo -end +! subroutine mrcc_dress_simple(delta_ij_non_ref_,Ndet_non_ref,i_generator,n_selected,det_buffer,Nint,iproc) +! use bitmasks +! implicit none +! +! integer, intent(in) :: i_generator,n_selected, Nint, iproc +! integer, intent(in) :: Ndet_non_ref +! double precision, intent(inout) :: delta_ij_non_ref_(Ndet_non_ref,Ndet_non_ref,*) +! +! integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected) +! integer :: i,j,k,m +! integer :: new_size +! integer :: degree(psi_det_size) +! integer :: idx(0:psi_det_size) +! logical :: good +! +! integer(bit_kind) :: tq(Nint,2,n_selected) +! integer :: N_tq, c_ref +! integer :: connected_to_ref +! +! +! call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq) +! +! ! Compute / (E0 - Haa) +! double precision :: hka, haa +! double precision :: haj +! double precision :: f(N_states) +! +! do i=1,N_tq +! call get_excitation_degree_vector(psi_non_ref,tq(1,1,i),degree,Nint,Ndet_non_ref,idx) +! call i_h_j(tq(1,1,i),tq(1,1,i),Nint,haa) +! do m=1,N_states +! f(m) = 1.d0/(ci_electronic_energy(m)-haa) +! enddo +! do k=1,idx(0) +! call i_h_j(tq(1,1,i),psi_non_ref(1,1,idx(k)),Nint,hka) +! do j=k,idx(0) +! call i_h_j(tq(1,1,i),psi_non_ref(1,1,idx(j)),Nint,haj) +! do m=1,N_states +! delta_ij_non_ref_(idx(k), idx(j),m) += haj*hka* f(m) +! delta_ij_non_ref_(idx(j), idx(k),m) += haj*hka* f(m) +! enddo +! enddo +! enddo +! enddo +! end -subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq) + BEGIN_PROVIDER [ integer(bit_kind), gen_det_sorted, (N_int,2,N_det_generators,2) ] +&BEGIN_PROVIDER [ integer, gen_det_shortcut, (0:N_det_generators,2) ] +&BEGIN_PROVIDER [ integer, gen_det_version, (N_int, N_det_generators,2) ] +&BEGIN_PROVIDER [ integer, gen_det_idx, (N_det_generators,2) ] + + gen_det_sorted(:,:,:,1) = psi_det_generators(:,:,:N_det_generators) + gen_det_sorted(:,:,:,2) = psi_det_generators(:,:,:N_det_generators) + call sort_dets_ab_v(gen_det_sorted(:,:,:,1), gen_det_idx(:,1), gen_det_shortcut(0:,1), gen_det_version(:,:,1), N_det_generators, N_int) + call sort_dets_ba_v(gen_det_sorted(:,:,:,2), gen_det_idx(:,2), gen_det_shortcut(0:,2), gen_det_version(:,:,2), N_det_generators, N_int) + print *, " *********************** ", gen_det_shortcut(0,:) +END_PROVIDER + + +subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq,miniList,N_miniList) use bitmasks implicit none @@ -286,12 +313,158 @@ subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq integer :: c_ref integer :: connected_to_ref - + + integer :: na, nb, nt,mex, lex, sh,ni + + + integer(bit_kind),intent(in) :: miniList(Nint,2,N_det_generators) + integer,intent(in) :: N_miniList + + + + N_tq = 0 do i=1,N_selected +! c_ref = 0 +! do j=1,N_miniList +! na = popcnt(xor(miniList(1,1,j), det_buffer(1,1,i))) +! nb = popcnt(xor(miniList(1,2,j), det_buffer(1,2,i))) +! if(na+nb <= 4) then +! c_ref = 1 +! exit +! end if +! end do + + +! +! if(Nint /= 1) then +! c_ref = 0 +! na = 0 +! nb = 0 +! do ni=1,Nint +! na += popcnt(xor(det_buffer(ni,1,i), psi_ref(ni,1,1))) +! nb += popcnt(xor(det_buffer(ni,2,i), psi_ref(ni,2,1))) +! end do +! if(na > nb) then +! mex = 1 +! lex = 2 +! else +! mex = 2 +! lex = 1 +! end if +! +! +! sh_loop : do sh=1,gen_det_shortcut(0,lex) +! do ni=1,Nint +! if(det_buffer(ni,lex,i) /= gen_det_sorted(ni,lex,gen_det_shortcut(sh, lex),lex)) then +! cycle sh_loop +! end if +! end do +! do j=gen_det_shortcut(sh,lex),gen_det_shortcut(sh+1,lex)-1 +! if(gen_det_idx(j,lex) >= i_generator) then +! cycle +! end if +! nt = 0 +! do ni=1,nint +! nt += popcnt(xor(det_buffer(ni,mex,i), gen_det_sorted(ni,mex,j,lex))) +! end do +! if(nt <= 4) then +! ! if(gen_det_idx(j,lex) < i_generator) then +! c_ref = 1!gen_det_idx(j,lex) +! exit sh_loop +! ! end if +! end if +! end do +! exit sh_loop +! end do sh_loop +! +! if(c_ref == 0) then +! sh_loop2 : do sh = 1,gen_det_shortcut(0,mex) +! na = 0 +! do ni=1,Nint +! na += popcnt(xor(det_buffer(ni,mex,i), gen_det_sorted(ni,mex,gen_det_shortcut(sh, mex),mex))) +! end do +! if(na > 2) then +! cycle +! end if + +! do j=gen_det_shortcut(sh, mex), gen_det_shortcut(sh+1,mex)-1 +! if(gen_det_idx(j,mex) >= i_generator) then +! cycle +! end if +! nt = na +! do ni=1,Nint +! nt += popcnt(xor(det_buffer(ni,lex,i), gen_det_sorted(ni,lex,j,mex))) +! end do +! if(nt <= 4) then +! ! if(gen_det_idx(j,mex) < i_generator) then +! c_ref = 2!gen_det_idx(j,mex) +! exit sh_loop2 +! ! end if +! end if +! end do +! end do sh_loop2 +! end if +! else +! c_ref = 0 +! na = popcnt(xor(det_buffer(1,1,i), psi_ref(1,1,1))) +! nb = popcnt(xor(det_buffer(1,2,i), psi_ref(1,2,1))) +! if(na > nb) then +! mex = 1 +! lex = 2 +! else +! mex = 2 +! lex = 1 +! end if +! +! +! sh_loop3 : do sh=1,gen_det_shortcut(0,lex) +! if(det_buffer(1,lex,i) /= gen_det_version(1,sh,lex)) then!gen_det_sorted(1,lex,gen_det_shortcut(sh, lex),lex)) then +! cycle sh_loop3 +! end if +! do j=gen_det_shortcut(sh,lex),gen_det_shortcut(sh+1,lex)-1 +! if(gen_det_idx(j,lex) >= i_generator) then +! cycle +! end if +! nt = popcnt(xor(det_buffer(1,mex,i), gen_det_sorted(1,mex,j,lex))) +! if(nt <= 4) then +! ! if(gen_det_idx(j,lex) < i_generator) then +! c_ref = 1!gen_det_idx(j,lex) +! exit sh_loop3 +! ! end if +! end if +! end do +! exit sh_loop3 +! end do sh_loop3 +! +! if(c_ref == 0) then +! sh_loop4 : do sh = 1,gen_det_shortcut(0,mex) +! na = popcnt(xor(det_buffer(1,mex,i),gen_det_version(1,sh,mex)))! gen_det_sorted(1,mex,gen_det_shortcut(sh, mex),mex))) +! if(na > 2) then +! cycle sh_loop4 +! end if +! do j=gen_det_shortcut(sh, mex), gen_det_shortcut(sh+1,mex)-1 +! if(gen_det_idx(j,mex) >= i_generator) then +! cycle +! end if +! nt = na +! nt += popcnt(xor(det_buffer(1,lex,i), gen_det_sorted(1,lex,j,mex))) +! if(nt <= 4) then +! ! if(gen_det_idx(j,mex) < i_generator) then +! c_ref = 2!gen_det_idx(j,mex) +! exit sh_loop4 +! ! end if +! end if +! end do +! end do sh_loop4 +! end if +! end if + + c_ref = connected_to_ref(det_buffer(1,1,i),psi_det_generators,Nint, & i_generator,N_det_generators) + if (c_ref /= 0) then cycle endif diff --git a/plugins/Perturbation/README.rst b/plugins/Perturbation/README.rst index aa6ebf54..0307ec12 100644 --- a/plugins/Perturbation/README.rst +++ b/plugins/Perturbation/README.rst @@ -107,22 +107,22 @@ Documentation Undocumented -`perturb_buffer_by_mono_delta_rho_one_point `_ +`perturb_buffer_by_mono_delta_rho_one_point `_ Applly pertubration ``delta_rho_one_point`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_dipole_moment_z `_ +`perturb_buffer_by_mono_dipole_moment_z `_ Applly pertubration ``dipole_moment_z`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_epstein_nesbet `_ +`perturb_buffer_by_mono_epstein_nesbet `_ Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_epstein_nesbet_2x2 `_ +`perturb_buffer_by_mono_epstein_nesbet_2x2 `_ Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. @@ -142,7 +142,7 @@ Documentation routine. -`perturb_buffer_by_mono_h_core `_ +`perturb_buffer_by_mono_h_core `_ Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. @@ -152,22 +152,22 @@ Documentation routine. -`perturb_buffer_delta_rho_one_point `_ +`perturb_buffer_delta_rho_one_point `_ Applly pertubration ``delta_rho_one_point`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_dipole_moment_z `_ +`perturb_buffer_dipole_moment_z `_ Applly pertubration ``dipole_moment_z`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_epstein_nesbet `_ +`perturb_buffer_epstein_nesbet `_ Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_epstein_nesbet_2x2 `_ +`perturb_buffer_epstein_nesbet_2x2 `_ Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. @@ -187,7 +187,7 @@ Documentation routine. -`perturb_buffer_h_core `_ +`perturb_buffer_h_core `_ Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. diff --git a/src/Determinants/H_apply.template.f b/src/Determinants/H_apply.template.f index fe360a96..f90eb0c8 100644 --- a/src/Determinants/H_apply.template.f +++ b/src/Determinants/H_apply.template.f @@ -31,30 +31,30 @@ subroutine $subroutine_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl end do end do -! GEL D'ELECTRONS -! nt = 0 +! ! GEL D'ELECTRONS +! ! nt = 0 ! do i=1,i_generator-1 ! if(key_in(1,1) == key_prev(1,1,i)) then ! tmp = xor(key_in(1,2), key_prev(1,2,i)) ! if(popcnt(tmp) == 2) then ! ns = 1+trailz(iand(tmp, key_in(1,2))) -! if(status(ns, 2) /= 0) then -! nt += 1 -! end if +! ! if(status(ns, 2) /= 0) then +! ! nt += 1 +! ! end if ! status(ns, 2) = 0 ! end if ! else if(key_in(1,2) == key_prev(1,2,i)) then ! tmp = xor(key_in(1,1), key_prev(1,1,i)) ! if(popcnt(tmp) == 2) then ! ns = 1+trailz(iand(tmp, key_in(1,1))) -! if(status(ns, 1) /= 0) then -! nt += 1 -! end if +! ! if(status(ns, 1) /= 0) then +! ! nt += 1 +! ! end if ! status(ns, 1) = 0 ! end if ! end if ! end do -! print *, "nt", nt, i_generator +! ! print *, "nt", nt, i_generator do sp=1,2 diff --git a/src/Determinants/README.rst b/src/Determinants/README.rst index d12d8426..cc9e7ca3 100644 --- a/src/Determinants/README.rst +++ b/src/Determinants/README.rst @@ -157,11 +157,11 @@ Documentation of alpha and beta determinants -`davidson_converged `_ +`davidson_converged `_ True if the Davidson algorithm is converged -`davidson_criterion `_ +`davidson_criterion `_ Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] @@ -184,7 +184,7 @@ Documentation Initial guess vectors are not necessarily orthonormal -`davidson_diag_hjj `_ +`davidson_diag_hjj `_ Davidson diagonalization with specific diagonal elements of the H matrix .br H_jj : specific diagonal H matrix elements to diagonalize de Davidson @@ -213,7 +213,7 @@ Documentation Max number of Davidson sizes -`davidson_threshold `_ +`davidson_threshold `_ Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] @@ -229,7 +229,7 @@ Documentation det_coef -`det_connections `_ +`det_connections `_ Build connection proxy between determinants @@ -457,7 +457,7 @@ Documentation H_jj : array of -`h_u_0_org `_ +`h_u_0_org `_ Computes v_0 = H|u_0> .br n : number of determinants @@ -556,7 +556,7 @@ Documentation Energy of the reference bitmask used in Slater rules -`n_con_int `_ +`n_con_int `_ Number of integers to represent the connections between determinants @@ -921,7 +921,15 @@ Documentation for a given couple of hole/particle excitations i. -`sort_dets_ab `_ +`sort_dets_ab `_ + Undocumented + + +`sort_dets_ab_v `_ + Undocumented + + +`sort_dets_ba_v `_ Undocumented diff --git a/src/Determinants/davidson.irp.f b/src/Determinants/davidson.irp.f index 626ecec3..7a2f6401 100644 --- a/src/Determinants/davidson.irp.f +++ b/src/Determinants/davidson.irp.f @@ -120,6 +120,71 @@ subroutine tamiser(key, idx, no, n, Nint, N_key) end do end subroutine +subroutine sort_dets_ba_v(key, idx, shortcut, version, N_key, Nint) + use bitmasks + implicit none + integer(bit_kind),intent(inout) :: key(Nint,2,N_key) + integer,intent(out) :: idx(N_key) + integer,intent(out) :: shortcut(0:N_key+1) + integer(bit_kind),intent(out) :: version(Nint,N_key+1) + integer, intent(in) :: Nint, N_key + integer(bit_kind) :: tmp(Nint, 2,N_key) + + tmp(:,1,:N_key) = key(:,2,:N_key) + tmp(:,2,:N_key) = key(:,1,:N_key) + + call sort_dets_ab_v(tmp, idx, shortcut, version, N_key, Nint) + + key(:,1,:N_key) = tmp(:,2,:N_key) + key(:,2,:N_key) = tmp(:,1,:N_key) +end subroutine + + +subroutine sort_dets_ab_v(key, idx, shortcut, version, N_key, Nint) + use bitmasks + implicit none + + integer(bit_kind),intent(inout) :: key(Nint,2,N_key) + integer,intent(out) :: idx(N_key) + integer,intent(out) :: shortcut(0:N_key+1) + integer(bit_kind),intent(out) :: version(Nint,N_key+1) + integer, intent(in) :: Nint, N_key + integer(bit_kind) :: tmp(Nint, 2) + integer :: tmpidx,i,ni + + do i=1,N_key + idx(i) = i + end do + + do i=N_key/2,1,-1 + call tamiser(key, idx, i, N_key, Nint, N_key) + end do + + do i=N_key,2,-1 + tmp(:,:) = key(:,:,i) + key(:,:,i) = key(:,:,1) + key(:,:,1) = tmp(:,:) + tmpidx = idx(i) + idx(i) = idx(1) + idx(1) = tmpidx + call tamiser(key, idx, 1, i-1, Nint, N_key) + end do + + shortcut(0) = 1 + shortcut(1) = 1 + do i=2,N_key + do ni=1,nint + if(key(ni,1,i) /= key(ni,1,i-1)) then + shortcut(0) = shortcut(0) + 1 + shortcut(shortcut(0)) = i + version(:,shortcut(0)) = key(:,1,i) + exit + end if + end do + end do + shortcut(shortcut(0)+1) = N_key+1 +end subroutine + subroutine sort_dets_ab(key, idx, shortcut, N_key, Nint) use bitmasks diff --git a/src/Determinants/slater_rules.irp.f b/src/Determinants/slater_rules.irp.f index 72615089..06dcb9b7 100644 --- a/src/Determinants/slater_rules.irp.f +++ b/src/Determinants/slater_rules.irp.f @@ -1251,9 +1251,10 @@ subroutine H_u_0(v_0,u_0,H_jj,n,keys_tmp,shortcut,sort_idx,Nint) allocate(idx(0:n), vt(n)) Vt = 0.d0 v_0 = 0.d0 + !$OMP DO SCHEDULE(dynamic) - + do sh=1,shortcut(0) warp(1,0) = 0 do ii=1,sh!shortcut(0) diff --git a/src/Ezfio_files/README.rst b/src/Ezfio_files/README.rst index 986d7216..a612dcc7 100644 --- a/src/Ezfio_files/README.rst +++ b/src/Ezfio_files/README.rst @@ -203,83 +203,95 @@ Documentation Output file for Bitmask +`output_cas_sd `_ + Output file for CAS_SD + + `output_cpu_time_0 `_ Initial CPU and wall times when printing in the output files -`output_determinants `_ +`output_determinants `_ Output file for Determinants -`output_electrons `_ +`output_electrons `_ Output file for Electrons -`output_ezfio_files `_ +`output_ezfio_files `_ Output file for Ezfio_files -`output_generators_full `_ +`output_full_ci `_ + Output file for Full_CI + + +`output_generators_cas `_ + Output file for Generators_CAS + + +`output_generators_full `_ Output file for Generators_full -`output_hartree_fock `_ +`output_hartree_fock `_ Output file for Hartree_Fock -`output_integrals_bielec `_ +`output_integrals_bielec `_ Output file for Integrals_Bielec -`output_integrals_monoelec `_ +`output_integrals_monoelec `_ Output file for Integrals_Monoelec -`output_mo_basis `_ +`output_mo_basis `_ Output file for MO_Basis -`output_moguess `_ +`output_moguess `_ Output file for MOGuess -`output_mrcc_cassd `_ +`output_mrcc_cassd `_ Output file for MRCC_CASSD -`output_mrcc_utils `_ +`output_mrcc_utils `_ Output file for MRCC_Utils -`output_nuclei `_ +`output_nuclei `_ Output file for Nuclei -`output_perturbation `_ +`output_perturbation `_ Output file for Perturbation -`output_properties `_ +`output_properties `_ Output file for Properties -`output_pseudo `_ +`output_pseudo `_ Output file for Pseudo -`output_psiref_cas `_ +`output_psiref_cas `_ Output file for Psiref_CAS -`output_psiref_utils `_ +`output_psiref_utils `_ Output file for Psiref_Utils -`output_selectors_full `_ +`output_selectors_full `_ Output file for Selectors_full -`output_utils `_ +`output_utils `_ Output file for Utils