diff --git a/config/ifort.cfg b/config/ifort.cfg index c38d6724..c1d7e968 100644 --- a/config/ifort.cfg +++ b/config/ifort.cfg @@ -31,14 +31,14 @@ OPENMP : 1 ; Append OpenMP flags # -ftz : Flushes denormal results to zero # [OPT] -FCFLAGS : -xHost -O2 -ip -opt-prefetch -ftz -g +FCFLAGS : -xSSE4.2 -O2 -ip -opt-prefetch -ftz -g # Profiling flags ################# # [PROFILE] FC : -p -g -FCFLAGS : -xHost -O2 -ip -opt-prefetch -ftz +FCFLAGS : -xSSE4.2 -O2 -ip -opt-prefetch -ftz # Debugging flags ################# diff --git a/configure b/configure index 0698df12..90f52769 100755 --- a/configure +++ b/configure @@ -17,9 +17,11 @@ Options: who contains a binary, than you can compile then individualy if you want -Example: +Examples: ./configure config/gfortran.cfg --production + ./configure config/ifort.cfg --development + """ diff --git a/ocaml/.gitignore b/ocaml/.gitignore index 20613b5f..cbd77939 100644 --- a/ocaml/.gitignore +++ b/ocaml/.gitignore @@ -38,12 +38,12 @@ qp_print qp_run qp_set_ddci qp_set_mo_class -Input_pseudo.ml -Input_integrals_bielec.ml -Input_hartree_fock.ml -Input_perturbation.ml Input_determinants.ml +Input_hartree_fock.ml +Input_integrals_bielec.ml +Input_perturbation.ml Input_properties.ml +Input_pseudo.ml qp_edit.ml qp_edit qp_edit.native diff --git a/plugins/Alavi/.gitignore b/plugins/Alavi/.gitignore index d4828c6a..e4e1a2ab 100644 --- a/plugins/Alavi/.gitignore +++ b/plugins/Alavi/.gitignore @@ -1,23 +1,23 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files +.ninja_log +AO_Basis +Bitmask Determinants +Electrons +Ezfio_files +IRPF90_man +IRPF90_temp +Integrals_Bielec Integrals_Monoelec MO_Basis -Utils -Pseudo -Bitmask -AO_Basis -Electrons +Makefile +Makefile.depend Nuclei -Integrals_Bielec -alavi_graph \ No newline at end of file +Pseudo +Utils +alavi_graph +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CAS_SD/.gitignore b/plugins/CAS_SD/.gitignore index ff4f60e7..b8827b3b 100644 --- a/plugins/CAS_SD/.gitignore +++ b/plugins/CAS_SD/.gitignore @@ -1,30 +1,30 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +Determinants +Electrons +Ezfio_files +Generators_CAS +Hartree_Fock IRPF90_man -irpf90_entities -tags -irpf90.make +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis Makefile Makefile.depend -.ninja_log -.ninja_deps -ezfio_interface.irp.f -Ezfio_files -Perturbation -Determinants -Utils -Integrals_Monoelec -MO_Basis -Selectors_full -Integrals_Bielec -Pseudo -Bitmask -Generators_CAS -AO_Basis -Electrons -MOGuess Nuclei -Hartree_Fock +Perturbation Properties +Pseudo +Selectors_full +Utils +cas_sd cas_sd_selected -cas_sd \ No newline at end of file +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CAS_SD/H_apply.irp.f b/plugins/CAS_SD/H_apply.irp.f index 85b2f1c6..e2f939fe 100644 --- a/plugins/CAS_SD/H_apply.irp.f +++ b/plugins/CAS_SD/H_apply.irp.f @@ -5,6 +5,12 @@ from generate_h_apply import * s = H_apply("CAS_SD") print s + +s = H_apply("CAS_SD_selected_no_skip") +s.set_selection_pt2("epstein_nesbet_2x2") +s.unset_skip() +print s + s = H_apply("CAS_SD_selected") s.set_selection_pt2("epstein_nesbet_2x2") print s diff --git a/plugins/CAS_SD/README.rst b/plugins/CAS_SD/README.rst index fa513674..82bc3032 100644 --- a/plugins/CAS_SD/README.rst +++ b/plugins/CAS_SD/README.rst @@ -17,52 +17,69 @@ 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 `_ 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_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 `_ 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. -`h_apply_cas_sd_selected_diexc `_ +`h_apply_cas_sd_selected_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_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. + + +`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 `_ + 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 `_ 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/CAS_SD/cas_sd.irp.f b/plugins/CAS_SD/cas_sd.irp.f index 3a7a0fbc..e82adc36 100644 --- a/plugins/CAS_SD/cas_sd.irp.f +++ b/plugins/CAS_SD/cas_sd.irp.f @@ -9,6 +9,7 @@ program full_ci N_st = N_states allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st)) character*(64) :: perturbation + PROVIDE N_det_cas N_det_old = 0 pt2 = 1.d0 @@ -52,7 +53,7 @@ program full_ci print *, 'E = ', CI_energy print *, 'E+PT2 = ', CI_energy+pt2 print *, '-----' - call ezfio_set_cas_sd_energy(CI_energy) + call ezfio_set_cas_sd_energy(CI_energy(1)) if (abort_all) then exit endif @@ -60,16 +61,34 @@ program full_ci exit endif enddo + call diagonalize_CI + + if(do_pt2_end)then + print*,'Last iteration only to compute the PT2' + threshold_selectors = 1.d0 + threshold_generators = 0.999d0 + call H_apply_CAS_SD_PT2(pt2, norm_pert, H_pert_diag, N_st) + + print *, 'Final step' + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print *, 'PT2 = ', pt2 + print *, 'E = ', CI_energy + print *, 'E+PT2 = ', CI_energy+pt2 + print *, '-----' + call ezfio_set_cas_sd_energy_pt2(CI_energy(1)+pt2(1)) + endif + integer :: exc_max, degree_min exc_max = 0 - print *, 'CAS determinants : ', N_det_generators - do i=1,min(N_det_generators,10) - do k=i,N_det_generators - call get_excitation_degree(psi_det_generators(1,1,k),psi_det_generators(1,1,i),degree,N_int) + print *, 'CAS determinants : ', N_det_cas + do i=1,min(N_det_cas,10) + do k=i,N_det_cas + call get_excitation_degree(psi_cas(1,1,k),psi_cas(1,1,i),degree,N_int) exc_max = max(exc_max,degree) enddo - call debug_det(psi_det_generators(1,1,i),N_int) + call debug_det(psi_cas(1,1,i),N_int) print *, '' enddo print *, 'Max excitation degree in the CAS :', exc_max diff --git a/plugins/CAS_SD/tree_dependency.png b/plugins/CAS_SD/tree_dependency.png index 6dd95cc4..d3d98e3c 100644 Binary files a/plugins/CAS_SD/tree_dependency.png and b/plugins/CAS_SD/tree_dependency.png differ diff --git a/plugins/CID/.gitignore b/plugins/CID/.gitignore index 0248d25a..62ef7631 100644 --- a/plugins/CID/.gitignore +++ b/plugins/CID/.gitignore @@ -1,28 +1,28 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -Determinants -Integrals_Monoelec -MO_Basis -Selectors_full -Utils -Pseudo +.ninja_log AO_Basis Bitmask -SingleRefMethod +Determinants Electrons -MOGuess -Nuclei +Ezfio_files Hartree_Fock +IRPF90_man +IRPF90_temp Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis +Makefile +Makefile.depend +Nuclei +Pseudo +Selectors_full +SingleRefMethod +Utils cid -cid_lapack \ No newline at end of file +cid_lapack +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CID_SC2_selected/.gitignore b/plugins/CID_SC2_selected/.gitignore index f0c15969..5761c0d3 100644 --- a/plugins/CID_SC2_selected/.gitignore +++ b/plugins/CID_SC2_selected/.gitignore @@ -1,31 +1,31 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +CID +CID_selected +Determinants +Electrons +Ezfio_files +Hartree_Fock IRPF90_man -irpf90_entities -tags -irpf90.make +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis Makefile Makefile.depend -.ninja_log -.ninja_deps -ezfio_interface.irp.f -Ezfio_files +Nuclei Perturbation -Determinants -Integrals_Monoelec -MO_Basis +Properties +Pseudo Selectors_full SingleRefMethod Utils -CID -Pseudo -Properties -Bitmask -AO_Basis -Electrons -MOGuess -CID_selected -Nuclei -Hartree_Fock -Integrals_Bielec -cid_sc2_selection \ No newline at end of file +cid_sc2_selection +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CID_selected/.gitignore b/plugins/CID_selected/.gitignore index 94b590e5..0da32ffe 100644 --- a/plugins/CID_selected/.gitignore +++ b/plugins/CID_selected/.gitignore @@ -1,30 +1,30 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -Perturbation -Determinants -Utils -Integrals_Monoelec -MO_Basis -Selectors_full -Integrals_Bielec -CID -Pseudo +.ninja_log AO_Basis Bitmask -SingleRefMethod +CID +Determinants Electrons -MOGuess -Nuclei +Ezfio_files Hartree_Fock +IRPF90_man +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis +Makefile +Makefile.depend +Nuclei +Perturbation Properties -cid_selection \ No newline at end of file +Pseudo +Selectors_full +SingleRefMethod +Utils +cid_selection +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CIS/.gitignore b/plugins/CIS/.gitignore index cdcd6fbb..9b9257d3 100644 --- a/plugins/CIS/.gitignore +++ b/plugins/CIS/.gitignore @@ -1,28 +1,28 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -Determinants -Integrals_Monoelec -MO_Basis -Selectors_full -Utils -Pseudo +.ninja_log AO_Basis Bitmask -SingleRefMethod +Determinants Electrons -MOGuess -Nuclei +Ezfio_files Hartree_Fock +IRPF90_man +IRPF90_temp Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis +Makefile +Makefile.depend +Nuclei +Pseudo +Selectors_full +SingleRefMethod +Utils +cis +ezfio_interface.irp.f +irpf90.make +irpf90_entities super_ci -cis \ No newline at end of file +tags \ No newline at end of file diff --git a/plugins/CISD/.gitignore b/plugins/CISD/.gitignore index 8bafe2d7..5c7aee18 100644 --- a/plugins/CISD/.gitignore +++ b/plugins/CISD/.gitignore @@ -1,28 +1,28 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -Determinants -Integrals_Monoelec -MO_Basis -Selectors_full -Utils -Pseudo +.ninja_log AO_Basis Bitmask -SingleRefMethod +Determinants Electrons -MOGuess -Nuclei +Ezfio_files Hartree_Fock +IRPF90_man +IRPF90_temp Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis +Makefile +Makefile.depend +Nuclei +Pseudo +Selectors_full +SingleRefMethod +Utils +cisd cisd_lapack -cisd \ No newline at end of file +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CISD/tree_dependency.png b/plugins/CISD/tree_dependency.png index fe371494..63daa410 100644 Binary files a/plugins/CISD/tree_dependency.png and b/plugins/CISD/tree_dependency.png differ diff --git a/plugins/CISD_SC2_selected/.gitignore b/plugins/CISD_SC2_selected/.gitignore index aac63ca8..2f0e8bdd 100644 --- a/plugins/CISD_SC2_selected/.gitignore +++ b/plugins/CISD_SC2_selected/.gitignore @@ -1,31 +1,31 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +CISD +CISD_selected +Determinants +Electrons +Ezfio_files +Hartree_Fock IRPF90_man -irpf90_entities -tags -irpf90.make +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis Makefile Makefile.depend -.ninja_log -.ninja_deps -ezfio_interface.irp.f -Ezfio_files +Nuclei Perturbation -Determinants -Integrals_Monoelec -MO_Basis +Properties +Pseudo Selectors_full SingleRefMethod Utils -Pseudo -Properties -Bitmask -AO_Basis -Electrons -CISD_selected -MOGuess -CISD -Nuclei -Hartree_Fock -Integrals_Bielec -cisd_sc2_selection \ No newline at end of file +cisd_sc2_selection +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CISD_SC2_selected/tree_dependency.png b/plugins/CISD_SC2_selected/tree_dependency.png index a887b29a..05b0b67b 100644 Binary files a/plugins/CISD_SC2_selected/tree_dependency.png and b/plugins/CISD_SC2_selected/tree_dependency.png differ diff --git a/plugins/CISD_selected/.gitignore b/plugins/CISD_selected/.gitignore index 32bcf7de..e9803984 100644 --- a/plugins/CISD_selected/.gitignore +++ b/plugins/CISD_selected/.gitignore @@ -1,30 +1,30 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -Perturbation -Determinants -Utils -Integrals_Monoelec -MO_Basis -Selectors_full -Integrals_Bielec -Pseudo +.ninja_log AO_Basis Bitmask -SingleRefMethod -Electrons -MOGuess CISD -Nuclei +Determinants +Electrons +Ezfio_files Hartree_Fock +IRPF90_man +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis +Makefile +Makefile.depend +Nuclei +Perturbation Properties -cisd_selection \ No newline at end of file +Pseudo +Selectors_full +SingleRefMethod +Utils +cisd_selection +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/CISD_selected/tree_dependency.png b/plugins/CISD_selected/tree_dependency.png index 48e215dd..9e582bae 100644 Binary files a/plugins/CISD_selected/tree_dependency.png and b/plugins/CISD_selected/tree_dependency.png differ diff --git a/plugins/Casino/.gitignore b/plugins/Casino/.gitignore index acf88165..14f48469 100644 --- a/plugins/Casino/.gitignore +++ b/plugins/Casino/.gitignore @@ -1,23 +1,23 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files +.ninja_log +AO_Basis +Bitmask Determinants +Electrons +Ezfio_files +IRPF90_man +IRPF90_temp +Integrals_Bielec Integrals_Monoelec MO_Basis -Utils -Pseudo -Bitmask -AO_Basis -Electrons +Makefile +Makefile.depend Nuclei -Integrals_Bielec -save_for_casino \ No newline at end of file +Pseudo +Utils +ezfio_interface.irp.f +irpf90.make +irpf90_entities +save_for_casino +tags \ No newline at end of file diff --git a/plugins/DDCI_selected/.gitignore b/plugins/DDCI_selected/.gitignore index 2240335e..d114cb7b 100644 --- a/plugins/DDCI_selected/.gitignore +++ b/plugins/DDCI_selected/.gitignore @@ -1,29 +1,29 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +Determinants +Electrons +Ezfio_files +Generators_CAS +Hartree_Fock IRPF90_man -irpf90_entities -tags -irpf90.make +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis Makefile Makefile.depend -.ninja_log -.ninja_deps -ezfio_interface.irp.f -Ezfio_files -Perturbation -Determinants -Utils -Integrals_Monoelec -MO_Basis -Selectors_full -Integrals_Bielec -Pseudo -Bitmask -Generators_CAS -AO_Basis -Electrons -MOGuess Nuclei -Hartree_Fock +Perturbation Properties -ddci \ No newline at end of file +Pseudo +Selectors_full +Utils +ddci +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/DDCI_selected/tree_dependency.png b/plugins/DDCI_selected/tree_dependency.png index 6cfc1811..10780cb1 100644 Binary files a/plugins/DDCI_selected/tree_dependency.png and b/plugins/DDCI_selected/tree_dependency.png differ diff --git a/plugins/Full_CI/.gitignore b/plugins/Full_CI/.gitignore index 57302ebb..a806bcbc 100644 --- a/plugins/Full_CI/.gitignore +++ b/plugins/Full_CI/.gitignore @@ -1,32 +1,32 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +Determinants +Electrons +Ezfio_files +Generators_full +Hartree_Fock IRPF90_man -irpf90_entities -tags -irpf90.make +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis Makefile Makefile.depend -.ninja_log -.ninja_deps -ezfio_interface.irp.f -Ezfio_files -Perturbation -Determinants -Utils -Integrals_Monoelec -MO_Basis -Selectors_full -Integrals_Bielec -Pseudo -Generators_full -Bitmask -AO_Basis -Electrons -MOGuess Nuclei -Hartree_Fock +Perturbation Properties -target_pt2 +Pseudo +Selectors_full +Utils +ezfio_interface.irp.f full_ci -var_pt2_ratio -full_ci_no_skip \ No newline at end of file +full_ci_no_skip +irpf90.make +irpf90_entities +tags +target_pt2 +var_pt2_ratio \ No newline at end of file diff --git a/plugins/Full_CI/tree_dependency.png b/plugins/Full_CI/tree_dependency.png index d9ccb24f..ad7dcd84 100644 Binary files a/plugins/Full_CI/tree_dependency.png and b/plugins/Full_CI/tree_dependency.png differ diff --git a/plugins/Generators_CAS/tree_dependency.png b/plugins/Generators_CAS/tree_dependency.png new file mode 100644 index 00000000..7f32349e Binary files /dev/null and b/plugins/Generators_CAS/tree_dependency.png differ diff --git a/plugins/Generators_full/README.rst b/plugins/Generators_full/README.rst index a4bdadf8..dc6965e8 100644 --- a/plugins/Generators_full/README.rst +++ b/plugins/Generators_full/README.rst @@ -43,7 +43,7 @@ Needed Modules .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -.. image:: tree_dependency.pdf +.. image:: tree_dependency.png * `Determinants `_ * `Hartree_Fock `_ diff --git a/plugins/Generators_full/tree_dependency.png b/plugins/Generators_full/tree_dependency.png new file mode 100644 index 00000000..c2656d20 Binary files /dev/null and b/plugins/Generators_full/tree_dependency.png differ diff --git a/plugins/Hartree_Fock/.gitignore b/plugins/Hartree_Fock/.gitignore index dbafb30b..c44ada99 100644 --- a/plugins/Hartree_Fock/.gitignore +++ b/plugins/Hartree_Fock/.gitignore @@ -1,24 +1,24 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +Electrons +Ezfio_files +Huckel_guess IRPF90_man -irpf90_entities -tags -irpf90.make +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis Makefile Makefile.depend -.ninja_log -.ninja_deps -ezfio_interface.irp.f -Ezfio_files -Integrals_Monoelec -MO_Basis -Integrals_Bielec -Pseudo -Bitmask -AO_Basis -Electrons -MOGuess Nuclei +Pseudo +SCF Utils -Huckel_guess -SCF \ No newline at end of file +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/Hartree_Fock/tree_dependency.png b/plugins/Hartree_Fock/tree_dependency.png index e4708d5f..8a43fb0d 100644 Binary files a/plugins/Hartree_Fock/tree_dependency.png and b/plugins/Hartree_Fock/tree_dependency.png differ diff --git a/plugins/MP2/.gitignore b/plugins/MP2/.gitignore index 4d7ba949..228b1c9d 100644 --- a/plugins/MP2/.gitignore +++ b/plugins/MP2/.gitignore @@ -1,29 +1,29 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -Perturbation -Determinants -Utils -Integrals_Monoelec -MO_Basis -Selectors_full -Integrals_Bielec -Pseudo +.ninja_log AO_Basis Bitmask -SingleRefMethod +Determinants Electrons -MOGuess -Nuclei +Ezfio_files Hartree_Fock +IRPF90_man +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis +Makefile +Makefile.depend +Nuclei +Perturbation Properties -mp2 \ No newline at end of file +Pseudo +Selectors_full +SingleRefMethod +Utils +ezfio_interface.irp.f +irpf90.make +irpf90_entities +mp2 +tags \ No newline at end of file diff --git a/plugins/MRCC/.gitignore b/plugins/MRCC/.gitignore index b36a38a1..48b27784 100644 --- a/plugins/MRCC/.gitignore +++ b/plugins/MRCC/.gitignore @@ -1,29 +1,29 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +Determinants +Electrons +Ezfio_files +Generators_full +Hartree_Fock IRPF90_man -irpf90_entities -tags -irpf90.make +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis Makefile Makefile.depend -.ninja_log -.ninja_deps -ezfio_interface.irp.f -Ezfio_files -Perturbation -Determinants -Utils -Integrals_Monoelec -MO_Basis -Selectors_full -Integrals_Bielec -Pseudo -Generators_full -Bitmask -AO_Basis -Electrons -MOGuess Nuclei -Hartree_Fock +Perturbation Properties -mrcc \ No newline at end of file +Pseudo +Selectors_full +Utils +ezfio_interface.irp.f +irpf90.make +irpf90_entities +mrcc +tags \ No newline at end of file diff --git a/plugins/MRCC/H_apply.irp.f b/plugins/MRCC/H_apply.irp.f index cadaca32..7e479529 100644 --- a/plugins/MRCC/H_apply.irp.f +++ b/plugins/MRCC/H_apply.irp.f @@ -2,18 +2,20 @@ use bitmasks BEGIN_SHELL [ /usr/bin/env python ] from generate_h_apply import * -s = H_apply("mrcc_simple") -s.data["parameters"] = ", delta_ij_sd_, Ndet_sd" +s = H_apply("mrcc") +s.data["parameters"] = ", delta_ij_, delta_ii_,Ndet_cas, Ndet_non_cas" s.data["declarations"] += """ - integer, intent(in) :: Ndet_sd - double precision, intent(in) :: delta_ij_sd_(Ndet_sd,Ndet_sd,*) + integer, intent(in) :: Ndet_cas,Ndet_non_cas + double precision, intent(in) :: delta_ij_(Ndet_cas,Ndet_non_cas,*) + double precision, intent(in) :: delta_ii_(Ndet_cas,*) """ -s.data["keys_work"] = "call mrcc_dress_simple(delta_ij_sd_,Ndet_sd,i_generator,key_idx,keys_out,N_int,iproc)" -s.data["params_post"] += ", delta_ij_sd_, Ndet_sd" -s.data["params_main"] += "delta_ij_sd_, Ndet_sd" +s.data["keys_work"] = "call mrcc_dress(delta_ij_,delta_ii_,Ndet_cas,Ndet_non_cas,i_generator,key_idx,keys_out,N_int,iproc)" +s.data["params_post"] += ", delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas" +s.data["params_main"] += "delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas" s.data["decls_main"] += """ - integer, intent(in) :: Ndet_sd - double precision, intent(in) :: delta_ij_sd_(Ndet_sd,Ndet_sd,*) + integer, intent(in) :: Ndet_cas,Ndet_non_cas + double precision, intent(in) :: delta_ij_(Ndet_cas,Ndet_non_cas,*) + double precision, intent(in) :: delta_ii_(Ndet_cas,*) """ s.data["finalization"] = "" s.data["copy_buffer"] = "" @@ -22,11 +24,5 @@ s.data["size_max"] = "3072" print s - - -s.data["subroutine"] = "H_apply_mrcc" -s.data["keys_work"] = "call mrcc_dress(delta_ij_sd_,Ndet_sd,i_generator,key_idx,keys_out,N_int,iproc)" -print s - END_SHELL diff --git a/plugins/MRCC/README.rst b/plugins/MRCC/README.rst index b80aeb7f..b1a74ccc 100644 --- a/plugins/MRCC/README.rst +++ b/plugins/MRCC/README.rst @@ -20,23 +20,23 @@ Documentation .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -`ci_eigenvectors_dressed `_ +`ci_eigenvectors_dressed `_ Eigenvectors/values of the CI matrix -`ci_eigenvectors_s2_dressed `_ +`ci_eigenvectors_s2_dressed `_ Eigenvectors/values of the CI matrix -`ci_electronic_energy_dressed `_ +`ci_electronic_energy_dressed `_ Eigenvectors/values of the CI matrix -`ci_energy_dressed `_ +`ci_energy_dressed `_ N_states lowest eigenvalues of the dressed CI matrix -`davidson_diag_hjj_mrcc `_ +`davidson_diag_hjj_mrcc `_ Davidson diagonalization with specific diagonal elements of the H matrix .br H_jj : specific diagonal H matrix elements to diagonalize de Davidson @@ -76,66 +76,45 @@ Documentation Initial guess vectors are not necessarily orthonormal -`delta_ij `_ +`delta_ii `_ Dressing matrix in N_det basis -`delta_ij_non_cas `_ - Dressing matrix in SD basis +`delta_ij `_ + Dressing matrix in N_det basis -`diagonalize_ci_dressed `_ +`diagonalize_ci_dressed `_ Replace the coefficients of the CI states by the coefficients of the eigenstates of the CI matrix -`dressing_type `_ - [ Simple | MRCC ] - - `find_triples_and_quadruples `_ Undocumented -`h_apply_mrcc `_ +`h_apply_mrcc `_ 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_mrcc_diexc `_ +`h_apply_mrcc_diexc `_ Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_mrcc_monoexc `_ +`h_apply_mrcc_monoexc `_ Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -`h_apply_mrcc_simple `_ - 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_mrcc_simple_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_mrcc_simple_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_matrix_dressed `_ +`h_matrix_dressed `_ Dressed H with Delta_ij -`h_u_0_mrcc `_ +`h_u_0_mrcc `_ Computes v_0 = H|u_0> .br n : number of determinants diff --git a/plugins/MRCC/davidson.irp.f b/plugins/MRCC/davidson.irp.f index 57900082..588e1831 100644 --- a/plugins/MRCC/davidson.irp.f +++ b/plugins/MRCC/davidson.irp.f @@ -35,11 +35,16 @@ subroutine davidson_diag_mrcc(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit,i allocate(H_jj(sze)) !$OMP PARALLEL DEFAULT(NONE) & - !$OMP SHARED(sze,H_jj,dets_in,Nint,istate,delta_ij) & + !$OMP SHARED(sze,H_jj,N_det_cas,dets_in,Nint,istate,delta_ii,idx_cas) & !$OMP PRIVATE(i) !$OMP DO SCHEDULE(guided) do i=1,sze - H_jj(i) = diag_h_mat_elem(dets_in(1,1,i),Nint) + delta_ij(i,i,istate) + H_jj(i) = diag_h_mat_elem(dets_in(1,1,i),Nint) + enddo + !$OMP END DO + !$OMP DO SCHEDULE(guided) + do i=1,N_det_cas + H_jj(idx_cas(i)) += delta_ii(i,istate) enddo !$OMP END DO !$OMP END PARALLEL @@ -370,16 +375,16 @@ subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate) integer, allocatable :: idx(:) double precision :: hij double precision, allocatable :: vt(:) - integer :: i,j,k,l, jj + integer :: i,j,k,l, jj,ii integer :: i0, j0 ASSERT (Nint > 0) ASSERT (Nint == N_int) ASSERT (n>0) - PROVIDE ref_bitmask_energy delta_ij + PROVIDE ref_bitmask_energy delta_ij integer, parameter :: block_size = 157 !$OMP PARALLEL DEFAULT(NONE) & - !$OMP PRIVATE(i,hij,j,k,idx,jj,vt) & - !$OMP SHARED(n,H_jj,u_0,keys_tmp,Nint,v_0,istate,delta_ij) + !$OMP PRIVATE(i,hij,j,k,idx,jj,ii,vt) & + !$OMP SHARED(n_det_cas,n_det_non_cas,idx_cas,idx_non_cas,n,H_jj,u_0,keys_tmp,Nint,v_0,istate,delta_ij) !$OMP DO SCHEDULE(static) do i=1,n v_0(i) = H_jj(i) * u_0(i) @@ -389,20 +394,30 @@ subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate) Vt = 0.d0 !$OMP DO SCHEDULE(guided) do i=1,n -! idx(0) = i -! call filter_connected_davidson(keys_tmp,keys_tmp(1,1,i),Nint,i-1,idx) -! do jj=1,idx(0) -! j = idx(jj) + idx(0) = i + call filter_connected_davidson(keys_tmp,keys_tmp(1,1,i),Nint,i-1,idx) + do jj=1,idx(0) + j = idx(jj) ! if ( (dabs(u_0(j)) > 1.d-7).or.((dabs(u_0(i)) > 1.d-7)) ) then - do j = 1, i-1 call i_H_j(keys_tmp(1,1,j),keys_tmp(1,1,i),Nint,hij) - hij = hij + delta_ij(j,i,istate) + hij = hij vt (i) = vt (i) + hij*u_0(j) vt (j) = vt (j) + hij*u_0(i) ! endif enddo enddo !$OMP END DO + + !$OMP DO SCHEDULE(guided) + do ii=1,n_det_cas + i = idx_cas(ii) + do jj = 1, n_det_non_cas + j = idx_non_cas(jj) + vt (i) = vt (i) + delta_ij(ii,jj,istate)*u_0(j) + vt (j) = vt (j) + delta_ij(ii,jj,istate)*u_0(i) + enddo + enddo + !$OMP END DO !$OMP CRITICAL do i=1,n v_0(i) = v_0(i) + vt(i) diff --git a/plugins/MRCC/mrcc_dress.irp.f b/plugins/MRCC/mrcc_dress.irp.f index 23c15d13..53f94f5b 100644 --- a/plugins/MRCC/mrcc_dress.irp.f +++ b/plugins/MRCC/mrcc_dress.irp.f @@ -12,13 +12,14 @@ BEGIN_PROVIDER [ integer(omp_lock_kind), psi_cas_lock, (psi_det_size) ] END_PROVIDER -subroutine mrcc_dress(delta_ij_,Ndet,i_generator,n_selected,det_buffer,Nint,iproc) +subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas,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 - double precision, intent(inout) :: delta_ij_(Ndet,Ndet,*) + integer, intent(in) :: Ndet_cas, Ndet_non_cas + double precision, intent(inout) :: delta_ij_(Ndet_cas,Ndet_non_cas,*) + double precision, intent(inout) :: delta_ii_(Ndet_cas,*) integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected) integer :: i,j,k,l @@ -42,7 +43,7 @@ subroutine mrcc_dress(delta_ij_,Ndet,i_generator,n_selected,det_buffer,Nint,ipro call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq) - allocate (dIa_hla(N_states,Ndet)) + allocate (dIa_hla(N_states,Ndet_non_cas)) ! |I> @@ -136,12 +137,11 @@ subroutine mrcc_dress(delta_ij_,Ndet,i_generator,n_selected,det_buffer,Nint,ipro do l_sd=1,idx_alpha(0) k_sd = idx_alpha(l_sd) do i_state=1,N_states - delta_ij_(idx_non_cas(k_sd),idx_cas(i_I),i_state) += dIa_hla(i_state,k_sd) - delta_ij_(idx_cas(i_I),idx_non_cas(k_sd),i_state) += dIa_hla(i_state,k_sd) + delta_ij_(i_I,k_sd,i_state) += dIa_hla(i_state,k_sd) if(dabs(psi_cas_coef(i_I,i_state)).ge.5.d-5)then - delta_ij_(idx_cas(i_I),idx_cas(i_I),i_state) -= dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_cas_coef(k_sd,i_state) + delta_ii_(i_I,i_state) -= dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_cas_coef(k_sd,i_state) else - delta_ij_(idx_cas(i_I),idx_cas(i_I),i_state) = 0.d0 + delta_ii_(i_I,i_state) = 0.d0 endif enddo enddo diff --git a/plugins/MRCC/mrcc_utils.irp.f b/plugins/MRCC/mrcc_utils.irp.f index 02147ba1..6ae0926c 100644 --- a/plugins/MRCC/mrcc_utils.irp.f +++ b/plugins/MRCC/mrcc_utils.irp.f @@ -5,20 +5,19 @@ ! cm/ or perturbative 1/Delta_E(m) END_DOC integer :: i,k - double precision :: ihpsi(N_states), hii - -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 :: ihpsi(N_states), hii + + 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) call i_h_j(psi_non_cas(1,1,i),psi_non_cas(1,1,i),N_int,hii) do k=1,N_states - - lambda_pert(k,i) = 1.d0 / (psi_cas_energy_diagonalized(k)-hii) - lambda_mrcc(k,i) = psi_non_cas_coef(i,k)/ihpsi(k) - if (dabs(ihpsi(k)).le.1.d-3) then - lambda_mrcc(k,i) = 1.d0 / (psi_cas_energy_diagonalized(k)-hii) - cycle - endif + lambda_pert(k,i) = 1.d0 / (psi_cas_energy_diagonalized(k)-hii) + if (dabs(ihpsi(k)).le.1.d-3) then + lambda_mrcc(k,i) = lambda_pert(k,i) + else + lambda_mrcc(k,i) = psi_non_cas_coef(i,k)/ihpsi(k) + endif enddo enddo @@ -27,134 +26,117 @@ END_PROVIDER +!BEGIN_PROVIDER [ double precision, delta_ij_non_cas, (N_det_non_cas, N_det_non_cas,N_states) ] +!implicit none +!BEGIN_DOC +!! Dressing matrix in SD basis +!END_DOC +!delta_ij_non_cas = 0.d0 +!call H_apply_mrcc_simple(delta_ij_non_cas,N_det_non_cas) +!END_PROVIDER -BEGIN_PROVIDER [ character*(32), dressing_type ] - implicit none - BEGIN_DOC - ! [ Simple | MRCC ] - END_DOC - dressing_type = "MRCC" -END_PROVIDER - -BEGIN_PROVIDER [ double precision, delta_ij_non_cas, (N_det_non_cas, N_det_non_cas,N_states) ] - implicit none - BEGIN_DOC - ! Dressing matrix in SD basis - END_DOC - delta_ij_non_cas = 0.d0 - call H_apply_mrcc_simple(delta_ij_non_cas,N_det_non_cas) -END_PROVIDER - -BEGIN_PROVIDER [ double precision, delta_ij, (N_det,N_det,N_states) ] + BEGIN_PROVIDER [ double precision, delta_ij, (N_det_cas,N_det_non_cas,N_states) ] +&BEGIN_PROVIDER [ double precision, delta_ii, (N_det_cas,N_states) ] implicit none BEGIN_DOC ! Dressing matrix in N_det basis END_DOC integer :: i,j,m delta_ij = 0.d0 - if (dressing_type == "MRCC") then - call H_apply_mrcc(delta_ij,N_det) - else if (dressing_type == "Simple") then - do m=1,N_states - do j=1,N_det_non_cas - do i=1,N_det_non_cas - delta_ij(idx_non_cas(i),idx_non_cas(j),m) = delta_ij_non_cas(i,j,m) - enddo - enddo - enddo - endif - do i = 1, N_det - do j = 1, N_det - do m = 1, N_states - if(isnan(delta_ij(j,i,m)))then - delta_ij(j,i,m) = 0.d0 - endif - enddo - enddo - enddo - + delta_ii = 0.d0 + call H_apply_mrcc(delta_ij,delta_ii,N_det_cas,N_det_non_cas) END_PROVIDER -BEGIN_PROVIDER [ double precision, h_matrix_dressed, (N_det,N_det) ] +BEGIN_PROVIDER [ double precision, h_matrix_dressed, (N_det,N_det,N_states) ] implicit none BEGIN_DOC ! Dressed H with Delta_ij END_DOC - integer :: i, j - do j=1,N_det - do i=1,N_det - h_matrix_dressed(i,j) = h_matrix_all_dets(i,j) + delta_ij(i,j,1) + integer :: i, j,istate,ii,jj + do istate = 1,N_states + do j=1,N_det + do i=1,N_det + h_matrix_dressed(i,j,istate) = h_matrix_all_dets(i,j) + enddo enddo + do ii = 1, N_det_cas + i =idx_cas(ii) + h_matrix_dressed(i,i,istate) += delta_ii(ii,istate) + do jj = 1, N_det_non_cas + j =idx_cas(jj) + h_matrix_dressed(i,j,istate) += delta_ij(ii,jj,istate) + h_matrix_dressed(j,i,istate) += delta_ij(ii,jj,istate) + enddo + enddo enddo - END_PROVIDER BEGIN_PROVIDER [ double precision, CI_electronic_energy_dressed, (N_states_diag) ] &BEGIN_PROVIDER [ double precision, CI_eigenvectors_dressed, (N_det,N_states_diag) ] &BEGIN_PROVIDER [ double precision, CI_eigenvectors_s2_dressed, (N_states_diag) ] - implicit none - BEGIN_DOC - ! Eigenvectors/values of the CI matrix - END_DOC - integer :: i,j - - do j=1,N_states_diag - do i=1,N_det - CI_eigenvectors_dressed(i,j) = psi_coef(i,j) - enddo - enddo - - if (diag_algorithm == "Davidson") then - - integer :: istate - istate = 1 - 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,istate) - - else if (diag_algorithm == "Lapack") then - - double precision, allocatable :: eigenvectors(:,:), eigenvalues(:) - allocate (eigenvectors(size(H_matrix_dressed,1),N_det)) - allocate (eigenvalues(N_det)) - call lapack_diag(eigenvalues,eigenvectors, & - H_matrix_dressed,size(H_matrix_dressed,1),N_det) - CI_electronic_energy_dressed(:) = 0.d0 - do i=1,N_det + implicit none + BEGIN_DOC + ! Eigenvectors/values of the CI matrix + END_DOC + integer :: i,j + + do j=1,N_states_diag + do i=1,N_det + CI_eigenvectors_dressed(i,j) = psi_coef(i,j) + enddo + enddo + + if (diag_algorithm == "Davidson") then + + integer :: istate + istate = 1 + 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,istate) + + else if (diag_algorithm == "Lapack") then + + double precision, allocatable :: eigenvectors(:,:), eigenvalues(:) + allocate (eigenvectors(size(H_matrix_dressed,1),N_det)) + allocate (eigenvalues(N_det)) + call lapack_diag(eigenvalues,eigenvectors, & + H_matrix_dressed,size(H_matrix_dressed,1),N_det) + CI_electronic_energy_dressed(:) = 0.d0 + do i=1,N_det CI_eigenvectors_dressed(i,1) = eigenvectors(i,1) - enddo - integer :: i_state - double precision :: s2 - i_state = 0 - if (s2_eig) then - do j=1,N_det - call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2) - if(dabs(s2-expected_s2).le.0.3d0)then - i_state += 1 - do i=1,N_det - CI_eigenvectors_dressed(i,i_state) = eigenvectors(i,j) - enddo - CI_electronic_energy_dressed(i_state) = eigenvalues(j) - CI_eigenvectors_s2_dressed(i_state) = s2 - endif - if (i_state.ge.N_states_diag) then - exit - endif - enddo - else - do j=1,N_states_diag - call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2) - i_state += 1 - do i=1,N_det - CI_eigenvectors_dressed(i,i_state) = eigenvectors(i,j) - enddo - CI_electronic_energy_dressed(i_state) = eigenvalues(j) - CI_eigenvectors_s2_dressed(i_state) = s2 - enddo - endif - deallocate(eigenvectors,eigenvalues) - endif - + enddo + integer :: i_state + double precision :: s2 + i_state = 0 + if (s2_eig) then + do j=1,N_det + call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2) + if(dabs(s2-expected_s2).le.0.3d0)then + i_state += 1 + do i=1,N_det + CI_eigenvectors_dressed(i,i_state) = eigenvectors(i,j) + enddo + CI_electronic_energy_dressed(i_state) = eigenvalues(j) + CI_eigenvectors_s2_dressed(i_state) = s2 + endif + if (i_state.ge.N_states_diag) then + exit + endif + enddo + else + do j=1,N_states_diag + call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2) + i_state += 1 + do i=1,N_det + CI_eigenvectors_dressed(i,i_state) = eigenvectors(i,j) + enddo + CI_electronic_energy_dressed(i_state) = eigenvalues(j) + CI_eigenvectors_s2_dressed(i_state) = s2 + enddo + endif + deallocate(eigenvectors,eigenvalues) + endif + END_PROVIDER BEGIN_PROVIDER [ double precision, CI_energy_dressed, (N_states_diag) ] diff --git a/plugins/MRCC/tree_dependency.png b/plugins/MRCC/tree_dependency.png index 87293361..db540bc5 100644 Binary files a/plugins/MRCC/tree_dependency.png and b/plugins/MRCC/tree_dependency.png differ diff --git a/plugins/Molden/.gitignore b/plugins/Molden/.gitignore index 0bc5ada9..95cab459 100644 --- a/plugins/Molden/.gitignore +++ b/plugins/Molden/.gitignore @@ -1,4 +1,4 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py +# Automatically created by /home/giner/quantum_package/scripts/module/module_handler.py IRPF90_temp IRPF90_man irpf90_entities @@ -15,4 +15,4 @@ Utils AO_Basis Electrons Nuclei -print_mo \ No newline at end of file +print_mo diff --git a/plugins/Molden/tree_dependency.png b/plugins/Molden/tree_dependency.png index 2b9ffd86..0216e589 100644 Binary files a/plugins/Molden/tree_dependency.png and b/plugins/Molden/tree_dependency.png differ diff --git a/plugins/Perturbation/README.rst b/plugins/Perturbation/README.rst index 51348ae6..9162e94b 100644 --- a/plugins/Perturbation/README.rst +++ b/plugins/Perturbation/README.rst @@ -356,7 +356,7 @@ Needed Modules .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -.. image:: tree_dependency.pdf +.. image:: tree_dependency.png * `Properties `_ * `Hartree_Fock `_ diff --git a/plugins/Perturbation/tree_dependency.png b/plugins/Perturbation/tree_dependency.png new file mode 100644 index 00000000..1b361288 Binary files /dev/null and b/plugins/Perturbation/tree_dependency.png differ diff --git a/plugins/Properties/README.rst b/plugins/Properties/README.rst index a303da3a..5e5ab1cc 100644 --- a/plugins/Properties/README.rst +++ b/plugins/Properties/README.rst @@ -148,7 +148,7 @@ Needed Modules .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -.. image:: tree_dependency.pdf +.. image:: tree_dependency.png * `Determinants `_ diff --git a/plugins/Properties/tree_dependency.png b/plugins/Properties/tree_dependency.png new file mode 100644 index 00000000..680a08ee Binary files /dev/null and b/plugins/Properties/tree_dependency.png differ diff --git a/plugins/QmcChem/.gitignore b/plugins/QmcChem/.gitignore index 4abda663..6ed62124 100644 --- a/plugins/QmcChem/.gitignore +++ b/plugins/QmcChem/.gitignore @@ -1,23 +1,23 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files +.ninja_log +AO_Basis +Bitmask Determinants +Electrons +Ezfio_files +IRPF90_man +IRPF90_temp +Integrals_Bielec Integrals_Monoelec MO_Basis -Utils -Pseudo -Bitmask -AO_Basis -Electrons +Makefile +Makefile.depend Nuclei -Integrals_Bielec -save_for_qmcchem \ No newline at end of file +Pseudo +Utils +ezfio_interface.irp.f +irpf90.make +irpf90_entities +save_for_qmcchem +tags diff --git a/plugins/Selectors_full/README.rst b/plugins/Selectors_full/README.rst index 14c8a96c..33cbaf16 100644 --- a/plugins/Selectors_full/README.rst +++ b/plugins/Selectors_full/README.rst @@ -181,7 +181,7 @@ Needed Modules .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -.. image:: tree_dependency.pdf +.. image:: tree_dependency.png * `Determinants `_ * `Hartree_Fock `_ diff --git a/plugins/Selectors_full/tree_dependency.png b/plugins/Selectors_full/tree_dependency.png new file mode 100644 index 00000000..b6378b39 Binary files /dev/null and b/plugins/Selectors_full/tree_dependency.png differ diff --git a/plugins/SingleRefMethod/tree_dependency.png b/plugins/SingleRefMethod/tree_dependency.png new file mode 100644 index 00000000..74fe5cca Binary files /dev/null and b/plugins/SingleRefMethod/tree_dependency.png differ diff --git a/plugins/loc_cele/.gitignore b/plugins/loc_cele/.gitignore index 06066a28..6c8b96df 100644 --- a/plugins/loc_cele/.gitignore +++ b/plugins/loc_cele/.gitignore @@ -1,18 +1,18 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -MO_Basis -Utils +.ninja_log AO_Basis Electrons +Ezfio_files +IRPF90_man +IRPF90_temp +MO_Basis +Makefile +Makefile.depend Nuclei -loc_cele \ No newline at end of file +Utils +ezfio_interface.irp.f +irpf90.make +irpf90_entities +loc_cele +tags \ No newline at end of file diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index a743e591..a1cd7dad 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -29,6 +29,16 @@ Error: """ % f sys.exit(1) +# __ +# /__ | _ |_ _. | _. ._ o _. |_ | _ _ +# \_| | (_) |_) (_| | \/ (_| | | (_| |_) | (/_ _> +# + +from qp_path import QP_ROOT, QP_SRC, QP_EZFIO + +EZFIO_LIB = join(QP_ROOT, "lib", "libezfio.a") +ROOT_BUILD_NINJA = join(QP_ROOT, "config", "build.ninja") + header = r"""# # _______ _____ # __ __ \___ _______ _________ /____ ________ ___ @@ -48,17 +58,8 @@ header = r"""# # Generated automatically by {0} # # -""".format(__file__) +""".format(__file__).replace(QP_ROOT,"$QP_ROOT") -# __ -# /__ | _ |_ _. | _. ._ o _. |_ | _ _ -# \_| | (_) |_) (_| | \/ (_| | | (_| |_) | (/_ _> -# - -from qp_path import QP_ROOT, QP_SRC, QP_EZFIO - -EZFIO_LIB = join(QP_ROOT, "lib", "libezfio.a") -ROOT_BUILD_NINJA = join(QP_ROOT, "config", "build.ninja") # # |\ | _. ._ _ _ _| _|_ ._ | _ @@ -896,10 +897,10 @@ if __name__ == "__main__": "Is intolerable !", "You need a main file:", "- Create it in {0}", - "- Or delete {0} `qp_install_module.py uninstall {0}`" + "- Or delete {0} `qp_install_module.py uninstall {0}`", "- Or install a module who need {0} with a main "] - print "\n".join(l_msg).format(module) + print "\n".join(l_msg).format(module.rel) sys.exit(1) # ~#~#~#~#~#~#~#~#~#~#~#~ # diff --git a/scripts/module/create_gitignore.sh b/scripts/module/create_gitignore.sh index dde75e70..cf86ee39 100755 --- a/scripts/module/create_gitignore.sh +++ b/scripts/module/create_gitignore.sh @@ -21,15 +21,15 @@ function do_gitingore() # Do not modify this file. Add your ignored files to the gitignore # (without the dot at the beginning) file. # -IRPF90_temp -IRPF90_man -irpf90.make -tags -Makefile.depend -irpf90_entities build.ninja -.ninja_log +irpf90_entities +irpf90.make +IRPF90_man +IRPF90_temp +Makefile.depend .ninja_deps +.ninja_log +tags EOF if [[ -f gitignore ]] @@ -59,3 +59,6 @@ else done fi +# Sort the .gitignore to reduce conflict in git merges +sort .gitignore |uniq > .gitignore.new +mv .gitignore.new .gitignore diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index c346ab07..9160a49d 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -24,6 +24,7 @@ import shutil try: from docopt import docopt from qp_path import QP_SRC + from qp_path import QP_ROOT except ImportError: print "source .quantum_package.rc" raise @@ -284,5 +285,8 @@ if __name__ == '__main__': path = os.path.join(module_abs, ".gitignore") with open(path, "w+") as f: - f.write("# Automatically created by {0} \n".format(__file__)) - f.write("\n".join(l_dir + l_file + l_symlink + l_exe)) + f.write("# Automatically created by {0} \n".format(__file__).replace(QP_ROOT,"$QP_ROOT")) + l_text = l_dir + l_file + l_symlink + l_exe + l_text.sort() + f.write("\n".join(l_text)) + diff --git a/src/AO_Basis/tree_dependency.png b/src/AO_Basis/tree_dependency.png index bdfa565b..d69b7130 100644 Binary files a/src/AO_Basis/tree_dependency.png and b/src/AO_Basis/tree_dependency.png differ diff --git a/src/Bitmask/tree_dependency.png b/src/Bitmask/tree_dependency.png index 2bf26c7c..dfa495c3 100644 Binary files a/src/Bitmask/tree_dependency.png and b/src/Bitmask/tree_dependency.png differ diff --git a/src/Determinants/.gitignore b/src/Determinants/.gitignore index d845043c..516d3a70 100644 --- a/src/Determinants/.gitignore +++ b/src/Determinants/.gitignore @@ -1,28 +1,28 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f +.ninja_log +AO_Basis +Bitmask +Electrons Ezfio_files +IRPF90_man +IRPF90_temp +Integrals_Bielec Integrals_Monoelec MO_Basis -Utils -Pseudo -Bitmask -AO_Basis -Electrons +Makefile +Makefile.depend Nuclei -Integrals_Bielec -guess_triplet -guess_singlet -truncate_wf -save_natorb -program_initial_determinants +Pseudo +Utils det_svd -guess_doublet \ No newline at end of file +ezfio_interface.irp.f +guess_doublet +guess_singlet +guess_triplet +irpf90.make +irpf90_entities +program_initial_determinants +save_natorb +tags +truncate_wf \ No newline at end of file diff --git a/src/Determinants/tree_dependency.png b/src/Determinants/tree_dependency.png index d47d4c23..8731537a 100644 Binary files a/src/Determinants/tree_dependency.png and b/src/Determinants/tree_dependency.png differ diff --git a/src/Electrons/tree_dependency.png b/src/Electrons/tree_dependency.png index 8c7bb855..8ac27f56 100644 Binary files a/src/Electrons/tree_dependency.png and b/src/Electrons/tree_dependency.png differ diff --git a/src/Ezfio_files/README.rst b/src/Ezfio_files/README.rst new file mode 100644 index 00000000..0c144797 --- /dev/null +++ b/src/Ezfio_files/README.rst @@ -0,0 +1,188 @@ +================== +Ezfio_files Module +================== + +This modules essentially contains the name of the EZFIO directory in the +``ezfio_filename`` variable. This is read as the first argument of the +command-line, or as the ``QP_INPUT`` environment variable. +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +`ezfio_filename `_ + Name of EZFIO file. It is obtained from the QPACKAGE_INPUT environment + variable if it is set, or as the 1st argument of the command line. + + +`getunitandopen `_ + :f: + file name + .br + :mode: + 'R' : READ, UNFORMATTED + 'W' : WRITE, UNFORMATTED + 'r' : READ, FORMATTED + 'w' : WRITE, FORMATTED + 'a' : APPEND, FORMATTED + 'x' : READ/WRITE, FORMATTED + .br + + +`output_alavi `_ + Output file for Alavi + + +`output_ao_basis `_ + Output file for AO_Basis + + +`output_bitmask `_ + Output file for Bitmask + + +`output_cas_sd `_ + Output file for CAS_SD + + +`output_casino `_ + Output file for Casino + + +`output_cid `_ + Output file for CID + + +`output_cid_sc2_selected `_ + Output file for CID_SC2_selected + + +`output_cid_selected `_ + Output file for CID_selected + + +`output_cis `_ + Output file for CIS + + +`output_cisd `_ + Output file for CISD + + +`output_cisd_sc2_selected `_ + Output file for CISD_SC2_selected + + +`output_cisd_selected `_ + Output file for CISD_selected + + +`output_cpu_time_0 `_ + Initial CPU and wall times when printing in the output files + + +`output_ddci_selected `_ + Output file for DDCI_selected + + +`output_determinants `_ + Output file for Determinants + + +`output_electrons `_ + Output file for Electrons + + +`output_ezfio_files `_ + Output file for Ezfio_files + + +`output_generators_cas `_ + Output file for Generators_CAS + + +`output_generators_full `_ + Output file for Generators_full + + +`output_hartree_fock `_ + Output file for Hartree_Fock + + +`output_integrals_bielec `_ + Output file for Integrals_Bielec + + +`output_integrals_monoelec `_ + Output file for Integrals_Monoelec + + +`output_loc_cele `_ + Output file for loc_cele + + +`output_mo_basis `_ + Output file for MO_Basis + + +`output_moguess `_ + Output file for MOGuess + + +`output_mp2 `_ + Output file for MP2 + + +`output_mrcc `_ + Output file for MRCC + + +`output_nuclei `_ + Output file for Nuclei + + +`output_perturbation `_ + Output file for Perturbation + + +`output_properties `_ + Output file for Properties + + +`output_pseudo `_ + Output file for Pseudo + + +`output_selectors_full `_ + Output file for Selectors_full + + +`output_singlerefmethod `_ + Output file for SingleRefMethod + + +`output_utils `_ + Output file for Utils + + +`output_wall_time_0 `_ + Initial CPU and wall times when printing in the output files + + +`write_bool `_ + Write an logical value in output + + +`write_double `_ + Write a double precision value in output + + +`write_int `_ + Write an integer value in output + + +`write_time `_ + Write a time stamp in the output for chronological reconstruction + + diff --git a/src/Ezfio_files/tree_dependency.png b/src/Ezfio_files/tree_dependency.png index 4b0b9fd0..d54e695c 100644 Binary files a/src/Ezfio_files/tree_dependency.png and b/src/Ezfio_files/tree_dependency.png differ diff --git a/src/Integrals_Bielec/tree_dependency.png b/src/Integrals_Bielec/tree_dependency.png index fb08a8dd..30d4bbdb 100644 Binary files a/src/Integrals_Bielec/tree_dependency.png and b/src/Integrals_Bielec/tree_dependency.png differ diff --git a/src/Integrals_Monoelec/.gitignore b/src/Integrals_Monoelec/.gitignore index c30e4619..577068de 100644 --- a/src/Integrals_Monoelec/.gitignore +++ b/src/Integrals_Monoelec/.gitignore @@ -1,20 +1,20 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -MO_Basis -Utils -Pseudo +.ninja_log AO_Basis Electrons +Ezfio_files +IRPF90_man +IRPF90_temp +MO_Basis +Makefile +Makefile.depend Nuclei +Pseudo +Utils check_orthonormality -save_ortho_mos \ No newline at end of file +ezfio_interface.irp.f +irpf90.make +irpf90_entities +save_ortho_mos +tags \ No newline at end of file diff --git a/src/Integrals_Monoelec/pseudopot.f90 b/src/Integrals_Monoelec/pseudopot.f90 index b605a45e..66a13419 100644 --- a/src/Integrals_Monoelec/pseudopot.f90 +++ b/src/Integrals_Monoelec/pseudopot.f90 @@ -728,23 +728,30 @@ double precision int_prod_bessel_loc,binom_func,accu,prod,ylm,bigI,arg accu=accu+v_k(k)*crochet(n_k(k)+2+ntot,g_a+g_b+dz_k(k)) enddo Vloc=accu*fourpi*bigI(0,0,0,0,n_a(1)+n_b(1),n_a(2)+n_b(2),n_a(3)+n_b(3)) - !bigI frequantly is null + !bigI frequently is null return endif freal=dexp(-g_a*ac**2-g_b*bc**2) - d2=0.d0 + d2 = 0.d0 do i=1,3 - d(i)=g_a*(a(i)-c(i))+g_b*(b(i)-c(i)) - d2=d2+d(i)**2 + d(i)=g_a*(a(i)-c(i))+g_b*(b(i)-c(i)) + d2=d2+d(i)*d(i) enddo d2=dsqrt(d2) dreal=2.d0*d2 + theta_DC0=dacos(d(3)/d2) phi_DC0=datan2(d(2)/d2,d(1)/d2) + if (isnan(theta_DC0).or.isnan(phi_DC0)) then + print *, 'NaN in /src/Integrals_Monoelec/pseudopot.f90 at line 449.' + print *, 'Try to break symmetry in your molecule (1.-16 is OK).' + stop 1 + endif + allocate (array_R_loc(-2:ntot_max+klocmax_max,klocmax_max,0:ntot_max)) allocate (array_coefs(0:ntot_max,0:ntot_max,0:ntot_max,0:ntot_max,0:ntot_max,0:ntot_max)) diff --git a/src/Integrals_Monoelec/tree_dependency.png b/src/Integrals_Monoelec/tree_dependency.png index 10fff3cb..7431ba2d 100644 Binary files a/src/Integrals_Monoelec/tree_dependency.png and b/src/Integrals_Monoelec/tree_dependency.png differ diff --git a/src/MOGuess/.gitignore b/src/MOGuess/.gitignore index 105b5526..a912636d 100644 --- a/src/MOGuess/.gitignore +++ b/src/MOGuess/.gitignore @@ -1,20 +1,20 @@ -# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py -IRPF90_temp -IRPF90_man -irpf90_entities -tags -irpf90.make -Makefile -Makefile.depend -.ninja_log +# Automatically created by $QP_ROOT/scripts/module/module_handler.py .ninja_deps -ezfio_interface.irp.f -Ezfio_files -Integrals_Monoelec -MO_Basis -Utils -Pseudo +.ninja_log AO_Basis Electrons +Ezfio_files +H_CORE_guess +IRPF90_man +IRPF90_temp +Integrals_Monoelec +MO_Basis +Makefile +Makefile.depend Nuclei -H_CORE_guess \ No newline at end of file +Pseudo +Utils +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/src/MOGuess/tree_dependency.png b/src/MOGuess/tree_dependency.png index 31b8d39b..994660a3 100644 Binary files a/src/MOGuess/tree_dependency.png and b/src/MOGuess/tree_dependency.png differ diff --git a/src/MO_Basis/tree_dependency.png b/src/MO_Basis/tree_dependency.png index 028fc9bd..9c3e1be6 100644 Binary files a/src/MO_Basis/tree_dependency.png and b/src/MO_Basis/tree_dependency.png differ diff --git a/src/Nuclei/tree_dependency.png b/src/Nuclei/tree_dependency.png index 569e6ac5..7b3ed613 100644 Binary files a/src/Nuclei/tree_dependency.png and b/src/Nuclei/tree_dependency.png differ diff --git a/src/Pseudo/tree_dependency.png b/src/Pseudo/tree_dependency.png index 954f5a22..a2dc7c27 100644 Binary files a/src/Pseudo/tree_dependency.png and b/src/Pseudo/tree_dependency.png differ diff --git a/src/Utils/tree_dependency.png b/src/Utils/tree_dependency.png index 68f0c2ca..f0aa66a7 100644 Binary files a/src/Utils/tree_dependency.png and b/src/Utils/tree_dependency.png differ