diff --git a/data/ezfio_defaults/WILL_BE_DELETED.ezfio_default b/data/ezfio_defaults/WILL_BE_DELETED.ezfio_default deleted file mode 100644 index 0d9489d5..00000000 --- a/data/ezfio_defaults/WILL_BE_DELETED.ezfio_default +++ /dev/null @@ -1,61 +0,0 @@ -bielec_integrals - read_ao_integrals false - read_mo_integrals false - write_ao_integrals false - write_mo_integrals false - threshold_ao 1.e-15 - threshold_mo 1.e-15 - direct false - -cis_dressed - n_state_cis 10 - n_core_cis 0 - n_act_cis mo_basis_mo_tot_num - mp2_dressing false - standard_doubles true - en_2_2 false - -determinants - n_states 1 - n_states_diag determinants_n_states - n_det_max_jacobi 1000 - threshold_generators 0.99 - threshold_selectors 0.999 - read_wf false - s2_eig false - only_single_double_dm false - -full_ci - n_det_max_fci 10000 - n_det_max_fci_property 50000 - pt2_max 1.e-4 - do_pt2_end true - var_pt2_ratio 0.75 - -cas_sd - n_det_max_cas_sd 100000 - pt2_max 1.e-4 - do_pt2_end true - var_pt2_ratio 0.75 - -all_singles - n_det_max_fci 50000 - pt2_max 1.e-8 - do_pt2_end false - -hartree_fock - n_it_scf_max 200 - thresh_scf 1.e-10 - guess "Huckel" - -cisd_selected - n_det_max_cisd 10000 - pt2_max 1.e-4 - -cisd_sc2_selected - n_det_max_cisd_sc2 10000 - pt2_max 1.e-4 - do_pt2_end true - -properties - z_one_point 3.9 diff --git a/data/ezfio_defaults/cisd.ezfio_default b/data/ezfio_defaults/cisd.ezfio_default deleted file mode 100644 index 95991f8f..00000000 --- a/data/ezfio_defaults/cisd.ezfio_default +++ /dev/null @@ -1,4 +0,0 @@ -cisd_selected - n_det_max_cisd 10000 - pt2_max 1.e-4 - diff --git a/src/AOs/README.rst b/src/AOs/README.rst index 6b5c486d..b411cd20 100644 --- a/src/AOs/README.rst +++ b/src/AOs/README.rst @@ -147,5 +147,11 @@ Documentation Per convention, for P,D,F and G AOs, we take the index of the AO with the the corresponding power in the "X" axis +`n_pt_max_i_x `_ + Undocumented + +`n_pt_max_integrals `_ + Undocumented + diff --git a/src/CAS_SD/EZFIO.cfg b/src/CAS_SD/EZFIO.cfg index 7f27f95a..6fb8c8a0 100644 --- a/src/CAS_SD/EZFIO.cfg +++ b/src/CAS_SD/EZFIO.cfg @@ -1,29 +1,3 @@ -[N_det_max_cas_sd] -type: Det_number_max -doc: Max number of determinants in the wave function -interface: input -default: 10000 - -[do_pt2_end] -type: logical -doc: If true, compute the PT2 at the end of the selection -interface: input -default: True - -[PT2_max] -type: PT2_energy -doc: The selection process stops when the largest PT2 (for all the state is lower - than pt2_max in absolute value -interface: input -default: 0.0001 - -[var_pt2_ratio] -type: Normalized_float -doc: The selection process stops when the energy ratio variational/(variational+PT2) - is equal to var_pt2_ratio -interface: input -default: 0.75 - [energy] type: double precision doc: "Calculated CAS-SD energy" diff --git a/src/CAS_SD/cas_sd.irp.f b/src/CAS_SD/cas_sd.irp.f index e28334b2..c823489f 100644 --- a/src/CAS_SD/cas_sd.irp.f +++ b/src/CAS_SD/cas_sd.irp.f @@ -13,12 +13,12 @@ program full_ci N_det_old = 0 pt2 = 1.d0 diag_algorithm = "Lapack" - if (N_det > n_det_max_cas_sd) then + if (N_det > N_det_max) then call diagonalize_CI call save_wavefunction psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_cas_sd + N_det = N_det_max soft_touch N_det psi_det psi_coef call diagonalize_CI call save_wavefunction @@ -30,7 +30,7 @@ program full_ci print *, '-----' endif - do while (N_det < n_det_max_cas_sd.and.maxval(abs(pt2(1:N_st))) > pt2_max) + do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max) N_det_old = N_det call H_apply_CAS_SD(pt2, norm_pert, H_pert_diag, N_st) @@ -38,10 +38,10 @@ program full_ci PROVIDE psi_det PROVIDE psi_det_sorted - if (N_det > n_det_max_cas_sd) then + if (N_det > N_det_max) then psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_cas_sd + N_det = N_det_max soft_touch N_det psi_det psi_coef endif call diagonalize_CI diff --git a/src/CAS_SD/cas_sd_selected.irp.f b/src/CAS_SD/cas_sd_selected.irp.f index c3abadf4..08cfcf41 100644 --- a/src/CAS_SD/cas_sd_selected.irp.f +++ b/src/CAS_SD/cas_sd_selected.irp.f @@ -12,12 +12,12 @@ program full_ci pt2 = 1.d0 diag_algorithm = "Lapack" - if (N_det > n_det_max_cas_sd) then + if (N_det > N_det_max) then call diagonalize_CI call save_wavefunction psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_cas_sd + N_det = N_det_max soft_touch N_det psi_det psi_coef call diagonalize_CI call save_wavefunction @@ -29,17 +29,17 @@ program full_ci print *, '-----' endif - do while (N_det < n_det_max_cas_sd.and.maxval(abs(pt2(1:N_st))) > pt2_max) + do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max) call H_apply_CAS_SD_selected(pt2, norm_pert, H_pert_diag, N_st) PROVIDE psi_coef PROVIDE psi_det PROVIDE psi_det_sorted - if (N_det > n_det_max_cas_sd) then + if (N_det > N_det_max) then psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_cas_sd + N_det = N_det_max soft_touch N_det psi_det psi_coef endif call diagonalize_CI diff --git a/src/CISD_SC2_selected/EZFIO.cfg b/src/CISD_SC2_selected/EZFIO.cfg index b76eac5d..3b49c52b 100644 --- a/src/CISD_SC2_selected/EZFIO.cfg +++ b/src/CISD_SC2_selected/EZFIO.cfg @@ -1,22 +1,3 @@ -[N_det_max_cisd_sc2] -type: Det_number_max -doc: Max number of determinants -interface: input -default: 10000 - -[do_pt2_end] -type: logical -doc: If true, compute the PT2 at the end of the selection -interface: input -default: True - -[PT2_max] -type: PT2_energy -doc: The selection process stops when the largest PT2 (for all the states) is lower - than abs(pt2_max) -interface: input -default: 0.0001 - [energy] type: double precision doc: Calculated CISD_SC2 energy of ground_state diff --git a/src/CISD_SC2_selected/cisd_sc2_selection.irp.f b/src/CISD_SC2_selected/cisd_sc2_selection.irp.f index 55234fcb..f4c96f54 100644 --- a/src/CISD_SC2_selected/cisd_sc2_selection.irp.f +++ b/src/CISD_SC2_selected/cisd_sc2_selection.irp.f @@ -15,12 +15,12 @@ program cisd_sc2_selected E_old(1) = HF_energy davidson_threshold = 1.d-10 - if (N_det > n_det_max_cisd_sc2) then + if (N_det > N_det_max) then call diagonalize_CI_SC2 call save_wavefunction psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_cisd_sc2 + N_det = N_det_max soft_touch N_det psi_det psi_coef call diagonalize_CI call save_wavefunction @@ -34,7 +34,7 @@ program cisd_sc2_selected integer :: i_count i_count = 0 - do while (N_det < n_det_max_cisd_sc2.and.maxval(abs(pt2(1:N_st))) > pt2_max) + do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max) print*,'----' print*,'' call H_apply_SC2_selected(pt2, norm_pert, H_pert_diag, N_st) @@ -70,7 +70,7 @@ program cisd_sc2_selected call ezfio_set_full_ci_energy(CI_SC2_energy(1)) enddo - N_det = min(n_det_max_cisd_sc2,N_det) + N_det = min(N_det_max,N_det) davidson_threshold = 1.d-10 touch N_det psi_det psi_coef davidson_threshold davidson_criterion call diagonalize_CI_SC2 diff --git a/src/CISD_selected/README.rst b/src/CISD_selected/README.rst index 9baefdbb..d2730f2b 100644 --- a/src/CISD_selected/README.rst +++ b/src/CISD_selected/README.rst @@ -14,12 +14,6 @@ Documentation `cisd `_ Undocumented -`n_det_max_cisd `_ - Get n_det_max_cisd from EZFIO file - -`pt2_max `_ - Get pt2_max from EZFIO file - Needed Modules diff --git a/src/CISD_selected/cisd.ezfio_config b/src/CISD_selected/cisd.ezfio_config deleted file mode 100644 index be3854b1..00000000 --- a/src/CISD_selected/cisd.ezfio_config +++ /dev/null @@ -1,3 +0,0 @@ -cisd_selected - n_det_max_cisd integer - pt2_max double precision diff --git a/src/CISD_selected/cisd_selection.irp.f b/src/CISD_selected/cisd_selection.irp.f index c74d0f3a..b05e9ea4 100644 --- a/src/CISD_selected/cisd_selection.irp.f +++ b/src/CISD_selected/cisd_selection.irp.f @@ -18,7 +18,7 @@ program cisd print *, 'E = ', CI_energy(i) enddo E_old = CI_energy - do while (maxval(abs(pt2(1:N_st))) > pt2_max.and.n_det < n_det_max_cisd) + do while (maxval(abs(pt2(1:N_st))) > pt2_max.and.n_det < N_det_max) print*,'----' print*,'' call H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st) @@ -38,7 +38,7 @@ program cisd exit endif enddo - N_det = min(N_det,n_det_max_cisd) + N_det = min(N_det,N_det_max) touch N_det psi_det psi_coef call diagonalize_CI deallocate(pt2,norm_pert,H_pert_diag) diff --git a/src/CISD_selected/options.irp.f b/src/CISD_selected/options.irp.f deleted file mode 100644 index 53aa0ef6..00000000 --- a/src/CISD_selected/options.irp.f +++ /dev/null @@ -1,34 +0,0 @@ - BEGIN_PROVIDER [ integer, n_det_max_cisd ] - implicit none - BEGIN_DOC - ! Get n_det_max_cisd from EZFIO file - END_DOC - logical :: has_n_det_max_cisd - PROVIDE ezfio_filename - call ezfio_has_cisd_selected_n_det_max_cisd(has_n_det_max_cisd) - if (has_n_det_max_cisd) then - call ezfio_get_cisd_selected_n_det_max_cisd(n_det_max_cisd) - else - n_det_max_cisd = 30000 - call ezfio_set_cisd_selected_n_det_max_cisd(n_det_max_cisd) - endif - print*,'n_det_max_cisd = ',n_det_max_cisd - END_PROVIDER - - BEGIN_PROVIDER [ double precision , pt2_max ] - implicit none - BEGIN_DOC - ! Get pt2_max from EZFIO file - END_DOC - logical :: has_pt2_max - PROVIDE ezfio_filename - call ezfio_has_cisd_selected_pt2_max(has_pt2_max) - if (has_pt2_max) then - call ezfio_get_cisd_selected_pt2_max(pt2_max) - else - pt2_max = 1.d-9 - call ezfio_set_cisd_selected_pt2_max(pt2_max) - endif - print*,'pt2_max = ',pt2_max - END_PROVIDER - diff --git a/src/DDCI_selected/ddci.irp.f b/src/DDCI_selected/ddci.irp.f index 3f3b6159..1a44e3b1 100644 --- a/src/DDCI_selected/ddci.irp.f +++ b/src/DDCI_selected/ddci.irp.f @@ -11,12 +11,12 @@ program full_ci pt2 = 1.d0 diag_algorithm = "Lapack" - if (N_det > n_det_max_fci) then + if (N_det > N_det_max) then call diagonalize_CI call save_wavefunction psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_fci + N_det = N_det_max soft_touch N_det psi_det psi_coef call diagonalize_CI call save_wavefunction @@ -28,17 +28,17 @@ program full_ci print *, '-----' endif - do while (N_det < n_det_max_fci.and.maxval(abs(pt2(1:N_st))) > pt2_max) + do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max) call H_apply_DDCI_selection(pt2, norm_pert, H_pert_diag, N_st) PROVIDE psi_coef PROVIDE psi_det PROVIDE psi_det_sorted - if (N_det > n_det_max_fci) then + if (N_det > N_det_max) then psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_fci + N_det = N_det_max soft_touch N_det psi_det psi_coef endif call diagonalize_CI diff --git a/src/DDCI_selected/options.irp.f b/src/DDCI_selected/options.irp.f deleted file mode 100644 index 553fbe9f..00000000 --- a/src/DDCI_selected/options.irp.f +++ /dev/null @@ -1,32 +0,0 @@ -BEGIN_SHELL [ /usr/bin/python ] -from ezfio_with_default import EZFIO_Provider -T = EZFIO_Provider() -T.set_type ( "integer" ) -T.set_name ( "N_det_max_fci" ) -T.set_doc ( "Max number of determinants in the wave function" ) -T.set_ezfio_dir ( "full_ci" ) -T.set_ezfio_name( "N_det_max_fci" ) -T.set_output ( "output_full_ci" ) -print T - -T.set_type ( "logical" ) -T.set_name ( "do_pt2_end" ) -T.set_doc ( "If true, compute the PT2 at the end of the selection" ) -T.set_ezfio_name( "do_pt2_end" ) -print T - -T.set_type ( "double precision" ) -T.set_name ( "pt2_max" ) -T.set_doc ( """The selection process stops when the largest PT2 (for all the states) -is lower than pt2_max in absolute value""" ) -T.set_ezfio_name( "pt2_max" ) -print T - -T.set_type ( "double precision" ) -T.set_name ( "var_pt2_ratio" ) -T.set_doc ( """The selection process stops when the energy ratio variational/(variational+PT2) -is equal to var_pt2_ratio""" ) -T.set_ezfio_name( "var_pt2_ratio" ) -print T -END_SHELL - diff --git a/src/Determinants/EZFIO.cfg b/src/Determinants/EZFIO.cfg index eab4ea0e..4a2270c7 100644 --- a/src/Determinants/EZFIO.cfg +++ b/src/Determinants/EZFIO.cfg @@ -1,15 +1,27 @@ +[N_det_max] +type: Det_number_max +doc: Max number of determinants in the wave function +interface: input +default: 10000 + +[N_det_max_property] +type: Det_number_max +doc: Max number of determinants in the wave function when you select for a given property +interface: input +default: 10000 + +[N_det_max_jacobi] +type: Det_number_max +doc: Maximum number of determinants diagonalized by Jacobi +interface: input +default: 1000 + [N_states] type: States_number doc: Number of states to consider interface: input default: 1 -[N_det_max_jacobi] -type: Strictly_positive_int -doc: Maximum number of determinants diagonalized by Jacobi -interface: input -default: 1000 - [read_wf] type: logical doc: If true, read the wave function from the EZFIO file @@ -40,9 +52,6 @@ doc: Thresholds on selectors (fraction of the norm) interface: input default: 0.999 - -# Only create the ezfio_config, (no Input_* and no PROVIDER) - [n_states_diag] type: integer doc: n_states_diag @@ -72,13 +81,13 @@ type: integer interface: OCaml doc: psi_coef type: double precision -size: (determinants_n_det,determinants_n_states) +size: (determinants.n_det,determinants.n_states) [psi_det] interface: OCaml doc: psi_det type: integer*8 -size: (determinants_n_int*determinants_bit_kind/8,2,determinants_n_det) +size: (determinants.n_int*determinants.bit_kind/8,2,determinants.n_det) [det_num] interface: OCaml @@ -89,13 +98,13 @@ type: integer interface: OCaml doc: det_occ type: integer -size: (electrons_elec_alpha_num,determinants_det_num,2) +size: (electrons.elec_alpha_num,determinants.det_num,2) [det_coef] interface: OCaml doc: det_coef type: double precision -size: (determinants_det_num) +size: (determinants.det_num) [expected_s2] interface: OCaml diff --git a/src/Full_CI/EZFIO.cfg b/src/Full_CI/EZFIO.cfg index 89679d1a..37f25eda 100644 --- a/src/Full_CI/EZFIO.cfg +++ b/src/Full_CI/EZFIO.cfg @@ -1,35 +1,3 @@ -[N_det_max_fci] -type: Det_number_max -doc: Max number of determinants in the wave function -interface: input -default: 10000 - -[N_det_max_fci_property] -type: Det_number_max -doc: Max number of determinants in the wave function when you select for a given property -interface: input -default: 10000 - -[do_pt2_end] -type: logical -doc: If true, compute the PT2 at the end of the selection -interface: input -default: True - -[PT2_max] -type: PT2_energy -doc: The selection process stops when the largest PT2 (for all the state) is lower - than pt2_max in absolute value -interface: input -default: 0.0001 - -[var_pt2_ratio] -type: Normalized_float -doc: The selection process stops when the energy ratio variational/(variational+PT2) - is equal to var_pt2_ratio -interface: input -default: 0.75 - [energy] type: double precision doc: Calculated Selected FCI energy diff --git a/src/Full_CI/full_ci.irp.f b/src/Full_CI/full_ci.irp.f index 594cc474..e2a9700e 100644 --- a/src/Full_CI/full_ci.irp.f +++ b/src/Full_CI/full_ci.irp.f @@ -11,12 +11,12 @@ program full_ci pt2 = 1.d0 diag_algorithm = "Lapack" - if (N_det > n_det_max_fci) then + if (N_det > N_det_max) then call diagonalize_CI call save_wavefunction psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_fci + N_det = N_det_max soft_touch N_det psi_det psi_coef call diagonalize_CI call save_wavefunction @@ -38,7 +38,7 @@ program full_ci integer :: n_det_before print*,'Beginning the selection ...' - do while (N_det < n_det_max_fci.and.maxval(abs(pt2(1:N_st))) > pt2_max) + 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) @@ -46,10 +46,10 @@ program full_ci PROVIDE psi_det PROVIDE psi_det_sorted - if (N_det > n_det_max_fci) then + if (N_det > N_det_max) then psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_fci + N_det = N_det_max soft_touch N_det psi_det psi_coef endif call diagonalize_CI @@ -68,7 +68,7 @@ program full_ci exit endif enddo - N_det = min(n_det_max_fci,N_det) + N_det = min(N_det_max,N_det) touch N_det psi_det psi_coef call diagonalize_CI if(do_pt2_end)then diff --git a/src/Full_CI/full_ci_no_skip.irp.f b/src/Full_CI/full_ci_no_skip.irp.f index aa84fb9d..73958bf9 100644 --- a/src/Full_CI/full_ci_no_skip.irp.f +++ b/src/Full_CI/full_ci_no_skip.irp.f @@ -11,12 +11,12 @@ program full_ci pt2 = 1.d0 diag_algorithm = "Lapack" - if (N_det > n_det_max_fci) then + if (N_det > N_det_max) then call diagonalize_CI call save_wavefunction psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_fci + N_det = N_det_max soft_touch N_det psi_det psi_coef call diagonalize_CI call save_wavefunction @@ -38,7 +38,7 @@ program full_ci integer :: n_det_before print*,'Beginning the selection ...' - do while (N_det < n_det_max_fci.and.maxval(abs(pt2(1:N_st))) > pt2_max) + 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) @@ -46,10 +46,10 @@ program full_ci PROVIDE psi_det PROVIDE psi_det_sorted - if (N_det > n_det_max_fci) then + if (N_det > N_det_max) then psi_det = psi_det_sorted psi_coef = psi_coef_sorted - N_det = n_det_max_fci + N_det = N_det_max soft_touch N_det psi_det psi_coef endif call diagonalize_CI @@ -68,7 +68,7 @@ program full_ci exit endif enddo - N_det = min(n_det_max_fci,N_det) + N_det = min(N_det_max,N_det) touch N_det psi_det psi_coef call diagonalize_CI if(do_pt2_end)then diff --git a/src/Perturbation/EZFIO.cfg b/src/Perturbation/EZFIO.cfg new file mode 100644 index 00000000..28629104 --- /dev/null +++ b/src/Perturbation/EZFIO.cfg @@ -0,0 +1,19 @@ +[do_pt2_end] +type: logical +doc: If true, compute the PT2 at the end of the selection +interface: input +default: True + +[PT2_max] +type: PT2_energy +doc: The selection process stops when the largest PT2 (for all the state) is lower + than pt2_max in absolute value +interface: input +default: 0.0001 + +[var_pt2_ratio] +type: Normalized_float +doc: The selection process stops when the energy ratio variational/(variational+PT2) + is equal to var_pt2_ratio +interface: input +default: 0.75 \ No newline at end of file diff --git a/tests/unit_test/unit_test.py b/tests/unit_test/unit_test.py index 7baff4a2..53086de9 100755 --- a/tests/unit_test/unit_test.py +++ b/tests/unit_test/unit_test.py @@ -244,8 +244,8 @@ def run_full_ci_10k_pt2_end(geo, basis, pseudo): ref_energy_var = defaultdict(dict) ref_energy_pt2 = defaultdict(dict) - ref_energy_var["sto-3g"]["methane"] = Energy(-0.398058753535695E+02, None) - ref_energy_pt2["sto-3g"]["methane"] = Energy(-0.398059182483741E+02, None) + ref_energy_var["sto-3g"]["methane"] = Energy(-39.8058687211, None) + ref_energy_pt2["sto-3g"]["methane"] = Energy(-39.8059180427, None) # ~#~#~#~ # # I n i t #