diff --git a/config/ifort.cfg b/config/ifort.cfg index e1a0dadf..647ec77e 100644 --- a/config/ifort.cfg +++ b/config/ifort.cfg @@ -57,6 +57,6 @@ FCFLAGS : -xSSE2 -C -fpe0 ################# # [OPENMP] -FC : -fopenmp +FC : -openmp IRPF90_FLAGS : --openmp diff --git a/plugins/All_singles/ASSUMPTIONS.rst b/plugins/All_singles/ASSUMPTIONS.rst new file mode 100644 index 00000000..e69de29b diff --git a/plugins/All_singles/README.rst b/plugins/All_singles/README.rst new file mode 100644 index 00000000..24abb1ae --- /dev/null +++ b/plugins/All_singles/README.rst @@ -0,0 +1,4 @@ +================== +All_singles Module +================== + diff --git a/plugins/CAS_SD/README.rst b/plugins/CAS_SD/README.rst index f0fbbd17..92a4572b 100644 --- a/plugins/CAS_SD/README.rst +++ b/plugins/CAS_SD/README.rst @@ -34,24 +34,24 @@ Documentation 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 `_ 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_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. @@ -62,7 +62,7 @@ Documentation Assume N_int is already provided. -`h_apply_cas_sd_selected_monoexc `_ +`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. diff --git a/plugins/CISD/README.rst b/plugins/CISD/README.rst index 412f0aad..881509a3 100644 --- a/plugins/CISD/README.rst +++ b/plugins/CISD/README.rst @@ -26,10 +26,6 @@ Documentation .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -`cisd `_ - Undocumented - - `h_apply_cisd `_ 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. @@ -46,3 +42,160 @@ Documentation particles. Assume N_int is already provided. + +`h_apply_cisd_selection `_ + Undocumented + + +`h_apply_cisd_selection_delta_rho_one_point `_ + 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_cisd_selection_delta_rho_one_point_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_delta_rho_one_point_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_dipole_moment_z `_ + 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_cisd_selection_dipole_moment_z_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_dipole_moment_z_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet `_ + 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_cisd_selection_epstein_nesbet_2x2 `_ + 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_cisd_selection_epstein_nesbet_2x2_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_2x2_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_sc2 `_ + 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_cisd_selection_epstein_nesbet_sc2_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_sc2_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected `_ + 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_cisd_selection_epstein_nesbet_sc2_no_projected_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_sc2_projected `_ + 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_cisd_selection_epstein_nesbet_sc2_projected_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_epstein_nesbet_sc2_projected_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_h_core `_ + 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_cisd_selection_h_core_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_h_core_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_moller_plesset `_ + 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_cisd_selection_moller_plesset_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_selection_moller_plesset_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/CISD_SC2_selected/README.rst b/plugins/CISD_SC2_selected/README.rst index 307063a6..a9edfd18 100644 --- a/plugins/CISD_SC2_selected/README.rst +++ b/plugins/CISD_SC2_selected/README.rst @@ -12,41 +12,41 @@ Documentation Undocumented -`h_apply_pt2 `_ +`h_apply_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_pt2_diexc `_ +`h_apply_pt2_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_pt2_en_sc2 `_ +`h_apply_pt2_en_sc2 `_ 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_en_sc2_diexc `_ +`h_apply_pt2_en_sc2_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_pt2_en_sc2_monoexc `_ +`h_apply_pt2_en_sc2_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_monoexc `_ +`h_apply_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_sc2_selected `_ +`h_apply_sc2_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. @@ -57,7 +57,7 @@ Documentation Assume N_int is already provided. -`h_apply_sc2_selected_monoexc `_ +`h_apply_sc2_selected_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/CISD_selected/README.rst b/plugins/CISD_selected/README.rst index 230df80c..3dc6c637 100644 --- a/plugins/CISD_selected/README.rst +++ b/plugins/CISD_selected/README.rst @@ -8,162 +8,158 @@ Documentation .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -`cisd `_ - Undocumented - - `h_apply_cisd_selection `_ Undocumented -`h_apply_cisd_selection_delta_rho_one_point `_ +`h_apply_cisd_selection_delta_rho_one_point `_ 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_cisd_selection_delta_rho_one_point_diexc `_ +`h_apply_cisd_selection_delta_rho_one_point_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_delta_rho_one_point_monoexc `_ +`h_apply_cisd_selection_delta_rho_one_point_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_dipole_moment_z `_ +`h_apply_cisd_selection_dipole_moment_z `_ 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_cisd_selection_dipole_moment_z_diexc `_ +`h_apply_cisd_selection_dipole_moment_z_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_dipole_moment_z_monoexc `_ +`h_apply_cisd_selection_dipole_moment_z_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet `_ +`h_apply_cisd_selection_epstein_nesbet `_ 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_cisd_selection_epstein_nesbet_2x2 `_ +`h_apply_cisd_selection_epstein_nesbet_2x2 `_ 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_cisd_selection_epstein_nesbet_2x2_diexc `_ +`h_apply_cisd_selection_epstein_nesbet_2x2_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_2x2_monoexc `_ +`h_apply_cisd_selection_epstein_nesbet_2x2_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_diexc `_ +`h_apply_cisd_selection_epstein_nesbet_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_monoexc `_ +`h_apply_cisd_selection_epstein_nesbet_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_sc2 `_ +`h_apply_cisd_selection_epstein_nesbet_sc2 `_ 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_cisd_selection_epstein_nesbet_sc2_diexc `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_sc2_monoexc `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected `_ 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_cisd_selection_epstein_nesbet_sc2_no_projected_diexc `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected_monoexc `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_sc2_projected `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_projected `_ 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_cisd_selection_epstein_nesbet_sc2_projected_diexc `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_projected_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_epstein_nesbet_sc2_projected_monoexc `_ +`h_apply_cisd_selection_epstein_nesbet_sc2_projected_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_h_core `_ +`h_apply_cisd_selection_h_core `_ 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_cisd_selection_h_core_diexc `_ +`h_apply_cisd_selection_h_core_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_h_core_monoexc `_ +`h_apply_cisd_selection_h_core_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_moller_plesset `_ +`h_apply_cisd_selection_moller_plesset `_ 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_cisd_selection_moller_plesset_diexc `_ +`h_apply_cisd_selection_moller_plesset_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_cisd_selection_moller_plesset_monoexc `_ +`h_apply_cisd_selection_moller_plesset_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/DDCI_selected/README.rst b/plugins/DDCI_selected/README.rst index 471ebd21..0e5b3be1 100644 --- a/plugins/DDCI_selected/README.rst +++ b/plugins/DDCI_selected/README.rst @@ -12,24 +12,24 @@ Documentation Undocumented -`h_apply_ddci_pt2 `_ +`h_apply_ddci_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_ddci_pt2_diexc `_ +`h_apply_ddci_pt2_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_ddci_pt2_monoexc `_ +`h_apply_ddci_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_ddci_selection `_ +`h_apply_ddci_selection `_ 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. @@ -40,7 +40,7 @@ Documentation Assume N_int is already provided. -`h_apply_ddci_selection_monoexc `_ +`h_apply_ddci_selection_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 396fbcd6..64e44609 100644 --- a/plugins/Full_CI/README.rst +++ b/plugins/Full_CI/README.rst @@ -14,7 +14,7 @@ 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. @@ -25,126 +25,126 @@ Documentation Assume N_int is already provided. -`h_apply_fci_mono `_ +`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 `_ 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_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 `_ 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_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 `_ 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_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 `_ 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_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 `_ 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_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 `_ 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_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 `_ 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_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/full_ci.irp.f b/plugins/Full_CI/full_ci.irp.f index e2a9700e..c7b8452d 100644 --- a/plugins/Full_CI/full_ci.irp.f +++ b/plugins/Full_CI/full_ci.irp.f @@ -28,6 +28,7 @@ program full_ci print *, '-----' endif double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(N_states) + double precision :: E_CI_before(N_states) if(read_wf)then call i_H_psi(psi_det(1,1,N_det),psi_det,psi_coef,N_int,N_det,psi_det_size,N_states,i_H_psi_array) h = diag_H_mat_elem(psi_det(1,1,N_det),N_int) @@ -38,6 +39,7 @@ program full_ci integer :: n_det_before print*,'Beginning the selection ...' + E_CI_before = CI_energy do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max) n_det_before = N_det call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st) @@ -57,12 +59,13 @@ program full_ci if(n_det_before == N_det)then selection_criterion = selection_criterion * 0.5d0 endif - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - print *, 'PT2 = ', pt2 - print *, 'E = ', CI_energy - print *, 'E+PT2 = ', CI_energy+pt2 + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print *, 'PT2 = ', pt2 + print *, 'E = ', CI_energy + print *, 'E(before)+PT2 = ', E_CI_before+pt2 print *, '-----' + E_CI_before = CI_energy call ezfio_set_full_ci_energy(CI_energy) if (abort_all) then exit diff --git a/plugins/Full_CI/full_ci_no_skip.irp.f b/plugins/Full_CI/full_ci_no_skip.irp.f index 73958bf9..c9b8d1a0 100644 --- a/plugins/Full_CI/full_ci_no_skip.irp.f +++ b/plugins/Full_CI/full_ci_no_skip.irp.f @@ -28,6 +28,7 @@ program full_ci print *, '-----' endif double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(N_states) + double precision :: E_CI_before(N_states) if(read_wf)then call i_H_psi(psi_det(1,1,N_det),psi_det,psi_coef,N_int,N_det,psi_det_size,N_states,i_H_psi_array) h = diag_H_mat_elem(psi_det(1,1,N_det),N_int) @@ -38,6 +39,7 @@ program full_ci integer :: n_det_before print*,'Beginning the selection ...' + E_CI_before = CI_energy do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max) n_det_before = N_det call H_apply_FCI_no_skip(pt2, norm_pert, H_pert_diag, N_st) @@ -61,8 +63,9 @@ program full_ci print *, 'N_states = ', N_states print *, 'PT2 = ', pt2 print *, 'E = ', CI_energy - print *, 'E+PT2 = ', CI_energy+pt2 + print *, 'E+PT2 = ', E_CI_before+pt2 print *, '-----' + E_CI_before = CI_energy call ezfio_set_full_ci_energy(CI_energy) if (abort_all) then exit @@ -73,6 +76,7 @@ program full_ci call diagonalize_CI if(do_pt2_end)then print*,'Last iteration only to compute the PT2' +! print*,'The thres' threshold_selectors = 1.d0 threshold_generators = 0.999d0 call H_apply_FCI_PT2(pt2, norm_pert, H_pert_diag, N_st) diff --git a/plugins/Generators_restart/ASSUMPTIONS.rst b/plugins/Generators_restart/ASSUMPTIONS.rst new file mode 100644 index 00000000..e69de29b diff --git a/plugins/Generators_restart/README.rst b/plugins/Generators_restart/README.rst index 2a476a1a..e7ab7045 100644 --- a/plugins/Generators_restart/README.rst +++ b/plugins/Generators_restart/README.rst @@ -2,40 +2,3 @@ Generators_restart Module ========================= -Documentation -============= - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -`n_det_generators `_ - Read the wave function - - -`psi_coef_generators `_ - read wf - .br - - -`psi_det_generators `_ - read wf - .br - - -`select_max `_ - Memo to skip useless selectors - - -`size_select_max `_ - Size of the select_max array - -Needed Modules -============== - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -.. image:: tree_dependency.png - -* `Determinants `_ - diff --git a/plugins/MRCC/mrcc_utils.irp.f b/plugins/MRCC/mrcc_utils.irp.f index 872588cf..716d5ffc 100644 --- a/plugins/MRCC/mrcc_utils.irp.f +++ b/plugins/MRCC/mrcc_utils.irp.f @@ -1,21 +1,32 @@ BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states,psi_det_size) ] +&BEGIN_PROVIDER [ double precision, lambda_pert, (N_states,psi_det_size) ] implicit none BEGIN_DOC ! cm/ END_DOC integer :: i,k - double precision :: ihpsi(N_states) - do i=1,N_det_non_cas + double precision :: ihpsi(N_states), hij(N_states) + +do i=1,N_det_non_cas call i_h_psi(psi_non_cas(1,1,i), psi_cas, psi_cas_coef, N_int, N_det_cas, & size(psi_cas_coef,1), n_states, ihpsi) - double precision :: hij + call i_h_j(psi_non_cas(1,1,i),psi_non_cas(1,1,i),N_int,hij) do k=1,N_states - if (dabs(ihpsi(k)) > 1.d-5) then - lambda_mrcc(k,i) = psi_non_cas_coef(i,k)/ihpsi(k) - lambda_mrcc(k,i) = min( lambda_mrcc (k,i),0.d0 ) + lambda_pert(k,i) = 1d0 / (CI_electronic_energy(k)-hij(k)) + lambda_mrcc(k,i) = psi_non_cas_coef(i,k)/ihpsi(k) + if ((lambda_mrcc(k,i)/lambda_pert(k,i))<0.d0 .or. (lambda_mrcc(k,i)/lambda_pert(k,i))>4.d0) then + lambda_mrcc(k,i) = lambda_pert(k,i) else - lambda_mrcc(k,i) = 0.d0 + if ((lambda_mrcc(k,i)/lambda_pert(k,i))<0.1d0 .or. (lambda_mrcc(k,i)/lambda_pert(k,i))>=0d0) then + lambda_mrcc(k,i) = lambda_mrcc(k,i)*((cos((lambda_mrcc(k,i)/lambda_pert(k,i))*3.141592653589793d0/0.1d0+3.141592653589793d0)+1d0)/2.d0) & + + lambda_pert(k,i)*(1.d0-((cos((lambda_mrcc(k,i)/lambda_pert(k,i))*3.141592653589793d0/0.1d0+3.141592653589793d0)+1.d0)/2.d0)) + elseif ((lambda_mrcc(k,i)/lambda_pert(k,i))<=4.0d0 .or. (lambda_mrcc(k,i)/lambda_pert(k,i))>2.0d0) then + lambda_mrcc(k,i) = lambda_mrcc(k,i)*(1.d0-(cos(abs(2.d0-(lambda_mrcc(k,i)/lambda_pert(k,i)))*3.141592653589793d0/2.0d0+3.141592653589793d0)+1.d0)/2d0) & + + lambda_pert(k,i)*((cos(abs(2.d0-(lambda_mrcc(k,i)/lambda_pert(k,i)))*3.141592653589793d0/2.0d0+3.141592653589793d0)+1.d0)/2.d0) + else + lambda_mrcc(k,i) = lambda_mrcc(k,i) + endif endif enddo enddo @@ -23,6 +34,8 @@ END_PROVIDER + + BEGIN_PROVIDER [ character*(32), dressing_type ] implicit none BEGIN_DOC diff --git a/plugins/Molden/NEEDED_CHILDREN_MODULES b/plugins/Molden/NEEDED_CHILDREN_MODULES index 64795a92..305dfb78 100644 --- a/plugins/Molden/NEEDED_CHILDREN_MODULES +++ b/plugins/Molden/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -MOs Utils +MO_Basis Utils diff --git a/plugins/Molden/README.rst b/plugins/Molden/README.rst index c97e6319..71639cad 100644 --- a/plugins/Molden/README.rst +++ b/plugins/Molden/README.rst @@ -35,6 +35,6 @@ Needed Modules .. image:: tree_dependency.png -* `MOs `_ +* `MO_Basis `_ * `Utils `_ diff --git a/plugins/Perturbation/README.rst b/plugins/Perturbation/README.rst index 9162e94b..aad453e8 100644 --- a/plugins/Perturbation/README.rst +++ b/plugins/Perturbation/README.rst @@ -85,7 +85,7 @@ 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. @@ -95,12 +95,12 @@ Documentation 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. @@ -120,17 +120,17 @@ 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. -`perturb_buffer_by_mono_moller_plesset `_ +`perturb_buffer_by_mono_moller_plesset `_ Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply 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. @@ -140,12 +140,12 @@ Documentation 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. @@ -165,12 +165,12 @@ 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. -`perturb_buffer_moller_plesset `_ +`perturb_buffer_moller_plesset `_ Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. diff --git a/scripts/generate_h_apply.py b/scripts/generate_h_apply.py index 563a7a56..9f878d7d 100755 --- a/scripts/generate_h_apply.py +++ b/scripts/generate_h_apply.py @@ -277,7 +277,7 @@ class H_apply(object): do k=1,N_st norm_psi(k) = norm_psi(k) + psi_coef_generators(i_generator,k)*psi_coef_generators(i_generator,k) ! delta_pt2(k) = 0.d0 -! pt2_old(k) = 0.d0 + pt2_old(k) = 0.d0 ! pt2(k) = select_max(i_generator) enddo !$ call omp_unset_lock(lck) diff --git a/src/Determinants/diagonalize_CI.irp.f b/src/Determinants/diagonalize_CI.irp.f index 7c017956..9af8d413 100644 --- a/src/Determinants/diagonalize_CI.irp.f +++ b/src/Determinants/diagonalize_CI.irp.f @@ -52,6 +52,10 @@ END_PROVIDER call davidson_diag(psi_det,CI_eigenvectors,CI_electronic_energy, & size(CI_eigenvectors,1),N_det,N_states_diag,N_int,output_determinants) + do j=1,N_states_diag + call get_s2_u0(psi_det,CI_eigenvectors(1,j),N_det,size(CI_eigenvectors,1),CI_eigenvectors_s2(j)) + enddo + else if (diag_algorithm == "Lapack") then @@ -69,7 +73,8 @@ END_PROVIDER if (s2_eig) then i_state = 0 do j=1,N_det - call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2) + call get_s2_u0(psi_det,eigenvectors(1,j),N_det,size(eigenvectors,1),s2) + print*,'s2 = ',s2 if(dabs(s2-expected_s2).le.0.3d0)then i_state += 1 do i=1,N_det diff --git a/src/Determinants/s2.irp.f b/src/Determinants/s2.irp.f index 760893e0..fd42fe51 100644 --- a/src/Determinants/s2.irp.f +++ b/src/Determinants/s2.irp.f @@ -1,4 +1,4 @@ -subroutine get_s2(key_i,key_j,phase,Nint) +subroutine get_s2(key_i,key_j,s2,Nint) implicit none use bitmasks BEGIN_DOC @@ -7,21 +7,21 @@ subroutine get_s2(key_i,key_j,phase,Nint) integer, intent(in) :: Nint integer(bit_kind), intent(in) :: key_i(Nint,2) integer(bit_kind), intent(in) :: key_j(Nint,2) - double precision, intent(out) :: phase + double precision, intent(out) :: s2 integer :: exc(0:2,2,2) integer :: degree double precision :: phase_spsm integer :: nup, i - phase = 0.d0 + s2 = 0.d0 !$FORCEINLINE call get_excitation_degree(key_i,key_j,degree,Nint) select case (degree) case(2) - call get_double_excitation(key_i,key_j,exc,phase_spsm,Nint) + call get_double_excitation(key_j,key_i,exc,phase_spsm,Nint) if (exc(0,1,1) == 1) then ! Mono alpha + mono-beta if ( (exc(1,1,1) == exc(1,2,2)).and.(exc(1,1,2) == exc(1,2,1)) ) then - phase = -phase_spsm + s2 = -phase_spsm endif endif case(0) @@ -29,7 +29,7 @@ subroutine get_s2(key_i,key_j,phase,Nint) do i=1,Nint nup += popcnt(iand(xor(key_i(i,1),key_i(i,2)),key_i(i,1))) enddo - phase = dble(nup) + s2 = dble(nup) end select end @@ -72,7 +72,7 @@ BEGIN_PROVIDER [ double precision, s2_values, (N_states) ] integer :: i double precision :: s2 do i = 1, N_states - call get_s2_u0(psi_det,psi_coef(1,i),n_det,psi_det_size,s2) + call get_s2_u0(psi_det,psi_coef(1,i),n_det,size(psi_coef,1),s2) s2_values(i) = s2 enddo @@ -89,18 +89,32 @@ subroutine get_s2_u0(psi_keys_tmp,psi_coefs_tmp,n,nmax,s2) integer :: i,j,l double precision :: s2_tmp s2 = 0.d0 +!print*,'IN get_s2_u0' +!print*,'n,nmax = ',n,nmax + double precision :: accu + accu = 0.d0 + do i = 1,n + accu += psi_coefs_tmp(i) * psi_coefs_tmp(i) +! print*,'psi_coef = ',psi_coefs_tmp(i) + enddo +!print*,'accu = ',accu +!print*,'' !$OMP PARALLEL DO DEFAULT(NONE) & - !$OMP PRIVATE(i,j,s2_tmp) SHARED(n,psi_coefs_tmp,psi_keys_tmp,N_int) & - !$OMP REDUCTION(+:s2) SCHEDULE(dynamic) + !$OMP PRIVATE(i,j,s2_tmp) SHARED(n,psi_coefs_tmp,psi_keys_tmp,N_int) REDUCTION(+:s2) SCHEDULE(dynamic) do i=1,n - call get_s2(psi_keys_tmp(1,1,i),psi_keys_tmp(1,1,i),s2_tmp,N_int) - s2 += psi_coefs_tmp(i)*psi_coefs_tmp(i)*s2_tmp do j=i+1,n call get_s2(psi_keys_tmp(1,1,i),psi_keys_tmp(1,1,j),s2_tmp,N_int) s2 += (psi_coefs_tmp(i)+psi_coefs_tmp(i))*psi_coefs_tmp(j)*s2_tmp +! s2 = s2 + 2.d0 * psi_coefs_tmp(i)*psi_coefs_tmp(j)*s2_tmp enddo enddo !$OMP END PARALLEL DO + do i=1,n + call get_s2(psi_keys_tmp(1,1,i),psi_keys_tmp(1,1,i),s2_tmp,N_int) + s2 += psi_coefs_tmp(i)*psi_coefs_tmp(i)*s2_tmp + enddo s2 += S_z2_Sz +!print*,'s2 = ',s2 +!print*,'' end