diff --git a/src/CAS_SD/.gitignore b/plugins/CAS_SD/.gitignore similarity index 100% rename from src/CAS_SD/.gitignore rename to plugins/CAS_SD/.gitignore diff --git a/src/CAS_SD/EZFIO.cfg b/plugins/CAS_SD/EZFIO.cfg similarity index 100% rename from src/CAS_SD/EZFIO.cfg rename to plugins/CAS_SD/EZFIO.cfg diff --git a/src/CAS_SD/H_apply.irp.f b/plugins/CAS_SD/H_apply.irp.f similarity index 100% rename from src/CAS_SD/H_apply.irp.f rename to plugins/CAS_SD/H_apply.irp.f diff --git a/src/CAS_SD/NEEDED_CHILDREN_MODULES b/plugins/CAS_SD/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CAS_SD/NEEDED_CHILDREN_MODULES rename to plugins/CAS_SD/NEEDED_CHILDREN_MODULES diff --git a/src/CAS_SD/README.rst b/plugins/CAS_SD/README.rst similarity index 100% rename from src/CAS_SD/README.rst rename to plugins/CAS_SD/README.rst diff --git a/src/CAS_SD/cas_sd.irp.f b/plugins/CAS_SD/cas_sd.irp.f similarity index 100% rename from src/CAS_SD/cas_sd.irp.f rename to plugins/CAS_SD/cas_sd.irp.f diff --git a/src/CAS_SD/cas_sd_selected.irp.f b/plugins/CAS_SD/cas_sd_selected.irp.f similarity index 100% rename from src/CAS_SD/cas_sd_selected.irp.f rename to plugins/CAS_SD/cas_sd_selected.irp.f diff --git a/src/CAS_SD/tree_dependency.png b/plugins/CAS_SD/tree_dependency.png similarity index 100% rename from src/CAS_SD/tree_dependency.png rename to plugins/CAS_SD/tree_dependency.png diff --git a/src/CID/.gitignore b/plugins/CID/.gitignore similarity index 100% rename from src/CID/.gitignore rename to plugins/CID/.gitignore diff --git a/src/CID/H_apply.irp.f b/plugins/CID/H_apply.irp.f similarity index 100% rename from src/CID/H_apply.irp.f rename to plugins/CID/H_apply.irp.f diff --git a/src/CID/NEEDED_CHILDREN_MODULES b/plugins/CID/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CID/NEEDED_CHILDREN_MODULES rename to plugins/CID/NEEDED_CHILDREN_MODULES diff --git a/src/CID/README.rst b/plugins/CID/README.rst similarity index 100% rename from src/CID/README.rst rename to plugins/CID/README.rst diff --git a/src/CID/cid.irp.f b/plugins/CID/cid.irp.f similarity index 100% rename from src/CID/cid.irp.f rename to plugins/CID/cid.irp.f diff --git a/src/CID/cid_lapack.irp.f b/plugins/CID/cid_lapack.irp.f similarity index 100% rename from src/CID/cid_lapack.irp.f rename to plugins/CID/cid_lapack.irp.f diff --git a/src/CID/tree_dependency.png b/plugins/CID/tree_dependency.png similarity index 100% rename from src/CID/tree_dependency.png rename to plugins/CID/tree_dependency.png diff --git a/src/CID_SC2_selected/.gitignore b/plugins/CID_SC2_selected/.gitignore similarity index 100% rename from src/CID_SC2_selected/.gitignore rename to plugins/CID_SC2_selected/.gitignore diff --git a/src/CID_SC2_selected/H_apply.irp.f b/plugins/CID_SC2_selected/H_apply.irp.f similarity index 100% rename from src/CID_SC2_selected/H_apply.irp.f rename to plugins/CID_SC2_selected/H_apply.irp.f diff --git a/src/CID_SC2_selected/NEEDED_CHILDREN_MODULES b/plugins/CID_SC2_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CID_SC2_selected/NEEDED_CHILDREN_MODULES rename to plugins/CID_SC2_selected/NEEDED_CHILDREN_MODULES diff --git a/src/CID_SC2_selected/README.rst b/plugins/CID_SC2_selected/README.rst similarity index 100% rename from src/CID_SC2_selected/README.rst rename to plugins/CID_SC2_selected/README.rst diff --git a/src/CID_SC2_selected/cid_sc2_selection.irp.f b/plugins/CID_SC2_selected/cid_sc2_selection.irp.f similarity index 100% rename from src/CID_SC2_selected/cid_sc2_selection.irp.f rename to plugins/CID_SC2_selected/cid_sc2_selection.irp.f diff --git a/src/CID_SC2_selected/tree_dependency.png b/plugins/CID_SC2_selected/tree_dependency.png similarity index 100% rename from src/CID_SC2_selected/tree_dependency.png rename to plugins/CID_SC2_selected/tree_dependency.png diff --git a/src/CID_selected/.gitignore b/plugins/CID_selected/.gitignore similarity index 100% rename from src/CID_selected/.gitignore rename to plugins/CID_selected/.gitignore diff --git a/src/CID_selected/H_apply.irp.f b/plugins/CID_selected/H_apply.irp.f similarity index 100% rename from src/CID_selected/H_apply.irp.f rename to plugins/CID_selected/H_apply.irp.f diff --git a/src/CID_selected/NEEDED_CHILDREN_MODULES b/plugins/CID_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CID_selected/NEEDED_CHILDREN_MODULES rename to plugins/CID_selected/NEEDED_CHILDREN_MODULES diff --git a/src/CID_selected/README.rst b/plugins/CID_selected/README.rst similarity index 100% rename from src/CID_selected/README.rst rename to plugins/CID_selected/README.rst diff --git a/src/CID_selected/cid_selection.irp.f b/plugins/CID_selected/cid_selection.irp.f similarity index 100% rename from src/CID_selected/cid_selection.irp.f rename to plugins/CID_selected/cid_selection.irp.f diff --git a/src/CID_selected/tree_dependency.png b/plugins/CID_selected/tree_dependency.png similarity index 100% rename from src/CID_selected/tree_dependency.png rename to plugins/CID_selected/tree_dependency.png diff --git a/src/CIS/.gitignore b/plugins/CIS/.gitignore similarity index 100% rename from src/CIS/.gitignore rename to plugins/CIS/.gitignore diff --git a/src/CIS/H_apply.irp.f b/plugins/CIS/H_apply.irp.f similarity index 100% rename from src/CIS/H_apply.irp.f rename to plugins/CIS/H_apply.irp.f diff --git a/src/CIS/NEEDED_CHILDREN_MODULES b/plugins/CIS/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CIS/NEEDED_CHILDREN_MODULES rename to plugins/CIS/NEEDED_CHILDREN_MODULES diff --git a/src/CIS/README.rst b/plugins/CIS/README.rst similarity index 100% rename from src/CIS/README.rst rename to plugins/CIS/README.rst diff --git a/src/CIS/cis.irp.f b/plugins/CIS/cis.irp.f similarity index 100% rename from src/CIS/cis.irp.f rename to plugins/CIS/cis.irp.f diff --git a/src/CIS/super_ci.irp.f b/plugins/CIS/super_ci.irp.f similarity index 100% rename from src/CIS/super_ci.irp.f rename to plugins/CIS/super_ci.irp.f diff --git a/src/CIS/tree_dependency.png b/plugins/CIS/tree_dependency.png similarity index 100% rename from src/CIS/tree_dependency.png rename to plugins/CIS/tree_dependency.png diff --git a/src/CISD/.gitignore b/plugins/CISD/.gitignore similarity index 100% rename from src/CISD/.gitignore rename to plugins/CISD/.gitignore diff --git a/src/CISD/H_apply.irp.f b/plugins/CISD/H_apply.irp.f similarity index 100% rename from src/CISD/H_apply.irp.f rename to plugins/CISD/H_apply.irp.f diff --git a/src/CISD/NEEDED_CHILDREN_MODULES b/plugins/CISD/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CISD/NEEDED_CHILDREN_MODULES rename to plugins/CISD/NEEDED_CHILDREN_MODULES diff --git a/src/CISD/README.rst b/plugins/CISD/README.rst similarity index 100% rename from src/CISD/README.rst rename to plugins/CISD/README.rst diff --git a/src/CISD/cisd.irp.f b/plugins/CISD/cisd.irp.f similarity index 100% rename from src/CISD/cisd.irp.f rename to plugins/CISD/cisd.irp.f diff --git a/src/CISD/cisd_lapack.irp.f b/plugins/CISD/cisd_lapack.irp.f similarity index 100% rename from src/CISD/cisd_lapack.irp.f rename to plugins/CISD/cisd_lapack.irp.f diff --git a/src/CISD/tree_dependency.png b/plugins/CISD/tree_dependency.png similarity index 100% rename from src/CISD/tree_dependency.png rename to plugins/CISD/tree_dependency.png diff --git a/src/CISD_SC2_selected/.gitignore b/plugins/CISD_SC2_selected/.gitignore similarity index 100% rename from src/CISD_SC2_selected/.gitignore rename to plugins/CISD_SC2_selected/.gitignore diff --git a/src/CISD_SC2_selected/EZFIO.cfg b/plugins/CISD_SC2_selected/EZFIO.cfg similarity index 100% rename from src/CISD_SC2_selected/EZFIO.cfg rename to plugins/CISD_SC2_selected/EZFIO.cfg diff --git a/src/CISD_SC2_selected/H_apply.irp.f b/plugins/CISD_SC2_selected/H_apply.irp.f similarity index 100% rename from src/CISD_SC2_selected/H_apply.irp.f rename to plugins/CISD_SC2_selected/H_apply.irp.f diff --git a/src/CISD_SC2_selected/NEEDED_CHILDREN_MODULES b/plugins/CISD_SC2_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CISD_SC2_selected/NEEDED_CHILDREN_MODULES rename to plugins/CISD_SC2_selected/NEEDED_CHILDREN_MODULES diff --git a/src/CISD_SC2_selected/README.rst b/plugins/CISD_SC2_selected/README.rst similarity index 100% rename from src/CISD_SC2_selected/README.rst rename to plugins/CISD_SC2_selected/README.rst diff --git a/src/CISD_SC2_selected/cisd_sc2_selection.irp.f b/plugins/CISD_SC2_selected/cisd_sc2_selection.irp.f similarity index 100% rename from src/CISD_SC2_selected/cisd_sc2_selection.irp.f rename to plugins/CISD_SC2_selected/cisd_sc2_selection.irp.f diff --git a/src/CISD_SC2_selected/tree_dependency.png b/plugins/CISD_SC2_selected/tree_dependency.png similarity index 100% rename from src/CISD_SC2_selected/tree_dependency.png rename to plugins/CISD_SC2_selected/tree_dependency.png diff --git a/src/CISD_selected/.gitignore b/plugins/CISD_selected/.gitignore similarity index 100% rename from src/CISD_selected/.gitignore rename to plugins/CISD_selected/.gitignore diff --git a/src/CISD_selected/H_apply.irp.f b/plugins/CISD_selected/H_apply.irp.f similarity index 100% rename from src/CISD_selected/H_apply.irp.f rename to plugins/CISD_selected/H_apply.irp.f diff --git a/src/CISD_selected/NEEDED_CHILDREN_MODULES b/plugins/CISD_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/CISD_selected/NEEDED_CHILDREN_MODULES rename to plugins/CISD_selected/NEEDED_CHILDREN_MODULES diff --git a/src/CISD_selected/README.rst b/plugins/CISD_selected/README.rst similarity index 100% rename from src/CISD_selected/README.rst rename to plugins/CISD_selected/README.rst diff --git a/src/CISD_selected/cisd_selection.irp.f b/plugins/CISD_selected/cisd_selection.irp.f similarity index 100% rename from src/CISD_selected/cisd_selection.irp.f rename to plugins/CISD_selected/cisd_selection.irp.f diff --git a/src/CISD_selected/tree_dependency.png b/plugins/CISD_selected/tree_dependency.png similarity index 100% rename from src/CISD_selected/tree_dependency.png rename to plugins/CISD_selected/tree_dependency.png diff --git a/src/DDCI_selected/.gitignore b/plugins/DDCI_selected/.gitignore similarity index 100% rename from src/DDCI_selected/.gitignore rename to plugins/DDCI_selected/.gitignore diff --git a/src/DDCI_selected/EZFIO.cfg b/plugins/DDCI_selected/EZFIO.cfg similarity index 100% rename from src/DDCI_selected/EZFIO.cfg rename to plugins/DDCI_selected/EZFIO.cfg diff --git a/src/DDCI_selected/H_apply.irp.f b/plugins/DDCI_selected/H_apply.irp.f similarity index 100% rename from src/DDCI_selected/H_apply.irp.f rename to plugins/DDCI_selected/H_apply.irp.f diff --git a/src/DDCI_selected/NEEDED_CHILDREN_MODULES b/plugins/DDCI_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/DDCI_selected/NEEDED_CHILDREN_MODULES rename to plugins/DDCI_selected/NEEDED_CHILDREN_MODULES diff --git a/src/DDCI_selected/README.rst b/plugins/DDCI_selected/README.rst similarity index 100% rename from src/DDCI_selected/README.rst rename to plugins/DDCI_selected/README.rst diff --git a/src/DDCI_selected/ddci.irp.f b/plugins/DDCI_selected/ddci.irp.f similarity index 100% rename from src/DDCI_selected/ddci.irp.f rename to plugins/DDCI_selected/ddci.irp.f diff --git a/src/DDCI_selected/tree_dependency.png b/plugins/DDCI_selected/tree_dependency.png similarity index 100% rename from src/DDCI_selected/tree_dependency.png rename to plugins/DDCI_selected/tree_dependency.png diff --git a/src/DensityFit/.gitignore b/plugins/DensityFit/.gitignore similarity index 100% rename from src/DensityFit/.gitignore rename to plugins/DensityFit/.gitignore diff --git a/src/DensityFit/NEEDED_CHILDREN_MODULES b/plugins/DensityFit/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/DensityFit/NEEDED_CHILDREN_MODULES rename to plugins/DensityFit/NEEDED_CHILDREN_MODULES diff --git a/src/DensityFit/README.rst b/plugins/DensityFit/README.rst similarity index 100% rename from src/DensityFit/README.rst rename to plugins/DensityFit/README.rst diff --git a/src/DensityFit/aux_basis.ezfio_config b/plugins/DensityFit/aux_basis.ezfio_config similarity index 100% rename from src/DensityFit/aux_basis.ezfio_config rename to plugins/DensityFit/aux_basis.ezfio_config diff --git a/src/DensityFit/aux_basis.irp.f b/plugins/DensityFit/aux_basis.irp.f similarity index 100% rename from src/DensityFit/aux_basis.irp.f rename to plugins/DensityFit/aux_basis.irp.f diff --git a/src/DensityFit/overlap.irp.f b/plugins/DensityFit/overlap.irp.f similarity index 100% rename from src/DensityFit/overlap.irp.f rename to plugins/DensityFit/overlap.irp.f diff --git a/src/DensityFit/tree_dependency.png b/plugins/DensityFit/tree_dependency.png similarity index 100% rename from src/DensityFit/tree_dependency.png rename to plugins/DensityFit/tree_dependency.png diff --git a/src/DensityMatrix/.gitignore b/plugins/DensityMatrix/.gitignore similarity index 100% rename from src/DensityMatrix/.gitignore rename to plugins/DensityMatrix/.gitignore diff --git a/src/DensityMatrix/README.rst b/plugins/DensityMatrix/README.rst similarity index 100% rename from src/DensityMatrix/README.rst rename to plugins/DensityMatrix/README.rst diff --git a/src/DensityMatrix/density_matrix.irp.f b/plugins/DensityMatrix/density_matrix.irp.f similarity index 100% rename from src/DensityMatrix/density_matrix.irp.f rename to plugins/DensityMatrix/density_matrix.irp.f diff --git a/src/DensityMatrix/det_num.irp.f b/plugins/DensityMatrix/det_num.irp.f similarity index 100% rename from src/DensityMatrix/det_num.irp.f rename to plugins/DensityMatrix/det_num.irp.f diff --git a/src/FCIdump/.gitignore b/plugins/FCIdump/.gitignore similarity index 100% rename from src/FCIdump/.gitignore rename to plugins/FCIdump/.gitignore diff --git a/src/FCIdump/NEEDED_CHILDREN_MODULES b/plugins/FCIdump/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/FCIdump/NEEDED_CHILDREN_MODULES rename to plugins/FCIdump/NEEDED_CHILDREN_MODULES diff --git a/src/FCIdump/README.rst b/plugins/FCIdump/README.rst similarity index 100% rename from src/FCIdump/README.rst rename to plugins/FCIdump/README.rst diff --git a/src/FCIdump/fcidump.irp.f b/plugins/FCIdump/fcidump.irp.f similarity index 100% rename from src/FCIdump/fcidump.irp.f rename to plugins/FCIdump/fcidump.irp.f diff --git a/src/FCIdump/tree_dependency.png b/plugins/FCIdump/tree_dependency.png similarity index 100% rename from src/FCIdump/tree_dependency.png rename to plugins/FCIdump/tree_dependency.png diff --git a/plugins/Full_CI/.gitignore b/plugins/Full_CI/.gitignore new file mode 100644 index 00000000..df7eac39 --- /dev/null +++ b/plugins/Full_CI/.gitignore @@ -0,0 +1,34 @@ +# +# 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 +.ninja_deps +Generators_full +Pseudo +Integrals_Monoelec +Bitmask +Integrals_Bielec +AOs +Selectors_full +MOs +Hartree_Fock +Perturbation +Determinants +Electrons +Utils +Properties +Nuclei +MOGuess +Ezfio_files +target_pt2 +full_ci +var_pt2_ratio +full_ci_no_skip diff --git a/plugins/Full_CI/EZFIO.cfg b/plugins/Full_CI/EZFIO.cfg new file mode 100644 index 00000000..37f25eda --- /dev/null +++ b/plugins/Full_CI/EZFIO.cfg @@ -0,0 +1,10 @@ +[energy] +type: double precision +doc: Calculated Selected FCI energy +interface: output + +[energy_pt2] +type: double precision +doc: Calculated FCI energy + PT2 +interface: output + diff --git a/plugins/Full_CI/H_apply.irp.f b/plugins/Full_CI/H_apply.irp.f new file mode 100644 index 00000000..a755ad4a --- /dev/null +++ b/plugins/Full_CI/H_apply.irp.f @@ -0,0 +1,44 @@ +use bitmasks +BEGIN_SHELL [ /usr/bin/env python ] +from generate_h_apply import * + +s = H_apply("FCI") +s.set_selection_pt2("epstein_nesbet_2x2") +print s + +s = H_apply("FCI_PT2") +s.set_perturbation("epstein_nesbet_2x2") +print s + +s = H_apply("FCI_no_skip") +s.set_selection_pt2("epstein_nesbet_2x2") +s.unset_skip() +print s + +s = H_apply("FCI_mono") +s.set_selection_pt2("epstein_nesbet_2x2") +s.unset_double_excitations() +print s + + +s = H_apply("select_mono_delta_rho") +s.unset_double_excitations() +s.set_selection_pt2("delta_rho_one_point") +print s + +s = H_apply("pt2_mono_delta_rho") +s.unset_double_excitations() +s.set_perturbation("delta_rho_one_point") +print s + +s = H_apply("select_mono_di_delta_rho") +s.set_selection_pt2("delta_rho_one_point") +print s + +s = H_apply("pt2_mono_di_delta_rho") +s.set_perturbation("delta_rho_one_point") +print s + + +END_SHELL + diff --git a/src/MRCC/NEEDED_CHILDREN_MODULES b/plugins/Full_CI/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/MRCC/NEEDED_CHILDREN_MODULES rename to plugins/Full_CI/NEEDED_CHILDREN_MODULES diff --git a/plugins/Full_CI/README.rst b/plugins/Full_CI/README.rst new file mode 100644 index 00000000..396fbcd6 --- /dev/null +++ b/plugins/Full_CI/README.rst @@ -0,0 +1,167 @@ +============== +Full_CI Module +============== + +Performs a perturbatively selected Full-CI. + +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +`full_ci `_ + Undocumented + + +`h_apply_fci `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_fci_diexc `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + 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 `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`var_pt2_ratio_run `_ + Undocumented + +Needed Modules +============== + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +.. image:: tree_dependency.png + +* `Perturbation `_ +* `Selectors_full `_ +* `Generators_full `_ + diff --git a/plugins/Full_CI/full_ci.irp.f b/plugins/Full_CI/full_ci.irp.f new file mode 100644 index 00000000..e2a9700e --- /dev/null +++ b/plugins/Full_CI/full_ci.irp.f @@ -0,0 +1,91 @@ +program full_ci + implicit none + integer :: i,k + + + double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:) + integer :: N_st, degree + N_st = N_states + allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st)) + character*(64) :: perturbation + + pt2 = 1.d0 + diag_algorithm = "Lapack" + 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 + soft_touch N_det psi_det psi_coef + call diagonalize_CI + call save_wavefunction + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print *, 'PT2 = ', pt2 + print *, 'E = ', CI_energy + print *, 'E+PT2 = ', CI_energy+pt2 + print *, '-----' + endif + double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(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) + selection_criterion = dabs(psi_coef(N_det,1) * (i_H_psi_array(1) - h * psi_coef(N_det,1))) * 0.1d0 + soft_touch selection_criterion + endif + + + integer :: n_det_before + print*,'Beginning the selection ...' + 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) + + PROVIDE psi_coef + PROVIDE psi_det + PROVIDE psi_det_sorted + + if (N_det > N_det_max) then + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + N_det = N_det_max + soft_touch N_det psi_det psi_coef + endif + call diagonalize_CI + call save_wavefunction + 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 *, '-----' + call ezfio_set_full_ci_energy(CI_energy) + if (abort_all) then + exit + endif + enddo + N_det = min(N_det_max,N_det) + touch N_det psi_det psi_coef + 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_FCI_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_full_ci_energy_pt2(CI_energy+pt2) + endif + call save_wavefunction + deallocate(pt2,norm_pert) +end diff --git a/plugins/Full_CI/full_ci_no_skip.irp.f b/plugins/Full_CI/full_ci_no_skip.irp.f new file mode 100644 index 00000000..73958bf9 --- /dev/null +++ b/plugins/Full_CI/full_ci_no_skip.irp.f @@ -0,0 +1,91 @@ +program full_ci + implicit none + integer :: i,k + + + double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:) + integer :: N_st, degree + N_st = N_states + allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st)) + character*(64) :: perturbation + + pt2 = 1.d0 + diag_algorithm = "Lapack" + 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 + soft_touch N_det psi_det psi_coef + call diagonalize_CI + call save_wavefunction + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print *, 'PT2 = ', pt2 + print *, 'E = ', CI_energy + print *, 'E+PT2 = ', CI_energy+pt2 + print *, '-----' + endif + double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(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) + selection_criterion = dabs(psi_coef(N_det,1) * (i_H_psi_array(1) - h * psi_coef(N_det,1))) * 0.1d0 + soft_touch selection_criterion + endif + + + integer :: n_det_before + print*,'Beginning the selection ...' + 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) + + PROVIDE psi_coef + PROVIDE psi_det + PROVIDE psi_det_sorted + + if (N_det > N_det_max) then + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + N_det = N_det_max + soft_touch N_det psi_det psi_coef + endif + call diagonalize_CI + call save_wavefunction + 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 *, '-----' + call ezfio_set_full_ci_energy(CI_energy) + if (abort_all) then + exit + endif + enddo + N_det = min(N_det_max,N_det) + touch N_det psi_det psi_coef + 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_FCI_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_full_ci_energy_pt2(CI_energy+pt2) + endif + call save_wavefunction + deallocate(pt2,norm_pert) +end diff --git a/plugins/Full_CI/target_pt2.irp.f b/plugins/Full_CI/target_pt2.irp.f new file mode 100644 index 00000000..c0420e20 --- /dev/null +++ b/plugins/Full_CI/target_pt2.irp.f @@ -0,0 +1,76 @@ +program var_pt2_ratio_run + implicit none + integer :: i,k + + + double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:) + integer :: N_st, degree + N_st = N_states + allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st)) + character*(64) :: perturbation + + double precision, allocatable :: psi_det_save(:,:,:), psi_coef_save(:,:) + + double precision :: E_fci, E_var, ratio, E_ref + integer :: Nmin, Nmax + + pt2 = -(pt2_max+1.d0) + diag_algorithm = "Lapack" + + ratio = 0.d0 + Nmin=1 + do while (dabs(pt2(1)) > pt2_max) + call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st) + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + soft_touch N_det psi_det psi_coef + call diagonalize_CI + ratio = (CI_energy(1) - HF_energy) / (CI_energy(1)+pt2(1) - HF_energy) + enddo + + threshold_selectors = 1.d0 + threshold_generators = 0.999d0 + call diagonalize_CI + call H_apply_FCI_PT2(pt2, norm_pert, H_pert_diag, N_st) + E_ref = CI_energy(1) + pt2(1) + threshold_selectors = 0.99d0 + threshold_generators = 0.98d0 + + var_pt2_ratio = (E_ref + pt2_max - HF_energy) / (E_ref - HF_energy) + TOUCH var_pt2_ratio + + Nmax=max(10000,3*N_det) + Nmin=1 + do while (Nmax-Nmin > 1) + ratio = (CI_energy(1) - HF_energy) / (E_ref - HF_energy) + + if (ratio < var_pt2_ratio) then + Nmin = N_det +! Nmax = max(Nmax,Nmin+10) + ! Select new determinants + call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st) + N_det = min(N_det,Nmax) + else + Nmax = N_det + N_det = Nmin + (Nmax-Nmin)/2 + endif + + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + soft_touch N_det psi_det psi_coef + call diagonalize_CI + call save_wavefunction + print *, 'Det min, Det max: ', Nmin, Nmax + print *, 'Ratio : ', ratio, ' ~ ', var_pt2_ratio + print *, 'HF_energy = ', HF_energy + print *, 'Est FCI = ', E_ref + print *, 'PT2 = ', pt2(1) + print *, 'N_det = ', N_det + print *, 'E = ', CI_energy(1) + call ezfio_set_full_ci_energy(CI_energy) + if (abort_all) then + exit + endif + enddo + deallocate(pt2,norm_pert) +end diff --git a/plugins/Full_CI/tree_dependency.png b/plugins/Full_CI/tree_dependency.png new file mode 100644 index 00000000..7696fea7 Binary files /dev/null and b/plugins/Full_CI/tree_dependency.png differ diff --git a/plugins/Full_CI/var_pt2_ratio.irp.f b/plugins/Full_CI/var_pt2_ratio.irp.f new file mode 100644 index 00000000..20395fa9 --- /dev/null +++ b/plugins/Full_CI/var_pt2_ratio.irp.f @@ -0,0 +1,71 @@ +program var_pt2_ratio_run + implicit none + integer :: i,k + + + double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:) + integer :: N_st, degree + N_st = N_states + allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st)) + character*(64) :: perturbation + + double precision, allocatable :: psi_det_save(:,:,:), psi_coef_save(:,:) + + double precision :: E_fci, E_var, ratio, E_ref + integer :: Nmin, Nmax + + pt2 = 1.d0 + diag_algorithm = "Lapack" + + ratio = 0.d0 + Nmin=1 + do while (ratio < var_pt2_ratio) + call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st) + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + soft_touch N_det psi_det psi_coef + call diagonalize_CI + ratio = (CI_energy(1) - HF_energy) / (CI_energy(1)+pt2(1) - HF_energy) + enddo + + threshold_selectors = 1.d0 + threshold_generators = 0.999d0 + call diagonalize_CI + call H_apply_FCI_PT2(pt2, norm_pert, H_pert_diag, N_st) + E_ref = CI_energy(1) + pt2(1) + threshold_selectors = 0.999d0 + threshold_generators = 0.99d0 + + Nmax=N_det + Nmin=1 + do while (Nmax-Nmin > 1) + ratio = (CI_energy(1) - HF_energy) / (E_ref - HF_energy) + + if (ratio < var_pt2_ratio) then + Nmin = N_det + Nmax = max(Nmax,Nmin+10) + ! Select new determinants + call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st) + else + Nmax = N_det + N_det = Nmin + (Nmax-Nmin)/2 + endif + + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + soft_touch N_det psi_det psi_coef + call diagonalize_CI + call save_wavefunction + print *, 'Det min, Det max: ', Nmin, Nmax + print *, 'Ratio : ', ratio, ' ~ ', var_pt2_ratio + print *, 'HF_energy = ', HF_energy + print *, 'Est FCI = ', E_ref + print *, 'N_det = ', N_det + print *, 'E = ', CI_energy(1) + call ezfio_set_full_ci_energy(CI_energy) + if (abort_all) then + exit + endif + enddo + deallocate(pt2,norm_pert) +end diff --git a/src/Generators_CAS/.gitignore b/plugins/Generators_CAS/.gitignore similarity index 100% rename from src/Generators_CAS/.gitignore rename to plugins/Generators_CAS/.gitignore diff --git a/src/Generators_CAS/NEEDED_CHILDREN_MODULES b/plugins/Generators_CAS/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Generators_CAS/NEEDED_CHILDREN_MODULES rename to plugins/Generators_CAS/NEEDED_CHILDREN_MODULES diff --git a/src/Generators_CAS/README.rst b/plugins/Generators_CAS/README.rst similarity index 100% rename from src/Generators_CAS/README.rst rename to plugins/Generators_CAS/README.rst diff --git a/src/Generators_CAS/generators.irp.f b/plugins/Generators_CAS/generators.irp.f similarity index 100% rename from src/Generators_CAS/generators.irp.f rename to plugins/Generators_CAS/generators.irp.f diff --git a/src/Generators_CAS/tree_dependency.png b/plugins/Generators_CAS/tree_dependency.png similarity index 100% rename from src/Generators_CAS/tree_dependency.png rename to plugins/Generators_CAS/tree_dependency.png diff --git a/src/Generators_full/.gitignore b/plugins/Generators_full/.gitignore similarity index 100% rename from src/Generators_full/.gitignore rename to plugins/Generators_full/.gitignore diff --git a/src/Generators_full/NEEDED_CHILDREN_MODULES b/plugins/Generators_full/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Generators_full/NEEDED_CHILDREN_MODULES rename to plugins/Generators_full/NEEDED_CHILDREN_MODULES diff --git a/src/Generators_full/README.rst b/plugins/Generators_full/README.rst similarity index 100% rename from src/Generators_full/README.rst rename to plugins/Generators_full/README.rst diff --git a/src/Generators_full/generators.irp.f b/plugins/Generators_full/generators.irp.f similarity index 100% rename from src/Generators_full/generators.irp.f rename to plugins/Generators_full/generators.irp.f diff --git a/src/Generators_full/tree_dependency.png b/plugins/Generators_full/tree_dependency.png similarity index 100% rename from src/Generators_full/tree_dependency.png rename to plugins/Generators_full/tree_dependency.png diff --git a/src/Generators_restart/.gitignore b/plugins/Generators_restart/.gitignore similarity index 100% rename from src/Generators_restart/.gitignore rename to plugins/Generators_restart/.gitignore diff --git a/src/Generators_restart/NEEDED_CHILDREN_MODULES b/plugins/Generators_restart/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Generators_restart/NEEDED_CHILDREN_MODULES rename to plugins/Generators_restart/NEEDED_CHILDREN_MODULES diff --git a/src/Generators_restart/README.rst b/plugins/Generators_restart/README.rst similarity index 100% rename from src/Generators_restart/README.rst rename to plugins/Generators_restart/README.rst diff --git a/src/Generators_restart/generators.irp.f b/plugins/Generators_restart/generators.irp.f similarity index 100% rename from src/Generators_restart/generators.irp.f rename to plugins/Generators_restart/generators.irp.f diff --git a/src/Generators_restart/tree_dependency.png b/plugins/Generators_restart/tree_dependency.png similarity index 100% rename from src/Generators_restart/tree_dependency.png rename to plugins/Generators_restart/tree_dependency.png diff --git a/plugins/Hartree_Fock/.gitignore b/plugins/Hartree_Fock/.gitignore new file mode 100644 index 00000000..0197ab71 --- /dev/null +++ b/plugins/Hartree_Fock/.gitignore @@ -0,0 +1,26 @@ +# +# 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 +.ninja_deps +Pseudo +Integrals_Monoelec +Bitmask +Integrals_Bielec +AOs +MOs +Electrons +Utils +Nuclei +MOGuess +Ezfio_files +Huckel_guess +SCF diff --git a/plugins/Hartree_Fock/EZFIO.cfg b/plugins/Hartree_Fock/EZFIO.cfg new file mode 100644 index 00000000..e2b0ea5a --- /dev/null +++ b/plugins/Hartree_Fock/EZFIO.cfg @@ -0,0 +1,22 @@ +[thresh_scf] +type: Threshold +doc: Threshold on the convergence of the Hartree Fock energy +interface: input +default: 1.e-10 + +[n_it_scf_max] +type: Strictly_positive_int +doc: Maximum number of SCF iterations +interface: input +default: 200 + +[mo_guess_type] +type: MO_guess +doc: Initial MO guess. Can be [ Huckel | HCore ] +interface: input +default: Huckel + +[energy] +type: double precision +doc: Calculated HF energy +interface: output diff --git a/plugins/Hartree_Fock/Fock_matrix.irp.f b/plugins/Hartree_Fock/Fock_matrix.irp.f new file mode 100644 index 00000000..7dd349b1 --- /dev/null +++ b/plugins/Hartree_Fock/Fock_matrix.irp.f @@ -0,0 +1,364 @@ + BEGIN_PROVIDER [ double precision, Fock_matrix_mo, (mo_tot_num_align,mo_tot_num) ] +&BEGIN_PROVIDER [ double precision, Fock_matrix_diag_mo, (mo_tot_num)] + implicit none + BEGIN_DOC + ! Fock matrix on the MO basis. + ! For open shells, the ROHF Fock Matrix is + ! + ! | F-K | F + K/2 | F | + ! |---------------------------------| + ! | F + K/2 | F | F - K/2 | + ! |---------------------------------| + ! | F | F - K/2 | F + K | + ! + ! F = 1/2 (Fa + Fb) + ! + ! K = Fb - Fa + ! + END_DOC + integer :: i,j,n + if (elec_alpha_num == elec_beta_num) then + Fock_matrix_mo = Fock_matrix_alpha_mo + else + + do j=1,elec_beta_num + ! F-K + do i=1,elec_beta_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j))& + - (Fock_matrix_beta_mo(i,j) - Fock_matrix_alpha_mo(i,j)) + enddo + ! F+K/2 + do i=elec_beta_num+1,elec_alpha_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j))& + + 0.5d0*(Fock_matrix_beta_mo(i,j) - Fock_matrix_alpha_mo(i,j)) + enddo + ! F + do i=elec_alpha_num+1, mo_tot_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j)) + enddo + enddo + + do j=elec_beta_num+1,elec_alpha_num + ! F+K/2 + do i=1,elec_beta_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j))& + + 0.5d0*(Fock_matrix_beta_mo(i,j) - Fock_matrix_alpha_mo(i,j)) + enddo + ! F + do i=elec_beta_num+1,elec_alpha_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j)) + enddo + ! F-K/2 + do i=elec_alpha_num+1, mo_tot_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j))& + - 0.5d0*(Fock_matrix_beta_mo(i,j) - Fock_matrix_alpha_mo(i,j)) + enddo + enddo + + do j=elec_alpha_num+1, mo_tot_num + ! F + do i=1,elec_beta_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j)) + enddo + ! F-K/2 + do i=elec_beta_num+1,elec_alpha_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j))& + - 0.5d0*(Fock_matrix_beta_mo(i,j) - Fock_matrix_alpha_mo(i,j)) + enddo + ! F+K + do i=elec_alpha_num+1,mo_tot_num + Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_alpha_mo(i,j)+Fock_matrix_beta_mo(i,j)) & + + (Fock_matrix_beta_mo(i,j) - Fock_matrix_alpha_mo(i,j)) + enddo + enddo + + endif + do i = 1, mo_tot_num + Fock_matrix_diag_mo(i) = Fock_matrix_mo(i,i) + enddo +END_PROVIDER + + + + BEGIN_PROVIDER [ double precision, Fock_matrix_alpha_ao, (ao_num_align, ao_num) ] +&BEGIN_PROVIDER [ double precision, Fock_matrix_beta_ao, (ao_num_align, ao_num) ] + implicit none + BEGIN_DOC + ! Alpha Fock matrix in AO basis set + END_DOC + + integer :: i,j + do j=1,ao_num + !DIR$ VECTOR ALIGNED + do i=1,ao_num + Fock_matrix_alpha_ao(i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_alpha(i,j) + Fock_matrix_beta_ao (i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_beta (i,j) + enddo + enddo + +END_PROVIDER + + + BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_alpha, (ao_num_align, ao_num) ] +&BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_beta , (ao_num_align, ao_num) ] + use map_module + implicit none + BEGIN_DOC + ! Alpha Fock matrix in AO basis set + END_DOC + + integer :: i,j,k,l,k1,r,s + integer*8 :: p,q + double precision :: integral + double precision :: ao_bielec_integral + if (do_direct_integrals) then + + ao_bi_elec_integral_alpha = 0.d0 + ao_bi_elec_integral_beta = 0.d0 + !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,p,q,r,s)& + !$OMP SHARED(ao_num,HF_density_matrix_ao_alpha,HF_density_matrix_ao_beta,& + !$OMP ao_integrals_map,ao_integrals_threshold, ao_bielec_integral_schwartz, & + !$OMP ao_overlap_abs) & + !$OMP REDUCTION(+:ao_bi_elec_integral_alpha,ao_bi_elec_integral_beta) + + allocate(keys(1), values(1)) + + q = ao_num*ao_num*ao_num*ao_num + !$OMP DO SCHEDULE(dynamic) + do p=1_8,q + call bielec_integrals_index_reverse(kk,ii,ll,jj,p) + if ( (kk(1)>ao_num).or. & + (ii(1)>ao_num).or. & + (jj(1)>ao_num).or. & + (ll(1)>ao_num) ) then + cycle + endif + k = kk(1) + i = ii(1) + l = ll(1) + j = jj(1) + + if (ao_overlap_abs(k,l)*ao_overlap_abs(i,j) & + < ao_integrals_threshold) then + cycle + endif + if (ao_bielec_integral_schwartz(k,l)*ao_bielec_integral_schwartz(i,j) & + < ao_integrals_threshold) then + cycle + endif + values(1) = ao_bielec_integral(k,l,i,j) + if (abs(values(1)) < ao_integrals_threshold) then + cycle + endif + do k2=1,8 + if (kk(k2)==0) then + cycle + endif + i = ii(k2) + j = jj(k2) + k = kk(k2) + l = ll(k2) + integral = (HF_density_matrix_ao_alpha(k,l)+HF_density_matrix_ao_beta(k,l)) * values(1) + ao_bi_elec_integral_alpha(i,j) += integral + ao_bi_elec_integral_beta (i,j) += integral + integral = values(1) + ao_bi_elec_integral_alpha(l,j) -= HF_density_matrix_ao_alpha(k,i) * integral + ao_bi_elec_integral_beta (l,j) -= HF_density_matrix_ao_beta (k,i) * integral + enddo + enddo + !$OMP END DO + deallocate(keys,values) + !$OMP END PARALLEL + else + PROVIDE ao_bielec_integrals_in_map + + integer(omp_lock_kind) :: lck(ao_num) + integer*8 :: i8 + integer :: ii(8), jj(8), kk(8), ll(8), k2 + integer(cache_map_size_kind) :: n_elements_max, n_elements + integer(key_kind), allocatable :: keys(:) + double precision, allocatable :: values(:) + + ao_bi_elec_integral_alpha = 0.d0 + ao_bi_elec_integral_beta = 0.d0 + !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max,n_elements)& + !$OMP SHARED(ao_num,HF_density_matrix_ao_alpha,HF_density_matrix_ao_beta,& + !$OMP ao_integrals_map) & + !$OMP REDUCTION(+:ao_bi_elec_integral_alpha,ao_bi_elec_integral_beta) + + call get_cache_map_n_elements_max(ao_integrals_map,n_elements_max) + allocate(keys(n_elements_max), values(n_elements_max)) + + !$OMP DO SCHEDULE(dynamic) + do i8=0_8,ao_integrals_map%map_size + n_elements = n_elements_max + call get_cache_map(ao_integrals_map,i8,keys,values,n_elements) + do k1=1,n_elements + call bielec_integrals_index_reverse(kk,ii,ll,jj,keys(k1)) + + do k2=1,8 + if (kk(k2)==0) then + cycle + endif + i = ii(k2) + j = jj(k2) + k = kk(k2) + l = ll(k2) + integral = (HF_density_matrix_ao_alpha(k,l)+HF_density_matrix_ao_beta(k,l)) * values(k1) + ao_bi_elec_integral_alpha(i,j) += integral + ao_bi_elec_integral_beta (i,j) += integral + integral = values(k1) + ao_bi_elec_integral_alpha(l,j) -= HF_density_matrix_ao_alpha(k,i) * integral + ao_bi_elec_integral_beta (l,j) -= HF_density_matrix_ao_beta (k,i) * integral + enddo + enddo + enddo + !$OMP END DO + deallocate(keys,values) + !$OMP END PARALLEL + + endif + +END_PROVIDER + + + + + + +BEGIN_PROVIDER [ double precision, Fock_matrix_alpha_mo, (mo_tot_num_align,mo_tot_num) ] + implicit none + BEGIN_DOC + ! Fock matrix on the MO basis + END_DOC + double precision, allocatable :: T(:,:) + allocate ( T(ao_num_align,mo_tot_num) ) + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: T + call dgemm('N','N', ao_num, mo_tot_num, ao_num, & + 1.d0, Fock_matrix_alpha_ao,size(Fock_matrix_alpha_ao,1), & + mo_coef, size(mo_coef,1), & + 0.d0, T, ao_num_align) + call dgemm('T','N', mo_tot_num, mo_tot_num, ao_num, & + 1.d0, mo_coef,size(mo_coef,1), & + T, size(T,1), & + 0.d0, Fock_matrix_alpha_mo, mo_tot_num_align) + deallocate(T) +END_PROVIDER + + +BEGIN_PROVIDER [ double precision, Fock_matrix_beta_mo, (mo_tot_num_align,mo_tot_num) ] + implicit none + BEGIN_DOC + ! Fock matrix on the MO basis + END_DOC + double precision, allocatable :: T(:,:) + allocate ( T(ao_num_align,mo_tot_num) ) + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: T + call dgemm('N','N', ao_num, mo_tot_num, ao_num, & + 1.d0, Fock_matrix_beta_ao,size(Fock_matrix_beta_ao,1), & + mo_coef, size(mo_coef,1), & + 0.d0, T, ao_num_align) + call dgemm('T','N', mo_tot_num, mo_tot_num, ao_num, & + 1.d0, mo_coef,size(mo_coef,1), & + T, size(T,1), & + 0.d0, Fock_matrix_beta_mo, mo_tot_num_align) + deallocate(T) +END_PROVIDER + +BEGIN_PROVIDER [ double precision, HF_energy ] + implicit none + BEGIN_DOC + ! Hartree-Fock energy + END_DOC + HF_energy = nuclear_repulsion + + integer :: i,j + do j=1,ao_num + do i=1,ao_num + HF_energy += 0.5d0 * ( & + (ao_mono_elec_integral(i,j) + Fock_matrix_alpha_ao(i,j) ) * HF_density_matrix_ao_alpha(i,j) +& + (ao_mono_elec_integral(i,j) + Fock_matrix_beta_ao (i,j) ) * HF_density_matrix_ao_beta (i,j) ) + enddo + enddo + +END_PROVIDER + + +BEGIN_PROVIDER [ double precision, Fock_matrix_ao, (ao_num_align, ao_num) ] + implicit none + BEGIN_DOC + ! Fock matrix in AO basis set + END_DOC + + if (elec_alpha_num == elec_beta_num) then + integer :: i,j + do j=1,ao_num + !DIR$ VECTOR ALIGNED + do i=1,ao_num_align + Fock_matrix_ao(i,j) = Fock_matrix_alpha_ao(i,j) + enddo + enddo + else + double precision, allocatable :: T(:,:), M(:,:) + ! F_ao = S C F_mo C^t S + allocate (T(ao_num_align,ao_num),M(ao_num_align,ao_num)) + call dgemm('N','N', ao_num,ao_num,ao_num, 1.d0, & + ao_overlap, size(ao_overlap,1), & + mo_coef, size(mo_coef,1), & + 0.d0, & + M, size(M,1)) + call dgemm('N','N', ao_num,mo_tot_num,mo_tot_num, 1.d0, & + M, size(M,1), & + Fock_matrix_mo, size(Fock_matrix_mo,1), & + 0.d0, & + T, size(T,1)) + call dgemm('N','T', mo_tot_num,ao_num,mo_tot_num, 1.d0, & + T, size(T,1), & + mo_coef, size(mo_coef,1), & + 0.d0, & + M, size(M,1)) + call dgemm('N','N', ao_num,ao_num,ao_num, 1.d0, & + M, size(M,1), & + ao_overlap, size(ao_overlap,1), & + 0.d0, & + Fock_matrix_ao, size(Fock_matrix_ao,1)) + + deallocate(T) + endif +END_PROVIDER + +subroutine Fock_mo_to_ao(FMO,LDFMO,FAO,LDFAO) + implicit none + integer, intent(in) :: LDFMO ! size(FMO,1) + integer, intent(in) :: LDFAO ! size(FAO,1) + double precision, intent(in) :: FMO(LDFMO,*) + double precision, intent(out) :: FAO(LDFAO,*) + + double precision, allocatable :: T(:,:), M(:,:) + ! F_ao = S C F_mo C^t S + allocate (T(ao_num_align,ao_num),M(ao_num_align,ao_num)) + call dgemm('N','N', ao_num,ao_num,ao_num, 1.d0, & + ao_overlap, size(ao_overlap,1), & + mo_coef, size(mo_coef,1), & + 0.d0, & + M, size(M,1)) + call dgemm('N','N', ao_num,mo_tot_num,mo_tot_num, 1.d0, & + M, size(M,1), & + FMO, size(FMO,1), & + 0.d0, & + T, size(T,1)) + call dgemm('N','T', mo_tot_num,ao_num,mo_tot_num, 1.d0, & + T, size(T,1), & + mo_coef, size(mo_coef,1), & + 0.d0, & + M, size(M,1)) + call dgemm('N','N', ao_num,ao_num,ao_num, 1.d0, & + M, size(M,1), & + ao_overlap, size(ao_overlap,1), & + 0.d0, & + FAO, size(FAO,1)) + deallocate(T,M) +end + diff --git a/plugins/Hartree_Fock/HF_density_matrix_ao.irp.f b/plugins/Hartree_Fock/HF_density_matrix_ao.irp.f new file mode 100644 index 00000000..e8585f59 --- /dev/null +++ b/plugins/Hartree_Fock/HF_density_matrix_ao.irp.f @@ -0,0 +1,41 @@ +BEGIN_PROVIDER [ double precision, HF_density_matrix_ao_alpha, (ao_num_align,ao_num) ] + implicit none + BEGIN_DOC + ! S^-1 x Alpha density matrix in the AO basis x S^-1 + END_DOC + + call dgemm('N','T',ao_num,ao_num,elec_alpha_num,1.d0, & + mo_coef, size(mo_coef,1), & + mo_coef, size(mo_coef,1), 0.d0, & + HF_density_matrix_ao_alpha, size(HF_density_matrix_ao_alpha,1)) + +END_PROVIDER + +BEGIN_PROVIDER [ double precision, HF_density_matrix_ao_beta, (ao_num_align,ao_num) ] + implicit none + BEGIN_DOC + ! S^-1 Beta density matrix in the AO basis x S^-1 + END_DOC + + call dgemm('N','T',ao_num,ao_num,elec_beta_num,1.d0, & + mo_coef, size(mo_coef,1), & + mo_coef, size(mo_coef,1), 0.d0, & + HF_density_matrix_ao_beta, size(HF_density_matrix_ao_beta,1)) + +END_PROVIDER + +BEGIN_PROVIDER [ double precision, HF_density_matrix_ao, (ao_num_align,ao_num) ] + implicit none + BEGIN_DOC + ! S^-1 Density matrix in the AO basis S^-1 + END_DOC + ASSERT (size(HF_density_matrix_ao,1) == size(HF_density_matrix_ao_alpha,1)) + if (elec_alpha_num== elec_beta_num) then + HF_density_matrix_ao = HF_density_matrix_ao_alpha + HF_density_matrix_ao_alpha + else + ASSERT (size(HF_density_matrix_ao,1) == size(HF_density_matrix_ao_beta ,1)) + HF_density_matrix_ao = HF_density_matrix_ao_alpha + HF_density_matrix_ao_beta + endif + +END_PROVIDER + diff --git a/plugins/Hartree_Fock/Hartree_Fock b/plugins/Hartree_Fock/Hartree_Fock new file mode 120000 index 00000000..ca3fae3a --- /dev/null +++ b/plugins/Hartree_Fock/Hartree_Fock @@ -0,0 +1 @@ +/home/razoa/quantum_package/bulk/Hartree_Fock \ No newline at end of file diff --git a/plugins/Hartree_Fock/Huckel_guess.irp.f b/plugins/Hartree_Fock/Huckel_guess.irp.f new file mode 100644 index 00000000..ed264005 --- /dev/null +++ b/plugins/Hartree_Fock/Huckel_guess.irp.f @@ -0,0 +1,6 @@ +program guess + implicit none + character*(64) :: label + call huckel_guess + +end diff --git a/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES b/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..784cb0fb --- /dev/null +++ b/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +Integrals_Bielec MOGuess diff --git a/plugins/Hartree_Fock/README.rst b/plugins/Hartree_Fock/README.rst new file mode 100644 index 00000000..4dacf17c --- /dev/null +++ b/plugins/Hartree_Fock/README.rst @@ -0,0 +1,152 @@ +=================== +Hartree-Fock Module +=================== + +From the 140 molecules of the G2 set, only LiO, ONa don't converge well. + +Needed Modules +============== + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +.. image:: tree_dependency.png + +* `Integrals_Bielec `_ +* `MOGuess `_ + +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +`ao_bi_elec_integral_alpha `_ + Alpha Fock matrix in AO basis set + + +`ao_bi_elec_integral_beta `_ + Alpha Fock matrix in AO basis set + + +`create_guess `_ + Create an MO guess if no MOs are present in the EZFIO directory + + +`damping_scf `_ + Undocumented + + +`diagonal_fock_matrix_mo `_ + Diagonal Fock matrix in the MO basis + + +`diagonal_fock_matrix_mo_sum `_ + diagonal element of the fock matrix calculated as the sum over all the interactions + with all the electrons in the RHF determinant + diagonal_Fock_matrix_mo_sum(i) = sum_{j=1, N_elec} 2 J_ij -K_ij + + +`eigenvectors_fock_matrix_mo `_ + Diagonal Fock matrix in the MO basis + + +`fock_matrix_alpha_ao `_ + Alpha Fock matrix in AO basis set + + +`fock_matrix_alpha_mo `_ + Fock matrix on the MO basis + + +`fock_matrix_ao `_ + Fock matrix in AO basis set + + +`fock_matrix_beta_ao `_ + Alpha Fock matrix in AO basis set + + +`fock_matrix_beta_mo `_ + Fock matrix on the MO basis + + +`fock_matrix_diag_mo `_ + Fock matrix on the MO basis. + For open shells, the ROHF Fock Matrix is + .br + | F-K | F + K/2 | F | + |---------------------------------| + | F + K/2 | F | F - K/2 | + |---------------------------------| + | F | F - K/2 | F + K | + .br + F = 1/2 (Fa + Fb) + .br + K = Fb - Fa + .br + + +`fock_matrix_mo `_ + Fock matrix on the MO basis. + For open shells, the ROHF Fock Matrix is + .br + | F-K | F + K/2 | F | + |---------------------------------| + | F + K/2 | F | F - K/2 | + |---------------------------------| + | F | F - K/2 | F + K | + .br + F = 1/2 (Fa + Fb) + .br + K = Fb - Fa + .br + + +`fock_mo_to_ao `_ + Undocumented + + +`guess `_ + Undocumented + + +`hf_density_matrix_ao `_ + S^-1 Density matrix in the AO basis S^-1 + + +`hf_density_matrix_ao_alpha `_ + S^-1 x Alpha density matrix in the AO basis x S^-1 + + +`hf_density_matrix_ao_beta `_ + S^-1 Beta density matrix in the AO basis x S^-1 + + +`hf_energy `_ + Hartree-Fock energy + + +`huckel_guess `_ + Build the MOs using the extended Huckel model + + +`mo_guess_type `_ + Initial MO guess. Can be [ Huckel | HCore ] + + +`n_it_scf_max `_ + Maximum number of SCF iterations + + +`run `_ + Run SCF calculation + + +`scf `_ + Undocumented + + +`thresh_scf `_ + Threshold on the convergence of the Hartree Fock energy + diff --git a/plugins/Hartree_Fock/SCF.irp.f b/plugins/Hartree_Fock/SCF.irp.f new file mode 100644 index 00000000..33e1ac6c --- /dev/null +++ b/plugins/Hartree_Fock/SCF.irp.f @@ -0,0 +1,52 @@ + +program scf + call create_guess + call orthonormalize_mos + call run +end + +subroutine create_guess + implicit none + BEGIN_DOC +! Create an MO guess if no MOs are present in the EZFIO directory + END_DOC + logical :: exists + PROVIDE ezfio_filename + call ezfio_has_mo_basis_mo_coef(exists) + if (.not.exists) then + if (mo_guess_type == "HCore") then + mo_coef = ao_ortho_lowdin_coef + TOUCH mo_coef + mo_label = 'Guess' + call mo_as_eigvectors_of_mo_matrix(mo_mono_elec_integral,size(mo_mono_elec_integral,1),size(mo_mono_elec_integral,2),mo_label) + SOFT_TOUCH mo_coef mo_label + else if (mo_guess_type == "Huckel") then + call huckel_guess + else + print *, 'Unrecognized MO guess type : '//mo_guess_type + stop 1 + endif + endif +end + + +subroutine run + + use bitmasks + implicit none + BEGIN_DOC +! Run SCF calculation + END_DOC + double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem,get_mo_bielec_integral + double precision :: E0 + integer :: i_it, i, j, k + + E0 = HF_energy + + thresh_SCF = 1.d-10 + call damping_SCF + mo_label = "Canonical" + TOUCH mo_label mo_coef + call save_mos + +end diff --git a/plugins/Hartree_Fock/damping_SCF.irp.f b/plugins/Hartree_Fock/damping_SCF.irp.f new file mode 100644 index 00000000..d55bc8b8 --- /dev/null +++ b/plugins/Hartree_Fock/damping_SCF.irp.f @@ -0,0 +1,127 @@ +subroutine damping_SCF + implicit none + double precision :: E + double precision, allocatable :: D_alpha(:,:), D_beta(:,:) + double precision :: E_new + double precision, allocatable :: D_new_alpha(:,:), D_new_beta(:,:), F_new(:,:) + double precision, allocatable :: delta_alpha(:,:), delta_beta(:,:) + double precision :: lambda, E_half, a, b, delta_D, delta_E, E_min + + integer :: i,j,k + logical :: saving + character :: save_char + + allocate( & + D_alpha( ao_num_align, ao_num ), & + D_beta( ao_num_align, ao_num ), & + F_new( ao_num_align, ao_num ), & + D_new_alpha( ao_num_align, ao_num ), & + D_new_beta( ao_num_align, ao_num ), & + delta_alpha( ao_num_align, ao_num ), & + delta_beta( ao_num_align, ao_num )) + + do j=1,ao_num + do i=1,ao_num + D_alpha(i,j) = HF_density_matrix_ao_alpha(i,j) + D_beta (i,j) = HF_density_matrix_ao_beta (i,j) + enddo + enddo + + + call write_time(output_hartree_fock) + + write(output_hartree_fock,'(A4,X,A16, X, A16, X, A16, X, A4 )'), '====','================','================','================', '====' + write(output_hartree_fock,'(A4,X,A16, X, A16, X, A16, X, A4 )'), ' N ', 'Energy ', 'Energy diff ', 'Density diff ', 'Save' + write(output_hartree_fock,'(A4,X,A16, X, A16, X, A16, X, A4 )'), '====','================','================','================', '====' + + E = HF_energy + 1.d0 + E_min = HF_energy + delta_D = 0.d0 + do k=1,n_it_scf_max + + delta_E = HF_energy - E + E = HF_energy + + if ( (delta_E < 0.d0).and.(dabs(delta_E) < thresh_scf) ) then + exit + endif + + saving = E < E_min + if (saving) then + call save_mos + save_char = 'X' + E_min = E + else + save_char = ' ' + endif + + write(output_hartree_fock,'(I4,X,F16.10, X, F16.10, X, F16.10, 3X, A )'), & + k, E, delta_E, delta_D, save_char + + D_alpha = HF_density_matrix_ao_alpha + D_beta = HF_density_matrix_ao_beta + mo_coef = eigenvectors_fock_matrix_mo + TOUCH mo_coef + + D_new_alpha = HF_density_matrix_ao_alpha + D_new_beta = HF_density_matrix_ao_beta + F_new = Fock_matrix_ao + E_new = HF_energy + + delta_alpha = D_new_alpha - D_alpha + delta_beta = D_new_beta - D_beta + + lambda = .5d0 + E_half = 0.d0 + do while (E_half > E) + HF_density_matrix_ao_alpha = D_alpha + lambda * delta_alpha + HF_density_matrix_ao_beta = D_beta + lambda * delta_beta + TOUCH HF_density_matrix_ao_alpha HF_density_matrix_ao_beta + mo_coef = eigenvectors_fock_matrix_mo + TOUCH mo_coef + E_half = HF_energy + if ((E_half > E).and.(E_new < E)) then + lambda = 1.d0 + exit + else if ((E_half > E).and.(lambda > 5.d-2)) then + lambda = 0.5d0 * lambda + E_new = E_half + else + exit + endif + enddo + + a = (E_new + E - 2.d0*E_half)*2.d0 + b = -E_new - 3.d0*E + 4.d0*E_half + lambda = -lambda*b/a + D_alpha = (1.d0-lambda) * D_alpha + lambda * D_new_alpha + D_beta = (1.d0-lambda) * D_beta + lambda * D_new_beta + delta_E = HF_energy - E + do j=1,ao_num + do i=1,ao_num + delta_D = delta_D + & + (D_alpha(i,j) - HF_density_matrix_ao_alpha(i,j))*(D_alpha(i,j) - HF_density_matrix_ao_alpha(i,j)) + & + (D_beta (i,j) - HF_density_matrix_ao_beta (i,j))*(D_beta (i,j) - HF_density_matrix_ao_beta (i,j)) + enddo + enddo + delta_D = dsqrt(delta_D/dble(ao_num)**2) + HF_density_matrix_ao_alpha = D_alpha + HF_density_matrix_ao_beta = D_beta + TOUCH HF_density_matrix_ao_alpha HF_density_matrix_ao_beta + mo_coef = eigenvectors_fock_matrix_mo + TOUCH mo_coef + + + enddo + write(output_hartree_fock,'(A4,X,A16, X, A16, X, A16, X, A4 )'), '====','================','================','================', '====' + write(output_hartree_fock,*) + + call mo_as_eigvectors_of_mo_matrix(Fock_matrix_mo,size(Fock_matrix_mo,1),size(Fock_matrix_mo,2),mo_label) + + call write_double(output_hartree_fock, E_min, 'Hartree-Fock energy') + call ezfio_set_hartree_fock_energy(E_min) + + call write_time(output_hartree_fock) + + deallocate(D_alpha,D_beta,F_new,D_new_alpha,D_new_beta,delta_alpha,delta_beta) +end diff --git a/plugins/Hartree_Fock/diagonalize_fock.irp.f b/plugins/Hartree_Fock/diagonalize_fock.irp.f new file mode 100644 index 00000000..90bfddcb --- /dev/null +++ b/plugins/Hartree_Fock/diagonalize_fock.irp.f @@ -0,0 +1,91 @@ + BEGIN_PROVIDER [ double precision, diagonal_Fock_matrix_mo, (ao_num) ] +&BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num_align,mo_tot_num) ] + implicit none + BEGIN_DOC + ! Diagonal Fock matrix in the MO basis + END_DOC + + integer :: i,j + integer :: liwork, lwork, n, info + integer, allocatable :: iwork(:) + double precision, allocatable :: work(:), F(:,:), S(:,:) + + allocate(F(ao_num_align,ao_num), S(ao_num_align,ao_num) ) + do j=1,ao_num + do i=1,ao_num + S(i,j) = ao_overlap(i,j) + F(i,j) = Fock_matrix_ao(i,j) + enddo + enddo + + n = ao_num + lwork = 1+6*n + 2*n*n + liwork = 3 + 5*n + + allocate(work(lwork), iwork(liwork) ) + + lwork = -1 + liwork = -1 + + call dsygvd(1,'v','u',ao_num,F,size(F,1),S,size(S,1),& + diagonal_Fock_matrix_mo, work, lwork, iwork, liwork, info) +! call dsygv(1, 'v', 'u',ao_num,F,size(F,1),S,size(S,1),& +! diagonal_Fock_matrix_mo, work, lwork, info) + + + + if (info /= 0) then + print *, irp_here//' failed : ', info + stop 1 + endif + lwork = int(work(1)) + liwork = iwork(1) + deallocate(work,iwork) + allocate(work(lwork), iwork(liwork) ) +! deallocate(work) +! allocate(work(lwork)) + + call dsygvd(1,'v','u',ao_num,F,size(F,1),S,size(S,1),& + diagonal_Fock_matrix_mo, work, lwork, iwork, liwork, info) + +! call dsygv(1, 'v', 'u',ao_num,F,size(F,1),S,size(S,1),& +! diagonal_Fock_matrix_mo, work, lwork, info) + + if (info /= 0) then + print *, irp_here//' failed : ', info + stop 1 + endif + do j=1,mo_tot_num + do i=1,ao_num + eigenvectors_Fock_matrix_mo(i,j) = F(i,j) + enddo + enddo + + deallocate(work, iwork, F, S) +END_PROVIDER + +BEGIN_PROVIDER [double precision, diagonal_Fock_matrix_mo_sum, (mo_tot_num)] + implicit none + BEGIN_DOC + ! diagonal element of the fock matrix calculated as the sum over all the interactions + ! with all the electrons in the RHF determinant + ! diagonal_Fock_matrix_mo_sum(i) = sum_{j=1, N_elec} 2 J_ij -K_ij + END_DOC + integer :: i,j + double precision :: accu + do i = 1,elec_alpha_num + accu = 0.d0 + do j = 1, elec_alpha_num + accu += 2.d0 * mo_bielec_integral_jj_from_ao(i,j) - mo_bielec_integral_jj_exchange_from_ao(i,j) + enddo + diagonal_Fock_matrix_mo_sum(i) = accu + mo_mono_elec_integral(i,i) + enddo + do i = elec_alpha_num+1,mo_tot_num + accu = 0.d0 + do j = 1, elec_alpha_num + accu += 2.d0 * mo_bielec_integral_jj_from_ao(i,j) - mo_bielec_integral_jj_exchange_from_ao(i,j) + enddo + diagonal_Fock_matrix_mo_sum(i) = accu + mo_mono_elec_integral(i,i) + enddo + +END_PROVIDER diff --git a/plugins/Hartree_Fock/huckel.irp.f b/plugins/Hartree_Fock/huckel.irp.f new file mode 100644 index 00000000..4ea8d93f --- /dev/null +++ b/plugins/Hartree_Fock/huckel.irp.f @@ -0,0 +1,34 @@ +subroutine huckel_guess + implicit none + BEGIN_DOC +! Build the MOs using the extended Huckel model + END_DOC + integer :: i,j + double precision :: tmp_matrix(ao_num_align,ao_num),accu + double precision :: c + character*(64) :: label + + mo_coef = ao_ortho_lowdin_coef + TOUCH mo_coef + label = "Guess" + call mo_as_eigvectors_of_mo_matrix(mo_mono_elec_integral, & + size(mo_mono_elec_integral,1),size(mo_mono_elec_integral,2),label) + TOUCH mo_coef + + c = 0.5d0 * 1.75d0 + do j=1,ao_num + do i=1,ao_num + if (i/=j) then + Fock_matrix_ao(i,j) = c*ao_overlap(i,j)*(ao_mono_elec_integral(i,i) + & + ao_mono_elec_integral(j,j)) + else + Fock_matrix_ao(i,j) = Fock_matrix_alpha_ao(i,j) + endif + enddo + enddo + TOUCH Fock_matrix_ao + mo_coef = eigenvectors_fock_matrix_mo + SOFT_TOUCH mo_coef + call save_mos + +end diff --git a/plugins/Hartree_Fock/test b/plugins/Hartree_Fock/test new file mode 100644 index 00000000..e69de29b diff --git a/plugins/Hartree_Fock/tree_dependency.png b/plugins/Hartree_Fock/tree_dependency.png new file mode 100644 index 00000000..82a2ac8e Binary files /dev/null and b/plugins/Hartree_Fock/tree_dependency.png differ diff --git a/src/MP2/.gitignore b/plugins/MP2/.gitignore similarity index 100% rename from src/MP2/.gitignore rename to plugins/MP2/.gitignore diff --git a/src/MP2/H_apply.irp.f b/plugins/MP2/H_apply.irp.f similarity index 100% rename from src/MP2/H_apply.irp.f rename to plugins/MP2/H_apply.irp.f diff --git a/src/MP2/NEEDED_CHILDREN_MODULES b/plugins/MP2/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/MP2/NEEDED_CHILDREN_MODULES rename to plugins/MP2/NEEDED_CHILDREN_MODULES diff --git a/src/MP2/README.rst b/plugins/MP2/README.rst similarity index 100% rename from src/MP2/README.rst rename to plugins/MP2/README.rst diff --git a/src/MP2/mp2.irp.f b/plugins/MP2/mp2.irp.f similarity index 100% rename from src/MP2/mp2.irp.f rename to plugins/MP2/mp2.irp.f diff --git a/src/MP2/tree_dependency.png b/plugins/MP2/tree_dependency.png similarity index 100% rename from src/MP2/tree_dependency.png rename to plugins/MP2/tree_dependency.png diff --git a/src/MRCC/.gitignore b/plugins/MRCC/.gitignore similarity index 100% rename from src/MRCC/.gitignore rename to plugins/MRCC/.gitignore diff --git a/src/MRCC/EZFIO.cfg b/plugins/MRCC/EZFIO.cfg similarity index 100% rename from src/MRCC/EZFIO.cfg rename to plugins/MRCC/EZFIO.cfg diff --git a/src/MRCC/H_apply.irp.f b/plugins/MRCC/H_apply.irp.f similarity index 100% rename from src/MRCC/H_apply.irp.f rename to plugins/MRCC/H_apply.irp.f diff --git a/plugins/MRCC/NEEDED_CHILDREN_MODULES b/plugins/MRCC/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..04ce9e78 --- /dev/null +++ b/plugins/MRCC/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +Perturbation Selectors_full Generators_full diff --git a/src/MRCC/README.rst b/plugins/MRCC/README.rst similarity index 100% rename from src/MRCC/README.rst rename to plugins/MRCC/README.rst diff --git a/src/MRCC/davidson.irp.f b/plugins/MRCC/davidson.irp.f similarity index 100% rename from src/MRCC/davidson.irp.f rename to plugins/MRCC/davidson.irp.f diff --git a/src/MRCC/mrcc.irp.f b/plugins/MRCC/mrcc.irp.f similarity index 100% rename from src/MRCC/mrcc.irp.f rename to plugins/MRCC/mrcc.irp.f diff --git a/src/MRCC/mrcc_dress.irp.f b/plugins/MRCC/mrcc_dress.irp.f similarity index 100% rename from src/MRCC/mrcc_dress.irp.f rename to plugins/MRCC/mrcc_dress.irp.f diff --git a/src/MRCC/mrcc_utils.irp.f b/plugins/MRCC/mrcc_utils.irp.f similarity index 100% rename from src/MRCC/mrcc_utils.irp.f rename to plugins/MRCC/mrcc_utils.irp.f diff --git a/src/MRCC/tree_dependency.png b/plugins/MRCC/tree_dependency.png similarity index 100% rename from src/MRCC/tree_dependency.png rename to plugins/MRCC/tree_dependency.png diff --git a/src/Molden/.gitignore b/plugins/Molden/.gitignore similarity index 100% rename from src/Molden/.gitignore rename to plugins/Molden/.gitignore diff --git a/src/Molden/NEEDED_CHILDREN_MODULES b/plugins/Molden/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Molden/NEEDED_CHILDREN_MODULES rename to plugins/Molden/NEEDED_CHILDREN_MODULES diff --git a/src/Molden/README.rst b/plugins/Molden/README.rst similarity index 100% rename from src/Molden/README.rst rename to plugins/Molden/README.rst diff --git a/src/Molden/print_mo.irp.f b/plugins/Molden/print_mo.irp.f similarity index 100% rename from src/Molden/print_mo.irp.f rename to plugins/Molden/print_mo.irp.f diff --git a/src/Molden/tree_dependency.png b/plugins/Molden/tree_dependency.png similarity index 100% rename from src/Molden/tree_dependency.png rename to plugins/Molden/tree_dependency.png diff --git a/src/Perturbation/.gitignore b/plugins/Perturbation/.gitignore similarity index 100% rename from src/Perturbation/.gitignore rename to plugins/Perturbation/.gitignore diff --git a/src/Perturbation/EZFIO.cfg b/plugins/Perturbation/EZFIO.cfg similarity index 100% rename from src/Perturbation/EZFIO.cfg rename to plugins/Perturbation/EZFIO.cfg diff --git a/src/Perturbation/Moller_plesset.irp.f b/plugins/Perturbation/Moller_plesset.irp.f similarity index 100% rename from src/Perturbation/Moller_plesset.irp.f rename to plugins/Perturbation/Moller_plesset.irp.f diff --git a/src/Perturbation/NEEDED_CHILDREN_MODULES b/plugins/Perturbation/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Perturbation/NEEDED_CHILDREN_MODULES rename to plugins/Perturbation/NEEDED_CHILDREN_MODULES diff --git a/src/Perturbation/README.rst b/plugins/Perturbation/README.rst similarity index 100% rename from src/Perturbation/README.rst rename to plugins/Perturbation/README.rst diff --git a/src/Perturbation/delta_rho_perturbation.irp.f b/plugins/Perturbation/delta_rho_perturbation.irp.f similarity index 100% rename from src/Perturbation/delta_rho_perturbation.irp.f rename to plugins/Perturbation/delta_rho_perturbation.irp.f diff --git a/src/Perturbation/dipole_moment.irp.f b/plugins/Perturbation/dipole_moment.irp.f similarity index 100% rename from src/Perturbation/dipole_moment.irp.f rename to plugins/Perturbation/dipole_moment.irp.f diff --git a/src/Perturbation/epstein_nesbet.irp.f b/plugins/Perturbation/epstein_nesbet.irp.f similarity index 100% rename from src/Perturbation/epstein_nesbet.irp.f rename to plugins/Perturbation/epstein_nesbet.irp.f diff --git a/src/Perturbation/exc_max.irp.f b/plugins/Perturbation/exc_max.irp.f similarity index 100% rename from src/Perturbation/exc_max.irp.f rename to plugins/Perturbation/exc_max.irp.f diff --git a/src/Perturbation/pert_sc2.irp.f b/plugins/Perturbation/pert_sc2.irp.f similarity index 100% rename from src/Perturbation/pert_sc2.irp.f rename to plugins/Perturbation/pert_sc2.irp.f diff --git a/src/Perturbation/pert_single.irp.f b/plugins/Perturbation/pert_single.irp.f similarity index 100% rename from src/Perturbation/pert_single.irp.f rename to plugins/Perturbation/pert_single.irp.f diff --git a/src/Perturbation/perturbation.irp.f b/plugins/Perturbation/perturbation.irp.f similarity index 100% rename from src/Perturbation/perturbation.irp.f rename to plugins/Perturbation/perturbation.irp.f diff --git a/src/Perturbation/perturbation.template.f b/plugins/Perturbation/perturbation.template.f similarity index 100% rename from src/Perturbation/perturbation.template.f rename to plugins/Perturbation/perturbation.template.f diff --git a/src/Perturbation/selection.irp.f b/plugins/Perturbation/selection.irp.f similarity index 100% rename from src/Perturbation/selection.irp.f rename to plugins/Perturbation/selection.irp.f diff --git a/src/Perturbation/tree_dependency.png b/plugins/Perturbation/tree_dependency.png similarity index 100% rename from src/Perturbation/tree_dependency.png rename to plugins/Perturbation/tree_dependency.png diff --git a/src/Properties/.gitignore b/plugins/Properties/.gitignore similarity index 100% rename from src/Properties/.gitignore rename to plugins/Properties/.gitignore diff --git a/src/Properties/EZFIO.cfg b/plugins/Properties/EZFIO.cfg similarity index 100% rename from src/Properties/EZFIO.cfg rename to plugins/Properties/EZFIO.cfg diff --git a/src/Properties/NEEDED_CHILDREN_MODULES b/plugins/Properties/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Properties/NEEDED_CHILDREN_MODULES rename to plugins/Properties/NEEDED_CHILDREN_MODULES diff --git a/src/Properties/README.rst b/plugins/Properties/README.rst similarity index 100% rename from src/Properties/README.rst rename to plugins/Properties/README.rst diff --git a/src/Properties/average.irp.f b/plugins/Properties/average.irp.f similarity index 100% rename from src/Properties/average.irp.f rename to plugins/Properties/average.irp.f diff --git a/src/Properties/delta_rho.irp.f b/plugins/Properties/delta_rho.irp.f similarity index 100% rename from src/Properties/delta_rho.irp.f rename to plugins/Properties/delta_rho.irp.f diff --git a/src/Properties/properties.irp.f b/plugins/Properties/properties.irp.f similarity index 100% rename from src/Properties/properties.irp.f rename to plugins/Properties/properties.irp.f diff --git a/src/Properties/routines_test.irp.f b/plugins/Properties/routines_test.irp.f similarity index 100% rename from src/Properties/routines_test.irp.f rename to plugins/Properties/routines_test.irp.f diff --git a/src/Properties/slater_rules_mono_electronic.irp.f b/plugins/Properties/slater_rules_mono_electronic.irp.f similarity index 100% rename from src/Properties/slater_rules_mono_electronic.irp.f rename to plugins/Properties/slater_rules_mono_electronic.irp.f diff --git a/src/Properties/tree_dependency.png b/plugins/Properties/tree_dependency.png similarity index 100% rename from src/Properties/tree_dependency.png rename to plugins/Properties/tree_dependency.png diff --git a/src/QmcChem/.gitignore b/plugins/QmcChem/.gitignore similarity index 100% rename from src/QmcChem/.gitignore rename to plugins/QmcChem/.gitignore diff --git a/src/QmcChem/NEEDED_CHILDREN_MODULES b/plugins/QmcChem/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/QmcChem/NEEDED_CHILDREN_MODULES rename to plugins/QmcChem/NEEDED_CHILDREN_MODULES diff --git a/src/QmcChem/README.rst b/plugins/QmcChem/README.rst similarity index 100% rename from src/QmcChem/README.rst rename to plugins/QmcChem/README.rst diff --git a/src/QmcChem/pot_ao_pseudo_ints.irp.f b/plugins/QmcChem/pot_ao_pseudo_ints.irp.f similarity index 100% rename from src/QmcChem/pot_ao_pseudo_ints.irp.f rename to plugins/QmcChem/pot_ao_pseudo_ints.irp.f diff --git a/src/QmcChem/pseudo.irp.f b/plugins/QmcChem/pseudo.irp.f similarity index 100% rename from src/QmcChem/pseudo.irp.f rename to plugins/QmcChem/pseudo.irp.f diff --git a/src/QmcChem/save_for_qmcchem.irp.f b/plugins/QmcChem/save_for_qmcchem.irp.f similarity index 100% rename from src/QmcChem/save_for_qmcchem.irp.f rename to plugins/QmcChem/save_for_qmcchem.irp.f diff --git a/src/QmcChem/tree_dependency.png b/plugins/QmcChem/tree_dependency.png similarity index 100% rename from src/QmcChem/tree_dependency.png rename to plugins/QmcChem/tree_dependency.png diff --git a/src/Selectors_full/.gitignore b/plugins/Selectors_full/.gitignore similarity index 100% rename from src/Selectors_full/.gitignore rename to plugins/Selectors_full/.gitignore diff --git a/src/Selectors_full/NEEDED_CHILDREN_MODULES b/plugins/Selectors_full/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Selectors_full/NEEDED_CHILDREN_MODULES rename to plugins/Selectors_full/NEEDED_CHILDREN_MODULES diff --git a/src/Selectors_full/README.rst b/plugins/Selectors_full/README.rst similarity index 100% rename from src/Selectors_full/README.rst rename to plugins/Selectors_full/README.rst diff --git a/src/Selectors_full/e_corr_selectors.irp.f b/plugins/Selectors_full/e_corr_selectors.irp.f similarity index 100% rename from src/Selectors_full/e_corr_selectors.irp.f rename to plugins/Selectors_full/e_corr_selectors.irp.f diff --git a/src/Selectors_full/selectors.irp.f b/plugins/Selectors_full/selectors.irp.f similarity index 100% rename from src/Selectors_full/selectors.irp.f rename to plugins/Selectors_full/selectors.irp.f diff --git a/src/Selectors_full/tree_dependency.png b/plugins/Selectors_full/tree_dependency.png similarity index 100% rename from src/Selectors_full/tree_dependency.png rename to plugins/Selectors_full/tree_dependency.png diff --git a/src/Selectors_no_sorted/.gitignore b/plugins/Selectors_no_sorted/.gitignore similarity index 100% rename from src/Selectors_no_sorted/.gitignore rename to plugins/Selectors_no_sorted/.gitignore diff --git a/src/Selectors_no_sorted/NEEDED_CHILDREN_MODULES b/plugins/Selectors_no_sorted/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/Selectors_no_sorted/NEEDED_CHILDREN_MODULES rename to plugins/Selectors_no_sorted/NEEDED_CHILDREN_MODULES diff --git a/src/Selectors_no_sorted/README.rst b/plugins/Selectors_no_sorted/README.rst similarity index 100% rename from src/Selectors_no_sorted/README.rst rename to plugins/Selectors_no_sorted/README.rst diff --git a/src/Selectors_no_sorted/e_corr_selectors.irp.f b/plugins/Selectors_no_sorted/e_corr_selectors.irp.f similarity index 100% rename from src/Selectors_no_sorted/e_corr_selectors.irp.f rename to plugins/Selectors_no_sorted/e_corr_selectors.irp.f diff --git a/src/Selectors_no_sorted/selectors.irp.f b/plugins/Selectors_no_sorted/selectors.irp.f similarity index 100% rename from src/Selectors_no_sorted/selectors.irp.f rename to plugins/Selectors_no_sorted/selectors.irp.f diff --git a/src/Selectors_no_sorted/tree_dependency.png b/plugins/Selectors_no_sorted/tree_dependency.png similarity index 100% rename from src/Selectors_no_sorted/tree_dependency.png rename to plugins/Selectors_no_sorted/tree_dependency.png diff --git a/src/SingleRefMethod/.gitignore b/plugins/SingleRefMethod/.gitignore similarity index 100% rename from src/SingleRefMethod/.gitignore rename to plugins/SingleRefMethod/.gitignore diff --git a/src/SingleRefMethod/NEEDED_CHILDREN_MODULES b/plugins/SingleRefMethod/NEEDED_CHILDREN_MODULES similarity index 100% rename from src/SingleRefMethod/NEEDED_CHILDREN_MODULES rename to plugins/SingleRefMethod/NEEDED_CHILDREN_MODULES diff --git a/src/SingleRefMethod/README.rst b/plugins/SingleRefMethod/README.rst similarity index 100% rename from src/SingleRefMethod/README.rst rename to plugins/SingleRefMethod/README.rst diff --git a/src/SingleRefMethod/generators.irp.f b/plugins/SingleRefMethod/generators.irp.f similarity index 100% rename from src/SingleRefMethod/generators.irp.f rename to plugins/SingleRefMethod/generators.irp.f diff --git a/src/SingleRefMethod/tree_dependency.png b/plugins/SingleRefMethod/tree_dependency.png similarity index 100% rename from src/SingleRefMethod/tree_dependency.png rename to plugins/SingleRefMethod/tree_dependency.png