diff --git a/.travis.yml b/.travis.yml index 0847b3d7..90de546d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,4 +36,4 @@ python: script: - ./configure --install all --config ./config/travis.cfg - source ./quantum_package.rc ; ninja -j 1 -v - - source ./quantum_package.rc ; qp_test -a -v + - source ./quantum_package.rc ; qp_test -a diff --git a/README.md b/README.md index aedb0b07..7dba42a5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Set of quantum chemistry programs and libraries. For more information, you can visit the [wiki of the project](http://github.com/LCPQ/quantum_package/wiki), or below for the installation instructions. - +The documentation is accessible [here](https://quantum-package-scemamamaster.readthedocs.io) Demo ==== diff --git a/REPLACE b/REPLACE new file mode 100644 index 00000000..0a6e2a64 --- /dev/null +++ b/REPLACE @@ -0,0 +1,146 @@ +qp_name mo_mono_elec_integral --rename=mo_mono_elec_integrals +qp_name mo_nucl_elec_integral --rename=mo_nucl_elec_integrals +qp_name mo_kinetic_integral --rename=mo_kinetic_integrals +qp_name disk_access_mo_one_integrals --replace="io_mo_one_e_integrals" +qp_name disk_access_mo_one_integrals --rename="io_mo_one_e_integrals" +qp_name disk_access_ao_one_integrals --rename="io_ao_one_e_integrals" +qp_name ao_mono_elec_integral --rename="ao_one_e_integrals" +qp_name disk_access_ao_integrals --rename="io_ao_two_e_integrals" +qp_name disk_access_mo_integrals --rename="io_mo_two_e_integrals" +qp_name io_mo_integrals --rename="io_mo_two_e_integrals" +qp_name io_ao_integrals --rename="io_ao_two_e_integrals" +qp_name read_ao_integrals --rename="read_ao_two_e_integrals" +qp_name read_mo_integrals --rename="read_mo_two_e_integrals" +qp_name write_mo_integrals --rename="write_mo_two_e_integrals" +qp_name write_ao_integrals --rename="write_ao_two_e_integrals" +qp_name ao_two_e_integrals --rename="ao_two_e_ints" +qp_name mo_two_e_integrals --rename="mo_two_e_ints" +qp_name mo_two_e_erf_integrals --rename="mo_two_e_erf_ints" +qp_name ao_two_e_erf_integrals --rename="ao_two_e_erf_ints" +qp_name ezfio_set_mo_two_e_ints_io_mo_integrals -r ezfio_set_mo_two_e_ints_io_mo_two_e_integrals +qp_name ezfio_set_ao_two_e_ints_io_ao_integrals -r ezfio_set_ao_two_e_ints_io_ao_two_e_integrals +qp_name mo_tot_num -r mo_num +qp_name ezfio_set_mo_basis_mo_tot_num -r ezfio_set_mo_basis_mo_num +qp_name ezfio_get_mo_basis_mo_tot_num -r ezfio_get_mo_basis_mo_num +qp_name ezfio_set_ao_two_e_integrals_disk_access_ao_integrals -r ezfio_set_ao_two_e_integrals_io_ao_two_e_integrals +qp_name ezfio_set_mo_two_e_integrals_disk_access_mo_integrals -r ezfio_set_mo_two_e_integrals_io_mo_two_e_integrals +qp_name ezfio_set_mo_two_e_integrals_io_mo_two_e_integrals -r ezfio_set_mo_two_e_ints_io_mo_two_e_integrals +qp_name ezfio_get_mo_two_e_integrals_io_mo_two_e_integrals -r ezfio_get_mo_two_e_ints_io_mo_two_e_integrals +qp_name ezfio_set_ao_two_e_integrals_io_ao_two_e_integrals -r ezfio_set_ao_two_e_ints_io_ao_two_e_integrals +qp_name ezfio_get_ao_two_e_integrals_io_ao_two_e_integrals -r ezfio_get_ao_two_e_ints_io_ao_two_e_integrals +qp_name ezfio_set_ao_two_e_erf_integrals_disk_access_ao_integrals_erf -r ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf +qp_name ezfio_set_mo_two_e_erf_integrals_disk_access_mo_integrals_erf -r ezfio_set_mo_two_e_erf_ints_io_mo_two_e_integrals_erf +qp_name disk_access_ao_integrals_erf io_ao_integrals_erf +qp_name disk_access_ao_integrals_erf -r io_ao_integrals_erf +qp_name disk_access_mo_integrals_erf -r io_mo_integrals_erf +qp_name write_mo_integrals_erf -r write_mo_two_e_integrals_erf +qp_name read_mo_integrals_erf -r read_mo_two_e_integrals_erf +qp_name ao_integrals_n_e +qp_name ao_nucl_elec_interals -r ao_integrals_n_e +qp_name ao_nucl_elec_integrals -r ao_integrals_n_e +qp_name ao_nucl_elec_integrals_per_atom -r ao_integrals_n_e_per_atom +qp_name bi_elec_ref_bitmask_energy -r ref_bitmask_two_e_energy +qp_name mono_elec_ref_bitmask_energy -r ref_bitmask_one_e_energy +qp_name kinetic_ref_bitmask_energy -r ref_bitmask_kinetic_energy +qp_name nucl_elec_ref_bitmask_energy -r ref_bitmask_e_n_energy +qp_name disk_access_ao_integrals_erf +qp_name mo_bielec_integral_jj +qp_name mo_bielec_integral_jj -r mo_two_e_integrals_jj +qp_name mo_bielec_integral_jj_anti -r mo_two_e_integrals_jj_anti +qp_name mo_bielec_integral_jj_anti_from_ao -r mo_two_e_integrals_jj_anti_from_ao +qp_name mo_bielec_integral_jj_anti_exchange -r mo_two_e_integrals_jj_exchange +qp_name mo_bielec_integral_jj_exchange -r mo_two_e_integrals_jj_exchange +qp_name mo_bielec_integral_jj_exchange_from_ao -r mo_two_e_integrals_jj_exchange_from_ao +qp_name mo_bielec_integral_vv_anti_from_ao -r mo_two_e_integrals_vv_anti_from_ao +qp_name mo_bielec_integral_vv_exchange_from_ao -r mo_two_e_integrals_vv_exchange_from_ao +qp_name mo_bielec_integral_vv_from_ao -r mo_two_e_integrals_vv_from_ao +qp_name mo_bielec_integrals_erf_in_map -r mo_two_e_integrals_erf_in_map +qp_name mo_bielec_integrals_in_map -r mo_two_e_integrals_in_map +qp_name ao_bielec_integrals_in_map -r ao_two_e_integrals_in_map +qp_name ao_bielec_integrals_erf_in_map -r ao_two_e_integrals_erf_in_map +qp_name mo_mono_elec_integrals -r mo_one_e_integrals +qp_name mo_nucl_elec_integrals -r mo_integrals_n_e +qp_name mo_nucl_elec_integrals_per_atom -r mo_integrals_n_e_per_atom +qp_name I_x1_pol_mult_mono_elec -r I_x1_pol_mult_one_e +qp_name I_x2_pol_mult_mono_elec -r I_x2_pol_mult_one_e +qp_name give_polynom_mult_center_mono_elec give_polynomial_mult_center_one_e +qp_name give_polynom_mult_center_mono_elec -r give_polynomial_mult_center_one_e +qp_name give_polynom_mult_center_mono_elec_erf -r give_polynomial_mult_center_one_e_erf +qp_name give_polynom_mult_center_mono_elec_erf_opt -r give_polynomial_mult_center_one_e_erf_opt +qp_name i_H_j_mono_spin_monoelec -r i_H_j_mono_spin_one_e +qp_name diag_H_mat_elem_monoelec -r diag_H_mat_elem_one_e +qp_name i_H_j_monoelec -r i_H_j_one_e +qp_name get_mo_bielec_integral -r get_two_e_integral +qp_name ao_bielec_integrals_in_map_slave_tcp -r ao_two_e_integrals_in_map_slave_tcp +qp_name get_ao_bielec_integrals_non_zero -r get_ao_two_e_integrals_non_zero +qp_name bielec +qp_name bielec -r two-electron +qp_name ao_bielec_integral -r ao_two_e_integral +qp_name compute_ao_bielec_integrals -r compute_ao_two_e_integrals +qp_name mo_bielec_integral_jj_from_ao -r mo_two_e_integral_jj_from_ao +qp_name bielec_tmp_1 -r two_e_tmp_1 +qp_name bielec_tmp_2 -r two_e_tmp_2 +qp_name bielec_tmp_3 -r two_e_tmp_3 +qp_name mo_bielec_integrals_index -r mo_two_e_integrals_index +qp_name bielec_tmp_0_idx -r two_e_tmp_0_idx +qp_name bielec_tmp_0 -r two_e_tmp_0 +qp_name get_ao_bielec_integrals -r get_ao_two_e_integrals +qp_name bielectronic -r two-electron +qp_name bielec_integrals_index -r two_e_integrals_index +qp_name mo_bielec_integral -r mo_two_e_integral +qp_name mo_bielec_integrals_ij -r mo_two_e_integrals_ij +qp_name get_mo_bielec_integrals_ij -r get_mo_two_e_integrals_ij +qp_name get_mo_bielec_integrals_i1j1 -r get_mo_two_e_integrals_i1j1 +qp_name get_mo_bielec_integrals_coulomb -r get_mo_two_e_integrals_coulomb +qp_name get_mo_bielec_integrals_coulomb_ii -r get_mo_two_e_integrals_coulomb_ii +qp_name get_mo_bielec_integrals_exch_ii -r get_mo_two_e_integrals_exch_ii +qp_name get_mo_bielec_integrals -r get_mo_two_e_integrals +qp_name get_ao_bielec_integrals_erf -r get_ao_two_e_integrals_erf +qp_name save_erf_bielec_ints_mo_into_ints_mo -r save_erf_two_e_ints_mo_into_ints_mo +qp_name get_mo_bielec_integral_erf -r get_mo_two_e_integral_erf +qp_name get_ao_bielec_integral_erf -r get_ao_two_e_integral_erf +qp_name bielec_integrals_index_reverse -r two_e_integrals_index_reverse +qp_name get_mo_bielec_integrals_erf -r get_mo_two_e_integrals_erf +qp_name ao_bielec_integral_schwartz -r ao_two_e_integral_schwartz +qp_name get_mo_bielec_integrals_erf_ij -r get_mo_two_e_integrals_erf_ij +qp_name get_mo_bielec_integrals_erf_i1j1 -r get_mo_two_e_integrals_erf_i1j1 +qp_name get_mo_bielec_integral_schwartz -r get_mo_two_e_integral_schwartz +qp_name get_ao_bielec_integrals_erf_non_zero -r get_ao_two_e_integrals_erf_non_zero +qp_name compute_ao_bielec_integrals_erf -r compute_ao_two_e_integrals_erf +qp_name mo_bielec_integrals_erf_index -r mo_two_e_integrals_erf_index +qp_name get_mo_bielec_integrals_erf_exch_ii -r get_mo_two_e_integrals_erf_exch_ii +qp_name get_mo_bielec_integrals_erf_coulomb_ii -r get_mo_two_e_integrals_erf_coulomb_ii +qp_name mo_bielec_integral_erf -r mo_two_e_integral_erf +qp_name i_H_j_bielec -r i_H_j_two_e +qp_name H_S2_u_0_bielec_nstates_openmp_work -r H_S2_u_0_two_e_nstates_openmp_work +qp_name H_S2_u_0_bielec_nstates_openmp_work_1 -r H_S2_u_0_two_e_nstates_openmp_work_1 +qp_name H_S2_u_0_bielec_nstates_openmp_work_2 -r H_S2_u_0_two_e_nstates_openmp_work_2 +qp_name H_S2_u_0_bielec_nstates_openmp_work_3 -r H_S2_u_0_two_e_nstates_openmp_work_3 +qp_name H_S2_u_0_bielec_nstates_openmp_work_4 -r H_S2_u_0_two_e_nstates_openmp_work_4 +qp_name H_S2_u_0_bielec_nstates_openmp -r H_S2_u_0_two_e_nstates_openmp +qp_name ac_operator_bielec -r ac_operator_two_e +qp_name aa_operator_bielec -r aa_operator_two_e +qp_name a_operator_bielec -r a_operator_two_e +qp_name u_0_H_u_0_bielec -r u_0_H_u_0_two_e +qp_name H_S2_u_0_bielec_nstates_openmp_work_$N_int +qp_name H_S2_u_0_bielec_nstates_openmp_work_$N_int #-r "H_S2_u_0_two_e_nstates_openmp_work_$N_int" +qp_name H_S2_u_0_bielec_nstates_openmp_work_$N_int -r "H_S2_u_0_two_e_nstates_openmp_work_$N_int" +qp_name ao_bielec_integral_erf -r ao_two_e_integral_erf +qp_name psi_energy_bielec -r psi_energy_two_e +qp_name ao_bielec_integrals_in_map_slave_inproc -r ao_two_e_integrals_in_map_slave_inproc +qp_name ao_bielec_integrals_in_map_collector -r ao_two_e_integrals_in_map_collector +qp_name ao_bielec_integral_schwartz_accel -r ao_two_e_integral_schwartz_accel +qp_name get_ao_bielec_integral -r get_ao_two_e_integral +qp_name ao_bielec_integrals_in_map_slave -r ao_two_e_integrals_in_map_slave +qp_name ao_bielec_integral_erf_schwartz -r ao_two_e_integral_erf_schwartz +qp_name ao_bielec_integral_schwartz_accel_erf -r ao_two_e_integral_schwartz_accel_erf +qp_name ao_bielec_integrals_erf_in_map_slave_tcp -r ao_two_e_integrals_erf_in_map_slave_tcp +qp_name ao_bielec_integrals_erf_in_map_slave -r ao_two_e_integrals_erf_in_map_slave +qp_name ao_bielec_integrals_erf_in_map_slave_inproc -r ao_two_e_integrals_erf_in_map_slave_inproc +qp_name ao_bielec_integrals_erf_in_map_collector -r ao_two_e_integrals_erf_in_map_collector +qp_name save_erf_bielec_ints_ao_into_ints_ao -r save_erf_two_e_ints_ao_into_ints_ao +qp_name save_erf_bi_elec_integrals_mo -r save_erf_two_e_integrals_mo +qp_name ao_bi_elec_integral_beta -r ao_two_e_integral_beta +qp_name ao_bi_elec_integral_alpha -r ao_two_e_integral_alpha +qp_name ao_bi_elec_integral_alpha_tmp -r ao_two_e_integral_alpha_tmp +qp_name ao_bi_elec_integral_beta_tmp -r ao_two_e_integral_beta_tmp diff --git a/configure b/configure index 7cb64986..cb05d609 100755 --- a/configure +++ b/configure @@ -15,13 +15,16 @@ Usage: Options: -c , --config define a configuration file, in - "${QP_ROOT}/config/" + "${QP_ROOT}/config/". -h, --help print the help message -i , --install install . Use at your own risk. Example: ./configure -c config/gfortran.cfg +Note: + - Using different configuration files for installing dependencies and + compiling QP can improve the user experience. EOF exit @@ -239,7 +242,7 @@ EOF elif [[ ${PACKAGE} = ezfio ]] ; then download \ - "https://gitlab.com/scemama/EZFIO/-/archive/v1.3.4/EZFIO-v1.3.4.tar.gz" + "https://gitlab.com/scemama/EZFIO/-/archive/v1.3.4/EZFIO-v1.3.4.tar.gz" \ "${QP_ROOT}"/external/ezfio.tar.gz ( cd "${QP_ROOT}"/external @@ -291,6 +294,7 @@ EOF "https://github.com/bats-core/bats-core/archive/v1.1.0.tar.gz" \ "${QP_ROOT}"/external/bats.tar.gz ( + cd "${QP_ROOT}"/external tar -zxf bats.tar.gz ( cd bats-core-1.1.0/ diff --git a/data/module_gitignore b/data/module_gitignore index a3145ad5..6369c858 100644 --- a/data/module_gitignore +++ b/data/module_gitignore @@ -7,8 +7,8 @@ tags Makefile ao_basis ao_one_e_integrals -ao_two_e_erf_integrals -ao_two_e_integrals +ao_two_e_erf_ints +ao_two_e_ints aux_quantities becke_numerical_grid bitmask @@ -37,8 +37,8 @@ kohn_sham_rs mo_basis mo_guess mo_one_e_integrals -mo_two_e_erf_integrals -mo_two_e_integrals +mo_two_e_erf_ints +mo_two_e_ints mpi mrpt_utils nuclei diff --git a/docs/source/Makefile b/docs/source/Makefile index cf351839..874ce344 100644 --- a/docs/source/Makefile +++ b/docs/source/Makefile @@ -1,4 +1,5 @@ default: + ./auto_generate.py make -C ../ html clean: make -C ../ clean diff --git a/docs/source/modules/ao_basis.rst b/docs/source/modules/ao_basis.rst new file mode 100644 index 00000000..863e9eec --- /dev/null +++ b/docs/source/modules/ao_basis.rst @@ -0,0 +1,657 @@ +.. _ao_basis: + +.. program:: ao_basis + +.. default-role:: option + +======== +ao_basis +======== + +This module describes the atomic orbitals basis set. + +An |AO| :math:`\chi` centered on nucleus A is represented as: + +.. math:: + + \chi_i({\bf r}) = (x-X_A)^a (y-Y_A)^b (z-Z_A)^c \sum_k c_{ki} e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2} + + +The |AO| coefficients are normalized as: + +.. math:: + + {\tilde c}_{ki} = \frac{c_{ki}}{ \int \left( (x-X_A)^a (y-Y_A)^b (z-Z_A)^c e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2} \right)^2 dr} + +Warning: `ao_coef` contains the |AO| coefficients given in input. These do not +include the normalization constant of the |AO|. The `ao_coef_normalized` provider includes +this normalization factor. + +The |AOs| are also sorted by increasing exponent to accelerate the calculation of +the two electron integrals. + + + + + + +EZFIO parameters +---------------- + +.. option:: ao_basis + + Name of the |AO| basis set + + +.. option:: ao_num + + Number of |AOs| + + +.. option:: ao_prim_num + + Number of primitives per |AO| + + +.. option:: ao_prim_num_max + + Maximum number of primitives + + Default: =maxval(ao_basis.ao_prim_num) + +.. option:: ao_nucl + + Index of the nucleus on which the |AO| is centered + + +.. option:: ao_power + + Powers of x, y and z for each |AO| + + +.. option:: ao_coef + + Primitive coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs. + + +.. option:: ao_expo + + Exponents for each primitive of each |AO| + + +.. option:: ao_md5 + + MD5 key, specific of the |AO| basis + + +.. option:: ao_cartesian + + If |true|, use |AOs| in Cartesian coordinates (6d,10f,...) + + Default: false + + +Providers +--------- + + +.. c:var:: ao_coef_normalization_factor + + .. code:: text + + double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_coef_normalization_factor (ao_num) + + File: :file:`aos.irp.f` + + Coefficients including the |AO| normalization + + + + +.. c:var:: ao_coef_normalization_libint_factor + + .. code:: text + + double precision, allocatable :: ao_coef_normalization_libint_factor (ao_num) + + File: :file:`aos.irp.f` + + |AO| normalization for interfacing with libint + + + + +.. c:var:: ao_coef_normalized + + .. code:: text + + double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_coef_normalization_factor (ao_num) + + File: :file:`aos.irp.f` + + Coefficients including the |AO| normalization + + + + +.. c:var:: ao_coef_normalized_ordered + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max) + + File: :file:`aos.irp.f` + + Sorted primitives to accelerate 4 index |MO| transformation + + + + +.. c:var:: ao_coef_normalized_ordered_transp + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered_transp (ao_prim_num_max,ao_num) + + File: :file:`aos.irp.f` + + Transposed :c:data:`ao_coef_normalized_ordered` + + + + +.. c:var:: ao_coef_normalized_ordered_transp_per_nucl + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + + + + + +.. c:var:: ao_expo_ordered + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max) + + File: :file:`aos.irp.f` + + Sorted primitives to accelerate 4 index |MO| transformation + + + + +.. c:var:: ao_expo_ordered_transp + + .. code:: text + + double precision, allocatable :: ao_expo_ordered_transp (ao_prim_num_max,ao_num) + + File: :file:`aos.irp.f` + + Transposed :c:data:`ao_expo_ordered` + + + + +.. c:var:: ao_expo_ordered_transp_per_nucl + + .. code:: text + + double precision, allocatable :: ao_expo_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + + + + + +.. c:var:: ao_l + + .. code:: text + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + File: :file:`aos.irp.f` + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + + + +.. c:var:: ao_l_char + + .. code:: text + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + File: :file:`aos.irp.f` + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + + + +.. c:var:: ao_l_char_space + + .. code:: text + + character*(4), allocatable :: ao_l_char_space (ao_num) + + File: :file:`aos.irp.f` + + Converts an l value to a string + + + + +.. c:var:: ao_l_max + + .. code:: text + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + File: :file:`aos.irp.f` + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + + + +.. c:var:: ao_power_ordered_transp_per_nucl + + .. code:: text + + integer, allocatable :: ao_power_ordered_transp_per_nucl (3,N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + + + + + +.. c:var:: ao_prim_num_max + + .. code:: text + + integer :: ao_prim_num_max + + File: :file:`aos.irp.f` + + Max number of primitives. + + + + +.. c:var:: cart_to_sphe_0 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_0 (1,1) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=0 + + + + +.. c:var:: cart_to_sphe_1 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_1 (3,3) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=1 + + + + +.. c:var:: cart_to_sphe_2 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_2 (6,5) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=2 + + + + +.. c:var:: cart_to_sphe_3 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_3 (10,7) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=3 + + + + +.. c:var:: cart_to_sphe_4 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_4 (15,9) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=4 + + + + +.. c:var:: cart_to_sphe_5 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_5 (21,11) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=5 + + + + +.. c:var:: cart_to_sphe_6 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_6 (28,13) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=6 + + + + +.. c:var:: cart_to_sphe_7 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_7 (36,15) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=7 + + + + +.. c:var:: cart_to_sphe_8 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_8 (45,17) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=8 + + + + +.. c:var:: cart_to_sphe_9 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_9 (55,19) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=9 + + + + +.. c:var:: l_to_charater + + .. code:: text + + character*(128), allocatable :: l_to_charater (0:7) + + File: :file:`aos.irp.f` + + Character corresponding to the "l" value of an |AO| + + + + +.. c:var:: n_aos_max + + .. code:: text + + integer, allocatable :: nucl_n_aos (nucl_num) + integer :: n_aos_max + + File: :file:`aos.irp.f` + + Number of |AOs| per atom + + + + +.. c:var:: n_pt_max_i_x + + .. code:: text + + integer :: n_pt_max_integrals + integer :: n_pt_max_i_x + + File: :file:`dimensions_integrals.irp.f` + + Number of points used in the numerical integrations. + + + + +.. c:var:: n_pt_max_integrals + + .. code:: text + + integer :: n_pt_max_integrals + integer :: n_pt_max_i_x + + File: :file:`dimensions_integrals.irp.f` + + Number of points used in the numerical integrations. + + + + +.. c:var:: nucl_aos + + .. code:: text + + integer, allocatable :: nucl_aos (nucl_num,N_AOs_max) + + File: :file:`aos.irp.f` + + List of |AOs| centered on each atom + + + + +.. c:var:: nucl_aos_transposed + + .. code:: text + + integer, allocatable :: nucl_aos_transposed (N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + List of AOs attached on each atom + + + + +.. c:var:: nucl_list_shell_aos + + .. code:: text + + integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) + integer, allocatable :: nucl_num_shell_aos (nucl_num) + + File: :file:`aos.irp.f` + + Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis + + + + +.. c:var:: nucl_n_aos + + .. code:: text + + integer, allocatable :: nucl_n_aos (nucl_num) + integer :: n_aos_max + + File: :file:`aos.irp.f` + + Number of |AOs| per atom + + + + +.. c:var:: nucl_num_shell_aos + + .. code:: text + + integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) + integer, allocatable :: nucl_num_shell_aos (nucl_num) + + File: :file:`aos.irp.f` + + Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_power_index + + .. code:: text + + integer function ao_power_index(nx,ny,nz) + + File: :file:`aos.irp.f` + + Unique index given to a triplet of powers: + + :math:`\frac{1}{2} (l-n_x) (l-n_x+1) + n_z + 1` + + + + + +.. c:function:: ao_value + + .. code:: text + + double precision function ao_value(i,r) + + File: :file:`aos_value.irp.f` + + return the value of the ith ao at point r + + + + + +.. c:function:: give_all_aos_and_grad_and_lapl_at_r + + .. code:: text + + subroutine give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array) + + File: :file:`aos_value.irp.f` + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r + + + + + +.. c:function:: give_all_aos_and_grad_at_r + + .. code:: text + + subroutine give_all_aos_and_grad_at_r(r,aos_array,aos_grad_array) + + File: :file:`aos_value.irp.f` + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r + + + + + +.. c:function:: give_all_aos_at_r + + .. code:: text + + subroutine give_all_aos_at_r(r,aos_array) + + File: :file:`aos_value.irp.f` + + input : r == r(1) = x and so on aos_array(i) = aos(i) evaluated in r + + + + + +.. c:function:: give_all_aos_at_r_old + + .. code:: text + + subroutine give_all_aos_at_r_old(r,aos_array) + + File: :file:`aos_value.irp.f` + + gives the values of aos at a given point r + + + + + +.. c:function:: primitive_value + + .. code:: text + + double precision function primitive_value(i,j,r) + + File: :file:`aos_value.irp.f` + + return the value of the jth primitive of ith ao at point r WITHOUT THE COEF + + diff --git a/docs/source/modules/ao_one_e_ints.rst b/docs/source/modules/ao_one_e_ints.rst new file mode 100644 index 00000000..f8691b5e --- /dev/null +++ b/docs/source/modules/ao_one_e_ints.rst @@ -0,0 +1,1040 @@ +.. _ao_one_e_ints: + +.. program:: ao_one_e_ints + +.. default-role:: option + +================== +ao_one_e_integrals +================== + +All the one-electron integrals in the |AO| basis are here. + +The most important providers for usual quantum-chemistry calculation are: + +* `ao_kinetic_integral` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_ao_ints.irp.f`) +* `ao_nucl_elec_integral` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_ao_ints.irp.f`) +* `ao_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`ao_mono_ints.irp.f`) + + +Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_ao.irp.f`. + + + +EZFIO parameters +---------------- + +.. option:: ao_integrals_e_n + + Nucleus-electron integrals in |AO| basis set + + +.. option:: io_ao_integrals_e_n + + Read/Write |AO| nucleus-electron attraction integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_kinetic + + Kinetic energy integrals in |AO| basis set + + +.. option:: io_ao_integrals_kinetic + + Read/Write |AO| kinetic integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_pseudo + + Pseudopotential integrals in |AO| basis set + + +.. option:: io_ao_integrals_pseudo + + Read/Write |AO| pseudopotential integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_overlap + + Overlap integrals in |AO| basis set + + +.. option:: io_ao_integrals_overlap + + Read/Write |AO| overlap integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_one_e_integrals + + Combined integrals in |AO| basis set + + +.. option:: io_ao_one_e_integrals + + Read/Write |AO| one-electron integrals from/to disk [ Write | Read | None ] + + Default: None + + +Providers +--------- + + +.. c:var:: ao_cart_to_sphe_coef + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) + integer :: ao_cart_to_sphe_num + + File: :file:`ao_ortho_canonical.irp.f` + + Coefficients to go from cartesian to spherical coordinates in the current basis set + + + + +.. c:var:: ao_cart_to_sphe_inv + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_inv (ao_cart_to_sphe_num,ao_num) + + File: :file:`ao_ortho_canonical.irp.f` + + Inverse of :c:data:`ao_cart_to_sphe_coef` + + + + +.. c:var:: ao_cart_to_sphe_num + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) + integer :: ao_cart_to_sphe_num + + File: :file:`ao_ortho_canonical.irp.f` + + Coefficients to go from cartesian to spherical coordinates in the current basis set + + + + +.. c:var:: ao_cart_to_sphe_overlap + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_overlap (ao_cart_to_sphe_num,ao_cart_to_sphe_num) + + File: :file:`ao_ortho_canonical.irp.f` + + |AO| overlap matrix in the spherical basis set + + + + +.. c:var:: ao_deriv2_x + + .. code:: text + + double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Second derivative matrix elements in the |AO| basis. + + :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` + + + + + + +.. c:var:: ao_deriv2_y + + .. code:: text + + double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Second derivative matrix elements in the |AO| basis. + + :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` + + + + + + +.. c:var:: ao_deriv2_z + + .. code:: text + + double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Second derivative matrix elements in the |AO| basis. + + :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` + + + + + + +.. c:var:: ao_deriv_1_x + + .. code:: text + + double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * d/dx AO_j + + * array of the integrals of AO_i * d/dy AO_j + + * array of the integrals of AO_i * d/dz AO_j + + + + +.. c:var:: ao_deriv_1_y + + .. code:: text + + double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * d/dx AO_j + + * array of the integrals of AO_i * d/dy AO_j + + * array of the integrals of AO_i * d/dz AO_j + + + + +.. c:var:: ao_deriv_1_z + + .. code:: text + + double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * d/dx AO_j + + * array of the integrals of AO_i * d/dy AO_j + + * array of the integrals of AO_i * d/dz AO_j + + + + +.. c:var:: ao_dipole_x + + .. code:: text + + double precision, allocatable :: ao_dipole_x (ao_num,ao_num) + double precision, allocatable :: ao_dipole_y (ao_num,ao_num) + double precision, allocatable :: ao_dipole_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x AO_j + + * array of the integrals of AO_i * y AO_j + + * array of the integrals of AO_i * z AO_j + + + + +.. c:var:: ao_dipole_y + + .. code:: text + + double precision, allocatable :: ao_dipole_x (ao_num,ao_num) + double precision, allocatable :: ao_dipole_y (ao_num,ao_num) + double precision, allocatable :: ao_dipole_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x AO_j + + * array of the integrals of AO_i * y AO_j + + * array of the integrals of AO_i * z AO_j + + + + +.. c:var:: ao_dipole_z + + .. code:: text + + double precision, allocatable :: ao_dipole_x (ao_num,ao_num) + double precision, allocatable :: ao_dipole_y (ao_num,ao_num) + double precision, allocatable :: ao_dipole_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x AO_j + + * array of the integrals of AO_i * y AO_j + + * array of the integrals of AO_i * z AO_j + + + + +.. c:var:: ao_integrals_n_e + + .. code:: text + + double precision, allocatable :: ao_integrals_n_e (ao_num,ao_num) + + File: :file:`pot_ao_ints.irp.f` + + Nucleus-electron interaction, in the |AO| basis set. + + :math:`\langle \chi_i | -\sum_A \frac{1}{|r-R_A|} | \chi_j \rangle` + + + + +.. c:var:: ao_integrals_n_e_per_atom + + .. code:: text + + double precision, allocatable :: ao_integrals_n_e_per_atom (ao_num,ao_num,nucl_num) + + File: :file:`pot_ao_ints.irp.f` + + Nucleus-electron interaction in the |AO| basis set, per atom A. + + :math:`\langle \chi_i | -\frac{1}{|r-R_A|} | \chi_j \rangle` + + + + +.. c:var:: ao_kinetic_integrals + + .. code:: text + + double precision, allocatable :: ao_kinetic_integrals (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Kinetic energy integrals in the |AO| basis. + + :math:`\langle \chi_i |\hat{T}| \chi_j \rangle` + + + + +.. c:var:: ao_one_e_integrals + + .. code:: text + + double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) + double precision, allocatable :: ao_one_e_integrals_diag (ao_num) + + File: :file:`ao_one_e_ints.irp.f` + + One-electron Hamiltonian in the |AO| basis. + + + + +.. c:var:: ao_one_e_integrals_diag + + .. code:: text + + double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) + double precision, allocatable :: ao_one_e_integrals_diag (ao_num) + + File: :file:`ao_one_e_ints.irp.f` + + One-electron Hamiltonian in the |AO| basis. + + + + +.. c:var:: ao_ortho_canonical_coef + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) + integer :: ao_ortho_canonical_num + + File: :file:`ao_ortho_canonical.irp.f` + + matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_canonical_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_canonical orbital + + + + +.. c:var:: ao_ortho_canonical_coef_inv + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_coef_inv (ao_num,ao_num) + + File: :file:`ao_ortho_canonical.irp.f` + + ao_ortho_canonical_coef^(-1) + + + + +.. c:var:: ao_ortho_canonical_num + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) + integer :: ao_ortho_canonical_num + + File: :file:`ao_ortho_canonical.irp.f` + + matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_canonical_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_canonical orbital + + + + +.. c:var:: ao_ortho_canonical_overlap + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_overlap (ao_ortho_canonical_num,ao_ortho_canonical_num) + + File: :file:`ao_ortho_canonical.irp.f` + + overlap matrix of the ao_ortho_canonical. Expected to be the Identity + + + + +.. c:var:: ao_overlap + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_overlap_abs + + .. code:: text + + double precision, allocatable :: ao_overlap_abs (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between absolute values of atomic basis functions: + + :math:`\int |\chi_i(r)| |\chi_j(r)| dr` + + + + +.. c:var:: ao_overlap_x + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_overlap_y + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_overlap_z + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_pseudo_integrals + + .. code:: text + + double precision, allocatable :: ao_pseudo_integrals (ao_num,ao_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Pseudo-potential integrals in the |AO| basis set. + + + + +.. c:var:: ao_pseudo_integrals_local + + .. code:: text + + double precision, allocatable :: ao_pseudo_integrals_local (ao_num,ao_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Local pseudo-potential + + + + +.. c:var:: ao_pseudo_integrals_non_local + + .. code:: text + + double precision, allocatable :: ao_pseudo_integrals_non_local (ao_num,ao_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Non-local pseudo-potential + + + + +.. c:var:: ao_spread_x + + .. code:: text + + double precision, allocatable :: ao_spread_x (ao_num,ao_num) + double precision, allocatable :: ao_spread_y (ao_num,ao_num) + double precision, allocatable :: ao_spread_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x^2 AO_j + + * array of the integrals of AO_i * y^2 AO_j + + * array of the integrals of AO_i * z^2 AO_j + + + + +.. c:var:: ao_spread_y + + .. code:: text + + double precision, allocatable :: ao_spread_x (ao_num,ao_num) + double precision, allocatable :: ao_spread_y (ao_num,ao_num) + double precision, allocatable :: ao_spread_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x^2 AO_j + + * array of the integrals of AO_i * y^2 AO_j + + * array of the integrals of AO_i * z^2 AO_j + + + + +.. c:var:: ao_spread_z + + .. code:: text + + double precision, allocatable :: ao_spread_x (ao_num,ao_num) + double precision, allocatable :: ao_spread_y (ao_num,ao_num) + double precision, allocatable :: ao_spread_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x^2 AO_j + + * array of the integrals of AO_i * y^2 AO_j + + * array of the integrals of AO_i * z^2 AO_j + + + + +.. c:var:: give_polynomial_mult_center_one_e_erf + + .. code:: text + + subroutine give_polynomial_mult_center_one_e_erf(A_center,B_center,alpha,beta,& + power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in) + + File: :file:`pot_ao_erf_ints.irp.f` + + Returns the explicit polynomial in terms of the :math:`t` variable of the following polynomial: + + :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . + + + + +.. c:var:: give_polynomial_mult_center_one_e_erf_opt + + .. code:: text + + subroutine give_polynomial_mult_center_one_e_erf_opt(A_center,B_center,alpha,beta,& + power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in,p,p_inv,p_inv_2,p_new,P_center) + + File: :file:`pot_ao_erf_ints.irp.f` + + Returns the explicit polynomial in terms of the :math:`t` variable of the following polynomial: + + :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . + + + + +.. c:var:: i_x1_pol_mult_one_e + + .. code:: text + + recursive subroutine I_x1_pol_mult_one_e(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) + + File: :file:`pot_ao_ints.irp.f` + + Recursive routine involved in the electron-nucleus potential + + + + +.. c:var:: i_x2_pol_mult_one_e + + .. code:: text + + recursive subroutine I_x2_pol_mult_one_e(c,R1x,R1xp,R2x,d,nd,dim) + + File: :file:`pot_ao_ints.irp.f` + + Recursive routine involved in the electron-nucleus potential + + + + +.. c:var:: pseudo_dz_k_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) + integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) + double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_dz_kl_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_n_k_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) + integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) + double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_n_kl_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_v_k_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) + integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) + double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_v_kl_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: s_half + + .. code:: text + + double precision, allocatable :: s_half (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + :math:`S^{1/2}` + + + + +.. c:var:: s_half_inv + + .. code:: text + + double precision, allocatable :: s_half_inv (AO_num,AO_num) + + File: :file:`ao_overlap.irp.f` + + :math:`X = S^{-1/2}` obtained by SVD + + + + +.. c:var:: s_inv + + .. code:: text + + double precision, allocatable :: s_inv (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Inverse of the overlap matrix + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: give_all_erf_kl_ao + + .. code:: text + + subroutine give_all_erf_kl_ao(integrals_ao,mu_in,C_center) + + File: :file:`pot_ao_erf_ints.irp.f` + + Subroutine that returns all integrals over :math:`r` of type :math:`\frac{ \erf(\mu * |r-R_C|) }{ |r-R_C| }` + + + + + +.. c:function:: give_polynomial_mult_center_one_e + + .. code:: text + + subroutine give_polynomial_mult_center_one_e(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out) + + File: :file:`pot_ao_ints.irp.f` + + Returns the explicit polynomial in terms of the "t" variable of the following + + :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . + + + + + +.. c:function:: int_gaus_pol + + .. code:: text + + double precision function int_gaus_pol(alpha,n) + + File: :file:`pot_ao_ints.irp.f` + + Computes the integral: + + :math:`\int_{-\infty}^{\infty} x^n \exp(-\alpha x^2) dx` . + + + + + +.. c:function:: nai_pol_mult + + .. code:: text + + double precision function NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in) + + File: :file:`pot_ao_ints.irp.f` + + Computes the electron-nucleus attraction with two primitves. + + :math:`\langle g_i | \frac{1}{|r-R_c|} | g_j \rangle` + + + + + +.. c:function:: nai_pol_mult_erf + + .. code:: text + + double precision function NAI_pol_mult_erf(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in,mu_in) + + File: :file:`pot_ao_erf_ints.irp.f` + + Computes the following integral : :math:`\int dr (x-A_x)^a (x-B_x)^b \exp(-\alpha (x-A_x)^2 - \beta (x-B_x)^2 ) \frac{\erf(\mu |r-R_C|)}{|r-R_c|}` . + + + + + +.. c:function:: nai_pol_mult_erf_ao + + .. code:: text + + double precision function NAI_pol_mult_erf_ao(i_ao,j_ao,mu_in,C_center) + + File: :file:`pot_ao_erf_ints.irp.f` + + Computes the following integral : :math:`\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) \frac{\erf(\mu |r-R_C|)}{|r-R_C|}` . + + + + + +.. c:function:: overlap_bourrin_deriv_x + + .. code:: text + + subroutine overlap_bourrin_deriv_x(i_component,A_center,B_center,alpha,beta,power_A,power_B,dx,lower_exp_val,overlap_x,nx) + + File: :file:`spread_dipole_ao.irp.f` + + + + + + + +.. c:function:: overlap_bourrin_dipole + + .. code:: text + + subroutine overlap_bourrin_dipole(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`spread_dipole_ao.irp.f` + + + + + + + +.. c:function:: overlap_bourrin_spread + + .. code:: text + + subroutine overlap_bourrin_spread(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`spread_dipole_ao.irp.f` + + Computes the following integral : int [-infty ; +infty] of [(x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) * x ] needed for the dipole and those things + + + + + +.. c:function:: overlap_bourrin_x + + .. code:: text + + subroutine overlap_bourrin_x(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`spread_dipole_ao.irp.f` + + + + + + + +.. c:function:: v_e_n + + .. code:: text + + double precision function V_e_n(a_x,a_y,a_z,b_x,b_y,b_z,alpha,beta) + + File: :file:`pot_ao_ints.irp.f` + + Primitve nuclear attraction between the two primitves centered on the same atom. + + :math:`p_1 = x^{a_x} y^{a_y} z^{a_z} \exp(-\alpha r^2)` + + :math:`p_2 = x^{b_x} y^{b_y} z^{b_z} \exp(-\beta r^2)` + + + + + +.. c:function:: v_phi + + .. code:: text + + double precision function V_phi(n,m) + + File: :file:`pot_ao_ints.irp.f` + + Computes the angular :math:`\phi` part of the nuclear attraction integral: + + :math:`\int_{0}^{2 \pi} \cos(\phi)^n \sin(\phi)^m d\phi` . + + + + + +.. c:function:: v_r + + .. code:: text + + double precision function V_r(n,alpha) + + File: :file:`pot_ao_ints.irp.f` + + Computes the radial part of the nuclear attraction integral: + + :math:`\int_{0}^{\infty} r^n \exp(-\alpha r^2) dr` + + + + + + + +.. c:function:: v_theta + + .. code:: text + + double precision function V_theta(n,m) + + File: :file:`pot_ao_ints.irp.f` + + Computes the angular :math:`\theta` part of the nuclear attraction integral: + + :math:`\int_{0}^{\pi} \cos(\theta)^n \sin(\theta)^m d\theta` + + + + + +.. c:function:: wallis + + .. code:: text + + double precision function Wallis(n) + + File: :file:`pot_ao_ints.irp.f` + + Wallis integral: + + :math:`\int_{0}^{\pi} \cos(\theta)^n d\theta` . + + diff --git a/docs/source/modules/ao_two_e_erf_ints.rst b/docs/source/modules/ao_two_e_erf_ints.rst new file mode 100644 index 00000000..0d91b17d --- /dev/null +++ b/docs/source/modules/ao_two_e_erf_ints.rst @@ -0,0 +1,425 @@ +.. _ao_two_e_erf_ints: + +.. program:: ao_two_e_erf_ints + +.. default-role:: option + +====================== +ao_two_e_erf_ints +====================== + +Here, all two-electron integrals (:math:`erf(\mu r_{12})/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`utils/map_module.f90`. + +The main parameter of this module is :option:`ao_two_e_erf_ints mu_erf` which is the range-separation parameter. + +To fetch an |AO| integral, use the +`get_ao_two_e_integral_erf(i,j,k,l,ao_integrals_erf_map)` function. + + +The conventions are: +* For |AO| integrals : (ij|kl) = (11|22) = = <12|12> + + + + + + +EZFIO parameters +---------------- + +.. option:: io_ao_two_e_integrals_erf + + Read/Write |AO| integrals with the long range interaction from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mu_erf + + cutting of the interaction in the range separated model + + Default: 0.5 + + +Providers +--------- + + +.. c:var:: ao_integrals_erf_cache + + .. code:: text + + double precision, allocatable :: ao_integrals_erf_cache (0:64*64*64*64) + + File: :file:`map_integrals_erf.irp.f` + + Cache of |AO| integrals for fast access + + + + +.. c:var:: ao_integrals_erf_cache_max + + .. code:: text + + integer :: ao_integrals_erf_cache_min + integer :: ao_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_erf_cache_min + + .. code:: text + + integer :: ao_integrals_erf_cache_min + integer :: ao_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_erf_map + + .. code:: text + + type(map_type) :: ao_integrals_erf_map + + File: :file:`map_integrals_erf.irp.f` + + |AO| integrals + + + + +.. c:var:: ao_two_e_integral_erf_schwartz + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_erf_schwartz (ao_num,ao_num) + + File: :file:`providers_ao_erf.irp.f` + + Needed to compute Schwartz inequalities + + + + +.. c:var:: ao_two_e_integrals_erf_in_map + + .. code:: text + + logical :: ao_two_e_integrals_erf_in_map + + File: :file:`providers_ao_erf.irp.f` + + Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2) + + + + +.. c:var:: general_primitive_integral_erf + + .. code:: text + + double precision function general_primitive_integral_erf(dim, & + P_new,P_center,fact_p,p,p_inv,iorder_p, & + Q_new,Q_center,fact_q,q,q_inv,iorder_q) + + File: :file:`two_e_integrals_erf.irp.f` + + Computes the integral where p,q,r,s are Gaussian primitives + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_two_e_integral_erf + + .. code:: text + + double precision function ao_two_e_integral_erf(i,j,k,l) + + File: :file:`two_e_integrals_erf.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integral_schwartz_accel_erf + + .. code:: text + + double precision function ao_two_e_integral_schwartz_accel_erf(i,j,k,l) + + File: :file:`two_e_integrals_erf.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_collector + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_collector(zmq_socket_pull) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Collects results from the AO integral calculation + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_slave(thread,iproc) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Computes a buffer of integrals + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave_inproc + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_slave_inproc(i) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave_tcp + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_slave_tcp(i) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: clear_ao_erf_map + + .. code:: text + + subroutine clear_ao_erf_map + + File: :file:`map_integrals_erf.irp.f` + + Frees the memory of the |AO| map + + + + + +.. c:function:: compute_ao_integrals_erf_jl + + .. code:: text + + subroutine compute_ao_integrals_erf_jl(j,l,n_integrals,buffer_i,buffer_value) + + File: :file:`two_e_integrals_erf.irp.f` + + Parallel client for AO integrals + + + + + +.. c:function:: compute_ao_two_e_integrals_erf + + .. code:: text + + subroutine compute_ao_two_e_integrals_erf(j,k,l,sze,buffer_value) + + File: :file:`two_e_integrals_erf.irp.f` + + Compute AO 1/r12 integrals for all i and fixed j,k,l + + + + + +.. c:function:: dump_ao_integrals_erf + + .. code:: text + + subroutine dump_ao_integrals_erf(filename) + + File: :file:`map_integrals_erf.irp.f` + + Save to disk the |AO| erf integrals + + + + + +.. c:function:: eri_erf + + .. code:: text + + double precision function ERI_erf(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) + + File: :file:`two_e_integrals_erf.irp.f` + + ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2) + + + + + +.. c:function:: get_ao_erf_map_size + + .. code:: text + + function get_ao_erf_map_size() + + File: :file:`map_integrals_erf.irp.f` + + Returns the number of elements in the |AO| map + + + + + +.. c:function:: get_ao_two_e_integral_erf + + .. code:: text + + double precision function get_ao_two_e_integral_erf(i,j,k,l,map) result(result) + + File: :file:`map_integrals_erf.irp.f` + + Gets one |AO| two-electron integral from the |AO| map + + + + + +.. c:function:: get_ao_two_e_integrals_erf + + .. code:: text + + subroutine get_ao_two_e_integrals_erf(j,k,l,sze,out_val) + + File: :file:`map_integrals_erf.irp.f` + + Gets multiple |AO| two-electron integral from the |AO| map . All i are retrieved for j,k,l fixed. + + + + + +.. c:function:: get_ao_two_e_integrals_erf_non_zero + + .. code:: text + + subroutine get_ao_two_e_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) + + File: :file:`map_integrals_erf.irp.f` + + Gets multiple |AO| two-electron integrals from the |AO| map . All non-zero i are retrieved for j,k,l fixed. + + + + + +.. c:function:: insert_into_ao_integrals_erf_map + + .. code:: text + + subroutine insert_into_ao_integrals_erf_map(n_integrals,buffer_i, buffer_values) + + File: :file:`map_integrals_erf.irp.f` + + Create new entry into |AO| map + + + + + +.. c:function:: integrale_new_erf + + .. code:: text + + subroutine integrale_new_erf(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt) + + File: :file:`two_e_integrals_erf.irp.f` + + calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1) + + + + + +.. c:function:: load_ao_integrals_erf + + .. code:: text + + integer function load_ao_integrals_erf(filename) + + File: :file:`map_integrals_erf.irp.f` + + Read from disk the |AO| erf integrals + + + + + +.. c:function:: save_erf_two_e_integrals_ao + + .. code:: text + + subroutine save_erf_two_e_integrals_ao + + File: :file:`routines_save_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_erf_two_e_ints_ao_into_ints_ao + + .. code:: text + + subroutine save_erf_two_e_ints_ao_into_ints_ao + + File: :file:`routines_save_integrals_erf.irp.f` + + + + diff --git a/docs/source/modules/ao_two_e_ints.rst b/docs/source/modules/ao_two_e_ints.rst new file mode 100644 index 00000000..c9b9074a --- /dev/null +++ b/docs/source/modules/ao_two_e_ints.rst @@ -0,0 +1,619 @@ +.. _ao_two_e_ints: + +.. program:: ao_two_e_ints + +.. default-role:: option + +================== +ao_two_e_ints +================== + +Here, all two-electron integrals (:math:`1/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`utils/map_module.f90`. + +To fetch an |AO| integral, use the +`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function. + + +The conventions are: +* For |AO| integrals : (ij|kl) = (11|22) = = <12|12> + + + + + + +EZFIO parameters +---------------- + +.. option:: io_ao_two_e_integrals + + Read/Write |AO| integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_threshold + + If | (pq|rs) | < `ao_integrals_threshold` then (pq|rs) is zero + + Default: 1.e-15 + +.. option:: do_direct_integrals + + Compute integrals on the fly (very slow, only for debugging) + + Default: False + + +Providers +--------- + + +.. c:var:: ao_integrals_cache + + .. code:: text + + double precision, allocatable :: ao_integrals_cache (0:64*64*64*64) + + File: :file:`map_integrals.irp.f` + + Cache of AO integrals for fast access + + + + +.. c:var:: ao_integrals_cache_max + + .. code:: text + + integer :: ao_integrals_cache_min + integer :: ao_integrals_cache_max + + File: :file:`map_integrals.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_cache_min + + .. code:: text + + integer :: ao_integrals_cache_min + integer :: ao_integrals_cache_max + + File: :file:`map_integrals.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_map + + .. code:: text + + type(map_type) :: ao_integrals_map + + File: :file:`map_integrals.irp.f` + + AO integrals + + + + +.. c:var:: ao_two_e_integral_schwartz + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_schwartz (ao_num,ao_num) + + File: :file:`two_e_integrals.irp.f` + + Needed to compute Schwartz inequalities + + + + +.. c:var:: ao_two_e_integrals_in_map + + .. code:: text + + logical :: ao_two_e_integrals_in_map + + File: :file:`two_e_integrals.irp.f` + + Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2) + + + + +.. c:var:: gauleg_t2 + + .. code:: text + + double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2) + double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2) + + File: :file:`gauss_legendre.irp.f` + + t_w(i,1,k) = w(i) t_w(i,2,k) = t(i) + + + + +.. c:var:: gauleg_w + + .. code:: text + + double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2) + double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2) + + File: :file:`gauss_legendre.irp.f` + + t_w(i,1,k) = w(i) t_w(i,2,k) = t(i) + + + + +.. c:var:: general_primitive_integral + + .. code:: text + + double precision function general_primitive_integral(dim, & + P_new,P_center,fact_p,p,p_inv,iorder_p, & + Q_new,Q_center,fact_q,q,q_inv,iorder_q) + + File: :file:`two_e_integrals.irp.f` + + Computes the integral where p,q,r,s are Gaussian primitives + + + + +.. c:var:: i_x1_new + + .. code:: text + + recursive subroutine I_x1_new(a,c,B_10,B_01,B_00,res,n_pt) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x1_pol_mult_a1 + + .. code:: text + + recursive subroutine I_x1_pol_mult_a1(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x1_pol_mult_a2 + + .. code:: text + + recursive subroutine I_x1_pol_mult_a2(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x1_pol_mult_recurs + + .. code:: text + + recursive subroutine I_x1_pol_mult_recurs(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x2_new + + .. code:: text + + recursive subroutine I_x2_new(c,B_10,B_01,B_00,res,n_pt) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x2_pol_mult + + .. code:: text + + recursive subroutine I_x2_pol_mult(c,B_10,B_01,B_00,C_00,D_00,d,nd,dim) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_l4 + + .. code:: text + + integer function ao_l4(i,j,k,l) + + File: :file:`two_e_integrals.irp.f` + + Computes the product of l values of i,j,k,and l + + + + + +.. c:function:: ao_two_e_integral + + .. code:: text + + double precision function ao_two_e_integral(i,j,k,l) + + File: :file:`two_e_integrals.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integral_schwartz_accel + + .. code:: text + + double precision function ao_two_e_integral_schwartz_accel(i,j,k,l) + + File: :file:`two_e_integrals.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integrals_in_map_collector + + .. code:: text + + subroutine ao_two_e_integrals_in_map_collector(zmq_socket_pull) + + File: :file:`integrals_in_map_slave.irp.f` + + Collects results from the AO integral calculation + + + + + +.. c:function:: ao_two_e_integrals_in_map_slave + + .. code:: text + + subroutine ao_two_e_integrals_in_map_slave(thread,iproc) + + File: :file:`integrals_in_map_slave.irp.f` + + Computes a buffer of integrals + + + + + +.. c:function:: ao_two_e_integrals_in_map_slave_inproc + + .. code:: text + + subroutine ao_two_e_integrals_in_map_slave_inproc(i) + + File: :file:`integrals_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: ao_two_e_integrals_in_map_slave_tcp + + .. code:: text + + subroutine ao_two_e_integrals_in_map_slave_tcp(i) + + File: :file:`integrals_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: clear_ao_map + + .. code:: text + + subroutine clear_ao_map + + File: :file:`map_integrals.irp.f` + + Frees the memory of the AO map + + + + + +.. c:function:: compute_ao_integrals_jl + + .. code:: text + + subroutine compute_ao_integrals_jl(j,l,n_integrals,buffer_i,buffer_value) + + File: :file:`two_e_integrals.irp.f` + + Parallel client for AO integrals + + + + + +.. c:function:: compute_ao_two_e_integrals + + .. code:: text + + subroutine compute_ao_two_e_integrals(j,k,l,sze,buffer_value) + + File: :file:`two_e_integrals.irp.f` + + Compute AO 1/r12 integrals for all i and fixed j,k,l + + + + + +.. c:function:: dump_ao_integrals + + .. code:: text + + subroutine dump_ao_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Save to disk the |AO| integrals + + + + + +.. c:function:: eri + + .. code:: text + + double precision function ERI(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) + + File: :file:`two_e_integrals.irp.f` + + ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2) + + + + + +.. c:function:: gauleg + + .. code:: text + + subroutine gauleg(x1,x2,x,w,n) + + File: :file:`gauss_legendre.irp.f` + + Gauss-Legendre + + + + + +.. c:function:: get_ao_map_size + + .. code:: text + + function get_ao_map_size() + + File: :file:`map_integrals.irp.f` + + Returns the number of elements in the AO map + + + + + +.. c:function:: get_ao_two_e_integral + + .. code:: text + + double precision function get_ao_two_e_integral(i,j,k,l,map) result(result) + + File: :file:`map_integrals.irp.f` + + Gets one AO bi-electronic integral from the AO map + + + + + +.. c:function:: get_ao_two_e_integrals + + .. code:: text + + subroutine get_ao_two_e_integrals(j,k,l,sze,out_val) + + File: :file:`map_integrals.irp.f` + + Gets multiple AO bi-electronic integral from the AO map . All i are retrieved for j,k,l fixed. + + + + + +.. c:function:: get_ao_two_e_integrals_non_zero + + .. code:: text + + subroutine get_ao_two_e_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) + + File: :file:`map_integrals.irp.f` + + Gets multiple AO bi-electronic integral from the AO map . All non-zero i are retrieved for j,k,l fixed. + + + + + +.. c:function:: give_polynom_mult_center_x + + .. code:: text + + subroutine give_polynom_mult_center_x(P_center,Q_center,a_x,d_x,p,q,n_pt_in,pq_inv,pq_inv_2,p10_1,p01_1,p10_2,p01_2,d,n_pt_out) + + File: :file:`two_e_integrals.irp.f` + + subroutine that returns the explicit polynom in term of the "t" variable of the following polynomw : I_x1(a_x, d_x,p,q) * I_x1(a_y, d_y,p,q) * I_x1(a_z, d_z,p,q) + + + + + +.. c:function:: i_x1_pol_mult + + .. code:: text + + subroutine I_x1_pol_mult(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + + +.. c:function:: insert_into_ao_integrals_map + + .. code:: text + + subroutine insert_into_ao_integrals_map(n_integrals,buffer_i, buffer_values) + + File: :file:`map_integrals.irp.f` + + Create new entry into AO map + + + + + +.. c:function:: integrale_new + + .. code:: text + + subroutine integrale_new(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt) + + File: :file:`two_e_integrals.irp.f` + + calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1) + + + + + +.. c:function:: load_ao_integrals + + .. code:: text + + integer function load_ao_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Read from disk the |AO| integrals + + + + + +.. c:function:: n_pt_sup + + .. code:: text + + integer function n_pt_sup(a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) + + File: :file:`two_e_integrals.irp.f` + + Returns the upper boundary of the degree of the polynomial involved in the bielctronic integral : Ix(a_x,b_x,c_x,d_x) * Iy(a_y,b_y,c_y,d_y) * Iz(a_z,b_z,c_z,d_z) + + + + + +.. c:function:: push_integrals + + .. code:: text + + subroutine push_integrals(zmq_socket_push, n_integrals, buffer_i, buffer_value, task_id) + + File: :file:`integrals_in_map_slave.irp.f` + + Push integrals in the push socket + + + + + +.. c:function:: two_e_integrals_index + + .. code:: text + + subroutine two_e_integrals_index(i,j,k,l,i1) + + File: :file:`map_integrals.irp.f` + + + + + + + +.. c:function:: two_e_integrals_index_reverse + + .. code:: text + + subroutine two_e_integrals_index_reverse(i,j,k,l,i1) + + File: :file:`map_integrals.irp.f` + + + + diff --git a/docs/source/modules/aux_quantities.rst b/docs/source/modules/aux_quantities.rst new file mode 100644 index 00000000..ba56eac3 --- /dev/null +++ b/docs/source/modules/aux_quantities.rst @@ -0,0 +1,52 @@ +.. _aux_quantities: + +.. program:: aux_quantities + +.. default-role:: option + +============== +aux_quantities +============== + + +This module contains some global variables (such as densities and energies) +which are stored in the EZFIO folder in a different place than determinants. +This is used in practice to store density matrices which can be obtained from +any methods, as long as they are stored in the same MO basis which is used for +the calculations. In |RSDFT| calculations, this can be done to perform damping +on the density in order to speed up convergence. + +The main providers of that module are: + +* `data_one_body_alpha_dm_mo` and `data_one_body_beta_dm_mo` which are the + one-body alpha and beta densities which are necessary read from the EZFIO + folder. + + +Thanks to these providers you can use any density matrix that does not +necessary corresponds to that of the current wave function. + + + +EZFIO parameters +---------------- + +.. option:: data_energy_var + + Variational energy computed with the wave function + + +.. option:: data_energy_proj + + Projected energy computed with the wave function + + +.. option:: data_one_body_alpha_dm_mo + + Alpha one body density matrix on the MO basis computed with the wave function + + +.. option:: data_one_body_beta_dm_mo + + Beta one body density matrix on the MO basis computed with the wave function + diff --git a/docs/source/modules/becke_numerical_grid.rst b/docs/source/modules/becke_numerical_grid.rst new file mode 100644 index 00000000..1c77b50d --- /dev/null +++ b/docs/source/modules/becke_numerical_grid.rst @@ -0,0 +1,454 @@ +.. _becke_numerical_grid: + +.. program:: becke_numerical_grid + +.. default-role:: option + +==================== +becke_numerical_grid +==================== + +This module contains all quantities needed to build the Becke's grid used in general for DFT integration. Note that it can be used for whatever integration in R^3 as long as the functions to be integrated are mostly concentrated near the atomic regions. + +This grid is built as the reunion of a spherical grid around each atom. Each spherical grid contains +a certain number of radial and angular points. No pruning is done on the angular part of the grid. + +The main keyword for that modue is: + +* :option:`becke_numerical_grid grid_type_sgn` which controls the precision of the grid according the standard **SG-n** grids. This keyword controls the two providers `n_points_integration_angular` `n_points_radial_grid`. + +The main providers of that module are: + +* `n_points_integration_angular` which is the number of angular integration points. WARNING: it obeys to specific rules so it cannot be any integer number. Some of the possible values are [ 50 | 74 | 170 | 194 | 266 | 302 | 590 | 1202 | 2030 | 5810 ] for instance. See :file:`angular.f` for more details. +* `n_points_radial_grid` which is the number of radial angular points. This can be any strictly positive integer. Nevertheless, a minimum of 50 is in general necessary. +* `final_grid_points` which are the (x,y,z) coordinates of the grid points. +* `final_weight_at_r_vector` which are the weights at each grid point + + +For a simple example of how to use the grid, see :file:`example.irp.f`. + +The spherical integration uses Lebedev-Laikov grids, which was used from the code distributed through CCL (http://www.ccl.net/). +See next section for explanations and citation policies. + +.. code-block:: text + + This subroutine is part of a set of subroutines that generate + Lebedev grids [1-6] for integration on a sphere. The original + C-code [1] was kindly provided by Dr. Dmitri N. Laikov and + translated into fortran by Dr. Christoph van Wuellen. + This subroutine was translated using a C to fortran77 conversion + tool written by Dr. Christoph van Wuellen. + + Users of this code are asked to include reference [1] in their + publications, and in the user- and programmers-manuals + describing their codes. + + This code was distributed through CCL (http://www.ccl.net/). + + [1] V.I. Lebedev, and D.N. Laikov + "A quadrature formula for the sphere of the 131st + algebraic order of accuracy" + Doklady Mathematics, Vol. 59, No. 3, 1999, pp. 477-481. + + [2] V.I. Lebedev + "A quadrature formula for the sphere of 59th algebraic + order of accuracy" + Russian Acad. Sci. Dokl. Math., Vol. 50, 1995, pp. 283-286. + + [3] V.I. Lebedev, and A.L. Skorokhodov + "Quadrature formulas of orders 41, 47, and 53 for the sphere" + Russian Acad. Sci. Dokl. Math., Vol. 45, 1992, pp. 587-592. + + [4] V.I. Lebedev + "Spherical quadrature formulas exact to orders 25-29" + Siberian Mathematical Journal, Vol. 18, 1977, pp. 99-107. + + [5] V.I. Lebedev + "Quadratures on a sphere" + Computational Mathematics and Mathematical Physics, Vol. 16, + 1976, pp. 10-24. + + [6] V.I. Lebedev + "Values of the nodes and weights of ninth to seventeenth + order Gauss-Markov quadrature formulae invariant under the + octahedron group with inversion" + Computational Mathematics and Mathematical Physics, Vol. 15, + 1975, pp. 44-51. + + + + + +EZFIO parameters +---------------- + +.. option:: grid_type_sgn + + Type of grid used for the Becke's numerical grid. Can be, by increasing accuracy: [ 0 | 1 | 2 | 3 ] + + Default: 2 + + +Providers +--------- + + +.. c:var:: alpha_knowles + + .. code:: text + + double precision, allocatable :: alpha_knowles (100) + + File: :file:`integration_radial.irp.f` + + Recommended values for the alpha parameters according to the paper of Knowles (JCP, 104, 1996) as a function of the nuclear charge + + + + +.. c:var:: angular_quadrature_points + + .. code:: text + + double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) + double precision, allocatable :: weights_angular_points (n_points_integration_angular) + + File: :file:`grid_becke.irp.f` + + weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme + + + + +.. c:var:: dr_radial_integral + + .. code:: text + + double precision, allocatable :: grid_points_radial (n_points_radial_grid) + double precision :: dr_radial_integral + + File: :file:`grid_becke.irp.f` + + points in [0,1] to map the radial integral [0,\infty] + + + + +.. c:var:: final_grid_points + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: final_weight_at_r + + .. code:: text + + double precision, allocatable :: final_weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke.irp.f` + + Total weight on each grid point which takes into account all Lebedev, Voronoi and radial weights. + + + + +.. c:var:: final_weight_at_r_vector + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: grid_points_per_atom + + .. code:: text + + double precision, allocatable :: grid_points_per_atom (3,n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke.irp.f` + + x,y,z coordinates of grid points used for integration in 3d space + + + + +.. c:var:: grid_points_radial + + .. code:: text + + double precision, allocatable :: grid_points_radial (n_points_radial_grid) + double precision :: dr_radial_integral + + File: :file:`grid_becke.irp.f` + + points in [0,1] to map the radial integral [0,\infty] + + + + +.. c:var:: index_final_points + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: index_final_points_reverse + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: m_knowles + + .. code:: text + + integer :: m_knowles + + File: :file:`grid_becke.irp.f` + + value of the "m" parameter in the equation (7) of the paper of Knowles (JCP, 104, 1996) + + + + +.. c:var:: n_points_final_grid + + .. code:: text + + integer :: n_points_final_grid + + File: :file:`grid_becke_vector.irp.f` + + Number of points which are non zero + + + + +.. c:var:: n_points_grid_per_atom + + .. code:: text + + integer :: n_points_grid_per_atom + + File: :file:`grid_becke.irp.f` + + Number of grid points per atom + + + + +.. c:var:: n_points_integration_angular + + .. code:: text + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + File: :file:`grid_becke.irp.f` + + n_points_radial_grid = number of radial grid points per atom + + n_points_integration_angular = number of angular grid points per atom + + These numbers are automatically set by setting the grid_type_sgn parameter + + + + +.. c:var:: n_points_radial_grid + + .. code:: text + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + File: :file:`grid_becke.irp.f` + + n_points_radial_grid = number of radial grid points per atom + + n_points_integration_angular = number of angular grid points per atom + + These numbers are automatically set by setting the grid_type_sgn parameter + + + + +.. c:var:: weight_at_r + + .. code:: text + + double precision, allocatable :: weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke.irp.f` + + Weight function at grid points : w_n(r) according to the equation (22) of Becke original paper (JCP, 88, 1988) + + The "n" discrete variable represents the nucleis which in this array is represented by the last dimension and the points are labelled by the other dimensions. + + + + +.. c:var:: weights_angular_points + + .. code:: text + + double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) + double precision, allocatable :: weights_angular_points (n_points_integration_angular) + + File: :file:`grid_becke.irp.f` + + weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: cell_function_becke + + .. code:: text + + double precision function cell_function_becke(r,atom_number) + + File: :file:`step_function_becke.irp.f` + + atom_number :: atom on which the cell function of Becke (1988, JCP,88(4)) r(1:3) :: x,y,z coordinantes of the current point + + + + + +.. c:function:: derivative_knowles_function + + .. code:: text + + double precision function derivative_knowles_function(alpha,m,x) + + File: :file:`integration_radial.irp.f` + + Derivative of the function proposed by Knowles (JCP, 104, 1996) for distributing the radial points + + + + + +.. c:function:: example_becke_numerical_grid + + .. code:: text + + subroutine example_becke_numerical_grid + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in becke_numerical_grid + + + + + +.. c:function:: f_function_becke + + .. code:: text + + double precision function f_function_becke(x) + + File: :file:`step_function_becke.irp.f` + + + + + + + +.. c:function:: knowles_function + + .. code:: text + + double precision function knowles_function(alpha,m,x) + + File: :file:`integration_radial.irp.f` + + Function proposed by Knowles (JCP, 104, 1996) for distributing the radial points : the Log "m" function ( equation (7) in the paper ) + + + + + +.. c:function:: step_function_becke + + .. code:: text + + double precision function step_function_becke(x) + + File: :file:`step_function_becke.irp.f` + + Step function of the Becke paper (1988, JCP,88(4)) + + diff --git a/docs/source/modules/bitmask.rst b/docs/source/modules/bitmask.rst new file mode 100644 index 00000000..9cf72275 --- /dev/null +++ b/docs/source/modules/bitmask.rst @@ -0,0 +1,1272 @@ +.. _bitmask: + +.. program:: bitmask + +.. default-role:: option + +============== +bitmask module +============== + +The central part of this module is the :file:`bitmasks_module.f90` file. It contains +the constants that will be used to define on which kind of integer the bitmasks +will be defined. + +In the program, to represent a determinant as a pair of bitstrings, +the determinant should be defined as + +.. code-block:: fortran + + use bitmasks + integer(bit_kind) :: determinant(N_int,2) + + +:file:`bitmasks_routines.irp.f` contains helper routines to manipulate bitmask, like +transforming a bit string to a list of integers for example. + + +`bit_kind_shift`, `bit_kind_size` and `bit_kind` are supposed to be consistent:: + + 2**bit_kind_shift = bit_kind_size + bit_kind = bit_kind_size / 8 + + +For an example of how to use the bitmaks, see the file :file:`example.irp.f`. + + + +Providers +--------- + + +.. c:var:: cas_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: cas_bitmask (N_int,2,N_cas_bitmask) + + File: :file:`bitmasks.irp.f` + + Bitmasks for CAS reference determinants. (N_int, alpha/beta, CAS reference) + + + + +.. c:var:: closed_shell_ref_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: closed_shell_ref_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: core_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer :: n_core_orb + + File: :file:`bitmasks.irp.f` + + Core + deleted orbitals bitmask + + + + +.. c:var:: core_inact_act_bitmask_4 + + .. code:: text + + integer(bit_kind), allocatable :: core_inact_act_bitmask_4 (N_int,4) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: core_inact_virt_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive and virtual bitmasks + + + + +.. c:var:: full_ijkl_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: full_ijkl_bitmask (N_int) + + File: :file:`bitmasks.irp.f` + + Bitmask to include all possible MOs + + + + +.. c:var:: full_ijkl_bitmask_4 + + .. code:: text + + integer(bit_kind), allocatable :: full_ijkl_bitmask_4 (N_int,4) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: generators_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: generators_bitmask (N_int,2,6,N_generators_bitmask) + + File: :file:`bitmasks.irp.f` + + Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). + + 3rd index is : + + * 1 : hole for single exc + + * 2 : particle for single exc + + * 3 : hole for 1st exc of double + + * 4 : particle for 1st exc of double + + * 5 : hole for 2nd exc of double + + * 6 : particle for 2nd exc of double + + + + + + +.. c:var:: generators_bitmask_restart + + .. code:: text + + integer(bit_kind), allocatable :: generators_bitmask_restart (N_int,2,6,N_generators_bitmask_restart) + + File: :file:`bitmasks.irp.f` + + Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). + + 3rd index is : + + * 1 : hole for single exc + + * 2 : particle for single exc + + * 3 : hole for 1st exc of double + + * 4 : particle for 1st exc of double + + * 5 : hole for 2nd exc of double + + * 6 : particle for 2nd exc of double + + + + + + +.. c:var:: hf_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: hf_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Hartree Fock bit mask + + + + +.. c:var:: i_bitmask_gen + + .. code:: text + + integer :: i_bitmask_gen + + File: :file:`bitmasks.irp.f` + + Current bitmask for the generators + + + + +.. c:var:: inact_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: inact_virt_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive and virtual bitmasks + + + + +.. c:var:: index_holes_bitmask + + .. code:: text + + integer, allocatable :: index_holes_bitmask (3) + + File: :file:`modify_bitmasks.irp.f` + + Index of the holes in the generators_bitmasks + + + + +.. c:var:: index_particl_bitmask + + .. code:: text + + integer, allocatable :: index_particl_bitmask (3) + + File: :file:`modify_bitmasks.irp.f` + + Index of the holes in the generators_bitmasks + + + + +.. c:var:: list_act + + .. code:: text + + integer, allocatable :: list_act (n_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_act(i) = index of the ith active orbital + + list_act_reverse : reverse list of active orbitals list_act_reverse(i) = 0 ::> not an active list_act_reverse(i) = k ::> IS the kth active orbital + + + + +.. c:var:: list_act_reverse + + .. code:: text + + integer, allocatable :: list_act (n_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_act(i) = index of the ith active orbital + + list_act_reverse : reverse list of active orbitals list_act_reverse(i) = 0 ::> not an active list_act_reverse(i) = k ::> IS the kth active orbital + + + + +.. c:var:: list_core + + .. code:: text + + integer, allocatable :: list_core (n_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + List of the core orbitals that are never excited in post CAS method + + + + +.. c:var:: list_core_inact + + .. code:: text + + integer, allocatable :: list_core_inact (n_core_inact_orb) + integer, allocatable :: list_core_inact_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_inact_act + + .. code:: text + + integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) + integer, allocatable :: list_core_inact_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_inact_act_reverse + + .. code:: text + + integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) + integer, allocatable :: list_core_inact_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_inact_reverse + + .. code:: text + + integer, allocatable :: list_core_inact (n_core_inact_orb) + integer, allocatable :: list_core_inact_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_reverse + + .. code:: text + + integer, allocatable :: list_core (n_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + List of the core orbitals that are never excited in post CAS method + + + + +.. c:var:: list_inact + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: list_inact_reverse + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: list_virt + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: list_virt_reverse + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: mpi_bit_kind + + .. code:: text + + integer :: mpi_bit_kind + + File: :file:`mpi.irp.f` + + MPI bit kind type + + + + +.. c:var:: n_act_orb + + .. code:: text + + integer :: n_act_orb + + File: :file:`bitmasks.irp.f` + + number of active orbitals + + + + +.. c:var:: n_cas_bitmask + + .. code:: text + + integer :: n_cas_bitmask + + File: :file:`bitmasks.irp.f` + + Number of bitmasks for CAS + + + + +.. c:var:: n_core_inact_act_orb + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) + integer :: n_core_inact_act_orb + + File: :file:`bitmasks.irp.f` + + Reunion of the core, inactive and active bitmasks + + + + +.. c:var:: n_core_inact_orb + + .. code:: text + + integer :: n_core_inact_orb + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: n_core_orb + + .. code:: text + + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer :: n_core_orb + + File: :file:`bitmasks.irp.f` + + Core + deleted orbitals bitmask + + + + +.. c:var:: n_core_orb_allocate + + .. code:: text + + integer :: n_core_orb_allocate + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: n_generators_bitmask + + .. code:: text + + integer :: n_generators_bitmask + + File: :file:`bitmasks.irp.f` + + Number of bitmasks for generators + + + + +.. c:var:: n_generators_bitmask_restart + + .. code:: text + + integer :: n_generators_bitmask_restart + + File: :file:`bitmasks.irp.f` + + Number of bitmasks for generators + + + + +.. c:var:: n_inact_orb + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: n_inact_orb_allocate + + .. code:: text + + integer :: n_inact_orb_allocate + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: n_int + + .. code:: text + + integer :: n_int + + File: :file:`bitmasks.irp.f` + + Number of 64-bit integers needed to represent determinants as binary strings + + + + +.. c:var:: n_virt_orb + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: n_virt_orb_allocate + + .. code:: text + + integer :: n_virt_orb_allocate + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: ref_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: ref_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask + + + + +.. c:var:: reunion_of_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive, active and virtual bitmasks + + + + +.. c:var:: reunion_of_cas_inact_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_cas_inact_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive, active and virtual bitmasks + + + + +.. c:var:: reunion_of_core_inact_act_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) + integer :: n_core_inact_act_orb + + File: :file:`bitmasks.irp.f` + + Reunion of the core, inactive and active bitmasks + + + + +.. c:var:: reunion_of_core_inact_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_core_inact_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the core and inactive and virtual bitmasks + + + + +.. c:var:: unpaired_alpha_electrons + + .. code:: text + + integer(bit_kind), allocatable :: unpaired_alpha_electrons (N_int) + + File: :file:`bitmasks.irp.f` + + Bitmask reprenting the unpaired alpha electrons in the HF_bitmask + + + + +.. c:var:: virt_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: virt_bitmask_4 + + .. code:: text + + integer(bit_kind), allocatable :: virt_bitmask_4 (N_int,4) + + File: :file:`bitmasks.irp.f` + + + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: bitstring_to_hexa + + .. code:: text + + subroutine bitstring_to_hexa( output, string, Nint ) + + File: :file:`bitmasks_routines.irp.f` + + Transform a bit string to a string in hexadecimal format for printing + + + + + +.. c:function:: bitstring_to_list + + .. code:: text + + subroutine bitstring_to_list( string, list, n_elements, Nint) + + File: :file:`bitmasks_routines.irp.f` + + Gives the inidices(+1) of the bits set to 1 in the bit string + + + + + +.. c:function:: bitstring_to_str + + .. code:: text + + subroutine bitstring_to_str( output, string, Nint ) + + File: :file:`bitmasks_routines.irp.f` + + Transform a bit string to a string for printing + + + + + +.. c:function:: broadcast_chunks_bit_kind + + .. code:: text + + subroutine broadcast_chunks_bit_kind(A, LDA) + + File: :file:`mpi.irp.f` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: clear_bit_to_integer + + .. code:: text + + subroutine clear_bit_to_integer(i_physical,key,Nint) + + File: :file:`bitmasks_routines.irp.f` + + set to 0 the bit number i_physical in the bitstring key + + + + + +.. c:function:: debug_det + + .. code:: text + + subroutine debug_det(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant in '+-' notation and hexadecimal representation. + + + + + +.. c:function:: debug_spindet + + .. code:: text + + subroutine debug_spindet(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant in '+-' notation and hexadecimal representation. + + + + + +.. c:function:: example_bitmask + + .. code:: text + + subroutine example_bitmask + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in bitmask + + + + + +.. c:function:: initialize_bitmask_to_restart_ones + + .. code:: text + + subroutine initialize_bitmask_to_restart_ones + + File: :file:`modify_bitmasks.irp.f` + + Initialization of the generators_bitmask to the restart bitmask + + + + + +.. c:function:: is_a_1h + + .. code:: text + + logical function is_a_1h(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_1h1p + + .. code:: text + + logical function is_a_1h1p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_1h2p + + .. code:: text + + logical function is_a_1h2p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_1p + + .. code:: text + + logical function is_a_1p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_2h + + .. code:: text + + logical function is_a_2h(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_2h1p + + .. code:: text + + logical function is_a_2h1p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_2p + + .. code:: text + + logical function is_a_2p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_two_holes_two_particles + + .. code:: text + + logical function is_a_two_holes_two_particles(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + logical function that returns True if the determinant 'key_in' belongs to the 2h-2p excitation class of the DDCI space this is calculated using the CAS_bitmask that defines the active orbital space, the inact_bitmasl that defines the inactive oribital space and the virt_bitmask that defines the virtual orbital space + + + + + +.. c:function:: is_i_in_virtual + + .. code:: text + + logical function is_i_in_virtual(i) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_the_hole_in_det + + .. code:: text + + logical function is_the_hole_in_det(key_in,ispin,i_hole) + + File: :file:`find_hole.irp.f` + + + + + + + +.. c:function:: is_the_particl_in_det + + .. code:: text + + logical function is_the_particl_in_det(key_in,ispin,i_particl) + + File: :file:`find_hole.irp.f` + + + + + + + +.. c:function:: list_to_bitstring + + .. code:: text + + subroutine list_to_bitstring( string, list, n_elements, Nint) + + File: :file:`bitmasks_routines.irp.f` + + Returns the physical string "string(N_int,2)" from the array of occupations "list(N_int*bit_kind_size,2) + + + + + +.. c:function:: modify_bitmasks_for_hole + + .. code:: text + + subroutine modify_bitmasks_for_hole(i_hole) + + File: :file:`modify_bitmasks.irp.f` + + modify the generators_bitmask in order that one can only excite the electrons occupying i_hole + + + + + +.. c:function:: modify_bitmasks_for_hole_in_out + + .. code:: text + + subroutine modify_bitmasks_for_hole_in_out(i_hole) + + File: :file:`modify_bitmasks.irp.f` + + modify the generators_bitmask in order that one can only excite the electrons occupying i_hole + + + + + +.. c:function:: modify_bitmasks_for_particl + + .. code:: text + + subroutine modify_bitmasks_for_particl(i_part) + + File: :file:`modify_bitmasks.irp.f` + + modify the generators_bitmask in order that one can only excite the electrons to the orbital i_part + + + + + +.. c:function:: number_of_holes + + .. code:: text + + integer function number_of_holes(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + Function that returns the number of holes in the inact space + + + + + +.. c:function:: number_of_holes_verbose + + .. code:: text + + integer function number_of_holes_verbose(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + function that returns the number of holes in the inact space + + + + + +.. c:function:: number_of_particles + + .. code:: text + + integer function number_of_particles(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + function that returns the number of particles in the virtual space + + + + + +.. c:function:: number_of_particles_verbose + + .. code:: text + + integer function number_of_particles_verbose(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + function that returns the number of particles in the inact space + + + + + +.. c:function:: print_det + + .. code:: text + + subroutine print_det(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant using the '+-' notation + + + + + +.. c:function:: print_generators_bitmasks_holes + + .. code:: text + + subroutine print_generators_bitmasks_holes + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_generators_bitmasks_holes_for_one_generator + + .. code:: text + + subroutine print_generators_bitmasks_holes_for_one_generator(i_gen) + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_generators_bitmasks_particles + + .. code:: text + + subroutine print_generators_bitmasks_particles + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_generators_bitmasks_particles_for_one_generator + + .. code:: text + + subroutine print_generators_bitmasks_particles_for_one_generator(i_gen) + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_spindet + + .. code:: text + + subroutine print_spindet(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant using the '+-' notation + + + + + +.. c:function:: set_bit_to_integer + + .. code:: text + + subroutine set_bit_to_integer(i_physical,key,Nint) + + File: :file:`bitmasks_routines.irp.f` + + set to 1 the bit number i_physical in the bitstring key + + + + + +.. c:function:: set_bitmask_hole_as_input + + .. code:: text + + subroutine set_bitmask_hole_as_input(input_bimask) + + File: :file:`modify_bitmasks.irp.f` + + set the generators_bitmask for the holes as the input_bimask + + + + + +.. c:function:: set_bitmask_particl_as_input + + .. code:: text + + subroutine set_bitmask_particl_as_input(input_bimask) + + File: :file:`modify_bitmasks.irp.f` + + set the generators_bitmask for the particles as the input_bimask + + diff --git a/docs/source/modules/cis.rst b/docs/source/modules/cis.rst new file mode 100644 index 00000000..9ba5c4c7 --- /dev/null +++ b/docs/source/modules/cis.rst @@ -0,0 +1,117 @@ +.. _cis: + +.. program:: cis + +.. default-role:: option + +=== +cis +=== + +This module contains a CIS program, built by setting the following rules: + +* The only generator determinant is the Hartree-Fock (single-reference method) +* All generated singly excited determinants are included in the wave function (no perturbative + selection) + +These rules are set in the ``H_apply.irp.f`` file. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Variational |CIS| energy + + + +Subroutines / functions +----------------------- + + + +.. c:function:: cis + + .. code:: text + + subroutine cis + + File: :file:`cis.irp.f` + + Configuration Interaction with Single excitations. + + + + + +.. c:function:: h_apply_cis + + .. code:: text + + subroutine H_apply_cis() + + File: :file:`h_apply.irp.f_shell_8` + + 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. + + + + + +.. c:function:: h_apply_cis_diexc + + .. code:: text + + subroutine H_apply_cis_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cis_diexcorg + + .. code:: text + + subroutine H_apply_cis_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + + + + +.. c:function:: h_apply_cis_diexcp + + .. code:: text + + subroutine H_apply_cis_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cis_monoexc + + .. code:: text + + subroutine H_apply_cis_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + diff --git a/docs/source/modules/cisd.rst b/docs/source/modules/cisd.rst new file mode 100644 index 00000000..d1cc56d7 --- /dev/null +++ b/docs/source/modules/cisd.rst @@ -0,0 +1,117 @@ +.. _cisd: + +.. program:: cisd + +.. default-role:: option + +==== +cisd +==== + +This module contains a CISD program, built by setting the following rules: + +* The only generator determinant is the Hartree-Fock (single-reference method) +* All generated determinants are included in the wave function (no perturbative + selection) + +These rules are set in the ``H_apply.irp.f`` file. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Variational |CISD| energy + + + +Subroutines / functions +----------------------- + + + +.. c:function:: cisd + + .. code:: text + + subroutine cisd + + File: :file:`cisd.irp.f` + + Configuration Interaction with Single and Double excitations. + + + + + +.. c:function:: h_apply_cisd + + .. code:: text + + subroutine H_apply_cisd() + + File: :file:`h_apply.irp.f_shell_8` + + 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. + + + + + +.. c:function:: h_apply_cisd_diexc + + .. code:: text + + subroutine H_apply_cisd_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cisd_diexcorg + + .. code:: text + + subroutine H_apply_cisd_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + + + + +.. c:function:: h_apply_cisd_diexcp + + .. code:: text + + subroutine H_apply_cisd_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cisd_monoexc + + .. code:: text + + subroutine H_apply_cisd_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + diff --git a/docs/source/modules/davidson.rst b/docs/source/modules/davidson.rst new file mode 100644 index 00000000..dbc7f628 --- /dev/null +++ b/docs/source/modules/davidson.rst @@ -0,0 +1,720 @@ +.. _davidson: + +.. program:: davidson + +.. default-role:: option + +======== +davidson +======== + +Abstract module for Davidson's diagonalization. +It contains everything required for the Davidson algorithm, dressed or not. If +a dressing is used, the dressing column should be defined and the +:ref:`davidson_dressed` module should be used. If no dressing is required, +the :ref:`davidson` module should be used, and it has a default zero dressing vector. + +The important providers for that module are: + +# `psi_energy` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the Hamiltonian, dressed or not. It uses the general subroutine `u_0_H_u_0`. +# `psi_energy_two_e` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the standard two-electrons coulomb operator. It uses the general routine `u_0_H_u_0_two_e`. + + + +EZFIO parameters +---------------- + +.. option:: threshold_davidson + + Thresholds of Davidson's algorithm + + Default: 1.e-10 + +.. option:: n_states_diag + + Number of states to consider during the Davdison diagonalization + + Default: 4 + +.. option:: davidson_sze_max + + Number of micro-iterations before re-contracting + + Default: 8 + +.. option:: state_following + + If |true|, the states are re-ordered to match the input states + + Default: False + +.. option:: disk_based_davidson + + If |true|, disk space is used to store the vectors + + Default: False + +.. option:: distributed_davidson + + If |true|, use the distributed algorithm + + Default: True + +.. option:: only_expected_s2 + + If |true|, use filter out all vectors with bad |S^2| values + + Default: True + + +Providers +--------- + + +.. c:var:: ci_eigenvectors + + .. code:: text + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + Eigenvectors/values of the |CI| matrix + + + + +.. c:var:: ci_eigenvectors_s2 + + .. code:: text + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + Eigenvectors/values of the |CI| matrix + + + + +.. c:var:: ci_electronic_energy + + .. code:: text + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + Eigenvectors/values of the |CI| matrix + + + + +.. c:var:: ci_energy + + .. code:: text + + double precision, allocatable :: ci_energy (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + :c:data:`n_states` lowest eigenvalues of the |CI| matrix + + + + +.. c:var:: davidson_criterion + + .. code:: text + + character(64) :: davidson_criterion + + File: :file:`parameters.irp.f` + + Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] + + + + +.. c:var:: dressed_column_idx + + .. code:: text + + integer, allocatable :: dressed_column_idx (N_states) + + File: :file:`diagonalization_hs2_dressed.irp.f` + + Index of the dressed columns + + + + +.. c:var:: n_states_diag + + .. code:: text + + integer :: n_states_diag + + File: :file:`input.irp.f` + + Number of states to consider during the Davdison diagonalization + + + + +.. c:var:: nthreads_davidson + + .. code:: text + + integer :: nthreads_davidson + + File: :file:`davidson_parallel.irp.f` + + Number of threads for Davidson + + + + +.. c:var:: psi_energy + + .. code:: text + + double precision, allocatable :: psi_energy (N_states) + + File: :file:`u0_h_u0.irp.f` + + Electronic energy of the current wave function + + + + +.. c:var:: psi_energy_two_e + + .. code:: text + + double precision, allocatable :: psi_energy_two_e (N_states) + + File: :file:`u0_wee_u0.irp.f` + + Energy of the current wave function + + + + +.. c:var:: psi_energy_with_nucl_rep + + .. code:: text + + double precision, allocatable :: psi_energy_with_nucl_rep (N_states) + + File: :file:`u0_h_u0.irp.f` + + Energy of the wave function with the nuclear repulsion energy. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: davidson_collector + + .. code:: text + + subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze, N_st) + + File: :file:`davidson_parallel.irp.f` + + Routine collecting the results of the workers in Davidson's algorithm. + + + + + +.. c:function:: davidson_converged + + .. code:: text + + subroutine davidson_converged(energy,residual,wall,iterations,cpu,N_st,converged) + + File: :file:`parameters.irp.f` + + True if the Davidson algorithm is converged + + + + + +.. c:function:: davidson_diag_hjj_sjj + + .. code:: text + + subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged) + + File: :file:`diagonalization_hs2_dressed.irp.f` + + Davidson diagonalization with specific diagonal elements of the H matrix + + H_jj : specific diagonal H matrix elements to diagonalize de Davidson + + S2_out : Output : s^2 + + dets_in : bitmasks corresponding to determinants + + u_in : guess coefficients on the various states. Overwritten on exit + + dim_in : leftmost dimension of u_in + + sze : Number of determinants + + N_st : Number of eigenstates + + N_st_diag : Number of states in which H is diagonalized. Assumed > sze + + Initial guess vectors are not necessarily orthonormal + + + + + +.. c:function:: davidson_diag_hs2 + + .. code:: text + + subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_diag,Nint,dressing_state,converged) + + File: :file:`diagonalization_hs2_dressed.irp.f` + + Davidson diagonalization. + + dets_in : bitmasks corresponding to determinants + + u_in : guess coefficients on the various states. Overwritten on exit + + dim_in : leftmost dimension of u_in + + sze : Number of determinants + + N_st : Number of eigenstates + + Initial guess vectors are not necessarily orthonormal + + + + + +.. c:function:: davidson_pull_results + + .. code:: text + + subroutine davidson_pull_results(zmq_socket_pull, v_t, s_t, imin, imax, task_id) + + File: :file:`davidson_parallel.irp.f` + + Pull the results of :math:`H|U \rangle` on the master. + + + + + +.. c:function:: davidson_push_results + + .. code:: text + + subroutine davidson_push_results(zmq_socket_push, v_t, s_t, imin, imax, task_id) + + File: :file:`davidson_parallel.irp.f` + + Push the results of :math:`H|U \rangle` from a worker to the master. + + + + + +.. c:function:: davidson_run_slave + + .. code:: text + + subroutine davidson_run_slave(thread,iproc) + + File: :file:`davidson_parallel.irp.f` + + Slave routine for Davidson's diagonalization. + + + + + +.. c:function:: davidson_slave_inproc + + .. code:: text + + subroutine davidson_slave_inproc(i) + + File: :file:`davidson_parallel.irp.f` + + + + + + + +.. c:function:: davidson_slave_tcp + + .. code:: text + + subroutine davidson_slave_tcp(i) + + File: :file:`davidson_parallel.irp.f` + + + + + + + +.. c:function:: davidson_slave_work + + .. code:: text + + subroutine davidson_slave_work(zmq_to_qp_run_socket, zmq_socket_push, N_st, sze, worker_id) + + File: :file:`davidson_parallel.irp.f` + + + + + + + +.. c:function:: diagonalize_ci + + .. code:: text + + subroutine diagonalize_CI + + File: :file:`diagonalize_ci.irp.f` + + Replace the coefficients of the |CI| states by the coefficients of the eigenstates of the |CI| matrix. + + + + + +.. c:function:: h_s2_u_0_nstates_openmp + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze) + + File: :file:`u0_h_u0.irp.f` + + Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` . + + Assumes that the determinants are in psi_det + + istart, iend, ishift, istep are used in ZMQ parallelization. + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_h_u0.irp.f` + + Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_1 + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_h_u0.irp.f_template_468` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_2 + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_h_u0.irp.f_template_468` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_3 + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_h_u0.irp.f_template_468` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_4 + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_h_u0.irp.f_template_468` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_n_int + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_h_u0.irp.f_template_468` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_zmq + + .. code:: text + + subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze) + + File: :file:`davidson_parallel.irp.f` + + Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` + + n : number of determinants + + H_jj : array of :math:`\langle j|H|j \rangle` + + S2_jj : array of :math:`\langle j|S^2|j \rangle` + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp(v_0,s_0,u_0,N_st,sze) + + File: :file:`u0_wee_u0.irp.f` + + Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` + + Assumes that the determinants are in psi_det + + istart, iend, ishift, istep are used in ZMQ parallelization. + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f` + + Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_1 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_2 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_3 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_4 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_n_int + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: u_0_h_u_0 + + .. code:: text + + subroutine u_0_H_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze) + + File: :file:`u0_h_u0.irp.f` + + Computes :math:`E_0 = \frac{\langle u_0|H|u_0 \rangle}{\langle u_0|u_0 \rangle}` + + n : number of determinants + + + + + + + +.. c:function:: u_0_h_u_0_two_e + + .. code:: text + + subroutine u_0_H_u_0_two_e(e_0,u_0,n,keys_tmp,Nint,N_st,sze) + + File: :file:`u0_wee_u0.irp.f` + + Computes :math:`E_0 = \frac{ \langle u_0|H|u_0\rangle}{\langle u_0|u_0 \rangle}` . + + n : number of determinants + + + + + + + +.. c:function:: zmq_get_n_states_diag + + .. code:: text + + integer function zmq_get_N_states_diag(zmq_to_qp_run_socket, worker_id) + + File: :file:`davidson_parallel.irp.f` + + Get N_states_diag from the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_states_diag + + .. code:: text + + integer function zmq_put_N_states_diag(zmq_to_qp_run_socket,worker_id) + + File: :file:`davidson_parallel.irp.f` + + Put N_states_diag on the qp_run scheduler + + diff --git a/docs/source/modules/davidson_dressed.rst b/docs/source/modules/davidson_dressed.rst new file mode 100644 index 00000000..4697104f --- /dev/null +++ b/docs/source/modules/davidson_dressed.rst @@ -0,0 +1,13 @@ +.. _davidson_dressed: + +.. program:: davidson_dressed + +.. default-role:: option + +================ +davidson_dressed +================ + +Davidson with single-column dressing. + + diff --git a/docs/source/modules/davidson_undressed.rst b/docs/source/modules/davidson_undressed.rst new file mode 100644 index 00000000..e785b4ca --- /dev/null +++ b/docs/source/modules/davidson_undressed.rst @@ -0,0 +1,45 @@ +.. _davidson_undressed: + +.. program:: davidson_undressed + +.. default-role:: option + +================== +davidson_undressed +================== + +Module for main files Davidson's algorithm with no dressing. + + + + +Providers +--------- + + +.. c:var:: dressing_column_h + + .. code:: text + + double precision, allocatable :: dressing_column_h (N_det,N_states) + double precision, allocatable :: dressing_column_s (N_det,N_states) + + File: :file:`null_dressing_vector.irp.f` + + Null dressing vectors + + + + +.. c:var:: dressing_column_s + + .. code:: text + + double precision, allocatable :: dressing_column_h (N_det,N_states) + double precision, allocatable :: dressing_column_s (N_det,N_states) + + File: :file:`null_dressing_vector.irp.f` + + Null dressing vectors + + diff --git a/docs/source/modules/density_for_dft.rst b/docs/source/modules/density_for_dft.rst new file mode 100644 index 00000000..2c5db607 --- /dev/null +++ b/docs/source/modules/density_for_dft.rst @@ -0,0 +1,119 @@ +.. _density_for_dft: + +.. program:: density_for_dft + +.. default-role:: option + +=============== +density_for_dft +=============== + + +This module defines the *provider* of the density used for the DFT related calculations. +This definition is done through the keyword :option:`density_for_dft density_for_dft`. +The density can be: + +* WFT : the density is computed with a potentially multi determinant wave function (see variables `psi_det` and `psi_det`)# input_density : the density is set to a density previously stored in the |EZFIO| folder (see ``aux_quantities``) +* damping_rs_dft : the density is damped between the input_density and the WFT density, with a damping factor of :option:`density_for_dft damping_for_rs_dft` + + + + +EZFIO parameters +---------------- + +.. option:: density_for_dft + + Type of density used for DFT calculation. If set to WFT , it uses the density of the wave function stored in (psi_det,psi_coef). If set to input_density it uses the one-body dm stored in aux_quantities/ . If set to damping_rs_dft it uses the damped density between WFT and input_density. In the ks_scf and rs_ks_scf programs, it is set to WFT. + + Default: WFT + +.. option:: damping_for_rs_dft + + damping factor for the density used in RSFT. + + Default: 0.5 + + +Providers +--------- + + +.. c:var:: one_body_dm_alpha_ao_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + + File: :file:`density_for_dft.irp.f` + + one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft + + + + +.. c:var:: one_body_dm_average_mo_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_average_mo_for_dft (mo_num,mo_num) + + File: :file:`density_for_dft.irp.f` + + + + + + +.. c:var:: one_body_dm_beta_ao_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + + File: :file:`density_for_dft.irp.f` + + one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft + + + + +.. c:var:: one_body_dm_mo_alpha_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha_for_dft (mo_num,mo_num,N_states) + + File: :file:`density_for_dft.irp.f` + + density matrix for alpha electrons in the MO basis used for all DFT calculations based on the density + + + + +.. c:var:: one_body_dm_mo_beta_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_beta_for_dft (mo_num,mo_num,N_states) + + File: :file:`density_for_dft.irp.f` + + density matrix for beta electrons in the MO basis used for all DFT calculations based on the density + + + + +.. c:var:: one_body_dm_mo_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_for_dft (mo_num,mo_num,N_states) + + File: :file:`density_for_dft.irp.f` + + + + diff --git a/docs/source/modules/determinants.rst b/docs/source/modules/determinants.rst new file mode 100644 index 00000000..c2d56042 --- /dev/null +++ b/docs/source/modules/determinants.rst @@ -0,0 +1,4072 @@ +.. _determinants: + +.. program:: determinants + +.. default-role:: option + +============ +determinants +============ + +Contains everything for the computation of the Hamiltonian matrix elements in the basis of orthogonal Slater determinants built on a restricted spin-orbitals basis. + +The main providers for this module are: + +* :option:`determinants n_states`: number of states to be computed +* `psi_det`: list of determinants in the wave function used in many routines/providers of the |QP|. +* `psi_coef`: list of coefficients, for all :option:`determinants n_states` states, and all determinants. + +The main routines for this module are: + +* `i_H_j`: computes the Hamiltonian matrix element between two arbitrary Slater determinants. +* `i_H_j_s2`: computes the Hamiltonian and (:math:`S^2`) matrix element between two arbitrary Slater determinants. +* `i_H_j_verbose`: returns the decomposition in terms of one- and two-body components of the Hamiltonian matrix elements between two arbitrary Slater determinants. Also return the fermionic phase factor. +* `i_H_psi`: computes the Hamiltonian matrix element between an arbitrary Slater determinant and a wave function composed of a sum of arbitrary Slater determinants. + + +For an example of how to use these routines and providers, take a look at :file:`example.irp.f`. + + + +EZFIO parameters +---------------- + +.. option:: n_det_max + + Maximum number of determinants in the wave function + + Default: 1000000 + +.. option:: n_det_print_wf + + Maximum number of determinants to be printed with the program print_wf + + Default: 10000 + +.. option:: n_det_max_full + + Maximum number of determinants where |H| is fully diagonalized + + Default: 1000 + +.. option:: n_states + + Number of states to consider + + Default: 1 + +.. option:: read_wf + + If |true|, read the wave function from the |EZFIO| file + + Default: False + +.. option:: s2_eig + + Force the wave function to be an eigenfunction of |S^2| + + Default: True + +.. option:: used_weight + + 0: 1./(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi)) + + Default: 0 + +.. option:: threshold_generators + + Thresholds on generators (fraction of the square of the norm) + + Default: 0.99 + +.. option:: n_int + + Number of integers required to represent bitstrings (set in module :ref:`bitmask`) + + +.. option:: bit_kind + + (set in module :ref:`bitmask`) + + +.. option:: mo_label + + Label of the |MOs| on which the determinants are expressed + + +.. option:: n_det + + Number of determinants in the current wave function + + +.. option:: psi_coef + + Coefficients of the wave function + + +.. option:: psi_det + + Determinants of the variational space + + +.. option:: expected_s2 + + Expected value of |S^2| + + +.. option:: target_energy + + Energy that should be obtained when truncating the wave function (optional) + + Default: 0. + +.. option:: state_average_weight + + Weight of the states in state-average calculations. + + + +Providers +--------- + + +.. c:var:: abs_psi_coef_max + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: abs_psi_coef_min + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: barycentric_electronic_energy + + .. code:: text + + double precision, allocatable :: barycentric_electronic_energy (N_states) + + File: :file:`energy.irp.f` + + :math:`E_n = \sum_i {c_i^{(n)}}^2 H_{ii}` + + + + +.. c:var:: c0_weight + + .. code:: text + + double precision, allocatable :: c0_weight (N_states) + + File: :file:`density_matrix.irp.f` + + Weight of the states in the selection : :math:`\frac{1}{c_0^2}` . + + + + +.. c:var:: det_alpha_norm + + .. code:: text + + double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) + double precision, allocatable :: det_beta_norm (N_det_beta_unique) + + File: :file:`spindeterminants.irp.f` + + Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: + + ||Da||_i \sum_j C_{ij}**2 + + + + +.. c:var:: det_beta_norm + + .. code:: text + + double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) + double precision, allocatable :: det_beta_norm (N_det_beta_unique) + + File: :file:`spindeterminants.irp.f` + + Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: + + ||Da||_i \sum_j C_{ij}**2 + + + + +.. c:var:: det_to_occ_pattern + + .. code:: text + + integer, allocatable :: det_to_occ_pattern (N_det) + + File: :file:`occ_pattern.irp.f` + + Returns the index of the occupation pattern for each determinant + + + + +.. c:var:: diag_algorithm + + .. code:: text + + character*(64) :: diag_algorithm + + File: :file:`determinants.irp.f` + + Diagonalization algorithm (Davidson or Lapack) + + + + +.. c:var:: diagonal_h_matrix_on_psi_det + + .. code:: text + + double precision, allocatable :: diagonal_h_matrix_on_psi_det (N_det) + + File: :file:`energy.irp.f` + + Diagonal of the Hamiltonian ordered as psi_det + + + + +.. c:var:: double_exc_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: double_exc_bitmask (N_int,4,N_double_exc_bitmasks) + + File: :file:`determinants_bitmasks.irp.f` + + double_exc_bitmask(:,1,i) is the bitmask for holes of excitation 1 + + double_exc_bitmask(:,2,i) is the bitmask for particles of excitation 1 + + double_exc_bitmask(:,3,i) is the bitmask for holes of excitation 2 + + double_exc_bitmask(:,4,i) is the bitmask for particles of excitation 2 + + for a given couple of hole/particle excitations i. + + + + +.. c:var:: expected_s2 + + .. code:: text + + double precision :: expected_s2 + + File: :file:`s2.irp.f` + + Expected value of |S^2| : S*(S+1) + + + + +.. c:var:: fock_operator_closed_shell_ref_bitmask + + .. code:: text + + double precision, allocatable :: fock_operator_closed_shell_ref_bitmask (mo_num,mo_num) + + File: :file:`single_excitations.irp.f` + + + + + + +.. c:var:: fock_wee_closed_shell + + .. code:: text + + double precision, allocatable :: fock_wee_closed_shell (mo_num,mo_num) + + File: :file:`mono_excitations_bielec.irp.f` + + + + + + +.. c:var:: h_apply_buffer_allocated + + .. code:: text + + logical :: h_apply_buffer_allocated + integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) + + File: :file:`h_apply.irp.f` + + Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. + + + + +.. c:var:: h_apply_buffer_lock + + .. code:: text + + logical :: h_apply_buffer_allocated + integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) + + File: :file:`h_apply.irp.f` + + Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. + + + + +.. c:var:: h_matrix_all_dets + + .. code:: text + + double precision, allocatable :: h_matrix_all_dets (N_det,N_det) + + File: :file:`utils.irp.f` + + |H| matrix on the basis of the Slater determinants defined by psi_det + + + + +.. c:var:: h_matrix_cas + + .. code:: text + + double precision, allocatable :: h_matrix_cas (N_det_cas,N_det_cas) + + File: :file:`psi_cas.irp.f` + + + + + + +.. c:var:: idx_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: idx_non_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: max_degree_exc + + .. code:: text + + integer :: max_degree_exc + + File: :file:`determinants.irp.f` + + Maximum degree of excitation in the wave function with respect to the Hartree-Fock determinant. + + + + +.. c:var:: mo_energy_expval + + .. code:: text + + double precision, allocatable :: mo_energy_expval (N_states,mo_num,2,2) + + File: :file:`mo_energy_expval.irp.f` + + Third index is spin. Fourth index is 1:creation, 2:annihilation + + + + +.. c:var:: n_det + + .. code:: text + + integer :: n_det + + File: :file:`determinants.irp.f` + + Number of determinants in the wave function + + + + +.. c:var:: n_det_alpha_unique + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) + integer :: n_det_alpha_unique + + File: :file:`spindeterminants.irp.f_template_141` + + Unique :math:`\alpha` determinants + + + + +.. c:var:: n_det_beta_unique + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) + integer :: n_det_beta_unique + + File: :file:`spindeterminants.irp.f_template_141` + + Unique :math:`\beta` determinants + + + + +.. c:var:: n_det_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: n_det_non_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: n_double_exc_bitmasks + + .. code:: text + + integer :: n_double_exc_bitmasks + + File: :file:`determinants_bitmasks.irp.f` + + Number of double excitation bitmasks + + + + +.. c:var:: n_occ_pattern + + .. code:: text + + integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) + integer :: n_occ_pattern + + File: :file:`occ_pattern.irp.f` + + Array of the occ_patterns present in the wave function. + + psi_occ_pattern(:,1,j) = j-th occ_pattern of the wave function : represents all the single occupations + + psi_occ_pattern(:,2,j) = j-th occ_pattern of the wave function : represents all the double occupations + + The occ patterns are sorted by :c:func:`occ_pattern_search_key` + + + + +.. c:var:: n_single_exc_bitmasks + + .. code:: text + + integer :: n_single_exc_bitmasks + + File: :file:`determinants_bitmasks.irp.f` + + Number of single excitation bitmasks + + + + +.. c:var:: one_body_dm_ao_alpha + + .. code:: text + + double precision, allocatable :: one_body_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_body_dm_ao_beta (ao_num,ao_num) + + File: :file:`density_matrix.irp.f` + + One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` . + + + + +.. c:var:: one_body_dm_ao_beta + + .. code:: text + + double precision, allocatable :: one_body_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_body_dm_ao_beta (ao_num,ao_num) + + File: :file:`density_matrix.irp.f` + + One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` . + + + + +.. c:var:: one_body_dm_dagger_mo_spin_index + + .. code:: text + + double precision, allocatable :: one_body_dm_dagger_mo_spin_index (mo_num,mo_num,N_states,2) + + File: :file:`density_matrix.irp.f` + + + + + + +.. c:var:: one_body_dm_mo + + .. code:: text + + double precision, allocatable :: one_body_dm_mo (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + One-body density matrix + + + + +.. c:var:: one_body_dm_mo_alpha + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta (mo_num,mo_num,N_states) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_alpha_average + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_body_dm_mo_beta_average (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_beta + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta (mo_num,mo_num,N_states) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_beta_average + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_body_dm_mo_beta_average (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_diff + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_diff (mo_num,mo_num,2:N_states) + + File: :file:`density_matrix.irp.f` + + Difference of the one-body density matrix with respect to the ground state + + + + +.. c:var:: one_body_dm_mo_spin_index + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_spin_index (mo_num,mo_num,N_states,2) + + File: :file:`density_matrix.irp.f` + + + + + + +.. c:var:: one_body_single_double_dm_mo_alpha + + .. code:: text + + double precision, allocatable :: one_body_single_double_dm_mo_alpha (mo_num,mo_num) + double precision, allocatable :: one_body_single_double_dm_mo_beta (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_single_double_dm_mo_beta + + .. code:: text + + double precision, allocatable :: one_body_single_double_dm_mo_alpha (mo_num,mo_num) + double precision, allocatable :: one_body_single_double_dm_mo_beta (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_spin_density_ao + + .. code:: text + + double precision, allocatable :: one_body_spin_density_ao (ao_num,ao_num) + + File: :file:`density_matrix.irp.f` + + One body spin density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha) - \rho_{AO}(\beta)` + + + + +.. c:var:: one_body_spin_density_mo + + .. code:: text + + double precision, allocatable :: one_body_spin_density_mo (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\rho(\alpha) - \rho(\beta)` + + + + +.. c:var:: psi_average_norm_contrib + + .. code:: text + + double precision, allocatable :: psi_average_norm_contrib (psi_det_size) + + File: :file:`determinants.irp.f` + + Contribution of determinants to the state-averaged density. + + + + +.. c:var:: psi_average_norm_contrib_sorted + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_bilinear_matrix + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix (N_det_alpha_unique,N_det_beta_unique,N_states) + + File: :file:`spindeterminants.irp.f` + + Coefficient matrix if the wave function is expressed in a bilinear form : + + :math:`D_\alpha^\dagger.C.D_\beta` + + + + +.. c:var:: psi_bilinear_matrix_columns + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_columns_loc + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_columns_loc (N_det_beta_unique+1) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : + + :math:`D_\alpha^\dagger.C.D_\beta` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_order + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_order_reverse + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_order_reverse (N_det) + + File: :file:`spindeterminants.irp.f` + + Order which allows to go from psi_bilinear_matrix to psi_det + + + + +.. c:var:: psi_bilinear_matrix_order_transp_reverse + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_order_transp_reverse (N_det) + + File: :file:`spindeterminants.irp.f` + + Order which allows to go from psi_bilinear_matrix_order_transp to psi_bilinear_matrix + + + + +.. c:var:: psi_bilinear_matrix_rows + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_transp_columns + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_transp_order + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_transp_rows + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_transp_rows_loc + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_transp_rows_loc (N_det_alpha_unique+1) + + File: :file:`spindeterminants.irp.f` + + Location of the columns in the psi_bilinear_matrix + + + + +.. c:var:: psi_bilinear_matrix_transp_values + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_values + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: psi_cas_coef + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: psi_cas_coef_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_cas_energy + + .. code:: text + + double precision, allocatable :: psi_cas_energy (N_states) + + File: :file:`psi_cas.irp.f` + + Variational energy of :math:`\Psi_{CAS}` , where :math:`\Psi_{CAS} = \sum_{I \in CAS} \I \rangle \langle I | \Psi \rangle` . + + + + +.. c:var:: psi_cas_energy_diagonalized + + .. code:: text + + double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) + double precision, allocatable :: psi_cas_energy_diagonalized (N_states) + + File: :file:`psi_cas.irp.f` + + + + + + +.. c:var:: psi_cas_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_coef + + .. code:: text + + double precision, allocatable :: psi_coef (psi_det_size,N_states) + + File: :file:`determinants.irp.f` + + The wave function coefficients. Initialized with Hartree-Fock if the |EZFIO| file is empty. + + + + +.. c:var:: psi_coef_cas_diagonalized + + .. code:: text + + double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) + double precision, allocatable :: psi_cas_energy_diagonalized (N_states) + + File: :file:`psi_cas.irp.f` + + + + + + +.. c:var:: psi_coef_max + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: psi_coef_min + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: psi_coef_sorted + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_coef_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`determinants.irp.f` + + Determinants on which we apply :math:`\langle i|H|psi \rangle` for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_det + + .. code:: text + + integer(bit_kind), allocatable :: psi_det (N_int,2,psi_det_size) + + File: :file:`determinants.irp.f` + + The determinants of the wave function. Initialized with Hartree-Fock if the |EZFIO| file is empty. + + + + +.. c:var:: psi_det_alpha + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_alpha (N_int,psi_det_size) + + File: :file:`spindeterminants.irp.f` + + List of :math:`\alpha` determinants of psi_det + + + + +.. c:var:: psi_det_alpha_unique + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) + integer :: n_det_alpha_unique + + File: :file:`spindeterminants.irp.f_template_141` + + Unique :math:`\alpha` determinants + + + + +.. c:var:: psi_det_beta + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_beta (N_int,psi_det_size) + + File: :file:`spindeterminants.irp.f` + + List of :math:`\beta` determinants of psi_det + + + + +.. c:var:: psi_det_beta_unique + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) + integer :: n_det_beta_unique + + File: :file:`spindeterminants.irp.f_template_141` + + Unique :math:`\beta` determinants + + + + +.. c:var:: psi_det_hii + + .. code:: text + + double precision, allocatable :: psi_det_hii (N_det) + + File: :file:`determinants.irp.f` + + :math:`\langle i|h|i \rangle` for all determinants. + + + + +.. c:var:: psi_det_size + + .. code:: text + + integer :: psi_det_size + + File: :file:`determinants.irp.f` + + Size of the psi_det and psi_coef arrays + + + + +.. c:var:: psi_det_sorted + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_det_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`determinants.irp.f` + + Determinants on which we apply :math:`\langle i|H|psi \rangle` for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_det_sorted_order + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_energy_h_core + + .. code:: text + + double precision, allocatable :: psi_energy_h_core (N_states) + + File: :file:`psi_energy_mono_elec.irp.f` + + psi_energy_h_core = :math:`\langle \Psi | h_{core} |\Psi \rangle` + + computed using the :c:data:`one_body_dm_mo_alpha` + :c:data:`one_body_dm_mo_beta` and :c:data:`mo_one_e_integrals` + + + + +.. c:var:: psi_non_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: psi_non_cas_coef + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: psi_non_cas_coef_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_non_cas_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_occ_pattern + + .. code:: text + + integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) + integer :: n_occ_pattern + + File: :file:`occ_pattern.irp.f` + + Array of the occ_patterns present in the wave function. + + psi_occ_pattern(:,1,j) = j-th occ_pattern of the wave function : represents all the single occupations + + psi_occ_pattern(:,2,j) = j-th occ_pattern of the wave function : represents all the double occupations + + The occ patterns are sorted by :c:func:`occ_pattern_search_key` + + + + +.. c:var:: psi_occ_pattern_hii + + .. code:: text + + double precision, allocatable :: psi_occ_pattern_hii (N_occ_pattern) + + File: :file:`occ_pattern.irp.f` + + :math:`\langle I|H|I \rangle` where :math:`|I\rangle` is an occupation pattern. This is the minimum :math:`H_{ii}` , where the :math:`|i\rangle` are the determinants of :math:`|I\rangle` . + + + + +.. c:var:: ref_bitmask_e_n_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_kinetic_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_one_e_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_two_e_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_closed_shell_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: ref_closed_shell_bitmask (N_int,2) + + File: :file:`single_excitations.irp.f` + + + + + + +.. c:var:: s2_matrix_all_dets + + .. code:: text + + double precision, allocatable :: s2_matrix_all_dets (N_det,N_det) + + File: :file:`utils.irp.f` + + |S^2| matrix on the basis of the Slater determinants defined by psi_det + + + + +.. c:var:: s2_values + + .. code:: text + + double precision, allocatable :: s2_values (N_states) + + File: :file:`s2.irp.f` + + array of the averaged values of the S^2 operator on the various states + + + + +.. c:var:: s_z + + .. code:: text + + double precision :: s_z + double precision :: s_z2_sz + + File: :file:`s2.irp.f` + + z component of the Spin + + + + +.. c:var:: s_z2_sz + + .. code:: text + + double precision :: s_z + double precision :: s_z2_sz + + File: :file:`s2.irp.f` + + z component of the Spin + + + + +.. c:var:: single_exc_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: single_exc_bitmask (N_int,2,N_single_exc_bitmasks) + + File: :file:`determinants_bitmasks.irp.f` + + single_exc_bitmask(:,1,i) is the bitmask for holes + + single_exc_bitmask(:,2,i) is the bitmask for particles + + for a given couple of hole/particle excitations i. + + + + +.. c:var:: singles_alpha_csc + + .. code:: text + + integer, allocatable :: singles_alpha_csc (singles_alpha_csc_size) + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: singles_alpha_csc_idx + + .. code:: text + + integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) + integer*8 :: singles_alpha_csc_size + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: singles_alpha_csc_size + + .. code:: text + + integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) + integer*8 :: singles_alpha_csc_size + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: singles_alpha_size + + .. code:: text + + integer :: singles_alpha_size + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: state_average_weight + + .. code:: text + + double precision, allocatable :: state_average_weight (N_states) + + File: :file:`density_matrix.irp.f` + + Weights in the state-average calculation of the density matrix + + + + +.. c:var:: weight_occ_pattern + + .. code:: text + + double precision, allocatable :: weight_occ_pattern (N_occ_pattern,N_states) + + File: :file:`occ_pattern.irp.f` + + Weight of the occupation patterns in the wave function + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: a_operator + + .. code:: text + + subroutine a_operator(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules.irp.f` + + Needed for :c:func:`diag_H_mat_elem`. + + + + + +.. c:function:: a_operator_two_e + + .. code:: text + + subroutine a_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules_wee_mono.irp.f` + + Needed for :c:func:`diag_Wee_mat_elem`. + + + + + +.. c:function:: ac_operator + + .. code:: text + + subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules.irp.f` + + Needed for :c:func:`diag_H_mat_elem`. + + + + + +.. c:function:: ac_operator_two_e + + .. code:: text + + subroutine ac_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules_wee_mono.irp.f` + + Needed for :c:func:`diag_Wee_mat_elem`. + + + + + +.. c:function:: apply_excitation + + .. code:: text + + subroutine apply_excitation(det, exc, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_hole + + .. code:: text + + subroutine apply_hole(det, s1, h1, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_holes + + .. code:: text + + subroutine apply_holes(det, s1, h1, s2, h2, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_particle + + .. code:: text + + subroutine apply_particle(det, s1, p1, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_particles + + .. code:: text + + subroutine apply_particles(det, s1, p1, s2, p2, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: au0_h_au0 + + .. code:: text + + subroutine au0_h_au0(energies,psi_in,psi_in_coef,ndet,dim_psi_coef) + + File: :file:`mo_energy_expval.irp.f` + + + + + + + +.. c:function:: bitstring_to_list_ab + + .. code:: text + + subroutine bitstring_to_list_ab( string, list, n_elements, Nint) + + File: :file:`slater_rules.irp.f` + + Gives the inidices(+1) of the bits set to 1 in the bit string For alpha/beta determinants. + + + + + +.. c:function:: build_fock_tmp + + .. code:: text + + subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint) + + File: :file:`fock_diag.irp.f` + + Build the diagonal of the Fock matrix corresponding to a generator determinant. :math:`F_{00}` is :math:`\langle i|H|i \rangle = E_0` . + + + + + +.. c:function:: connected_to_ref + + .. code:: text + + integer function connected_to_ref(key,keys,Nint,N_past_in,Ndet) + + File: :file:`connected_to_ref.irp.f` + + input : key : a given Slater determinant + + : keys: a list of Slater determinants + + : Ndet: the number of Slater determinants in keys + + : N_past_in the number of Slater determinants for the connectivity research + + output : 0 : key not connected to the N_past_in first Slater determinants in keys + + i : key is connected to determinant i of keys + + -i : key is the ith determinant of the reference wf keys + + + + + +.. c:function:: connected_to_ref_by_mono + + .. code:: text + + integer function connected_to_ref_by_mono(key,keys,Nint,N_past_in,Ndet) + + File: :file:`connected_to_ref.irp.f` + + Returns |true| is ``key`` is connected to the reference by a single excitation. input : key : a given Slater determinant + + : keys: a list of Slater determinants + + : Ndet: the number of Slater determinants in keys + + : N_past_in the number of Slater determinants for the connectivity research + + output : 0 : key not connected by a MONO EXCITATION to the N_past_in first Slater determinants in keys + + i : key is connected by a MONO EXCITATION to determinant i of keys + + -i : key is the ith determinant of the reference wf keys + + + + + +.. c:function:: copy_h_apply_buffer_to_wf + + .. code:: text + + subroutine copy_H_apply_buffer_to_wf + + File: :file:`h_apply.irp.f` + + Copies the H_apply buffer to psi_coef. After calling this subroutine, N_det, psi_det and psi_coef need to be touched + + + + + +.. c:function:: copy_psi_bilinear_to_psi + + .. code:: text + + subroutine copy_psi_bilinear_to_psi(psi, isize) + + File: :file:`spindeterminants.irp.f` + + Overwrites psi_det and psi_coef with the wf in bilinear order + + + + + +.. c:function:: create_microlist + + .. code:: text + + subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_microlist, N_microlist, ptr_microlist, Nint) + + File: :file:`filter_connected.irp.f` + + + + + + + +.. c:function:: create_minilist + + .. code:: text + + subroutine create_minilist(key_mask, fullList, miniList, idx_miniList, N_fullList, N_miniList, Nint) + + File: :file:`slater_rules.irp.f` + + + + + + + +.. c:function:: create_minilist_find_previous + + .. code:: text + + subroutine create_minilist_find_previous(key_mask, fullList, miniList, N_fullList, N_miniList, fullMatch, Nint) + + File: :file:`slater_rules.irp.f` + + + + + + + +.. c:function:: create_wf_of_psi_bilinear_matrix + + .. code:: text + + subroutine create_wf_of_psi_bilinear_matrix(truncate) + + File: :file:`spindeterminants.irp.f` + + Generate a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants + + + + + +.. c:function:: decode_exc + + .. code:: text + + subroutine decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) + + File: :file:`slater_rules.irp.f` + + Decodes the exc arrays returned by get_excitation. h1,h2 : Holes p1,p2 : Particles s1,s2 : Spins (1:alpha, 2:beta) degree : Degree of excitation + + + + + +.. c:function:: decode_exc_spin + + .. code:: text + + subroutine decode_exc_spin(exc,h1,p1,h2,p2) + + File: :file:`slater_rules.irp.f` + + Decodes the exc arrays returned by get_excitation. + + h1,h2 : Holes + + p1,p2 : Particles + + + + + +.. c:function:: det_inf + + .. code:: text + + logical function det_inf(key1, key2, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Ordering function for determinants. + + + + + +.. c:function:: det_search_key + + .. code:: text + + integer*8 function det_search_key(det,Nint) + + File: :file:`connected_to_ref.irp.f` + + Return an integer*8 corresponding to a determinant index for searching + + + + + +.. c:function:: detcmp + + .. code:: text + + integer function detCmp(a,b,Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: deteq + + .. code:: text + + logical function detEq(a,b,Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: diag_h_mat_elem + + .. code:: text + + double precision function diag_H_mat_elem(det_in,Nint) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|i \rangle` . + + + + + +.. c:function:: diag_h_mat_elem_au0_h_au0 + + .. code:: text + + subroutine diag_H_mat_elem_au0_h_au0(det_in,Nint,hii) + + File: :file:`mo_energy_expval.irp.f` + + Computes :math:`\langle i|H|i \rangle` for any determinant :math:`|i\rangle` . Used for wave functions with an additional electron. + + + + + +.. c:function:: diag_h_mat_elem_fock + + .. code:: text + + double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Nint) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|i \rangle` when :math:`i` is at most a double excitation from a reference. + + + + + +.. c:function:: diag_h_mat_elem_one_e + + .. code:: text + + double precision function diag_H_mat_elem_one_e(det_in,Nint) + + File: :file:`slater_rules_wee_mono.irp.f` + + Computes :math:`\langle i|H|i \rangle` . + + + + + +.. c:function:: diag_s_mat_elem + + .. code:: text + + double precision function diag_S_mat_elem(key_i,Nint) + + File: :file:`s2.irp.f` + + Returns + + + + + +.. c:function:: diag_wee_mat_elem + + .. code:: text + + double precision function diag_wee_mat_elem(det_in,Nint) + + File: :file:`slater_rules_wee_mono.irp.f` + + Computes :math:`\langle i|H|i \rangle` . + + + + + +.. c:function:: do_mono_excitation + + .. code:: text + + subroutine do_mono_excitation(key_in,i_hole,i_particle,ispin,i_ok) + + File: :file:`create_excitations.irp.f` + + Apply the single excitation operator : a^{dager}_(i_particle) a_(i_hole) of spin = ispin on key_in ispin = 1 == alpha ispin = 2 == beta i_ok = 1 == the excitation is possible i_ok = -1 == the excitation is not possible + + + + + +.. c:function:: example_determinants + + .. code:: text + + subroutine example_determinants + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in determinants + + + + + +.. c:function:: example_determinants_psi_det + + .. code:: text + + subroutine example_determinants_psi_det + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in determinants using the psi_det/psi_coef + + + + + +.. c:function:: fill_h_apply_buffer_no_selection + + .. code:: text + + subroutine fill_H_apply_buffer_no_selection(n_selected,det_buffer,Nint,iproc) + + File: :file:`h_apply.irp.f` + + Fill the H_apply buffer with determiants for |CISD| + + + + + +.. c:function:: filter_connected + + .. code:: text + + subroutine filter_connected(key1,key2,Nint,sze,idx) + + File: :file:`filter_connected.irp.f` + + Filters out the determinants that are not connected by H + + returns the array idx which contains the index of the + + determinants in the array key1 that interact + + via the H operator with key2. + + idx(0) is the number of determinants that interact with key1 + + + + + +.. c:function:: filter_connected_i_h_psi0 + + .. code:: text + + subroutine filter_connected_i_H_psi0(key1,key2,Nint,sze,idx) + + File: :file:`filter_connected.irp.f` + + Returns the array idx which contains the index of the + + determinants in the array key1 that interact + + via the H operator with key2. + + idx(0) is the number of determinants that interact with key1 + + + + + +.. c:function:: filter_not_connected + + .. code:: text + + subroutine filter_not_connected(key1,key2,Nint,sze,idx) + + File: :file:`filter_connected.irp.f` + + Returns the array idx which contains the index of the + + determinants in the array key1 that DO NOT interact + + via the H operator with key2. + + idx(0) is the number of determinants that DO NOT interact with key1 + + + + + +.. c:function:: generate_all_alpha_beta_det_products + + .. code:: text + + subroutine generate_all_alpha_beta_det_products + + File: :file:`spindeterminants.irp.f` + + Create a wave function from all possible :math:`\alpha \times \beta` determinants + + + + + +.. c:function:: get_all_spin_doubles + + .. code:: text + + subroutine get_all_spin_doubles(buffer, idx, spindet, Nint, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the double excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_1 + + .. code:: text + + subroutine get_all_spin_doubles_1(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the double excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_2 + + .. code:: text + + subroutine get_all_spin_doubles_2(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_3 + + .. code:: text + + subroutine get_all_spin_doubles_3(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_4 + + .. code:: text + + subroutine get_all_spin_doubles_4(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_n_int + + .. code:: text + + subroutine get_all_spin_doubles_N_int(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles + + .. code:: text + + subroutine get_all_spin_singles(buffer, idx, spindet, Nint, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_1 + + .. code:: text + + subroutine get_all_spin_singles_1(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_2 + + .. code:: text + + subroutine get_all_spin_singles_2(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_3 + + .. code:: text + + subroutine get_all_spin_singles_3(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_4 + + .. code:: text + + subroutine get_all_spin_singles_4(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles + + .. code:: text + + subroutine get_all_spin_singles_and_doubles(buffer, idx, spindet, Nint, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`\alpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_1 + + .. code:: text + + subroutine get_all_spin_singles_and_doubles_1(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`\alpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_2 + + .. code:: text + + subroutine get_all_spin_singles_and_doubles_2(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_3 + + .. code:: text + + subroutine get_all_spin_singles_and_doubles_3(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_4 + + .. code:: text + + subroutine get_all_spin_singles_and_doubles_4(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_n_int + + .. code:: text + + subroutine get_all_spin_singles_and_doubles_N_int(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_n_int + + .. code:: text + + subroutine get_all_spin_singles_N_int(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_double_excitation + + .. code:: text + + subroutine get_double_excitation(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the two excitation operators between two doubly excited determinants and the phase. + + + + + +.. c:function:: get_double_excitation_spin + + .. code:: text + + subroutine get_double_excitation_spin(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the two excitation operators between two doubly excited spin-determinants and the phase. + + + + + +.. c:function:: get_excitation + + .. code:: text + + subroutine get_excitation(det1,det2,exc,degree,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operators between two determinants and the phase. + + + + + +.. c:function:: get_excitation_degree + + .. code:: text + + subroutine get_excitation_degree(key1,key2,degree,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation degree between two determinants. + + + + + +.. c:function:: get_excitation_degree_spin + + .. code:: text + + subroutine get_excitation_degree_spin(key1,key2,degree,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation degree between two determinants. + + + + + +.. c:function:: get_excitation_degree_vector + + .. code:: text + + subroutine get_excitation_degree_vector(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants. + + + + + +.. c:function:: get_excitation_degree_vector_double_alpha_beta + + .. code:: text + + subroutine get_excitation_degree_vector_double_alpha_beta(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. + + + + + +.. c:function:: get_excitation_degree_vector_mono + + .. code:: text + + subroutine get_excitation_degree_vector_mono(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and returns only the single excitations. + + + + + +.. c:function:: get_excitation_degree_vector_mono_or_exchange + + .. code:: text + + subroutine get_excitation_degree_vector_mono_or_exchange(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. + + + + + +.. c:function:: get_excitation_degree_vector_mono_or_exchange_verbose + + .. code:: text + + subroutine get_excitation_degree_vector_mono_or_exchange_verbose(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. + + + + + +.. c:function:: get_excitation_spin + + .. code:: text + + subroutine get_excitation_spin(det1,det2,exc,degree,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operators between two determinants and the phase. + + + + + +.. c:function:: get_index_in_psi_det_alpha_unique + + .. code:: text + + integer function get_index_in_psi_det_alpha_unique(key,Nint) + + File: :file:`spindeterminants.irp.f` + + Returns the index of the determinant in the ``psi_det_alpha_unique`` array + + + + + +.. c:function:: get_index_in_psi_det_beta_unique + + .. code:: text + + integer function get_index_in_psi_det_beta_unique(key,Nint) + + File: :file:`spindeterminants.irp.f` + + Returns the index of the determinant in the ``psi_det_beta_unique`` array + + + + + +.. c:function:: get_index_in_psi_det_sorted_bit + + .. code:: text + + integer function get_index_in_psi_det_sorted_bit(key,Nint) + + File: :file:`connected_to_ref.irp.f` + + Returns the index of the determinant in the ``psi_det_sorted_bit`` array + + + + + +.. c:function:: get_mono_excitation + + .. code:: text + + subroutine get_mono_excitation(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operator between two singly excited determinants and the phase. + + + + + +.. c:function:: get_mono_excitation_from_fock + + .. code:: text + + subroutine get_mono_excitation_from_fock(det_1,det_2,h,p,spin,phase,hij) + + File: :file:`single_excitations.irp.f` + + + + + + + +.. c:function:: get_mono_excitation_spin + + .. code:: text + + subroutine get_mono_excitation_spin(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operator between two singly excited determinants and the phase. + + + + + +.. c:function:: get_phase + + .. code:: text + + subroutine get_phase(key1,key2,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the phase between key1 and key2. + + + + + +.. c:function:: get_phasemask_bit + + .. code:: text + + subroutine get_phasemask_bit(det1, pm, Nint) + + File: :file:`slater_rules.irp.f` + + + + + + + +.. c:function:: get_s2 + + .. code:: text + + subroutine get_s2(key_i,key_j,Nint,s2) + + File: :file:`s2.irp.f` + + Returns + + + + + +.. c:function:: get_uj_s2_ui + + .. code:: text + + subroutine get_uJ_s2_uI(psi_keys_tmp,psi_coefs_tmp,n,nmax_coefs,nmax_keys,s2,nstates) + + File: :file:`s2.irp.f` + + returns the matrix elements of S^2 "s2(i,j)" between the "nstates" states psi_coefs_tmp(:,i) and psi_coefs_tmp(:,j) + + + + + +.. c:function:: getmobiles + + .. code:: text + + subroutine getMobiles(key,key_mask, mobiles,Nint) + + File: :file:`filter_connected.irp.f` + + + + + + + +.. c:function:: i_h_j + + .. code:: text + + subroutine i_H_j(key_i,key_j,Nint,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_double_alpha_beta + + .. code:: text + + subroutine i_H_j_double_alpha_beta(key_i,key_j,Nint,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by an opposite-spin double excitation. + + + + + +.. c:function:: i_h_j_double_spin + + .. code:: text + + subroutine i_H_j_double_spin(key_i,key_j,Nint,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a same-spin double excitation. + + + + + +.. c:function:: i_h_j_mono_spin + + .. code:: text + + subroutine i_H_j_mono_spin(key_i,key_j,Nint,spin,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. + + + + + +.. c:function:: i_h_j_mono_spin_one_e + + .. code:: text + + subroutine i_H_j_mono_spin_one_e(key_i,key_j,Nint,spin,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. + + + + + +.. c:function:: i_h_j_one_e + + .. code:: text + + subroutine i_H_j_one_e(key_i,key_j,Nint,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_s2 + + .. code:: text + + subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` and :math:`\langle i|S^2|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_two_e + + .. code:: text + + subroutine i_H_j_two_e(key_i,key_j,Nint,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_verbose + + .. code:: text + + subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_psi + + .. code:: text + + subroutine i_H_psi(key,keys,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|Psi \rangle = \sum_J c_J \langle i | H | J \rangle` . + + Uses filter_connected_i_H_psi0 to get all the :math:`|J \rangle` to which :math:`|i \rangle` is connected. The i_H_psi_minilist is much faster but requires to build the minilists. + + + + + +.. c:function:: i_h_psi_minilist + + .. code:: text + + subroutine i_H_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|\Psi \rangle = \sum_J c_J \langle i|H|J\rangle` . + + Uses filter_connected_i_H_psi0 to get all the :math:`|J \rangle` to which :math:`|i \rangle` is connected. The :math:`|J\rangle` are searched in short pre-computed lists. + + + + + +.. c:function:: i_s2_psi_minilist + + .. code:: text + + subroutine i_S2_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_S2_psi_array) + + File: :file:`s2.irp.f` + + Computes :math:`\langle i|S^2|\Psi \rangle = \sum_J c_J \langle i|S^2|J \rangle` . + + Uses filter_connected_i_H_psi0 to get all the :math:`|J\rangle` to which :math:`|i\rangle` is connected. The :math:`|J\rangle` are searched in short pre-computed lists. + + + + + +.. c:function:: i_wee_j_mono + + .. code:: text + + subroutine i_Wee_j_mono(key_i,key_j,Nint,spin,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. + + + + + +.. c:function:: is_connected_to + + .. code:: text + + logical function is_connected_to(key,keys,Nint,Ndet) + + File: :file:`connected_to_ref.irp.f` + + Returns |true| if determinant ``key`` is connected to ``keys`` + + + + + +.. c:function:: is_connected_to_by_mono + + .. code:: text + + logical function is_connected_to_by_mono(key,keys,Nint,Ndet) + + File: :file:`connected_to_ref.irp.f` + + Returns |true| is ``key`` is connected to ``keys`` by a single excitation. + + + + + +.. c:function:: is_in_wavefunction + + .. code:: text + + logical function is_in_wavefunction(key,Nint) + + File: :file:`connected_to_ref.irp.f` + + |true| if the determinant ``det`` is in the wave function + + + + + +.. c:function:: is_spin_flip_possible + + .. code:: text + + logical function is_spin_flip_possible(key_in,i_flip,ispin) + + File: :file:`create_excitations.irp.f` + + returns |true| if the spin-flip of spin ispin in the orbital i_flip is possible on key_in + + + + + +.. c:function:: make_s2_eigenfunction + + .. code:: text + + subroutine make_s2_eigenfunction + + File: :file:`occ_pattern.irp.f` + + + + + + + +.. c:function:: mono_excitation_wee + + .. code:: text + + subroutine mono_excitation_wee(det_1,det_2,h,p,spin,phase,hij) + + File: :file:`mono_excitations_bielec.irp.f` + + + + + + + +.. c:function:: occ_pattern_of_det + + .. code:: text + + subroutine occ_pattern_of_det(d,o,Nint) + + File: :file:`occ_pattern.irp.f` + + Transforms a determinant to an occupation pattern + + occ(:,1) : Single occupations + + occ(:,2) : Double occupations + + + + + + + +.. c:function:: occ_pattern_search_key + + .. code:: text + + integer*8 function occ_pattern_search_key(det,Nint) + + File: :file:`connected_to_ref.irp.f` + + Return an integer*8 corresponding to a determinant index for searching + + + + + +.. c:function:: occ_pattern_to_dets + + .. code:: text + + subroutine occ_pattern_to_dets(o,d,sze,n_alpha,Nint) + + File: :file:`occ_pattern.irp.f` + + Generate all possible determinants for a give occ_pattern + + + + + +.. c:function:: occ_pattern_to_dets_size + + .. code:: text + + subroutine occ_pattern_to_dets_size(o,sze,n_alpha,Nint) + + File: :file:`occ_pattern.irp.f` + + Number of possible determinants for a given occ_pattern + + + + + +.. c:function:: pull_pt2 + + .. code:: text + + subroutine pull_pt2(zmq_socket_pull,pt2,norm_pert,H_pert_diag,i_generator,N_st,n,task_id) + + File: :file:`h_apply.irp.f` + + Pull |PT2| calculation in the collector + + + + + +.. c:function:: push_pt2 + + .. code:: text + + subroutine push_pt2(zmq_socket_push,pt2,norm_pert,H_pert_diag,i_generator,N_st,task_id) + + File: :file:`h_apply.irp.f` + + Push |PT2| calculation to the collector + + + + + +.. c:function:: read_dets + + .. code:: text + + subroutine read_dets(det,Nint,Ndet) + + File: :file:`determinants.irp.f` + + Reads the determinants from the |EZFIO| file + + + + + +.. c:function:: remove_duplicates_in_psi_det + + .. code:: text + + subroutine remove_duplicates_in_psi_det(found_duplicates) + + File: :file:`h_apply.irp.f` + + Removes duplicate determinants in the wave function. + + + + + +.. c:function:: resize_h_apply_buffer + + .. code:: text + + subroutine resize_H_apply_buffer(new_size,iproc) + + File: :file:`h_apply.irp.f` + + Resizes the H_apply buffer of proc iproc. The buffer lock should be set before calling this function. + + + + + +.. c:function:: routine_example_psi_det + + .. code:: text + + subroutine routine_example_psi_det + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in determinants using many determinants + + + + + +.. c:function:: s2_u_0 + + .. code:: text + + subroutine S2_u_0(v_0,u_0,n,keys_tmp,Nint) + + File: :file:`s2.irp.f` + + Computes v_0 = S^2|u_0> + + n : number of determinants + + + + + + + +.. c:function:: s2_u_0_nstates + + .. code:: text + + subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) + + File: :file:`s2.irp.f` + + Computes v_0 = S^2|u_0> + + n : number of determinants + + + + + + + +.. c:function:: save_natural_mos + + .. code:: text + + subroutine save_natural_mos + + File: :file:`density_matrix.irp.f` + + Save natural orbitals, obtained by diagonalization of the one-body density matrix in the |MO| basis + + + + + +.. c:function:: save_ref_determinant + + .. code:: text + + subroutine save_ref_determinant + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: save_wavefunction + + .. code:: text + + subroutine save_wavefunction + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_general + + .. code:: text + + subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_specified + + .. code:: text + + subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,index_det_save) + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_truncated + + .. code:: text + + subroutine save_wavefunction_truncated(thr) + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_unsorted + + .. code:: text + + subroutine save_wavefunction_unsorted + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: set_natural_mos + + .. code:: text + + subroutine set_natural_mos + + File: :file:`density_matrix.irp.f` + + Set natural orbitals, obtained by diagonalization of the one-body density matrix in the |MO| basis + + + + + +.. c:function:: sort_dets_ab + + .. code:: text + + subroutine sort_dets_ab(key, idx, shortcut, N_key, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Deprecated routine + + + + + +.. c:function:: sort_dets_ab_v + + .. code:: text + + subroutine sort_dets_ab_v(key_in, key_out, idx, shortcut, version, N_key, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Deprecated routine + + + + + +.. c:function:: sort_dets_ba_v + + .. code:: text + + subroutine sort_dets_ba_v(key_in, key_out, idx, shortcut, version, N_key, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Deprecated routine + + + + + +.. c:function:: sort_dets_by_det_search_key + + .. code:: text + + subroutine sort_dets_by_det_search_key(Ndet, det_in, coef_in, sze, det_out, coef_out, N_st) + + File: :file:`determinants.irp.f` + + Determinants are sorted according to their :c:func:`det_search_key`. Useful to accelerate the search of a random determinant in the wave function. + + /!\ The first dimension of coef_out and coef_in need to be psi_det_size + + + + + + + +.. c:function:: spin_det_search_key + + .. code:: text + + integer*8 function spin_det_search_key(det,Nint) + + File: :file:`spindeterminants.irp.f` + + Return an integer(8) corresponding to a determinant index for searching + + + + + +.. c:function:: tamiser + + .. code:: text + + subroutine tamiser(key, idx, no, n, Nint, N_key) + + File: :file:`sort_dets_ab.irp.f` + + + + + + + +.. c:function:: u_0_s2_u_0 + + .. code:: text + + subroutine u_0_S2_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8) + + File: :file:`s2.irp.f` + + Computes e_0 = / + + n : number of determinants + + + + + + + +.. c:function:: wf_of_psi_bilinear_matrix + + .. code:: text + + subroutine wf_of_psi_bilinear_matrix(truncate) + + File: :file:`spindeterminants.irp.f` + + Generate a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants + + + + + +.. c:function:: write_spindeterminants + + .. code:: text + + subroutine write_spindeterminants + + File: :file:`spindeterminants.irp.f` + + + + + + + +.. c:function:: zmq_get_n_det + + .. code:: text + + integer function zmq_get_N_det(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_det from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_det_alpha_unique + + .. code:: text + + integer function zmq_get_N_det_alpha_unique(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_det_alpha_unique from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_det_beta_unique + + .. code:: text + + integer function zmq_get_N_det_beta_unique(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_det_beta_unique from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_states + + .. code:: text + + integer function zmq_get_N_states(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_states from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi + + .. code:: text + + integer function zmq_get_psi(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f` + + Get the wave function from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear + + .. code:: text + + integer function zmq_get_psi_bilinear(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f` + + Get the wave function from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_columns + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Get psi_bilinear_matrix_columns on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_order + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Get psi_bilinear_matrix_order on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_rows + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Get psi_bilinear_matrix_rows on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_values + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + get psi_bilinear_matrix_values on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_coef + + .. code:: text + + integer*8 function zmq_get_psi_coef(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + get psi_coef on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det + + .. code:: text + + integer*8 function zmq_get_psi_det(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Get psi_det on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det_alpha_unique + + .. code:: text + + integer*8 function zmq_get_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Get psi_det_alpha_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det_beta_unique + + .. code:: text + + integer*8 function zmq_get_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Get psi_det_beta_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det_size + + .. code:: text + + integer function zmq_get_psi_det_size(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get psi_det_size from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_notouch + + .. code:: text + + integer function zmq_get_psi_notouch(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f` + + Get the wave function from the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det + + .. code:: text + + integer function zmq_put_N_det(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_det on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_alpha_unique + + .. code:: text + + integer function zmq_put_N_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_det_alpha_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_beta_unique + + .. code:: text + + integer function zmq_put_N_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_det_beta_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_states + + .. code:: text + + integer function zmq_put_N_states(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_states on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi + + .. code:: text + + integer function zmq_put_psi(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f` + + Put the wave function on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear + + .. code:: text + + integer function zmq_put_psi_bilinear(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f` + + Put the wave function on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_columns + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Put psi_bilinear_matrix_columns on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_order + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Put psi_bilinear_matrix_order on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_rows + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Put psi_bilinear_matrix_rows on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_values + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + Put psi_bilinear_matrix_values on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_coef + + .. code:: text + + integer*8 function zmq_put_psi_coef(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + Put psi_coef on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det + + .. code:: text + + integer*8 function zmq_put_psi_det(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Put psi_det on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det_alpha_unique + + .. code:: text + + integer*8 function zmq_put_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Put psi_det_alpha_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det_beta_unique + + .. code:: text + + integer*8 function zmq_put_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Put psi_det_beta_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det_size + + .. code:: text + + integer function zmq_put_psi_det_size(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put psi_det_size on the qp_run scheduler + + diff --git a/docs/source/modules/dft_keywords.rst b/docs/source/modules/dft_keywords.rst new file mode 100644 index 00000000..8a5fe1a5 --- /dev/null +++ b/docs/source/modules/dft_keywords.rst @@ -0,0 +1,59 @@ +.. _dft_keywords: + +.. program:: dft_keywords + +.. default-role:: option + +============ +dft_keywords +============ + +This module contains the main keywords related to a DFT calculation or RS-DFT calculation, such as: + +* :option:`dft_keywords exchange_functional` +* :option:`dft_keywords correlation_functional` +* :option:`dft_keywords HF_exchange` : only relevent for the :c:func:`rs_ks_scf` program + +The keyword for the **range separation parameter** :math:`\mu` is the :option:`ao_two_e_erf_ints mu_erf` keyword. + +The keyword for the type of density used in RS-DFT calculation with a multi-configurational wave function is the :option:`density_for_dft density_for_dft` keyword. + + + +EZFIO parameters +---------------- + +.. option:: exchange_functional + + name of the exchange functional + + Default: short_range_LDA + +.. option:: correlation_functional + + name of the correlation functional + + Default: short_range_LDA + +.. option:: HF_exchange + + Percentage of HF exchange in the DFT model + + Default: 0. + + +Providers +--------- + + +.. c:var:: dft_type + + .. code:: text + + character*(32) :: dft_type + + File: :file:`keywords.irp.f` + + defines the type of DFT applied: LDA, GGA etc ... + + diff --git a/docs/source/modules/dft_utils_in_r.rst b/docs/source/modules/dft_utils_in_r.rst new file mode 100644 index 00000000..bf815025 --- /dev/null +++ b/docs/source/modules/dft_utils_in_r.rst @@ -0,0 +1,361 @@ +.. _dft_utils_in_r: + +.. program:: dft_utils_in_r + +.. default-role:: option + +============== +dft_utils_in_r +============== + +This module contains most of the fundamental quantities (AOs, MOs or density derivatives) evaluated in real-space representation that are needed for the various DFT modules. + +As these quantities might be used and re-used, the values at each point of the grid are stored (see ``becke_numerical_grid`` for more information on the grid). + +The main providers for this module are: + +* `aos_in_r_array`: values of the |AO| basis on the grid point. +* `mos_in_r_array`: values of the |MO| basis on the grid point. +* `one_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points. + + + + +Providers +--------- + + +.. c:var:: aos_grad_in_r_array + + .. code:: text + + double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point + + aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: aos_grad_in_r_array_transp + + .. code:: text + + double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point + + aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: aos_in_r_array + + .. code:: text + + double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid) + double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num) + + File: :file:`ao_in_r.irp.f` + + aos_in_r_array(i,j) = value of the ith ao on the jth grid point + + aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point + + + + +.. c:var:: aos_in_r_array_transp + + .. code:: text + + double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid) + double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num) + + File: :file:`ao_in_r.irp.f` + + aos_in_r_array(i,j) = value of the ith ao on the jth grid point + + aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point + + + + +.. c:var:: aos_lapl_in_r_array + + .. code:: text + + double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point + + aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: aos_lapl_in_r_array_transp + + .. code:: text + + double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point + + aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: mos_grad_in_r_array + + .. code:: text + + double precision, allocatable :: mos_grad_in_r_array (mo_num,n_points_final_grid,3) + + File: :file:`mo_in_r.irp.f` + + mos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith mo on the jth grid point + + mos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth mo on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: mos_in_r_array + + .. code:: text + + double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid) + double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num) + + File: :file:`mo_in_r.irp.f` + + mos_in_r_array(i,j) = value of the ith mo on the jth grid point + + mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point + + + + +.. c:var:: mos_in_r_array_transp + + .. code:: text + + double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid) + double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num) + + File: :file:`mo_in_r.irp.f` + + mos_in_r_array(i,j) = value of the ith mo on the jth grid point + + mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point + + + + +.. c:var:: mos_lapl_in_r_array + + .. code:: text + + double precision, allocatable :: mos_lapl_in_r_array (mo_num,n_points_final_grid,3) + + File: :file:`mo_in_r.irp.f` + + mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point + + mos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth mo on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: one_body_dm_alpha_at_r + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_body_dm_beta_at_r + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_body_grad_2_dm_alpha_at_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_body_grad_2_dm_beta_at_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_dm_alpha_in_r + + .. code:: text + + double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + + File: :file:`dm_in_r.irp.f` + + + + + + +.. c:var:: one_dm_and_grad_alpha_in_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_dm_and_grad_beta_in_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_dm_beta_in_r + + .. code:: text + + double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + + File: :file:`dm_in_r.irp.f` + + + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r + + .. code:: text + + subroutine density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r(r,dm_a,dm_b, grad_dm_a, grad_dm_b, aos_array, grad_aos_array) + + File: :file:`dm_in_r.irp.f` + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r : dm_b = beta density evaluated at r : aos_array(i) = ao(i) evaluated at r : grad_dm_a(1) = X gradient of the alpha density evaluated in r : grad_dm_a(1) = X gradient of the beta density evaluated in r : grad_aos_array(1) = X gradient of the aos(i) evaluated at r + + + + + +.. c:function:: dm_dft_alpha_beta_and_all_aos_at_r + + .. code:: text + + subroutine dm_dft_alpha_beta_and_all_aos_at_r(r,dm_a,dm_b,aos_array) + + File: :file:`dm_in_r.irp.f` + + input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r output : dm_b = beta density evaluated at r output : aos_array(i) = ao(i) evaluated at r + + + + + +.. c:function:: dm_dft_alpha_beta_at_r + + .. code:: text + + subroutine dm_dft_alpha_beta_at_r(r,dm_a,dm_b) + + File: :file:`dm_in_r.irp.f` + + input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r(3) output : dm_b = beta density evaluated at r(3) + + diff --git a/docs/source/modules/dft_utils_one_e.rst b/docs/source/modules/dft_utils_one_e.rst new file mode 100644 index 00000000..09708468 --- /dev/null +++ b/docs/source/modules/dft_utils_one_e.rst @@ -0,0 +1,1951 @@ +.. _dft_utils_one_e: + +.. program:: dft_utils_one_e + +.. default-role:: option + +=============== +dft_utils_one_e +=============== + +This module contains all the one-body related quantities needed to perform DFT or RS-DFT calculations. +Therefore, it contains most of the properties which depends on the one-body density and density matrix. + +The most important files and variables are: + +* The general *providers* for the x/c energies in :file:`e_xc_general.irp.f` +* The general *providers* for the x/c potentials in :file:`pot_general.irp.f` +* The short-range hartree operator and all related quantities in :file:`sr_coulomb.irp.f` + +These *providers* will be used in many DFT-related programs, such as :file:`ks_scf.irp.f` or :file:`rs_ks_scf.irp.f`. +It is also needed to compute the effective one-body operator needed in multi-determinant RS-DFT (see plugins by eginer). + +Some other interesting quantities: + +* The LDA and PBE *providers* for the x/c energies in :file:`e_xc.irp.f` and :file:`sr_exc.irp.f` +* The LDA and PBE *providers* for the x/c potentials on the AO basis in :file:`pot_ao.irp.f` and :file:`sr_pot_ao.irp.f` +* The :math:`h_{core}` energy computed directly with the one-body density matrix in :file:`one_e_energy_dft.irp.f` +* LDA and PBE short-range functionals *subroutines* in :file:`exc_sr_lda.irp.f` and :file:`exc_sr_pbe.irp.f` + + + + + +Providers +--------- + + +.. c:var:: aos_dsr_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dsr_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dsr_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dsr_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: effective_one_e_potential + + .. code:: text + + double precision, allocatable :: effective_one_e_potential (mo_num,mo_num,N_states) + double precision, allocatable :: effective_one_e_potential_without_kin (mo_num,mo_num,N_states) + + File: :file:`sr_coulomb.irp.f` + + Effective_one_e_potential(i,j) = :math:`\rangle i| v_{H}^{sr} |j\rangle + \rangle i| h_{core} |j\rangle + \rangle i|v_{xc} |j\rangle` + + Taking the expectation value does not provide any energy, but effective_one_e_potential(i,j) is the potential coupling DFT and WFT part to be used in any WFT calculation. + + shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal + + + + +.. c:var:: effective_one_e_potential_without_kin + + .. code:: text + + double precision, allocatable :: effective_one_e_potential (mo_num,mo_num,N_states) + double precision, allocatable :: effective_one_e_potential_without_kin (mo_num,mo_num,N_states) + + File: :file:`sr_coulomb.irp.f` + + Effective_one_e_potential(i,j) = :math:`\rangle i| v_{H}^{sr} |j\rangle + \rangle i| h_{core} |j\rangle + \rangle i|v_{xc} |j\rangle` + + Taking the expectation value does not provide any energy, but effective_one_e_potential(i,j) is the potential coupling DFT and WFT part to be used in any WFT calculation. + + shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal + + + + +.. c:var:: energy_c + + .. code:: text + + double precision, allocatable :: energy_x (N_states) + double precision, allocatable :: energy_c (N_states) + + File: :file:`e_xc_general.irp.f` + + correlation and exchange energies general providers. + + + + +.. c:var:: energy_c_lda + + .. code:: text + + double precision, allocatable :: energy_x_lda (N_states) + double precision, allocatable :: energy_c_lda (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_c_pbe + + .. code:: text + + double precision, allocatable :: energy_x_pbe (N_states) + double precision, allocatable :: energy_c_pbe (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: energy_sr_c_lda + + .. code:: text + + double precision, allocatable :: energy_sr_x_lda (N_states) + double precision, allocatable :: energy_sr_c_lda (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_sr_c_pbe + + .. code:: text + + double precision, allocatable :: energy_sr_x_pbe (N_states) + double precision, allocatable :: energy_sr_c_pbe (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: energy_sr_x_lda + + .. code:: text + + double precision, allocatable :: energy_sr_x_lda (N_states) + double precision, allocatable :: energy_sr_c_lda (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_sr_x_pbe + + .. code:: text + + double precision, allocatable :: energy_sr_x_pbe (N_states) + double precision, allocatable :: energy_sr_c_pbe (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: energy_x + + .. code:: text + + double precision, allocatable :: energy_x (N_states) + double precision, allocatable :: energy_c (N_states) + + File: :file:`e_xc_general.irp.f` + + correlation and exchange energies general providers. + + + + +.. c:var:: energy_x_lda + + .. code:: text + + double precision, allocatable :: energy_x_lda (N_states) + double precision, allocatable :: energy_c_lda (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_x_pbe + + .. code:: text + + double precision, allocatable :: energy_x_pbe (N_states) + double precision, allocatable :: energy_c_pbe (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: gga_sr_type_functionals + + .. code:: text + + subroutine GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + + File: :file:`utils.irp.f` + + routine that helps in building the x/c potentials on the AO basis for a GGA functional with a short-range interaction + + + + +.. c:var:: gga_type_functionals + + .. code:: text + + subroutine GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + + File: :file:`utils.irp.f` + + routine that helps in building the x/c potentials on the AO basis for a GGA functional + + + + +.. c:var:: grad_aos_dsr_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dsr_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dsr_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dsr_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: mu_erf_dft + + .. code:: text + + double precision :: mu_erf_dft + + File: :file:`mu_erf_dft.irp.f` + + range separation parameter used in RS-DFT. It is set to mu_erf in order to be consistent with the two electrons integrals erf + + + + +.. c:var:: potential_c_alpha_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_c_alpha_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_c_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_c_alpha_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: potential_c_beta_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_c_beta_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_c_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_c_beta_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: potential_sr_c_alpha_ao_lda + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_sr_c_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_sr_c_beta_ao_lda + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_sr_c_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_sr_x_alpha_ao_lda + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_sr_x_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_sr_x_beta_ao_lda + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_sr_x_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_x_alpha_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_x_alpha_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_x_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_x_alpha_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: potential_x_beta_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_x_beta_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_x_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_x_beta_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: psi_dft_energy_h_core + + .. code:: text + + double precision, allocatable :: psi_dft_energy_kinetic (N_states) + double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) + double precision, allocatable :: psi_dft_energy_h_core (N_states) + + File: :file:`one_e_energy_dft.irp.f` + + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft + + + + +.. c:var:: psi_dft_energy_kinetic + + .. code:: text + + double precision, allocatable :: psi_dft_energy_kinetic (N_states) + double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) + double precision, allocatable :: psi_dft_energy_h_core (N_states) + + File: :file:`one_e_energy_dft.irp.f` + + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft + + + + +.. c:var:: psi_dft_energy_nuclear_elec + + .. code:: text + + double precision, allocatable :: psi_dft_energy_kinetic (N_states) + double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) + double precision, allocatable :: psi_dft_energy_h_core (N_states) + + File: :file:`one_e_energy_dft.irp.f` + + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft + + + + +.. c:var:: shifting_constant + + .. code:: text + + double precision, allocatable :: shifting_constant (N_states) + + File: :file:`shifted_potential.irp.f` + + shifting_constant = (E_{Hxc} - <\Psi | V_{Hxc} | \Psi>) / N_elec constant to add to the potential in order to obtain the variational energy as the eigenvalue of the effective long-range Hamiltonian (see original paper of Levy PRL 113, 113002 (2014), equation (17) ) + + + + +.. c:var:: short_range_hartree + + .. code:: text + + double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) + double precision, allocatable :: short_range_hartree (N_states) + + File: :file:`sr_coulomb.irp.f` + + short_range_Hartree_operator(i,j) = :math:`\int dr i(r)j(r) \int r' \rho(r') W_{ee}^{sr}` + + short_range_Hartree = :math:`1/2 \sum_{i,j} \rho_{ij} \mathtt{short_range_Hartree_operator}(i,j)` + + = :math:`1/2 \int dr \int r' \rho(r) \rho(r') W_{ee}^{sr}` + + + + +.. c:var:: short_range_hartree_operator + + .. code:: text + + double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) + double precision, allocatable :: short_range_hartree (N_states) + + File: :file:`sr_coulomb.irp.f` + + short_range_Hartree_operator(i,j) = :math:`\int dr i(r)j(r) \int r' \rho(r') W_{ee}^{sr}` + + short_range_Hartree = :math:`1/2 \sum_{i,j} \rho_{ij} \mathtt{short_range_Hartree_operator}(i,j)` + + = :math:`1/2 \int dr \int r' \rho(r) \rho(r') W_{ee}^{sr}` + + + + +.. c:var:: trace_v_h + + .. code:: text + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + File: :file:`pot_general.irp.f` + + Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} + + + + +.. c:var:: trace_v_hxc + + .. code:: text + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + File: :file:`pot_general.irp.f` + + Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} + + + + +.. c:var:: trace_v_xc + + .. code:: text + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + File: :file:`pot_general.irp.f` + + Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: berf + + .. code:: text + + function berf(a) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dberfda + + .. code:: text + + function dberfda(a) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dpol + + .. code:: text + + double precision function dpol(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dpold + + .. code:: text + + double precision function dpold(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dpoldd + + .. code:: text + + double precision function dpoldd(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_lda + + .. code:: text + + subroutine ec_lda(rho_a,rho_b,ec,vc_a,vc_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_lda_sr + + .. code:: text + + subroutine ec_lda_sr(mu,rho_a,rho_b,ec,vc_a,vc_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_only_lda_sr + + .. code:: text + + subroutine ec_only_lda_sr(mu,rho_a,rho_b,ec) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_pbe_only + + .. code:: text + + subroutine ec_pbe_only(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec) + + File: :file:`exc_sr_pbe.irp.f` + + Short-range PBE correlation energy functional for erf interaction + + input : ========== + + mu = range separated parameter + + rhoc, rhoo = total density and spin density + + sigmacc = square of the gradient of the total density + + sigmaco = square of the gradient of the spin density + + sigmaoo = scalar product between the gradient of the total density and the one of the spin density + + output: ========== + + ec = correlation energy + + + + + + + +.. c:function:: ec_pbe_sr + + .. code:: text + + subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo) + + File: :file:`exc_sr_pbe.irp.f` + + Short-range PBE correlation energy functional for erf interaction + + input : ========== + + mu = range separated parameter + + rhoc, rhoo = total density and spin density + + sigmacc = square of the gradient of the total density + + sigmaco = square of the gradient of the spin density + + sigmaoo = scalar product between the gradient of the total density and the one of the spin density + + output: ========== + + ec = correlation energy + + all variables v** are energy derivatives with respect to components of the density + + vrhoc = derivative with respect to the total density + + vrhoo = derivative with respect to spin density + + vsigmacc = derivative with respect to the square of the gradient of the total density + + vsigmaco = derivative with respect to scalar product between the gradients of total and spin densities + + vsigmaoo = derivative with respect to the square of the gradient of the psin density + + + + + +.. c:function:: ecorrlr + + .. code:: text + + subroutine ecorrlr(rs,z,mu,eclr) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ecpw + + .. code:: text + + subroutine ecPW(x,y,ec,ecd,ecz,ecdd,eczd) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ex_lda + + .. code:: text + + subroutine ex_lda(rho_a,rho_b,ex,vx_a,vx_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ex_lda_sr + + .. code:: text + + subroutine ex_lda_sr(mu,rho_a,rho_b,ex,vx_a,vx_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ex_pbe_sr + + .. code:: text + + subroutine ex_pbe_sr(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex,vx_rho_a,vx_rho_b,vx_grd_rho_a_2,vx_grd_rho_b_2,vx_grd_rho_a_b) + + File: :file:`exc_sr_pbe.irp.f` + + mu = range separation parameter rho_a = density alpha rho_b = density beta grd_rho_a_2 = (gradient rho_a)^2 grd_rho_b_2 = (gradient rho_b)^2 grd_rho_a_b = (gradient rho_a).(gradient rho_b) ex = exchange energy density at the density and corresponding gradients of the density vx_rho_a = d ex / d rho_a vx_rho_b = d ex / d rho_b vx_grd_rho_a_2 = d ex / d grd_rho_a_2 vx_grd_rho_b_2 = d ex / d grd_rho_b_2 vx_grd_rho_a_b = d ex / d grd_rho_a_b + + + + + +.. c:function:: ex_pbe_sr_only + + .. code:: text + + subroutine ex_pbe_sr_only(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex) + + File: :file:`exc_sr_pbe.irp.f` + + rho_a = density alpha rho_b = density beta grd_rho_a_2 = (gradient rho_a)^2 grd_rho_b_2 = (gradient rho_b)^2 grd_rho_a_b = (gradient rho_a).(gradient rho_b) ex = exchange energy density at point r + + + + + +.. c:function:: g0d + + .. code:: text + + double precision function g0d(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: g0dd + + .. code:: text + + double precision function g0dd(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: g0f + + .. code:: text + + double precision function g0f(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: gpw + + .. code:: text + + subroutine GPW(x,Ac,alfa1,beta1,beta2,beta3,beta4,G,Gd,Gdd) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: grad_rho_ab_to_grad_rho_oc + + .. code:: text + + subroutine grad_rho_ab_to_grad_rho_oc(grad_rho_a_2,grad_rho_b_2,grad_rho_a_b,grad_rho_o_2,grad_rho_c_2,grad_rho_o_c) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: qrpa + + .. code:: text + + double precision function Qrpa(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: qrpad + + .. code:: text + + double precision function Qrpad(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: qrpadd + + .. code:: text + + double precision function Qrpadd(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: rho_ab_to_rho_oc + + .. code:: text + + subroutine rho_ab_to_rho_oc(rho_a,rho_b,rho_o,rho_c) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: rho_oc_to_rho_ab + + .. code:: text + + subroutine rho_oc_to_rho_ab(rho_o,rho_c,rho_a,rho_b) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: v_grad_rho_oc_to_v_grad_rho_ab + + .. code:: text + + subroutine v_grad_rho_oc_to_v_grad_rho_ab(v_grad_rho_o_2,v_grad_rho_c_2,v_grad_rho_o_c,v_grad_rho_a_2,v_grad_rho_b_2,v_grad_rho_a_b) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: v_rho_ab_to_v_rho_oc + + .. code:: text + + subroutine v_rho_ab_to_v_rho_oc(v_rho_a,v_rho_b,v_rho_o,v_rho_c) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: v_rho_oc_to_v_rho_ab + + .. code:: text + + subroutine v_rho_oc_to_v_rho_ab(v_rho_o,v_rho_c,v_rho_a,v_rho_b) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: vcorrlr + + .. code:: text + + subroutine vcorrlr(rs,z,mu,vclrup,vclrdown,vclrupd,vclrdownd) + + File: :file:`exc_sr_lda.irp.f` + + + + diff --git a/docs/source/modules/dressing.rst b/docs/source/modules/dressing.rst new file mode 100644 index 00000000..a4b3285d --- /dev/null +++ b/docs/source/modules/dressing.rst @@ -0,0 +1,36 @@ +.. _dressing: + +.. program:: dressing + +.. default-role:: option + +========= +dress_zmq +========= + +Module to facilitate the construction of modules using dressed +Hamiltonians, parallelized with |ZeroMQ|. + + + + +EZFIO parameters +---------------- + +.. option:: thresh_dressed_ci + + Threshold on the convergence of the dressed |CI| energy + + Default: 1.e-5 + +.. option:: n_it_max_dressed_ci + + Maximum number of dressed |CI| iterations + + Default: 10 + +.. option:: dress_relative_error + + Stop stochastic dressing when the relative error is smaller than :option:`perturbation PT2_relative_error` + + Default: 0.001 diff --git a/docs/source/modules/electrons.rst b/docs/source/modules/electrons.rst new file mode 100644 index 00000000..97fee97c --- /dev/null +++ b/docs/source/modules/electrons.rst @@ -0,0 +1,76 @@ +.. _electrons: + +.. program:: electrons + +.. default-role:: option + +========= +electrons +========= + +Describes the electrons. For the moment, only the number of alpha +and beta electrons are provided by this module. + + +Assumptions +=========== + +* `elec_num` >= 0 +* `elec_alpha_num` >= 0 +* `elec_beta_num` >= 0 +* `elec_alpha_num` >= `elec_beta_num` + + + + + +EZFIO parameters +---------------- + +.. option:: elec_alpha_num + + Numbers of electrons alpha ("up") + + +.. option:: elec_beta_num + + Numbers of electrons beta ("down") + + +.. option:: elec_num + + Numbers total of electrons (alpha + beta) + + Default: = electrons.elec_alpha_num + electrons.elec_beta_num + + +Providers +--------- + + +.. c:var:: elec_num + + .. code:: text + + integer :: elec_num + integer, allocatable :: elec_num_tab (2) + + File: :file:`electrons.irp.f` + + Numbers of alpha ("up") , beta ("down") and total electrons + + + + +.. c:var:: elec_num_tab + + .. code:: text + + integer :: elec_num + integer, allocatable :: elec_num_tab (2) + + File: :file:`electrons.irp.f` + + Numbers of alpha ("up") , beta ("down") and total electrons + + diff --git a/docs/source/modules/ezfio_files.rst b/docs/source/modules/ezfio_files.rst new file mode 100644 index 00000000..7bfdc840 --- /dev/null +++ b/docs/source/modules/ezfio_files.rst @@ -0,0 +1,151 @@ +.. _ezfio_files: + +.. program:: ezfio_files + +.. default-role:: option + +=========== +ezfio_files +=========== + +This modules essentially contains the name of the |EZFIO| directory in the +:c:data:`ezfio_filename` variable. This is read as the first argument of the +command-line, or as the :envvar:`QP_INPUT` environment variable. + + + + +Providers +--------- + + +.. c:var:: ezfio_filename + + .. code:: text + + character*(128) :: ezfio_filename + + File: :file:`ezfio.irp.f` + + 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. + + + + +.. c:var:: ezfio_work_dir + + .. code:: text + + character*(128) :: ezfio_work_dir + + File: :file:`ezfio.irp.f` + + EZFIO/work/ + + + + +.. c:var:: output_cpu_time_0 + + .. code:: text + + double precision :: output_wall_time_0 + double precision :: output_cpu_time_0 + + File: :file:`output.irp.f` + + Initial CPU and wall times when printing in the output files + + + + +.. c:var:: output_wall_time_0 + + .. code:: text + + double precision :: output_wall_time_0 + double precision :: output_cpu_time_0 + + File: :file:`output.irp.f` + + Initial CPU and wall times when printing in the output files + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: getunitandopen + + .. code:: text + + integer function getUnitAndOpen(f,mode) + + File: :file:`get_unit_and_open.irp.f` + + :f: file name + + :mode: 'R' : READ, UNFORMATTED 'W' : WRITE, UNFORMATTED 'r' : READ, FORMATTED 'w' : WRITE, FORMATTED 'a' : APPEND, FORMATTED 'x' : READ/WRITE, FORMATTED + + + + + + + +.. c:function:: write_bool + + .. code:: text + + subroutine write_bool(iunit,value,label) + + File: :file:`output.irp.f` + + Write an logical value in output + + + + + +.. c:function:: write_double + + .. code:: text + + subroutine write_double(iunit,value,label) + + File: :file:`output.irp.f` + + Write a double precision value in output + + + + + +.. c:function:: write_int + + .. code:: text + + subroutine write_int(iunit,value,label) + + File: :file:`output.irp.f` + + Write an integer value in output + + + + + +.. c:function:: write_time + + .. code:: text + + subroutine write_time(iunit) + + File: :file:`output.irp.f` + + Write a time stamp in the output for chronological reconstruction + + diff --git a/docs/source/modules/fci.rst b/docs/source/modules/fci.rst new file mode 100644 index 00000000..09c58e2d --- /dev/null +++ b/docs/source/modules/fci.rst @@ -0,0 +1,921 @@ +.. _fci: + +.. program:: fci + +.. default-role:: option + +=== +fci +=== + +Selected Full Configuration Interaction. + +The :command:`FCI` program starts with a single determinant, or with the wave +function in the |EZFIO| database if :option:`determinants read_wf` is |true|. +Then, it will iteratively: + +* Select the most important determinants from the external space and add them to the + internal space +* If :option:`determinants s2_eig` is |true|, add all the necessary + determinants to allow the eigenstates of |H| to be eigenstates of |S^2| +* Diagonalize |H| in the enlarged internal space +* Compute (stochastically) the second-order perturbative contribution to the energy +* Extrapolate the variational energy by fitting + :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` + + +The number of selected determinants at each iteration will be such that the +size of the wave function will double at every iteration. If :option:`determinants +s2_eig` is |true|, then the number of selected determinants will be 1.5x the +current number, and then all the additional determinants will be added. + +By default, the program will stop when more than one million determinants have +been selected, or when the |PT2| energy is below :math:`10^{-4}`. + +The variational and |PT2| energies of the iterations are stored in the +|EZFIO| database, in the :ref:`iterations` module. + + + +Computation of the |PT2| energy +------------------------------- + +At each iteration, the |PT2| energy is computed considering the Epstein-Nesbet +zeroth-order Hamiltonian: + +.. math:: + + E_{\text{PT2}} = \sum_{ \alpha } + \frac{|\langle \Psi_S | \hat{H} | \alpha \rangle|^2} + {E - \langle \alpha | \hat{H} | \alpha \rangle} + +where the |kalpha| determinants are generated by applying all the single and +double excitation operators to all the determinants of the wave function +:math:`\Psi_G`. + +When the hybrid-deterministic/stochastic algorithm is chosen +(default), :math:`Psi_G = \Psi_S = \Psi`, the full wavefunction expanded in the +internal space. +When the deterministic algorithm is chosen (:option:`perturbation do_pt2` +is set to |false|), :math:`Psi_G` is a truncation of |Psi| using +:option:`determinants threshold_generators`, and :math:`Psi_S` is a truncation +of |Psi| using :option:`determinants threshold_selectors`, and re-weighted +by :math:`1/\langle \Psi_s | \Psi_s \rangle`. + +At every iteration, while computing the |PT2|, the variance of the wave +function is also computed: + +.. math:: + + \sigma^2 & = \langle \Psi | \hat{H}^2 | \Psi \rangle - + \langle \Psi | \hat{H} | \Psi \rangle^2 \\ + & = \sum_{i \in \text{FCI}} + \langle \Psi | \hat{H} | i \rangle + \langle i | \hat{H} | \Psi \rangle - + \langle \Psi | \hat{H} | \Psi \rangle^2 \\ + & = \sum_{ \alpha } + \langle |\Psi | \hat{H} | \alpha \rangle|^2. + +The expression of the variance is the same as the expression of the |PT2|, with +a denominator of 1. It measures how far the wave function is from the |FCI| +solution. Note that the absence of denominator in the Heat-Bath selected |CI| +method is selection method by minimization of the variance, whereas |CIPSI| is +a selection method by minimization of the energy. + + +If :option:`perturbation do_pt2` is set to |false|, then the stochastic +|PT2| is not computed, and an approximate value is obtained from the |CIPSI| +selection. The calculation is faster, but the extrapolated |FCI| value is +less accurate. This way of running the code should be used when the only +goal is to generate a wave function, as for using |CIPSI| wave functions as +trial wave functions of |QMC| calculations for example. + + +The :command:`PT2` program reads the wave function of the |EZFIO| database +and computes the energy and the |PT2| contribution. + + +State-averaging +--------------- + +Extrapolated |FCI| energy +------------------------- + +An estimate of the |FCI| energy is computed by extrapolating + +.. math:: + + E=E_\text{FCI} - \alpha\, E_\text{PT2} + +This extrapolation is done for all the requested states, and excitation +energies are printed as energy differences between the extrapolated +energies of the excited states and the extrapolated energy of the ground +state. + +The extrapolations are given considering the 2 last points, the 3 last points, ..., +the 7 last points. The extrapolated value should be chosen such that the extrpolated +value is stable with the number of points. + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Calculated Selected |FCI| energy + + +.. option:: energy_pt2 + + Calculated |FCI| energy + |PT2| + + + +Providers +--------- + + +.. c:var:: initialize_pt2_e0_denominator + + .. code:: text + + logical :: initialize_pt2_e0_denominator + + File: :file:`energy.irp.f` + + If true, initialize pt2_E0_denominator + + + + +.. c:var:: pt2_cw + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_e0_denominator + + .. code:: text + + double precision, allocatable :: pt2_e0_denominator (N_states) + + File: :file:`energy.irp.f` + + E0 in the denominator of the PT2 + + + + +.. c:var:: pt2_f + + .. code:: text + + integer, allocatable :: pt2_f (N_det_generators) + integer :: pt2_n_tasks_max + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_j + + .. code:: text + + integer, allocatable :: pt2_j (N_det_generators) + integer, allocatable :: pt2_r (N_det_generators) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_mindetinfirstteeth + + .. code:: text + + integer :: pt2_n_teeth + integer :: pt2_mindetinfirstteeth + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_n_0 + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_n_tasks + + .. code:: text + + integer :: pt2_n_tasks + + File: :file:`pt2_stoch_routines.irp.f` + + Number of parallel tasks for the Monte Carlo + + + + +.. c:var:: pt2_n_tasks_max + + .. code:: text + + integer, allocatable :: pt2_f (N_det_generators) + integer :: pt2_n_tasks_max + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_n_teeth + + .. code:: text + + integer :: pt2_n_teeth + integer :: pt2_mindetinfirstteeth + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_r + + .. code:: text + + integer, allocatable :: pt2_j (N_det_generators) + integer, allocatable :: pt2_r (N_det_generators) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_stoch_istate + + .. code:: text + + integer :: pt2_stoch_istate + + File: :file:`pt2_stoch_routines.irp.f` + + State for stochatsic PT2 + + + + +.. c:var:: pt2_u + + .. code:: text + + double precision, allocatable :: pt2_u (N_det_generators) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_u_0 + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_w + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_w_t + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_to_selection_buffer + + .. code:: text + + subroutine add_to_selection_buffer(b, det, val) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: bitstring_to_list_in_selection + + .. code:: text + + subroutine bitstring_to_list_in_selection( string, list, n_elements, Nint) + + File: :file:`selection.irp.f` + + Gives the inidices(+1) of the bits set to 1 in the bit string + + + + + +.. c:function:: create_selection_buffer + + .. code:: text + + subroutine create_selection_buffer(N, siz_, res) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: delete_selection_buffer + + .. code:: text + + subroutine delete_selection_buffer(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: fci + + .. code:: text + + subroutine fci + + File: :file:`fci.irp.f` + + Selected Full Configuration Interaction. + + + + + +.. c:function:: fill_buffer_double + + .. code:: text + + subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, variance, norm, mat, buf) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_d0 + + .. code:: text + + subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_d1 + + .. code:: text + + subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_d2 + + .. code:: text + + subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_m0 + + .. code:: text + + subroutine get_m0(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_m1 + + .. code:: text + + subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_m2 + + .. code:: text + + subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_mask_phase + + .. code:: text + + subroutine get_mask_phase(det1, pm, Nint) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_phase_bi + + .. code:: text + + double precision function get_phase_bi(phasemask, s1, s2, h1, p1, h2, p2, Nint) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: make_selection_buffer_s2 + + .. code:: text + + subroutine make_selection_buffer_s2(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: merge_selection_buffers + + .. code:: text + + subroutine merge_selection_buffers(b1, b2) + + File: :file:`selection_buffer.irp.f` + + Merges the selection buffers b1 and b2 into b2 + + + + + +.. c:function:: past_d1 + + .. code:: text + + subroutine past_d1(bannedOrb, p) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: past_d2 + + .. code:: text + + subroutine past_d2(banned, p, sp) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: pt2 + + .. code:: text + + subroutine pt2 + + File: :file:`pt2.irp.f` + + Second order perturbative correction to the wave function contained in the EZFIO directory. + + + + + +.. c:function:: pt2_collector + + .. code:: text + + subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, variance, norm) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: pt2_find_sample + + .. code:: text + + integer function pt2_find_sample(v, w) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: pt2_find_sample_lr + + .. code:: text + + integer function pt2_find_sample_lr(v, w, l_in, r_in) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: pt2_slave_inproc + + .. code:: text + + subroutine pt2_slave_inproc(i) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: pull_pt2_results + + .. code:: text + + subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id, n_tasks) + + File: :file:`run_pt2_slave.irp.f` + + + + + + + +.. c:function:: pull_selection_results + + .. code:: text + + subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det, N, task_id, ntask) + + File: :file:`run_selection_slave.irp.f` + + + + + + + +.. c:function:: push_pt2_results + + .. code:: text + + subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, task_id, n_tasks) + + File: :file:`run_pt2_slave.irp.f` + + + + + + + +.. c:function:: push_selection_results + + .. code:: text + + subroutine push_selection_results(zmq_socket_push, pt2, variance, norm, b, task_id, ntask) + + File: :file:`run_selection_slave.irp.f` + + + + + + + +.. c:function:: run_pt2_slave + + .. code:: text + + subroutine run_pt2_slave(thread,iproc,energy) + + File: :file:`run_pt2_slave.irp.f` + + + + + + + +.. c:function:: run_selection_slave + + .. code:: text + + subroutine run_selection_slave(thread,iproc,energy) + + File: :file:`run_selection_slave.irp.f` + + + + + + + +.. c:function:: select_connected + + .. code:: text + + subroutine select_connected(i_generator,E0,pt2,variance,norm,b,subset,csubset) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: select_singles_and_doubles + + .. code:: text + + subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,variance,norm,buf,subset,csubset) + + File: :file:`selection.irp.f` + + WARNING /!\ : It is assumed that the generators and selectors are psi_det_sorted + + + + + +.. c:function:: selection_collector + + .. code:: text + + subroutine selection_collector(zmq_socket_pull, b, N, pt2, variance, norm) + + File: :file:`zmq_selection.irp.f` + + + + + + + +.. c:function:: selection_slave_inproc + + .. code:: text + + subroutine selection_slave_inproc(i) + + File: :file:`zmq_selection.irp.f` + + + + + + + +.. c:function:: sort_selection_buffer + + .. code:: text + + subroutine sort_selection_buffer(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: splash_pq + + .. code:: text + + subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, interesting) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: spot_isinwf + + .. code:: text + + subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: testteethbuilding + + .. code:: text + + logical function testTeethBuilding(minF, N) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: zmq_pt2 + + .. code:: text + + subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: zmq_selection + + .. code:: text + + subroutine ZMQ_selection(N_in, pt2, variance, norm) + + File: :file:`zmq_selection.irp.f` + + + + diff --git a/docs/source/modules/generators_cas.rst b/docs/source/modules/generators_cas.rst new file mode 100644 index 00000000..a00b7a01 --- /dev/null +++ b/docs/source/modules/generators_cas.rst @@ -0,0 +1,19 @@ +.. _generators_cas: + +.. program:: generators_cas + +.. default-role:: option + +============== +generators_cas +============== + +Module defining the generator determinants as those belonging to a |CAS|. +The |MOs| belonging to the |CAS| are those which were set as active with +the :ref:`qp_set_mo_class` command. + +This module is intended to be included in the :file:`NEED` file to define +the generators as the |CAS| determinants, which can be useful to define post-CAS approaches (see cassd module for instance). + + + diff --git a/docs/source/modules/generators_full.rst b/docs/source/modules/generators_full.rst new file mode 100644 index 00000000..90b32a98 --- /dev/null +++ b/docs/source/modules/generators_full.rst @@ -0,0 +1,145 @@ +.. _generators_full: + +.. program:: generators_full + +.. default-role:: option + +=============== +generators_full +=============== + +Module defining the generator determinants as all the determinants of the +variational space. + +This module is intended to be included in the :file:`NEED` file to define +a full set of generators. + + + +Providers +--------- + + +.. c:var:: degree_max_generators + + .. code:: text + + integer :: degree_max_generators + + File: :file:`generators.irp.f` + + Max degree of excitation (respect to HF) of the generators + + + + +.. c:var:: n_det_generators + + .. code:: text + + integer :: n_det_generators + + File: :file:`generators.irp.f` + + For Single reference wave functions, the number of generators is 1 : the Hartree-Fock determinant + + + + +.. c:var:: psi_coef_generators + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_coef_sorted_gen + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) + integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_det_generators + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_det_sorted_gen + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) + integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_det_sorted_gen_order + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) + integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: select_max + + .. code:: text + + double precision, allocatable :: select_max (size_select_max) + + File: :file:`generators.irp.f` + + Memo to skip useless selectors + + + + +.. c:var:: size_select_max + + .. code:: text + + integer :: size_select_max + + File: :file:`generators.irp.f` + + Size of the select_max array + + diff --git a/docs/source/modules/hartree_fock.rst b/docs/source/modules/hartree_fock.rst new file mode 100644 index 00000000..7ca55dfe --- /dev/null +++ b/docs/source/modules/hartree_fock.rst @@ -0,0 +1,233 @@ +.. _hartree_fock: + +.. program:: hartree_fock + +.. default-role:: option + +============ +hartree_fock +============ + + +The Hartree-Fock module performs *Restricted* Hartree-Fock calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals). + +The Hartree-Fock in an SCF and therefore is based on the ``scf_utils`` structure. +It performs the following actions: + +#. Compute/Read all the one- and two-electron integrals, and store them in memory + +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations + +The definition of the Fock matrix is in :file:`hartree_fock fock_matrix_hf.irp.f` +For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. +The main are: + +# :option:`scf_utils thresh_scf` + +# :option:`scf_utils level_shift` + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + + + + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Energy HF + + + +Providers +--------- + + +.. c:var:: ao_two_e_integral_alpha + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: ao_two_e_integral_beta + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: extra_e_contrib_density + + .. code:: text + + double precision :: extra_e_contrib_density + + File: :file:`hf_energy.irp.f` + + Extra contribution to the SCF energy coming from the density. + + For a Hartree-Fock calculation: extra_e_contrib_density = 0 + + For a Kohn-Sham or Range-separated Kohn-Sham: the exchange/correlation - trace of the V_xc potential + + + + +.. c:var:: fock_matrix_ao_alpha + + .. code:: text + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: fock_matrix_ao_beta + + .. code:: text + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: hf_energy + + .. code:: text + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + File: :file:`hf_energy.irp.f` + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + + + +.. c:var:: hf_one_electron_energy + + .. code:: text + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + File: :file:`hf_energy.irp.f` + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + + + +.. c:var:: hf_two_electron_energy + + .. code:: text + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + File: :file:`hf_energy.irp.f` + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: create_guess + + .. code:: text + + subroutine create_guess + + File: :file:`scf.irp.f` + + Create a MO guess if no MOs are present in the EZFIO directory + + + + + +.. c:function:: run + + .. code:: text + + subroutine run + + File: :file:`scf.irp.f` + + Run SCF calculation + + + + + +.. c:function:: scf + + .. code:: text + + subroutine scf + + File: :file:`scf.irp.f` + + Produce `Hartree_Fock` |MOs| + + output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ + + output: hartree_fock.energy + + optional: mo_basis.mo_coef + + diff --git a/docs/source/modules/iterations.rst b/docs/source/modules/iterations.rst new file mode 100644 index 00000000..0f192da4 --- /dev/null +++ b/docs/source/modules/iterations.rst @@ -0,0 +1,114 @@ +.. _iterations: + +.. program:: iterations + +.. default-role:: option + +========== +iterations +========== + +Module which saves the computed energies for an extrapolation to +the |FCI| limit. + + + +EZFIO parameters +---------------- + +.. option:: n_iter + + Number of saved iterations + + Default: 1 + +.. option:: n_det_iterations + + Number of determinants at each iteration + + +.. option:: energy_iterations + + The variational energy at each iteration + + +.. option:: pt2_iterations + + The |PT2| correction at each iteration + + + +Providers +--------- + + +.. c:var:: extrapolated_energy + + .. code:: text + + double precision, allocatable :: extrapolated_energy (N_iter,N_states) + + File: :file:`iterations.irp.f` + + Extrapolated energy, using E_var = f(PT2) where PT2=0 + + + + +.. c:var:: n_iter + + .. code:: text + + integer :: n_iter + + File: :file:`io.irp.f` + + number of iterations + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: print_extrapolated_energy + + .. code:: text + + subroutine print_extrapolated_energy(e_,pt2_) + + File: :file:`print_extrapolation.irp.f` + + Print the extrapolated energy in the output + + + + + +.. c:function:: print_summary + + .. code:: text + + subroutine print_summary(e_,pt2_,error_,variance_,norm_) + + File: :file:`print_summary.irp.f` + + Print the extrapolated energy in the output + + + + + +.. c:function:: save_iterations + + .. code:: text + + subroutine save_iterations(e_, pt2_,n_) + + File: :file:`iterations.irp.f` + + Update the energy in the EZFIO file. + + diff --git a/docs/source/modules/kohn_sham.rst b/docs/source/modules/kohn_sham.rst new file mode 100644 index 00000000..4710a3d8 --- /dev/null +++ b/docs/source/modules/kohn_sham.rst @@ -0,0 +1,87 @@ +.. _kohn_sham: + +.. program:: kohn_sham + +.. default-role:: option + +========= +kohn_sham +========= + + +The Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals). + +The Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure. +It performs the following actions: + +#. Compute/Read all the one- and two-electron integrals, and store them in memory +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations + +The definition of the Fock matrix is in :file:`kohn_sham fock_matrix_ks.irp.f` +For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. +The main are: + +#. :option:`scf_utils thresh_scf` +#. :option:`scf_utils level_shift` + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + + + + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + + + +Providers +--------- + + +.. c:var:: ks_energy + + .. code:: text + + double precision :: ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`ks_enery.irp.f` + + Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: srs_ks_cf + + .. code:: text + + subroutine srs_ks_cf + + File: :file:`ks_scf.irp.f` + + Produce `Kohn_Sham` MO orbital output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: kohn_sham.energy optional: mo_basis.mo_coef + + diff --git a/docs/source/modules/kohn_sham_rs.rst b/docs/source/modules/kohn_sham_rs.rst new file mode 100644 index 00000000..ca51ab5b --- /dev/null +++ b/docs/source/modules/kohn_sham_rs.rst @@ -0,0 +1,259 @@ +.. _kohn_sham_rs: + +.. program:: kohn_sham_rs + +.. default-role:: option + +============ +kohn_sham_rs +============ + + +The Range-separated Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals) where the coulomb interaction is partially treated using exact exchange. +The splitting of the interaction between long- and short-range is determined by the range-separation parameter :option:`ao_two_e_erf_ints mu_erf`. The long-range part of the interaction is explicitly treated with exact exchange, and the short-range part of the interaction is treated with appropriate DFT functionals. + +The Range-separated Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure. +It performs the following actions: + +#. Compute/Read all the one- and two-electron integrals, and store them in memory +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations + +The definition of the Fock matrix is in :file:`kohn_sham_rs fock_matrix_rs_ks.irp.f` +For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. +The main are: +# :option:`scf_utils thresh_scf` +# :option:`scf_utils level_shift` + + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Energy range separated hybrid + + + +Providers +--------- + + +.. c:var:: ao_potential_alpha_xc + + .. code:: text + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: ao_potential_beta_xc + + .. code:: text + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: e_correlation_dft + + .. code:: text + + double precision :: e_correlation_dft + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: e_exchange_dft + + .. code:: text + + double precision :: e_exchange_dft + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: fock_matrix_alpha_no_xc_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) + double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) + + File: :file:`fock_matrix_rs_ks.irp.f` + + Mono electronic an Coulomb matrix in AO basis set + + + + +.. c:var:: fock_matrix_beta_no_xc_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) + double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) + + File: :file:`fock_matrix_rs_ks.irp.f` + + Mono electronic an Coulomb matrix in AO basis set + + + + +.. c:var:: fock_matrix_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: one_electron_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: rs_ks_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: trace_potential_xc + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: two_electron_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: check_coherence_functional + + .. code:: text + + subroutine check_coherence_functional + + File: :file:`rs_ks_scf.irp.f` + + + + + + + +.. c:function:: rs_ks_scf + + .. code:: text + + subroutine rs_ks_scf + + File: :file:`rs_ks_scf.irp.f` + + Produce `Range_separated_Kohn_Sham` MO orbital output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: kohn_sham.energy optional: mo_basis.mo_coef + + diff --git a/docs/source/modules/mo_basis.rst b/docs/source/modules/mo_basis.rst new file mode 100644 index 00000000..bf647f5c --- /dev/null +++ b/docs/source/modules/mo_basis.rst @@ -0,0 +1,370 @@ +.. _mo_basis: + +.. program:: mo_basis + +.. default-role:: option + +======== +mo_basis +======== + +Molecular orbitals are expressed as + +.. math:: + + \phi_k({\bf r}) = \sum_i C_{ik} \chi_k({\bf r}) + + +where :math:`\chi_k` are *normalized* atomic basis functions. + +The current set of |MOs| has a label `mo_label`. +When the orbitals are modified, the label should also be updated to keep +everything consistent. + +When saving the |MOs|, the :file:`mo_basis` directory of the |EZFIO| database +is copied in the :file:`save` directory, named by the current `mo_label`. All +this is done with the script named :file:`save_current_mos.sh` in the +:file:`$QP_ROOT/scripts` directory. + + + + + + +EZFIO parameters +---------------- + +.. option:: mo_num + + Total number of |MOs| + + +.. option:: mo_coef + + Coefficient of the i-th |AO| on the j-th |MO| + + +.. option:: mo_label + + Label characterizing the MOS (Local, Canonical, Natural, *etc*) + + +.. option:: mo_occ + + |MO| occupation numbers + + +.. option:: mo_class + + [ Core | Inactive | Active | Virtual | Deleted ], as defined by :ref:`qp_set_mo_class` + + +.. option:: ao_md5 + + MD5 checksum characterizing the |AO| basis set. + + + +Providers +--------- + + +.. c:var:: mo_coef + + .. code:: text + + double precision, allocatable :: mo_coef (ao_num,mo_num) + + File: :file:`mos.irp.f` + + Molecular orbital coefficients on |AO| basis set + + mo_coef(i,j) = coefficient of the i-th |AO| on the jth mo + + mo_label : Label characterizing the MOS (local, canonical, natural, etc) + + + + +.. c:var:: mo_coef_begin_iteration + + .. code:: text + + double precision, allocatable :: mo_coef_begin_iteration (ao_num,mo_num) + + File: :file:`track_orb.irp.f` + + Void provider to store the coefficients of the |MO| basis at the beginning of the SCF iteration + + Usefull to track some orbitals + + + + +.. c:var:: mo_coef_in_ao_ortho_basis + + .. code:: text + + double precision, allocatable :: mo_coef_in_ao_ortho_basis (ao_num,mo_num) + + File: :file:`mos.irp.f` + + |MO| coefficients in orthogonalized |AO| basis + + :math:`C^{-1}.C_{mo}` + + + + +.. c:var:: mo_coef_transp + + .. code:: text + + double precision, allocatable :: mo_coef_transp (mo_num,ao_num) + + File: :file:`mos.irp.f` + + |MO| coefficients on |AO| basis set + + + + +.. c:var:: mo_label + + .. code:: text + + character*(64) :: mo_label + + File: :file:`mos.irp.f` + + |MO| coefficients on |AO| basis set + + mo_coef(i,j) = coefficient of the i-th |AO| on the j-th |MO| + + mo_label : Label characterizing the |MOs| (local, canonical, natural, etc) + + + + +.. c:var:: mo_num + + .. code:: text + + integer :: mo_num + + File: :file:`mos.irp.f` + + Number of MOs + + + + +.. c:var:: mo_occ + + .. code:: text + + double precision, allocatable :: mo_occ (mo_num) + + File: :file:`mos.irp.f` + + |MO| occupation numbers + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_ortho_cano_to_ao + + .. code:: text + + subroutine ao_ortho_cano_to_ao(A_ao,LDA_ao,A,LDA) + + File: :file:`mos.irp.f` + + Transform A from the |AO| basis to the orthogonal |AO| basis + + :math:`C^{-1}.A_{ao}.C^{\dagger-1}` + + + + + +.. c:function:: ao_to_mo + + .. code:: text + + subroutine ao_to_mo(A_ao,LDA_ao,A_mo,LDA_mo) + + File: :file:`mos.irp.f` + + Transform A from the |AO| basis to the |MO| basis + + :math:`C^\dagger.A_{ao}.C` + + + + + +.. c:function:: give_all_mos_and_grad_and_lapl_at_r + + .. code:: text + + subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_lapl_array) + + File: :file:`mos_in_r.irp.f` + + + + + + + +.. c:function:: give_all_mos_and_grad_at_r + + .. code:: text + + subroutine give_all_mos_and_grad_at_r(r,mos_array,mos_grad_array) + + File: :file:`mos_in_r.irp.f` + + + + + + + +.. c:function:: give_all_mos_at_r + + .. code:: text + + subroutine give_all_mos_at_r(r,mos_array) + + File: :file:`mos_in_r.irp.f` + + + + + + + +.. c:function:: initialize_mo_coef_begin_iteration + + .. code:: text + + subroutine initialize_mo_coef_begin_iteration + + File: :file:`track_orb.irp.f` + + + + Initialize :c:data:`mo_coef_begin_iteration` to the current :c:data:`mo_coef` + + + + + +.. c:function:: mix_mo_jk + + .. code:: text + + subroutine mix_mo_jk(j,k) + + File: :file:`mos.irp.f` + + Rotates the j-th |MO| with the k-th |MO| to give two new |MOs| that are + + * :math:`+ = \frac{1}{\sqrt{2}} (|j\rangle + |k\rangle)` + + * :math:`- = \frac{1}{\sqrt{2}} (|j\rangle - |k\rangle)` + + by convention, the '+' |MO| is in the lowest index (min(j,k)) by convention, the '-' |MO| is in the highest index (max(j,k)) + + + + + +.. c:function:: mo_as_eigvectors_of_mo_matrix + + .. code:: text + + subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label,sign,output) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: mo_as_svd_vectors_of_mo_matrix + + .. code:: text + + subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: mo_as_svd_vectors_of_mo_matrix_eig + + .. code:: text + + subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: reorder_active_orb + + .. code:: text + + subroutine reorder_active_orb + + File: :file:`track_orb.irp.f` + + routines that takes the current :c:data:`mo_coef` and reorder the active orbitals (see :c:data:`list_act` and :c:data:`n_act_orb`) according to the overlap with :c:data:`mo_coef_begin_iteration` + + + + + +.. c:function:: save_mos + + .. code:: text + + subroutine save_mos + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: save_mos_truncated + + .. code:: text + + subroutine save_mos_truncated(n) + + File: :file:`utils.irp.f` + + + + diff --git a/docs/source/modules/mo_guess.rst b/docs/source/modules/mo_guess.rst new file mode 100644 index 00000000..24dc1476 --- /dev/null +++ b/docs/source/modules/mo_guess.rst @@ -0,0 +1,87 @@ +.. _mo_guess: + +.. program:: mo_guess + +.. default-role:: option + +======== +mo_guess +======== + +Guess for |MOs|. + + + + +Providers +--------- + + +.. c:var:: ao_ortho_canonical_nucl_elec_integrals + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_nucl_elec_integrals (mo_num,mo_num) + + File: :file:`pot_mo_ortho_canonical_ints.irp.f` + + + + + + +.. c:var:: ao_ortho_lowdin_coef + + .. code:: text + + double precision, allocatable :: ao_ortho_lowdin_coef (ao_num,ao_num) + + File: :file:`mo_ortho_lowdin.irp.f` + + matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_lowdin_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_lowdin orbital + + + + +.. c:var:: ao_ortho_lowdin_nucl_elec_integrals + + .. code:: text + + double precision, allocatable :: ao_ortho_lowdin_nucl_elec_integrals (mo_num,mo_num) + + File: :file:`pot_mo_ortho_lowdin_ints.irp.f` + + + + + + +.. c:var:: ao_ortho_lowdin_overlap + + .. code:: text + + double precision, allocatable :: ao_ortho_lowdin_overlap (ao_num,ao_num) + + File: :file:`mo_ortho_lowdin.irp.f` + + overlap matrix of the ao_ortho_lowdin supposed to be the Identity + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: hcore_guess + + .. code:: text + + subroutine hcore_guess + + File: :file:`h_core_guess_routine.irp.f` + + Produce `H_core` MO orbital + + diff --git a/docs/source/modules/mo_one_e_ints.rst b/docs/source/modules/mo_one_e_ints.rst new file mode 100644 index 00000000..167b62c8 --- /dev/null +++ b/docs/source/modules/mo_one_e_ints.rst @@ -0,0 +1,287 @@ +.. _mo_one_e_ints: + +.. program:: mo_one_e_ints + +.. default-role:: option + +================== +mo_one_e_integrals +================== + +All the one-electron integrals in |MO| basis are defined here. + +The most important providers for usual quantum-chemistry calculation are: + +* `mo_kinetic_integrals` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_mo_ints.irp.f`) +* `mo_integrals_n_e` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_mo_ints.irp.f`) +* `mo_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`mo_mono_ints.irp.f`) + +Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_mo.irp.f`. + + + +EZFIO parameters +---------------- + +.. option:: mo_integrals_e_n + + Nucleus-electron integrals in |MO| basis set + + +.. option:: io_mo_integrals_e_n + + Read/Write |MO| electron-nucleus attraction integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_integrals_kinetic + + Kinetic energy integrals in |MO| basis set + + +.. option:: io_mo_integrals_kinetic + + Read/Write |MO| one-electron kinetic integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_integrals_pseudo + + Pseudopotential integrals in |MO| basis set + + +.. option:: io_mo_integrals_pseudo + + Read/Write |MO| pseudopotential integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_one_e_integrals + + One-electron integrals in |MO| basis set + + +.. option:: io_mo_one_e_integrals + + Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ] + + Default: None + + +Providers +--------- + + +.. c:var:: mo_dipole_x + + .. code:: text + + double precision, allocatable :: mo_dipole_x (mo_num,mo_num) + double precision, allocatable :: mo_dipole_y (mo_num,mo_num) + double precision, allocatable :: mo_dipole_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j + + + + +.. c:var:: mo_dipole_y + + .. code:: text + + double precision, allocatable :: mo_dipole_x (mo_num,mo_num) + double precision, allocatable :: mo_dipole_y (mo_num,mo_num) + double precision, allocatable :: mo_dipole_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j + + + + +.. c:var:: mo_dipole_z + + .. code:: text + + double precision, allocatable :: mo_dipole_x (mo_num,mo_num) + double precision, allocatable :: mo_dipole_y (mo_num,mo_num) + double precision, allocatable :: mo_dipole_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j + + + + +.. c:var:: mo_integrals_n_e + + .. code:: text + + double precision, allocatable :: mo_integrals_n_e (mo_num,mo_num) + + File: :file:`pot_mo_ints.irp.f` + + Nucleus-electron interaction on the |MO| basis + + + + +.. c:var:: mo_integrals_n_e_per_atom + + .. code:: text + + double precision, allocatable :: mo_integrals_n_e_per_atom (mo_num,mo_num,nucl_num) + + File: :file:`pot_mo_ints.irp.f` + + mo_integrals_n_e_per_atom(i,j,k) = :math:`\langle \phi_i| -\frac{1}{|r-R_k|} | \phi_j \rangle` . where R_k is the coordinate of the k-th nucleus. + + + + +.. c:var:: mo_kinetic_integrals + + .. code:: text + + double precision, allocatable :: mo_kinetic_integrals (mo_num,mo_num) + + File: :file:`kin_mo_ints.irp.f` + + Kinetic energy integrals in the MO basis + + + + +.. c:var:: mo_one_e_integrals + + .. code:: text + + double precision, allocatable :: mo_one_e_integrals (mo_num,mo_num) + + File: :file:`mo_one_e_ints.irp.f` + + array of the mono electronic hamiltonian on the MOs basis : sum of the kinetic and nuclear electronic potential (and pseudo potential if needed) + + + + +.. c:var:: mo_overlap + + .. code:: text + + double precision, allocatable :: mo_overlap (mo_num,mo_num) + + File: :file:`mo_overlap.irp.f` + + Provider to check that the MOs are indeed orthonormal. + + + + +.. c:var:: mo_pseudo_integrals + + .. code:: text + + double precision, allocatable :: mo_pseudo_integrals (mo_num,mo_num) + + File: :file:`pot_mo_pseudo_ints.irp.f` + + Pseudopotential integrals in |MO| basis + + + + +.. c:var:: mo_spread_x + + .. code:: text + + double precision, allocatable :: mo_spread_x (mo_num,mo_num) + double precision, allocatable :: mo_spread_y (mo_num,mo_num) + double precision, allocatable :: mo_spread_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j + + + + +.. c:var:: mo_spread_y + + .. code:: text + + double precision, allocatable :: mo_spread_x (mo_num,mo_num) + double precision, allocatable :: mo_spread_y (mo_num,mo_num) + double precision, allocatable :: mo_spread_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j + + + + +.. c:var:: mo_spread_z + + .. code:: text + + double precision, allocatable :: mo_spread_x (mo_num,mo_num) + double precision, allocatable :: mo_spread_y (mo_num,mo_num) + double precision, allocatable :: mo_spread_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j + + + + +.. c:var:: s_mo_coef + + .. code:: text + + double precision, allocatable :: s_mo_coef (ao_num,mo_num) + + File: :file:`ao_to_mo.irp.f` + + Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: mo_to_ao + + .. code:: text + + subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) + + File: :file:`ao_to_mo.irp.f` + + Transform A from the MO basis to the AO basis + + (S.C).A_mo.(S.C)t + + + + + +.. c:function:: orthonormalize_mos + + .. code:: text + + subroutine orthonormalize_mos + + File: :file:`orthonormalize.irp.f` + + + + diff --git a/docs/source/modules/mo_two_e_erf_ints.rst b/docs/source/modules/mo_two_e_erf_ints.rst new file mode 100644 index 00000000..12f7c130 --- /dev/null +++ b/docs/source/modules/mo_two_e_erf_ints.rst @@ -0,0 +1,488 @@ +.. _mo_two_e_erf_ints: + +.. program:: mo_two_e_erf_ints + +.. default-role:: option + +====================== +mo_two_e_erf_ints +====================== + +Here, all two-electron integrals (:math:`erf({\mu}_{erf} * r_{12})/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`Utils/map_module.f90`. + +The range separation parameter :math:`{\mu}_{erf}` is the variable :option:`ao_two_e_erf_ints mu_erf`. + +To fetch an |MO| integral, use +`get_mo_two_e_integral_erf(i,j,k,l,mo_integrals_map_erf)` + +The conventions are: + +* For |MO| integrals : = <12|12> + +Be aware that it might not be the same conventions for |MO| and |AO| integrals. + + + + + +EZFIO parameters +---------------- + +.. option:: io_mo_two_e_integrals_erf + + Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ] + + Default: None + + +Providers +--------- + + +.. c:var:: core_energy_erf + + .. code:: text + + double precision :: core_energy_erf + + File: :file:`core_quantities_erf.irp.f` + + energy from the core : contains all core-core contributionswith the erf interaction + + + + +.. c:var:: core_fock_operator_erf + + .. code:: text + + double precision, allocatable :: core_fock_operator_erf (mo_num,mo_num) + + File: :file:`core_quantities_erf.irp.f` + + this is the contribution to the Fock operator from the core electrons with the erf interaction + + + + +.. c:var:: insert_into_mo_integrals_erf_map + + .. code:: text + + subroutine insert_into_mo_integrals_erf_map(n_integrals, & + buffer_i, buffer_values, thr) + + File: :file:`map_integrals_erf.irp.f` + + Create new entry into |MO| map, or accumulate in an existing entry + + + + +.. c:var:: int_erf_3_index + + .. code:: text + + double precision, allocatable :: int_erf_3_index (mo_num,mo_num,mo_num) + double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_num) + + File: :file:`ints_erf_3_index.irp.f` + + int_erf_3_index(i,j) = = (ii|jj) with the erf interaction + + int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction + + + + +.. c:var:: int_erf_3_index_exc + + .. code:: text + + double precision, allocatable :: int_erf_3_index (mo_num,mo_num,mo_num) + double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_num) + + File: :file:`ints_erf_3_index.irp.f` + + int_erf_3_index(i,j) = = (ii|jj) with the erf interaction + + int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction + + + + +.. c:var:: mo_integrals_erf_cache + + .. code:: text + + double precision, allocatable :: mo_integrals_erf_cache (0:64*64*64*64) + + File: :file:`map_integrals_erf.irp.f` + + Cache of |MO| integrals for fast access + + + + +.. c:var:: mo_integrals_erf_cache_max + + .. code:: text + + integer :: mo_integrals_erf_cache_min + integer :: mo_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_erf_cache_min + + .. code:: text + + integer :: mo_integrals_erf_cache_min + integer :: mo_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_erf_map + + .. code:: text + + type(map_type) :: mo_integrals_erf_map + + File: :file:`map_integrals_erf.irp.f` + + |MO| integrals + + + + +.. c:var:: mo_two_e_int_erf_jj + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_anti + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_anti_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_exchange + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_exchange_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_erf_in_map + + .. code:: text + + logical :: mo_two_e_integrals_erf_in_map + + File: :file:`mo_bi_integrals_erf.irp.f` + + If True, the map of MO two-electron integrals is provided + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_integrals_to_map_erf + + .. code:: text + + subroutine add_integrals_to_map_erf(mask_ijkl) + + File: :file:`mo_bi_integrals_erf.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: clear_mo_erf_map + + .. code:: text + + subroutine clear_mo_erf_map + + File: :file:`mo_bi_integrals_erf.irp.f` + + Frees the memory of the MO map + + + + + +.. c:function:: get_mo_erf_map_size + + .. code:: text + + integer*8 function get_mo_erf_map_size() + + File: :file:`map_integrals_erf.irp.f` + + Returns the number of elements in the |MO| map + + + + + +.. c:function:: get_mo_two_e_integral_erf + + .. code:: text + + double precision function get_mo_two_e_integral_erf(i,j,k,l,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns one integral :math:`\langle ij|kl \rangle` in the |MO| basis + + + + + +.. c:function:: get_mo_two_e_integrals_erf + + .. code:: text + + subroutine get_mo_two_e_integrals_erf(j,k,l,sze,out_val,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ij|kl \rangle` in the |MO| basis, all i for j,k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_coulomb_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_coulomb_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ki|li \rangle` + + k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_exch_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_exch_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ki|il \rangle` + + :math:`\int k(1)i(2) \frac{1}{r_{12}} i(1)l(2)` :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_i1j1 + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_i1j1(k,l,sze,out_array,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ik|jl \rangle` in the |MO| basis, all :math:`\int i(1)j(1) \frac{\erf(\mu * r_{12})}{r_{12}} k(2)l(2)` i, j for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_ij + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_ij(k,l,sze,out_array,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ij|kl \rangle` in the |MO| basis, all :math:`\int i(1)j(2) \frac{1}{r_{12}} k(1)l(2)` i, j for k,l fixed. + + + + + +.. c:function:: load_mo_integrals_erf + + .. code:: text + + integer function load_mo_integrals_erf(filename) + + File: :file:`map_integrals_erf.irp.f` + + Read from disk the |MO| erf integrals + + + + + +.. c:function:: mo_two_e_integral_erf + + .. code:: text + + double precision function mo_two_e_integral_erf(i,j,k,l) + + File: :file:`map_integrals_erf.irp.f` + + Returns one integral :math:`\langle ij|kl \rangle` in the |MO| basis + + + + + +.. c:function:: mo_two_e_integrals_erf_index + + .. code:: text + + subroutine mo_two_e_integrals_erf_index(i,j,k,l,i1) + + File: :file:`mo_bi_integrals_erf.irp.f` + + Computes an unique index for i,j,k,l integrals + + + + + +.. c:function:: provide_all_mo_integrals_erf + + .. code:: text + + subroutine provide_all_mo_integrals_erf + + File: :file:`mo_bi_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_erf_two_e_integrals_mo + + .. code:: text + + subroutine save_erf_two_e_integrals_mo + + File: :file:`routines_save_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_erf_two_e_ints_mo_into_ints_mo + + .. code:: text + + subroutine save_erf_two_e_ints_mo_into_ints_mo + + File: :file:`routines_save_integrals_erf.irp.f` + + + + diff --git a/docs/source/modules/mo_two_e_ints.rst b/docs/source/modules/mo_two_e_ints.rst new file mode 100644 index 00000000..2dfdf1b4 --- /dev/null +++ b/docs/source/modules/mo_two_e_ints.rst @@ -0,0 +1,590 @@ +.. _mo_two_e_ints: + +.. program:: mo_two_e_ints + +.. default-role:: option + +================== +mo_two_e_ints +================== + +Here, all two-electron integrals (:math:`1/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`Utils/map_module.f90`. + +To fetch an |AO| integral, use the +`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function, and +to fetch an |MO| integral, use +`get_two_e_integral(i,j,k,l,mo_integrals_map)` or +`mo_two_e_integral(i,j,k,l)`. + +The conventions are: + +* For |AO| integrals : (ik|jl) = (11|22) +* For |MO| integrals : = <12|12> + + + + + + +EZFIO parameters +---------------- + +.. option:: io_mo_two_e_integrals + + Read/Write |MO| integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_integrals_threshold + + If | | < `mo_integrals_threshold` then is zero + + Default: 1.e-15 + +.. option:: no_vvvv_integrals + + If `True`, computes all integrals except for the integrals having 4 virtual indices + + Default: False + +.. option:: no_ivvv_integrals + + Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual indices and 1 belonging to the core inactive active orbitals + + Default: False + +.. option:: no_vvv_integrals + + Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual orbitals + + Default: False + + +Providers +--------- + + +.. c:var:: big_array_coulomb_integrals + + .. code:: text + + double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num) + double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num) + + File: :file:`integrals_3_index.irp.f` + + big_array_coulomb_integrals(i,j) = = (ii|jj) + + big_array_exchange_integrals(i,j) = = (ij|ij) + + + + +.. c:var:: big_array_exchange_integrals + + .. code:: text + + double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num) + double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num) + + File: :file:`integrals_3_index.irp.f` + + big_array_coulomb_integrals(i,j) = = (ii|jj) + + big_array_exchange_integrals(i,j) = = (ij|ij) + + + + +.. c:var:: core_energy + + .. code:: text + + double precision :: core_energy + + File: :file:`core_quantities.irp.f` + + energy from the core : contains all core-core contributions + + + + +.. c:var:: core_fock_operator + + .. code:: text + + double precision, allocatable :: core_fock_operator (mo_num,mo_num) + + File: :file:`core_quantities.irp.f` + + this is the contribution to the Fock operator from the core electrons + + + + +.. c:var:: insert_into_mo_integrals_map + + .. code:: text + + subroutine insert_into_mo_integrals_map(n_integrals, & + buffer_i, buffer_values, thr) + + File: :file:`map_integrals.irp.f` + + Create new entry into MO map, or accumulate in an existing entry + + + + +.. c:var:: mo_integrals_cache + + .. code:: text + + double precision, allocatable :: mo_integrals_cache (0_8:128_8*128_8*128_8*128_8) + + File: :file:`map_integrals.irp.f` + + Cache of MO integrals for fast access + + + + +.. c:var:: mo_integrals_cache_max + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_cache_max_8 + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_cache_min + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_cache_min_8 + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_map + + .. code:: text + + type(map_type) :: mo_integrals_map + + File: :file:`map_integrals.irp.f` + + MO integrals + + + + +.. c:var:: mo_two_e_integral_jj_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_in_map + + .. code:: text + + logical :: mo_two_e_integrals_in_map + + File: :file:`mo_bi_integrals.irp.f` + + If True, the map of MO two-electron integrals is provided + + + + +.. c:var:: mo_two_e_integrals_jj + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_anti + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_anti_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_exchange + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_exchange_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_vv_anti_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals + + + + +.. c:var:: mo_two_e_integrals_vv_exchange_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals + + + + +.. c:var:: mo_two_e_integrals_vv_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_integrals_to_map + + .. code:: text + + subroutine add_integrals_to_map(mask_ijkl) + + File: :file:`mo_bi_integrals.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: add_integrals_to_map_no_exit_34 + + .. code:: text + + subroutine add_integrals_to_map_no_exit_34(mask_ijkl) + + File: :file:`mo_bi_integrals.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: add_integrals_to_map_three_indices + + .. code:: text + + subroutine add_integrals_to_map_three_indices(mask_ijk) + + File: :file:`mo_bi_integrals.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: clear_mo_map + + .. code:: text + + subroutine clear_mo_map + + File: :file:`mo_bi_integrals.irp.f` + + Frees the memory of the MO map + + + + + +.. c:function:: dump_mo_integrals + + .. code:: text + + subroutine dump_mo_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Save to disk the |MO| integrals + + + + + +.. c:function:: get_mo_map_size + + .. code:: text + + integer*8 function get_mo_map_size() + + File: :file:`map_integrals.irp.f` + + Return the number of elements in the MO map + + + + + +.. c:function:: get_mo_two_e_integrals + + .. code:: text + + subroutine get_mo_two_e_integrals(j,k,l,sze,out_val,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals in the MO basis, all i for j,k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_coulomb_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_coulomb_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_exch_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_exch_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals k(1)i(2) 1/r12 i(1)l(2) :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_i1j1 + + .. code:: text + + subroutine get_mo_two_e_integrals_i1j1(k,l,sze,out_array,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals in the MO basis, all i(1)j(1) 1/r12 k(2)l(2) i, j for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_ij + + .. code:: text + + subroutine get_mo_two_e_integrals_ij(k,l,sze,out_array,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals in the MO basis, all i(1)j(2) 1/r12 k(1)l(2) i, j for k,l fixed. + + + + + +.. c:function:: get_two_e_integral + + .. code:: text + + double precision function get_two_e_integral(i,j,k,l,map) + + File: :file:`map_integrals.irp.f` + + Returns one integral in the MO basis + + + + + +.. c:function:: load_mo_integrals + + .. code:: text + + integer function load_mo_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Read from disk the |MO| integrals + + + + + +.. c:function:: mo_two_e_integral + + .. code:: text + + double precision function mo_two_e_integral(i,j,k,l) + + File: :file:`map_integrals.irp.f` + + Returns one integral in the MO basis + + + + + +.. c:function:: mo_two_e_integrals_index + + .. code:: text + + subroutine mo_two_e_integrals_index(i,j,k,l,i1) + + File: :file:`mo_bi_integrals.irp.f` + + Computes an unique index for i,j,k,l integrals + + diff --git a/docs/source/modules/mpi.rst b/docs/source/modules/mpi.rst new file mode 100644 index 00000000..d8c7290f --- /dev/null +++ b/docs/source/modules/mpi.rst @@ -0,0 +1,130 @@ +.. _mpi: + +.. program:: mpi + +.. default-role:: option + +=== +mpi +=== + +Contains all the functions and providers for parallelization with |MPI|. + + + +Providers +--------- + + +.. c:var:: mpi_initialized + + .. code:: text + + logical :: mpi_initialized + + File: :file:`mpi.irp.f` + + Always true. Initialized MPI + + + + +.. c:var:: mpi_master + + .. code:: text + + logical :: mpi_master + + File: :file:`mpi.irp.f` + + If true, rank is zero + + + + +.. c:var:: mpi_rank + + .. code:: text + + integer :: mpi_rank + integer :: mpi_size + + File: :file:`mpi.irp.f` + + Rank of MPI process and number of MPI processes + + + + +.. c:var:: mpi_size + + .. code:: text + + integer :: mpi_rank + integer :: mpi_size + + File: :file:`mpi.irp.f` + + Rank of MPI process and number of MPI processes + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: broadcast_chunks_double + + .. code:: text + + subroutine broadcast_chunks_double(A, LDA) + + File: :file:`mpi.irp.f_template_97` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: broadcast_chunks_integer + + .. code:: text + + subroutine broadcast_chunks_integer(A, LDA) + + File: :file:`mpi.irp.f_template_97` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: broadcast_chunks_integer8 + + .. code:: text + + subroutine broadcast_chunks_integer8(A, LDA) + + File: :file:`mpi.irp.f_template_97` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: mpi_print + + .. code:: text + + subroutine mpi_print(string) + + File: :file:`mpi.irp.f` + + Print string to stdout if the MPI rank is zero. + + diff --git a/docs/source/modules/nuclei.rst b/docs/source/modules/nuclei.rst new file mode 100644 index 00000000..7f6a89ff --- /dev/null +++ b/docs/source/modules/nuclei.rst @@ -0,0 +1,351 @@ +.. _nuclei: + +.. program:: nuclei + +.. default-role:: option + +====== +nuclei +====== + +This module contains data relative to the nuclei (coordinates, charge, +nuclear repulsion energy, etc). +The coordinates are expressed in atomic units. + + + + +EZFIO parameters +---------------- + +.. option:: nucl_num + + Number of nuclei + + +.. option:: nucl_label + + Nuclear labels + + +.. option:: nucl_charge + + Nuclear charges + + +.. option:: nucl_coord + + Nuclear coordinates in the format (:, {x,y,z}) + + +.. option:: disk_access_nuclear_repulsion + + Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ] + + Default: None + +.. option:: nuclear_repulsion + + Nuclear repulsion (Computed automaticaly or Read in the |EZFIO|) + + + +Providers +--------- + + +.. c:var:: center_of_mass + + .. code:: text + + double precision, allocatable :: center_of_mass (3) + + File: :file:`nuclei.irp.f` + + Center of mass of the molecule + + + + +.. c:var:: element_mass + + .. code:: text + + character*(4), allocatable :: element_name (0:127) + double precision, allocatable :: element_mass (0:127) + + File: :file:`nuclei.irp.f` + + Array of the name of element, sorted by nuclear charge (integer) + + + + +.. c:var:: element_name + + .. code:: text + + character*(4), allocatable :: element_name (0:127) + double precision, allocatable :: element_mass (0:127) + + File: :file:`nuclei.irp.f` + + Array of the name of element, sorted by nuclear charge (integer) + + + + +.. c:var:: inertia_tensor + + .. code:: text + + double precision, allocatable :: inertia_tensor (3,3) + + File: :file:`inertia.irp.f` + + Inertia tensor + + + + +.. c:var:: inertia_tensor_eigenvalues + + .. code:: text + + double precision, allocatable :: inertia_tensor_eigenvectors (3,3) + double precision, allocatable :: inertia_tensor_eigenvalues (3) + + File: :file:`inertia.irp.f` + + Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. + + + + +.. c:var:: inertia_tensor_eigenvectors + + .. code:: text + + double precision, allocatable :: inertia_tensor_eigenvectors (3,3) + double precision, allocatable :: inertia_tensor_eigenvalues (3) + + File: :file:`inertia.irp.f` + + Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. + + + + +.. c:var:: nucl_coord + + .. code:: text + + double precision, allocatable :: nucl_coord (nucl_num,3) + + File: :file:`nuclei.irp.f` + + Nuclear coordinates in the format (:, {x,y,z}) + + + + +.. c:var:: nucl_coord_transp + + .. code:: text + + double precision, allocatable :: nucl_coord_transp (3,nucl_num) + + File: :file:`nuclei.irp.f` + + Transposed array of nucl_coord + + + + +.. c:var:: nucl_dist + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_2 + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_inv + + .. code:: text + + double precision, allocatable :: nucl_dist_inv (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + Inverse of the distance between nucleus I and nucleus J + + + + +.. c:var:: nucl_dist_vec_x + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_vec_y + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_vec_z + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nuclear_repulsion + + .. code:: text + + double precision :: nuclear_repulsion + + File: :file:`nuclei.irp.f` + + Nuclear repulsion energy + + + + +.. c:var:: slater_bragg_radii + + .. code:: text + + double precision, allocatable :: slater_bragg_radii (100) + + File: :file:`atomic_radii.irp.f` + + atomic radii in Angstrom defined in table I of JCP 41, 3199 (1964) Slater execpt for the Hydrogen atom where we took the value of Becke (1988, JCP) + + + + +.. c:var:: slater_bragg_radii_per_atom + + .. code:: text + + double precision, allocatable :: slater_bragg_radii_per_atom (nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_radii_per_atom_ua + + .. code:: text + + double precision, allocatable :: slater_bragg_radii_per_atom_ua (nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_radii_ua + + .. code:: text + + double precision, allocatable :: slater_bragg_radii_ua (100) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_type_inter_distance + + .. code:: text + + double precision, allocatable :: slater_bragg_type_inter_distance (nucl_num,nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_type_inter_distance_ua + + .. code:: text + + double precision, allocatable :: slater_bragg_type_inter_distance_ua (nucl_num,nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + diff --git a/docs/source/modules/perturbation.rst b/docs/source/modules/perturbation.rst new file mode 100644 index 00000000..5ea4aecc --- /dev/null +++ b/docs/source/modules/perturbation.rst @@ -0,0 +1,560 @@ +.. _perturbation: + +.. program:: perturbation + +.. default-role:: option + +============ +perturbation +============ + + +All subroutines in ``*.irp.f`` starting with `pt2_` in the current directory are +perturbation computed using the routine `i_H_psi`. Other cases are not allowed. +The arguments of the `pt2_` are always: + +.. code-block:: fortran + + subroutine pt2_...( & + psi_ref, & + psi_ref_coefs, & + E_refs, & + det_pert, & + c_pert, & + e_2_pert, & + H_pert_diag, & + Nint, & + Ndet, & + N_st ) + + + integer , intent(in) :: Nint,Ndet,N_st + integer(bit_kind), intent(in) :: psi_ref(Nint,2,Ndet) + double precision , intent(in) :: psi_ref_coefs(Ndet,N_st) + double precision , intent(in) :: E_refs(N_st) + integer(bit_kind), intent(in) :: det_pert(Nint,2) + double precision , intent(out) :: c_pert(N_st),e_2_pert(N_st),H_pert_diag + + +`psi_ref` + bitstring of the determinants present in the various `N_st` states + +`psi_ref_coefs` + coefficients of the determinants on the various `N_st` states + +`E_refs` + Energy of the various `N_st` states + +`det_pert` + Perturber determinant + +`c_pert` + Perturbative coefficients for the various states + +`e_2_pert` + Perturbative energetic contribution for the various states + +`H_pert_diag` + Diagonal |H| matrix element of the perturber + +`Nint` + Should be equal to `N_int` + +`Ndet` + Number of determinants `i` in |Psi| on which we apply + +`N_st` + Number of states + + + + + + +EZFIO parameters +---------------- + +.. option:: do_pt2 + + If `True`, compute the |PT2| contribution + + Default: True + +.. option:: pt2_max + + The selection process stops when the largest |PT2| (for all the state) is lower + + than `pt2_max` in absolute value + + Default: 0.0001 + +.. option:: pt2_relative_error + + Stop stochastic |PT2| when the relative error is smaller than `PT2_relative_error` + + Default: 0.005 + +.. option:: correlation_energy_ratio_max + + The selection process stops at a fixed correlation ratio (useful for getting same accuracy between molecules). + + Defined as :math:`{E_{CI}-E_{HF}}/{E_{CI}+E_{PT2} - E_{HF}}`. + + Default: 1.00 + +.. option:: h0_type + + Type of zeroth-order Hamiltonian [ EN | Barycentric | Variance | SOP ] + + Default: EN + + +Providers +--------- + + +.. c:var:: fill_h_apply_buffer_selection + + .. code:: text + + subroutine fill_H_apply_buffer_selection(n_selected,det_buffer,e_2_pert_buffer,coef_pert_buffer, & + N_st,Nint,iproc,select_max_out) + + File: :file:`selection.irp.f` + + Fill the H_apply buffer with determiants for the selection + + + + +.. c:var:: max_exc_pert + + .. code:: text + + integer :: max_exc_pert + + File: :file:`exc_max.irp.f` + + + + + + +.. c:var:: selection_criterion + + .. code:: text + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + File: :file:`selection.irp.f` + + Threshold to select determinants. Set by selection routines. + + + + +.. c:var:: selection_criterion_factor + + .. code:: text + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + File: :file:`selection.irp.f` + + Threshold to select determinants. Set by selection routines. + + + + +.. c:var:: selection_criterion_min + + .. code:: text + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + File: :file:`selection.irp.f` + + Threshold to select determinants. Set by selection routines. + + + + +.. c:var:: var_pt2_ratio + + .. code:: text + + double precision :: var_pt2_ratio + + File: :file:`var_pt2_ratio_provider.irp.f` + + The selection process stops when the energy ratio variational/(variational+PT2) is equal to var_pt2_ratio + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: perturb_buffer_by_mono_dummy + + .. code:: text + + subroutine perturb_buffer_by_mono_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_epstein_nesbet + + .. code:: text + + subroutine perturb_buffer_by_mono_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_epstein_nesbet_2x2 + + .. code:: text + + subroutine perturb_buffer_by_mono_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_h_core + + .. code:: text + + subroutine perturb_buffer_by_mono_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_moller_plesset + + .. code:: text + + subroutine perturb_buffer_by_mono_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_moller_plesset_general + + .. code:: text + + subroutine perturb_buffer_by_mono_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_qdpt + + .. code:: text + + subroutine perturb_buffer_by_mono_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_dummy + + .. code:: text + + subroutine perturb_buffer_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_epstein_nesbet + + .. code:: text + + subroutine perturb_buffer_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_epstein_nesbet_2x2 + + .. code:: text + + subroutine perturb_buffer_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_h_core + + .. code:: text + + subroutine perturb_buffer_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_moller_plesset + + .. code:: text + + subroutine perturb_buffer_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_moller_plesset_general + + .. code:: text + + subroutine perturb_buffer_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_qdpt + + .. code:: text + + subroutine perturb_buffer_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: pt2_dummy + + .. code:: text + + subroutine pt2_dummy (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Dummy perturbation to add all connected determinants. + + + + + +.. c:function:: pt2_epstein_nesbet + + .. code:: text + + subroutine pt2_epstein_nesbet (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{ E_n - \langle \alpha|H|\alpha \rangle }` . + + `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{ E_n - \langle \alpha|H|\alpha \rangle }` . + + + + + + + +.. c:function:: pt2_epstein_nesbet_2x2 + + .. code:: text + + subroutine pt2_epstein_nesbet_2x2 (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the Epstein-Nesbet 2x2 diagonalization coefficient and energetic contribution for the various N_st states. + + `e_2_pert(i)` = :math:`\frac{1}{2} ( \langle \alpha|H|\alpha \rangle - E_n) - \sqrt{ (\langle \alpha|H|\alpha \rangle - E_n)^2 + 4 \langle i|H|\alpha \rangle^2 }` . + + `c_pert(i)` = `e_2_pert(i)` :math:`\times \frac{1}{ \langle i|H|\alpha \rangle}` . + + + + + + + +.. c:function:: pt2_h_core + + .. code:: text + + subroutine pt2_h_core(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pert_single.irp.f` + + compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution + + for the various N_st states. + + c_pert(i) = /( E(i) - ) + + e_2_pert(i) = ^2/( E(i) - ) + + + + + + + +.. c:function:: pt2_moller_plesset + + .. code:: text + + subroutine pt2_moller_plesset (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` . + + `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` . + + + + + + + +.. c:function:: pt2_moller_plesset_general + + .. code:: text + + subroutine pt2_moller_plesset_general (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` . + + `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` . + + + + + + + +.. c:function:: pt2_qdpt + + .. code:: text + + subroutine pt2_qdpt (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the QDPT first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\langle i|H|i \rangle - \langle \alpha|H|\alpha \rangle}` . + + + + + + + +.. c:function:: remove_small_contributions + + .. code:: text + + subroutine remove_small_contributions + + File: :file:`selection.irp.f` + + Remove determinants with small contributions. N_states is assumed to be provided. + + + + + +.. c:function:: repeat_all_e_corr + + .. code:: text + + double precision function repeat_all_e_corr(key_in) + + File: :file:`pert_sc2.irp.f` + + + + diff --git a/docs/source/modules/pseudo.rst b/docs/source/modules/pseudo.rst new file mode 100644 index 00000000..b9ab7433 --- /dev/null +++ b/docs/source/modules/pseudo.rst @@ -0,0 +1,94 @@ +.. _pseudo: + +.. program:: pseudo + +.. default-role:: option + +====== +pseudo +====== + +This module defines the |EZFIO| parameters of the effective core potentials. + + + +EZFIO parameters +---------------- + +.. option:: nucl_charge_remove + + Nuclear charges removed per atom + + +.. option:: pseudo_klocmax + + Maximum value of k for the local component + + +.. option:: pseudo_n_k + + Number of gaussians in the local component + + +.. option:: pseudo_v_k + + Coefficients in the local component + + +.. option:: pseudo_dz_k + + Exponents in the local component + + +.. option:: pseudo_lmax + + Maximum angular momentum + + +.. option:: pseudo_kmax + + Maximum number of functions in the non-local component + + +.. option:: pseudo_n_kl + + Number of functions in the non-local component + + +.. option:: pseudo_v_kl + + Coefficients in the non-local component + + +.. option:: pseudo_dz_kl + + Exponents in the non-local component + + +.. option:: do_pseudo + + If `True`, pseudo-potentials are used. + + Default: False + +.. option:: pseudo_grid_size + + Nb of points of the grid for the QMC interfaces + + Default: 1000 + +.. option:: pseudo_grid_rmax + + R_max of the QMC grid + + Default: 10.0 + +.. option:: ao_pseudo_grid + + Grid for the QMC interface + + +.. option:: mo_pseudo_grid + + Grid for the QMC interface + diff --git a/docs/source/modules/psiref_cas.rst b/docs/source/modules/psiref_cas.rst new file mode 100644 index 00000000..fe4e38ae --- /dev/null +++ b/docs/source/modules/psiref_cas.rst @@ -0,0 +1,14 @@ +.. _psiref_cas: + +.. program:: psiref_cas + +.. default-role:: option + +========== +psiref_cas +========== + +Reference wave function is defined as a |CAS| wave function. +This module is required for |CAS-SD|, |MRPT| or |MRCC|. + + diff --git a/docs/source/modules/psiref_utils.rst b/docs/source/modules/psiref_utils.rst new file mode 100644 index 00000000..634ecb61 --- /dev/null +++ b/docs/source/modules/psiref_utils.rst @@ -0,0 +1,16 @@ +.. _psiref_utils: + +.. program:: psiref_utils + +.. default-role:: option + +============ +psiref_utils +============ + + +Utilities related to the use of a reference wave function. This module +needs to be loaded with any `psi_ref_*` module. + + + diff --git a/docs/source/modules/scf_utils.rst b/docs/source/modules/scf_utils.rst new file mode 100644 index 00000000..d9ec8f4f --- /dev/null +++ b/docs/source/modules/scf_utils.rst @@ -0,0 +1,390 @@ +.. _scf_utils: + +.. program:: scf_utils + +.. default-role:: option + +========= +scf_utils +========= + + + +The scf_utils module is an abstract module which contains the basics to perform *Restricted* SCF calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals) based on a single-determinant wave function. + +This module does not produce any executable *and must not do*, but instead it contains everything one needs to perform an orbital optimization based on an Fock matrix. +The ``scf_utils`` module is meant to be included in the :file:`NEED` of the various single determinant SCF procedures, such as ``hartree_fock`` or ``kohn_sham``, where a specific definition of the Fock matrix is given (see :file:`hartree_fock fock_matrix_hf.irp.f` for an example). + +All SCF programs perform the following actions: + + +#. Compute/Read all the one- and two-electron integrals, and store them in memory + +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations based on the definition of the Fock matrix + + +The main keywords/options are: + +* :option:`scf_utils thresh_scf` +* :option:`scf_utils level_shift` + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + +EZFIO parameters +---------------- + +.. option:: max_dim_diis + + Maximum size of the DIIS extrapolation procedure + + Default: 15 + +.. option:: threshold_diis + + Threshold on the convergence of the DIIS error vector during a Hartree-Fock calculation. If 0. is chosen, the square root of thresh_scf will be used. + + Default: 0. + +.. option:: thresh_scf + + Threshold on the convergence of the Hartree Fock energy. + + Default: 1.e-10 + +.. option:: n_it_scf_max + + Maximum number of SCF iterations + + Default: 500 + +.. option:: level_shift + + Energy shift on the virtual MOs to improve SCF convergence + + Default: 0. + +.. option:: scf_algorithm + + Type of SCF algorithm used. Possible choices are [ Simple | DIIS] + + Default: DIIS + +.. option:: mo_guess_type + + Initial MO guess. Can be [ Huckel | HCore ] + + Default: Huckel + +.. option:: energy + + Calculated HF energy + + +.. option:: no_oa_or_av_opt + + If true, leave the active orbitals untouched in the SCF procedure + + Default: False + + +Providers +--------- + + +.. c:var:: eigenvalues_fock_matrix_ao + + .. code:: text + + double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) + double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) + + File: :file:`diis.irp.f` + + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + + + +.. c:var:: eigenvectors_fock_matrix_ao + + .. code:: text + + double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) + double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) + + File: :file:`diis.irp.f` + + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + + + +.. c:var:: eigenvectors_fock_matrix_mo + + .. code:: text + + double precision, allocatable :: eigenvectors_fock_matrix_mo (ao_num,mo_num) + + File: :file:`diagonalize_fock.irp.f` + + Eigenvector of the Fock matrix in the MO basis obtained with level shift. + + + + +.. c:var:: extrapolate_fock_matrix + + .. code:: text + + subroutine extrapolate_Fock_matrix( & + error_matrix_DIIS,Fock_matrix_DIIS, & + Fock_matrix_AO_,size_Fock_matrix_AO, & + iteration_SCF,dim_DIIS & + ) + + File: :file:`roothaan_hall_scf.irp.f` + + Compute the extrapolated Fock matrix using the DIIS procedure + + + + +.. c:var:: fock_matrix_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_ao (ao_num,ao_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix in AO basis set + + + + +.. c:var:: fock_matrix_diag_mo + + .. code:: text + + double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) + double precision, allocatable :: fock_matrix_diag_mo (mo_num) + + File: :file:`fock_matrix.irp.f` + + 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 + + + + + + +.. c:var:: fock_matrix_mo + + .. code:: text + + double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) + double precision, allocatable :: fock_matrix_diag_mo (mo_num) + + File: :file:`fock_matrix.irp.f` + + 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 + + + + + + +.. c:var:: fock_matrix_mo_alpha + + .. code:: text + + double precision, allocatable :: fock_matrix_mo_alpha (mo_num,mo_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix on the MO basis + + + + +.. c:var:: fock_matrix_mo_beta + + .. code:: text + + double precision, allocatable :: fock_matrix_mo_beta (mo_num,mo_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix on the MO basis + + + + +.. c:var:: fps_spf_matrix_ao + + .. code:: text + + double precision, allocatable :: fps_spf_matrix_ao (AO_num,AO_num) + + File: :file:`diis.irp.f` + + Commutator FPS - SPF + + + + +.. c:var:: fps_spf_matrix_mo + + .. code:: text + + double precision, allocatable :: fps_spf_matrix_mo (mo_num,mo_num) + + File: :file:`diis.irp.f` + + Commutator FPS - SPF in MO basis + + + + +.. c:var:: scf_density_matrix_ao + + .. code:: text + + double precision, allocatable :: scf_density_matrix_ao (ao_num,ao_num) + + File: :file:`scf_density_matrix_ao.irp.f` + + S^{-1}.P.S^{-1} where P = C.C^t + + + + +.. c:var:: scf_density_matrix_ao_alpha + + .. code:: text + + double precision, allocatable :: scf_density_matrix_ao_alpha (ao_num,ao_num) + + File: :file:`scf_density_matrix_ao.irp.f` + + S^{-1}.P_alpha.S^{-1} + + + + +.. c:var:: scf_density_matrix_ao_beta + + .. code:: text + + double precision, allocatable :: scf_density_matrix_ao_beta (ao_num,ao_num) + + File: :file:`scf_density_matrix_ao.irp.f` + + S^{-1}.P_beta.S^{-1} + + + + +.. c:var:: scf_energy + + .. code:: text + + double precision :: scf_energy + + File: :file:`fock_matrix.irp.f` + + Hartree-Fock energy + + + + +.. c:var:: threshold_diis_nonzero + + .. code:: text + + double precision :: threshold_diis_nonzero + + File: :file:`diis.irp.f` + + If threshold_DIIS is zero, choose sqrt(thresh_scf) + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: damping_scf + + .. code:: text + + subroutine damping_SCF + + File: :file:`damping_scf.irp.f` + + + + + + + +.. c:function:: huckel_guess + + .. code:: text + + subroutine huckel_guess + + File: :file:`huckel.irp.f` + + Build the MOs using the extended Huckel model + + + + + +.. c:function:: roothaan_hall_scf + + .. code:: text + + subroutine Roothaan_Hall_SCF + + File: :file:`roothaan_hall_scf.irp.f` + + Roothaan-Hall algorithm for SCF Hartree-Fock calculation + + diff --git a/docs/source/modules/selectors_cassd.rst b/docs/source/modules/selectors_cassd.rst new file mode 100644 index 00000000..d6c2b8ff --- /dev/null +++ b/docs/source/modules/selectors_cassd.rst @@ -0,0 +1,13 @@ +.. _selectors_cassd: + +.. program:: selectors_cassd + +.. default-role:: option + +=============== +selectors_cassd +=============== + +Selectors for |CAS-SD| calculations. The selectors are defined as first the +generators from :ref:`Generators_CAS`, and then the rest of the wave function. + diff --git a/docs/source/modules/selectors_full.rst b/docs/source/modules/selectors_full.rst new file mode 100644 index 00000000..9edb70b9 --- /dev/null +++ b/docs/source/modules/selectors_full.rst @@ -0,0 +1,72 @@ +.. _selectors_full: + +.. program:: selectors_full + +.. default-role:: option + +============== +selectors_full +============== + +All the determinants are possible selectors. Only the largest contributions are kept, where +a threshold is applied to the squared norm of the wave function, with the :option:`determinants +threshold_selectors` flag. + + + +Providers +--------- + + +.. c:var:: n_det_selectors + + .. code:: text + + integer :: n_det_selectors + + File: :file:`selectors.irp.f` + + For Single reference wave functions, the number of selectors is 1 : the Hartree-Fock determinant + + + + +.. c:var:: psi_selectors + + .. code:: text + + integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) + double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) + + File: :file:`selectors.irp.f` + + Determinants on which we apply for perturbation. + + + + +.. c:var:: psi_selectors_coef + + .. code:: text + + integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) + double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) + + File: :file:`selectors.irp.f` + + Determinants on which we apply for perturbation. + + + + +.. c:var:: threshold_selectors + + .. code:: text + + double precision :: threshold_selectors + + File: :file:`selectors.irp.f` + + Thresholds on selectors (fraction of the square of the norm) + + diff --git a/docs/source/modules/selectors_utils.rst b/docs/source/modules/selectors_utils.rst new file mode 100644 index 00000000..959d2930 --- /dev/null +++ b/docs/source/modules/selectors_utils.rst @@ -0,0 +1,381 @@ +.. _selectors_utils: + +.. program:: selectors_utils + +.. default-role:: option + +=============== +selectors_utils +=============== + +Helper functions for selectors. + + + + +Providers +--------- + + +.. c:var:: coef_hf_selector + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: delta_e_per_selector + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: double_index_selectors + + .. code:: text + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + File: :file:`e_corr_selectors.irp.f` + + Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. + + double_index_selectors = list of the index of the double excitations + + n_double_selectors = number of double excitations in the selectors determinants + + + + +.. c:var:: e_corr_double_only + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: e_corr_per_selectors + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: e_corr_second_order + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: exc_degree_per_selectors + + .. code:: text + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + File: :file:`e_corr_selectors.irp.f` + + Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. + + double_index_selectors = list of the index of the double excitations + + n_double_selectors = number of double excitations in the selectors determinants + + + + +.. c:var:: i_h_hf_per_selectors + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: inv_selectors_coef_hf + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: inv_selectors_coef_hf_squared + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: n_double_selectors + + .. code:: text + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + File: :file:`e_corr_selectors.irp.f` + + Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. + + double_index_selectors = list of the index of the double excitations + + n_double_selectors = number of double excitations in the selectors determinants + + + + +.. c:var:: psi_selectors_coef_transp + + .. code:: text + + double precision, allocatable :: psi_selectors_coef_transp (N_states,psi_selectors_size) + + File: :file:`selectors.irp.f` + + Transposed psi_selectors + + + + +.. c:var:: psi_selectors_diag_h_mat + + .. code:: text + + double precision, allocatable :: psi_selectors_diag_h_mat (psi_selectors_size) + + File: :file:`selectors.irp.f` + + Diagonal elements of the H matrix for each selectors + + + + +.. c:var:: psi_selectors_size + + .. code:: text + + integer :: psi_selectors_size + + File: :file:`selectors.irp.f` + + + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: zmq_get_n_det_generators + + .. code:: text + + integer function zmq_get_N_det_generators(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_102` + + Get N_det_generators from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_det_selectors + + .. code:: text + + integer function zmq_get_N_det_selectors(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_102` + + Get N_det_selectors from the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_generators + + .. code:: text + + integer function zmq_put_N_det_generators(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_102` + + Put N_det_generators on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_selectors + + .. code:: text + + integer function zmq_put_N_det_selectors(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_102` + + Put N_det_selectors on the qp_run scheduler + + diff --git a/docs/source/modules/single_ref_method.rst b/docs/source/modules/single_ref_method.rst new file mode 100644 index 00000000..ae80a401 --- /dev/null +++ b/docs/source/modules/single_ref_method.rst @@ -0,0 +1,14 @@ +.. _single_ref_method: + +.. program:: single_ref_method + +.. default-role:: option + +================= +single_ref_method +================= + +Include this module for single reference methods. +Using this module, the only generator determinant is the Hartree-Fock determinant. + + diff --git a/docs/source/modules/slave.rst b/docs/source/modules/slave.rst new file mode 100644 index 00000000..74b75541 --- /dev/null +++ b/docs/source/modules/slave.rst @@ -0,0 +1,73 @@ +.. _slave: + +.. program:: slave + +.. default-role:: option + +===== +slave +===== + +Slave processes for distributed parallelism. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: provide_everything + + .. code:: text + + subroutine provide_everything + + File: :file:`slave_cipsi.irp.f` + + + + + + + +.. c:function:: qp_ao_ints + + .. code:: text + + subroutine qp_ao_ints + + File: :file:`slave_eri.irp.f` + + Slave for electron repulsion integrals + + + + + +.. c:function:: run_wf + + .. code:: text + + subroutine run_wf + + File: :file:`slave_cipsi.irp.f` + + + + + + + +.. c:function:: slave + + .. code:: text + + subroutine slave + + File: :file:`slave_cipsi.irp.f` + + Helper program for distributed parallelism + + diff --git a/docs/source/modules/tools.rst b/docs/source/modules/tools.rst new file mode 100644 index 00000000..fd37d0c2 --- /dev/null +++ b/docs/source/modules/tools.rst @@ -0,0 +1,222 @@ +.. _tools: + +.. program:: tools + +.. default-role:: option + +===== +tools +===== + +Useful tools are grouped in this module. + + + +Subroutines / functions +----------------------- + + + +.. c:function:: diagonalize_h + + .. code:: text + + subroutine diagonalize_h + + File: :file:`diagonalize_h.irp.f` + + program that extracts the N_states lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder + + + + + +.. c:function:: fcidump + + .. code:: text + + subroutine fcidump + + File: :file:`fcidump.irp.f` + + Produce a FCIDUMP file + + + + + +.. c:function:: four_idx_transform + + .. code:: text + + subroutine four_idx_transform + + File: :file:`four_idx_transform.irp.f` + + 4-index transformation of two-electron integrals from AO to MO integrals + + + + + +.. c:function:: molden + + .. code:: text + + subroutine molden + + File: :file:`molden.irp.f` + + Produce a Molden file + + + + + +.. c:function:: print_wf + + .. code:: text + + subroutine print_wf + + File: :file:`print_wf.irp.f` + + print the wave function stored in the EZFIO folder in the intermediate normalization + + it also prints a lot of information regarding the excitation operators from the reference determinant + + and a first-order perturbative analysis of the wave function. + + If the wave function strongly deviates from the first-order analysis, something funny is going on :) + + + + + +.. c:function:: routine + + .. code:: text + + subroutine routine + + File: :file:`write_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_natorb + + .. code:: text + + subroutine save_natorb + + File: :file:`save_natorb.irp.f` + + Save natural MOs into the EZFIO + + + + + +.. c:function:: save_one_body_dm + + .. code:: text + + subroutine save_one_body_dm + + File: :file:`save_one_body_dm.irp.f` + + programs that computes the one body density on the mo basis for alpha and beta electrons from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities. + + Then, the global variable data_one_body_alpha_dm_mo and data_one_body_beta_dm_mo will automatically read the density in a further calculation. + + This can be used to perform dampin on the density in RS-DFT calculation (see the density_for_dft module). + + + + + +.. c:function:: save_ortho_mos + + .. code:: text + + subroutine save_ortho_mos + + File: :file:`save_ortho_mos.irp.f` + + Save orthonormalized MOs in the EZFIO. + + + + + +.. c:function:: write_ao_basis + + .. code:: text + + subroutine write_Ao_basis(i_unit_output) + + File: :file:`molden.irp.f` + + + + + + + +.. c:function:: write_geometry + + .. code:: text + + subroutine write_geometry(i_unit_output) + + File: :file:`molden.irp.f` + + + + + + + +.. c:function:: write_integrals + + .. code:: text + + subroutine write_integrals + + File: :file:`write_integrals_erf.irp.f` + + Saves the two-electron erf integrals into the EZFIO + + + + + +.. c:function:: write_intro_gamess + + .. code:: text + + subroutine write_intro_gamess(i_unit_output) + + File: :file:`molden.irp.f` + + + + + + + +.. c:function:: write_mo_basis + + .. code:: text + + subroutine write_Mo_basis(i_unit_output) + + File: :file:`molden.irp.f` + + + + diff --git a/docs/source/modules/utils.rst b/docs/source/modules/utils.rst new file mode 100644 index 00000000..6437de1f --- /dev/null +++ b/docs/source/modules/utils.rst @@ -0,0 +1,1960 @@ +.. _utils: + +.. program:: utils + +.. default-role:: option + +===== +utils +===== + +Contains general purpose utilities (sorting, maps, etc). + + + + +Providers +--------- + + +.. c:var:: binom + + .. code:: text + + double precision, allocatable :: binom (0:40,0:40) + double precision, allocatable :: binom_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients + + + + +.. c:var:: binom_int + + .. code:: text + + integer*8, allocatable :: binom_int (0:40,0:40) + integer*8, allocatable :: binom_int_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients, as integers*8 + + + + +.. c:var:: binom_int_transp + + .. code:: text + + integer*8, allocatable :: binom_int (0:40,0:40) + integer*8, allocatable :: binom_int_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients, as integers*8 + + + + +.. c:var:: binom_transp + + .. code:: text + + double precision, allocatable :: binom (0:40,0:40) + double precision, allocatable :: binom_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients + + + + +.. c:var:: degree_max_integration_lebedev + + .. code:: text + + integer :: degree_max_integration_lebedev + + File: :file:`angular_integration.irp.f` + + integrate correctly a polynom of order "degree_max_integration_lebedev" needed for the angular integration according to LEBEDEV formulae + + + + +.. c:var:: dtranspose + + .. code:: text + + recursive subroutine dtranspose(A,LDA,B,LDB,d1,d2) + + File: :file:`transpose.irp.f` + + Transpose input matrix A into output matrix B + + + + +.. c:var:: fact_inv + + .. code:: text + + double precision, allocatable :: fact_inv (128) + + File: :file:`util.irp.f` + + 1/n! + + + + +.. c:var:: i2radix_sort + + .. code:: text + + recursive subroutine i2radix_sort(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: i8radix_sort + + .. code:: text + + recursive subroutine i8radix_sort(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: i8radix_sort_big + + .. code:: text + + recursive subroutine i8radix_sort_big(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: inv_int + + .. code:: text + + double precision, allocatable :: inv_int (128) + + File: :file:`util.irp.f` + + 1/i + + + + +.. c:var:: iradix_sort + + .. code:: text + + recursive subroutine iradix_sort(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: iradix_sort_big + + .. code:: text + + recursive subroutine iradix_sort_big(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: n_points_integration_angular_lebedev + + .. code:: text + + integer :: n_points_integration_angular_lebedev + + File: :file:`angular_integration.irp.f` + + Number of points needed for the angular integral + + + + +.. c:var:: nproc + + .. code:: text + + integer :: nproc + + File: :file:`util.irp.f` + + Number of current OpenMP threads + + + + +.. c:var:: overlap_gaussian_xyz + + .. code:: text + + subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,& + power_B,overlap_x,overlap_y,overlap_z,overlap,dim) + + File: :file:`one_e_integration.irp.f` + + .. math:: + + S_x = \int (x-A_x)^{a_x} exp(-\alpha(x-A_x)^2) (x-B_x)^{b_x} exp(-beta(x-B_x)^2) dx \\ S = S_x S_y S_z + + + + + + +.. c:var:: phi_angular_integration_lebedev + + .. code:: text + + double precision, allocatable :: theta_angular_integration_lebedev (n_points_integration_angular_lebedev) + double precision, allocatable :: phi_angular_integration_lebedev (n_points_integration_angular_lebedev) + double precision, allocatable :: weights_angular_integration_lebedev (n_points_integration_angular_lebedev) + + File: :file:`angular_integration.irp.f` + + Theta phi values together with the weights values for the angular integration : integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1 where i is the basis function and psi_j is the j th eigenvector + + + + + + + +.. c:function:: lapack_diagd + + .. code:: text + + subroutine lapack_diagd(eigvalues,eigvectors,H,nmax,n) + + File: :file:`linear_algebra.irp.f` + + Diagonalize matrix H + + H is untouched between input and ouptut + + eigevalues(i) = ith lowest eigenvalue of the H matrix + + eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector + + + + + + + +.. c:function:: logfact + + .. code:: text + + double precision function logfact(n) + + File: :file:`util.irp.f` + + n! + + + + + +.. c:function:: lowercase + + .. code:: text + + subroutine lowercase(txt,n) + + File: :file:`util.irp.f` + + Transform to lower case + + + + + +.. c:function:: map_load_from_disk + + .. code:: text + + subroutine map_load_from_disk(filename,map) + + File: :file:`map_functions.irp.f` + + + + + + + +.. c:function:: map_save_to_disk + + .. code:: text + + subroutine map_save_to_disk(filename,map) + + File: :file:`map_functions.irp.f` + + + + + + + +.. c:function:: memory_of_double + + .. code:: text + + double precision function memory_of_double(n) + + File: :file:`memory.irp.f` + + Computes the memory required for n double precision elements in gigabytes. + + + + + +.. c:function:: memory_of_int + + .. code:: text + + double precision function memory_of_int(n) + + File: :file:`memory.irp.f` + + Computes the memory required for n double precision elements in gigabytes. + + + + + +.. c:function:: multiply_poly + + .. code:: text + + subroutine multiply_poly(b,nb,c,nc,d,nd) + + File: :file:`integration.irp.f` + + Multiply two polynomials D(t) =! D(t) +( B(t)*C(t)) + + + + + +.. c:function:: normalize + + .. code:: text + + subroutine normalize(u,sze) + + File: :file:`util.irp.f` + + Normalizes vector u + + + + + +.. c:function:: ortho_canonical + + .. code:: text + + subroutine ortho_canonical(overlap,LDA,N,C,LDC,m) + + File: :file:`linear_algebra.irp.f` + + Compute C_new=C_old.U.s^-1/2 canonical orthogonalization. + + overlap : overlap matrix + + LDA : leftmost dimension of overlap array + + N : Overlap matrix is NxN (array is (LDA,N) ) + + C : Coefficients of the vectors to orthogonalize. On exit, orthogonal vectors + + LDC : leftmost dimension of C + + m : Coefficients matrix is MxN, ( array is (LDC,N) ) + + + + + + + +.. c:function:: ortho_lowdin + + .. code:: text + + subroutine ortho_lowdin(overlap,LDA,N,C,LDC,m) + + File: :file:`linear_algebra.irp.f` + + Compute C_new=C_old.S^-1/2 orthogonalization. + + overlap : overlap matrix + + LDA : leftmost dimension of overlap array + + N : Overlap matrix is NxN (array is (LDA,N) ) + + C : Coefficients of the vectors to orthogonalize. On exit, orthogonal vectors + + LDC : leftmost dimension of C + + M : Coefficients matrix is MxN, ( array is (LDC,N) ) + + + + + + + +.. c:function:: ortho_qr + + .. code:: text + + subroutine ortho_qr(A,LDA,m,n) + + File: :file:`linear_algebra.irp.f` + + Orthogonalization using Q.R factorization + + A : matrix to orthogonalize + + LDA : leftmost dimension of A + + n : Number of rows of A + + m : Number of columns of A + + + + + + + +.. c:function:: ortho_qr_unblocked + + .. code:: text + + subroutine ortho_qr_unblocked(A,LDA,m,n) + + File: :file:`linear_algebra.irp.f` + + Orthogonalization using Q.R factorization + + A : matrix to orthogonalize + + LDA : leftmost dimension of A + + n : Number of rows of A + + m : Number of columns of A + + + + + + + +.. c:function:: overlap_gaussian_x + + .. code:: text + + double precision function overlap_gaussian_x(A_center,B_center,alpha,beta,power_A,power_B,dim) + + File: :file:`one_e_integration.irp.f` + + .. math:: + + \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx + + + + + + + +.. c:function:: overlap_x_abs + + .. code:: text + + subroutine overlap_x_abs(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`one_e_integration.irp.f` + + .. math :: + + \int_{-infty}^{+infty} (x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) dx + + + + + + + +.. c:function:: print_memory_usage + + .. code:: text + + subroutine print_memory_usage() + + File: :file:`memory.irp.f` + + Prints the memory usage in the output + + + + + +.. c:function:: quick_dsort + + .. code:: text + + subroutine quick_dsort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_i2sort + + .. code:: text + + subroutine quick_i2sort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_i8sort + + .. code:: text + + subroutine quick_i8sort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_isort + + .. code:: text + + subroutine quick_isort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_sort + + .. code:: text + + subroutine quick_sort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: recentered_poly2 + + .. code:: text + + subroutine recentered_poly2(P_new,x_A,x_P,a,P_new2,x_B,x_Q,b) + + File: :file:`integration.irp.f` + + Recenter two polynomials + + + + + +.. c:function:: resident_memory + + .. code:: text + + subroutine resident_memory(value) + + File: :file:`memory.irp.f` + + Returns the current used memory in gigabytes used by the current process. + + + + + +.. c:function:: rint + + .. code:: text + + double precision function rint(n,rho) + + File: :file:`integration.irp.f` + + .. math:: + + \int_0^1 dx \exp(-p x^2) x^n + + + + + + + +.. c:function:: rint1 + + .. code:: text + + double precision function rint1(n,rho) + + File: :file:`integration.irp.f` + + Standard version of rint + + + + + +.. c:function:: rint_large_n + + .. code:: text + + double precision function rint_large_n(n,rho) + + File: :file:`integration.irp.f` + + Version of rint for large values of n + + + + + +.. c:function:: rint_sum + + .. code:: text + + double precision function rint_sum(n_pt_out,rho,d1) + + File: :file:`integration.irp.f` + + Needed for the calculation of two-electron integrals. + + + + + +.. c:function:: rinteg + + .. code:: text + + double precision function rinteg(n,u) + + File: :file:`need.irp.f` + + + + + + + +.. c:function:: rintgauss + + .. code:: text + + double precision function rintgauss(n) + + File: :file:`need.irp.f` + + + + + + + +.. c:function:: sabpartial + + .. code:: text + + double precision function SABpartial(zA,zB,A,B,nA,nB,gamA,gamB,l) + + File: :file:`need.irp.f` + + + + + + + +.. c:function:: set_order + + .. code:: text + + subroutine set_order(x,iorder,isize) + + File: :file:`sort.irp.f_template_347` + + array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. + + + + + +.. c:function:: set_order_big + + .. code:: text + + subroutine set_order_big(x,iorder,isize) + + File: :file:`sort.irp.f_template_412` + + array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format + + + + + +.. c:function:: sort + + .. code:: text + + subroutine sort(x,iorder,isize) + + File: :file:`sort.irp.f_template_293` + + Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: sorted_dnumber + + .. code:: text + + subroutine sorted_dnumber(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_i2number + + .. code:: text + + subroutine sorted_i2number(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_i8number + + .. code:: text + + subroutine sorted_i8number(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_inumber + + .. code:: text + + subroutine sorted_inumber(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_number + + .. code:: text + + subroutine sorted_number(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: svd + + .. code:: text + + subroutine svd(A,LDA,U,LDU,D,Vt,LDVt,m,n) + + File: :file:`linear_algebra.irp.f` + + Compute A = U.D.Vt + + LDx : leftmost dimension of x + + Dimsneion of A is m x n + + + + + + + +.. c:function:: total_memory + + .. code:: text + + subroutine total_memory(value) + + File: :file:`memory.irp.f` + + Returns the current used memory in gigabytes used by the current process. + + + + + +.. c:function:: u_dot_u + + .. code:: text + + double precision function u_dot_u(u,sze) + + File: :file:`util.irp.f` + + Compute + + + + + +.. c:function:: u_dot_v + + .. code:: text + + double precision function u_dot_v(u,v,sze) + + File: :file:`util.irp.f` + + Compute + + + + + +.. c:function:: wall_time + + .. code:: text + + subroutine wall_time(t) + + File: :file:`util.irp.f` + + The equivalent of cpu_time, but for the wall time. + + + + + +.. c:function:: write_git_log + + .. code:: text + + subroutine write_git_log(iunit) + + File: :file:`util.irp.f` + + Write the last git commit in file iunit. + + diff --git a/docs/source/modules/zmq.rst b/docs/source/modules/zmq.rst new file mode 100644 index 00000000..e5af0f0c --- /dev/null +++ b/docs/source/modules/zmq.rst @@ -0,0 +1,885 @@ +.. _zmq: + +.. program:: zmq + +.. default-role:: option + +=== +zmq +=== + +Definition of |ZeroMQ| sockets and messages. + + + + + +Providers +--------- + + +.. c:var:: qp_run_address + + .. code:: text + + character*(128) :: qp_run_address + integer :: zmq_port_start + + File: :file:`utils.irp.f` + + Address of the qp_run socket Example : tcp://130.120.229.139:12345 + + + + +.. c:var:: zmq_context + + .. code:: text + + integer(ZMQ_PTR) :: zmq_context + integer(omp_lock_kind) :: zmq_lock + + File: :file:`utils.irp.f` + + Context for the ZeroMQ library + + + + +.. c:var:: zmq_lock + + .. code:: text + + integer(ZMQ_PTR) :: zmq_context + integer(omp_lock_kind) :: zmq_lock + + File: :file:`utils.irp.f` + + Context for the ZeroMQ library + + + + +.. c:var:: zmq_port_start + + .. code:: text + + character*(128) :: qp_run_address + integer :: zmq_port_start + + File: :file:`utils.irp.f` + + Address of the qp_run socket Example : tcp://130.120.229.139:12345 + + + + +.. c:var:: zmq_socket_pair_inproc_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_pull_inproc_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_pull_tcp_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_push_inproc_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_push_tcp_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_sub_tcp_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_state + + .. code:: text + + character*(128) :: zmq_state + + File: :file:`utils.irp.f` + + Threads executing work through the ZeroMQ interface + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_task_to_taskserver + + .. code:: text + + integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: connect_to_taskserver + + .. code:: text + + integer function connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) + + File: :file:`utils.irp.f` + + Connect to the task server and obtain the worker ID + + + + + +.. c:function:: disconnect_from_taskserver + + .. code:: text + + integer function disconnect_from_taskserver(zmq_to_qp_run_socket, worker_id) + + File: :file:`utils.irp.f` + + Disconnect from the task server + + + + + +.. c:function:: disconnect_from_taskserver_state + + .. code:: text + + integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, state) + + File: :file:`utils.irp.f` + + Disconnect from the task server + + + + + +.. c:function:: end_parallel_job + + .. code:: text + + subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) + + File: :file:`utils.irp.f` + + End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + + + + +.. c:function:: end_zmq_pair_socket + + .. code:: text + + subroutine end_zmq_pair_socket(zmq_socket_pair) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_pull_socket + + .. code:: text + + subroutine end_zmq_pull_socket(zmq_socket_pull) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_push_socket + + .. code:: text + + subroutine end_zmq_push_socket(zmq_socket_push,thread) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_sub_socket + + .. code:: text + + subroutine end_zmq_sub_socket(zmq_socket_sub) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_to_qp_run_socket + + .. code:: text + + subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) + + File: :file:`utils.irp.f` + + Terminate the socket from the application to qp_run + + + + + +.. c:function:: get_task_from_taskserver + + .. code:: text + + integer function get_task_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: get_tasks_from_taskserver + + .. code:: text + + integer function get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task,n_tasks) + + File: :file:`utils.irp.f` + + Get multiple tasks from the task server + + + + + +.. c:function:: new_parallel_job + + .. code:: text + + subroutine new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) + + File: :file:`utils.irp.f` + + Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + + + + +.. c:function:: new_zmq_pair_socket + + .. code:: text + + function new_zmq_pair_socket(bind) + + File: :file:`utils.irp.f` + + Socket on which the collector and the main communicate + + + + + +.. c:function:: new_zmq_pull_socket + + .. code:: text + + function new_zmq_pull_socket() + + File: :file:`utils.irp.f` + + Socket on which the results are sent. If thread is 1, use inproc + + + + + +.. c:function:: new_zmq_push_socket + + .. code:: text + + function new_zmq_push_socket(thread) + + File: :file:`utils.irp.f` + + Socket on which the results are sent. If thread is 1, use inproc + + + + + +.. c:function:: new_zmq_sub_socket + + .. code:: text + + function new_zmq_sub_socket() + + File: :file:`utils.irp.f` + + Socket to read the state published by the Task server + + + + + +.. c:function:: new_zmq_to_qp_run_socket + + .. code:: text + + function new_zmq_to_qp_run_socket() + + File: :file:`utils.irp.f` + + Socket on which the qp_run process replies + + + + + +.. c:function:: reset_zmq_addresses + + .. code:: text + + subroutine reset_zmq_addresses + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + + +.. c:function:: switch_qp_run_to_master + + .. code:: text + + subroutine switch_qp_run_to_master + + File: :file:`utils.irp.f` + + Address of the master qp_run socket Example : tcp://130.120.229.139:12345 + + + + + +.. c:function:: task_done_to_taskserver + + .. code:: text + + integer function task_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: tasks_done_to_taskserver + + .. code:: text + + integer function tasks_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id, n_tasks) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: wait_for_next_state + + .. code:: text + + subroutine wait_for_next_state(state) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: wait_for_state + + .. code:: text + + subroutine wait_for_state(state_wait,state) + + File: :file:`utils.irp.f` + + Wait for the ZMQ state to be ready + + + + + +.. c:function:: wait_for_states + + .. code:: text + + subroutine wait_for_states(state_wait,state,n) + + File: :file:`utils.irp.f` + + Wait for the ZMQ state to be ready + + + + + +.. c:function:: zmq_abort + + .. code:: text + + integer function zmq_abort(zmq_to_qp_run_socket) + + File: :file:`utils.irp.f` + + Aborts a running parallel computation + + + + + +.. c:function:: zmq_delete_task + + .. code:: text + + integer function zmq_delete_task(zmq_to_qp_run_socket,zmq_socket_pull,task_id,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_delete_tasks + + .. code:: text + + integer function zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_delete_tasks_async_recv + + .. code:: text + + integer function zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_delete_tasks_async_send + + .. code:: text + + integer function zmq_delete_tasks_async_send(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_get8_dvector + + .. code:: text + + integer function zmq_get8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get8_ivector + + .. code:: text + + integer function zmq_get8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_get_dmatrix + + .. code:: text + + integer function zmq_get_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_dvector + + .. code:: text + + integer function zmq_get_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_i8matrix + + .. code:: text + + integer function zmq_get_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_imatrix + + .. code:: text + + integer function zmq_get_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_int + + .. code:: text + + integer function zmq_get_int(zmq_to_qp_run_socket, worker_id, name, x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_get_int_nompi + + .. code:: text + + integer function zmq_get_int_nompi(zmq_to_qp_run_socket, worker_id, name, x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_get_ivector + + .. code:: text + + integer function zmq_get_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_port + + .. code:: text + + function zmq_port(ishift) + + File: :file:`utils.irp.f` + + Return the value of the ZMQ port from the corresponding integer + + + + + +.. c:function:: zmq_put8_dvector + + .. code:: text + + integer function zmq_put8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put8_ivector + + .. code:: text + + integer function zmq_put8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a vector of integers on the qp_run scheduler + + + + + +.. c:function:: zmq_put_dmatrix + + .. code:: text + + integer function zmq_put_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_dvector + + .. code:: text + + integer function zmq_put_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_i8matrix + + .. code:: text + + integer function zmq_put_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_imatrix + + .. code:: text + + integer function zmq_put_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_int + + .. code:: text + + integer function zmq_put_int(zmq_to_qp_run_socket, worker_id, name, x) + + File: :file:`put_get.irp.f` + + Put a vector of integers on the qp_run scheduler + + + + + +.. c:function:: zmq_put_ivector + + .. code:: text + + integer function zmq_put_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a vector of integers on the qp_run scheduler + + + + + +.. c:function:: zmq_set_running + + .. code:: text + + integer function zmq_set_running(zmq_to_qp_run_socket) + + File: :file:`utils.irp.f` + + Set the job to Running in QP-run + + diff --git a/docs/source/programmers_guide/index_providers.rst b/docs/source/programmers_guide/index_providers.rst index 6f3dc12e..b712f62d 100644 --- a/docs/source/programmers_guide/index_providers.rst +++ b/docs/source/programmers_guide/index_providers.rst @@ -5,12 +5,6 @@ Index of Providers * :c:data:`abs_psi_coef_min` * :c:data:`alpha_knowles` * :c:data:`angular_quadrature_points` -* :c:data:`ao_bi_elec_integral_alpha` -* :c:data:`ao_bi_elec_integral_beta` -* :c:data:`ao_bielec_integral_erf_schwartz` -* :c:data:`ao_bielec_integral_schwartz` -* :c:data:`ao_bielec_integrals_erf_in_map` -* :c:data:`ao_bielec_integrals_in_map` * :c:data:`ao_cart_to_sphe_coef` * :c:data:`ao_cart_to_sphe_inv` * :c:data:`ao_cart_to_sphe_num` @@ -44,26 +38,26 @@ Index of Providers * :c:data:`ao_integrals_erf_cache_min` * :c:data:`ao_integrals_erf_map` * :c:data:`ao_integrals_map` +* :c:data:`ao_integrals_n_e` +* :c:data:`ao_integrals_n_e_per_atom` * :c:data:`ao_integrals_threshold` -* :c:data:`ao_kinetic_integral` +* :c:data:`ao_kinetic_integrals` * :c:data:`ao_l` * :c:data:`ao_l_char` * :c:data:`ao_l_char_space` * :c:data:`ao_l_max` * :c:data:`ao_md5` -* :c:data:`ao_mono_elec_integral` -* :c:data:`ao_mono_elec_integral_diag` * :c:data:`ao_nucl` -* :c:data:`ao_nucl_elec_integral` -* :c:data:`ao_nucl_elec_integral_per_atom` * :c:data:`ao_num` +* :c:data:`ao_one_e_integrals` +* :c:data:`ao_one_e_integrals_diag` * :c:data:`ao_ortho_canonical_coef` * :c:data:`ao_ortho_canonical_coef_inv` -* :c:data:`ao_ortho_canonical_nucl_elec_integral` +* :c:data:`ao_ortho_canonical_nucl_elec_integrals` * :c:data:`ao_ortho_canonical_num` * :c:data:`ao_ortho_canonical_overlap` * :c:data:`ao_ortho_lowdin_coef` -* :c:data:`ao_ortho_lowdin_nucl_elec_integral` +* :c:data:`ao_ortho_lowdin_nucl_elec_integrals` * :c:data:`ao_ortho_lowdin_overlap` * :c:data:`ao_overlap` * :c:data:`ao_overlap_abs` @@ -76,12 +70,18 @@ Index of Providers * :c:data:`ao_power_ordered_transp_per_nucl` * :c:data:`ao_prim_num` * :c:data:`ao_prim_num_max` -* :c:data:`ao_pseudo_integral` -* :c:data:`ao_pseudo_integral_local` -* :c:data:`ao_pseudo_integral_non_local` +* :c:data:`ao_pseudo_integrals` +* :c:data:`ao_pseudo_integrals_local` +* :c:data:`ao_pseudo_integrals_non_local` * :c:data:`ao_spread_x` * :c:data:`ao_spread_y` * :c:data:`ao_spread_z` +* :c:data:`ao_two_e_integral_alpha` +* :c:data:`ao_two_e_integral_beta` +* :c:data:`ao_two_e_integral_erf_schwartz` +* :c:data:`ao_two_e_integral_schwartz` +* :c:data:`ao_two_e_integrals_erf_in_map` +* :c:data:`ao_two_e_integrals_in_map` * :c:data:`aos_dsr_vc_alpha_pbe_w` * :c:data:`aos_dsr_vc_beta_pbe_w` * :c:data:`aos_dsr_vx_alpha_pbe_w` @@ -113,7 +113,6 @@ Index of Providers * :c:data:`aos_vx_beta_lda_w` * :c:data:`aos_vx_beta_pbe_w` * :c:data:`barycentric_electronic_energy` -* :c:data:`bi_elec_ref_bitmask_energy` * :c:data:`big_array_coulomb_integrals` * :c:data:`big_array_exchange_integrals` * :c:data:`binom` @@ -165,12 +164,6 @@ Index of Providers * :c:data:`dft_type` * :c:data:`diag_algorithm` * :c:data:`diagonal_h_matrix_on_psi_det` -* :c:data:`disk_access_ao_integrals` -* :c:data:`disk_access_ao_integrals_erf` -* :c:data:`disk_access_ao_one_integrals` -* :c:data:`disk_access_mo_integrals` -* :c:data:`disk_access_mo_integrals_erf` -* :c:data:`disk_access_mo_one_integrals` * :c:data:`disk_access_nuclear_repulsion` * :c:data:`disk_based_davidson` * :c:data:`distributed_davidson` @@ -248,8 +241,8 @@ Index of Providers * :c:data:`generators_bitmask_restart` * :c:data:`gga_sr_type_functionals` * :c:data:`gga_type_functionals` -* :c:data:`give_polynom_mult_center_mono_elec_erf` -* :c:data:`give_polynom_mult_center_mono_elec_erf_opt` +* :c:data:`give_polynomial_mult_center_one_e_erf` +* :c:data:`give_polynomial_mult_center_one_e_erf_opt` * :c:data:`grad_aos_dsr_vc_alpha_pbe_w` * :c:data:`grad_aos_dsr_vc_beta_pbe_w` * :c:data:`grad_aos_dsr_vx_alpha_pbe_w` @@ -279,11 +272,11 @@ Index of Providers * :c:data:`i_x1_new` * :c:data:`i_x1_pol_mult_a1` * :c:data:`i_x1_pol_mult_a2` -* :c:data:`i_x1_pol_mult_mono_elec` +* :c:data:`i_x1_pol_mult_one_e` * :c:data:`i_x1_pol_mult_recurs` * :c:data:`i_x2_new` * :c:data:`i_x2_pol_mult` -* :c:data:`i_x2_pol_mult_mono_elec` +* :c:data:`i_x2_pol_mult_one_e` * :c:data:`idx_cas` * :c:data:`idx_non_cas` * :c:data:`inact_bitmask` @@ -303,9 +296,21 @@ Index of Providers * :c:data:`inv_int` * :c:data:`inv_selectors_coef_hf` * :c:data:`inv_selectors_coef_hf_squared` +* :c:data:`io_ao_integrals_e_n` +* :c:data:`io_ao_integrals_kinetic` +* :c:data:`io_ao_integrals_overlap` +* :c:data:`io_ao_integrals_pseudo` +* :c:data:`io_ao_one_e_integrals` +* :c:data:`io_ao_two_e_integrals` +* :c:data:`io_ao_two_e_integrals_erf` +* :c:data:`io_mo_integrals_e_n` +* :c:data:`io_mo_integrals_kinetic` +* :c:data:`io_mo_integrals_pseudo` +* :c:data:`io_mo_one_e_integrals` +* :c:data:`io_mo_two_e_integrals` +* :c:data:`io_mo_two_e_integrals_erf` * :c:data:`iradix_sort` * :c:data:`iradix_sort_big` -* :c:data:`kinetic_ref_bitmask_energy` * :c:data:`ks_energy` * :c:data:`l_to_charater` * :c:data:`level_shift` @@ -325,17 +330,6 @@ Index of Providers * :c:data:`max_degree_exc` * :c:data:`max_dim_diis` * :c:data:`max_exc_pert` -* :c:data:`mo_bielec_integral_jj` -* :c:data:`mo_bielec_integral_jj_anti` -* :c:data:`mo_bielec_integral_jj_anti_from_ao` -* :c:data:`mo_bielec_integral_jj_exchange` -* :c:data:`mo_bielec_integral_jj_exchange_from_ao` -* :c:data:`mo_bielec_integral_jj_from_ao` -* :c:data:`mo_bielec_integral_vv_anti_from_ao` -* :c:data:`mo_bielec_integral_vv_exchange_from_ao` -* :c:data:`mo_bielec_integral_vv_from_ao` -* :c:data:`mo_bielec_integrals_erf_in_map` -* :c:data:`mo_bielec_integrals_in_map` * :c:data:`mo_class` * :c:data:`mo_coef` * :c:data:`mo_coef_begin_iteration` @@ -356,27 +350,36 @@ Index of Providers * :c:data:`mo_integrals_erf_cache_min` * :c:data:`mo_integrals_erf_map` * :c:data:`mo_integrals_map` +* :c:data:`mo_integrals_n_e` +* :c:data:`mo_integrals_n_e_per_atom` * :c:data:`mo_integrals_threshold` -* :c:data:`mo_kinetic_integral` +* :c:data:`mo_kinetic_integrals` * :c:data:`mo_label` -* :c:data:`mo_mono_elec_integral` -* :c:data:`mo_nucl_elec_integral` -* :c:data:`mo_nucl_elec_integral_per_atom` * :c:data:`mo_num` * :c:data:`mo_occ` +* :c:data:`mo_one_e_integrals` * :c:data:`mo_overlap` -* :c:data:`mo_pseudo_integral` +* :c:data:`mo_pseudo_integrals` * :c:data:`mo_spread_x` * :c:data:`mo_spread_y` * :c:data:`mo_spread_z` -* :c:data:`mo_tot_num` * :c:data:`mo_two_e_int_erf_jj` * :c:data:`mo_two_e_int_erf_jj_anti` * :c:data:`mo_two_e_int_erf_jj_anti_from_ao` * :c:data:`mo_two_e_int_erf_jj_exchange` * :c:data:`mo_two_e_int_erf_jj_exchange_from_ao` * :c:data:`mo_two_e_int_erf_jj_from_ao` -* :c:data:`mono_elec_ref_bitmask_energy` +* :c:data:`mo_two_e_integral_jj_from_ao` +* :c:data:`mo_two_e_integrals_erf_in_map` +* :c:data:`mo_two_e_integrals_in_map` +* :c:data:`mo_two_e_integrals_jj` +* :c:data:`mo_two_e_integrals_jj_anti` +* :c:data:`mo_two_e_integrals_jj_anti_from_ao` +* :c:data:`mo_two_e_integrals_jj_exchange` +* :c:data:`mo_two_e_integrals_jj_exchange_from_ao` +* :c:data:`mo_two_e_integrals_vv_anti_from_ao` +* :c:data:`mo_two_e_integrals_vv_exchange_from_ao` +* :c:data:`mo_two_e_integrals_vv_from_ao` * :c:data:`mos_grad_in_r_array` * :c:data:`mos_in_r_array` * :c:data:`mos_in_r_array_transp` @@ -446,7 +449,6 @@ Index of Providers * :c:data:`nucl_dist_vec_x` * :c:data:`nucl_dist_vec_y` * :c:data:`nucl_dist_vec_z` -* :c:data:`nucl_elec_ref_bitmask_energy` * :c:data:`nucl_label` * :c:data:`nucl_list_shell_aos` * :c:data:`nucl_n_aos` @@ -574,8 +576,8 @@ Index of Providers * :c:data:`psi_dft_energy_kinetic` * :c:data:`psi_dft_energy_nuclear_elec` * :c:data:`psi_energy` -* :c:data:`psi_energy_bielec` * :c:data:`psi_energy_h_core` +* :c:data:`psi_energy_two_e` * :c:data:`psi_energy_with_nucl_rep` * :c:data:`psi_non_cas` * :c:data:`psi_non_cas_coef` @@ -608,12 +610,20 @@ Index of Providers * :c:data:`pt2_w_t` * :c:data:`qp_max_mem` * :c:data:`qp_run_address` -* :c:data:`read_ao_integrals` -* :c:data:`read_ao_integrals_erf` -* :c:data:`read_ao_one_integrals` -* :c:data:`read_mo_integrals` -* :c:data:`read_mo_integrals_erf` -* :c:data:`read_mo_one_integrals` +* :c:data:`read_ao_integrals_e_n` +* :c:data:`read_ao_integrals_kinetic` +* :c:data:`read_ao_integrals_overlap` +* :c:data:`read_ao_integrals_pseudo` +* :c:data:`read_ao_one_e_integrals` +* :c:data:`read_ao_two_e_integrals` +* :c:data:`read_ao_two_e_integrals_erf` +* :c:data:`read_mo_integrals_e_n` +* :c:data:`read_mo_integrals_kinetic` +* :c:data:`read_mo_integrals_pseudo` +* :c:data:`read_mo_one_e_integrals` +* :c:data:`read_mo_two_e_integrals` +* :c:data:`read_mo_two_e_integrals_erf` +* :c:data:`read_nuclear_repulsion` * :c:data:`read_wf` * :c:data:`rec__quicksort` * :c:data:`rec_d_quicksort` @@ -621,7 +631,11 @@ Index of Providers * :c:data:`rec_i8_quicksort` * :c:data:`rec_i_quicksort` * :c:data:`ref_bitmask` +* :c:data:`ref_bitmask_e_n_energy` * :c:data:`ref_bitmask_energy` +* :c:data:`ref_bitmask_kinetic_energy` +* :c:data:`ref_bitmask_one_e_energy` +* :c:data:`ref_bitmask_two_e_energy` * :c:data:`ref_closed_shell_bitmask` * :c:data:`reunion_of_bitmask` * :c:data:`reunion_of_cas_inact_bitmask` @@ -686,12 +700,20 @@ Index of Providers * :c:data:`weight_occ_pattern` * :c:data:`weights_angular_integration_lebedev` * :c:data:`weights_angular_points` -* :c:data:`write_ao_integrals` -* :c:data:`write_ao_integrals_erf` -* :c:data:`write_ao_one_integrals` -* :c:data:`write_mo_integrals` -* :c:data:`write_mo_integrals_erf` -* :c:data:`write_mo_one_integrals` +* :c:data:`write_ao_integrals_e_n` +* :c:data:`write_ao_integrals_kinetic` +* :c:data:`write_ao_integrals_overlap` +* :c:data:`write_ao_integrals_pseudo` +* :c:data:`write_ao_one_e_integrals` +* :c:data:`write_ao_two_e_integrals` +* :c:data:`write_ao_two_e_integrals_erf` +* :c:data:`write_mo_integrals_e_n` +* :c:data:`write_mo_integrals_kinetic` +* :c:data:`write_mo_integrals_pseudo` +* :c:data:`write_mo_one_e_integrals` +* :c:data:`write_mo_two_e_integrals` +* :c:data:`write_mo_two_e_integrals_erf` +* :c:data:`write_nuclear_repulsion` * :c:data:`zmq_context` * :c:data:`zmq_lock` * :c:data:`zmq_port_start` @@ -708,9 +730,9 @@ Index of Subroutines/Functions * :c:func:`a_coef` * :c:func:`a_operator` -* :c:func:`a_operator_bielec` +* :c:func:`a_operator_two_e` * :c:func:`ac_operator` -* :c:func:`ac_operator_bielec` +* :c:func:`ac_operator_two_e` * :c:func:`add_integrals_to_map` * :c:func:`add_integrals_to_map_erf` * :c:func:`add_integrals_to_map_no_exit_34` @@ -719,22 +741,22 @@ Index of Subroutines/Functions * :c:func:`add_poly_multiply` * :c:func:`add_task_to_taskserver` * :c:func:`add_to_selection_buffer` -* :c:func:`ao_bielec_integral` -* :c:func:`ao_bielec_integral_erf` -* :c:func:`ao_bielec_integral_schwartz_accel` -* :c:func:`ao_bielec_integral_schwartz_accel_erf` -* :c:func:`ao_bielec_integrals_erf_in_map_collector` -* :c:func:`ao_bielec_integrals_erf_in_map_slave` -* :c:func:`ao_bielec_integrals_erf_in_map_slave_inproc` -* :c:func:`ao_bielec_integrals_erf_in_map_slave_tcp` -* :c:func:`ao_bielec_integrals_in_map_collector` -* :c:func:`ao_bielec_integrals_in_map_slave` -* :c:func:`ao_bielec_integrals_in_map_slave_inproc` -* :c:func:`ao_bielec_integrals_in_map_slave_tcp` * :c:func:`ao_l4` * :c:func:`ao_ortho_cano_to_ao` * :c:func:`ao_power_index` * :c:func:`ao_to_mo` +* :c:func:`ao_two_e_integral` +* :c:func:`ao_two_e_integral_erf` +* :c:func:`ao_two_e_integral_schwartz_accel` +* :c:func:`ao_two_e_integral_schwartz_accel_erf` +* :c:func:`ao_two_e_integrals_erf_in_map_collector` +* :c:func:`ao_two_e_integrals_erf_in_map_slave` +* :c:func:`ao_two_e_integrals_erf_in_map_slave_inproc` +* :c:func:`ao_two_e_integrals_erf_in_map_slave_tcp` +* :c:func:`ao_two_e_integrals_in_map_collector` +* :c:func:`ao_two_e_integrals_in_map_slave` +* :c:func:`ao_two_e_integrals_in_map_slave_inproc` +* :c:func:`ao_two_e_integrals_in_map_slave_tcp` * :c:func:`ao_value` * :c:func:`apply_excitation` * :c:func:`apply_hole` @@ -746,8 +768,6 @@ Index of Subroutines/Functions * :c:func:`au0_h_au0` * :c:func:`b_coef` * :c:func:`berf` -* :c:func:`bielec_integrals_index` -* :c:func:`bielec_integrals_index_reverse` * :c:func:`binom_func` * :c:func:`bitstring_to_hexa` * :c:func:`bitstring_to_list` @@ -769,10 +789,10 @@ Index of Subroutines/Functions * :c:func:`clear_bit_to_integer` * :c:func:`clear_mo_erf_map` * :c:func:`clear_mo_map` -* :c:func:`compute_ao_bielec_integrals` -* :c:func:`compute_ao_bielec_integrals_erf` * :c:func:`compute_ao_integrals_erf_jl` * :c:func:`compute_ao_integrals_jl` +* :c:func:`compute_ao_two_e_integrals` +* :c:func:`compute_ao_two_e_integrals_erf` * :c:func:`connect_to_taskserver` * :c:func:`connected_to_ref` * :c:func:`connected_to_ref_by_mono` @@ -815,7 +835,7 @@ Index of Subroutines/Functions * :c:func:`diag_h_mat_elem` * :c:func:`diag_h_mat_elem_au0_h_au0` * :c:func:`diag_h_mat_elem_fock` -* :c:func:`diag_h_mat_elem_monoelec` +* :c:func:`diag_h_mat_elem_one_e` * :c:func:`diag_s_mat_elem` * :c:func:`diag_wee_mat_elem` * :c:func:`diagonalize_ci` @@ -899,14 +919,14 @@ Index of Subroutines/Functions * :c:func:`get_all_spin_singles_and_doubles_4` * :c:func:`get_all_spin_singles_and_doubles_n_int` * :c:func:`get_all_spin_singles_n_int` -* :c:func:`get_ao_bielec_integral` -* :c:func:`get_ao_bielec_integral_erf` -* :c:func:`get_ao_bielec_integrals` -* :c:func:`get_ao_bielec_integrals_erf` -* :c:func:`get_ao_bielec_integrals_erf_non_zero` -* :c:func:`get_ao_bielec_integrals_non_zero` * :c:func:`get_ao_erf_map_size` * :c:func:`get_ao_map_size` +* :c:func:`get_ao_two_e_integral` +* :c:func:`get_ao_two_e_integral_erf` +* :c:func:`get_ao_two_e_integrals` +* :c:func:`get_ao_two_e_integrals_erf` +* :c:func:`get_ao_two_e_integrals_erf_non_zero` +* :c:func:`get_ao_two_e_integrals_non_zero` * :c:func:`get_d0` * :c:func:`get_d1` * :c:func:`get_d2` @@ -929,20 +949,19 @@ Index of Subroutines/Functions * :c:func:`get_m1` * :c:func:`get_m2` * :c:func:`get_mask_phase` -* :c:func:`get_mo_bielec_integral` -* :c:func:`get_mo_bielec_integral_erf` -* :c:func:`get_mo_bielec_integrals` -* :c:func:`get_mo_bielec_integrals_coulomb_ii` -* :c:func:`get_mo_bielec_integrals_erf` -* :c:func:`get_mo_bielec_integrals_erf_coulomb_ii` -* :c:func:`get_mo_bielec_integrals_erf_exch_ii` -* :c:func:`get_mo_bielec_integrals_erf_i1j1` -* :c:func:`get_mo_bielec_integrals_erf_ij` -* :c:func:`get_mo_bielec_integrals_exch_ii` -* :c:func:`get_mo_bielec_integrals_i1j1` -* :c:func:`get_mo_bielec_integrals_ij` * :c:func:`get_mo_erf_map_size` * :c:func:`get_mo_map_size` +* :c:func:`get_mo_two_e_integral_erf` +* :c:func:`get_mo_two_e_integrals` +* :c:func:`get_mo_two_e_integrals_coulomb_ii` +* :c:func:`get_mo_two_e_integrals_erf` +* :c:func:`get_mo_two_e_integrals_erf_coulomb_ii` +* :c:func:`get_mo_two_e_integrals_erf_exch_ii` +* :c:func:`get_mo_two_e_integrals_erf_i1j1` +* :c:func:`get_mo_two_e_integrals_erf_ij` +* :c:func:`get_mo_two_e_integrals_exch_ii` +* :c:func:`get_mo_two_e_integrals_i1j1` +* :c:func:`get_mo_two_e_integrals_ij` * :c:func:`get_mono_excitation` * :c:func:`get_mono_excitation_from_fock` * :c:func:`get_mono_excitation_spin` @@ -953,6 +972,7 @@ Index of Subroutines/Functions * :c:func:`get_s2` * :c:func:`get_task_from_taskserver` * :c:func:`get_tasks_from_taskserver` +* :c:func:`get_two_e_integral` * :c:func:`get_uj_s2_ui` * :c:func:`getmobiles` * :c:func:`getunitandopen` @@ -967,8 +987,8 @@ Index of Subroutines/Functions * :c:func:`give_explicit_poly_and_gaussian` * :c:func:`give_explicit_poly_and_gaussian_double` * :c:func:`give_explicit_poly_and_gaussian_x` -* :c:func:`give_polynom_mult_center_mono_elec` * :c:func:`give_polynom_mult_center_x` +* :c:func:`give_polynomial_mult_center_one_e` * :c:func:`gpw` * :c:func:`grad_rho_ab_to_grad_rho_oc` * :c:func:`gser` @@ -982,13 +1002,6 @@ Index of Subroutines/Functions * :c:func:`h_apply_cisd_diexcorg` * :c:func:`h_apply_cisd_diexcp` * :c:func:`h_apply_cisd_monoexc` -* :c:func:`h_s2_u_0_bielec_nstates_openmp` -* :c:func:`h_s2_u_0_bielec_nstates_openmp_work` -* :c:func:`h_s2_u_0_bielec_nstates_openmp_work_1` -* :c:func:`h_s2_u_0_bielec_nstates_openmp_work_2` -* :c:func:`h_s2_u_0_bielec_nstates_openmp_work_3` -* :c:func:`h_s2_u_0_bielec_nstates_openmp_work_4` -* :c:func:`h_s2_u_0_bielec_nstates_openmp_work_n_int` * :c:func:`h_s2_u_0_nstates_openmp` * :c:func:`h_s2_u_0_nstates_openmp_work` * :c:func:`h_s2_u_0_nstates_openmp_work_1` @@ -997,6 +1010,13 @@ Index of Subroutines/Functions * :c:func:`h_s2_u_0_nstates_openmp_work_4` * :c:func:`h_s2_u_0_nstates_openmp_work_n_int` * :c:func:`h_s2_u_0_nstates_zmq` +* :c:func:`h_s2_u_0_two_e_nstates_openmp` +* :c:func:`h_s2_u_0_two_e_nstates_openmp_work` +* :c:func:`h_s2_u_0_two_e_nstates_openmp_work_1` +* :c:func:`h_s2_u_0_two_e_nstates_openmp_work_2` +* :c:func:`h_s2_u_0_two_e_nstates_openmp_work_3` +* :c:func:`h_s2_u_0_two_e_nstates_openmp_work_4` +* :c:func:`h_s2_u_0_two_e_nstates_openmp_work_n_int` * :c:func:`hcore_guess` * :c:func:`heap_dsort` * :c:func:`heap_dsort_big` @@ -1017,13 +1037,13 @@ Index of Subroutines/Functions * :c:func:`i8set_order_big` * :c:func:`i8sort` * :c:func:`i_h_j` -* :c:func:`i_h_j_bielec` * :c:func:`i_h_j_double_alpha_beta` * :c:func:`i_h_j_double_spin` * :c:func:`i_h_j_mono_spin` -* :c:func:`i_h_j_mono_spin_monoelec` -* :c:func:`i_h_j_monoelec` +* :c:func:`i_h_j_mono_spin_one_e` +* :c:func:`i_h_j_one_e` * :c:func:`i_h_j_s2` +* :c:func:`i_h_j_two_e` * :c:func:`i_h_j_verbose` * :c:func:`i_h_psi` * :c:func:`i_h_psi_minilist` @@ -1086,11 +1106,11 @@ Index of Subroutines/Functions * :c:func:`mo_as_eigvectors_of_mo_matrix` * :c:func:`mo_as_svd_vectors_of_mo_matrix` * :c:func:`mo_as_svd_vectors_of_mo_matrix_eig` -* :c:func:`mo_bielec_integral` -* :c:func:`mo_bielec_integral_erf` -* :c:func:`mo_bielec_integrals_erf_index` -* :c:func:`mo_bielec_integrals_index` * :c:func:`mo_to_ao` +* :c:func:`mo_two_e_integral` +* :c:func:`mo_two_e_integral_erf` +* :c:func:`mo_two_e_integrals_erf_index` +* :c:func:`mo_two_e_integrals_index` * :c:func:`modify_bitmasks_for_hole` * :c:func:`modify_bitmasks_for_hole_in_out` * :c:func:`modify_bitmasks_for_particl` @@ -1218,10 +1238,10 @@ Index of Subroutines/Functions * :c:func:`s2_u_0` * :c:func:`s2_u_0_nstates` * :c:func:`sabpartial` -* :c:func:`save_erf_bi_elec_integrals_ao` -* :c:func:`save_erf_bi_elec_integrals_mo` -* :c:func:`save_erf_bielec_ints_ao_into_ints_ao` -* :c:func:`save_erf_bielec_ints_mo_into_ints_mo` +* :c:func:`save_erf_two_e_integrals_ao` +* :c:func:`save_erf_two_e_integrals_mo` +* :c:func:`save_erf_two_e_ints_ao_into_ints_ao` +* :c:func:`save_erf_two_e_ints_mo_into_ints_mo` * :c:func:`save_iterations` * :c:func:`save_mos` * :c:func:`save_mos_truncated` @@ -1270,8 +1290,10 @@ Index of Subroutines/Functions * :c:func:`tasks_done_to_taskserver` * :c:func:`testteethbuilding` * :c:func:`total_memory` +* :c:func:`two_e_integrals_index` +* :c:func:`two_e_integrals_index_reverse` * :c:func:`u_0_h_u_0` -* :c:func:`u_0_h_u_0_bielec` +* :c:func:`u_0_h_u_0_two_e` * :c:func:`u_0_s2_u_0` * :c:func:`u_dot_u` * :c:func:`u_dot_v` diff --git a/docs/source/users_guide/excited_states.rst b/docs/source/users_guide/excited_states.rst index 495692b9..87798aca 100644 --- a/docs/source/users_guide/excited_states.rst +++ b/docs/source/users_guide/excited_states.rst @@ -1,3 +1,4 @@ +============== Excited states ============== diff --git a/docs/source/users_guide/qp_edit.rst b/docs/source/users_guide/qp_edit.rst index 3a1a5d84..02eb9809 100644 --- a/docs/source/users_guide/qp_edit.rst +++ b/docs/source/users_guide/qp_edit.rst @@ -4,7 +4,8 @@ qp_edit ======= -.. TODO +.. program:: qp_edit + This command reads the content of the |EZFIO| directory and creates a temporary file containing the data. The data is presented as a *ReStructured Text* (rst) diff --git a/docs/source/users_guide/qp_export_as_tgz.rst b/docs/source/users_guide/qp_export_as_tgz.rst index 1333ed77..fcb2c10e 100644 --- a/docs/source/users_guide/qp_export_as_tgz.rst +++ b/docs/source/users_guide/qp_export_as_tgz.rst @@ -1 +1,9 @@ -TODO +================ +qp_export_as_tgz +================ + +.. program:: qp_export_as_tgz + +.. TODO + +.. include:: /work.rst diff --git a/docs/source/users_guide/qp_name.rst b/docs/source/users_guide/qp_name.rst new file mode 100644 index 00000000..5667e97a --- /dev/null +++ b/docs/source/users_guide/qp_name.rst @@ -0,0 +1,35 @@ +.. _qp_name: + +qp_name +======= + +.. program:: qp_name + +Displays the names of all the files in which the provider/subroutine/function +given as argument is used. With the `-r` flag, the name can be changed in the +whole quantum package. + +Usage +----- + +.. code:: bash + + qp_name [-r | --rename=] + + +.. option:: -h + + Prints the help message. + + +.. option:: -r --rename= + + Renames the provider/subroutine/function and all its occurences. + + +.. note:: + + It is safe to create a commit before renaming a provider, and then to + check what has changed using git diff. + + diff --git a/docs/source/users_guide/qp_plugins.rst b/docs/source/users_guide/qp_plugins.rst index 871a0e0a..17366b02 100644 --- a/docs/source/users_guide/qp_plugins.rst +++ b/docs/source/users_guide/qp_plugins.rst @@ -4,6 +4,8 @@ qp_plugins ========== +.. program:: qp_plugins + This command deals with all external plugings of |qp|. Plugin repositories can be downloaded, and the plugins in these repositories can be installed/uninstalled of created. diff --git a/docs/source/users_guide/qp_set_mo_class.rst b/docs/source/users_guide/qp_set_mo_class.rst index 40e141f7..6b942155 100644 --- a/docs/source/users_guide/qp_set_mo_class.rst +++ b/docs/source/users_guide/qp_set_mo_class.rst @@ -3,7 +3,7 @@ qp_set_mo_class =============== -.. TODO +.. program:: qp_set_mo_class This command sets the orbital classes in an |EZFIO| directory. diff --git a/docs/source/users_guide/qp_test.rst b/docs/source/users_guide/qp_test.rst index 2714f9c5..4e7b3245 100644 --- a/docs/source/users_guide/qp_test.rst +++ b/docs/source/users_guide/qp_test.rst @@ -4,6 +4,8 @@ qp_test ======= +.. program:: qp_test + This command runs the consistency test of |qp|. The tests are run with the |Bats| shell testing environment. If the name of a test of its number is specified on the command line, only this diff --git a/ocaml/Bitlist.ml b/ocaml/Bitlist.ml index 46d9ab9a..200847ba 100644 --- a/ocaml/Bitlist.ml +++ b/ocaml/Bitlist.ml @@ -87,9 +87,9 @@ let of_int64_array l = (* Compute n_int *) -let n_int_of_mo_tot_num mo_tot_num = +let n_int_of_mo_num mo_num = let bit_kind_size = Bit_kind_size.to_int (Lazy.force Qpackage.bit_kind_size) in - N_int_number.of_int ( (mo_tot_num-1)/bit_kind_size + 1 ) + N_int_number.of_int ( (mo_num-1)/bit_kind_size + 1 ) (* Create a zero bit list *) @@ -134,14 +134,14 @@ let of_mo_number_list n_int l = let to_mo_number_list l = let a = Array.of_list l in - let mo_tot_num = MO_number.get_max () in + let mo_num = MO_number.get_max () in let rec do_work accu = function | 0 -> accu | i -> begin let new_accu = match a.(i-1) with - | Bit.One -> (MO_number.of_int ~max:mo_tot_num i)::accu + | Bit.One -> (MO_number.of_int ~max:mo_num i)::accu | Bit.Zero -> accu in do_work new_accu (i-1) diff --git a/ocaml/Bitlist.mli b/ocaml/Bitlist.mli index f67d86b7..1f230f08 100644 --- a/ocaml/Bitlist.mli +++ b/ocaml/Bitlist.mli @@ -23,7 +23,7 @@ val to_int64_list : t -> int64 list val to_int64_array : t -> int64 array (** Get the number of needed int64 elements to encode the bit list *) -val n_int_of_mo_tot_num : int -> Qptypes.N_int_number.t +val n_int_of_mo_num : int -> Qptypes.N_int_number.t (** Conversion to MO numbers *) val to_mo_number_list : t -> Qptypes.MO_number.t list diff --git a/ocaml/Determinant.ml b/ocaml/Determinant.ml index a6d754b0..aa949bf5 100644 --- a/ocaml/Determinant.ml +++ b/ocaml/Determinant.ml @@ -24,9 +24,9 @@ let to_bitlist_couple x = in (xa,xb) -let bitlist_to_string ~mo_tot_num x = +let bitlist_to_string ~mo_num x = let len = - MO_number.to_int mo_tot_num + MO_number.to_int mo_num in let s = List.map (function @@ -47,17 +47,17 @@ let of_int64_array ~n_int ~alpha ~beta x = in if ( (Bitlist.popcnt a) <> alpha) then begin - let mo_tot_num = MO_number.get_max () in - let mo_tot_num = MO_number.of_int mo_tot_num ~max:mo_tot_num in + let mo_num = MO_number.get_max () in + let mo_num = MO_number.of_int mo_num ~max:mo_num in failwith (Printf.sprintf "Expected %d electrons in alpha determinant -%s" alpha (bitlist_to_string ~mo_tot_num:mo_tot_num a) ) +%s" alpha (bitlist_to_string ~mo_num:mo_num a) ) end; if ( (Bitlist.popcnt b) <> beta ) then begin - let mo_tot_num = MO_number.get_max () in - let mo_tot_num = MO_number.of_int mo_tot_num ~max:mo_tot_num in + let mo_num = MO_number.get_max () in + let mo_num = MO_number.of_int mo_num ~max:mo_num in failwith (Printf.sprintf "Expected %d electrons in beta determinant -%s" beta (bitlist_to_string ~mo_tot_num:mo_tot_num b) ) +%s" beta (bitlist_to_string ~mo_num:mo_num b) ) end; x @@ -70,15 +70,15 @@ let of_bitlist_couple ?n_int ~alpha ~beta (xa,xb) = and n_int = match n_int with | Some x -> x - | None -> Bitlist.n_int_of_mo_tot_num (List.length xa) + | None -> Bitlist.n_int_of_mo_num (List.length xa) in of_int64_array ~n_int ~alpha ~beta (Array.concat [ba;bb]) -let to_string ~mo_tot_num x = +let to_string ~mo_num x = let (xa,xb) = to_bitlist_couple x in - [ " " ; bitlist_to_string ~mo_tot_num xa ; "\n" ; - " " ; bitlist_to_string ~mo_tot_num xb ] + [ " " ; bitlist_to_string ~mo_num xa ; "\n" ; + " " ; bitlist_to_string ~mo_num xb ] |> String.concat "" diff --git a/ocaml/Determinant.mli b/ocaml/Determinant.mli index 78a2f52f..0acbb059 100644 --- a/ocaml/Determinant.mli +++ b/ocaml/Determinant.mli @@ -30,4 +30,4 @@ val of_bitlist_couple : ?n_int:Qptypes.N_int_number.t -> Bitlist.t * Bitlist.t -> t (** String representation *) -val to_string : mo_tot_num:Qptypes.MO_number.t -> t -> string +val to_string : mo_num:Qptypes.MO_number.t -> t -> string diff --git a/ocaml/Input_bitmasks.ml b/ocaml/Input_bitmasks.ml index 75a22a26..21c6b3f8 100644 --- a/ocaml/Input_bitmasks.ml +++ b/ocaml/Input_bitmasks.ml @@ -29,8 +29,8 @@ end = struct let read_n_int () = if not (Ezfio.has_bitmasks_n_int()) then - Ezfio.get_mo_basis_mo_tot_num () - |> Bitlist.n_int_of_mo_tot_num + Ezfio.get_mo_basis_mo_num () + |> Bitlist.n_int_of_mo_num |> N_int_number.to_int |> Ezfio.set_bitmasks_n_int ; @@ -59,7 +59,7 @@ end = struct let full_mask n_int = let range = "[1-"^ - (Int.to_string (Ezfio.get_mo_basis_mo_tot_num ()))^"]" + (Int.to_string (Ezfio.get_mo_basis_mo_num ()))^"]" in MO_class.create_active range |> MO_class.to_bitlist n_int @@ -121,7 +121,7 @@ end = struct ;; let read () = - if (Ezfio.has_mo_basis_mo_tot_num ()) then + if (Ezfio.has_mo_basis_mo_num ()) then Some { n_int = read_n_int (); bit_kind = read_bit_kind (); diff --git a/ocaml/Input_determinants_by_hand.ml b/ocaml/Input_determinants_by_hand.ml index 40212d0b..25b983de 100644 --- a/ocaml/Input_determinants_by_hand.ml +++ b/ocaml/Input_determinants_by_hand.ml @@ -41,8 +41,8 @@ end = struct let read_n_int () = if not (Ezfio.has_determinants_n_int()) then - Ezfio.get_mo_basis_mo_tot_num () - |> Bitlist.n_int_of_mo_tot_num + Ezfio.get_mo_basis_mo_num () + |> Bitlist.n_int_of_mo_num |> N_int_number.to_int |> Ezfio.set_determinants_n_int ; @@ -214,10 +214,10 @@ end = struct in if not (Ezfio.has_determinants_psi_det ()) then begin - let mo_tot_num = MO_number.get_max () in + let mo_num = MO_number.get_max () in let rec build_data accu = function | 0 -> accu - | n -> build_data ((MO_number.of_int ~max:mo_tot_num n)::accu) (n-1) + | n -> build_data ((MO_number.of_int ~max:mo_num n)::accu) (n-1) in let det_a = build_data [] (Elec_alpha_number.to_int n_alpha) |> Bitlist.of_mo_number_list n_int @@ -257,7 +257,7 @@ end = struct let read () = - if (Ezfio.has_mo_basis_mo_tot_num ()) then + if (Ezfio.has_mo_basis_mo_num ()) then { n_int = read_n_int () ; bit_kind = read_bit_kind () ; n_det = read_n_det () ; @@ -304,9 +304,9 @@ end = struct let to_rst b = let max = - Ezfio.get_mo_basis_mo_tot_num () + Ezfio.get_mo_basis_mo_num () in - let mo_tot_num = + let mo_num = MO_number.of_int ~max max in let det_text = @@ -333,7 +333,7 @@ end = struct Array.init ndet ~f:(fun i -> Printf.sprintf " %s\n%s\n" (coefs_string i) - (Determinant.to_string ~mo_tot_num:mo_tot_num b.psi_det.(i) + (Determinant.to_string ~mo_num:mo_num b.psi_det.(i) |> String.split ~on:'\n' |> List.map ~f:(fun x -> " "^x) |> String.concat ~sep:"\n" @@ -367,8 +367,8 @@ Determinants :: ;; let to_string b = - let mo_tot_num = Ezfio.get_mo_basis_mo_tot_num () in - let mo_tot_num = MO_number.of_int mo_tot_num ~max:mo_tot_num in + let mo_num = Ezfio.get_mo_basis_mo_num () in + let mo_num = MO_number.of_int mo_num ~max:mo_num in Printf.sprintf " n_int = %s bit_kind = %s @@ -388,7 +388,7 @@ psi_det = %s (b.psi_coef |> Array.to_list |> List.map ~f:Det_coef.to_string |> String.concat ~sep:", ") (b.psi_det |> Array.to_list |> List.map ~f:(Determinant.to_string - ~mo_tot_num:mo_tot_num) |> String.concat ~sep:"\n\n") + ~mo_num) |> String.concat ~sep:"\n\n") ;; let of_rst r = diff --git a/ocaml/Input_mo_basis.ml b/ocaml/Input_mo_basis.ml index c51a7f4a..b36a5484 100644 --- a/ocaml/Input_mo_basis.ml +++ b/ocaml/Input_mo_basis.ml @@ -5,7 +5,7 @@ open Core module Mo_basis : sig type t = - { mo_tot_num : MO_number.t ; + { mo_num : MO_number.t ; mo_label : MO_label.t; mo_class : MO_class.t array; mo_occ : MO_occ.t array; @@ -17,7 +17,7 @@ module Mo_basis : sig val to_rst : t -> Rst_string.t end = struct type t = - { mo_tot_num : MO_number.t ; + { mo_num : MO_number.t ; mo_label : MO_label.t; mo_class : MO_class.t array; mo_occ : MO_occ.t array; @@ -54,21 +54,21 @@ end = struct result - let read_mo_tot_num () = - Ezfio.get_mo_basis_mo_tot_num () + let read_mo_num () = + Ezfio.get_mo_basis_mo_num () |> MO_number.of_int let read_mo_class () = if not (Ezfio.has_mo_basis_mo_class ()) then begin - let mo_tot_num = MO_number.to_int (read_mo_tot_num ()) in + let mo_num = MO_number.to_int (read_mo_num ()) in let data = - Array.init mo_tot_num ~f:(fun _ -> MO_class.(to_string (Active []))) + Array.init mo_num ~f:(fun _ -> MO_class.(to_string (Active []))) |> Array.to_list in Ezfio.ezfio_array_of_list ~rank:1 - ~dim:[| mo_tot_num |] ~data:data + ~dim:[| mo_num |] ~data:data |> Ezfio.set_mo_basis_mo_class end; Ezfio.flattened_ezfio (Ezfio.get_mo_basis_mo_class () ) @@ -80,13 +80,13 @@ end = struct begin let elec_alpha_num = Ezfio.get_electrons_elec_alpha_num () and elec_beta_num = Ezfio.get_electrons_elec_beta_num () - and mo_tot_num = MO_number.to_int (read_mo_tot_num ()) in - let data = Array.init mo_tot_num ~f:(fun i -> + and mo_num = MO_number.to_int (read_mo_num ()) in + let data = Array.init mo_num ~f:(fun i -> if (i Array.to_list in Ezfio.ezfio_array_of_list ~rank:1 - ~dim:[| mo_tot_num |] ~data:data + ~dim:[| mo_num |] ~data:data |> Ezfio.set_mo_basis_mo_occ end; Ezfio.flattened_ezfio (Ezfio.get_mo_basis_mo_occ () ) @@ -98,17 +98,17 @@ end = struct |> Ezfio.flattened_ezfio |> Array.map ~f:MO_coef.of_float in - let mo_tot_num = read_mo_tot_num () |> MO_number.to_int in - let ao_num = (Array.length a)/mo_tot_num in - Array.init mo_tot_num ~f:(fun j -> + let mo_num = read_mo_num () |> MO_number.to_int in + let ao_num = (Array.length a)/mo_num in + Array.init mo_num ~f:(fun j -> Array.sub ~pos:(j*ao_num) ~len:(ao_num) a ) let read () = - if (Ezfio.has_mo_basis_mo_tot_num ()) then + if (Ezfio.has_mo_basis_mo_num ()) then Some - { mo_tot_num = read_mo_tot_num (); + { mo_num = read_mo_num (); mo_label = read_mo_label () ; mo_class = read_mo_class (); mo_occ = read_mo_occ (); @@ -121,7 +121,7 @@ end = struct let mo_coef_to_string mo_coef = let ao_num = Array.length mo_coef.(0) - and mo_tot_num = Array.length mo_coef in + and mo_num = Array.length mo_coef in let rec print_five imin imax = match (imax-imin+1) with | 1 -> @@ -175,10 +175,10 @@ end = struct | _ -> assert false in let rec create_list accu i = - if (i+4 < mo_tot_num) then + if (i+4 < mo_num) then create_list ( (print_five i (i+3) |> String.concat ~sep:"\n")::accu ) (i+4) else - (print_five i (mo_tot_num-1) |> String.concat ~sep:"\n")::accu |> List.rev + (print_five i (mo_num-1) |> String.concat ~sep:"\n")::accu |> List.rev in create_list [] 0 |> String.concat ~sep:"\n\n" @@ -191,14 +191,14 @@ Label of the molecular orbitals :: Total number of MOs :: - mo_tot_num = %s + mo_num = %s MO coefficients :: %s " (MO_label.to_string b.mo_label) - (MO_number.to_string b.mo_tot_num) + (MO_number.to_string b.mo_num) (mo_coef_to_string b.mo_coef) |> Rst_string.of_string @@ -206,14 +206,14 @@ MO coefficients :: let to_string b = Printf.sprintf " -mo_label = %s -mo_tot_num = \"%s\" +mo_label = \"%s\" +mo_num = %s mo_clas = %s mo_occ = %s mo_coef = %s " (MO_label.to_string b.mo_label) - (MO_number.to_string b.mo_tot_num) + (MO_number.to_string b.mo_num) (b.mo_class |> Array.to_list |> List.map ~f:(MO_class.to_string) |> String.concat ~sep:", " ) (b.mo_occ |> Array.to_list |> List.map diff --git a/ocaml/qp_create_guess.ml b/ocaml/qp_create_guess.ml index 71a5b296..6e0d6cfe 100644 --- a/ocaml/qp_create_guess.ml +++ b/ocaml/qp_create_guess.ml @@ -26,8 +26,8 @@ let run ~multiplicity ezfio_file = let n_open_shells = alpha - beta in - let mo_tot_num = - Ezfio.get_mo_basis_mo_tot_num () + let mo_num = + Ezfio.get_mo_basis_mo_num () in let build_list_of_dets ne n_closed n_open = let init = @@ -60,7 +60,7 @@ let run ~multiplicity ezfio_file = in set_n_electrons init n_open ne |> List.filter ~f:(fun x -> List.length x <= n_closed+n_open) - |> List.map ~f:(fun x -> extend x (((mo_tot_num-1)/64+1)*64 - List.length x)) + |> List.map ~f:(fun x -> extend x (((mo_num-1)/64+1)*64 - List.length x)) in let alpha_new = @@ -79,7 +79,7 @@ let run ~multiplicity ezfio_file = in let n_int = - Bitlist.n_int_of_mo_tot_num mo_tot_num + Bitlist.n_int_of_mo_num mo_num in let determinants = List.map l_alpha ~f:(fun x -> List.map l_beta ~f:(fun y -> (x,y) )) @@ -94,7 +94,7 @@ let run ~multiplicity ezfio_file = in determinants - |> List.map ~f:(fun x -> Determinant.to_string ~mo_tot_num:(MO_number.of_int mo_tot_num) x) + |> List.map ~f:(fun x -> Determinant.to_string ~mo_num:(MO_number.of_int mo_num) x) |> List.iter ~f:(fun x -> Printf.printf "%s\n\n%!" x); let l = diff --git a/ocaml/qp_find_pi_space.ml b/ocaml/qp_find_pi_space.ml index 0d69f934..97360270 100644 --- a/ocaml/qp_find_pi_space.ml +++ b/ocaml/qp_find_pi_space.ml @@ -24,7 +24,7 @@ let run ?(sym="None") ?(apply="no") fc ezfio_filename = and n = (AO_number.to_int aos.Input.Ao_basis.ao_num) and m = - (MO_number.to_int mos.Input.Mo_basis.mo_tot_num) + (MO_number.to_int mos.Input.Mo_basis.mo_num) and one = Positive_int.of_int 1 and zero = Positive_int.of_int 0 in diff --git a/ocaml/qp_overlap_of_wf.ml b/ocaml/qp_overlap_of_wf.ml index a9fd4bee..3197bae5 100644 --- a/ocaml/qp_overlap_of_wf.ml +++ b/ocaml/qp_overlap_of_wf.ml @@ -19,8 +19,8 @@ let () = let fetch_wf ~state filename = (* State 0 is the ground state *) Ezfio.set_file filename; - let mo_tot_num = - Ezfio.get_mo_basis_mo_tot_num () + let mo_num = + Ezfio.get_mo_basis_mo_num () |> MO_number.of_int in let d = @@ -33,7 +33,7 @@ let () = state*n_det in let keys = - Array.map (Determinant.to_string ~mo_tot_num) + Array.map (Determinant.to_string ~mo_num) d.Determinants_by_hand.psi_det and values = Array.map Det_coef.to_float diff --git a/ocaml/qp_set_mo_class.ml b/ocaml/qp_set_mo_class.ml index 3c41d527..819b8ef7 100644 --- a/ocaml/qp_set_mo_class.ml +++ b/ocaml/qp_set_mo_class.ml @@ -36,17 +36,17 @@ type t = MO_class.t option let set ~core ~inact ~act ~virt ~del = - let mo_tot_num = - Ezfio.get_mo_basis_mo_tot_num () + let mo_num = + Ezfio.get_mo_basis_mo_num () in let n_int = try N_int_number.of_int (Ezfio.get_determinants_n_int ()) - with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num + with _ -> Bitlist.n_int_of_mo_num mo_num in let mo_class = - Array.init mo_tot_num ~f:(fun i -> None) + Array.init mo_num ~f:(fun i -> None) in (* Check input data *) @@ -74,7 +74,7 @@ let set ~core ~inact ~act ~virt ~del = let check f x = try f x with Invalid_argument a -> begin - Printf.printf "Number of MOs: %d\n%!" mo_tot_num; + Printf.printf "Number of MOs: %d\n%!" mo_num; raise (Invalid_argument a) end in @@ -96,7 +96,7 @@ let set ~core ~inact ~act ~virt ~del = for i=1 to (Array.length mo_class) do if (mo_class.(i-1) = None) then - failwith (Printf.sprintf "Orbital %d is not specified (mo_tot_num = %d)" i mo_tot_num) + failwith (Printf.sprintf "Orbital %d is not specified (mo_num = %d)" i mo_num) done; @@ -199,7 +199,7 @@ let set ~core ~inact ~act ~virt ~del = | Some x -> MO_class.to_string x ) in - Ezfio.ezfio_array_of_list ~rank:1 ~dim:[| mo_tot_num |] ~data + Ezfio.ezfio_array_of_list ~rank:1 ~dim:[| mo_num |] ~data |> Ezfio.set_mo_basis_mo_class @@ -223,18 +223,18 @@ let get () = | Some x -> x in - let mo_tot_num = - MO_number.to_int data.Input.Mo_basis.mo_tot_num + let mo_num = + MO_number.to_int data.Input.Mo_basis.mo_num in let n_int = try N_int_number.of_int (Ezfio.get_determinants_n_int ()) - with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num + with _ -> Bitlist.n_int_of_mo_num mo_num in Printf.printf "Electrons: %d %d\n" elec_alpha_num elec_beta_num; - Printf.printf "MO : %d\n" mo_tot_num; + Printf.printf "MO : %d\n" mo_num; Printf.printf "n_int: %d\n" (N_int_number.to_int n_int); @@ -267,8 +267,8 @@ let get () = let run ~q ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_filename = Ezfio.set_file ezfio_filename ; - if not (Ezfio.has_mo_basis_mo_tot_num ()) then - failwith "mo_basis/mo_tot_num not found" ; + if not (Ezfio.has_mo_basis_mo_num ()) then + failwith "mo_basis/mo_num not found" ; if q then get () diff --git a/ocaml/qptypes_generator.ml b/ocaml/qptypes_generator.ml index 06aa0ab6..b17b2c32 100644 --- a/ocaml/qptypes_generator.ml +++ b/ocaml/qptypes_generator.ml @@ -58,8 +58,8 @@ let input_data = " * Det_number_max : int assert (x > 0) ; - if (x > 10_00_000_000) then - warning \"More than 10 billion determinants\"; + if (x > 50_00_000_000) then + warning \"More than 50 billion determinants\"; * States_number : int assert (x > 0) ; @@ -141,7 +141,7 @@ let input_data = " let input_ezfio = " * MO_number : int - mo_basis_mo_tot_num + mo_basis_mo_num 1 : 10_000 More than 10_000 MOs @@ -162,8 +162,8 @@ let input_ezfio = " * Det_number : int determinants_n_det - 1 : 10_000_000_000 - More than 10 billion determinants + 1 : 50_000_000_000 + More than 50 billion determinants " diff --git a/ocaml/tests/test_determinants.ml b/ocaml/tests/test_determinants.ml index b2649828..4c9cb5b6 100644 --- a/ocaml/tests/test_determinants.ml +++ b/ocaml/tests/test_determinants.ml @@ -1,7 +1,7 @@ open Qptypes;; let test_module () = - let mo_tot_num = MO_number.of_int 10 in + let mo_num = MO_number.of_int 10 in let det = [| 15L ; 7L |] |> Determinant.of_int64_array @@ -9,7 +9,7 @@ let test_module () = ~alpha:(Elec_alpha_number.of_int 4) ~beta:(Elec_beta_number.of_int 3) in - Printf.printf "%s\n" (Determinant.to_string (~mo_tot_num:mo_tot_num) det) + Printf.printf "%s\n" (Determinant.to_string (~mo_num:mo_num) det) ;; test_module ();; diff --git a/scripts/ezfio_interface/ei_handler.py b/scripts/ezfio_interface/ei_handler.py index ef168fd7..709c26f6 100755 --- a/scripts/ezfio_interface/ei_handler.py +++ b/scripts/ezfio_interface/ei_handler.py @@ -318,7 +318,7 @@ def create_ezfio_provider(dict_ezfio_cfg): return [code, ...] """ - from ezfio_generate_provider import EZFIO_Provider + from ezfio_generate_provider import EZFIO_Provider, gen_ezfio_provider_disk_access dict_code_provider = dict() ez_p = EZFIO_Provider() @@ -330,12 +330,24 @@ def create_ezfio_provider(dict_ezfio_cfg): ez_p.set_ezfio_dir(dict_info['ezfio_dir']) ez_p.set_ezfio_name(dict_info['ezfio_name']) ez_p.set_output("6") -# ez_p.set_output("output_%s" % dict_info['module'].lower) # (nuclei.nucl_num,pseudo.klocmax) => (nucl_num,klocmax) ez_p.set_size(re.sub(r'\w+\.', "", dict_info['size'])) - dict_code_provider[provider_name] = str(ez_p) + "\n" + str_ = str(ez_p) + "\n" + if dict_info['type'].fancy == 'Disk_access': + + allowed_prefix = ['disk_access', 'io'] + assert (any(provider_name.startswith(p) for p in allowed_prefix)) + + provider_name_c = provider_name + for p in allowed_prefix: + if provider_name_c.startswith(p): + provider_name_c = provider_name_c.replace(p+'_','',1) + + str_ += gen_ezfio_provider_disk_access(provider_name, provider_name_c) + + dict_code_provider[provider_name] = str_ return dict_code_provider diff --git a/scripts/ezfio_interface/ezfio_generate_provider.py b/scripts/ezfio_interface/ezfio_generate_provider.py index d521338e..46df7e5e 100755 --- a/scripts/ezfio_interface/ezfio_generate_provider.py +++ b/scripts/ezfio_interface/ezfio_generate_provider.py @@ -10,6 +10,32 @@ fetched from the EZFIO file. import sys +def gen_ezfio_provider_disk_access(name_ref, name): + data = """ + BEGIN_PROVIDER [ logical, read_{name} ] + &BEGIN_PROVIDER [ logical, write_{name} ] + + BEGIN_DOC + ! One level of abstraction for {name} + END_DOC + + if ({name_ref}.EQ.'Read') then + read_{name} = .True. + write_{name} = .False. + else if ({name_ref}.EQ.'Write') then + read_{name} = .False. + write_{name} = .True. + else if ({name_ref}.EQ.'None') then + read_{name} = .False. + write_{name} = .False. + else + print *, '{name_ref} has a bad type' + stop 1 + endif + + END_PROVIDER +""" + return data.format(name=name,name_ref=name_ref) class EZFIO_Provider(object): diff --git a/scripts/ezfio_interface/qp_convert_output_to_ezfio b/scripts/ezfio_interface/qp_convert_output_to_ezfio index 7132380c..3805323b 100755 --- a/scripts/ezfio_interface/qp_convert_output_to_ezfio +++ b/scripts/ezfio_interface/qp_convert_output_to_ezfio @@ -228,8 +228,8 @@ def write_ezfio(res, filename): for i in MOindices: MOs.append(allMOs[i]) - mo_tot_num = len(MOs) - while len(MOindices) < mo_tot_num: + mo_num = len(MOs) + while len(MOindices) < mo_num: MOindices.append(len(MOindices)) MOmap = list(MOindices) @@ -237,7 +237,7 @@ def write_ezfio(res, filename): MOmap[i] = MOindices.index(i) energies = [] - for i in xrange(mo_tot_num): + for i in xrange(mo_num): energies.append(MOs[i].eigenvalue) if res.occ_num is not None: @@ -245,7 +245,7 @@ def write_ezfio(res, filename): for i in MOindices: OccNum.append(res.occ_num[MO_type][i]) - while len(OccNum) < mo_tot_num: + while len(OccNum) < mo_num: OccNum.append(0.) MoMatrix = [] @@ -267,7 +267,7 @@ def write_ezfio(res, filename): # W r i t e # # ~#~#~#~#~ # - ezfio.set_mo_basis_mo_tot_num(mo_tot_num) + ezfio.set_mo_basis_mo_num(mo_num) ezfio.set_mo_basis_mo_occ(OccNum) ezfio.set_mo_basis_mo_coef(MoMatrix) print "OK" diff --git a/scripts/generate_h_apply.py b/scripts/generate_h_apply.py index a5f3049d..3822c71a 100755 --- a/scripts/generate_h_apply.py +++ b/scripts/generate_h_apply.py @@ -89,7 +89,7 @@ class H_apply(object): # !$OMP occ_hole_tmp,key_idx,i_b,j_b,key,N_elec_in_key_part_1,& # !$OMP N_elec_in_key_hole_1,N_elec_in_key_part_2, & # !$OMP N_elec_in_key_hole_2,ia_ja_pairs,key_union_hole_part) & -# !$OMP SHARED(key_in,N_int,elec_num_tab,mo_tot_num, & +# !$OMP SHARED(key_in,N_int,elec_num_tab,mo_num, & # !$OMP hole_1, particl_1, hole_2, particl_2, & # !$OMP elec_alpha_num,i_generator) FIRSTPRIVATE(iproc)""" # s["omp_end_parallel"] = "!$OMP END PARALLEL" @@ -107,7 +107,7 @@ class H_apply(object): s["filter_integrals"] = "array_pairs = .True." if SingleRef: s["filter_integrals"] = """ - call get_mo_bielec_integrals_existing_ik(i_a,j_a,mo_tot_num,array_pairs,mo_integrals_map) + call get_mo_bielec_integrals_existing_ik(i_a,j_a,mo_num,array_pairs,mo_integrals_map) """ s["generate_psi_guess"] = """ diff --git a/scripts/qp_name b/scripts/qp_name new file mode 100755 index 00000000..fb741c7e --- /dev/null +++ b/scripts/qp_name @@ -0,0 +1,102 @@ +#!/usr/bin/env python2 + +""" +Displays the names of all the files in which the provider/subroutine/function +given as argument is used. With the -r flag, the name can be changed in the +whole quantum package. + +Usage: + qp_name [-r | --rename=] + +Options: + -h Prints the help message + -r --rename= Renames the provider / + subroutine / function and all + its occurences + +Note: + It is safe to create a commit before renaming a provider, and then to + check what has changed using git diff. + +""" + + +import re +import sys +import os + + +try: + from docopt import docopt + from qp_path import QP_SRC, QP_ROOT, QP_PLUGINS +except ImportError: + print "source .quantum_package.rc" + raise + + +def main(arguments): + + # Check that name exist in */IRPF90_man + print "Checking that name exists..." + all_modules = os.listdir(QP_SRC) + + f = arguments[""]+".l" + found = False + for mod in all_modules: + if os.path.isdir( os.path.join(QP_SRC,mod,"IRPF90_man") ): + for filename in os.listdir( os.path.join(QP_SRC,mod,"IRPF90_man") ): + if filename == f: + found = True + break + if found: break + + if not found: + print "Error:" + print "The variable/subroutine/function \""+arguments[""] \ + + "\" was not found in the sources." + print "Did you compile the code at the root?" + print "Continue? [y/N] ", + cont = sys.stdin.read(1).strip() in [ "y", "Y" ] + if not cont: + print "Aborted" + sys.exit(1) + + # Now search in all the files + if arguments["--rename"]: + print "Replacing..." + else: + print "Searching..." + + name = re.compile(r"\b"+arguments[""]+r"\b", re.IGNORECASE) + + for mod in all_modules: + dirname = os.path.join(QP_SRC,mod) + if not os.path.isdir(dirname): + continue + + for filename in os.listdir(dirname): + if "." not in filename: + continue + filename = os.path.join(dirname,filename) + if not os.path.isfile(filename): + continue + with open(filename, "r") as f: + f_in = f.read() + if name.search(f_in): + print filename + if arguments["--rename"]: + f_new = name.sub(arguments["--rename"], f_in) + with open(filename, "w") as f: + f.write(f_new) + + print "Done" + + + + + +if __name__ == '__main__': + arguments = docopt(__doc__) + main(arguments) + + diff --git a/scripts/qp_set_frozen_core b/scripts/qp_set_frozen_core index a4633895..16e5820f 100755 --- a/scripts/qp_set_frozen_core +++ b/scripts/qp_set_frozen_core @@ -56,7 +56,7 @@ def main(arguments): else: nb += 5 - mo_tot_num = ezfio.mo_basis_mo_tot_num + mo_num = ezfio.mo_basis_mo_num if arguments["-q"]: print nb @@ -64,10 +64,10 @@ def main(arguments): if nb == 0: os.system( """qp_set_mo_class -act "[1-%d]" %s""" % - (mo_tot_num, sys.argv[1]) ) + (mo_num, sys.argv[1]) ) else: os.system( """qp_set_mo_class -core "[1-%d]" -act "[%d-%d]" %s""" % - (nb, nb+1, mo_tot_num, sys.argv[1]) ) + (nb, nb+1, mo_num, sys.argv[1]) ) diff --git a/scripts/qp_test b/scripts/qp_test index 182ec876..d1e1afde 100755 --- a/scripts/qp_test +++ b/scripts/qp_test @@ -13,6 +13,7 @@ Options: """ +import sys import os import subprocess @@ -22,7 +23,7 @@ try: except ImportError: print "Please check if you have sourced the ${QP_ROOT}/quantum_package.rc" print "(`source ${QP_ROOT}/quantum_package.rc`)" - print sys.exit(1) + sys.exit(1) def main(arguments): diff --git a/src/ao_one_e_integrals/EZFIO.cfg b/src/ao_one_e_integrals/EZFIO.cfg deleted file mode 100644 index 2b3977d1..00000000 --- a/src/ao_one_e_integrals/EZFIO.cfg +++ /dev/null @@ -1,31 +0,0 @@ -[integral_nuclear] -type: double precision -doc: Nucleus-electron integrals in |AO| basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio - -[integral_kinetic] -type: double precision -doc: Kinetic energy integrals in |AO| basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio - -[integral_pseudo] -type: double precision -doc: Pseudopotential integrals in |AO| basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio - -[integral_overlap] -type: double precision -doc: Overlap integrals in |AO| basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio - -[disk_access_ao_one_integrals] -type: Disk_access -doc: Read/Write |AO| one-electron integrals from/to disk [ Write | Read | None ] -interface: ezfio,provider,ocaml -default: None - - diff --git a/src/ao_one_e_integrals/ao_mono_ints.irp.f b/src/ao_one_e_integrals/ao_mono_ints.irp.f deleted file mode 100644 index 3e671941..00000000 --- a/src/ao_one_e_integrals/ao_mono_ints.irp.f +++ /dev/null @@ -1,15 +0,0 @@ - BEGIN_PROVIDER [ double precision, ao_mono_elec_integral,(ao_num,ao_num)] -&BEGIN_PROVIDER [ double precision, ao_mono_elec_integral_diag,(ao_num)] - implicit none - integer :: i,j,n,l - BEGIN_DOC - ! Array of the one-electron Hamiltonian on the |AO| basis. - END_DOC - do j = 1, ao_num - do i = 1, ao_num - ao_mono_elec_integral(i,j) = ao_nucl_elec_integral(i,j) + ao_kinetic_integral(i,j) + ao_pseudo_integral(i,j) - enddo - ao_mono_elec_integral_diag(j) = ao_mono_elec_integral(j,j) - enddo -END_PROVIDER - diff --git a/src/ao_one_e_integrals/read_write.irp.f b/src/ao_one_e_integrals/read_write.irp.f deleted file mode 100644 index 190a40e4..00000000 --- a/src/ao_one_e_integrals/read_write.irp.f +++ /dev/null @@ -1,28 +0,0 @@ - BEGIN_PROVIDER [ logical, read_ao_one_integrals ] -&BEGIN_PROVIDER [ logical, write_ao_one_integrals ] - - BEGIN_DOC - ! If |true|, read/write one-electrons from/to disk. - END_DOC - implicit none - - if (disk_access_ao_one_integrals.EQ.'Read') then - read_ao_one_integrals = .True. - write_ao_one_integrals = .False. - - else if (disk_access_ao_one_integrals.EQ.'Write') then - read_ao_one_integrals = .False. - write_ao_one_integrals = .True. - - else if (disk_access_ao_one_integrals.EQ.'None') then - read_ao_one_integrals = .False. - write_ao_one_integrals = .False. - - else - print *, 'bielec_integrals/disk_access_ao_integrals has a wrong type' - stop 1 - - endif - -END_PROVIDER - diff --git a/src/.gitignore b/src/ao_one_e_ints/.gitignore similarity index 100% rename from src/.gitignore rename to src/ao_one_e_ints/.gitignore diff --git a/src/ao_one_e_ints/EZFIO.cfg b/src/ao_one_e_ints/EZFIO.cfg new file mode 100644 index 00000000..930f7a77 --- /dev/null +++ b/src/ao_one_e_ints/EZFIO.cfg @@ -0,0 +1,64 @@ +[ao_integrals_e_n] +type: double precision +doc: Nucleus-electron integrals in |AO| basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio + +[io_ao_integrals_e_n] +type: Disk_access +doc: Read/Write |AO| nucleus-electron attraction integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + + +[ao_integrals_kinetic] +type: double precision +doc: Kinetic energy integrals in |AO| basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio + +[io_ao_integrals_kinetic] +type: Disk_access +doc: Read/Write |AO| kinetic integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + + +[ao_integrals_pseudo] +type: double precision +doc: Pseudopotential integrals in |AO| basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio + +[io_ao_integrals_pseudo] +type: Disk_access +doc: Read/Write |AO| pseudopotential integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + + +[ao_integrals_overlap] +type: double precision +doc: Overlap integrals in |AO| basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio + +[io_ao_integrals_overlap] +type: Disk_access +doc: Read/Write |AO| overlap integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + + +[ao_one_e_integrals] +type: double precision +doc: Combined integrals in |AO| basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio + +[io_ao_one_e_integrals] +type: Disk_access +doc: Read/Write |AO| one-electron integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + diff --git a/src/ao_one_e_integrals/NEED b/src/ao_one_e_ints/NEED similarity index 100% rename from src/ao_one_e_integrals/NEED rename to src/ao_one_e_ints/NEED diff --git a/src/ao_one_e_integrals/README.rst b/src/ao_one_e_ints/README.rst similarity index 82% rename from src/ao_one_e_integrals/README.rst rename to src/ao_one_e_ints/README.rst index 8f9f5497..739e7634 100644 --- a/src/ao_one_e_integrals/README.rst +++ b/src/ao_one_e_ints/README.rst @@ -8,7 +8,7 @@ The most important providers for usual quantum-chemistry calculation are: * `ao_kinetic_integral` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_ao_ints.irp.f`) * `ao_nucl_elec_integral` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_ao_ints.irp.f`) -* `ao_mono_elec_integral` which are the the h_core operator integrals on the |AO| basis (see :file:`ao_mono_ints.irp.f`) +* `ao_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`ao_mono_ints.irp.f`) Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_ao.irp.f`. diff --git a/src/ao_one_e_ints/ao_one_e_ints.irp.f b/src/ao_one_e_ints/ao_one_e_ints.irp.f new file mode 100644 index 00000000..f2e19cd4 --- /dev/null +++ b/src/ao_one_e_ints/ao_one_e_ints.irp.f @@ -0,0 +1,29 @@ + BEGIN_PROVIDER [ double precision, ao_one_e_integrals,(ao_num,ao_num)] +&BEGIN_PROVIDER [ double precision, ao_one_e_integrals_diag,(ao_num)] + implicit none + integer :: i,j,n,l + BEGIN_DOC + ! One-electron Hamiltonian in the |AO| basis. + END_DOC + + IF (read_ao_one_e_integrals) THEN + call ezfio_get_ao_one_e_ints_ao_one_e_integrals(ao_one_e_integrals) + ELSE + ao_one_e_integrals = ao_integrals_n_e + ao_kinetic_integrals + + IF (DO_PSEUDO) THEN + ao_one_e_integrals += ao_pseudo_integrals + ENDIF + ENDIF + + DO j = 1, ao_num + ao_one_e_integrals_diag(j) = ao_one_e_integrals(j,j) + ENDDO + + IF (write_ao_one_e_integrals) THEN + call ezfio_set_ao_one_e_ints_ao_one_e_integrals(ao_one_e_integrals) + print *, 'AO one-e integrals written to disk' + ENDIF + +END_PROVIDER + diff --git a/src/ao_one_e_integrals/ao_ortho_canonical.irp.f b/src/ao_one_e_ints/ao_ortho_canonical.irp.f similarity index 100% rename from src/ao_one_e_integrals/ao_ortho_canonical.irp.f rename to src/ao_one_e_ints/ao_ortho_canonical.irp.f diff --git a/src/ao_one_e_integrals/ao_overlap.irp.f b/src/ao_one_e_ints/ao_overlap.irp.f similarity index 96% rename from src/ao_one_e_integrals/ao_overlap.irp.f rename to src/ao_one_e_ints/ao_overlap.irp.f index a9b6ab53..8b6b3a6f 100644 --- a/src/ao_one_e_integrals/ao_overlap.irp.f +++ b/src/ao_one_e_ints/ao_overlap.irp.f @@ -19,8 +19,8 @@ ao_overlap_x = 0.d0 ao_overlap_y = 0.d0 ao_overlap_z = 0.d0 - if (read_ao_one_integrals) then - call ezfio_get_ao_one_e_integrals_integral_overlap(ao_overlap(1:ao_num, 1:ao_num)) + if (read_ao_integrals_overlap) then + call ezfio_get_ao_one_e_ints_ao_integrals_overlap(ao_overlap(1:ao_num, 1:ao_num)) print *, 'AO overlap integrals read from disk' else @@ -63,8 +63,8 @@ enddo !$OMP END PARALLEL DO endif - if (write_ao_one_integrals) then - call ezfio_set_ao_one_e_integrals_integral_overlap(ao_overlap(1:ao_num, 1:ao_num)) + if (write_ao_integrals_overlap) then + call ezfio_set_ao_one_e_ints_ao_integrals_overlap(ao_overlap(1:ao_num, 1:ao_num)) print *, 'AO overlap integrals written to disk' endif diff --git a/src/ao_one_e_integrals/kin_ao_ints.irp.f b/src/ao_one_e_ints/kin_ao_ints.irp.f similarity index 90% rename from src/ao_one_e_integrals/kin_ao_ints.irp.f rename to src/ao_one_e_ints/kin_ao_ints.irp.f index d48d0f95..a136c74f 100644 --- a/src/ao_one_e_integrals/kin_ao_ints.irp.f +++ b/src/ao_one_e_ints/kin_ao_ints.irp.f @@ -117,7 +117,7 @@ END_PROVIDER -BEGIN_PROVIDER [double precision, ao_kinetic_integral, (ao_num,ao_num)] +BEGIN_PROVIDER [double precision, ao_kinetic_integrals, (ao_num,ao_num)] implicit none BEGIN_DOC ! Kinetic energy integrals in the |AO| basis. @@ -126,22 +126,22 @@ BEGIN_PROVIDER [double precision, ao_kinetic_integral, (ao_num,ao_num)] END_DOC integer :: i,j,k,l - if (read_ao_one_integrals) then - call ezfio_get_ao_one_e_integrals_integral_kinetic(ao_kinetic_integral) + if (read_ao_integrals_kinetic) then + call ezfio_get_ao_one_e_ints_ao_integrals_kinetic(ao_kinetic_integrals) print *, 'AO kinetic integrals read from disk' else !$OMP PARALLEL DO DEFAULT(NONE) & !$OMP PRIVATE(i,j) & - !$OMP SHARED(ao_num, ao_kinetic_integral,ao_deriv2_x,ao_deriv2_y,ao_deriv2_z) + !$OMP SHARED(ao_num, ao_kinetic_integrals,ao_deriv2_x,ao_deriv2_y,ao_deriv2_z) do j = 1, ao_num do i = 1, ao_num - ao_kinetic_integral(i,j) = -0.5d0 * (ao_deriv2_x(i,j) + ao_deriv2_y(i,j) + ao_deriv2_z(i,j) ) + ao_kinetic_integrals(i,j) = -0.5d0 * (ao_deriv2_x(i,j) + ao_deriv2_y(i,j) + ao_deriv2_z(i,j) ) enddo enddo !$OMP END PARALLEL DO endif - if (write_ao_one_integrals) then - call ezfio_set_ao_one_e_integrals_integral_kinetic(ao_kinetic_integral) + if (write_ao_integrals_kinetic) then + call ezfio_set_ao_one_e_ints_ao_integrals_kinetic(ao_kinetic_integrals) print *, 'AO kinetic integrals written to disk' endif END_PROVIDER diff --git a/src/ao_one_e_integrals/pot_ao_erf_ints.irp.f b/src/ao_one_e_ints/pot_ao_erf_ints.irp.f similarity index 92% rename from src/ao_one_e_integrals/pot_ao_erf_ints.irp.f rename to src/ao_one_e_ints/pot_ao_erf_ints.irp.f index d95976e4..b572a09e 100644 --- a/src/ao_one_e_integrals/pot_ao_erf_ints.irp.f +++ b/src/ao_one_e_ints/pot_ao_erf_ints.irp.f @@ -103,9 +103,9 @@ double precision function NAI_pol_mult_erf(A_center,B_center,power_A,power_B,alp return endif - ! call give_polynom_mult_center_mono_elec_erf(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in) + ! call give_polynomial_mult_center_one_e_erf(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in) p_new = p_new * p_new - call give_polynom_mult_center_mono_elec_erf_opt(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in,p,p_inv,p_inv_2,p_new,P_center) + call give_polynomial_mult_center_one_e_erf_opt(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in,p,p_inv,p_inv_2,p_new,P_center) if(n_pt_out<0)then @@ -123,7 +123,7 @@ double precision function NAI_pol_mult_erf(A_center,B_center,power_A,power_B,alp end -subroutine give_polynom_mult_center_mono_elec_erf_opt(A_center,B_center,alpha,beta,& +subroutine give_polynomial_mult_center_one_e_erf_opt(A_center,B_center,alpha,beta,& power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in,p,p_inv,p_inv_2,p_new,P_center) BEGIN_DOC ! Returns the explicit polynomial in terms of the $t$ variable of the following polynomial: @@ -176,7 +176,7 @@ subroutine give_polynom_mult_center_mono_elec_erf_opt(A_center,B_center,alpha,be n_pt3 = n_pt_in a_x = power_A(1) b_x = power_B(1) - call I_x1_pol_mult_mono_elec(a_x,b_x,R1x,R1xp,R2x,d1,n_pt1,n_pt_in) + call I_x1_pol_mult_one_e(a_x,b_x,R1x,R1xp,R2x,d1,n_pt1,n_pt_in) if(n_pt1<0)then n_pt_out = -1 do i = 0,n_pt_in @@ -195,7 +195,7 @@ subroutine give_polynom_mult_center_mono_elec_erf_opt(A_center,B_center,alpha,be !R1xp = (P_x - B_x) - (P_x - C_x) ( t * mu/sqrt(p+mu^2) )^2 a_y = power_A(2) b_y = power_B(2) - call I_x1_pol_mult_mono_elec(a_y,b_y,R1x,R1xp,R2x,d2,n_pt2,n_pt_in) + call I_x1_pol_mult_one_e(a_y,b_y,R1x,R1xp,R2x,d2,n_pt2,n_pt_in) if(n_pt2<0)then n_pt_out = -1 do i = 0,n_pt_in @@ -216,7 +216,7 @@ subroutine give_polynom_mult_center_mono_elec_erf_opt(A_center,B_center,alpha,be a_z = power_A(3) b_z = power_B(3) - call I_x1_pol_mult_mono_elec(a_z,b_z,R1x,R1xp,R2x,d3,n_pt3,n_pt_in) + call I_x1_pol_mult_one_e(a_z,b_z,R1x,R1xp,R2x,d3,n_pt3,n_pt_in) if(n_pt3<0)then n_pt_out = -1 do i = 0,n_pt_in @@ -241,7 +241,7 @@ end -subroutine give_polynom_mult_center_mono_elec_erf(A_center,B_center,alpha,beta,& +subroutine give_polynomial_mult_center_one_e_erf(A_center,B_center,alpha,beta,& power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in) BEGIN_DOC ! Returns the explicit polynomial in terms of the $t$ variable of the following polynomial: @@ -302,7 +302,7 @@ subroutine give_polynom_mult_center_mono_elec_erf(A_center,B_center,alpha,beta,& n_pt3 = n_pt_in a_x = power_A(1) b_x = power_B(1) - call I_x1_pol_mult_mono_elec(a_x,b_x,R1x,R1xp,R2x,d1,n_pt1,n_pt_in) + call I_x1_pol_mult_one_e(a_x,b_x,R1x,R1xp,R2x,d1,n_pt1,n_pt_in) ! print*,'passed the first I_x1' if(n_pt1<0)then n_pt_out = -1 @@ -322,7 +322,7 @@ subroutine give_polynom_mult_center_mono_elec_erf(A_center,B_center,alpha,beta,& !R1xp = (P_x - B_x) - (P_x - C_x) ( t * mu/sqrt(p+mu^2) )^2 a_y = power_A(2) b_y = power_B(2) - call I_x1_pol_mult_mono_elec(a_y,b_y,R1x,R1xp,R2x,d2,n_pt2,n_pt_in) + call I_x1_pol_mult_one_e(a_y,b_y,R1x,R1xp,R2x,d2,n_pt2,n_pt_in) ! print*,'passed the second I_x1' if(n_pt2<0)then n_pt_out = -1 @@ -346,7 +346,7 @@ subroutine give_polynom_mult_center_mono_elec_erf(A_center,B_center,alpha,beta,& ! print*,'a_z = ',a_z ! print*,'b_z = ',b_z - call I_x1_pol_mult_mono_elec(a_z,b_z,R1x,R1xp,R2x,d3,n_pt3,n_pt_in) + call I_x1_pol_mult_one_e(a_z,b_z,R1x,R1xp,R2x,d3,n_pt3,n_pt_in) ! print*,'passed the third I_x1' if(n_pt3<0)then n_pt_out = -1 diff --git a/src/ao_one_e_integrals/pot_ao_ints.irp.f b/src/ao_one_e_ints/pot_ao_ints.irp.f similarity index 89% rename from src/ao_one_e_integrals/pot_ao_ints.irp.f rename to src/ao_one_e_ints/pot_ao_ints.irp.f index 34e046ae..88c975a3 100644 --- a/src/ao_one_e_integrals/pot_ao_ints.irp.f +++ b/src/ao_one_e_ints/pot_ao_ints.irp.f @@ -1,4 +1,4 @@ -BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num,ao_num)] +BEGIN_PROVIDER [ double precision, ao_integrals_n_e, (ao_num,ao_num)] BEGIN_DOC ! Nucleus-electron interaction, in the |AO| basis set. ! @@ -12,12 +12,12 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num,ao_num)] integer :: i,j,k,l,n_pt_in,m double precision :: overlap_x,overlap_y,overlap_z,overlap,dx,NAI_pol_mult - if (read_ao_one_integrals) then - call ezfio_get_ao_one_e_integrals_integral_nuclear(ao_nucl_elec_integral) + if (read_ao_integrals_e_n) then + call ezfio_get_ao_one_e_ints_ao_integrals_e_n(ao_integrals_n_e) print *, 'AO N-e integrals read from disk' else - ao_nucl_elec_integral = 0.d0 + ao_integrals_n_e = 0.d0 ! _ ! /| / |_) @@ -29,7 +29,7 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num,ao_num)] !$OMP PRIVATE (i,j,k,l,m,alpha,beta,A_center,B_center,C_center,power_A,power_B,& !$OMP num_A,num_B,Z,c,n_pt_in) & !$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,& - !$OMP n_pt_max_integrals,ao_nucl_elec_integral,nucl_num,nucl_charge) + !$OMP n_pt_max_integrals,ao_integrals_n_e,nucl_num,nucl_charge) n_pt_in = n_pt_max_integrals @@ -65,7 +65,7 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num,ao_num)] power_A,power_B,alpha,beta,C_center,n_pt_in) enddo - ao_nucl_elec_integral(i,j) = ao_nucl_elec_integral(i,j) & + ao_integrals_n_e(i,j) = ao_integrals_n_e(i,j) & + ao_coef_normalized_ordered_transp(l,j) & * ao_coef_normalized_ordered_transp(m,i) * c enddo @@ -76,14 +76,14 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num,ao_num)] !$OMP END DO !$OMP END PARALLEL endif - if (write_ao_one_integrals) then - call ezfio_set_ao_one_e_integrals_integral_nuclear(ao_nucl_elec_integral) + if (write_ao_integrals_e_n) then + call ezfio_set_ao_one_e_ints_ao_integrals_e_n(ao_integrals_n_e) print *, 'AO N-e integrals written to disk' endif END_PROVIDER -BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral_per_atom, (ao_num,ao_num,nucl_num)] +BEGIN_PROVIDER [ double precision, ao_integrals_n_e_per_atom, (ao_num,ao_num,nucl_num)] BEGIN_DOC ! Nucleus-electron interaction in the |AO| basis set, per atom A. ! @@ -97,14 +97,14 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral_per_atom, (ao_num,ao_nu integer :: i,j,k,l,n_pt_in,m double precision :: overlap_x,overlap_y,overlap_z,overlap,dx,NAI_pol_mult - ao_nucl_elec_integral_per_atom = 0.d0 + ao_integrals_n_e_per_atom = 0.d0 !$OMP PARALLEL & !$OMP DEFAULT (NONE) & !$OMP PRIVATE (i,j,k,l,m,alpha,beta,A_center,B_center,power_A,power_B,& !$OMP num_A,num_B,c,n_pt_in,C_center) & !$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,& - !$OMP n_pt_max_integrals,ao_nucl_elec_integral_per_atom,nucl_num) + !$OMP n_pt_max_integrals,ao_integrals_n_e_per_atom,nucl_num) n_pt_in = n_pt_max_integrals !$OMP DO SCHEDULE (dynamic) @@ -140,7 +140,7 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral_per_atom, (ao_num,ao_nu * ao_coef_normalized_ordered_transp(m,i) enddo enddo - ao_nucl_elec_integral_per_atom(i,j,k) = -c + ao_integrals_n_e_per_atom(i,j,k) = -c enddo enddo enddo @@ -214,7 +214,7 @@ double precision function NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,b return endif - call give_polynom_mult_center_mono_elec(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out) + call give_polynomial_mult_center_one_e(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out) if(n_pt_out<0)then @@ -234,7 +234,7 @@ double precision function NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,b end -subroutine give_polynom_mult_center_mono_elec(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out) +subroutine give_polynomial_mult_center_one_e(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out) implicit none BEGIN_DOC ! Returns the explicit polynomial in terms of the "t" variable of the following @@ -295,7 +295,7 @@ subroutine give_polynom_mult_center_mono_elec(A_center,B_center,alpha,beta,power n_pt3 = n_pt_in a_x = power_A(1) b_x = power_B(1) - call I_x1_pol_mult_mono_elec(a_x,b_x,R1x,R1xp,R2x,d1,n_pt1,n_pt_in) + call I_x1_pol_mult_one_e(a_x,b_x,R1x,R1xp,R2x,d1,n_pt1,n_pt_in) if(n_pt1<0)then n_pt_out = -1 @@ -315,7 +315,7 @@ subroutine give_polynom_mult_center_mono_elec(A_center,B_center,alpha,beta,power a_y = power_A(2) b_y = power_B(2) - call I_x1_pol_mult_mono_elec(a_y,b_y,R1x,R1xp,R2x,d2,n_pt2,n_pt_in) + call I_x1_pol_mult_one_e(a_y,b_y,R1x,R1xp,R2x,d2,n_pt2,n_pt_in) if(n_pt2<0)then n_pt_out = -1 @@ -337,7 +337,7 @@ subroutine give_polynom_mult_center_mono_elec(A_center,B_center,alpha,beta,power a_z = power_A(3) b_z = power_B(3) - call I_x1_pol_mult_mono_elec(a_z,b_z,R1x,R1xp,R2x,d3,n_pt3,n_pt_in) + call I_x1_pol_mult_one_e(a_z,b_z,R1x,R1xp,R2x,d3,n_pt3,n_pt_in) if(n_pt3<0)then n_pt_out = -1 @@ -361,7 +361,7 @@ subroutine give_polynom_mult_center_mono_elec(A_center,B_center,alpha,beta,power end -recursive subroutine I_x1_pol_mult_mono_elec(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) +recursive subroutine I_x1_pol_mult_one_e(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) implicit none BEGIN_DOC ! Recursive routine involved in the electron-nucleus potential @@ -388,20 +388,20 @@ recursive subroutine I_x1_pol_mult_mono_elec(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) nd = -1 return else if ((a==0).and.(c.ne.0)) then - call I_x2_pol_mult_mono_elec(c,R1x,R1xp,R2x,d,nd,n_pt_in) + call I_x2_pol_mult_one_e(c,R1x,R1xp,R2x,d,nd,n_pt_in) else if (a==1) then nx = nd do ix=0,n_pt_in X(ix) = 0.d0 Y(ix) = 0.d0 enddo - call I_x2_pol_mult_mono_elec(c-1,R1x,R1xp,R2x,X,nx,n_pt_in) + call I_x2_pol_mult_one_e(c-1,R1x,R1xp,R2x,X,nx,n_pt_in) do ix=0,nx X(ix) *= dble(c) enddo call multiply_poly(X,nx,R2x,2,d,nd) ny=0 - call I_x2_pol_mult_mono_elec(c,R1x,R1xp,R2x,Y,ny,n_pt_in) + call I_x2_pol_mult_one_e(c,R1x,R1xp,R2x,Y,ny,n_pt_in) call multiply_poly(Y,ny,R1x,2,d,nd) else do ix=0,n_pt_in @@ -409,7 +409,7 @@ recursive subroutine I_x1_pol_mult_mono_elec(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) Y(ix) = 0.d0 enddo nx = 0 - call I_x1_pol_mult_mono_elec(a-2,c,R1x,R1xp,R2x,X,nx,n_pt_in) + call I_x1_pol_mult_one_e(a-2,c,R1x,R1xp,R2x,X,nx,n_pt_in) do ix=0,nx X(ix) *= dble(a-1) enddo @@ -419,18 +419,18 @@ recursive subroutine I_x1_pol_mult_mono_elec(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) do ix=0,n_pt_in X(ix) = 0.d0 enddo - call I_x1_pol_mult_mono_elec(a-1,c-1,R1x,R1xp,R2x,X,nx,n_pt_in) + call I_x1_pol_mult_one_e(a-1,c-1,R1x,R1xp,R2x,X,nx,n_pt_in) do ix=0,nx X(ix) *= dble(c) enddo call multiply_poly(X,nx,R2x,2,d,nd) ny=0 - call I_x1_pol_mult_mono_elec(a-1,c,R1x,R1xp,R2x,Y,ny,n_pt_in) + call I_x1_pol_mult_one_e(a-1,c,R1x,R1xp,R2x,Y,ny,n_pt_in) call multiply_poly(Y,ny,R1x,2,d,nd) endif end -recursive subroutine I_x2_pol_mult_mono_elec(c,R1x,R1xp,R2x,d,nd,dim) +recursive subroutine I_x2_pol_mult_one_e(c,R1x,R1xp,R2x,d,nd,dim) implicit none BEGIN_DOC ! Recursive routine involved in the electron-nucleus potential @@ -459,7 +459,7 @@ recursive subroutine I_x2_pol_mult_mono_elec(c,R1x,R1xp,R2x,d,nd,dim) Y(ix) = 0.d0 enddo nx = 0 - call I_x1_pol_mult_mono_elec(0,c-2,R1x,R1xp,R2x,X,nx,dim) + call I_x1_pol_mult_one_e(0,c-2,R1x,R1xp,R2x,X,nx,dim) do ix=0,nx X(ix) *= dble(c-1) enddo @@ -469,7 +469,7 @@ recursive subroutine I_x2_pol_mult_mono_elec(c,R1x,R1xp,R2x,d,nd,dim) Y(ix) = 0.d0 enddo - call I_x1_pol_mult_mono_elec(0,c-1,R1x,R1xp,R2x,Y,ny,dim) + call I_x1_pol_mult_one_e(0,c-1,R1x,R1xp,R2x,Y,ny,dim) if(ny.ge.0)then call multiply_poly(Y,ny,R1xp,2,d,nd) endif diff --git a/src/ao_one_e_integrals/pot_ao_pseudo_ints.irp.f b/src/ao_one_e_ints/pot_ao_pseudo_ints.irp.f similarity index 88% rename from src/ao_one_e_integrals/pot_ao_pseudo_ints.irp.f rename to src/ao_one_e_ints/pot_ao_pseudo_ints.irp.f index 382a47b0..a317b6d3 100644 --- a/src/ao_one_e_integrals/pot_ao_pseudo_ints.irp.f +++ b/src/ao_one_e_ints/pot_ao_pseudo_ints.irp.f @@ -1,33 +1,33 @@ -BEGIN_PROVIDER [ double precision, ao_pseudo_integral, (ao_num,ao_num)] +BEGIN_PROVIDER [ double precision, ao_pseudo_integrals, (ao_num,ao_num)] implicit none BEGIN_DOC ! Pseudo-potential integrals in the |AO| basis set. END_DOC - if (read_ao_one_integrals) then - call ezfio_get_ao_one_e_integrals_integral_pseudo(ao_pseudo_integral) + if (read_ao_integrals_pseudo) then + call ezfio_get_ao_one_e_ints_ao_integrals_pseudo(ao_pseudo_integrals) print *, 'AO pseudopotential integrals read from disk' else - ao_pseudo_integral = 0.d0 + ao_pseudo_integrals = 0.d0 if (do_pseudo) then if (pseudo_klocmax > 0) then - ao_pseudo_integral += ao_pseudo_integral_local + ao_pseudo_integrals += ao_pseudo_integrals_local endif if (pseudo_kmax > 0) then - ao_pseudo_integral += ao_pseudo_integral_non_local + ao_pseudo_integrals += ao_pseudo_integrals_non_local endif endif endif - if (write_ao_one_integrals) then - call ezfio_set_ao_one_e_integrals_integral_pseudo(ao_pseudo_integral) + if (write_ao_integrals_pseudo) then + call ezfio_set_ao_one_e_ints_ao_integrals_pseudo(ao_pseudo_integrals) print *, 'AO pseudopotential integrals written to disk' endif END_PROVIDER -BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] +BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)] implicit none BEGIN_DOC ! Local pseudo-potential @@ -44,7 +44,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] integer :: thread_num integer :: omp_get_thread_num - ao_pseudo_integral_local = 0.d0 + ao_pseudo_integrals_local = 0.d0 print*, 'Providing the nuclear electron pseudo integrals (local)' @@ -59,7 +59,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] !$OMP num_A,num_B,Z,c,n_pt_in, & !$OMP wall_0,wall_2,thread_num) & !$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,& - !$OMP ao_pseudo_integral_local,nucl_num,nucl_charge, & + !$OMP ao_pseudo_integrals_local,nucl_num,nucl_charge, & !$OMP pseudo_klocmax,pseudo_lmax,pseudo_kmax,pseudo_v_k_transp,pseudo_n_k_transp, pseudo_dz_k_transp,& !$OMP wall_1) @@ -105,7 +105,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] A_center,power_A,alpha,B_center,power_B,beta,C_center) enddo - ao_pseudo_integral_local(i,j) = ao_pseudo_integral_local(i,j) +& + ao_pseudo_integrals_local(i,j) = ao_pseudo_integrals_local(i,j) +& ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i)*c enddo enddo @@ -127,7 +127,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] END_PROVIDER - BEGIN_PROVIDER [ double precision, ao_pseudo_integral_non_local, (ao_num,ao_num)] + BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_non_local, (ao_num,ao_num)] implicit none BEGIN_DOC ! Non-local pseudo-potential @@ -144,7 +144,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] double precision :: cpu_1, cpu_2, wall_1, wall_2, wall_0 integer :: thread_num - ao_pseudo_integral_non_local = 0.d0 + ao_pseudo_integrals_non_local = 0.d0 print*, 'Providing the nuclear electron pseudo integrals (non-local)' @@ -158,7 +158,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] !$OMP num_A,num_B,Z,c,n_pt_in, & !$OMP wall_0,wall_2,thread_num) & !$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,& - !$OMP ao_pseudo_integral_non_local,nucl_num,nucl_charge,& + !$OMP ao_pseudo_integrals_non_local,nucl_num,nucl_charge,& !$OMP pseudo_klocmax,pseudo_lmax,pseudo_kmax,pseudo_n_kl_transp, pseudo_v_kl_transp, pseudo_dz_kl_transp,& !$OMP wall_1) @@ -204,7 +204,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num,ao_num)] pseudo_dz_kl_transp(1,0,k), & A_center,power_A,alpha,B_center,power_B,beta,C_center) enddo - ao_pseudo_integral_non_local(i,j) = ao_pseudo_integral_non_local(i,j) +& + ao_pseudo_integrals_non_local(i,j) = ao_pseudo_integrals_non_local(i,j) +& ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i)*c enddo enddo diff --git a/src/ao_one_e_integrals/pseudopot.f90 b/src/ao_one_e_ints/pseudopot.f90 similarity index 100% rename from src/ao_one_e_integrals/pseudopot.f90 rename to src/ao_one_e_ints/pseudopot.f90 diff --git a/src/ao_one_e_integrals/spread_dipole_ao.irp.f b/src/ao_one_e_ints/spread_dipole_ao.irp.f similarity index 100% rename from src/ao_one_e_integrals/spread_dipole_ao.irp.f rename to src/ao_one_e_ints/spread_dipole_ao.irp.f diff --git a/src/ao_two_e_erf_integrals/NEED b/src/ao_two_e_erf_integrals/NEED deleted file mode 100644 index 842a7f5d..00000000 --- a/src/ao_two_e_erf_integrals/NEED +++ /dev/null @@ -1 +0,0 @@ -ao_two_e_integrals diff --git a/src/ao_two_e_erf_integrals/read_write_erf.irp.f b/src/ao_two_e_erf_integrals/read_write_erf.irp.f deleted file mode 100644 index 5e3e5361..00000000 --- a/src/ao_two_e_erf_integrals/read_write_erf.irp.f +++ /dev/null @@ -1,27 +0,0 @@ - BEGIN_PROVIDER [ logical, read_ao_integrals_erf ] -&BEGIN_PROVIDER [ logical, write_ao_integrals_erf ] - implicit none - - BEGIN_DOC - ! Flag to read or write the |AO| erf integrals - END_DOC - - if (disk_access_ao_integrals_erf.EQ.'Read') then - read_ao_integrals_erf = .True. - write_ao_integrals_erf = .False. - - else if (disk_access_ao_integrals_erf.EQ.'Write') then - read_ao_integrals_erf = .False. - write_ao_integrals_erf = .True. - - else if (disk_access_ao_integrals_erf.EQ.'None') then - read_ao_integrals_erf = .False. - write_ao_integrals_erf = .False. - - else - print *, 'disk_access_ao_integrals_erf has a wrong type' - stop 1 - - endif - -END_PROVIDER diff --git a/src/ao_two_e_erf_integrals/EZFIO.cfg b/src/ao_two_e_erf_ints/EZFIO.cfg similarity index 91% rename from src/ao_two_e_erf_integrals/EZFIO.cfg rename to src/ao_two_e_erf_ints/EZFIO.cfg index 2df5c2ff..0af0e1d8 100644 --- a/src/ao_two_e_erf_integrals/EZFIO.cfg +++ b/src/ao_two_e_erf_ints/EZFIO.cfg @@ -1,4 +1,4 @@ -[disk_access_ao_integrals_erf] +[io_ao_two_e_integrals_erf] type: Disk_access doc: Read/Write |AO| integrals with the long range interaction from/to disk [ Write | Read | None ] interface: ezfio,provider,ocaml diff --git a/src/ao_two_e_erf_ints/NEED b/src/ao_two_e_erf_ints/NEED new file mode 100644 index 00000000..b30cc39d --- /dev/null +++ b/src/ao_two_e_erf_ints/NEED @@ -0,0 +1 @@ +ao_two_e_ints diff --git a/src/ao_two_e_erf_integrals/README.rst b/src/ao_two_e_erf_ints/README.rst similarity index 63% rename from src/ao_two_e_erf_integrals/README.rst rename to src/ao_two_e_erf_ints/README.rst index cf50e17b..68e785b0 100644 --- a/src/ao_two_e_erf_integrals/README.rst +++ b/src/ao_two_e_erf_ints/README.rst @@ -1,15 +1,15 @@ ====================== -ao_two_e_erf_integrals +ao_two_e_erf_ints ====================== Here, all two-electron integrals (:math:`erf(\mu r_{12})/r_{12}`) are computed. As they have 4 indices and many are zero, they are stored in a map, as defined in :file:`utils/map_module.f90`. -The main parameter of this module is :option:`ao_two_e_erf_integrals mu_erf` which is the range-separation parameter. +The main parameter of this module is :option:`ao_two_e_erf_ints mu_erf` which is the range-separation parameter. To fetch an |AO| integral, use the -`get_ao_bielec_integral_erf(i,j,k,l,ao_integrals_erf_map)` function. +`get_ao_two_e_integral_erf(i,j,k,l,ao_integrals_erf_map)` function. The conventions are: diff --git a/src/ao_two_e_erf_integrals/integrals_erf_in_map_slave.irp.f b/src/ao_two_e_erf_ints/integrals_erf_in_map_slave.irp.f similarity index 93% rename from src/ao_two_e_erf_integrals/integrals_erf_in_map_slave.irp.f rename to src/ao_two_e_erf_ints/integrals_erf_in_map_slave.irp.f index 74d41f40..1d7b723d 100644 --- a/src/ao_two_e_erf_integrals/integrals_erf_in_map_slave.irp.f +++ b/src/ao_two_e_erf_ints/integrals_erf_in_map_slave.irp.f @@ -1,27 +1,27 @@ -subroutine ao_bielec_integrals_erf_in_map_slave_tcp(i) +subroutine ao_two_e_integrals_erf_in_map_slave_tcp(i) implicit none integer, intent(in) :: i BEGIN_DOC ! Computes a buffer of integrals. i is the ID of the current thread. END_DOC - call ao_bielec_integrals_erf_in_map_slave(0,i) + call ao_two_e_integrals_erf_in_map_slave(0,i) end -subroutine ao_bielec_integrals_erf_in_map_slave_inproc(i) +subroutine ao_two_e_integrals_erf_in_map_slave_inproc(i) implicit none integer, intent(in) :: i BEGIN_DOC ! Computes a buffer of integrals. i is the ID of the current thread. END_DOC - call ao_bielec_integrals_erf_in_map_slave(1,i) + call ao_two_e_integrals_erf_in_map_slave(1,i) end -subroutine ao_bielec_integrals_erf_in_map_slave(thread,iproc) +subroutine ao_two_e_integrals_erf_in_map_slave(thread,iproc) use map_module use f77_zmq implicit none @@ -86,7 +86,7 @@ subroutine ao_bielec_integrals_erf_in_map_slave(thread,iproc) end -subroutine ao_bielec_integrals_erf_in_map_collector(zmq_socket_pull) +subroutine ao_two_e_integrals_erf_in_map_collector(zmq_socket_pull) use map_module use f77_zmq implicit none diff --git a/src/ao_two_e_erf_integrals/map_integrals_erf.irp.f b/src/ao_two_e_erf_ints/map_integrals_erf.irp.f similarity index 87% rename from src/ao_two_e_erf_integrals/map_integrals_erf.irp.f rename to src/ao_two_e_erf_ints/map_integrals_erf.irp.f index c92b5676..4648656d 100644 --- a/src/ao_two_e_erf_integrals/map_integrals_erf.irp.f +++ b/src/ao_two_e_erf_ints/map_integrals_erf.irp.f @@ -10,7 +10,7 @@ BEGIN_PROVIDER [ type(map_type), ao_integrals_erf_map ] END_DOC integer(key_kind) :: key_max integer(map_size_kind) :: sze - call bielec_integrals_index(ao_num,ao_num,ao_num,ao_num,key_max) + call two_e_integrals_index(ao_num,ao_num,ao_num,ao_num,key_max) sze = key_max call map_init(ao_integrals_erf_map,sze) print*, 'AO map initialized : ', sze @@ -33,7 +33,7 @@ BEGIN_PROVIDER [ double precision, ao_integrals_erf_cache, (0:64*64*64*64) ] BEGIN_DOC ! Cache of |AO| integrals for fast access END_DOC - PROVIDE ao_bielec_integrals_erf_in_map + PROVIDE ao_two_e_integrals_erf_in_map integer :: i,j,k,l,ii integer(key_kind) :: idx real(integral_kind) :: integral @@ -43,7 +43,7 @@ BEGIN_PROVIDER [ double precision, ao_integrals_erf_cache, (0:64*64*64*64) ] do j=ao_integrals_erf_cache_min,ao_integrals_erf_cache_max do i=ao_integrals_erf_cache_min,ao_integrals_erf_cache_max !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,idx) + call two_e_integrals_index(i,j,k,l,idx) !DIR$ FORCEINLINE call map_get(ao_integrals_erf_map,idx,integral) ii = l-ao_integrals_erf_cache_min @@ -74,7 +74,7 @@ subroutine insert_into_ao_integrals_erf_map(n_integrals,buffer_i, buffer_values) call map_append(ao_integrals_erf_map, buffer_i, buffer_values, n_integrals) end -double precision function get_ao_bielec_integral_erf(i,j,k,l,map) result(result) +double precision function get_ao_two_e_integral_erf(i,j,k,l,map) result(result) use map_module implicit none BEGIN_DOC @@ -85,11 +85,11 @@ double precision function get_ao_bielec_integral_erf(i,j,k,l,map) result(result) type(map_type), intent(inout) :: map integer :: ii real(integral_kind) :: tmp - PROVIDE ao_bielec_integrals_erf_in_map ao_integrals_erf_cache ao_integrals_erf_cache_min + PROVIDE ao_two_e_integrals_erf_in_map ao_integrals_erf_cache ao_integrals_erf_cache_min !DIR$ FORCEINLINE if (ao_overlap_abs(i,k)*ao_overlap_abs(j,l) < ao_integrals_threshold ) then tmp = 0.d0 - else if (ao_bielec_integral_erf_schwartz(i,k)*ao_bielec_integral_erf_schwartz(j,l) < ao_integrals_threshold) then + else if (ao_two_e_integral_erf_schwartz(i,k)*ao_two_e_integral_erf_schwartz(j,l) < ao_integrals_threshold) then tmp = 0.d0 else ii = l-ao_integrals_erf_cache_min @@ -98,7 +98,7 @@ double precision function get_ao_bielec_integral_erf(i,j,k,l,map) result(result) ii = ior(ii, i-ao_integrals_erf_cache_min) if (iand(ii, -64) /= 0) then !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,idx) + call two_e_integrals_index(i,j,k,l,idx) !DIR$ FORCEINLINE call map_get(map,idx,tmp) tmp = tmp @@ -114,7 +114,7 @@ double precision function get_ao_bielec_integral_erf(i,j,k,l,map) result(result) end -subroutine get_ao_bielec_integrals_erf(j,k,l,sze,out_val) +subroutine get_ao_two_e_integrals_erf(j,k,l,sze,out_val) use map_module BEGIN_DOC ! Gets multiple |AO| two-electron integral from the |AO| map . @@ -127,7 +127,7 @@ subroutine get_ao_bielec_integrals_erf(j,k,l,sze,out_val) integer :: i integer(key_kind) :: hash double precision :: thresh - PROVIDE ao_bielec_integrals_erf_in_map ao_integrals_erf_map + PROVIDE ao_two_e_integrals_erf_in_map ao_integrals_erf_map thresh = ao_integrals_threshold if (ao_overlap_abs(j,l) < thresh) then @@ -135,14 +135,14 @@ subroutine get_ao_bielec_integrals_erf(j,k,l,sze,out_val) return endif - double precision :: get_ao_bielec_integral_erf + double precision :: get_ao_two_e_integral_erf do i=1,sze - out_val(i) = get_ao_bielec_integral_erf(i,j,k,l,ao_integrals_erf_map) + out_val(i) = get_ao_two_e_integral_erf(i,j,k,l,ao_integrals_erf_map) enddo end -subroutine get_ao_bielec_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) +subroutine get_ao_two_e_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) use map_module implicit none BEGIN_DOC @@ -156,7 +156,7 @@ subroutine get_ao_bielec_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index, integer :: i integer(key_kind) :: hash double precision :: thresh,tmp - PROVIDE ao_bielec_integrals_erf_in_map + PROVIDE ao_two_e_integrals_erf_in_map thresh = ao_integrals_threshold non_zero_int = 0 @@ -168,12 +168,12 @@ subroutine get_ao_bielec_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index, non_zero_int = 0 do i=1,sze integer, external :: ao_l4 - double precision, external :: ao_bielec_integral_erf + double precision, external :: ao_two_e_integral_erf !DIR$ FORCEINLINE - if (ao_bielec_integral_erf_schwartz(i,k)*ao_bielec_integral_erf_schwartz(j,l) < thresh) then + if (ao_two_e_integral_erf_schwartz(i,k)*ao_two_e_integral_erf_schwartz(j,l) < thresh) then cycle endif - call bielec_integrals_index(i,j,k,l,hash) + call two_e_integrals_index(i,j,k,l,hash) call map_get(ao_integrals_erf_map, hash,tmp) if (dabs(tmp) < thresh ) cycle non_zero_int = non_zero_int+1 diff --git a/src/ao_two_e_erf_integrals/providers_ao_erf.irp.f b/src/ao_two_e_erf_ints/providers_ao_erf.irp.f similarity index 73% rename from src/ao_two_e_erf_integrals/providers_ao_erf.irp.f rename to src/ao_two_e_erf_ints/providers_ao_erf.irp.f index dd7330a6..43d8af60 100644 --- a/src/ao_two_e_erf_integrals/providers_ao_erf.irp.f +++ b/src/ao_two_e_erf_ints/providers_ao_erf.irp.f @@ -1,5 +1,5 @@ -BEGIN_PROVIDER [ logical, ao_bielec_integrals_erf_in_map ] +BEGIN_PROVIDER [ logical, ao_two_e_integrals_erf_in_map ] implicit none use f77_zmq use map_module @@ -9,7 +9,7 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_erf_in_map ] END_DOC integer :: i,j,k,l - double precision :: ao_bielec_integral_erf,cpu_1,cpu_2, wall_1, wall_2 + double precision :: ao_two_e_integral_erf,cpu_1,cpu_2, wall_1, wall_2 double precision :: integral, wall_0 include 'utils/constants.include.F' @@ -22,15 +22,15 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_erf_in_map ] integer :: kk, m, j1, i1, lmax character*(64) :: fmt - integral = ao_bielec_integral_erf(1,1,1,1) + integral = ao_two_e_integral_erf(1,1,1,1) double precision :: map_mb - PROVIDE read_ao_integrals_erf disk_access_ao_integrals_erf - if (read_ao_integrals_erf) then + PROVIDE read_ao_two_e_integrals_erf io_ao_two_e_integrals_erf + if (read_ao_two_e_integrals_erf) then print*,'Reading the AO ERF integrals' call map_load_from_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map) print*, 'AO ERF integrals provided' - ao_bielec_integrals_erf_in_map = .True. + ao_two_e_integrals_erf_in_map = .True. return endif @@ -63,9 +63,9 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_erf_in_map ] !$OMP PARALLEL DEFAULT(shared) private(i) num_threads(nproc+1) i = omp_get_thread_num() if (i==0) then - call ao_bielec_integrals_erf_in_map_collector(zmq_socket_pull) + call ao_two_e_integrals_erf_in_map_collector(zmq_socket_pull) else - call ao_bielec_integrals_erf_in_map_slave_inproc(i) + call ao_two_e_integrals_erf_in_map_slave_inproc(i) endif !$OMP END PARALLEL @@ -85,12 +85,12 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_erf_in_map ] print*, ' cpu time :',cpu_2 - cpu_1, 's' print*, ' wall time :',wall_2 - wall_1, 's ( x ', (cpu_2-cpu_1)/(wall_2-wall_1+tiny(1.d0)), ' )' - ao_bielec_integrals_erf_in_map = .True. + ao_two_e_integrals_erf_in_map = .True. - if (write_ao_integrals_erf) then + if (write_ao_two_e_integrals_erf) then call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map) - call ezfio_set_ao_two_e_erf_integrals_disk_access_ao_integrals_erf("Read") + call ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf("Read") endif END_PROVIDER @@ -98,24 +98,24 @@ END_PROVIDER -BEGIN_PROVIDER [ double precision, ao_bielec_integral_erf_schwartz,(ao_num,ao_num) ] +BEGIN_PROVIDER [ double precision, ao_two_e_integral_erf_schwartz,(ao_num,ao_num) ] implicit none BEGIN_DOC ! Needed to compute Schwartz inequalities END_DOC integer :: i,k - double precision :: ao_bielec_integral_erf,cpu_1,cpu_2, wall_1, wall_2 + double precision :: ao_two_e_integral_erf,cpu_1,cpu_2, wall_1, wall_2 - ao_bielec_integral_erf_schwartz(1,1) = ao_bielec_integral_erf(1,1,1,1) + ao_two_e_integral_erf_schwartz(1,1) = ao_two_e_integral_erf(1,1,1,1) !$OMP PARALLEL DO PRIVATE(i,k) & !$OMP DEFAULT(NONE) & - !$OMP SHARED (ao_num,ao_bielec_integral_erf_schwartz) & + !$OMP SHARED (ao_num,ao_two_e_integral_erf_schwartz) & !$OMP SCHEDULE(dynamic) do i=1,ao_num do k=1,i - ao_bielec_integral_erf_schwartz(i,k) = dsqrt(ao_bielec_integral_erf(i,k,i,k)) - ao_bielec_integral_erf_schwartz(k,i) = ao_bielec_integral_erf_schwartz(i,k) + ao_two_e_integral_erf_schwartz(i,k) = dsqrt(ao_two_e_integral_erf(i,k,i,k)) + ao_two_e_integral_erf_schwartz(k,i) = ao_two_e_integral_erf_schwartz(i,k) enddo enddo !$OMP END PARALLEL DO diff --git a/src/ao_two_e_erf_integrals/routines_save_integrals_erf.irp.f b/src/ao_two_e_erf_ints/routines_save_integrals_erf.irp.f similarity index 51% rename from src/ao_two_e_erf_integrals/routines_save_integrals_erf.irp.f rename to src/ao_two_e_erf_ints/routines_save_integrals_erf.irp.f index a2544cc0..4b0cfad0 100644 --- a/src/ao_two_e_erf_integrals/routines_save_integrals_erf.irp.f +++ b/src/ao_two_e_erf_ints/routines_save_integrals_erf.irp.f @@ -1,18 +1,18 @@ -subroutine save_erf_bi_elec_integrals_ao +subroutine save_erf_two_e_integrals_ao implicit none integer :: i,j,k,l - PROVIDE ao_bielec_integrals_erf_in_map + PROVIDE ao_two_e_integrals_erf_in_map call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map) - call ezfio_set_ao_two_e_erf_integrals_disk_access_ao_integrals_erf('Read') + call ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf('Read') end -subroutine save_erf_bielec_ints_ao_into_ints_ao +subroutine save_erf_two_e_ints_ao_into_ints_ao implicit none integer :: i,j,k,l - PROVIDE ao_bielec_integrals_erf_in_map + PROVIDE ao_two_e_integrals_erf_in_map call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints',ao_integrals_erf_map) - call ezfio_set_ao_two_e_integrals_disk_access_ao_integrals('Read') + call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals('Read') end diff --git a/src/ao_two_e_erf_integrals/two_e_integrals_erf.irp.f b/src/ao_two_e_erf_ints/two_e_integrals_erf.irp.f similarity index 93% rename from src/ao_two_e_erf_integrals/two_e_integrals_erf.irp.f rename to src/ao_two_e_erf_ints/two_e_integrals_erf.irp.f index 84c4b625..730ecf46 100644 --- a/src/ao_two_e_erf_integrals/two_e_integrals_erf.irp.f +++ b/src/ao_two_e_erf_ints/two_e_integrals_erf.irp.f @@ -1,4 +1,4 @@ -double precision function ao_bielec_integral_erf(i,j,k,l) +double precision function ao_two_e_integral_erf(i,j,k,l) implicit none BEGIN_DOC ! integral of the AO basis or (ij|kl) @@ -14,10 +14,10 @@ double precision function ao_bielec_integral_erf(i,j,k,l) double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq integer :: iorder_p(3), iorder_q(3) - double precision :: ao_bielec_integral_schwartz_accel_erf + double precision :: ao_two_e_integral_schwartz_accel_erf if (ao_prim_num(i) * ao_prim_num(j) * ao_prim_num(k) * ao_prim_num(l) > 1024 ) then - ao_bielec_integral_erf = ao_bielec_integral_schwartz_accel_erf(i,j,k,l) + ao_two_e_integral_erf = ao_two_e_integral_schwartz_accel_erf(i,j,k,l) return endif @@ -27,7 +27,7 @@ double precision function ao_bielec_integral_erf(i,j,k,l) num_j = ao_nucl(j) num_k = ao_nucl(k) num_l = ao_nucl(l) - ao_bielec_integral_erf = 0.d0 + ao_two_e_integral_erf = 0.d0 if (num_i /= num_j .or. num_k /= num_l .or. num_j /= num_k)then do p = 1, 3 @@ -64,7 +64,7 @@ double precision function ao_bielec_integral_erf(i,j,k,l) integral = general_primitive_integral_erf(dim1, & P_new,P_center,fact_p,pp,p_inv,iorder_p, & Q_new,Q_center,fact_q,qq,q_inv,iorder_q) - ao_bielec_integral_erf = ao_bielec_integral_erf + coef4 * integral + ao_two_e_integral_erf = ao_two_e_integral_erf + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -93,7 +93,7 @@ double precision function ao_bielec_integral_erf(i,j,k,l) I_power(1),J_power(1),K_power(1),L_power(1), & I_power(2),J_power(2),K_power(2),L_power(2), & I_power(3),J_power(3),K_power(3),L_power(3)) - ao_bielec_integral_erf = ao_bielec_integral_erf + coef4 * integral + ao_two_e_integral_erf = ao_two_e_integral_erf + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -103,7 +103,7 @@ double precision function ao_bielec_integral_erf(i,j,k,l) end -double precision function ao_bielec_integral_schwartz_accel_erf(i,j,k,l) +double precision function ao_two_e_integral_schwartz_accel_erf(i,j,k,l) implicit none BEGIN_DOC ! integral of the AO basis or (ij|kl) @@ -127,7 +127,7 @@ double precision function ao_bielec_integral_schwartz_accel_erf(i,j,k,l) num_j = ao_nucl(j) num_k = ao_nucl(k) num_l = ao_nucl(l) - ao_bielec_integral_schwartz_accel_erf = 0.d0 + ao_two_e_integral_schwartz_accel_erf = 0.d0 double precision :: thr thr = ao_integrals_threshold*ao_integrals_threshold @@ -203,7 +203,7 @@ double precision function ao_bielec_integral_schwartz_accel_erf(i,j,k,l) integral = general_primitive_integral_erf(dim1, & P_new,P_center,fact_p,pp,p_inv,iorder_p, & Q_new,Q_center,fact_q,qq,q_inv,iorder_q) - ao_bielec_integral_schwartz_accel_erf = ao_bielec_integral_schwartz_accel_erf + coef4 * integral + ao_two_e_integral_schwartz_accel_erf = ao_two_e_integral_schwartz_accel_erf + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -263,7 +263,7 @@ double precision function ao_bielec_integral_schwartz_accel_erf(i,j,k,l) I_power(1),J_power(1),K_power(1),L_power(1), & I_power(2),J_power(2),K_power(2),L_power(2), & I_power(3),J_power(3),K_power(3),L_power(3)) - ao_bielec_integral_schwartz_accel_erf = ao_bielec_integral_schwartz_accel_erf + coef4 * integral + ao_two_e_integral_schwartz_accel_erf = ao_two_e_integral_schwartz_accel_erf + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -275,7 +275,7 @@ double precision function ao_bielec_integral_schwartz_accel_erf(i,j,k,l) end -subroutine compute_ao_bielec_integrals_erf(j,k,l,sze,buffer_value) +subroutine compute_ao_two_e_integrals_erf(j,k,l,sze,buffer_value) implicit none use map_module @@ -286,7 +286,7 @@ subroutine compute_ao_bielec_integrals_erf(j,k,l,sze,buffer_value) include 'utils/constants.include.F' integer, intent(in) :: j,k,l,sze real(integral_kind), intent(out) :: buffer_value(sze) - double precision :: ao_bielec_integral_erf + double precision :: ao_two_e_integral_erf integer :: i @@ -294,7 +294,7 @@ subroutine compute_ao_bielec_integrals_erf(j,k,l,sze,buffer_value) buffer_value = 0._integral_kind return endif - if (ao_bielec_integral_erf_schwartz(j,l) < thresh ) then + if (ao_two_e_integral_erf_schwartz(j,l) < thresh ) then buffer_value = 0._integral_kind return endif @@ -304,12 +304,12 @@ subroutine compute_ao_bielec_integrals_erf(j,k,l,sze,buffer_value) buffer_value(i) = 0._integral_kind cycle endif - if (ao_bielec_integral_erf_schwartz(i,k)*ao_bielec_integral_erf_schwartz(j,l) < thresh ) then + if (ao_two_e_integral_erf_schwartz(i,k)*ao_two_e_integral_erf_schwartz(j,l) < thresh ) then buffer_value(i) = 0._integral_kind cycle endif !DIR$ FORCEINLINE - buffer_value(i) = ao_bielec_integral_erf(i,k,j,l) + buffer_value(i) = ao_two_e_integral_erf(i,k,j,l) enddo end @@ -458,7 +458,7 @@ end double precision function ERI_erf(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) implicit none BEGIN_DOC - ! ATOMIC PRIMTIVE bielectronic integral between the 4 primitives :: + ! ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: ! primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) ! primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) ! primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) @@ -608,7 +608,7 @@ subroutine compute_ao_integrals_erf_jl(j,l,n_integrals,buffer_i,buffer_value) real(integral_kind),intent(out) :: buffer_value(ao_num*ao_num) integer :: i,k - double precision :: ao_bielec_integral_erf,cpu_1,cpu_2, wall_1, wall_2 + double precision :: ao_two_e_integral_erf,cpu_1,cpu_2, wall_1, wall_2 double precision :: integral, wall_0 double precision :: thr integer :: kk, m, j1, i1 @@ -631,17 +631,17 @@ subroutine compute_ao_integrals_erf_jl(j,l,n_integrals,buffer_i,buffer_value) if (ao_overlap_abs(i,k)*ao_overlap_abs(j,l) < thr) then cycle endif - if (ao_bielec_integral_erf_schwartz(i,k)*ao_bielec_integral_erf_schwartz(j,l) < thr ) then + if (ao_two_e_integral_erf_schwartz(i,k)*ao_two_e_integral_erf_schwartz(j,l) < thr ) then cycle endif !DIR$ FORCEINLINE - integral = ao_bielec_integral_erf(i,k,j,l) ! i,k : r1 j,l : r2 + integral = ao_two_e_integral_erf(i,k,j,l) ! i,k : r1 j,l : r2 if (abs(integral) < thr) then cycle endif n_integrals += 1 !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,buffer_i(n_integrals)) + call two_e_integrals_index(i,j,k,l,buffer_i(n_integrals)) buffer_value(n_integrals) = integral enddo enddo diff --git a/src/ao_two_e_integrals/read_write.irp.f b/src/ao_two_e_integrals/read_write.irp.f deleted file mode 100644 index 7a98d5a6..00000000 --- a/src/ao_two_e_integrals/read_write.irp.f +++ /dev/null @@ -1,27 +0,0 @@ - BEGIN_PROVIDER [ logical, read_ao_integrals ] -&BEGIN_PROVIDER [ logical, write_ao_integrals ] - - BEGIN_DOC - ! Flag to read or write the |AO| integrals - END_DOC - implicit none - - if (disk_access_ao_integrals.EQ.'Read') then - read_ao_integrals = .True. - write_ao_integrals = .False. - - else if (disk_access_ao_integrals.EQ.'Write') then - read_ao_integrals = .False. - write_ao_integrals = .True. - - else if (disk_access_ao_integrals.EQ.'None') then - read_ao_integrals = .False. - write_ao_integrals = .False. - - else - print *, 'disk_access_ao_integrals has a wrong type' - stop 1 - - endif - -END_PROVIDER diff --git a/src/ao_two_e_integrals/EZFIO.cfg b/src/ao_two_e_ints/EZFIO.cfg similarity index 94% rename from src/ao_two_e_integrals/EZFIO.cfg rename to src/ao_two_e_ints/EZFIO.cfg index 929f06b4..b18c65d1 100644 --- a/src/ao_two_e_integrals/EZFIO.cfg +++ b/src/ao_two_e_ints/EZFIO.cfg @@ -1,4 +1,4 @@ -[disk_access_ao_integrals] +[io_ao_two_e_integrals] type: Disk_access doc: Read/Write |AO| integrals from/to disk [ Write | Read | None ] interface: ezfio,provider,ocaml diff --git a/src/ao_two_e_integrals/NEED b/src/ao_two_e_ints/NEED similarity index 59% rename from src/ao_two_e_integrals/NEED rename to src/ao_two_e_ints/NEED index 23bd2326..ffc5e8be 100644 --- a/src/ao_two_e_integrals/NEED +++ b/src/ao_two_e_ints/NEED @@ -1,4 +1,4 @@ -ao_one_e_integrals +ao_one_e_ints pseudo bitmask zmq diff --git a/src/ao_two_e_integrals/README.rst b/src/ao_two_e_ints/README.rst similarity index 80% rename from src/ao_two_e_integrals/README.rst rename to src/ao_two_e_ints/README.rst index 7c870e2b..fb808a58 100644 --- a/src/ao_two_e_integrals/README.rst +++ b/src/ao_two_e_ints/README.rst @@ -1,5 +1,5 @@ ================== -ao_two_e_integrals +ao_two_e_ints ================== Here, all two-electron integrals (:math:`1/r_{12}`) are computed. @@ -7,7 +7,7 @@ As they have 4 indices and many are zero, they are stored in a map, as defined in :file:`utils/map_module.f90`. To fetch an |AO| integral, use the -`get_ao_bielec_integral(i,j,k,l,ao_integrals_map)` function. +`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function. The conventions are: diff --git a/src/ao_two_e_integrals/gauss_legendre.irp.f b/src/ao_two_e_ints/gauss_legendre.irp.f similarity index 100% rename from src/ao_two_e_integrals/gauss_legendre.irp.f rename to src/ao_two_e_ints/gauss_legendre.irp.f diff --git a/src/ao_two_e_integrals/integrals_in_map_slave.irp.f b/src/ao_two_e_ints/integrals_in_map_slave.irp.f similarity index 95% rename from src/ao_two_e_integrals/integrals_in_map_slave.irp.f rename to src/ao_two_e_ints/integrals_in_map_slave.irp.f index 4b915963..3c1c3d1e 100644 --- a/src/ao_two_e_integrals/integrals_in_map_slave.irp.f +++ b/src/ao_two_e_ints/integrals_in_map_slave.irp.f @@ -1,20 +1,20 @@ -subroutine ao_bielec_integrals_in_map_slave_tcp(i) +subroutine ao_two_e_integrals_in_map_slave_tcp(i) implicit none integer, intent(in) :: i BEGIN_DOC ! Computes a buffer of integrals. i is the ID of the current thread. END_DOC - call ao_bielec_integrals_in_map_slave(0,i) + call ao_two_e_integrals_in_map_slave(0,i) end -subroutine ao_bielec_integrals_in_map_slave_inproc(i) +subroutine ao_two_e_integrals_in_map_slave_inproc(i) implicit none integer, intent(in) :: i BEGIN_DOC ! Computes a buffer of integrals. i is the ID of the current thread. END_DOC - call ao_bielec_integrals_in_map_slave(1,i) + call ao_two_e_integrals_in_map_slave(1,i) end @@ -71,7 +71,7 @@ end -subroutine ao_bielec_integrals_in_map_slave(thread,iproc) +subroutine ao_two_e_integrals_in_map_slave(thread,iproc) use map_module use f77_zmq implicit none @@ -136,7 +136,7 @@ subroutine ao_bielec_integrals_in_map_slave(thread,iproc) end -subroutine ao_bielec_integrals_in_map_collector(zmq_socket_pull) +subroutine ao_two_e_integrals_in_map_collector(zmq_socket_pull) use map_module use f77_zmq implicit none diff --git a/src/ao_two_e_integrals/map_integrals.irp.f b/src/ao_two_e_ints/map_integrals.irp.f similarity index 88% rename from src/ao_two_e_integrals/map_integrals.irp.f rename to src/ao_two_e_ints/map_integrals.irp.f index d29d0302..a21df6b2 100644 --- a/src/ao_two_e_integrals/map_integrals.irp.f +++ b/src/ao_two_e_ints/map_integrals.irp.f @@ -10,13 +10,13 @@ BEGIN_PROVIDER [ type(map_type), ao_integrals_map ] END_DOC integer(key_kind) :: key_max integer(map_size_kind) :: sze - call bielec_integrals_index(ao_num,ao_num,ao_num,ao_num,key_max) + call two_e_integrals_index(ao_num,ao_num,ao_num,ao_num,key_max) sze = key_max call map_init(ao_integrals_map,sze) print*, 'AO map initialized : ', sze END_PROVIDER -subroutine bielec_integrals_index(i,j,k,l,i1) +subroutine two_e_integrals_index(i,j,k,l,i1) use map_module implicit none integer, intent(in) :: i,j,k,l @@ -33,7 +33,7 @@ subroutine bielec_integrals_index(i,j,k,l,i1) i1 = i1+shiftr(i2*i2-i2,1) end -subroutine bielec_integrals_index_reverse(i,j,k,l,i1) +subroutine two_e_integrals_index_reverse(i,j,k,l,i1) use map_module implicit none integer, intent(out) :: i(8),j(8),k(8),l(8) @@ -97,11 +97,11 @@ subroutine bielec_integrals_index_reverse(i,j,k,l,i1) enddo do ii=1,8 if (i(ii) /= 0) then - call bielec_integrals_index(i(ii),j(ii),k(ii),l(ii),i2) + call two_e_integrals_index(i(ii),j(ii),k(ii),l(ii),i2) if (i1 /= i2) then print *, i1, i2 print *, i(ii), j(ii), k(ii), l(ii) - stop 'bielec_integrals_index_reverse failed' + stop 'two_e_integrals_index_reverse failed' endif endif enddo @@ -125,7 +125,7 @@ BEGIN_PROVIDER [ double precision, ao_integrals_cache, (0:64*64*64*64) ] BEGIN_DOC ! Cache of AO integrals for fast access END_DOC - PROVIDE ao_bielec_integrals_in_map + PROVIDE ao_two_e_integrals_in_map integer :: i,j,k,l,ii integer(key_kind) :: idx real(integral_kind) :: integral @@ -135,7 +135,7 @@ BEGIN_PROVIDER [ double precision, ao_integrals_cache, (0:64*64*64*64) ] do j=ao_integrals_cache_min,ao_integrals_cache_max do i=ao_integrals_cache_min,ao_integrals_cache_max !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,idx) + call two_e_integrals_index(i,j,k,l,idx) !DIR$ FORCEINLINE call map_get(ao_integrals_map,idx,integral) ii = l-ao_integrals_cache_min @@ -152,7 +152,7 @@ BEGIN_PROVIDER [ double precision, ao_integrals_cache, (0:64*64*64*64) ] END_PROVIDER -double precision function get_ao_bielec_integral(i,j,k,l,map) result(result) +double precision function get_ao_two_e_integral(i,j,k,l,map) result(result) use map_module implicit none BEGIN_DOC @@ -163,11 +163,11 @@ double precision function get_ao_bielec_integral(i,j,k,l,map) result(result) type(map_type), intent(inout) :: map integer :: ii real(integral_kind) :: tmp - PROVIDE ao_bielec_integrals_in_map ao_integrals_cache ao_integrals_cache_min + PROVIDE ao_two_e_integrals_in_map ao_integrals_cache ao_integrals_cache_min !DIR$ FORCEINLINE if (ao_overlap_abs(i,k)*ao_overlap_abs(j,l) < ao_integrals_threshold ) then tmp = 0.d0 - else if (ao_bielec_integral_schwartz(i,k)*ao_bielec_integral_schwartz(j,l) < ao_integrals_threshold) then + else if (ao_two_e_integral_schwartz(i,k)*ao_two_e_integral_schwartz(j,l) < ao_integrals_threshold) then tmp = 0.d0 else ii = l-ao_integrals_cache_min @@ -176,7 +176,7 @@ double precision function get_ao_bielec_integral(i,j,k,l,map) result(result) ii = ior(ii, i-ao_integrals_cache_min) if (iand(ii, -64) /= 0) then !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,idx) + call two_e_integrals_index(i,j,k,l,idx) !DIR$ FORCEINLINE call map_get(map,idx,tmp) else @@ -191,7 +191,7 @@ double precision function get_ao_bielec_integral(i,j,k,l,map) result(result) end -subroutine get_ao_bielec_integrals(j,k,l,sze,out_val) +subroutine get_ao_two_e_integrals(j,k,l,sze,out_val) use map_module BEGIN_DOC ! Gets multiple AO bi-electronic integral from the AO map . @@ -204,7 +204,7 @@ subroutine get_ao_bielec_integrals(j,k,l,sze,out_val) integer :: i integer(key_kind) :: hash double precision :: thresh - PROVIDE ao_bielec_integrals_in_map ao_integrals_map + PROVIDE ao_two_e_integrals_in_map ao_integrals_map thresh = ao_integrals_threshold if (ao_overlap_abs(j,l) < thresh) then @@ -212,14 +212,14 @@ subroutine get_ao_bielec_integrals(j,k,l,sze,out_val) return endif - double precision :: get_ao_bielec_integral + double precision :: get_ao_two_e_integral do i=1,sze - out_val(i) = get_ao_bielec_integral(i,j,k,l,ao_integrals_map) + out_val(i) = get_ao_two_e_integral(i,j,k,l,ao_integrals_map) enddo end -subroutine get_ao_bielec_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) +subroutine get_ao_two_e_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) use map_module implicit none BEGIN_DOC @@ -233,7 +233,7 @@ subroutine get_ao_bielec_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_ integer :: i integer(key_kind) :: hash double precision :: thresh,tmp - PROVIDE ao_bielec_integrals_in_map + PROVIDE ao_two_e_integrals_in_map thresh = ao_integrals_threshold non_zero_int = 0 @@ -245,12 +245,12 @@ subroutine get_ao_bielec_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_ non_zero_int = 0 do i=1,sze integer, external :: ao_l4 - double precision, external :: ao_bielec_integral + double precision, external :: ao_two_e_integral !DIR$ FORCEINLINE - if (ao_bielec_integral_schwartz(i,k)*ao_bielec_integral_schwartz(j,l) < thresh) then + if (ao_two_e_integral_schwartz(i,k)*ao_two_e_integral_schwartz(j,l) < thresh) then cycle endif - call bielec_integrals_index(i,j,k,l,hash) + call two_e_integrals_index(i,j,k,l,hash) call map_get(ao_integrals_map, hash,tmp) if (dabs(tmp) < thresh ) cycle non_zero_int = non_zero_int+1 diff --git a/src/ao_two_e_integrals/two_e_integrals.irp.f b/src/ao_two_e_ints/two_e_integrals.irp.f similarity index 93% rename from src/ao_two_e_integrals/two_e_integrals.irp.f rename to src/ao_two_e_ints/two_e_integrals.irp.f index 72c96f7f..76a9cdd6 100644 --- a/src/ao_two_e_integrals/two_e_integrals.irp.f +++ b/src/ao_two_e_ints/two_e_integrals.irp.f @@ -1,4 +1,4 @@ -double precision function ao_bielec_integral(i,j,k,l) +double precision function ao_two_e_integral(i,j,k,l) implicit none BEGIN_DOC ! integral of the AO basis or (ij|kl) @@ -14,10 +14,10 @@ double precision function ao_bielec_integral(i,j,k,l) double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq integer :: iorder_p(3), iorder_q(3) - double precision :: ao_bielec_integral_schwartz_accel + double precision :: ao_two_e_integral_schwartz_accel if (ao_prim_num(i) * ao_prim_num(j) * ao_prim_num(k) * ao_prim_num(l) > 1024 ) then - ao_bielec_integral = ao_bielec_integral_schwartz_accel(i,j,k,l) + ao_two_e_integral = ao_two_e_integral_schwartz_accel(i,j,k,l) return endif @@ -27,7 +27,7 @@ double precision function ao_bielec_integral(i,j,k,l) num_j = ao_nucl(j) num_k = ao_nucl(k) num_l = ao_nucl(l) - ao_bielec_integral = 0.d0 + ao_two_e_integral = 0.d0 if (num_i /= num_j .or. num_k /= num_l .or. num_j /= num_k)then do p = 1, 3 @@ -64,7 +64,7 @@ double precision function ao_bielec_integral(i,j,k,l) integral = general_primitive_integral(dim1, & P_new,P_center,fact_p,pp,p_inv,iorder_p, & Q_new,Q_center,fact_q,qq,q_inv,iorder_q) - ao_bielec_integral = ao_bielec_integral + coef4 * integral + ao_two_e_integral = ao_two_e_integral + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -93,7 +93,7 @@ double precision function ao_bielec_integral(i,j,k,l) I_power(1),J_power(1),K_power(1),L_power(1), & I_power(2),J_power(2),K_power(2),L_power(2), & I_power(3),J_power(3),K_power(3),L_power(3)) - ao_bielec_integral = ao_bielec_integral + coef4 * integral + ao_two_e_integral = ao_two_e_integral + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -103,7 +103,7 @@ double precision function ao_bielec_integral(i,j,k,l) end -double precision function ao_bielec_integral_schwartz_accel(i,j,k,l) +double precision function ao_two_e_integral_schwartz_accel(i,j,k,l) implicit none BEGIN_DOC ! integral of the AO basis or (ij|kl) @@ -127,7 +127,7 @@ double precision function ao_bielec_integral_schwartz_accel(i,j,k,l) num_j = ao_nucl(j) num_k = ao_nucl(k) num_l = ao_nucl(l) - ao_bielec_integral_schwartz_accel = 0.d0 + ao_two_e_integral_schwartz_accel = 0.d0 double precision :: thr thr = ao_integrals_threshold*ao_integrals_threshold @@ -203,7 +203,7 @@ double precision function ao_bielec_integral_schwartz_accel(i,j,k,l) integral = general_primitive_integral(dim1, & P_new,P_center,fact_p,pp,p_inv,iorder_p, & Q_new,Q_center,fact_q,qq,q_inv,iorder_q) - ao_bielec_integral_schwartz_accel = ao_bielec_integral_schwartz_accel + coef4 * integral + ao_two_e_integral_schwartz_accel = ao_two_e_integral_schwartz_accel + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -263,7 +263,7 @@ double precision function ao_bielec_integral_schwartz_accel(i,j,k,l) I_power(1),J_power(1),K_power(1),L_power(1), & I_power(2),J_power(2),K_power(2),L_power(2), & I_power(3),J_power(3),K_power(3),L_power(3)) - ao_bielec_integral_schwartz_accel = ao_bielec_integral_schwartz_accel + coef4 * integral + ao_two_e_integral_schwartz_accel = ao_two_e_integral_schwartz_accel + coef4 * integral enddo ! s enddo ! r enddo ! q @@ -286,7 +286,7 @@ end -subroutine compute_ao_bielec_integrals(j,k,l,sze,buffer_value) +subroutine compute_ao_two_e_integrals(j,k,l,sze,buffer_value) implicit none use map_module @@ -297,7 +297,7 @@ subroutine compute_ao_bielec_integrals(j,k,l,sze,buffer_value) include 'utils/constants.include.F' integer, intent(in) :: j,k,l,sze real(integral_kind), intent(out) :: buffer_value(sze) - double precision :: ao_bielec_integral + double precision :: ao_two_e_integral integer :: i @@ -305,7 +305,7 @@ subroutine compute_ao_bielec_integrals(j,k,l,sze,buffer_value) buffer_value = 0._integral_kind return endif - if (ao_bielec_integral_schwartz(j,l) < thresh ) then + if (ao_two_e_integral_schwartz(j,l) < thresh ) then buffer_value = 0._integral_kind return endif @@ -315,17 +315,17 @@ subroutine compute_ao_bielec_integrals(j,k,l,sze,buffer_value) buffer_value(i) = 0._integral_kind cycle endif - if (ao_bielec_integral_schwartz(i,k)*ao_bielec_integral_schwartz(j,l) < thresh ) then + if (ao_two_e_integral_schwartz(i,k)*ao_two_e_integral_schwartz(j,l) < thresh ) then buffer_value(i) = 0._integral_kind cycle endif !DIR$ FORCEINLINE - buffer_value(i) = ao_bielec_integral(i,k,j,l) + buffer_value(i) = ao_two_e_integral(i,k,j,l) enddo end -BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] +BEGIN_PROVIDER [ logical, ao_two_e_integrals_in_map ] implicit none use f77_zmq use map_module @@ -335,7 +335,7 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] END_DOC integer :: i,j,k,l - double precision :: ao_bielec_integral,cpu_1,cpu_2, wall_1, wall_2 + double precision :: ao_two_e_integral,cpu_1,cpu_2, wall_1, wall_2 double precision :: integral, wall_0 include 'utils/constants.include.F' @@ -348,15 +348,15 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] integer :: kk, m, j1, i1, lmax character*(64) :: fmt - integral = ao_bielec_integral(1,1,1,1) + integral = ao_two_e_integral(1,1,1,1) double precision :: map_mb - PROVIDE read_ao_integrals disk_access_ao_integrals - if (read_ao_integrals) then + PROVIDE read_ao_two_e_integrals io_ao_two_e_integrals + if (read_ao_two_e_integrals) then print*,'Reading the AO integrals' call map_load_from_disk(trim(ezfio_filename)//'/work/ao_ints',ao_integrals_map) print*, 'AO integrals provided' - ao_bielec_integrals_in_map = .True. + ao_two_e_integrals_in_map = .True. return endif @@ -389,9 +389,9 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] !$OMP PARALLEL DEFAULT(shared) private(i) num_threads(nproc+1) i = omp_get_thread_num() if (i==0) then - call ao_bielec_integrals_in_map_collector(zmq_socket_pull) + call ao_two_e_integrals_in_map_collector(zmq_socket_pull) else - call ao_bielec_integrals_in_map_slave_inproc(i) + call ao_two_e_integrals_in_map_slave_inproc(i) endif !$OMP END PARALLEL @@ -411,34 +411,34 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] print*, ' cpu time :',cpu_2 - cpu_1, 's' print*, ' wall time :',wall_2 - wall_1, 's ( x ', (cpu_2-cpu_1)/(wall_2-wall_1+tiny(1.d0)), ' )' - ao_bielec_integrals_in_map = .True. + ao_two_e_integrals_in_map = .True. - if (write_ao_integrals.and.mpi_master) then + if (write_ao_two_e_integrals.and.mpi_master) then call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints',ao_integrals_map) - call ezfio_set_ao_two_e_integrals_disk_access_ao_integrals('Read') + call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals('Read') endif END_PROVIDER -BEGIN_PROVIDER [ double precision, ao_bielec_integral_schwartz,(ao_num,ao_num) ] +BEGIN_PROVIDER [ double precision, ao_two_e_integral_schwartz,(ao_num,ao_num) ] implicit none BEGIN_DOC ! Needed to compute Schwartz inequalities END_DOC integer :: i,k - double precision :: ao_bielec_integral,cpu_1,cpu_2, wall_1, wall_2 + double precision :: ao_two_e_integral,cpu_1,cpu_2, wall_1, wall_2 - ao_bielec_integral_schwartz(1,1) = ao_bielec_integral(1,1,1,1) + ao_two_e_integral_schwartz(1,1) = ao_two_e_integral(1,1,1,1) !$OMP PARALLEL DO PRIVATE(i,k) & !$OMP DEFAULT(NONE) & - !$OMP SHARED (ao_num,ao_bielec_integral_schwartz) & + !$OMP SHARED (ao_num,ao_two_e_integral_schwartz) & !$OMP SCHEDULE(dynamic) do i=1,ao_num do k=1,i - ao_bielec_integral_schwartz(i,k) = dsqrt(ao_bielec_integral(i,k,i,k)) - ao_bielec_integral_schwartz(k,i) = ao_bielec_integral_schwartz(i,k) + ao_two_e_integral_schwartz(i,k) = dsqrt(ao_two_e_integral(i,k,i,k)) + ao_two_e_integral_schwartz(k,i) = ao_two_e_integral_schwartz(i,k) enddo enddo !$OMP END PARALLEL DO @@ -1166,7 +1166,7 @@ subroutine compute_ao_integrals_jl(j,l,n_integrals,buffer_i,buffer_value) real(integral_kind),intent(out) :: buffer_value(ao_num*ao_num) integer :: i,k - double precision :: ao_bielec_integral,cpu_1,cpu_2, wall_1, wall_2 + double precision :: ao_two_e_integral,cpu_1,cpu_2, wall_1, wall_2 double precision :: integral, wall_0 double precision :: thr integer :: kk, m, j1, i1 @@ -1189,17 +1189,17 @@ subroutine compute_ao_integrals_jl(j,l,n_integrals,buffer_i,buffer_value) if (ao_overlap_abs(i,k)*ao_overlap_abs(j,l) < thr) then cycle endif - if (ao_bielec_integral_schwartz(i,k)*ao_bielec_integral_schwartz(j,l) < thr ) then + if (ao_two_e_integral_schwartz(i,k)*ao_two_e_integral_schwartz(j,l) < thr ) then cycle endif !DIR$ FORCEINLINE - integral = ao_bielec_integral(i,k,j,l) ! i,k : r1 j,l : r2 + integral = ao_two_e_integral(i,k,j,l) ! i,k : r1 j,l : r2 if (abs(integral) < thr) then cycle endif n_integrals += 1 !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,buffer_i(n_integrals)) + call two_e_integrals_index(i,j,k,l,buffer_i(n_integrals)) buffer_value(n_integrals) = integral enddo enddo diff --git a/src/aux_quantities/EZFIO.cfg b/src/aux_quantities/EZFIO.cfg index 7126f257..e8e86deb 100644 --- a/src/aux_quantities/EZFIO.cfg +++ b/src/aux_quantities/EZFIO.cfg @@ -14,13 +14,13 @@ size: (determinants.n_states) interface: ezfio, provider doc: Alpha one body density matrix on the MO basis computed with the wave function type: double precision -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num,determinants.n_states) +size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states) [data_one_body_beta_dm_mo] interface: ezfio, provider doc: Beta one body density matrix on the MO basis computed with the wave function type: double precision -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num,determinants.n_states) +size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states) diff --git a/src/bitmask/bitmasks.irp.f b/src/bitmask/bitmasks.irp.f index 918b38ed..fdbb6351 100644 --- a/src/bitmask/bitmasks.irp.f +++ b/src/bitmask/bitmasks.irp.f @@ -6,7 +6,7 @@ BEGIN_PROVIDER [ integer, N_int ] BEGIN_DOC ! Number of 64-bit integers needed to represent determinants as binary strings END_DOC - N_int = (mo_tot_num-1)/bit_kind_size + 1 + N_int = (mo_num-1)/bit_kind_size + 1 call write_int(6,N_int, 'N_int') if (N_int > N_int_max) then stop 'N_int > N_int_max' @@ -30,7 +30,7 @@ BEGIN_PROVIDER [ integer(bit_kind), full_ijkl_bitmask, (N_int) ] if (mo_class(k) /= 'Deleted') then full_ijkl_bitmask(j) = ibset(full_ijkl_bitmask(j),i) endif - if (k == mo_tot_num) exit + if (k == mo_num) exit enddo enddo END_PROVIDER @@ -496,8 +496,8 @@ END_PROVIDER BEGIN_PROVIDER [ integer, list_inact, (n_inact_orb)] &BEGIN_PROVIDER [ integer, list_virt, (n_virt_orb)] - &BEGIN_PROVIDER [ integer, list_inact_reverse, (mo_tot_num)] - &BEGIN_PROVIDER [ integer, list_virt_reverse, (mo_tot_num)] + &BEGIN_PROVIDER [ integer, list_inact_reverse, (mo_num)] + &BEGIN_PROVIDER [ integer, list_virt_reverse, (mo_num)] BEGIN_DOC ! list_inact : List of the inactive orbitals which are supposed to be doubly excited ! in post CAS methods @@ -536,7 +536,7 @@ END_PROVIDER BEGIN_PROVIDER [ integer, list_core_inact, (n_core_inact_orb)] -&BEGIN_PROVIDER [ integer, list_core_inact_reverse, (mo_tot_num)] +&BEGIN_PROVIDER [ integer, list_core_inact_reverse, (mo_num)] implicit none integer :: occ_inact(N_int*bit_kind_size) @@ -591,7 +591,7 @@ END_PROVIDER enddo END_PROVIDER BEGIN_PROVIDER [ integer, list_core_inact_act, (n_core_inact_act_orb)] -&BEGIN_PROVIDER [ integer, list_core_inact_act_reverse, (mo_tot_num)] +&BEGIN_PROVIDER [ integer, list_core_inact_act_reverse, (mo_num)] implicit none integer :: occ_inact(N_int*bit_kind_size) integer :: itest,i @@ -636,7 +636,7 @@ END_PROVIDER END_PROVIDER BEGIN_PROVIDER [integer, list_core, (n_core_orb)] -&BEGIN_PROVIDER [integer, list_core_reverse, (mo_tot_num)] +&BEGIN_PROVIDER [integer, list_core_reverse, (mo_num)] BEGIN_DOC ! List of the core orbitals that are never excited in post CAS method END_DOC @@ -705,7 +705,7 @@ BEGIN_PROVIDER [ integer, n_act_orb] END_PROVIDER BEGIN_PROVIDER [integer, list_act, (n_act_orb)] -&BEGIN_PROVIDER [integer, list_act_reverse, (mo_tot_num)] +&BEGIN_PROVIDER [integer, list_act_reverse, (mo_num)] BEGIN_DOC ! list_act(i) = index of the ith active orbital ! diff --git a/src/bitmask/example.irp.f b/src/bitmask/example.irp.f index 7800e556..7ce8bc6d 100644 --- a/src/bitmask/example.irp.f +++ b/src/bitmask/example.irp.f @@ -57,7 +57,7 @@ subroutine example_bitmask integer :: i_orb character*(2048) :: output - do i_orb = 1, min(4,mo_tot_num) ! you set the first four bits to 1 in key + do i_orb = 1, min(4,mo_num) ! you set the first four bits to 1 in key call set_bit_to_integer(i_orb,key,N_int) enddo print*,'print a human readable representation of the bitstring' diff --git a/src/cis/20.cis.bats b/src/cis/20.cis.bats index 0f59c22b..81d2f88e 100644 --- a/src/cis/20.cis.bats +++ b/src/cis/20.cis.bats @@ -9,7 +9,7 @@ function run() { ezfio set_file $1 ezfio set determinants n_states 3 ezfio set davidson threshold_davidson 1.e-12 - echo "Write" > $1/mo_two_e_integrals/disk_access_mo_integrals + ezfio set mo_two_e_ints io_mo_two_e_integrals Write qp_set_frozen_core $1 qp_run cis $1 energy1="$(ezfio get cis energy | tr '[]' ' ' | cut -d ',' -f 1)" @@ -63,7 +63,7 @@ function run() { } @test "SO" { - run so.ezfio -25.7502241401925 -25.5862791897799 -25.5829342971276 + run so.ezfio -25.7502263243068 -25.5862810638724 -25.5829361589673 } @test "CH4" { diff --git a/src/cisd/30.cisd.bats b/src/cisd/30.cisd.bats index f7d8bdb7..d3b4ca94 100644 --- a/src/cisd/30.cisd.bats +++ b/src/cisd/30.cisd.bats @@ -3,7 +3,7 @@ source $QP_ROOT/tests/bats/common.bats.sh function run() { - thresh=1.e-6 + thresh=1.e-5 test_exe cisd || skip qp_edit -c $1 ezfio set_file $1 @@ -29,7 +29,7 @@ function run() { @test "[Cu(NH3)4]2+" { qp_set_mo_class cu_nh3_4_2plus.ezfio -core "[1-24]" -act "[25-45]" -del "[46-87]" - run cu_nh3_4_2plus.ezfio -1862.98685486633 -1862.68819645070 + run cu_nh3_4_2plus.ezfio -1862.9868140855440 -1862.9868140855440 } @test "C2H2" { @@ -70,7 +70,7 @@ function run() { @test "CH4" { qp_set_mo_class ch4.ezfio -core "[1]" -act "[2-30]" -del "[31-59]" - run ch4.ezfio -40.2403916878857 -39.8433229646061 + run ch4.ezfio -40.2403962667047 -39.8433221754964 } @test "CO2" { diff --git a/src/davidson/README.rst b/src/davidson/README.rst index 8df06db6..e3b4344f 100644 --- a/src/davidson/README.rst +++ b/src/davidson/README.rst @@ -11,4 +11,4 @@ the :ref:`davidson` module should be used, and it has a default zero dressing ve The important providers for that module are: # `psi_energy` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the Hamiltonian, dressed or not. It uses the general subroutine `u_0_H_u_0`. -# `psi_energy_bielec` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the standard two-electrons coulomb operator. It uses the general routine `u_0_H_u_0_bielec`. +# `psi_energy_two_e` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the standard two-electrons coulomb operator. It uses the general routine `u_0_H_u_0_two_e`. diff --git a/src/davidson/diagonalization_hs2_dressed.irp.f b/src/davidson/diagonalization_hs2_dressed.irp.f index 2cfe6448..52c31c2f 100644 --- a/src/davidson/diagonalization_hs2_dressed.irp.f +++ b/src/davidson/diagonalization_hs2_dressed.irp.f @@ -44,7 +44,7 @@ subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_d ASSERT (sze > 0) ASSERT (Nint > 0) ASSERT (Nint == N_int) - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map allocate(H_jj(sze)) H_jj(1) = diag_h_mat_elem(dets_in(1,1,1),Nint) diff --git a/src/davidson/u0_wee_u0.irp.f b/src/davidson/u0_wee_u0.irp.f index ca9e5b58..e6f8dc44 100644 --- a/src/davidson/u0_wee_u0.irp.f +++ b/src/davidson/u0_wee_u0.irp.f @@ -1,17 +1,17 @@ -BEGIN_PROVIDER [ double precision, psi_energy_bielec, (N_states) ] +BEGIN_PROVIDER [ double precision, psi_energy_two_e, (N_states) ] implicit none BEGIN_DOC ! Energy of the current wave function END_DOC integer :: i,j - call u_0_H_u_0_bielec(psi_energy_bielec,psi_coef,N_det,psi_det,N_int,N_states,psi_det_size) + call u_0_H_u_0_two_e(psi_energy_two_e,psi_coef,N_det,psi_det,N_int,N_states,psi_det_size) do i=N_det+1,N_states psi_energy(i) = 0.d0 enddo END_PROVIDER -subroutine H_S2_u_0_bielec_nstates_openmp(v_0,s_0,u_0,N_st,sze) +subroutine H_S2_u_0_two_e_nstates_openmp(v_0,s_0,u_0,N_st,sze) use bitmasks implicit none BEGIN_DOC @@ -39,7 +39,7 @@ subroutine H_S2_u_0_bielec_nstates_openmp(v_0,s_0,u_0,N_st,sze) size(u_t, 1), & N_det, N_st) - call H_S2_u_0_bielec_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,1,N_det,0,1) + call H_S2_u_0_two_e_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,1,N_det,0,1) deallocate(u_t) call dtranspose( & @@ -65,7 +65,7 @@ subroutine H_S2_u_0_bielec_nstates_openmp(v_0,s_0,u_0,N_st,sze) end -subroutine H_S2_u_0_bielec_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) +subroutine H_S2_u_0_two_e_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) use bitmasks implicit none BEGIN_DOC @@ -82,20 +82,20 @@ subroutine H_S2_u_0_bielec_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend, select case (N_int) case (1) - call H_S2_u_0_bielec_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + call H_S2_u_0_two_e_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) case (2) - call H_S2_u_0_bielec_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + call H_S2_u_0_two_e_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) case (3) - call H_S2_u_0_bielec_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + call H_S2_u_0_two_e_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) case (4) - call H_S2_u_0_bielec_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + call H_S2_u_0_two_e_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) case default - call H_S2_u_0_bielec_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + call H_S2_u_0_two_e_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) end select end BEGIN_TEMPLATE -subroutine H_S2_u_0_bielec_nstates_openmp_work_$N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) +subroutine H_S2_u_0_two_e_nstates_openmp_work_$N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) use bitmasks implicit none BEGIN_DOC @@ -457,7 +457,7 @@ N_int;; END_TEMPLATE -subroutine u_0_H_u_0_bielec(e_0,u_0,n,keys_tmp,Nint,N_st,sze) +subroutine u_0_H_u_0_two_e(e_0,u_0,n,keys_tmp,Nint,N_st,sze) use bitmasks implicit none BEGIN_DOC @@ -477,7 +477,7 @@ subroutine u_0_H_u_0_bielec(e_0,u_0,n,keys_tmp,Nint,N_st,sze) allocate (v_0(n,N_st),s_0(n,N_st),u_1(n,N_st)) u_1(1:n,:) = u_0(1:n,:) - call H_S2_u_0_bielec_nstates_openmp(v_0,s_0,u_1,N_st,n) + call H_S2_u_0_two_e_nstates_openmp(v_0,s_0,u_1,N_st,n) u_0(1:n,:) = u_1(1:n,:) deallocate(u_1) double precision :: norm diff --git a/src/density_for_dft/density_for_dft.irp.f b/src/density_for_dft/density_for_dft.irp.f index b106ca0b..ccfb141f 100644 --- a/src/density_for_dft/density_for_dft.irp.f +++ b/src/density_for_dft/density_for_dft.irp.f @@ -1,9 +1,9 @@ -BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_tot_num,mo_tot_num, N_states)] +BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_num,mo_num, N_states)] implicit none BEGIN_DOC ! density matrix for alpha electrons in the MO basis used for all DFT calculations based on the density END_DOC - double precision :: delta_alpha(mo_tot_num,mo_tot_num,N_states) + double precision :: delta_alpha(mo_num,mo_num,N_states) if(density_for_dft .EQ. "damping_rs_dft")then delta_alpha = one_body_dm_mo_alpha - data_one_body_alpha_dm_mo one_body_dm_mo_alpha_for_dft = data_one_body_alpha_dm_mo + damping_for_rs_dft * delta_alpha @@ -16,12 +16,12 @@ BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_tot_num,mo_t END_PROVIDER -BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_tot_num,mo_tot_num, N_states)] +BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_num,mo_num, N_states)] implicit none BEGIN_DOC ! density matrix for beta electrons in the MO basis used for all DFT calculations based on the density END_DOC - double precision :: delta_beta(mo_tot_num,mo_tot_num,N_states) + double precision :: delta_beta(mo_num,mo_num,N_states) if(density_for_dft .EQ. "damping_rs_dft")then delta_beta = one_body_dm_mo_beta - data_one_body_beta_dm_mo one_body_dm_mo_beta_for_dft = data_one_body_beta_dm_mo + damping_for_rs_dft * delta_beta @@ -33,12 +33,12 @@ BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_tot_num,mo_to endif END_PROVIDER -BEGIN_PROVIDER [double precision, one_body_dm_mo_for_dft, (mo_tot_num,mo_tot_num, N_states)] +BEGIN_PROVIDER [double precision, one_body_dm_mo_for_dft, (mo_num,mo_num, N_states)] implicit none one_body_dm_mo_for_dft = one_body_dm_mo_beta_for_dft + one_body_dm_mo_alpha_for_dft END_PROVIDER -BEGIN_PROVIDER [double precision, one_body_dm_average_mo_for_dft, (mo_tot_num,mo_tot_num)] +BEGIN_PROVIDER [double precision, one_body_dm_average_mo_for_dft, (mo_num,mo_num)] implicit none integer :: i one_body_dm_average_mo_for_dft = 0.d0 @@ -60,8 +60,8 @@ END_PROVIDER one_body_dm_beta_ao_for_dft = 0.d0 do k = 1, ao_num do l = 1, ao_num - do i = 1, mo_tot_num - do j = 1, mo_tot_num + do i = 1, mo_num + do j = 1, mo_num do istate = 1, N_states mo_alpha = one_body_dm_mo_alpha_for_dft(j,i,istate) mo_beta = one_body_dm_mo_beta_for_dft(j,i,istate) diff --git a/src/determinants/NEED b/src/determinants/NEED index 81418697..d5ce1247 100644 --- a/src/determinants/NEED +++ b/src/determinants/NEED @@ -1,3 +1,3 @@ mo_basis -mo_one_e_integrals -mo_two_e_integrals +mo_one_e_ints +mo_two_e_ints diff --git a/src/determinants/create_excitations.irp.f b/src/determinants/create_excitations.irp.f index 31be9401..9729be56 100644 --- a/src/determinants/create_excitations.irp.f +++ b/src/determinants/create_excitations.irp.f @@ -14,7 +14,7 @@ subroutine do_mono_excitation(key_in,i_hole,i_particle,ispin,i_ok) integer :: k,j,i use bitmasks ASSERT (i_hole > 0 ) - ASSERT (i_particle <= mo_tot_num) + ASSERT (i_particle <= mo_num) i_ok = 1 ! hole k = shiftr(i_hole-1,bit_kind_shift)+1 diff --git a/src/determinants/density_matrix.irp.f b/src/determinants/density_matrix.irp.f index 7577d159..bd5d4318 100644 --- a/src/determinants/density_matrix.irp.f +++ b/src/determinants/density_matrix.irp.f @@ -1,5 +1,5 @@ - BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha_average, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta_average, (mo_tot_num,mo_tot_num) ] + BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha_average, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta_average, (mo_num,mo_num) ] implicit none BEGIN_DOC ! $\alpha$ and $\beta$ one-body density matrix for each state @@ -13,7 +13,7 @@ enddo END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_tot_num,mo_tot_num,2:N_states) ] +BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_states) ] implicit none BEGIN_DOC ! Difference of the one-body density matrix with respect to the ground state @@ -21,8 +21,8 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_tot_num,mo_tot_num,2 integer :: i,j, istate do istate=2,N_states - do j=1,mo_tot_num - do i=1,mo_tot_num + do j=1,mo_num + do i=1,mo_num one_body_dm_mo_diff(i,j,istate) = & one_body_dm_mo_alpha(i,j,istate) - one_body_dm_mo_alpha(i,j,1) +& one_body_dm_mo_beta (i,j,istate) - one_body_dm_mo_beta (i,j,1) @@ -33,13 +33,13 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_tot_num,mo_tot_num,2 END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_tot_num,mo_tot_num,N_states,2) ] +BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_states,2) ] implicit none integer :: i,j,ispin,istate ispin = 1 do istate = 1, N_states - do j = 1, mo_tot_num - do i = 1, mo_tot_num + do j = 1, mo_num + do i = 1, mo_num one_body_dm_mo_spin_index(i,j,istate,ispin) = one_body_dm_mo_alpha(i,j,istate) enddo enddo @@ -47,8 +47,8 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_tot_num,mo_tot ispin = 2 do istate = 1, N_states - do j = 1, mo_tot_num - do i = 1, mo_tot_num + do j = 1, mo_num + do i = 1, mo_num one_body_dm_mo_spin_index(i,j,istate,ispin) = one_body_dm_mo_beta(i,j,istate) enddo enddo @@ -57,14 +57,14 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_tot_num,mo_tot END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_tot_num,mo_tot_num,N_states,2) ] +BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_num,mo_num,N_states,2) ] implicit none integer :: i,j,ispin,istate ispin = 1 do istate = 1, N_states - do j = 1, mo_tot_num + do j = 1, mo_num one_body_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_body_dm_mo_alpha(j,j,istate) - do i = j+1, mo_tot_num + do i = j+1, mo_num one_body_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_body_dm_mo_alpha(i,j,istate) one_body_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_body_dm_mo_alpha(i,j,istate) enddo @@ -73,9 +73,9 @@ BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_tot_num ispin = 2 do istate = 1, N_states - do j = 1, mo_tot_num + do j = 1, mo_num one_body_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_body_dm_mo_beta(j,j,istate) - do i = j+1, mo_tot_num + do i = j+1, mo_num one_body_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_body_dm_mo_beta(i,j,istate) one_body_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_body_dm_mo_beta(i,j,istate) enddo @@ -84,8 +84,8 @@ BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_tot_num END_PROVIDER - BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha, (mo_tot_num,mo_tot_num,N_states) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta, (mo_tot_num,mo_tot_num,N_states) ] + BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha, (mo_num,mo_num,N_states) ] +&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta, (mo_num,mo_num,N_states) ] implicit none BEGIN_DOC ! $\alpha$ and $\beta$ one-body density matrix for each state @@ -110,12 +110,12 @@ END_PROVIDER !$OMP tmp_a, tmp_b, n_occ, krow, kcol, lrow, lcol, tmp_det, tmp_det2)& !$OMP SHARED(psi_det,psi_coef,N_int,N_states,elec_alpha_num, & !$OMP elec_beta_num,one_body_dm_mo_alpha,one_body_dm_mo_beta,N_det,& - !$OMP mo_tot_num,psi_bilinear_matrix_rows,psi_bilinear_matrix_columns,& + !$OMP mo_num,psi_bilinear_matrix_rows,psi_bilinear_matrix_columns,& !$OMP psi_bilinear_matrix_transp_rows, psi_bilinear_matrix_transp_columns,& !$OMP psi_bilinear_matrix_order_reverse, psi_det_alpha_unique, psi_det_beta_unique,& !$OMP psi_bilinear_matrix_values, psi_bilinear_matrix_transp_values,& !$OMP N_det_alpha_unique,N_det_beta_unique,irp_here) - allocate(tmp_a(mo_tot_num,mo_tot_num,N_states), tmp_b(mo_tot_num,mo_tot_num,N_states) ) + allocate(tmp_a(mo_num,mo_num,N_states), tmp_b(mo_num,mo_num,N_states) ) tmp_a = 0.d0 !$OMP DO SCHEDULE(dynamic,64) do k_a=1,N_det @@ -231,8 +231,8 @@ END_PROVIDER END_PROVIDER - BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_alpha, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_beta, (mo_tot_num,mo_tot_num) ] + BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_alpha, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_beta, (mo_num,mo_num) ] implicit none BEGIN_DOC ! $\alpha$ and $\beta$ one-body density matrix for each state @@ -257,8 +257,8 @@ END_PROVIDER !$OMP tmp_a, tmp_b, n_occ_alpha,degree_respect_to_HF_k,degree_respect_to_HF_l)& !$OMP SHARED(ref_bitmask,psi_det,psi_coef,N_int,N_states,state_average_weight,elec_alpha_num,& !$OMP elec_beta_num,one_body_single_double_dm_mo_alpha,one_body_single_double_dm_mo_beta,N_det,& - !$OMP mo_tot_num) - allocate(tmp_a(mo_tot_num,mo_tot_num), tmp_b(mo_tot_num,mo_tot_num) ) + !$OMP mo_num) + allocate(tmp_a(mo_num,mo_num), tmp_b(mo_num,mo_num) ) tmp_a = 0.d0 tmp_b = 0.d0 !$OMP DO SCHEDULE(dynamic) @@ -314,7 +314,7 @@ END_PROVIDER !$OMP END PARALLEL END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_tot_num,mo_tot_num) ] +BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_num,mo_num) ] implicit none BEGIN_DOC ! One-body density matrix @@ -322,7 +322,7 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_tot_num,mo_tot_num) ] one_body_dm_mo = one_body_dm_mo_alpha_average + one_body_dm_mo_beta_average END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_spin_density_mo, (mo_tot_num,mo_tot_num) ] +BEGIN_PROVIDER [ double precision, one_body_spin_density_mo, (mo_num,mo_num) ] implicit none BEGIN_DOC ! $\rho(\alpha) - \rho(\beta)$ @@ -340,7 +340,7 @@ subroutine set_natural_mos double precision, allocatable :: tmp(:,:) label = "Natural" - call mo_as_svd_vectors_of_mo_matrix_eig(one_body_dm_mo,size(one_body_dm_mo,1),mo_tot_num,mo_tot_num,mo_occ,label) + call mo_as_svd_vectors_of_mo_matrix_eig(one_body_dm_mo,size(one_body_dm_mo,1),mo_num,mo_num,mo_occ,label) soft_touch mo_occ end @@ -414,8 +414,8 @@ BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ] one_body_spin_density_ao = 0.d0 do k = 1, ao_num do l = 1, ao_num - do i = 1, mo_tot_num - do j = 1, mo_tot_num + do i = 1, mo_num + do j = 1, mo_num dm_mo = one_body_spin_density_mo(j,i) ! if(dabs(dm_mo).le.1.d-10)cycle one_body_spin_density_ao(l,k) += mo_coef(k,i) * mo_coef(l,j) * dm_mo @@ -440,8 +440,8 @@ END_PROVIDER one_body_dm_ao_beta = 0.d0 do k = 1, ao_num do l = 1, ao_num - do i = 1, mo_tot_num - do j = 1, mo_tot_num + do i = 1, mo_num + do j = 1, mo_num mo_alpha = one_body_dm_mo_alpha_average(j,i) mo_beta = one_body_dm_mo_beta_average(j,i) ! if(dabs(dm_mo).le.1.d-10)cycle diff --git a/src/determinants/example.irp.f b/src/determinants/example.irp.f index 55f7cda9..1f411ee8 100644 --- a/src/determinants/example.irp.f +++ b/src/determinants/example.irp.f @@ -138,7 +138,7 @@ subroutine routine_example_psi_det enddo enddo print*,'' - print*,'Finding the connection through a bielectronic operator in the wave function' + print*,'Finding the connection through a two-electron operator in the wave function' print*,'You want to know the connections of the first determinant ' ! wave function determinant exc degree list call get_excitation_degree_vector( psi_det , psi_det(1,1,1),degree_list,N_int,N_det,idx) diff --git a/src/determinants/filter_connected.irp.f b/src/determinants/filter_connected.irp.f index 20335abc..79f29e95 100644 --- a/src/determinants/filter_connected.irp.f +++ b/src/determinants/filter_connected.irp.f @@ -218,11 +218,11 @@ subroutine getMobiles(key,key_mask, mobiles,Nint) else if(nel == 1) then mobiles(1) = list(1) call bitstring_to_list(mobileMask(1,2), list, nel, Nint) - mobiles(2) = list(1) + mo_tot_num + mobiles(2) = list(1) + mo_num else call bitstring_to_list(mobileMask(1,2), list, nel, Nint) - mobiles(1) = list(1) + mo_tot_num - mobiles(2) = list(2) + mo_tot_num + mobiles(1) = list(1) + mo_num + mobiles(2) = list(2) + mo_num end if end subroutine @@ -233,16 +233,16 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro integer, intent(in) :: Nint, N_minilist integer(bit_kind), intent(in) :: minilist(Nint,2,N_minilist), key_mask(Nint,2) - integer, intent(out) :: N_microlist(0:mo_tot_num*2), ptr_microlist(0:mo_tot_num*2+1), idx_microlist(N_minilist*4) + integer, intent(out) :: N_microlist(0:mo_num*2), ptr_microlist(0:mo_num*2+1), idx_microlist(N_minilist*4) integer(bit_kind), intent(out) :: microlist(Nint,2,N_minilist*4) integer :: i,j,k,nt,n_element(2) integer :: list(Nint*bit_kind_size,2) integer, allocatable :: cur_microlist(:) - allocate (cur_microlist(0:mo_tot_num*2+1)) + allocate (cur_microlist(0:mo_num*2+1)) integer(bit_kind) :: key_mask_neg(Nint,2), mobileMask(Nint,2) - integer :: mo_tot_num_2 - mo_tot_num_2 = mo_tot_num+mo_tot_num + integer :: mo_num_2 + mo_num_2 = mo_num+mo_num do i=1,Nint @@ -250,7 +250,7 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro key_mask_neg(i,2) = not(key_mask(i,2)) end do - do i=0,mo_tot_num_2 + do i=0,mo_num_2 N_microlist(i) = 0 enddo @@ -272,18 +272,18 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro end do do j=1,n_element(2) - nt = list(j,2) + mo_tot_num + nt = list(j,2) + mo_num N_microlist(nt) = N_microlist(nt) + 1 end do end if end do ptr_microlist(0) = 1 - do i=1,mo_tot_num_2+1 + do i=1,mo_num_2+1 ptr_microlist(i) = ptr_microlist(i-1) + N_microlist(i-1) end do - do i=0,mo_tot_num_2+1 + do i=0,mo_num_2+1 cur_microlist(i) = ptr_microlist(i) end do @@ -318,7 +318,7 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro end do do j=1,n_element(2) - nt = list(j,2) + mo_tot_num + nt = list(j,2) + mo_num idx_microlist(cur_microlist(nt)) = i do k=1,Nint microlist(k,1,cur_microlist(nt)) = minilist(k,1,i) diff --git a/src/determinants/fock_diag.irp.f b/src/determinants/fock_diag.irp.f index b5e800ea..29bb0ed4 100644 --- a/src/determinants/fock_diag.irp.f +++ b/src/determinants/fock_diag.irp.f @@ -7,7 +7,7 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint) END_DOC integer, intent(in) :: Nint integer(bit_kind), intent(in) :: det_ref(Nint,2) - double precision, intent(out) :: fock_diag_tmp(2,mo_tot_num+1) + double precision, intent(out) :: fock_diag_tmp(2,mo_num+1) integer :: occ(Nint*bit_kind_size,2) integer :: ne(2), i, j, ii, jj @@ -33,63 +33,63 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint) ! Occupied MOs do ii=1,elec_alpha_num i = occ(ii,1) - fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_mono_elec_integral(i,i) - E0 = E0 + mo_mono_elec_integral(i,i) + fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_one_e_integrals(i,i) + E0 = E0 + mo_one_e_integrals(i,i) do jj=1,elec_alpha_num j = occ(jj,1) if (i==j) cycle - fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_bielec_integral_jj_anti(i,j) - E0 = E0 + 0.5d0*mo_bielec_integral_jj_anti(i,j) + fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj_anti(i,j) + E0 = E0 + 0.5d0*mo_two_e_integrals_jj_anti(i,j) enddo do jj=1,elec_beta_num j = occ(jj,2) - fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_bielec_integral_jj(i,j) - E0 = E0 + mo_bielec_integral_jj(i,j) + fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj(i,j) + E0 = E0 + mo_two_e_integrals_jj(i,j) enddo enddo do ii=1,elec_beta_num i = occ(ii,2) - fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_mono_elec_integral(i,i) - E0 = E0 + mo_mono_elec_integral(i,i) + fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_one_e_integrals(i,i) + E0 = E0 + mo_one_e_integrals(i,i) do jj=1,elec_beta_num j = occ(jj,2) if (i==j) cycle - fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_bielec_integral_jj_anti(i,j) - E0 = E0 + 0.5d0*mo_bielec_integral_jj_anti(i,j) + fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj_anti(i,j) + E0 = E0 + 0.5d0*mo_two_e_integrals_jj_anti(i,j) enddo do jj=1,elec_alpha_num j = occ(jj,1) - fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_bielec_integral_jj(i,j) + fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj(i,j) enddo enddo ! Virtual MOs - do i=1,mo_tot_num + do i=1,mo_num if (fock_diag_tmp(1,i) /= 0.d0) cycle - fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_mono_elec_integral(i,i) + fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_one_e_integrals(i,i) do jj=1,elec_alpha_num j = occ(jj,1) - fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_bielec_integral_jj_anti(i,j) + fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj_anti(i,j) enddo do jj=1,elec_beta_num j = occ(jj,2) - fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_bielec_integral_jj(i,j) + fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj(i,j) enddo enddo - do i=1,mo_tot_num + do i=1,mo_num if (fock_diag_tmp(2,i) /= 0.d0) cycle - fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_mono_elec_integral(i,i) + fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_one_e_integrals(i,i) do jj=1,elec_beta_num j = occ(jj,2) - fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_bielec_integral_jj_anti(i,j) + fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj_anti(i,j) enddo do jj=1,elec_alpha_num j = occ(jj,1) - fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_bielec_integral_jj(i,j) + fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj(i,j) enddo enddo - fock_diag_tmp(1,mo_tot_num+1) = E0 - fock_diag_tmp(2,mo_tot_num+1) = E0 + fock_diag_tmp(1,mo_num+1) = E0 + fock_diag_tmp(2,mo_num+1) = E0 end diff --git a/src/determinants/h_apply.template.f b/src/determinants/h_apply.template.f index 348bd69c..868eedd1 100644 --- a/src/determinants/h_apply.template.f +++ b/src/determinants/h_apply.template.f @@ -7,7 +7,7 @@ subroutine $subroutine_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl integer,intent(in) :: i_generator,iproc_in integer :: status(N_int*bit_kind_size, 2) integer :: highest, p1,p2,sp,ni,i,mi,nt,ns,k - double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1) + double precision, intent(in) :: fock_diag_tmp(2,mo_num+1) integer(bit_kind), intent(in) :: key_prev(N_int, 2, *) PROVIDE N_int PROVIDE N_det @@ -74,7 +74,7 @@ end subroutine subroutine $subroutine_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in $parameters ) implicit none integer(bit_kind), intent(in) :: key_in(N_int, 2), particl_1(N_int, 2), particl_2(N_int, 2) - double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1) + double precision, intent(in) :: fock_diag_tmp(2,mo_num+1) integer(bit_kind) :: p1_mask(N_int, 2), p2_mask(N_int, 2), key_mask(N_int, 2) integer,intent(in) :: fs1,fs2,i_generator,iproc_in, fh1,fh2 integer(bit_kind) :: miniList(N_int, 2, N_det) @@ -121,7 +121,7 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl integer(bit_kind), intent(in) :: hole_1(N_int,2), particl_1(N_int,2) integer(bit_kind), intent(in) :: hole_2(N_int,2), particl_2(N_int,2) integer, intent(in) :: iproc_in - double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1) + double precision, intent(in) :: fock_diag_tmp(2,mo_num+1) integer(bit_kind), allocatable :: hole_save(:,:) integer(bit_kind), allocatable :: key(:,:),hole(:,:), particle(:,:) integer(bit_kind), allocatable :: hole_tmp(:,:), particle_tmp(:,:) @@ -133,7 +133,7 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl integer :: N_elec_in_key_hole_1(2),N_elec_in_key_part_1(2) integer :: N_elec_in_key_hole_2(2),N_elec_in_key_part_2(2) - double precision :: mo_bielec_integral + double precision :: mo_two_e_integral logical :: is_a_two_holes_two_particles integer, allocatable :: ia_ja_pairs(:,:,:) integer, allocatable :: ib_jb_pairs(:,:) @@ -177,20 +177,20 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl enddo call bitstring_to_list_ab(particle,occ_particle,N_elec_in_key_part_1,N_int) call bitstring_to_list_ab(hole,occ_hole,N_elec_in_key_hole_1,N_int) - allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_tot_num,2), & - ib_jb_pairs(2,0:(elec_alpha_num)*mo_tot_num)) + allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_num,2), & + ib_jb_pairs(2,0:(elec_alpha_num)*mo_num)) do ispin=1,2 i=0 do ii=N_elec_in_key_hole_1(ispin),1,-1 ! hole i_a = occ_hole(ii,ispin) ASSERT (i_a > 0) - ASSERT (i_a <= mo_tot_num) + ASSERT (i_a <= mo_num) do jj=1,N_elec_in_key_part_1(ispin) !particle j_a = occ_particle(jj,ispin) ASSERT (j_a > 0) - ASSERT (j_a <= mo_tot_num) + ASSERT (j_a <= mo_num) i += 1 ia_ja_pairs(1,i,ispin) = i_a ia_ja_pairs(2,i,ispin) = j_a @@ -205,7 +205,7 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl integer(bit_kind) :: test(N_int,2) double precision :: accu logical, allocatable :: array_pairs(:,:) - allocate(array_pairs(mo_tot_num,mo_tot_num)) + allocate(array_pairs(mo_num,mo_num)) accu = 0.d0 do ispin=1,2 other_spin = iand(ispin,1)+1 @@ -213,10 +213,10 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl do ii=1,ia_ja_pairs(1,0,ispin) i_a = ia_ja_pairs(1,ii,ispin) ASSERT (i_a > 0) - ASSERT (i_a <= mo_tot_num) + ASSERT (i_a <= mo_num) j_a = ia_ja_pairs(2,ii,ispin) ASSERT (j_a > 0) - ASSERT (j_a <= mo_tot_num) + ASSERT (j_a <= mo_num) hole = key_in k = shiftr(i_a-1,bit_kind_shift)+1 j = i_a-shiftl(k-1,bit_kind_shift)-1 @@ -249,11 +249,11 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl do kk = 1,N_elec_in_key_hole_2(other_spin) i_b = occ_hole_tmp(kk,other_spin) ASSERT (i_b > 0) - ASSERT (i_b <= mo_tot_num) + ASSERT (i_b <= mo_num) do jjj=1,N_elec_in_key_part_2(other_spin) ! particle j_b = occ_particle_tmp(jjj,other_spin) ASSERT (j_b > 0) - ASSERT (j_b <= mo_tot_num) + ASSERT (j_b <= mo_num) if (array_pairs(i_b,j_b)) then $filter_vvvv_excitation i+= 1 @@ -303,11 +303,11 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl i_b = occ_hole_tmp(kk,ispin) if (i_b <= i_a.or.i_b == j_a) cycle ASSERT (i_b > 0) - ASSERT (i_b <= mo_tot_num) + ASSERT (i_b <= mo_num) do jjj=1,N_elec_in_key_part_2(ispin) ! particule j_b = occ_particle_tmp(jjj,ispin) ASSERT (j_b > 0) - ASSERT (j_b <= mo_tot_num) + ASSERT (j_b <= mo_num) if (j_b <= j_a) cycle if (array_pairs(i_b,j_b)) then $filter_vvvv_excitation @@ -381,7 +381,7 @@ subroutine $subroutine_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generato integer(bit_kind),intent(in) :: key_in(N_int,2) integer(bit_kind),intent(in) :: hole_1(N_int,2), particl_1(N_int,2) integer, intent(in) :: iproc_in - double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1) + double precision, intent(in) :: fock_diag_tmp(2,mo_num+1) integer(bit_kind),allocatable :: keys_out(:,:,:) integer(bit_kind),allocatable :: hole_save(:,:) integer(bit_kind),allocatable :: key(:,:),hole(:,:), particle(:,:) @@ -444,7 +444,7 @@ subroutine $subroutine_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generato call bitstring_to_list_ab(particle,occ_particle,N_elec_in_key_part_1,N_int) call bitstring_to_list_ab(hole,occ_hole,N_elec_in_key_hole_1,N_int) - allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_tot_num,2)) + allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_num,2)) do ispin=1,2 i=0 diff --git a/src/determinants/h_apply_nozmq.template.f b/src/determinants/h_apply_nozmq.template.f index bccec196..9da0f4d3 100644 --- a/src/determinants/h_apply_nozmq.template.f +++ b/src/determinants/h_apply_nozmq.template.f @@ -17,13 +17,13 @@ subroutine $subroutine($params_main) double precision, allocatable :: fock_diag_tmp(:,:) $initialization - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators + PROVIDE H_apply_buffer_allocated mo_two_e_integrals_in_map psi_det_generators psi_coef_generators call wall_time(wall_0) iproc = 0 - allocate( mask(N_int,2,6), fock_diag_tmp(2,mo_tot_num+1) ) + allocate( mask(N_int,2,6), fock_diag_tmp(2,mo_num+1) ) do i_generator=1,N_det_generators ! Compute diagonal of the Fock matrix diff --git a/src/determinants/h_apply_zmq.template.f b/src/determinants/h_apply_zmq.template.f index 4b219b73..1dcd5cca 100644 --- a/src/determinants/h_apply_zmq.template.f +++ b/src/determinants/h_apply_zmq.template.f @@ -20,7 +20,7 @@ subroutine $subroutine($params_main) double precision, allocatable :: fock_diag_tmp(:,:) $initialization - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators + PROVIDE H_apply_buffer_allocated mo_two_e_integrals_in_map psi_det_generators psi_coef_generators integer(ZMQ_PTR), external :: new_zmq_pair_socket integer(ZMQ_PTR) :: zmq_socket_pair, zmq_socket_pull @@ -147,7 +147,7 @@ subroutine $subroutine_slave(thread, iproc) N_st = N_states allocate( pt2(N_st), norm_pert(N_st), H_pert_diag(N_st), & - mask(N_int,2,6), fock_diag_tmp(2,mo_tot_num+1) ) + mask(N_int,2,6), fock_diag_tmp(2,mo_num+1) ) do integer, external :: get_task_from_taskserver diff --git a/src/determinants/mo_energy_expval.irp.f b/src/determinants/mo_energy_expval.irp.f index b06ed721..23efdfb0 100644 --- a/src/determinants/mo_energy_expval.irp.f +++ b/src/determinants/mo_energy_expval.irp.f @@ -1,4 +1,4 @@ -BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_tot_num,2,2)] +BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_num,2,2)] use bitmasks implicit none BEGIN_DOC @@ -42,7 +42,7 @@ BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_tot_num,2,2)] do hp=1,2 do ispin=1,2 - do i=1,mo_tot_num + do i=1,mo_num psi_in_out_coef(1:N_det,1:N_states) = psi_coef(1:N_det,1:N_states) psi_in_out(1:N_int,1:2,1:N_det) = psi_det(1:N_int,1:2,1:N_det) call apply_exc_to_psi(i,hole_particle(hp),ispin, & @@ -70,7 +70,7 @@ BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_tot_num,2,2)] enddo enddo - mo_energy_expval(1:N_states,1:mo_tot_num,1:2,1) = -mo_energy_expval(1:N_states,1:mo_tot_num,1:2,1) + mo_energy_expval(1:N_states,1:mo_num,1:2,1) = -mo_energy_expval(1:N_states,1:mo_num,1:2,1) END_PROVIDER @@ -131,20 +131,20 @@ subroutine diag_H_mat_elem_au0_h_au0(det_in,Nint,hii) ! alpha - alpha do i = 1, elec_num_tab_local(1) iorb = occ(i,1) - hii += mo_mono_elec_integral(iorb,iorb) + hii += mo_one_e_integrals(iorb,iorb) do j = i+1, elec_num_tab_local(1) jorb = occ(j,1) - hii += mo_bielec_integral_jj_anti(jorb,iorb) + hii += mo_two_e_integrals_jj_anti(jorb,iorb) enddo enddo ! beta - beta do i = 1, elec_num_tab_local(2) iorb = occ(i,2) - hii += mo_mono_elec_integral(iorb,iorb) + hii += mo_one_e_integrals(iorb,iorb) do j = i+1, elec_num_tab_local(2) jorb = occ(j,2) - hii += mo_bielec_integral_jj_anti(jorb,iorb) + hii += mo_two_e_integrals_jj_anti(jorb,iorb) enddo enddo @@ -153,7 +153,7 @@ subroutine diag_H_mat_elem_au0_h_au0(det_in,Nint,hii) iorb = occ(i,2) do j = 1, elec_num_tab_local(1) jorb = occ(j,1) - hii += mo_bielec_integral_jj(jorb,iorb) + hii += mo_two_e_integrals_jj(jorb,iorb) enddo enddo diff --git a/src/determinants/mono_excitations_bielec.irp.f b/src/determinants/mono_excitations_bielec.irp.f index 92d11ebd..0e3293e0 100644 --- a/src/determinants/mono_excitations_bielec.irp.f +++ b/src/determinants/mono_excitations_bielec.irp.f @@ -27,40 +27,40 @@ subroutine mono_excitation_wee(det_1,det_2,h,p,spin,phase,hij) ! holes :: direct terms do i0 = 1, n_occ_ab_hole(1) i = occ_hole(i0,1) - hij -= big_array_coulomb_integrals(i,h,p) ! get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij -= big_array_coulomb_integrals(i,h,p) ! get_mo_two_e_integral_schwartz(h,i,p,i,mo_integrals_map) enddo do i0 = 1, n_occ_ab_hole(2) i = occ_hole(i0,2) - hij -= big_array_coulomb_integrals(i,h,p) !get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij -= big_array_coulomb_integrals(i,h,p) !get_mo_two_e_integral_schwartz(h,i,p,i,mo_integrals_map) enddo ! holes :: exchange terms do i0 = 1, n_occ_ab_hole(spin) i = occ_hole(i0,spin) - hij += big_array_exchange_integrals(i,h,p) ! get_mo_bielec_integral_schwartz(h,i,i,p,mo_integrals_map) + hij += big_array_exchange_integrals(i,h,p) ! get_mo_two_e_integral_schwartz(h,i,i,p,mo_integrals_map) enddo ! particles :: direct terms do i0 = 1, n_occ_ab_partcl(1) i = occ_partcl(i0,1) - hij += big_array_coulomb_integrals(i,h,p)!get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij += big_array_coulomb_integrals(i,h,p)!get_mo_two_e_integral_schwartz(h,i,p,i,mo_integrals_map) enddo do i0 = 1, n_occ_ab_partcl(2) i = occ_partcl(i0,2) - hij += big_array_coulomb_integrals(i,h,p) !get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij += big_array_coulomb_integrals(i,h,p) !get_mo_two_e_integral_schwartz(h,i,p,i,mo_integrals_map) enddo ! particles :: exchange terms do i0 = 1, n_occ_ab_partcl(spin) i = occ_partcl(i0,spin) - hij -= big_array_exchange_integrals(i,h,p)!get_mo_bielec_integral_schwartz(h,i,i,p,mo_integrals_map) + hij -= big_array_exchange_integrals(i,h,p)!get_mo_two_e_integral_schwartz(h,i,i,p,mo_integrals_map) enddo hij = hij * phase end -BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num) ] +BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_num, mo_num) ] implicit none integer :: i0,j0,i,j,k0,k integer :: n_occ_ab(2) @@ -77,15 +77,15 @@ BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num key_virt(i,1) = xor(key_virt(i,1),ref_closed_shell_bitmask(i,1)) key_virt(i,2) = xor(key_virt(i,2),ref_closed_shell_bitmask(i,2)) enddo - double precision :: array_coulomb(mo_tot_num),array_exchange(mo_tot_num) + double precision :: array_coulomb(mo_num),array_exchange(mo_num) call bitstring_to_list_ab(key_virt, occ_virt, n_occ_ab_virt, N_int) ! docc ---> virt mono excitations do i0 = 1, n_occ_ab(1) i=occ(i0,1) do j0 = 1, n_occ_ab_virt(1) j = occ_virt(j0,1) - call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map) - call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map) + call get_mo_two_e_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map) + call get_mo_two_e_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map) double precision :: accu accu = 0.d0 do k0 = 1, n_occ_ab(1) @@ -102,8 +102,8 @@ BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num i=occ_virt(i0,1) do j0 = 1, n_occ_ab_virt(1) j = occ_virt(j0,1) - call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map) - call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map) + call get_mo_two_e_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map) + call get_mo_two_e_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map) accu = 0.d0 do k0 = 1, n_occ_ab(1) k = occ(k0,1) @@ -119,8 +119,8 @@ BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num i=occ(i0,1) do j0 = 1, n_occ_ab(1) j = occ(j0,1) - call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map) - call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map) + call get_mo_two_e_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map) + call get_mo_two_e_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map) accu = 0.d0 do k0 = 1, n_occ_ab(1) k = occ(k0,1) diff --git a/src/determinants/psi_energy_mono_elec.irp.f b/src/determinants/psi_energy_mono_elec.irp.f index 15621941..f5a17024 100644 --- a/src/determinants/psi_energy_mono_elec.irp.f +++ b/src/determinants/psi_energy_mono_elec.irp.f @@ -2,23 +2,25 @@ implicit none integer :: i integer :: j,k - double precision :: tmp(mo_tot_num,mo_tot_num),mono_ints(mo_tot_num,mo_tot_num) + double precision :: tmp(mo_num,mo_num),mono_ints(mo_num,mo_num) BEGIN_DOC ! psi_energy_h_core = $\langle \Psi | h_{core} |\Psi \rangle$ -! computed using the `one_body_dm_mo_alpha` + `one_body_dm_mo_beta` and `mo_mono_elec_integral` +! +! computed using the :c:data:`one_body_dm_mo_alpha` + +! :c:data:`one_body_dm_mo_beta` and :c:data:`mo_one_e_integrals` END_DOC psi_energy_h_core = 0.d0 do i = 1, N_states - do j = 1, mo_tot_num - do k = 1, mo_tot_num - psi_energy_h_core(i) += mo_mono_elec_integral(k,j) * (one_body_dm_mo_alpha(k,j,i) + one_body_dm_mo_beta(k,j,i)) + do j = 1, mo_num + do k = 1, mo_num + psi_energy_h_core(i) += mo_one_e_integrals(k,j) * (one_body_dm_mo_alpha(k,j,i) + one_body_dm_mo_beta(k,j,i)) enddo enddo enddo double precision :: accu accu = 0.d0 do i = 1, N_states - do j = 1, mo_tot_num + do j = 1, mo_num accu += one_body_dm_mo_alpha(j,j,i) + one_body_dm_mo_beta(j,j,i) enddo accu = (elec_alpha_num + elec_beta_num ) / accu diff --git a/src/determinants/ref_bitmask.irp.f b/src/determinants/ref_bitmask.irp.f index 7f760562..181371cc 100644 --- a/src/determinants/ref_bitmask.irp.f +++ b/src/determinants/ref_bitmask.irp.f @@ -1,8 +1,8 @@ BEGIN_PROVIDER [ double precision, ref_bitmask_energy ] -&BEGIN_PROVIDER [ double precision, mono_elec_ref_bitmask_energy ] -&BEGIN_PROVIDER [ double precision, kinetic_ref_bitmask_energy ] -&BEGIN_PROVIDER [ double precision, nucl_elec_ref_bitmask_energy ] -&BEGIN_PROVIDER [ double precision, bi_elec_ref_bitmask_energy ] +&BEGIN_PROVIDER [ double precision, ref_bitmask_one_e_energy ] +&BEGIN_PROVIDER [ double precision, ref_bitmask_kinetic_energy ] +&BEGIN_PROVIDER [ double precision, ref_bitmask_e_n_energy ] +&BEGIN_PROVIDER [ double precision, ref_bitmask_two_e_energy ] use bitmasks implicit none BEGIN_DOC @@ -17,41 +17,41 @@ ref_bitmask_energy = 0.d0 - mono_elec_ref_bitmask_energy = 0.d0 - kinetic_ref_bitmask_energy = 0.d0 - nucl_elec_ref_bitmask_energy = 0.d0 - bi_elec_ref_bitmask_energy = 0.d0 + ref_bitmask_one_e_energy = 0.d0 + ref_bitmask_kinetic_energy = 0.d0 + ref_bitmask_e_n_energy = 0.d0 + ref_bitmask_two_e_energy = 0.d0 do i = 1, elec_beta_num - ref_bitmask_energy += mo_mono_elec_integral(occ(i,1),occ(i,1)) + mo_mono_elec_integral(occ(i,2),occ(i,2)) - kinetic_ref_bitmask_energy += mo_kinetic_integral(occ(i,1),occ(i,1)) + mo_kinetic_integral(occ(i,2),occ(i,2)) - nucl_elec_ref_bitmask_energy += mo_nucl_elec_integral(occ(i,1),occ(i,1)) + mo_nucl_elec_integral(occ(i,2),occ(i,2)) + ref_bitmask_energy += mo_one_e_integrals(occ(i,1),occ(i,1)) + mo_one_e_integrals(occ(i,2),occ(i,2)) + ref_bitmask_kinetic_energy += mo_kinetic_integrals(occ(i,1),occ(i,1)) + mo_kinetic_integrals(occ(i,2),occ(i,2)) + ref_bitmask_e_n_energy += mo_integrals_n_e(occ(i,1),occ(i,1)) + mo_integrals_n_e(occ(i,2),occ(i,2)) enddo do i = elec_beta_num+1,elec_alpha_num - ref_bitmask_energy += mo_mono_elec_integral(occ(i,1),occ(i,1)) - kinetic_ref_bitmask_energy += mo_kinetic_integral(occ(i,1),occ(i,1)) - nucl_elec_ref_bitmask_energy += mo_nucl_elec_integral(occ(i,1),occ(i,1)) + ref_bitmask_energy += mo_one_e_integrals(occ(i,1),occ(i,1)) + ref_bitmask_kinetic_energy += mo_kinetic_integrals(occ(i,1),occ(i,1)) + ref_bitmask_e_n_energy += mo_integrals_n_e(occ(i,1),occ(i,1)) enddo do j= 1, elec_alpha_num do i = j+1, elec_alpha_num - bi_elec_ref_bitmask_energy += mo_bielec_integral_jj_anti(occ(i,1),occ(j,1)) - ref_bitmask_energy += mo_bielec_integral_jj_anti(occ(i,1),occ(j,1)) + ref_bitmask_two_e_energy += mo_two_e_integrals_jj_anti(occ(i,1),occ(j,1)) + ref_bitmask_energy += mo_two_e_integrals_jj_anti(occ(i,1),occ(j,1)) enddo enddo do j= 1, elec_beta_num do i = j+1, elec_beta_num - bi_elec_ref_bitmask_energy += mo_bielec_integral_jj_anti(occ(i,2),occ(j,2)) - ref_bitmask_energy += mo_bielec_integral_jj_anti(occ(i,2),occ(j,2)) + ref_bitmask_two_e_energy += mo_two_e_integrals_jj_anti(occ(i,2),occ(j,2)) + ref_bitmask_energy += mo_two_e_integrals_jj_anti(occ(i,2),occ(j,2)) enddo do i= 1, elec_alpha_num - bi_elec_ref_bitmask_energy += mo_bielec_integral_jj(occ(i,1),occ(j,2)) - ref_bitmask_energy += mo_bielec_integral_jj(occ(i,1),occ(j,2)) + ref_bitmask_two_e_energy += mo_two_e_integrals_jj(occ(i,1),occ(j,2)) + ref_bitmask_energy += mo_two_e_integrals_jj(occ(i,1),occ(j,2)) enddo enddo - mono_elec_ref_bitmask_energy = kinetic_ref_bitmask_energy + nucl_elec_ref_bitmask_energy + ref_bitmask_one_e_energy = ref_bitmask_kinetic_energy + ref_bitmask_e_n_energy END_PROVIDER diff --git a/src/determinants/mono_excitations.irp.f b/src/determinants/single_excitations.irp.f similarity index 68% rename from src/determinants/mono_excitations.irp.f rename to src/determinants/single_excitations.irp.f index 9b8d55f4..b5126ee8 100644 --- a/src/determinants/mono_excitations.irp.f +++ b/src/determinants/single_excitations.irp.f @@ -19,7 +19,7 @@ BEGIN_PROVIDER [integer(bit_kind), ref_closed_shell_bitmask, (N_int,2)] END_PROVIDER -BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_tot_num, mo_tot_num) ] +BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_num, mo_num) ] implicit none integer :: i0,j0,i,j,k0,k integer :: n_occ_ab(2) @@ -37,23 +37,23 @@ BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_to key_virt(i,2) = xor(key_virt(i,2),ref_closed_shell_bitmask(i,2)) enddo double precision, allocatable :: array_coulomb(:),array_exchange(:) - allocate (array_coulomb(mo_tot_num),array_exchange(mo_tot_num)) + allocate (array_coulomb(mo_num),array_exchange(mo_num)) call bitstring_to_list_ab(key_virt, occ_virt, n_occ_ab_virt, N_int) ! docc ---> virt mono excitations do i0 = 1, n_occ_ab(1) i=occ(i0,1) do j0 = 1, n_occ_ab_virt(1) j = occ_virt(j0,1) - call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map) - call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map) + call get_mo_two_e_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map) + call get_mo_two_e_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map) double precision :: accu accu = 0.d0 do k0 = 1, n_occ_ab(1) k = occ(k0,1) accu += 2.d0 * array_coulomb(k) - array_exchange(k) enddo - fock_operator_closed_shell_ref_bitmask(i,j) = accu + mo_mono_elec_integral(i,j) - fock_operator_closed_shell_ref_bitmask(j,i) = accu + mo_mono_elec_integral(i,j) + fock_operator_closed_shell_ref_bitmask(i,j) = accu + mo_one_e_integrals(i,j) + fock_operator_closed_shell_ref_bitmask(j,i) = accu + mo_one_e_integrals(i,j) enddo enddo @@ -62,15 +62,15 @@ BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_to i=occ_virt(i0,1) do j0 = 1, n_occ_ab_virt(1) j = occ_virt(j0,1) - call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map) - call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map) + call get_mo_two_e_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map) + call get_mo_two_e_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map) accu = 0.d0 do k0 = 1, n_occ_ab(1) k = occ(k0,1) accu += 2.d0 * array_coulomb(k) - array_exchange(k) enddo - fock_operator_closed_shell_ref_bitmask(i,j) = accu+ mo_mono_elec_integral(i,j) - fock_operator_closed_shell_ref_bitmask(j,i) = accu+ mo_mono_elec_integral(i,j) + fock_operator_closed_shell_ref_bitmask(i,j) = accu+ mo_one_e_integrals(i,j) + fock_operator_closed_shell_ref_bitmask(j,i) = accu+ mo_one_e_integrals(i,j) enddo enddo @@ -79,15 +79,15 @@ BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_to i=occ(i0,1) do j0 = 1, n_occ_ab(1) j = occ(j0,1) - call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map) - call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map) + call get_mo_two_e_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map) + call get_mo_two_e_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map) accu = 0.d0 do k0 = 1, n_occ_ab(1) k = occ(k0,1) accu += 2.d0 * array_coulomb(k) - array_exchange(k) enddo - fock_operator_closed_shell_ref_bitmask(i,j) = accu+ mo_mono_elec_integral(i,j) - fock_operator_closed_shell_ref_bitmask(j,i) = accu+ mo_mono_elec_integral(i,j) + fock_operator_closed_shell_ref_bitmask(i,j) = accu+ mo_one_e_integrals(i,j) + fock_operator_closed_shell_ref_bitmask(j,i) = accu+ mo_one_e_integrals(i,j) enddo enddo deallocate(array_coulomb,array_exchange) @@ -122,33 +122,33 @@ subroutine get_mono_excitation_from_fock(det_1,det_2,h,p,spin,phase,hij) ! holes :: direct terms do i0 = 1, n_occ_ab_hole(1) i = occ_hole(i0,1) - hij -= big_array_coulomb_integrals(i,h,p) ! get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij -= big_array_coulomb_integrals(i,h,p) enddo do i0 = 1, n_occ_ab_hole(2) i = occ_hole(i0,2) - hij -= big_array_coulomb_integrals(i,h,p) !get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij -= big_array_coulomb_integrals(i,h,p) enddo ! holes :: exchange terms do i0 = 1, n_occ_ab_hole(spin) i = occ_hole(i0,spin) - hij += big_array_exchange_integrals(i,h,p) ! get_mo_bielec_integral_schwartz(h,i,i,p,mo_integrals_map) + hij += big_array_exchange_integrals(i,h,p) enddo ! particles :: direct terms do i0 = 1, n_occ_ab_partcl(1) i = occ_partcl(i0,1) - hij += big_array_coulomb_integrals(i,h,p)!get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij += big_array_coulomb_integrals(i,h,p) enddo do i0 = 1, n_occ_ab_partcl(2) i = occ_partcl(i0,2) - hij += big_array_coulomb_integrals(i,h,p) !get_mo_bielec_integral_schwartz(h,i,p,i,mo_integrals_map) + hij += big_array_coulomb_integrals(i,h,p) enddo ! particles :: exchange terms do i0 = 1, n_occ_ab_partcl(spin) i = occ_partcl(i0,spin) - hij -= big_array_exchange_integrals(i,h,p)!get_mo_bielec_integral_schwartz(h,i,i,p,mo_integrals_map) + hij -= big_array_exchange_integrals(i,h,p) enddo hij = hij * phase diff --git a/src/determinants/slater_rules.irp.f b/src/determinants/slater_rules.irp.f index 9e7168e2..4a3d5abb 100644 --- a/src/determinants/slater_rules.irp.f +++ b/src/determinants/slater_rules.irp.f @@ -476,13 +476,13 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) integer :: exc(0:2,2,2) integer :: degree - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral integer :: m,n,p,q integer :: i,j,k integer :: occ(Nint*bit_kind_size,2) double precision :: diag_H_mat_elem, phase integer :: n_occ_ab(2) - PROVIDE mo_bielec_integrals_in_map mo_integrals_map big_array_exchange_integrals + PROVIDE mo_two_e_integrals_in_map mo_integrals_map big_array_exchange_integrals ASSERT (Nint > 0) ASSERT (Nint == N_int) @@ -509,7 +509,7 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) else if (exc(1,2,1) ==exc(1,1,2))then hij = phase * big_array_exchange_integrals(exc(1,2,1),exc(1,1,1),exc(1,2,2)) else - hij = phase*get_mo_bielec_integral( & + hij = phase*get_two_e_integral( & exc(1,1,1), & exc(1,1,2), & exc(1,2,1), & @@ -517,24 +517,24 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) endif ! Double alpha else if (exc(0,1,1) == 2) then - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(1,2,1), & exc(2,2,1) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(2,2,1), & exc(1,2,1) ,mo_integrals_map) ) ! Double beta else if (exc(0,1,2) == 2) then - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(1,2,2), & exc(2,2,2) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(2,2,2), & @@ -578,13 +578,13 @@ subroutine i_H_j(key_i,key_j,Nint,hij) integer :: exc(0:2,2,2) integer :: degree - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral integer :: m,n,p,q integer :: i,j,k integer :: occ(Nint*bit_kind_size,2) double precision :: diag_H_mat_elem, phase integer :: n_occ_ab(2) - PROVIDE mo_bielec_integrals_in_map mo_integrals_map big_array_exchange_integrals + PROVIDE mo_two_e_integrals_in_map mo_integrals_map big_array_exchange_integrals ASSERT (Nint > 0) ASSERT (Nint == N_int) @@ -608,7 +608,7 @@ subroutine i_H_j(key_i,key_j,Nint,hij) else if (exc(1,2,1) ==exc(1,1,2))then hij = phase * big_array_exchange_integrals(exc(1,2,1),exc(1,1,1),exc(1,2,2)) else - hij = phase*get_mo_bielec_integral( & + hij = phase*get_two_e_integral( & exc(1,1,1), & exc(1,1,2), & exc(1,2,1), & @@ -616,24 +616,24 @@ subroutine i_H_j(key_i,key_j,Nint,hij) endif else if (exc(0,1,1) == 2) then ! Double alpha - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(1,2,1), & exc(2,2,1) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(2,2,1), & exc(1,2,1) ,mo_integrals_map) ) else if (exc(0,1,2) == 2) then ! Double beta - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(1,2,2), & exc(2,2,2) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(2,2,2), & @@ -677,7 +677,7 @@ subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) integer :: exc(0:2,2,2) integer :: degree - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral integer :: m,n,p,q integer :: i,j,k integer :: occ(Nint*bit_kind_size,2) @@ -685,7 +685,7 @@ subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) integer :: n_occ_ab(2) logical :: has_mipi(Nint*bit_kind_size) double precision :: mipi(Nint*bit_kind_size), miip(Nint*bit_kind_size) - PROVIDE mo_bielec_integrals_in_map mo_integrals_map + PROVIDE mo_two_e_integrals_in_map mo_integrals_map ASSERT (Nint > 0) ASSERT (Nint == N_int) @@ -704,19 +704,19 @@ subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) call get_double_excitation(key_i,key_j,exc,phase,Nint) if (exc(0,1,1) == 1) then ! Mono alpha, mono beta - hij = phase*get_mo_bielec_integral( & + hij = phase*get_two_e_integral( & exc(1,1,1), & exc(1,1,2), & exc(1,2,1), & exc(1,2,2) ,mo_integrals_map) else if (exc(0,1,1) == 2) then ! Double alpha - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(1,2,1), & exc(2,2,1) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(2,2,1), & @@ -724,12 +724,12 @@ subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) else if (exc(0,1,2) == 2) then ! Double beta - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(1,2,2), & exc(2,2,2) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(2,2,2), & @@ -747,15 +747,15 @@ subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) do k = 1, elec_alpha_num i = occ(k,1) if (.not.has_mipi(i)) then - mipi(i) = get_mo_bielec_integral(m,i,p,i,mo_integrals_map) - miip(i) = get_mo_bielec_integral(m,i,i,p,mo_integrals_map) + mipi(i) = get_two_e_integral(m,i,p,i,mo_integrals_map) + miip(i) = get_two_e_integral(m,i,i,p,mo_integrals_map) has_mipi(i) = .True. endif enddo do k = 1, elec_beta_num i = occ(k,2) if (.not.has_mipi(i)) then - mipi(i) = get_mo_bielec_integral(m,i,p,i,mo_integrals_map) + mipi(i) = get_two_e_integral(m,i,p,i,mo_integrals_map) has_mipi(i) = .True. endif enddo @@ -774,15 +774,15 @@ subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) do k = 1, elec_beta_num i = occ(k,2) if (.not.has_mipi(i)) then - mipi(i) = get_mo_bielec_integral(m,i,p,i,mo_integrals_map) - miip(i) = get_mo_bielec_integral(m,i,i,p,mo_integrals_map) + mipi(i) = get_two_e_integral(m,i,p,i,mo_integrals_map) + miip(i) = get_two_e_integral(m,i,i,p,mo_integrals_map) has_mipi(i) = .True. endif enddo do k = 1, elec_alpha_num i = occ(k,1) if (.not.has_mipi(i)) then - mipi(i) = get_mo_bielec_integral(m,i,p,i,mo_integrals_map) + mipi(i) = get_two_e_integral(m,i,p,i,mo_integrals_map) has_mipi(i) = .True. endif enddo @@ -795,7 +795,7 @@ subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) enddo endif - hmono = mo_mono_elec_integral(m,p) + hmono = mo_one_e_integrals(m,p) hij = phase*(hdouble + hmono) case (0) @@ -1592,7 +1592,7 @@ double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Ni END_DOC integer,intent(in) :: Nint integer(bit_kind),intent(in) :: det_ref(Nint,2), det_pert(Nint,2) - double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1) + double precision, intent(in) :: fock_diag_tmp(2,mo_num+1) integer :: degree double precision :: phase, E0 @@ -1600,7 +1600,7 @@ double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Ni integer :: h1, p1, h2, p2, s1, s2 call get_excitation_degree(det_ref,det_pert,degree,Nint) - E0 = fock_diag_tmp(1,mo_tot_num+1) + E0 = fock_diag_tmp(1,mo_num+1) if (degree == 2) then call get_double_excitation(det_ref,det_pert,exc,phase,Nint) call decode_exc(exc,2,h1,p1,h2,p2,s1,s2) @@ -1608,29 +1608,29 @@ double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Ni if ( (s1 == 1).and.(s2 == 1) ) then ! alpha/alpha diag_H_mat_elem_fock = E0 & - fock_diag_tmp(1,h1) & - + ( fock_diag_tmp(1,p1) - mo_bielec_integral_jj_anti(h1,p1) ) & - - ( fock_diag_tmp(1,h2) - mo_bielec_integral_jj_anti(h1,h2) & - + mo_bielec_integral_jj_anti(p1,h2) ) & - + ( fock_diag_tmp(1,p2) - mo_bielec_integral_jj_anti(h1,p2) & - + mo_bielec_integral_jj_anti(p1,p2) - mo_bielec_integral_jj_anti(h2,p2) ) + + ( fock_diag_tmp(1,p1) - mo_two_e_integrals_jj_anti(h1,p1) ) & + - ( fock_diag_tmp(1,h2) - mo_two_e_integrals_jj_anti(h1,h2) & + + mo_two_e_integrals_jj_anti(p1,h2) ) & + + ( fock_diag_tmp(1,p2) - mo_two_e_integrals_jj_anti(h1,p2) & + + mo_two_e_integrals_jj_anti(p1,p2) - mo_two_e_integrals_jj_anti(h2,p2) ) else if ( (s1 == 2).and.(s2 == 2) ) then ! beta/beta diag_H_mat_elem_fock = E0 & - fock_diag_tmp(2,h1) & - + ( fock_diag_tmp(2,p1) - mo_bielec_integral_jj_anti(h1,p1) ) & - - ( fock_diag_tmp(2,h2) - mo_bielec_integral_jj_anti(h1,h2) & - + mo_bielec_integral_jj_anti(p1,h2) ) & - + ( fock_diag_tmp(2,p2) - mo_bielec_integral_jj_anti(h1,p2) & - + mo_bielec_integral_jj_anti(p1,p2) - mo_bielec_integral_jj_anti(h2,p2) ) + + ( fock_diag_tmp(2,p1) - mo_two_e_integrals_jj_anti(h1,p1) ) & + - ( fock_diag_tmp(2,h2) - mo_two_e_integrals_jj_anti(h1,h2) & + + mo_two_e_integrals_jj_anti(p1,h2) ) & + + ( fock_diag_tmp(2,p2) - mo_two_e_integrals_jj_anti(h1,p2) & + + mo_two_e_integrals_jj_anti(p1,p2) - mo_two_e_integrals_jj_anti(h2,p2) ) else ! alpha/beta diag_H_mat_elem_fock = E0 & - fock_diag_tmp(1,h1) & - + ( fock_diag_tmp(1,p1) - mo_bielec_integral_jj_anti(h1,p1) ) & - - ( fock_diag_tmp(2,h2) - mo_bielec_integral_jj(h1,h2) & - + mo_bielec_integral_jj(p1,h2) ) & - + ( fock_diag_tmp(2,p2) - mo_bielec_integral_jj(h1,p2) & - + mo_bielec_integral_jj(p1,p2) - mo_bielec_integral_jj_anti(h2,p2) ) + + ( fock_diag_tmp(1,p1) - mo_two_e_integrals_jj_anti(h1,p1) ) & + - ( fock_diag_tmp(2,h2) - mo_two_e_integrals_jj(h1,h2) & + + mo_two_e_integrals_jj(p1,h2) ) & + + ( fock_diag_tmp(2,p2) - mo_two_e_integrals_jj(h1,p2) & + + mo_two_e_integrals_jj(p1,p2) - mo_two_e_integrals_jj_anti(h2,p2) ) endif @@ -1639,10 +1639,10 @@ double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Ni call decode_exc(exc,1,h1,p1,h2,p2,s1,s2) if (s1 == 1) then diag_H_mat_elem_fock = E0 - fock_diag_tmp(1,h1) & - + ( fock_diag_tmp(1,p1) - mo_bielec_integral_jj_anti(h1,p1) ) + + ( fock_diag_tmp(1,p1) - mo_two_e_integrals_jj_anti(h1,p1) ) else diag_H_mat_elem_fock = E0 - fock_diag_tmp(2,h1) & - + ( fock_diag_tmp(2,p1) - mo_bielec_integral_jj_anti(h1,p1) ) + + ( fock_diag_tmp(2,p1) - mo_two_e_integrals_jj_anti(h1,p1) ) endif else if (degree == 0) then @@ -1745,16 +1745,16 @@ subroutine a_operator(iorb,ispin,key,hjj,Nint,na,nb) call bitstring_to_list_ab(key, occ, tmp, Nint) na = na-1 - hjj = hjj - mo_mono_elec_integral(iorb,iorb) + hjj = hjj - mo_one_e_integrals(iorb,iorb) ! Same spin do i=1,na - hjj = hjj - mo_bielec_integral_jj_anti(occ(i,ispin),iorb) + hjj = hjj - mo_two_e_integrals_jj_anti(occ(i,ispin),iorb) enddo ! Opposite spin do i=1,nb - hjj = hjj - mo_bielec_integral_jj(occ(i,other_spin),iorb) + hjj = hjj - mo_two_e_integrals_jj(occ(i,other_spin),iorb) enddo end @@ -1793,21 +1793,21 @@ subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb) key(k,ispin) = ibset(key(k,ispin),l) other_spin = iand(ispin,1)+1 -! if (iorb > mo_tot_num) then -! print *, irp_here, 'iorb > mo_tot_num' -! print *, iorb, mo_tot_num +! if (iorb > mo_num) then +! print *, irp_here, 'iorb > mo_num' +! print *, iorb, mo_num ! stop -1 ! endif - hjj = hjj + mo_mono_elec_integral(iorb,iorb) + hjj = hjj + mo_one_e_integrals(iorb,iorb) ! Same spin do i=1,na - hjj = hjj + mo_bielec_integral_jj_anti(occ(i,ispin),iorb) + hjj = hjj + mo_two_e_integrals_jj_anti(occ(i,ispin),iorb) enddo ! Opposite spin do i=1,nb - hjj = hjj + mo_bielec_integral_jj(occ(i,other_spin),iorb) + hjj = hjj + mo_two_e_integrals_jj(occ(i,other_spin),iorb) enddo na = na+1 end @@ -2183,7 +2183,7 @@ subroutine i_H_j_mono_spin(key_i,key_j,Nint,spin,hij) integer :: exc(0:2,2) double precision :: phase - PROVIDE big_array_exchange_integrals mo_bielec_integrals_in_map + PROVIDE big_array_exchange_integrals mo_two_e_integrals_in_map call get_mono_excitation_spin(key_i(1,spin),key_j(1,spin),exc,phase,Nint) call get_mono_excitation_from_fock(key_i,key_j,exc(1,1),exc(1,2),spin,phase,hij) @@ -2202,16 +2202,16 @@ subroutine i_H_j_double_spin(key_i,key_j,Nint,hij) integer :: exc(0:2,2) double precision :: phase - double precision, external :: get_mo_bielec_integral + double precision, external :: get_two_e_integral - PROVIDE big_array_exchange_integrals mo_bielec_integrals_in_map + PROVIDE big_array_exchange_integrals mo_two_e_integrals_in_map call get_double_excitation_spin(key_i,key_j,exc,phase,Nint) - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1), & exc(2,1), & exc(1,2), & exc(2,2), mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1), & exc(2,1), & exc(2,2), & @@ -2231,9 +2231,9 @@ subroutine i_H_j_double_alpha_beta(key_i,key_j,Nint,hij) integer :: exc(0:2,2,2) double precision :: phase, phase2 - double precision, external :: get_mo_bielec_integral + double precision, external :: get_two_e_integral - PROVIDE big_array_exchange_integrals mo_bielec_integrals_in_map + PROVIDE big_array_exchange_integrals mo_two_e_integrals_in_map call get_mono_excitation_spin(key_i(1,1),key_j(1,1),exc(0,1,1),phase,Nint) call get_mono_excitation_spin(key_i(1,2),key_j(1,2),exc(0,1,2),phase2,Nint) @@ -2243,7 +2243,7 @@ subroutine i_H_j_double_alpha_beta(key_i,key_j,Nint,hij) else if (exc(1,2,1) == exc(1,1,2)) then hij = phase * big_array_exchange_integrals(exc(1,2,1),exc(1,1,1),exc(1,2,2)) else - hij = phase*get_mo_bielec_integral( & + hij = phase*get_two_e_integral( & exc(1,1,1), & exc(1,1,2), & exc(1,2,1), & diff --git a/src/determinants/slater_rules_wee_mono.irp.f b/src/determinants/slater_rules_wee_mono.irp.f index fab8a4a1..cf4f0eec 100644 --- a/src/determinants/slater_rules_wee_mono.irp.f +++ b/src/determinants/slater_rules_wee_mono.irp.f @@ -13,7 +13,7 @@ subroutine i_Wee_j_mono(key_i,key_j,Nint,spin,hij) integer :: exc(0:2,2) double precision :: phase - PROVIDE big_array_exchange_integrals mo_bielec_integrals_in_map + PROVIDE big_array_exchange_integrals mo_two_e_integrals_in_map call get_mono_excitation_spin(key_i(1,spin),key_j(1,spin),exc,phase,Nint) call mono_excitation_wee(key_i,key_j,exc(1,1),exc(1,2),spin,phase,hij) @@ -53,7 +53,7 @@ double precision function diag_wee_mat_elem(det_in,Nint) nexc(2) = nexc(2) + popcnt(hole(i,2)) enddo - diag_wee_mat_elem = bi_elec_ref_bitmask_energy + diag_wee_mat_elem = ref_bitmask_two_e_energy if (nexc(1)+nexc(2) == 0) then return endif @@ -75,15 +75,15 @@ double precision function diag_wee_mat_elem(det_in,Nint) nb = elec_num_tab(iand(ispin,1)+1) do i=1,nexc(ispin) !DIR$ FORCEINLINE - call ac_operator_bielec( occ_particle(i,ispin), ispin, det_tmp, diag_wee_mat_elem, Nint,na,nb) + call ac_operator_two_e( occ_particle(i,ispin), ispin, det_tmp, diag_wee_mat_elem, Nint,na,nb) !DIR$ FORCEINLINE - call a_operator_bielec ( occ_hole (i,ispin), ispin, det_tmp, diag_wee_mat_elem, Nint,na,nb) + call a_operator_two_e ( occ_hole (i,ispin), ispin, det_tmp, diag_wee_mat_elem, Nint,na,nb) enddo enddo end -subroutine a_operator_bielec(iorb,ispin,key,hjj,Nint,na,nb) +subroutine a_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) use bitmasks implicit none BEGIN_DOC @@ -116,18 +116,18 @@ subroutine a_operator_bielec(iorb,ispin,key,hjj,Nint,na,nb) ! Same spin do i=1,na - hjj = hjj - mo_bielec_integral_jj_anti(occ(i,ispin),iorb) + hjj = hjj - mo_two_e_integrals_jj_anti(occ(i,ispin),iorb) enddo ! Opposite spin do i=1,nb - hjj = hjj - mo_bielec_integral_jj(occ(i,other_spin),iorb) + hjj = hjj - mo_two_e_integrals_jj(occ(i,other_spin),iorb) enddo end -subroutine ac_operator_bielec(iorb,ispin,key,hjj,Nint,na,nb) +subroutine ac_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) use bitmasks implicit none BEGIN_DOC @@ -162,19 +162,19 @@ subroutine ac_operator_bielec(iorb,ispin,key,hjj,Nint,na,nb) ! Same spin do i=1,na - hjj = hjj + mo_bielec_integral_jj_anti(occ(i,ispin),iorb) + hjj = hjj + mo_two_e_integrals_jj_anti(occ(i,ispin),iorb) enddo ! Opposite spin do i=1,nb - hjj = hjj + mo_bielec_integral_jj(occ(i,other_spin),iorb) + hjj = hjj + mo_two_e_integrals_jj(occ(i,other_spin),iorb) enddo na = na+1 end -subroutine i_H_j_mono_spin_monoelec(key_i,key_j,Nint,spin,hij) +subroutine i_H_j_mono_spin_one_e(key_i,key_j,Nint,spin,hij) use bitmasks implicit none BEGIN_DOC @@ -192,11 +192,11 @@ subroutine i_H_j_mono_spin_monoelec(key_i,key_j,Nint,spin,hij) integer :: m,p m = exc(1,1) p = exc(1,2) - hij = phase * mo_mono_elec_integral(m,p) + hij = phase * mo_one_e_integrals(m,p) end -double precision function diag_H_mat_elem_monoelec(det_in,Nint) +double precision function diag_H_mat_elem_one_e(det_in,Nint) use bitmasks implicit none BEGIN_DOC @@ -217,7 +217,7 @@ double precision function diag_H_mat_elem_monoelec(det_in,Nint) ASSERT (sum(popcnt(det_in(:,1))) == elec_alpha_num) ASSERT (sum(popcnt(det_in(:,2))) == elec_beta_num) - diag_H_mat_elem_monoelec = 0.d0 + diag_H_mat_elem_one_e = 0.d0 !call debug_det(det_in,Nint) integer :: tmp(2) @@ -225,13 +225,13 @@ double precision function diag_H_mat_elem_monoelec(det_in,Nint) call bitstring_to_list_ab(det_in, occ_particle, tmp, Nint) do ispin = 1,2 do i = 1, tmp(ispin) - diag_H_mat_elem_monoelec += mo_mono_elec_integral(occ_particle(i,ispin),occ_particle(i,ispin)) + diag_H_mat_elem_one_e += mo_one_e_integrals(occ_particle(i,ispin),occ_particle(i,ispin)) enddo enddo end -subroutine i_H_j_monoelec(key_i,key_j,Nint,hij) +subroutine i_H_j_one_e(key_i,key_j,Nint,hij) use bitmasks implicit none BEGIN_DOC @@ -242,7 +242,7 @@ subroutine i_H_j_monoelec(key_i,key_j,Nint,hij) double precision, intent(out) :: hij integer :: degree,m,p - double precision :: diag_H_mat_elem_monoelec,phase + double precision :: diag_H_mat_elem_one_e,phase integer :: exc(0:2,2,2) call get_excitation_degree(key_i,key_j,degree,Nint) hij = 0.d0 @@ -250,7 +250,7 @@ subroutine i_H_j_monoelec(key_i,key_j,Nint,hij) return endif if(degree==0)then - hij = diag_H_mat_elem_monoelec(key_i,N_int) + hij = diag_H_mat_elem_one_e(key_i,N_int) else call get_mono_excitation(key_i,key_j,exc,phase,Nint) if (exc(0,1,1) == 1) then @@ -262,12 +262,12 @@ subroutine i_H_j_monoelec(key_i,key_j,Nint,hij) m = exc(1,1,2) p = exc(1,2,2) endif - hij = phase * mo_mono_elec_integral(m,p) + hij = phase * mo_one_e_integrals(m,p) endif end -subroutine i_H_j_bielec(key_i,key_j,Nint,hij) +subroutine i_H_j_two_e(key_i,key_j,Nint,hij) use bitmasks implicit none BEGIN_DOC @@ -279,13 +279,13 @@ subroutine i_H_j_bielec(key_i,key_j,Nint,hij) integer :: exc(0:2,2,2) integer :: degree - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral integer :: m,n,p,q integer :: i,j,k integer :: occ(Nint*bit_kind_size,2) double precision :: diag_H_mat_elem, phase,phase_2 integer :: n_occ_ab(2) - PROVIDE mo_bielec_integrals_in_map mo_integrals_map big_array_exchange_integrals bi_elec_ref_bitmask_energy + PROVIDE mo_two_e_integrals_in_map mo_integrals_map big_array_exchange_integrals ref_bitmask_two_e_energy ASSERT (Nint > 0) ASSERT (Nint == N_int) @@ -308,7 +308,7 @@ subroutine i_H_j_bielec(key_i,key_j,Nint,hij) else if (exc(1,2,1) ==exc(1,1,2))then hij = phase * big_array_exchange_integrals(exc(1,2,1),exc(1,1,1),exc(1,2,2)) else - hij = phase*get_mo_bielec_integral( & + hij = phase*get_two_e_integral( & exc(1,1,1), & exc(1,1,2), & exc(1,2,1), & @@ -316,24 +316,24 @@ subroutine i_H_j_bielec(key_i,key_j,Nint,hij) endif else if (exc(0,1,1) == 2) then ! Double alpha - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(1,2,1), & exc(2,2,1) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,1), & exc(2,1,1), & exc(2,2,1), & exc(1,2,1) ,mo_integrals_map) ) else if (exc(0,1,2) == 2) then ! Double beta - hij = phase*(get_mo_bielec_integral( & + hij = phase*(get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(1,2,2), & exc(2,2,2) ,mo_integrals_map) - & - get_mo_bielec_integral( & + get_two_e_integral( & exc(1,1,2), & exc(2,1,2), & exc(2,2,2), & diff --git a/src/determinants/spindeterminants.irp.f b/src/determinants/spindeterminants.irp.f index 94f1ad1e..7015815e 100644 --- a/src/determinants/spindeterminants.irp.f +++ b/src/determinants/spindeterminants.irp.f @@ -872,7 +872,7 @@ BEGIN_PROVIDER [ integer, singles_alpha_size ] BEGIN_DOC ! Dimension of the singles_alpha array END_DOC - singles_alpha_size = elec_alpha_num * (mo_tot_num - elec_alpha_num) + singles_alpha_size = elec_alpha_num * (mo_num - elec_alpha_num) END_PROVIDER BEGIN_PROVIDER [ integer*8, singles_alpha_csc_idx, (N_det_alpha_unique+1) ] diff --git a/src/dft_keywords/README.rst b/src/dft_keywords/README.rst index a5dae423..4de9b136 100644 --- a/src/dft_keywords/README.rst +++ b/src/dft_keywords/README.rst @@ -8,6 +8,6 @@ This module contains the main keywords related to a DFT calculation or RS-DFT ca * :option:`dft_keywords correlation_functional` * :option:`dft_keywords HF_exchange` : only relevent for the :c:func:`rs_ks_scf` program -The keyword for the **range separation parameter** :math:`\mu` is the :option:`ao_two_e_erf_integrals mu_erf` keyword. +The keyword for the **range separation parameter** :math:`\mu` is the :option:`ao_two_e_erf_ints mu_erf` keyword. The keyword for the type of density used in RS-DFT calculation with a multi-configurational wave function is the :option:`density_for_dft density_for_dft` keyword. diff --git a/src/dft_utils_in_r/dm_in_r.irp.f b/src/dft_utils_in_r/dm_in_r.irp.f index 33da7ffe..f87397d8 100644 --- a/src/dft_utils_in_r/dm_in_r.irp.f +++ b/src/dft_utils_in_r/dm_in_r.irp.f @@ -109,7 +109,7 @@ end integer :: i,j,k,l,m,istate double precision :: contrib double precision :: r(3) - double precision :: aos_array(ao_num),mos_array(mo_tot_num) + double precision :: aos_array(ao_num),mos_array(mo_num) do j = 1, nucl_num do k = 1, n_points_radial_grid -1 do l = 1, n_points_integration_angular diff --git a/src/dft_utils_in_r/mo_in_r.irp.f b/src/dft_utils_in_r/mo_in_r.irp.f index d844a88d..9c92481c 100644 --- a/src/dft_utils_in_r/mo_in_r.irp.f +++ b/src/dft_utils_in_r/mo_in_r.irp.f @@ -1,5 +1,5 @@ - BEGIN_PROVIDER[double precision, mos_in_r_array, (mo_tot_num,n_points_final_grid)] -&BEGIN_PROVIDER[double precision, mos_in_r_array_transp,(n_points_final_grid,mo_tot_num)] + BEGIN_PROVIDER[double precision, mos_in_r_array, (mo_num,n_points_final_grid)] +&BEGIN_PROVIDER[double precision, mos_in_r_array_transp,(n_points_final_grid,mo_num)] implicit none BEGIN_DOC ! mos_in_r_array(i,j) = value of the ith mo on the jth grid point @@ -7,13 +7,13 @@ ! mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point END_DOC integer :: i,j - double precision :: mos_array(mo_tot_num), r(3) + double precision :: mos_array(mo_num), r(3) do i = 1, n_points_final_grid r(1) = final_grid_points(1,i) r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) call give_all_mos_at_r(r,mos_array) - do j = 1, mo_tot_num + do j = 1, mo_num mos_in_r_array(j,i) = mos_array(j) mos_in_r_array_transp(i,j) = mos_array(j) enddo @@ -21,7 +21,7 @@ END_PROVIDER - BEGIN_PROVIDER[double precision, mos_grad_in_r_array,(mo_tot_num,n_points_final_grid,3)] + BEGIN_PROVIDER[double precision, mos_grad_in_r_array,(mo_num,n_points_final_grid,3)] implicit none BEGIN_DOC ! mos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith mo on the jth grid point @@ -33,11 +33,11 @@ integer :: m mos_grad_in_r_array = 0.d0 do m=1,3 - call dgemm('N','N',mo_tot_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_tot_num,aos_grad_in_r_array(1,1,m),ao_num,0.d0,mos_grad_in_r_array(1,1,m),mo_tot_num) + call dgemm('N','N',mo_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_num,aos_grad_in_r_array(1,1,m),ao_num,0.d0,mos_grad_in_r_array(1,1,m),mo_num) enddo END_PROVIDER - BEGIN_PROVIDER[double precision, mos_lapl_in_r_array,(mo_tot_num,n_points_final_grid,3)] + BEGIN_PROVIDER[double precision, mos_lapl_in_r_array,(mo_num,n_points_final_grid,3)] implicit none BEGIN_DOC ! mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point @@ -49,7 +49,7 @@ integer :: m mos_lapl_in_r_array = 0.d0 do m=1,3 - call dgemm('N','N',mo_tot_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_tot_num,aos_lapl_in_r_array(1,1,m),ao_num,0.d0,mos_lapl_in_r_array(1,1,m),mo_tot_num) + call dgemm('N','N',mo_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_num,aos_lapl_in_r_array(1,1,m),ao_num,0.d0,mos_lapl_in_r_array(1,1,m),mo_num) enddo END_PROVIDER diff --git a/src/dft_utils_one_e/NEED b/src/dft_utils_one_e/NEED index abda94d1..3bebd333 100644 --- a/src/dft_utils_one_e/NEED +++ b/src/dft_utils_one_e/NEED @@ -1,8 +1,8 @@ density_for_dft dft_utils_in_r -mo_one_e_integrals -mo_two_e_integrals -ao_one_e_integrals -ao_two_e_integrals -mo_two_e_erf_integrals -ao_two_e_erf_integrals +mo_one_e_ints +mo_two_e_ints +ao_one_e_ints +ao_two_e_ints +mo_two_e_erf_ints +ao_two_e_erf_ints diff --git a/src/dft_utils_one_e/one_e_energy_dft.irp.f b/src/dft_utils_one_e/one_e_energy_dft.irp.f index 8aca035b..cb0e12ca 100644 --- a/src/dft_utils_one_e/one_e_energy_dft.irp.f +++ b/src/dft_utils_one_e/one_e_energy_dft.irp.f @@ -10,16 +10,16 @@ psi_dft_energy_kinetic = 0.d0 psi_dft_energy_nuclear_elec = 0.d0 do istate = 1, N_states - do i = 1, mo_tot_num - do j = 1, mo_tot_num - psi_dft_energy_kinetic(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_kinetic_integral(j,i) - psi_dft_energy_nuclear_elec(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_nucl_elec_integral(j,i) + do i = 1, mo_num + do j = 1, mo_num + psi_dft_energy_kinetic(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_kinetic_integrals(j,i) + psi_dft_energy_nuclear_elec(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_integrals_n_e(j,i) enddo enddo enddo accu = 0.d0 do i = 1, N_states - do j = 1, mo_tot_num + do j = 1, mo_num accu += one_body_dm_mo_alpha_for_dft(j,j,i) + one_body_dm_mo_beta_for_dft(j,j,i) enddo accu = (elec_alpha_num + elec_beta_num ) / accu diff --git a/src/dft_utils_one_e/pot_general.irp.f b/src/dft_utils_one_e/pot_general.irp.f index c9cff11f..4c80cc81 100644 --- a/src/dft_utils_one_e/pot_general.irp.f +++ b/src/dft_utils_one_e/pot_general.irp.f @@ -57,10 +57,10 @@ END_PROVIDER - BEGIN_PROVIDER [double precision, potential_x_alpha_mo,(mo_tot_num,mo_tot_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_x_beta_mo,(mo_tot_num,mo_tot_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_c_alpha_mo,(mo_tot_num,mo_tot_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_c_beta_mo,(mo_tot_num,mo_tot_num,N_states)] + BEGIN_PROVIDER [double precision, potential_x_alpha_mo,(mo_num,mo_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_x_beta_mo,(mo_num,mo_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_alpha_mo,(mo_num,mo_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_beta_mo,(mo_num,mo_num,N_states)] implicit none BEGIN_DOC ! general providers for the alpha/beta exchange/correlation potentials on the MO basis @@ -114,8 +114,8 @@ END_PROVIDER do istate = 1, N_states Trace_v_xc(istate) = 0.d0 Trace_v_H(istate) = 0.d0 - do i = 1, mo_tot_num - do j = 1, mo_tot_num + do i = 1, mo_num + do j = 1, mo_num Trace_v_xc(istate) += (potential_x_alpha_mo(j,i,istate) + potential_c_alpha_mo(j,i,istate)) * one_body_dm_mo_alpha_for_dft(j,i,istate) Trace_v_xc(istate) += (potential_x_beta_mo(j,i,istate) + potential_c_beta_mo(j,i,istate) ) * one_body_dm_mo_beta_for_dft(j,i,istate) dm = one_body_dm_mo_alpha_for_dft(j,i,istate) + one_body_dm_mo_beta_for_dft(j,i,istate) diff --git a/src/dft_utils_one_e/sr_coulomb.irp.f b/src/dft_utils_one_e/sr_coulomb.irp.f index 07234c8e..4187a8da 100644 --- a/src/dft_utils_one_e/sr_coulomb.irp.f +++ b/src/dft_utils_one_e/sr_coulomb.irp.f @@ -1,4 +1,4 @@ - BEGIN_PROVIDER [double precision, short_range_Hartree_operator, (mo_tot_num,mo_tot_num,N_states)] + BEGIN_PROVIDER [double precision, short_range_Hartree_operator, (mo_num,mo_num,N_states)] &BEGIN_PROVIDER [double precision, short_range_Hartree, (N_states)] implicit none BEGIN_DOC @@ -9,19 +9,19 @@ ! = $1/2 \int dr \int r' \rho(r) \rho(r') W_{ee}^{sr}$ END_DOC integer :: i,j,k,l,m,n,istate - double precision :: get_mo_bielec_integral,get_mo_bielec_integral_erf + double precision :: get_two_e_integral,get_mo_two_e_integral_erf double precision :: integral, integral_erf, contrib - double precision :: integrals_array(mo_tot_num,mo_tot_num),integrals_erf_array(mo_tot_num,mo_tot_num) + double precision :: integrals_array(mo_num,mo_num),integrals_erf_array(mo_num,mo_num) short_range_Hartree_operator = 0.d0 short_range_Hartree = 0.d0 - do i = 1, mo_tot_num - do j = 1, mo_tot_num + do i = 1, mo_num + do j = 1, mo_num if(dabs(one_body_dm_average_mo_for_dft(j,i)).le.1.d-12)cycle - call get_mo_bielec_integrals_i1j1(i,j,mo_tot_num,integrals_array,mo_integrals_map) - call get_mo_bielec_integrals_erf_i1j1(i,j,mo_tot_num,integrals_erf_array,mo_integrals_erf_map) + call get_mo_two_e_integrals_i1j1(i,j,mo_num,integrals_array,mo_integrals_map) + call get_mo_two_e_integrals_erf_i1j1(i,j,mo_num,integrals_erf_array,mo_integrals_erf_map) do istate = 1, N_states - do k = 1, mo_tot_num - do l = 1, mo_tot_num + do k = 1, mo_num + do l = 1, mo_num integral = integrals_array(l,k) integral_erf = integrals_erf_array(l,k) contrib = one_body_dm_mo_for_dft(i,j,istate) * (integral - integral_erf) @@ -37,8 +37,8 @@ END_PROVIDER - BEGIN_PROVIDER [double precision, effective_one_e_potential, (mo_tot_num, mo_tot_num,N_states)] -&BEGIN_PROVIDER [double precision, effective_one_e_potential_without_kin, (mo_tot_num, mo_tot_num,N_states)] + BEGIN_PROVIDER [double precision, effective_one_e_potential, (mo_num, mo_num,N_states)] +&BEGIN_PROVIDER [double precision, effective_one_e_potential_without_kin, (mo_num, mo_num,N_states)] implicit none integer :: i,j,istate effective_one_e_potential = 0.d0 @@ -52,12 +52,12 @@ END_PROVIDER ! shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal END_DOC do istate = 1, N_states - do i = 1, mo_tot_num - do j = 1, mo_tot_num - effective_one_e_potential(i,j,istate) = short_range_Hartree_operator(i,j,istate) + mo_nucl_elec_integral(i,j) + mo_kinetic_integral(i,j) & + do i = 1, mo_num + do j = 1, mo_num + effective_one_e_potential(i,j,istate) = short_range_Hartree_operator(i,j,istate) + mo_integrals_n_e(i,j) + mo_kinetic_integrals(i,j) & + 0.5d0 * (potential_x_alpha_mo(i,j,istate) + potential_c_alpha_mo(i,j,istate) & + potential_x_beta_mo(i,j,istate) + potential_c_beta_mo(i,j,istate) ) - effective_one_e_potential_without_kin(i,j,istate) = short_range_Hartree_operator(i,j,istate) + mo_nucl_elec_integral(i,j) & + effective_one_e_potential_without_kin(i,j,istate) = short_range_Hartree_operator(i,j,istate) + mo_integrals_n_e(i,j) & + 0.5d0 * (potential_x_alpha_mo(i,j,istate) + potential_c_alpha_mo(i,j,istate) & + potential_x_beta_mo(i,j,istate) + potential_c_beta_mo(i,j,istate) ) enddo diff --git a/src/dressing/alpha_factory.irp.f b/src/dressing/alpha_factory.irp.f index 8f558c19..20b3eee4 100644 --- a/src/dressing/alpha_factory.irp.f +++ b/src/dressing/alpha_factory.irp.f @@ -187,10 +187,10 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index allocate(minilist(N_int, 2, N_det_selectors), fullminilist(N_int, 2, N_det)) - allocate(banned(mo_tot_num, mo_tot_num,2), bannedOrb(mo_tot_num, 2)) - allocate(counted(mo_tot_num, mo_tot_num), countedOrb(mo_tot_num, 2)) - allocate (indexes(0:mo_tot_num, 0:mo_tot_num)) - allocate (indexes_end(0:mo_tot_num, 0:mo_tot_num)) + allocate(banned(mo_num, mo_num,2), bannedOrb(mo_num, 2)) + allocate(counted(mo_num, mo_num), countedOrb(mo_num, 2)) + allocate (indexes(0:mo_num, 0:mo_num)) + allocate (indexes_end(0:mo_num, 0:mo_num)) integer :: nb_count do s1=1,2 do i1=N_holes(s1),1,-1 ! Generate low excitations first @@ -322,7 +322,7 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index h2 = hole_list(i2,s2) call apply_hole(pmask, s2,h2, mask, ok, N_int) banned = .false. - do j=1,mo_tot_num + do j=1,mo_num bannedOrb(j, 1) = .true. bannedOrb(j, 2) = .true. enddo @@ -370,15 +370,15 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned, implicit none double precision,intent(inout) :: delta_ij_loc(N_states,N_det,2) - integer, intent(in) :: sp, indexes(0:mo_tot_num, 0:mo_tot_num), siz, iproc, i_gen - integer, intent(in) :: indexes_end(0:mo_tot_num, 0:mo_tot_num), rabuf(*) - logical, intent(in) :: bannedOrb(mo_tot_num,2), banned(mo_tot_num, mo_tot_num) + integer, intent(in) :: sp, indexes(0:mo_num, 0:mo_num), siz, iproc, i_gen + integer, intent(in) :: indexes_end(0:mo_num, 0:mo_num), rabuf(*) + logical, intent(in) :: bannedOrb(mo_num,2), banned(mo_num, mo_num) integer(bit_kind), intent(in) :: mask(N_int, 2) integer(bit_kind) :: alpha(N_int, 2) integer, allocatable :: labuf(:), abuf(:), iorder(:) logical :: ok integer :: i,j,k,s,st1,st2,st3,st4,t2 - integer :: lindex(mo_tot_num,2), lindex_end(mo_tot_num, 2) + integer :: lindex(mo_num,2), lindex_end(mo_num, 2) integer :: s1, s2, stamo integer(bit_kind), allocatable :: det_minilist(:,:,:) @@ -420,7 +420,7 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned, lindex_end(:,1) = indexes_end(1:, 0)-1 end if - do i=1,mo_tot_num + do i=1,mo_num do j=1,2 if(lindex(i,j) > 0 .and. lindex_end(i,j) > lindex(i,j)) then call isort(abuf(lindex(i,j)), iorder, lindex_end(i,j)-lindex(i,j)+1) @@ -429,7 +429,7 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned, end do - do i=1,mo_tot_num + do i=1,mo_num if(bannedOrb(i,s1)) cycle if(lindex(i,s1) /= 0) then st2 = st1 + 1 + lindex_end(i,s1)-lindex(i,s1) @@ -447,7 +447,7 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned, stamo = i+1 end if - do j=stamo,mo_tot_num + do j=stamo,mo_num if(bannedOrb(j,s2) .or. banned(i,j)) cycle if(lindex(j,s2) /= 0) then k = lindex(j,s2) @@ -498,8 +498,8 @@ subroutine create_indexes(countedGlob, countedOrb, counted, indexes, siz) use bitmasks implicit none - integer, intent(in) :: countedGlob, countedOrb(mo_tot_num,2), counted(mo_tot_num, mo_tot_num) - integer, intent(out) :: indexes(0:mo_tot_num, 0:mo_tot_num), siz + integer, intent(in) :: countedGlob, countedOrb(mo_num,2), counted(mo_num, mo_num) + integer, intent(out) :: indexes(0:mo_num, 0:mo_num), siz integer :: tmp, i, j indexes(0, 0) = countedGlob @@ -509,8 +509,8 @@ subroutine create_indexes(countedGlob, countedOrb, counted, indexes, siz) siz = 1 - do i=0, mo_tot_num - do j=0, mo_tot_num + do i=0, mo_num + do j=0, mo_num if(indexes(i,j) == 0) cycle tmp = indexes(i,j) indexes(i,j) = siz @@ -529,8 +529,8 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob, integer, intent(in) :: sp, i_gen, N_sel integer, intent(in) :: interesting(0:N_sel) integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N_sel) - logical, intent(inout) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num, 2) - integer, intent(inout) :: countedGlob, countedOrb(mo_tot_num, 2), counted(mo_tot_num, mo_tot_num) + logical, intent(inout) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num, 2) + integer, intent(inout) :: countedGlob, countedOrb(mo_num, 2), counted(mo_num, mo_num) integer :: i, s, ii, j, k, l, h(0:2,2), p(0:4,2), nt @@ -568,7 +568,7 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob, if (interesting(i) == i_gen) then do s=1,2 - do j=1,mo_tot_num + do j=1,mo_num if(bannedOrb(j, s)) then if(sp == 3 .and. s == 1) then banned(j, :, 1) = .true. @@ -583,14 +583,14 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob, end do if(sp == 3) then - do j=1,mo_tot_num - do k=1,mo_tot_num + do j=1,mo_num + do k=1,mo_num banned(j,k,2) = banned(k,j,1) enddo enddo else - do k=1,mo_tot_num - do l=k+1,mo_tot_num + do k=1,mo_num + do l=k+1,mo_num banned(l,k,1) = banned(k,l,1) end do end do @@ -625,10 +625,10 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob, end if end do - do i=1,mo_tot_num + do i=1,mo_num if(bannedOrb(i,1)) countedOrb(i,1) = 0 if(bannedOrb(i,2)) countedOrb(i,2) = 0 - do j=1,mo_tot_num + do j=1,mo_num if(banned(i,j,1)) counted(i,j) = 0 end do end do @@ -647,8 +647,8 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, indexes, ab integer, intent(in) :: sp, i_gen, N_sel integer, intent(in) :: interesting(0:N_sel) integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N_sel) - logical, intent(inout) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num, 2) - integer, intent(inout) :: indexes(0:mo_tot_num, 0:mo_tot_num) + logical, intent(inout) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num, 2) + integer, intent(inout) :: indexes(0:mo_num, 0:mo_num) integer, intent(inout) :: abuf(*) integer :: i, ii, j, k, l, h(0:2,2), p(0:4,2), nt, s integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2) @@ -717,12 +717,12 @@ subroutine get_d2(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2) integer, intent(inout) :: abuf(*) integer, intent(in) :: i_gen - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) - integer, intent(inout) :: indexes(0:mo_tot_num, 0:mo_tot_num) + logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num,2) + integer, intent(inout) :: indexes(0:mo_num, 0:mo_num) integer, intent(in) :: h(0:2,2), p(0:4,2), sp !double precision, external :: get_phase_bi - double precision, external :: mo_bielec_integral + double precision, external :: mo_two_e_integral integer :: i, j, tip, ma, mi, puti, putj integer :: h1, h2, p1, p2, i1, i2 @@ -758,7 +758,7 @@ subroutine get_d2(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) !h1 = h(1, ma) !h2 = h(2, ma) - !hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2) + !hij = (mo_two_e_integral(p1, p2, h1, h2) - mo_two_e_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2) if(ma == 1) then abuf(indexes(putj, puti)) = i_gen indexes(putj, puti) += 1 @@ -779,7 +779,7 @@ subroutine get_d2(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) if(banned(puti,putj,bant)) cycle !p1 = p(turn2(i), 1) - !hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2) + !hij = mo_two_e_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2) abuf(indexes(puti, putj)) = i_gen indexes(puti, putj) += 1 @@ -801,7 +801,7 @@ subroutine get_d2(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) !i2 = turn2d(2, i, j) !p1 = p(i1, ma) !p2 = p(i2, ma) - !hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2) + !hij = (mo_two_e_integral(p1, p2, h1, h2) - mo_two_e_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2) abuf(indexes(puti, putj)) = i_gen indexes(puti, putj) += 1 end do @@ -816,7 +816,7 @@ subroutine get_d2(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) if(banned(puti,putj,1)) cycle !p2 = p(i, ma) - !hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, mi, ma, h1, p1, h2, p2) + !hij = mo_two_e_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, mi, ma, h1, p1, h2, p2) abuf(indexes(min(puti, putj), max(puti, putj))) = i_gen indexes(min(puti, putj), max(puti, putj)) += 1 end do @@ -828,7 +828,7 @@ subroutine get_d2(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) !p2 = p(2, mi) !h1 = h(1, mi) !h2 = h(2, mi) - !hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, mi, mi, h1, p1, h2, p2) + !hij = (mo_two_e_integral(p1, p2, h1, h2) - mo_two_e_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, mi, mi, h1, p1, h2, p2) abuf(indexes(puti, putj)) = i_gen indexes(puti, putj) += 1 @@ -845,13 +845,13 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2) integer, intent(inout) :: abuf(*) integer,intent(in) :: i_gen - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) + logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num,2) integer(bit_kind) :: det(N_int, 2) - integer, intent(inout) :: indexes(0:mo_tot_num, 0:mo_tot_num) + integer, intent(inout) :: indexes(0:mo_num, 0:mo_num) integer, intent(in) :: h(0:2,2), p(0:4,2), sp - double precision :: hij, tmp_row(N_states, mo_tot_num), tmp_row2(N_states, mo_tot_num) + double precision :: hij, tmp_row(N_states, mo_num), tmp_row2(N_states, mo_num) !double precision, external :: get_phase_bi - double precision, external :: mo_bielec_integral + double precision, external :: mo_two_e_integral logical :: ok logical, allocatable :: lbanned(:,:) @@ -865,7 +865,7 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) integer :: phasemask(2,N_int*bit_kind_size) - allocate (lbanned(mo_tot_num, 2)) + allocate (lbanned(mo_num, 2)) lbanned = bannedOrb do i=1, p(0,1) @@ -892,22 +892,22 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) !tmp_row = 0d0 !do putj=1, hfix-1 ! if(lbanned(putj, ma) .or. banned(putj, puti,bant)) cycle - ! hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) + ! hij = (mo_two_e_integral(p1, p2, putj, hfix)-mo_two_e_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) ! tmp_row(1:N_states,putj) += hij * coefs(1:N_states) !end do - !do putj=hfix+1, mo_tot_num + !do putj=hfix+1, mo_num ! if(lbanned(putj, ma) .or. banned(putj, puti,bant)) cycle - ! hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) + ! hij = (mo_two_e_integral(p1, p2, hfix, putj)-mo_two_e_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) ! tmp_row(1:N_states,putj) += hij * coefs(1:N_states) !end do if(ma == 1) then - !mat(1:N_states,1:mo_tot_num,puti) += tmp_row(1:N_states,1:mo_tot_num) + !mat(1:N_states,1:mo_num,puti) += tmp_row(1:N_states,1:mo_num) abuf(indexes(0, puti)) = i_gen indexes(0, puti) += 1 !countedOrb(puti, 2) -= 1 else - !mat(1:N_states,puti,1:mo_tot_num) += tmp_row(1:N_states,1:mo_tot_num) + !mat(1:N_states,puti,1:mo_num) += tmp_row(1:N_states,1:mo_num) abuf(indexes(puti, 0)) = i_gen indexes(puti, 0) += 1 !countedOrb(puti, 1) -= 1 @@ -918,18 +918,18 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) !pfix = p(1,mi) !tmp_row = 0d0 !tmp_row2 = 0d0 - !do puti=1,mo_tot_num + !do puti=1,mo_num ! if(lbanned(puti,mi)) cycle !p1 fixed ! putj = p1 !if(.not. banned(putj,puti,bant)) then - ! hij = mo_bielec_integral(p2,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p2, puti, pfix) + ! hij = mo_two_e_integral(p2,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p2, puti, pfix) ! tmp_row(:,puti) += hij * coefs(:) !end if ! putj = p2 !if(.not. banned(putj,puti,bant)) then - ! hij = mo_bielec_integral(p1,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p1, puti, pfix) + ! hij = mo_two_e_integral(p1,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p1, puti, pfix) ! tmp_row2(:,puti) += hij * coefs(:) !end if !end do @@ -963,12 +963,12 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) !tmp_row = 0d0 !do putj=1,hfix-1 ! if(lbanned(putj,ma) .or. banned(puti,putj,1)) cycle - ! hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) + ! hij = (mo_two_e_integral(p1, p2, putj, hfix)-mo_two_e_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) ! tmp_row(:,putj) += hij * coefs(:) !end do - !do putj=hfix+1,mo_tot_num + !do putj=hfix+1,mo_num ! if(lbanned(putj,ma) .or. banned(puti,putj,1)) cycle - ! hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) + ! hij = (mo_two_e_integral(p1, p2, hfix, putj)-mo_two_e_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) ! tmp_row(:,putj) += hij * coefs(:) !end do @@ -991,17 +991,17 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp) p2 = p(2,ma) !tmp_row = 0d0 !tmp_row2 = 0d0 - !do puti=1,mo_tot_num + !do puti=1,mo_num ! if(lbanned(puti,ma)) cycle ! putj = p2 !if(.not. banned(puti,putj,1)) then - ! hij = mo_bielec_integral(pfix, p1, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p1) + ! hij = mo_two_e_integral(pfix, p1, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p1) ! tmp_row(:,puti) += hij * coefs(:) !end if ! putj = p1 !if(.not. banned(puti,putj,1)) then - ! hij = mo_bielec_integral(pfix, p2, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p2) + ! hij = mo_two_e_integral(pfix, p2, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p2) ! tmp_row2(:,puti) += hij * coefs(:) !end if !end do @@ -1055,7 +1055,7 @@ subroutine past_d1(bannedOrb, p) use bitmasks implicit none - logical, intent(inout) :: bannedOrb(mo_tot_num, 2) + logical, intent(inout) :: bannedOrb(mo_num, 2) integer, intent(in) :: p(0:4, 2) integer :: i,s @@ -1071,7 +1071,7 @@ subroutine past_d2(banned, p, sp) use bitmasks implicit none - logical, intent(inout) :: banned(mo_tot_num, mo_tot_num) + logical, intent(inout) :: banned(mo_num, mo_num) integer, intent(in) :: p(0:4, 2), sp integer :: i,j @@ -1096,7 +1096,7 @@ subroutine count_d1(countedOrb, p) use bitmasks implicit none - integer, intent(inout) :: countedOrb(mo_tot_num, 2) + integer, intent(inout) :: countedOrb(mo_num, 2) integer, intent(in) :: p(0:4, 2) integer :: i,s @@ -1112,7 +1112,7 @@ subroutine count_d2(counted, p, sp) use bitmasks implicit none - integer, intent(inout) :: counted(mo_tot_num, mo_tot_num) + integer, intent(inout) :: counted(mo_num, mo_num) integer, intent(in) :: p(0:4, 2), sp integer :: i,j @@ -1140,7 +1140,7 @@ subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting) integer, intent(in) :: i_gen, N integer, intent(in) :: interesting(0:N) integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N) - logical, intent(inout) :: banned(mo_tot_num, mo_tot_num) + logical, intent(inout) :: banned(mo_num, mo_num) logical, intent(out) :: fullMatch diff --git a/src/dressing/dress_slave.irp.f b/src/dressing/dress_slave.irp.f index c1a88c8b..0ca609c7 100644 --- a/src/dressing/dress_slave.irp.f +++ b/src/dressing/dress_slave.irp.f @@ -15,7 +15,7 @@ subroutine dress_slave end subroutine provide_everything - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context + PROVIDE H_apply_buffer_allocated mo_two_e_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context end subroutine run_wf diff --git a/src/dressing/dress_stoch_routines.irp.f b/src/dressing/dress_stoch_routines.irp.f index 61dbc5e5..9b1f8337 100644 --- a/src/dressing/dress_stoch_routines.irp.f +++ b/src/dressing/dress_stoch_routines.irp.f @@ -258,7 +258,7 @@ subroutine ZMQ_dress(E, dress, delta_out, delta_s2_out, relative_error) state_average_weight(dress_stoch_istate) = 1.d0 TOUCH state_average_weight dress_stoch_istate - provide nproc mo_bielec_integrals_in_map mo_mono_elec_integral psi_selectors pt2_F pt2_N_teeth dress_M_m + provide nproc mo_two_e_integrals_in_map mo_one_e_integrals psi_selectors pt2_F pt2_N_teeth dress_M_m print *, '========== ================= ================= =================' print *, ' Samples Energy Stat. Error Seconds ' diff --git a/src/dummy/NEED b/src/dummy/NEED index dbb07f92..bcaa86de 100644 --- a/src/dummy/NEED +++ b/src/dummy/NEED @@ -1,7 +1,7 @@ ao_basis -ao_one_e_integrals -ao_two_e_erf_integrals -ao_two_e_integrals +ao_one_e_ints +ao_two_e_erf_ints +ao_two_e_ints aux_quantities becke_numerical_grid bitmask @@ -27,9 +27,9 @@ kohn_sham kohn_sham_rs mo_basis mo_guess -mo_one_e_integrals -mo_two_e_erf_integrals -mo_two_e_integrals +mo_one_e_ints +mo_two_e_erf_ints +mo_two_e_ints mpi nuclei perturbation diff --git a/src/ezfio_files/00.create.bats b/src/ezfio_files/00.create.bats index 89824eb7..3aa1a7b5 100644 --- a/src/ezfio_files/00.create.bats +++ b/src/ezfio_files/00.create.bats @@ -19,7 +19,7 @@ function run { qp_edit -c $EZ ezfio set_file $EZ ezfio set scf_utils thresh_scf 1.e-12 - echo "Write" > ${EZ}/ao_two_e_integrals/disk_access_ao_integrals + ezfio set ao_two_e_ints io_ao_two_e_integrals "Write" } diff --git a/src/ezfio_files/01.convert.bats b/src/ezfio_files/01.convert.bats index c40b2e3f..6df43d1e 100644 --- a/src/ezfio_files/01.convert.bats +++ b/src/ezfio_files/01.convert.bats @@ -10,7 +10,7 @@ function run { qp_edit -c $EZ ezfio set_file $EZ ezfio set scf_utils thresh_scf 1.e-12 - echo "Write" > ${EZ}/ao_two_e_integrals/disk_access_ao_integrals + echo "Write" > ${EZ}/ao_two_e_ints/io_ao_two_e_integrals } @test "HBO GAMESS" { diff --git a/src/fci/30.fci.bats b/src/fci/30.fci.bats deleted file mode 100644 index de5493ba..00000000 --- a/src/fci/30.fci.bats +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bats - -source $QP_ROOT/tests/bats/common.bats.sh - -function run_FCI() { - thresh=5.e-5 - test_exe fci || skip - qp_edit -c $1 - ezfio set_file $1 - ezfio set perturbation do_pt2 True - ezfio set perturbation pt2_relative_error 0.001 - ezfio set determinants n_states 1 - ezfio set determinants n_det_max $2 - ezfio set davidson threshold_davidson 1.e-10 - - qp_run fci $1 - energy="$(ezfio get FCI energy | tr '[]' ' ')" - eq $energy $3 $thresh - energy_pt2="$(ezfio get FCI energy_pt2 | tr '[]' ' ')" - eq $energy_pt2 $4 $thresh -} - - - -#=== H2O - -@test "qp_set_mo_class H2O cc-pVDZ" { - qp_set_mo_class h2o.ezfio -core "[1]" -act "[2-12]" -del "[13-24]" -} - -@test "FCI H2O cc-pVDZ" { - run_FCI h2o.ezfio 2000 -76.1254558901689 -76.1258820944775 -} - -@test "FCI H2O VDZ pseudo" { - qp_set_mo_class h2o_pseudo.ezfio -core "[1]" -act "[2-12]" -del "[13-23]" - run_FCI h2o_pseudo.ezfio 2000 -17.0399798017510 -17.0400546596391 -} - diff --git a/src/fci/pt2.irp.f b/src/fci/pt2.irp.f index 85215a92..94b05adf 100644 --- a/src/fci/pt2.irp.f +++ b/src/fci/pt2.irp.f @@ -7,7 +7,7 @@ program pt2 read_wf = .True. threshold_generators = 1.d0 SOFT_TOUCH read_wf threshold_generators - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map PROVIDE psi_energy call run end diff --git a/src/fci/pt2_stoch_routines.irp.f b/src/fci/pt2_stoch_routines.irp.f index 118bfca3..ab72a80c 100644 --- a/src/fci/pt2_stoch_routines.irp.f +++ b/src/fci/pt2_stoch_routines.irp.f @@ -128,7 +128,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) state_average_weight(pt2_stoch_istate) = 1.d0 TOUCH state_average_weight pt2_stoch_istate - provide nproc pt2_F mo_bielec_integrals_in_map mo_mono_elec_integral pt2_w psi_selectors + provide nproc pt2_F mo_two_e_integrals_in_map mo_one_e_integrals pt2_w psi_selectors call new_parallel_job(zmq_to_qp_run_socket, zmq_socket_pull, 'pt2') integer, external :: zmq_put_psi diff --git a/src/fci/selection.irp.f b/src/fci/selection.irp.f index db6b0484..84672b70 100644 --- a/src/fci/selection.irp.f +++ b/src/fci/selection.irp.f @@ -42,7 +42,7 @@ subroutine select_connected(i_generator,E0,pt2,variance,norm,b,subset,csubset) double precision, allocatable :: fock_diag_tmp(:,:) - allocate(fock_diag_tmp(2,mo_tot_num+1)) + allocate(fock_diag_tmp(2,mo_num+1)) call build_fock_tmp(fock_diag_tmp,psi_det_generators(1,1,i_generator),N_int) @@ -110,13 +110,13 @@ subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) integer(bit_kind), intent(in) :: phasemask(N_int,2) - logical, intent(in) :: bannedOrb(mo_tot_num) + logical, intent(in) :: bannedOrb(mo_num) double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: vect(N_states, mo_tot_num) + double precision, intent(inout) :: vect(N_states, mo_num) integer, intent(in) :: sp, h(0:2, 2), p(0:3, 2) integer :: i, j, k, h1, h2, p1, p2, sfix, hfix, pfix, hmob, pmob, puti double precision :: hij - double precision, external :: get_phase_bi, mo_bielec_integral + double precision, external :: get_phase_bi, mo_two_e_integral integer, parameter :: turn3_2(2,3) = reshape((/2,3, 1,3, 1,2/), (/2,3/)) integer, parameter :: turn2(2) = (/2,1/) @@ -129,7 +129,7 @@ subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) if(bannedOrb(puti)) cycle p1 = p(turn3_2(1,i), sp) p2 = p(turn3_2(2,i), sp) - hij = mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2, p1, h1, h2) + hij = mo_two_e_integral(p1, p2, h1, h2) - mo_two_e_integral(p2, p1, h1, h2) hij = hij * get_phase_bi(phasemask, sp, sp, h1, p1, h2, p2, N_int) do k=1,N_states vect(k,puti) = vect(k,puti) + hij * coefs(k) @@ -144,7 +144,7 @@ subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) puti = p(j, sp) if(bannedOrb(puti)) cycle pmob = p(turn2(j), sp) - hij = mo_bielec_integral(pmob, pfix, hmob, hfix) + hij = mo_two_e_integral(pmob, pfix, hmob, hfix) hij = hij * get_phase_bi(phasemask, sp, sfix, hmob, pmob, hfix, pfix, N_int) do k=1,N_states vect(k,puti) = vect(k,puti) + hij * coefs(k) @@ -158,7 +158,7 @@ subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) p2 = p(2,sfix) h1 = h(1,sfix) h2 = h(2,sfix) - hij = (mo_bielec_integral(p1,p2,h1,h2) - mo_bielec_integral(p2,p1,h1,h2)) + hij = (mo_two_e_integral(p1,p2,h1,h2) - mo_two_e_integral(p2,p1,h1,h2)) hij = hij * get_phase_bi(phasemask, sfix, sfix, h1, p1, h2, p2, N_int) do k=1,N_states vect(k,puti) = vect(k,puti) + hij * coefs(k) @@ -175,9 +175,9 @@ subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) integer(bit_kind), intent(in) :: phasemask(N_int,2) - logical, intent(in) :: bannedOrb(mo_tot_num) + logical, intent(in) :: bannedOrb(mo_num) double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: vect(N_states, mo_tot_num) + double precision, intent(inout) :: vect(N_states, mo_num) integer, intent(in) :: sp, h(0:2, 2), p(0:3, 2) integer :: i, hole, p1, p2, sh, k logical :: ok @@ -185,9 +185,9 @@ subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) logical, allocatable :: lbanned(:) integer(bit_kind) :: det(N_int, 2) double precision :: hij - double precision, external :: get_phase_bi, mo_bielec_integral + double precision, external :: get_phase_bi, mo_two_e_integral - allocate (lbanned(mo_tot_num)) + allocate (lbanned(mo_num)) lbanned = bannedOrb sh = 1 if(h(0,2) == 1) sh = 2 @@ -203,9 +203,9 @@ subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) lbanned(p2) = .true. - double precision :: hij_cache(mo_tot_num,2) - call get_mo_bielec_integrals(hole,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) - call get_mo_bielec_integrals(hole,p2,p1,mo_tot_num,hij_cache(1,2),mo_integrals_map) + double precision :: hij_cache(mo_num,2) + call get_mo_two_e_integrals(hole,p1,p2,mo_num,hij_cache(1,1),mo_integrals_map) + call get_mo_two_e_integrals(hole,p2,p1,mo_num,hij_cache(1,2),mo_integrals_map) do i=1,hole-1 if(lbanned(i)) cycle @@ -217,7 +217,7 @@ subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) enddo endif end do - do i=hole+1,mo_tot_num + do i=hole+1,mo_num if(lbanned(i)) cycle hij = hij_cache(i,2)-hij_cache(i,1) if (hij /= 0.d0) then @@ -235,8 +235,8 @@ subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) enddo else p2 = p(1, sh) - call get_mo_bielec_integrals(hole,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) - do i=1,mo_tot_num + call get_mo_two_e_integrals(hole,p1,p2,mo_num,hij_cache(1,1),mo_integrals_map) + do i=1,mo_num if(lbanned(i)) cycle hij = hij_cache(i,1) if (hij /= 0.d0) then @@ -263,9 +263,9 @@ subroutine get_m0(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) integer(bit_kind), intent(in) :: phasemask(N_int,2) - logical, intent(in) :: bannedOrb(mo_tot_num) + logical, intent(in) :: bannedOrb(mo_num) double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: vect(N_states, mo_tot_num) + double precision, intent(inout) :: vect(N_states, mo_num) integer, intent(in) :: sp, h(0:2, 2), p(0:3, 2) integer :: i,k logical :: ok @@ -274,10 +274,10 @@ subroutine get_m0(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) integer(bit_kind) :: det(N_int, 2) double precision :: hij - allocate(lbanned(mo_tot_num)) + allocate(lbanned(mo_num)) lbanned = bannedOrb lbanned(p(1,sp)) = .true. - do i=1,mo_tot_num + do i=1,mo_num if(lbanned(i)) cycle call apply_particle(mask, sp, i, det, ok, N_int) call i_h_j(gen, det, N_int, hij) @@ -299,7 +299,7 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d integer, intent(in) :: i_generator, subset, csubset integer(bit_kind), intent(in) :: hole_mask(N_int,2), particle_mask(N_int,2) - double precision, intent(in) :: fock_diag_tmp(mo_tot_num) + double precision, intent(in) :: fock_diag_tmp(mo_num) double precision, intent(in) :: E0(N_states) double precision, intent(inout) :: pt2(N_states) double precision, intent(inout) :: variance(N_states) @@ -325,7 +325,7 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d double precision :: rss double precision, external :: memory_of_double, memory_of_int rss = memory_of_int( (8*N_int+5)*N_det + N_det_alpha_unique + 4*N_int*N_det_selectors) - rss += memory_of_double(mo_tot_num*mo_tot_num*(N_states+1)) + rss += memory_of_double(mo_num*mo_num*(N_states+1)) call check_mem(rss,irp_here) allocate (preinteresting_det(N_int,2,N_det)) @@ -450,8 +450,8 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d deallocate(indices) allocate(minilist(N_int, 2, N_det_selectors), fullminilist(N_int, 2, N_det)) - allocate(banned(mo_tot_num, mo_tot_num,2), bannedOrb(mo_tot_num, 2)) - allocate (mat(N_states, mo_tot_num, mo_tot_num)) + allocate(banned(mo_num, mo_num,2), bannedOrb(mo_num, 2)) + allocate (mat(N_states, mo_num, mo_num)) maskInd = -1 integer :: nb_count, maskInd_save @@ -605,7 +605,7 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d h2 = hole_list(i2,s2) call apply_hole(pmask, s2,h2, mask, ok, N_int) banned = .false. - do j=1,mo_tot_num + do j=1,mo_num bannedOrb(j, 1) = .true. bannedOrb(j, 2) = .true. enddo @@ -651,9 +651,9 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d implicit none integer, intent(in) :: i_generator, sp, h1, h2 - double precision, intent(in) :: mat(N_states, mo_tot_num, mo_tot_num) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num) - double precision, intent(in) :: fock_diag_tmp(mo_tot_num) + double precision, intent(in) :: mat(N_states, mo_num, mo_num) + logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num) + double precision, intent(in) :: fock_diag_tmp(mo_num) double precision, intent(in) :: E0(N_states) double precision, intent(inout) :: pt2(N_states) double precision, intent(inout) :: variance(N_states) @@ -667,7 +667,7 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d double precision :: E_shift ! double precision, allocatable :: mat_inv(:,:,:) ! -! allocate(mat_inv(N_states,mo_tot_num,mo_tot_num)) +! allocate(mat_inv(N_states,mo_num,mo_num)) logical, external :: detEq @@ -687,12 +687,12 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d E_shift = psi_det_Hii(i_generator) - psi_occ_pattern_Hii(j) endif - do p1=1,mo_tot_num + do p1=1,mo_num if(bannedOrb(p1, s1)) cycle ib = 1 if(sp /= 3) ib = p1+1 -! mat_inv(1:N_states,p1,ib:mo_tot_num) = 1.d0/mat(1:N_states,p1,ib:mo_tot_num) - do p2=ib,mo_tot_num +! mat_inv(1:N_states,p1,ib:mo_num) = 1.d0/mat(1:N_states,p1,ib:mo_num) + do p2=ib,mo_num if(bannedOrb(p2, s2)) cycle if(banned(p1,p2)) cycle @@ -740,8 +740,8 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, intere integer, intent(in) :: sp, i_gen, N_sel integer, intent(in) :: interesting(0:N_sel) integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N_sel) - logical, intent(inout) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num, 2) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) + logical, intent(inout) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num, 2) + double precision, intent(inout) :: mat(N_states, mo_num, mo_num) integer :: i, ii, j, k, l, h(0:2,2), p(0:4,2), nt integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2) @@ -778,14 +778,14 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, intere if (interesting(i) == i_gen) then if(sp == 3) then - do k=1,mo_tot_num - do j=1,mo_tot_num + do k=1,mo_num + do j=1,mo_num banned(j,k,2) = banned(k,j,1) enddo enddo else - do k=1,mo_tot_num - do l=k+1,mo_tot_num + do k=1,mo_num + do l=k+1,mo_num banned(l,k,1) = banned(k,l,1) end do end do @@ -829,12 +829,12 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2) integer(bit_kind), intent(in) :: phasemask(N_int,2) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) + logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num,2) double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) + double precision, intent(inout) :: mat(N_states, mo_num, mo_num) integer, intent(in) :: h(0:2,2), p(0:4,2), sp - double precision, external :: get_phase_bi, mo_bielec_integral + double precision, external :: get_phase_bi, mo_two_e_integral integer :: i, j, k, tip, ma, mi, puti, putj integer :: h1, h2, p1, p2, i1, i2 @@ -870,7 +870,7 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) h1 = h(1, ma) h2 = h(2, ma) - hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2, N_int) + hij = (mo_two_e_integral(p1, p2, h1, h2) - mo_two_e_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2, N_int) if(ma == 1) then do k=1,N_states mat(k, putj, puti) = mat(k, putj, puti) +coefs(k) * hij @@ -894,7 +894,7 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) if(banned(puti,putj,bant) .or. bannedOrb(puti,1)) cycle p1 = p(turn2(i), 1) - hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2, N_int) + hij = mo_two_e_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2, N_int) do k=1,N_states mat(k, puti, putj) = mat(k, puti, putj) +coefs(k) * hij enddo @@ -918,7 +918,7 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) i2 = turn2d(2, i, j) p1 = p(i1, ma) p2 = p(i2, ma) - hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2, N_int) + hij = (mo_two_e_integral(p1, p2, h1, h2) - mo_two_e_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2, N_int) do k=1,N_states mat(k, puti, putj) = mat(k, puti, putj) +coefs(k) * hij enddo @@ -936,7 +936,7 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) if(banned(puti,putj,1)) cycle p2 = p(i, ma) - hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, mi, ma, h1, p1, h2, p2, N_int) + hij = mo_two_e_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, mi, ma, h1, p1, h2, p2, N_int) do k=1,N_states mat(k, min(puti, putj), max(puti, putj)) = mat(k, min(puti, putj), max(puti, putj)) + coefs(k) * hij enddo @@ -949,7 +949,7 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) p2 = p(2, mi) h1 = h(1, mi) h2 = h(2, mi) - hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, mi, mi, h1, p1, h2, p2, N_int) + hij = (mo_two_e_integral(p1, p2, h1, h2) - mo_two_e_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, mi, mi, h1, p1, h2, p2, N_int) do k=1,N_states mat(k, puti, putj) = mat(k, puti, putj) +coefs(k) * hij enddo @@ -965,13 +965,13 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2) integer(bit_kind), intent(in) :: phasemask(N_int,2) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) + logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num,2) integer(bit_kind) :: det(N_int, 2) double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) + double precision, intent(inout) :: mat(N_states, mo_num, mo_num) integer, intent(in) :: h(0:2,2), p(0:4,2), sp - double precision :: hij, tmp_row(N_states, mo_tot_num), tmp_row2(N_states, mo_tot_num) - double precision, external :: get_phase_bi, mo_bielec_integral + double precision :: hij, tmp_row(N_states, mo_num), tmp_row2(N_states, mo_num) + double precision, external :: get_phase_bi, mo_two_e_integral logical :: ok logical, allocatable :: lbanned(:,:) @@ -985,8 +985,8 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) double precision, allocatable :: hij_cache(:,:) PROVIDE mo_integrals_map N_int - allocate (lbanned(mo_tot_num, 2)) - allocate (hij_cache(mo_tot_num,2)) + allocate (lbanned(mo_num, 2)) + allocate (hij_cache(mo_num,2)) lbanned = bannedOrb do i=1, p(0,1) @@ -1010,8 +1010,8 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) p1 = p(1,ma) p2 = p(2,ma) if(.not. bannedOrb(puti, mi)) then - call get_mo_bielec_integrals(hfix,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) - call get_mo_bielec_integrals(hfix,p2,p1,mo_tot_num,hij_cache(1,2),mo_integrals_map) + call get_mo_two_e_integrals(hfix,p1,p2,mo_num,hij_cache(1,1),mo_integrals_map) + call get_mo_two_e_integrals(hfix,p2,p1,mo_num,hij_cache(1,2),mo_integrals_map) tmp_row = 0d0 do putj=1, hfix-1 if(lbanned(putj, ma)) cycle @@ -1024,7 +1024,7 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) enddo endif end do - do putj=hfix+1, mo_tot_num + do putj=hfix+1, mo_num if(lbanned(putj, ma)) cycle if(banned(putj, puti,bant)) cycle hij = hij_cache(putj,2) - hij_cache(putj,1) @@ -1035,9 +1035,9 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) end do if(ma == 1) then - mat(1:N_states,1:mo_tot_num,puti) = mat(1:N_states,1:mo_tot_num,puti) + tmp_row(1:N_states,1:mo_tot_num) + mat(1:N_states,1:mo_num,puti) = mat(1:N_states,1:mo_num,puti) + tmp_row(1:N_states,1:mo_num) else - mat(1:N_states,puti,1:mo_tot_num) = mat(1:N_states,puti,1:mo_tot_num) + tmp_row(1:N_states,1:mo_tot_num) + mat(1:N_states,puti,1:mo_num) = mat(1:N_states,puti,1:mo_num) + tmp_row(1:N_states,1:mo_num) end if end if @@ -1045,9 +1045,9 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) pfix = p(1,mi) tmp_row = 0d0 tmp_row2 = 0d0 - call get_mo_bielec_integrals(hfix,pfix,p1,mo_tot_num,hij_cache(1,1),mo_integrals_map) - call get_mo_bielec_integrals(hfix,pfix,p2,mo_tot_num,hij_cache(1,2),mo_integrals_map) - do puti=1,mo_tot_num + call get_mo_two_e_integrals(hfix,pfix,p1,mo_num,hij_cache(1,1),mo_integrals_map) + call get_mo_two_e_integrals(hfix,pfix,p2,mo_num,hij_cache(1,2),mo_integrals_map) + do puti=1,mo_num if(lbanned(puti,mi)) cycle !p1 fixed putj = p1 @@ -1089,8 +1089,8 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) puti = p(i, ma) p1 = p(turn3(1,i), ma) p2 = p(turn3(2,i), ma) - call get_mo_bielec_integrals(hfix,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) - call get_mo_bielec_integrals(hfix,p2,p1,mo_tot_num,hij_cache(1,2),mo_integrals_map) + call get_mo_two_e_integrals(hfix,p1,p2,mo_num,hij_cache(1,1),mo_integrals_map) + call get_mo_two_e_integrals(hfix,p2,p1,mo_num,hij_cache(1,2),mo_integrals_map) tmp_row = 0d0 do putj=1,hfix-1 if(lbanned(putj,ma)) cycle @@ -1101,7 +1101,7 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) tmp_row(:,putj) = tmp_row(:,putj) + hij * coefs(:) endif end do - do putj=hfix+1,mo_tot_num + do putj=hfix+1,mo_num if(lbanned(putj,ma)) cycle if(banned(putj,puti,1)) cycle hij = hij_cache(putj,2) - hij_cache(putj,1) @@ -1121,9 +1121,9 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) p2 = p(2,ma) tmp_row = 0d0 tmp_row2 = 0d0 - call get_mo_bielec_integrals(hfix,p1,pfix,mo_tot_num,hij_cache(1,1),mo_integrals_map) - call get_mo_bielec_integrals(hfix,p2,pfix,mo_tot_num,hij_cache(1,2),mo_integrals_map) - do puti=1,mo_tot_num + call get_mo_two_e_integrals(hfix,p1,pfix,mo_num,hij_cache(1,1),mo_integrals_map) + call get_mo_two_e_integrals(hfix,p2,pfix,mo_num,hij_cache(1,2),mo_integrals_map) + do puti=1,mo_num if(lbanned(puti,ma)) cycle putj = p2 if(.not. banned(puti,putj,1)) then @@ -1188,30 +1188,30 @@ subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) integer(bit_kind), intent(in) :: phasemask(N_int,2) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) + logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num,2) integer(bit_kind) :: det(N_int, 2) double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) + double precision, intent(inout) :: mat(N_states, mo_num, mo_num) integer, intent(in) :: h(0:2,2), p(0:4,2), sp integer :: i, j, k, s, h1, h2, p1, p2, puti, putj double precision :: hij, phase - double precision, external :: get_phase_bi, mo_bielec_integral + double precision, external :: get_phase_bi, mo_two_e_integral logical :: ok integer :: bant double precision, allocatable :: hij_cache1(:), hij_cache2(:) - allocate (hij_cache1(mo_tot_num),hij_cache2(mo_tot_num)) + allocate (hij_cache1(mo_num),hij_cache2(mo_num)) bant = 1 if(sp == 3) then ! AB h1 = p(1,1) h2 = p(1,2) - do p2=1, mo_tot_num + do p2=1, mo_num if(bannedOrb(p2,2)) cycle - call get_mo_bielec_integrals(p2,h1,h2,mo_tot_num,hij_cache1,mo_integrals_map) - do p1=1, mo_tot_num + call get_mo_two_e_integrals(p2,h1,h2,mo_num,hij_cache1,mo_integrals_map) + do p1=1, mo_num if(bannedOrb(p1, 1) .or. banned(p1, p2, bant)) cycle if(p1 /= h1 .and. p2 /= h2) then if (hij_cache1(p1) == 0.d0) cycle @@ -1231,11 +1231,11 @@ subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) else ! AA BB p1 = p(1,sp) p2 = p(2,sp) - do puti=1, mo_tot_num + do puti=1, mo_num if(bannedOrb(puti, sp)) cycle - call get_mo_bielec_integrals(puti,p2,p1,mo_tot_num,hij_cache1,mo_integrals_map) - call get_mo_bielec_integrals(puti,p1,p2,mo_tot_num,hij_cache2,mo_integrals_map) - do putj=puti+1, mo_tot_num + call get_mo_two_e_integrals(puti,p2,p1,mo_num,hij_cache1,mo_integrals_map) + call get_mo_two_e_integrals(puti,p1,p2,mo_num,hij_cache2,mo_integrals_map) + do putj=puti+1, mo_num if(bannedOrb(putj, sp) .or. banned(putj, sp, bant)) cycle if(puti /= p1 .and. putj /= p2 .and. puti /= p2 .and. putj /= p1) then hij = hij_cache1(putj) - hij_cache2(putj) @@ -1266,7 +1266,7 @@ subroutine past_d1(bannedOrb, p) use bitmasks implicit none - logical, intent(inout) :: bannedOrb(mo_tot_num, 2) + logical, intent(inout) :: bannedOrb(mo_num, 2) integer, intent(in) :: p(0:4, 2) integer :: i,s @@ -1282,7 +1282,7 @@ subroutine past_d2(banned, p, sp) use bitmasks implicit none - logical, intent(inout) :: banned(mo_tot_num, mo_tot_num) + logical, intent(inout) :: banned(mo_num, mo_num) integer, intent(in) :: p(0:4, 2), sp integer :: i,j @@ -1311,7 +1311,7 @@ subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting) integer, intent(in) :: i_gen, N integer, intent(in) :: interesting(0:N) integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N) - logical, intent(inout) :: banned(mo_tot_num, mo_tot_num) + logical, intent(inout) :: banned(mo_num, mo_num) logical, intent(out) :: fullMatch diff --git a/src/hartree_fock/NEED b/src/hartree_fock/NEED index 233ffdb5..2b3fa238 100644 --- a/src/hartree_fock/NEED +++ b/src/hartree_fock/NEED @@ -1 +1,3 @@ -scf_utils ao_one_e_integrals ao_two_e_integrals +ao_one_e_ints +ao_two_e_ints +scf_utils diff --git a/src/hartree_fock/fock_matrix_hf.irp.f b/src/hartree_fock/fock_matrix_hf.irp.f index c655ce9c..ff37c29a 100644 --- a/src/hartree_fock/fock_matrix_hf.irp.f +++ b/src/hartree_fock/fock_matrix_hf.irp.f @@ -1,6 +1,6 @@ - BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_alpha, (ao_num, ao_num) ] -&BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_beta , (ao_num, ao_num) ] + BEGIN_PROVIDER [ double precision, ao_two_e_integral_alpha, (ao_num, ao_num) ] +&BEGIN_PROVIDER [ double precision, ao_two_e_integral_beta , (ao_num, ao_num) ] use map_module implicit none BEGIN_DOC @@ -11,32 +11,32 @@ integer :: i0,j0,k0,l0 integer*8 :: p,q double precision :: integral, c0, c1, c2 - double precision :: ao_bielec_integral, local_threshold - double precision, allocatable :: ao_bi_elec_integral_alpha_tmp(:,:) - double precision, allocatable :: ao_bi_elec_integral_beta_tmp(:,:) + double precision :: ao_two_e_integral, local_threshold + double precision, allocatable :: ao_two_e_integral_alpha_tmp(:,:) + double precision, allocatable :: ao_two_e_integral_beta_tmp(:,:) - ao_bi_elec_integral_alpha = 0.d0 - ao_bi_elec_integral_beta = 0.d0 + ao_two_e_integral_alpha = 0.d0 + ao_two_e_integral_beta = 0.d0 if (do_direct_integrals) then !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,keys,values,p,q,r,s,i0,j0,k0,l0, & - !$OMP ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp, c0, c1, c2, & + !$OMP ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp, c0, c1, c2, & !$OMP local_threshold)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& - !$OMP ao_integrals_map,ao_integrals_threshold, ao_bielec_integral_schwartz, & - !$OMP ao_overlap_abs, ao_bi_elec_integral_alpha, ao_bi_elec_integral_beta) + !$OMP ao_integrals_map,ao_integrals_threshold, ao_two_e_integral_schwartz, & + !$OMP ao_overlap_abs, ao_two_e_integral_alpha, ao_two_e_integral_beta) allocate(keys(1), values(1)) - allocate(ao_bi_elec_integral_alpha_tmp(ao_num,ao_num), & - ao_bi_elec_integral_beta_tmp(ao_num,ao_num)) - ao_bi_elec_integral_alpha_tmp = 0.d0 - ao_bi_elec_integral_beta_tmp = 0.d0 + allocate(ao_two_e_integral_alpha_tmp(ao_num,ao_num), & + ao_two_e_integral_beta_tmp(ao_num,ao_num)) + ao_two_e_integral_alpha_tmp = 0.d0 + ao_two_e_integral_beta_tmp = 0.d0 q = ao_num*ao_num*ao_num*ao_num !$OMP DO SCHEDULE(static,1) do p=1_8,q - call bielec_integrals_index_reverse(kk,ii,ll,jj,p) + call two_e_integrals_index_reverse(kk,ii,ll,jj,p) if ( (kk(1)>ao_num).or. & (ii(1)>ao_num).or. & (jj(1)>ao_num).or. & @@ -52,7 +52,7 @@ < ao_integrals_threshold) then cycle endif - local_threshold = ao_bielec_integral_schwartz(k,l)*ao_bielec_integral_schwartz(i,j) + local_threshold = ao_two_e_integral_schwartz(k,l)*ao_two_e_integral_schwartz(i,j) if (local_threshold < ao_integrals_threshold) then cycle endif @@ -77,27 +77,27 @@ cycle endif if (values(1) == 0.d0) then - values(1) = ao_bielec_integral(k0,l0,i0,j0) + values(1) = ao_two_e_integral(k0,l0,i0,j0) endif integral = c0 * values(1) - ao_bi_elec_integral_alpha_tmp(i,j) += integral - ao_bi_elec_integral_beta_tmp (i,j) += integral + ao_two_e_integral_alpha_tmp(i,j) += integral + ao_two_e_integral_beta_tmp (i,j) += integral integral = values(1) - ao_bi_elec_integral_alpha_tmp(l,j) -= c1 * integral - ao_bi_elec_integral_beta_tmp (l,j) -= c2 * integral + ao_two_e_integral_alpha_tmp(l,j) -= c1 * integral + ao_two_e_integral_beta_tmp (l,j) -= c2 * integral enddo enddo !$OMP END DO NOWAIT !$OMP CRITICAL - ao_bi_elec_integral_alpha += ao_bi_elec_integral_alpha_tmp + ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp !$OMP END CRITICAL !$OMP CRITICAL - ao_bi_elec_integral_beta += ao_bi_elec_integral_beta_tmp + ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL - deallocate(keys,values,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp) + deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) !$OMP END PARALLEL else - PROVIDE ao_bielec_integrals_in_map + PROVIDE ao_two_e_integrals_in_map integer(omp_lock_kind) :: lck(ao_num) integer(map_size_kind) :: i8 @@ -108,23 +108,23 @@ !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max, & - !$OMP n_elements,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp)& + !$OMP n_elements,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& - !$OMP ao_integrals_map, ao_bi_elec_integral_alpha, ao_bi_elec_integral_beta) + !$OMP ao_integrals_map, ao_two_e_integral_alpha, ao_two_e_integral_beta) call get_cache_map_n_elements_max(ao_integrals_map,n_elements_max) allocate(keys(n_elements_max), values(n_elements_max)) - allocate(ao_bi_elec_integral_alpha_tmp(ao_num,ao_num), & - ao_bi_elec_integral_beta_tmp(ao_num,ao_num)) - ao_bi_elec_integral_alpha_tmp = 0.d0 - ao_bi_elec_integral_beta_tmp = 0.d0 + allocate(ao_two_e_integral_alpha_tmp(ao_num,ao_num), & + ao_two_e_integral_beta_tmp(ao_num,ao_num)) + ao_two_e_integral_alpha_tmp = 0.d0 + ao_two_e_integral_beta_tmp = 0.d0 !$OMP DO SCHEDULE(static,1) 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)) + call two_e_integrals_index_reverse(kk,ii,ll,jj,keys(k1)) do k2=1,8 if (kk(k2)==0) then @@ -135,24 +135,24 @@ k = kk(k2) l = ll(k2) integral = (SCF_density_matrix_ao_alpha(k,l)+SCF_density_matrix_ao_beta(k,l)) * values(k1) - ao_bi_elec_integral_alpha_tmp(i,j) += integral - ao_bi_elec_integral_beta_tmp (i,j) += integral + ao_two_e_integral_alpha_tmp(i,j) += integral + ao_two_e_integral_beta_tmp (i,j) += integral integral = values(k1) - ao_bi_elec_integral_alpha_tmp(l,j) -= SCF_density_matrix_ao_alpha(k,i) * integral - ao_bi_elec_integral_beta_tmp (l,j) -= SCF_density_matrix_ao_beta (k,i) * integral + ao_two_e_integral_alpha_tmp(l,j) -= SCF_density_matrix_ao_alpha(k,i) * integral + ao_two_e_integral_beta_tmp (l,j) -= SCF_density_matrix_ao_beta (k,i) * integral enddo enddo enddo !$OMP END DO !$OMP BARRIER !$OMP CRITICAL - ao_bi_elec_integral_alpha += ao_bi_elec_integral_alpha_tmp + ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp !$OMP END CRITICAL !$OMP BARRIER !$OMP CRITICAL - ao_bi_elec_integral_beta += ao_bi_elec_integral_beta_tmp + ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL - deallocate(keys,values,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp) + deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) !$OMP END PARALLEL endif @@ -169,8 +169,8 @@ END_PROVIDER integer :: i,j do j=1,ao_num do i=1,ao_num - Fock_matrix_ao_alpha(i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_alpha(i,j) - Fock_matrix_ao_beta (i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_beta (i,j) + Fock_matrix_ao_alpha(i,j) = ao_one_e_integrals(i,j) + ao_two_e_integral_alpha(i,j) + Fock_matrix_ao_beta (i,j) = ao_one_e_integrals(i,j) + ao_two_e_integral_beta (i,j) enddo enddo diff --git a/src/hartree_fock/hf_energy.irp.f b/src/hartree_fock/hf_energy.irp.f index d24c37f9..e6706a44 100644 --- a/src/hartree_fock/hf_energy.irp.f +++ b/src/hartree_fock/hf_energy.irp.f @@ -22,9 +22,9 @@ END_PROVIDER HF_energy = nuclear_repulsion do j=1,ao_num do i=1,ao_num - HF_two_electron_energy += 0.5d0 * ( ao_bi_elec_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & - +ao_bi_elec_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) - HF_one_electron_energy += ao_mono_elec_integral(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) + HF_two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & + +ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) + HF_one_electron_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) enddo enddo HF_energy += HF_two_electron_energy + HF_one_electron_energy diff --git a/src/hartree_fock/scf.irp.f b/src/hartree_fock/scf.irp.f index d735bb89..91c38179 100644 --- a/src/hartree_fock/scf.irp.f +++ b/src/hartree_fock/scf.irp.f @@ -1,14 +1,13 @@ program scf BEGIN_DOC -! Produce `Hartree_Fock` MO orbital -! output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ +! Produce `Hartree_Fock` |MOs| +! +! output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ +! ! output: hartree_fock.energy +! ! optional: mo_basis.mo_coef END_DOC - disk_access_mo_one_integrals = "None" - touch disk_access_mo_one_integrals - disk_access_ao_one_integrals = "None" - touch disk_access_ao_one_integrals call create_guess call orthonormalize_mos call run @@ -27,7 +26,10 @@ subroutine create_guess 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,1,.false.) + call mo_as_eigvectors_of_mo_matrix(mo_one_e_integrals, & + size(mo_one_e_integrals,1), & + size(mo_one_e_integrals,2), & + mo_label,1,.false.) SOFT_TOUCH mo_coef mo_label else if (mo_guess_type == "Huckel") then call huckel_guess @@ -47,15 +49,9 @@ subroutine run use bitmasks implicit none - double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem - double precision :: EHF integer :: i_it, i, j, k - EHF = SCF_energy - - mo_label = "Canonical" - -! Choose SCF algorithm + mo_label = "Orthonormalized" call Roothaan_Hall_SCF call ezfio_set_hartree_fock_energy(SCF_energy) diff --git a/src/kohn_sham/fock_matrix_ks.irp.f b/src/kohn_sham/fock_matrix_ks.irp.f index 6ab34514..3574414d 100644 --- a/src/kohn_sham/fock_matrix_ks.irp.f +++ b/src/kohn_sham/fock_matrix_ks.irp.f @@ -1,7 +1,7 @@ - BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_alpha, (ao_num, ao_num) ] -&BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_beta , (ao_num, ao_num) ] + BEGIN_PROVIDER [ double precision, ao_two_e_integral_alpha, (ao_num, ao_num) ] +&BEGIN_PROVIDER [ double precision, ao_two_e_integral_beta , (ao_num, ao_num) ] use map_module implicit none BEGIN_DOC @@ -12,34 +12,34 @@ integer :: i0,j0,k0,l0 integer*8 :: p,q double precision :: integral, c0, c1, c2 - double precision :: ao_bielec_integral, local_threshold - double precision, allocatable :: ao_bi_elec_integral_alpha_tmp(:,:) - double precision, allocatable :: ao_bi_elec_integral_beta_tmp(:,:) - !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_bi_elec_integral_beta_tmp - !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_bi_elec_integral_alpha_tmp + double precision :: ao_two_e_integral, local_threshold + double precision, allocatable :: ao_two_e_integral_alpha_tmp(:,:) + double precision, allocatable :: ao_two_e_integral_beta_tmp(:,:) + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_two_e_integral_beta_tmp + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_two_e_integral_alpha_tmp - ao_bi_elec_integral_alpha = 0.d0 - ao_bi_elec_integral_beta = 0.d0 + ao_two_e_integral_alpha = 0.d0 + ao_two_e_integral_beta = 0.d0 if (do_direct_integrals) then !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,p,q,r,s,i0,j0,k0,l0, & - !$OMP ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp, c0, c1, c2, & + !$OMP ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp, c0, c1, c2, & !$OMP local_threshold)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& - !$OMP ao_integrals_map,ao_integrals_threshold, ao_bielec_integral_schwartz, & - !$OMP ao_overlap_abs, ao_bi_elec_integral_alpha, ao_bi_elec_integral_beta) + !$OMP ao_integrals_map,ao_integrals_threshold, ao_two_e_integral_schwartz, & + !$OMP ao_overlap_abs, ao_two_e_integral_alpha, ao_two_e_integral_beta) allocate(keys(1), values(1)) - allocate(ao_bi_elec_integral_alpha_tmp(ao_num,ao_num), & - ao_bi_elec_integral_beta_tmp(ao_num,ao_num)) - ao_bi_elec_integral_alpha_tmp = 0.d0 - ao_bi_elec_integral_beta_tmp = 0.d0 + allocate(ao_two_e_integral_alpha_tmp(ao_num,ao_num), & + ao_two_e_integral_beta_tmp(ao_num,ao_num)) + ao_two_e_integral_alpha_tmp = 0.d0 + ao_two_e_integral_beta_tmp = 0.d0 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) + call two_e_integrals_index_reverse(kk,ii,ll,jj,p) if ( (kk(1)>ao_num).or. & (ii(1)>ao_num).or. & (jj(1)>ao_num).or. & @@ -55,7 +55,7 @@ < ao_integrals_threshold) then cycle endif - local_threshold = ao_bielec_integral_schwartz(k,l)*ao_bielec_integral_schwartz(i,j) + local_threshold = ao_two_e_integral_schwartz(k,l)*ao_two_e_integral_schwartz(i,j) if (local_threshold < ao_integrals_threshold) then cycle endif @@ -80,27 +80,27 @@ cycle endif if (values(1) == 0.d0) then - values(1) = ao_bielec_integral(k0,l0,i0,j0) + values(1) = ao_two_e_integral(k0,l0,i0,j0) endif integral = c0 * values(1) - ao_bi_elec_integral_alpha_tmp(i,j) += integral - ao_bi_elec_integral_beta_tmp (i,j) += integral + ao_two_e_integral_alpha_tmp(i,j) += integral + ao_two_e_integral_beta_tmp (i,j) += integral integral = values(1) - ao_bi_elec_integral_alpha_tmp(l,j) -= c1 * integral - ao_bi_elec_integral_beta_tmp (l,j) -= c2 * integral + ao_two_e_integral_alpha_tmp(l,j) -= c1 * integral + ao_two_e_integral_beta_tmp (l,j) -= c2 * integral enddo enddo !$OMP END DO NOWAIT !$OMP CRITICAL - ao_bi_elec_integral_alpha += ao_bi_elec_integral_alpha_tmp + ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp !$OMP END CRITICAL !$OMP CRITICAL - ao_bi_elec_integral_beta += ao_bi_elec_integral_beta_tmp + ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL - deallocate(keys,values,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp) + deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) !$OMP END PARALLEL else - PROVIDE ao_bielec_integrals_in_map + PROVIDE ao_two_e_integrals_in_map integer(omp_lock_kind) :: lck(ao_num) integer*8 :: i8 @@ -114,16 +114,16 @@ !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max, & - !$OMP n_elements,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp)& + !$OMP n_elements,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& - !$OMP ao_integrals_map, ao_bi_elec_integral_alpha, ao_bi_elec_integral_beta,HF_exchange) + !$OMP ao_integrals_map, ao_two_e_integral_alpha, ao_two_e_integral_beta,HF_exchange) call get_cache_map_n_elements_max(ao_integrals_map,n_elements_max) allocate(keys(n_elements_max), values(n_elements_max)) - allocate(ao_bi_elec_integral_alpha_tmp(ao_num,ao_num), & - ao_bi_elec_integral_beta_tmp(ao_num,ao_num)) - ao_bi_elec_integral_alpha_tmp = 0.d0 - ao_bi_elec_integral_beta_tmp = 0.d0 + allocate(ao_two_e_integral_alpha_tmp(ao_num,ao_num), & + ao_two_e_integral_beta_tmp(ao_num,ao_num)) + ao_two_e_integral_alpha_tmp = 0.d0 + ao_two_e_integral_beta_tmp = 0.d0 !$OMP DO SCHEDULE(dynamic,64) !DIR$ NOVECTOR @@ -131,7 +131,7 @@ 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)) + call two_e_integrals_index_reverse(kk,ii,ll,jj,keys(k1)) do k2=1,8 if (kk(k2)==0) then @@ -142,22 +142,22 @@ k = kk(k2) l = ll(k2) integral = (SCF_density_matrix_ao_alpha(k,l)+SCF_density_matrix_ao_beta(k,l)) * values(k1) - ao_bi_elec_integral_alpha_tmp(i,j) += integral - ao_bi_elec_integral_beta_tmp (i,j) += integral + ao_two_e_integral_alpha_tmp(i,j) += integral + ao_two_e_integral_beta_tmp (i,j) += integral integral = values(k1) - ao_bi_elec_integral_alpha_tmp(l,j) -= HF_exchange * (SCF_density_matrix_ao_alpha(k,i) * integral) - ao_bi_elec_integral_beta_tmp (l,j) -= HF_exchange * (SCF_density_matrix_ao_beta (k,i) * integral) + ao_two_e_integral_alpha_tmp(l,j) -= HF_exchange * (SCF_density_matrix_ao_alpha(k,i) * integral) + ao_two_e_integral_beta_tmp (l,j) -= HF_exchange * (SCF_density_matrix_ao_beta (k,i) * integral) enddo enddo enddo !$OMP END DO NOWAIT !$OMP CRITICAL - ao_bi_elec_integral_alpha += ao_bi_elec_integral_alpha_tmp + ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp !$OMP END CRITICAL !$OMP CRITICAL - ao_bi_elec_integral_beta += ao_bi_elec_integral_beta_tmp + ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL - deallocate(keys,values,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp) + deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) !$OMP END PARALLEL endif @@ -192,8 +192,8 @@ END_PROVIDER integer :: i,j do j=1,ao_num do i=1,ao_num - Fock_matrix_alpha_no_xc_ao(i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_alpha(i,j) - Fock_matrix_beta_no_xc_ao(i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_beta (i,j) + Fock_matrix_alpha_no_xc_ao(i,j) = ao_one_e_integrals(i,j) + ao_two_e_integral_alpha(i,j) + Fock_matrix_beta_no_xc_ao(i,j) = ao_one_e_integrals(i,j) + ao_two_e_integral_beta (i,j) enddo enddo diff --git a/src/kohn_sham/ks_enery.irp.f b/src/kohn_sham/ks_enery.irp.f index aec5074e..07d1f659 100644 --- a/src/kohn_sham/ks_enery.irp.f +++ b/src/kohn_sham/ks_enery.irp.f @@ -19,9 +19,9 @@ do i=1,ao_num Fock_matrix_energy += Fock_matrix_ao_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) + & Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j) - two_electron_energy += 0.5d0 * ( ao_bi_elec_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & - +ao_bi_elec_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) - one_electron_energy += ao_mono_elec_integral(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) + two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & + +ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) + one_electron_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j) enddo enddo diff --git a/src/kohn_sham/ks_scf.irp.f b/src/kohn_sham/ks_scf.irp.f index 47dc2e73..6bd31be1 100644 --- a/src/kohn_sham/ks_scf.irp.f +++ b/src/kohn_sham/ks_scf.irp.f @@ -1,15 +1,15 @@ program srs_ks_cf BEGIN_DOC ! Produce `Kohn_Sham` MO orbital -! output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ +! output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ ! output: kohn_sham.energy ! optional: mo_basis.mo_coef END_DOC - disk_access_mo_one_integrals = "None" - touch disk_access_mo_one_integrals - disk_access_ao_one_integrals = "None" - touch disk_access_ao_one_integrals + io_mo_one_e_integrals = "None" + touch io_mo_one_e_integrals + io_ao_one_e_integrals = "None" + touch io_ao_one_e_integrals read_wf = .False. density_for_dft ="WFT" touch density_for_dft @@ -64,7 +64,7 @@ subroutine create_guess 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,.false.) + call mo_as_eigvectors_of_mo_matrix(mo_one_e_integrals,size(mo_one_e_integrals,1),size(mo_one_e_integrals,2),mo_label,.false.) SOFT_TOUCH mo_coef mo_label else if (mo_guess_type == "Huckel") then call huckel_guess diff --git a/src/kohn_sham_rs/61.rsks.bats b/src/kohn_sham_rs/61.rsks.bats index e0d62d10..3f6bd98b 100644 --- a/src/kohn_sham_rs/61.rsks.bats +++ b/src/kohn_sham_rs/61.rsks.bats @@ -10,7 +10,7 @@ function run() { ezfio set scf_utils thresh_scf 1.e-10 echo "short_range_PBE" > $1/dft_keywords/exchange_functional echo "short_range_PBE" > $1/dft_keywords/correlation_functional - echo "0.5" > $1/ao_two_e_erf_integrals/mu_erf + echo "0.5" > $1/ao_two_e_erf_ints/mu_erf echo "1" > $1/becke_numerical_grid/grid_type_sgn qp_run rs_ks_scf $1 energy="$(ezfio get kohn_sham_rs energy)" diff --git a/src/kohn_sham_rs/README.rst b/src/kohn_sham_rs/README.rst index 14441fb1..3697eb49 100644 --- a/src/kohn_sham_rs/README.rst +++ b/src/kohn_sham_rs/README.rst @@ -5,7 +5,7 @@ kohn_sham_rs The Range-separated Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the spatial part of the |MOs| is common for alpha and beta spinorbitals) where the coulomb interaction is partially treated using exact exchange. -The splitting of the interaction between long- and short-range is determined by the range-separation parameter :option:`ao_two_e_erf_integrals mu_erf`. The long-range part of the interaction is explicitly treated with exact exchange, and the short-range part of the interaction is treated with appropriate DFT functionals. +The splitting of the interaction between long- and short-range is determined by the range-separation parameter :option:`ao_two_e_erf_ints mu_erf`. The long-range part of the interaction is explicitly treated with exact exchange, and the short-range part of the interaction is treated with appropriate DFT functionals. The Range-separated Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure. It performs the following actions: diff --git a/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f b/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f index 31f912ea..6d3c8956 100644 --- a/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f +++ b/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f @@ -1,5 +1,5 @@ - BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_alpha, (ao_num, ao_num) ] -&BEGIN_PROVIDER [ double precision, ao_bi_elec_integral_beta , (ao_num, ao_num) ] + BEGIN_PROVIDER [ double precision, ao_two_e_integral_alpha, (ao_num, ao_num) ] +&BEGIN_PROVIDER [ double precision, ao_two_e_integral_beta , (ao_num, ao_num) ] use map_module implicit none BEGIN_DOC @@ -10,34 +10,34 @@ integer :: i0,j0,k0,l0 integer*8 :: p,q double precision :: integral, c0, c1, c2 - double precision :: ao_bielec_integral, local_threshold - double precision, allocatable :: ao_bi_elec_integral_alpha_tmp(:,:) - double precision, allocatable :: ao_bi_elec_integral_beta_tmp(:,:) - !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_bi_elec_integral_beta_tmp - !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_bi_elec_integral_alpha_tmp + double precision :: ao_two_e_integral, local_threshold + double precision, allocatable :: ao_two_e_integral_alpha_tmp(:,:) + double precision, allocatable :: ao_two_e_integral_beta_tmp(:,:) + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_two_e_integral_beta_tmp + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: ao_two_e_integral_alpha_tmp - ao_bi_elec_integral_alpha = 0.d0 - ao_bi_elec_integral_beta = 0.d0 + ao_two_e_integral_alpha = 0.d0 + ao_two_e_integral_beta = 0.d0 if (do_direct_integrals) then !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,p,q,r,s,i0,j0,k0,l0, & - !$OMP ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp, c0, c1, c2, & + !$OMP ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp, c0, c1, c2, & !$OMP local_threshold)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& - !$OMP ao_integrals_map,ao_integrals_threshold, ao_bielec_integral_schwartz, & - !$OMP ao_overlap_abs, ao_bi_elec_integral_alpha, ao_bi_elec_integral_beta) + !$OMP ao_integrals_map,ao_integrals_threshold, ao_two_e_integral_schwartz, & + !$OMP ao_overlap_abs, ao_two_e_integral_alpha, ao_two_e_integral_beta) allocate(keys(1), values(1)) - allocate(ao_bi_elec_integral_alpha_tmp(ao_num,ao_num), & - ao_bi_elec_integral_beta_tmp(ao_num,ao_num)) - ao_bi_elec_integral_alpha_tmp = 0.d0 - ao_bi_elec_integral_beta_tmp = 0.d0 + allocate(ao_two_e_integral_alpha_tmp(ao_num,ao_num), & + ao_two_e_integral_beta_tmp(ao_num,ao_num)) + ao_two_e_integral_alpha_tmp = 0.d0 + ao_two_e_integral_beta_tmp = 0.d0 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) + call two_e_integrals_index_reverse(kk,ii,ll,jj,p) if ( (kk(1)>ao_num).or. & (ii(1)>ao_num).or. & (jj(1)>ao_num).or. & @@ -53,7 +53,7 @@ < ao_integrals_threshold) then cycle endif - local_threshold = ao_bielec_integral_schwartz(k,l)*ao_bielec_integral_schwartz(i,j) + local_threshold = ao_two_e_integral_schwartz(k,l)*ao_two_e_integral_schwartz(i,j) if (local_threshold < ao_integrals_threshold) then cycle endif @@ -78,28 +78,28 @@ cycle endif if (values(1) == 0.d0) then - values(1) = ao_bielec_integral(k0,l0,i0,j0) + values(1) = ao_two_e_integral(k0,l0,i0,j0) endif integral = c0 * values(1) - ao_bi_elec_integral_alpha_tmp(i,j) += integral - ao_bi_elec_integral_beta_tmp (i,j) += integral + ao_two_e_integral_alpha_tmp(i,j) += integral + ao_two_e_integral_beta_tmp (i,j) += integral integral = values(1) - ao_bi_elec_integral_alpha_tmp(l,j) -= c1 * integral - ao_bi_elec_integral_beta_tmp (l,j) -= c2 * integral + ao_two_e_integral_alpha_tmp(l,j) -= c1 * integral + ao_two_e_integral_beta_tmp (l,j) -= c2 * integral enddo enddo !$OMP END DO NOWAIT !$OMP CRITICAL - ao_bi_elec_integral_alpha += ao_bi_elec_integral_alpha_tmp + ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp !$OMP END CRITICAL !$OMP CRITICAL - ao_bi_elec_integral_beta += ao_bi_elec_integral_beta_tmp + ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL - deallocate(keys,values,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp) + deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) !$OMP END PARALLEL else - PROVIDE ao_bielec_integrals_in_map - PROVIDE ao_bielec_integrals_erf_in_map + PROVIDE ao_two_e_integrals_in_map + PROVIDE ao_two_e_integrals_erf_in_map integer(omp_lock_kind) :: lck(ao_num) integer*8 :: i8 @@ -113,16 +113,16 @@ !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max, & - !$OMP n_elements,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp)& + !$OMP n_elements,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& - !$OMP ao_integrals_map, ao_bi_elec_integral_alpha, ao_bi_elec_integral_beta) + !$OMP ao_integrals_map, ao_two_e_integral_alpha, ao_two_e_integral_beta) call get_cache_map_n_elements_max(ao_integrals_map,n_elements_max) allocate(keys(n_elements_max), values(n_elements_max)) - allocate(ao_bi_elec_integral_alpha_tmp(ao_num,ao_num), & - ao_bi_elec_integral_beta_tmp(ao_num,ao_num)) - ao_bi_elec_integral_alpha_tmp = 0.d0 - ao_bi_elec_integral_beta_tmp = 0.d0 + allocate(ao_two_e_integral_alpha_tmp(ao_num,ao_num), & + ao_two_e_integral_beta_tmp(ao_num,ao_num)) + ao_two_e_integral_alpha_tmp = 0.d0 + ao_two_e_integral_beta_tmp = 0.d0 !$OMP DO SCHEDULE(dynamic,64) !DIR$ NOVECTOR @@ -130,7 +130,7 @@ 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)) + call two_e_integrals_index_reverse(kk,ii,ll,jj,keys(k1)) do k2=1,8 if (kk(k2)==0) then @@ -141,42 +141,42 @@ k = kk(k2) l = ll(k2) integral = (SCF_density_matrix_ao_alpha(k,l)+SCF_density_matrix_ao_beta(k,l)) * values(k1) - ao_bi_elec_integral_alpha_tmp(i,j) += integral - ao_bi_elec_integral_beta_tmp (i,j) += integral + ao_two_e_integral_alpha_tmp(i,j) += integral + ao_two_e_integral_beta_tmp (i,j) += integral enddo enddo enddo !$OMP END DO NOWAIT !$OMP CRITICAL - ao_bi_elec_integral_alpha += ao_bi_elec_integral_alpha_tmp + ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp !$OMP END CRITICAL !$OMP CRITICAL - ao_bi_elec_integral_beta += ao_bi_elec_integral_beta_tmp + ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL - deallocate(keys,values,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp) + deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) !$OMP END PARALLEL !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(i,j,l,k1,k,integral_erf,ii,jj,kk,ll,i8,keys_erf,values_erf,n_elements_max_erf, & - !$OMP n_elements_erf,ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp)& + !$OMP n_elements_erf,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& - !$OMP ao_integrals_erf_map, ao_bi_elec_integral_alpha, ao_bi_elec_integral_beta) + !$OMP ao_integrals_erf_map, ao_two_e_integral_alpha, ao_two_e_integral_beta) call get_cache_map_n_elements_max(ao_integrals_erf_map,n_elements_max_erf) - allocate(ao_bi_elec_integral_alpha_tmp(ao_num,ao_num), & - ao_bi_elec_integral_beta_tmp(ao_num,ao_num)) + allocate(ao_two_e_integral_alpha_tmp(ao_num,ao_num), & + ao_two_e_integral_beta_tmp(ao_num,ao_num)) allocate(keys_Erf(n_elements_max_erf), values_erf(n_elements_max_erf)) - ao_bi_elec_integral_alpha_tmp = 0.d0 - ao_bi_elec_integral_beta_tmp = 0.d0 + ao_two_e_integral_alpha_tmp = 0.d0 + ao_two_e_integral_beta_tmp = 0.d0 !$OMP DO SCHEDULE(dynamic,64) !DIR$ NOVECTOR do i8=0_8,ao_integrals_erf_map%map_size n_elements_erf = n_elements_max_erf call get_cache_map(ao_integrals_erf_map,i8,keys_erf,values_erf,n_elements_erf) do k1=1,n_elements_erf - call bielec_integrals_index_reverse(kk,ii,ll,jj,keys_erf(k1)) + call two_e_integrals_index_reverse(kk,ii,ll,jj,keys_erf(k1)) do k2=1,8 if (kk(k2)==0) then @@ -188,20 +188,20 @@ l = ll(k2) double precision :: integral_erf integral_erf = values_erf(k1) - ao_bi_elec_integral_alpha_tmp(l,j) -= (SCF_density_matrix_ao_alpha(k,i) * integral_erf) - ao_bi_elec_integral_beta_tmp (l,j) -= (SCF_density_matrix_ao_beta (k,i) * integral_erf) + ao_two_e_integral_alpha_tmp(l,j) -= (SCF_density_matrix_ao_alpha(k,i) * integral_erf) + ao_two_e_integral_beta_tmp (l,j) -= (SCF_density_matrix_ao_beta (k,i) * integral_erf) enddo enddo enddo !$OMP END DO NOWAIT !$OMP CRITICAL - ao_bi_elec_integral_alpha = ao_bi_elec_integral_alpha + ao_bi_elec_integral_alpha_tmp + ao_two_e_integral_alpha = ao_two_e_integral_alpha + ao_two_e_integral_alpha_tmp !$OMP END CRITICAL !$OMP CRITICAL - ao_bi_elec_integral_beta = ao_bi_elec_integral_beta + ao_bi_elec_integral_beta_tmp + ao_two_e_integral_beta = ao_two_e_integral_beta + ao_two_e_integral_beta_tmp !$OMP END CRITICAL - deallocate(ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp) + deallocate(ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) deallocate(keys_erf,values_erf) !$OMP END PARALLEL @@ -238,8 +238,8 @@ END_PROVIDER integer :: i,j do j=1,ao_num do i=1,ao_num - Fock_matrix_alpha_no_xc_ao(i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_alpha(i,j) - Fock_matrix_beta_no_xc_ao(i,j) = ao_mono_elec_integral(i,j) + ao_bi_elec_integral_beta (i,j) + Fock_matrix_alpha_no_xc_ao(i,j) = ao_one_e_integrals(i,j) + ao_two_e_integral_alpha(i,j) + Fock_matrix_beta_no_xc_ao(i,j) = ao_one_e_integrals(i,j) + ao_two_e_integral_beta (i,j) enddo enddo diff --git a/src/kohn_sham_rs/rs_ks_energy.irp.f b/src/kohn_sham_rs/rs_ks_energy.irp.f index a1bcd769..222c374d 100644 --- a/src/kohn_sham_rs/rs_ks_energy.irp.f +++ b/src/kohn_sham_rs/rs_ks_energy.irp.f @@ -19,9 +19,9 @@ do i=1,ao_num Fock_matrix_energy += Fock_matrix_ao_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) + & Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j) - two_electron_energy += 0.5d0 * ( ao_bi_elec_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & - +ao_bi_elec_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) - one_electron_energy += ao_mono_elec_integral(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) + two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & + +ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) + one_electron_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j) enddo enddo diff --git a/src/kohn_sham_rs/rs_ks_scf.irp.f b/src/kohn_sham_rs/rs_ks_scf.irp.f index eb8806c9..57c8787d 100644 --- a/src/kohn_sham_rs/rs_ks_scf.irp.f +++ b/src/kohn_sham_rs/rs_ks_scf.irp.f @@ -1,15 +1,15 @@ program rs_ks_scf BEGIN_DOC ! Produce `Range_separated_Kohn_Sham` MO orbital -! output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ +! output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ ! output: kohn_sham.energy ! optional: mo_basis.mo_coef END_DOC - disk_access_mo_one_integrals = "None" - touch disk_access_mo_one_integrals - disk_access_ao_one_integrals = "None" - touch disk_access_ao_one_integrals + io_mo_one_e_integrals = "None" + touch io_mo_one_e_integrals + io_ao_one_e_integrals = "None" + touch io_ao_one_e_integrals read_wf = .False. density_for_dft ="WFT" @@ -66,7 +66,7 @@ subroutine create_guess 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,.false.) + call mo_as_eigvectors_of_mo_matrix(mo_one_e_integrals,size(mo_one_e_integrals,1),size(mo_one_e_integrals,2),mo_label,.false.) SOFT_TOUCH mo_coef mo_label else if (mo_guess_type == "Huckel") then call huckel_guess diff --git a/src/mo_basis/EZFIO.cfg b/src/mo_basis/EZFIO.cfg index 7391671b..126705bf 100644 --- a/src/mo_basis/EZFIO.cfg +++ b/src/mo_basis/EZFIO.cfg @@ -1,4 +1,4 @@ -[mo_tot_num] +[mo_num] type: integer doc: Total number of |MOs| interface: ezfio @@ -7,7 +7,7 @@ interface: ezfio type: double precision doc: Coefficient of the i-th |AO| on the j-th |MO| interface: ezfio -size: (ao_basis.ao_num,mo_basis.mo_tot_num) +size: (ao_basis.ao_num,mo_basis.mo_num) [mo_label] type: character*(64) @@ -18,13 +18,13 @@ interface: ezfio type: double precision doc: |MO| occupation numbers interface: ezfio -size: (mo_basis.mo_tot_num) +size: (mo_basis.mo_num) [mo_class] type: MO_class doc: [ Core | Inactive | Active | Virtual | Deleted ], as defined by :ref:`qp_set_mo_class` interface: ezfio, provider -size: (mo_basis.mo_tot_num) +size: (mo_basis.mo_num) [ao_md5] type: character*(32) diff --git a/src/mo_basis/NEED b/src/mo_basis/NEED index 9923766c..1a6a943c 100644 --- a/src/mo_basis/NEED +++ b/src/mo_basis/NEED @@ -1,3 +1,3 @@ ao_basis -ao_one_e_integrals +ao_one_e_ints electrons diff --git a/src/mo_basis/mos.irp.f b/src/mo_basis/mos.irp.f index 05b73297..c3f50bd8 100644 --- a/src/mo_basis/mos.irp.f +++ b/src/mo_basis/mos.irp.f @@ -1,4 +1,4 @@ -BEGIN_PROVIDER [ integer, mo_tot_num ] +BEGIN_PROVIDER [ integer, mo_num ] implicit none BEGIN_DOC ! Number of MOs @@ -7,7 +7,7 @@ BEGIN_PROVIDER [ integer, mo_tot_num ] logical :: has PROVIDE ezfio_filename if (mpi_master) then - call ezfio_has_mo_basis_mo_tot_num(has) + call ezfio_has_mo_basis_mo_num(has) endif IRP_IF MPI_DEBUG print *, irp_here, mpi_rank @@ -18,47 +18,29 @@ BEGIN_PROVIDER [ integer, mo_tot_num ] integer :: ierr call MPI_BCAST( has, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr) if (ierr /= MPI_SUCCESS) then - stop 'Unable to read mo_tot_num with MPI' + stop 'Unable to read mo_num with MPI' endif IRP_ENDIF if (.not.has) then - mo_tot_num = ao_ortho_canonical_num + mo_num = ao_ortho_canonical_num else if (mpi_master) then - call ezfio_get_mo_basis_mo_tot_num(mo_tot_num) + call ezfio_get_mo_basis_mo_num(mo_num) endif IRP_IF MPI - call MPI_BCAST( mo_tot_num, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + call MPI_BCAST( mo_num, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) if (ierr /= MPI_SUCCESS) then - stop 'Unable to read mo_tot_num with MPI' + stop 'Unable to read mo_num with MPI' endif IRP_ENDIF endif - call write_int(6,mo_tot_num,'mo_tot_num') - ASSERT (mo_tot_num > 0) + call write_int(6,mo_num,'mo_num') + ASSERT (mo_num > 0) END_PROVIDER -BEGIN_PROVIDER [ integer, mo_num ] - implicit none - BEGIN_DOC - ! mo_tot_num without the highest deleted MOs - END_DOC - mo_num = mo_tot_num - integer :: i - mo_num = mo_tot_num - do i=mo_tot_num,1,-1 - if (mo_class(i) == 'Deleted') then - mo_num -= 1 - else - exit - endif - enddo -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, mo_coef, (ao_num,mo_tot_num) ] +BEGIN_PROVIDER [ double precision, mo_coef, (ao_num,mo_num) ] implicit none BEGIN_DOC ! Molecular orbital coefficients on |AO| basis set @@ -96,14 +78,14 @@ BEGIN_PROVIDER [ double precision, mo_coef, (ao_num,mo_tot_num) ] write(*,*) 'Read mo_coef' endif IRP_IF MPI - call MPI_BCAST( mo_coef, mo_tot_num*ao_num, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) + call MPI_BCAST( mo_coef, mo_num*ao_num, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) if (ierr /= MPI_SUCCESS) then stop 'Unable to read mo_coef with MPI' endif IRP_ENDIF else ! Orthonormalized AO basis - do i=1,mo_tot_num + do i=1,mo_num do j=1,ao_num mo_coef(j,i) = ao_ortho_canonical_coef(j,i) enddo @@ -112,14 +94,14 @@ BEGIN_PROVIDER [ double precision, mo_coef, (ao_num,mo_tot_num) ] END_PROVIDER -BEGIN_PROVIDER [ double precision, mo_coef_in_ao_ortho_basis, (ao_num, mo_tot_num) ] +BEGIN_PROVIDER [ double precision, mo_coef_in_ao_ortho_basis, (ao_num, mo_num) ] implicit none BEGIN_DOC ! |MO| coefficients in orthogonalized |AO| basis ! ! $C^{-1}.C_{mo}$ END_DOC - call dgemm('N','N',ao_num,mo_tot_num,ao_num,1.d0, & + call dgemm('N','N',ao_num,mo_num,ao_num,1.d0, & ao_ortho_canonical_coef_inv, size(ao_ortho_canonical_coef_inv,1),& mo_coef, size(mo_coef,1), 0.d0, & mo_coef_in_ao_ortho_basis, size(mo_coef_in_ao_ortho_basis,1)) @@ -163,7 +145,7 @@ BEGIN_PROVIDER [ character*(64), mo_label ] END_PROVIDER -BEGIN_PROVIDER [ double precision, mo_coef_transp, (mo_tot_num,ao_num) ] +BEGIN_PROVIDER [ double precision, mo_coef_transp, (mo_num,ao_num) ] implicit none BEGIN_DOC ! |MO| coefficients on |AO| basis set @@ -171,7 +153,7 @@ BEGIN_PROVIDER [ double precision, mo_coef_transp, (mo_tot_num,ao_num) ] integer :: i, j do j=1,ao_num - do i=1,mo_tot_num + do i=1,mo_num mo_coef_transp(i,j) = mo_coef(j,i) enddo enddo @@ -179,7 +161,7 @@ BEGIN_PROVIDER [ double precision, mo_coef_transp, (mo_tot_num,ao_num) ] END_PROVIDER -BEGIN_PROVIDER [ double precision, mo_occ, (mo_tot_num) ] +BEGIN_PROVIDER [ double precision, mo_occ, (mo_num) ] implicit none BEGIN_DOC ! |MO| occupation numbers @@ -209,7 +191,7 @@ BEGIN_PROVIDER [ double precision, mo_occ, (mo_tot_num) ] IRP_IF MPI include 'mpif.h' integer :: ierr - call MPI_BCAST( mo_occ, mo_tot_num, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) + call MPI_BCAST( mo_occ, mo_num, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) if (ierr /= MPI_SUCCESS) then stop 'Unable to read mo_occ with MPI' endif @@ -227,18 +209,18 @@ subroutine ao_to_mo(A_ao,LDA_ao,A_mo,LDA_mo) END_DOC integer, intent(in) :: LDA_ao,LDA_mo double precision, intent(in) :: A_ao(LDA_ao,ao_num) - double precision, intent(out) :: A_mo(LDA_mo,mo_tot_num) + double precision, intent(out) :: A_mo(LDA_mo,mo_num) double precision, allocatable :: T(:,:) - allocate ( T(ao_num,mo_tot_num) ) + allocate ( T(ao_num,mo_num) ) !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: T - call dgemm('N','N', ao_num, mo_tot_num, ao_num, & + call dgemm('N','N', ao_num, mo_num, ao_num, & 1.d0, A_ao,LDA_ao, & mo_coef, size(mo_coef,1), & 0.d0, T, size(T,1)) - call dgemm('T','N', mo_tot_num, mo_tot_num, ao_num, & + call dgemm('T','N', mo_num, mo_num, ao_num, & 1.d0, mo_coef,size(mo_coef,1), & T, ao_num, & 0.d0, A_mo, size(A_mo,1)) @@ -288,7 +270,7 @@ subroutine ao_ortho_cano_to_ao(A_ao,LDA_ao,A,LDA) BEGIN_DOC ! Transform A from the |AO| basis to the orthogonal |AO| basis ! - ! $C^{-1}.A_{ao}.C^\dagger^{-1}$ + ! $C^{-1}.A_{ao}.C^{\dagger-1}$ END_DOC integer, intent(in) :: LDA_ao,LDA double precision, intent(in) :: A_ao(LDA_ao,*) diff --git a/src/mo_basis/mos_in_r.irp.f b/src/mo_basis/mos_in_r.irp.f index 4bbf9b2b..03cade65 100644 --- a/src/mo_basis/mos_in_r.irp.f +++ b/src/mo_basis/mos_in_r.irp.f @@ -2,23 +2,23 @@ subroutine give_all_mos_at_r(r,mos_array) implicit none double precision, intent(in) :: r(3) - double precision, intent(out) :: mos_array(mo_tot_num) + double precision, intent(out) :: mos_array(mo_num) double precision :: aos_array(ao_num) call give_all_aos_at_r(r,aos_array) - call dgemv('N',mo_tot_num,ao_num,1.d0,mo_coef_transp,mo_tot_num,aos_array,1,0.d0,mos_array,1) + call dgemv('N',mo_num,ao_num,1.d0,mo_coef_transp,mo_num,aos_array,1,0.d0,mos_array,1) end subroutine give_all_mos_and_grad_at_r(r,mos_array,mos_grad_array) implicit none double precision, intent(in) :: r(3) - double precision, intent(out) :: mos_array(mo_tot_num) - double precision, intent(out) :: mos_grad_array(mo_tot_num,3) + double precision, intent(out) :: mos_array(mo_num) + double precision, intent(out) :: mos_grad_array(mo_num,3) integer :: i,j,k double precision :: aos_array(ao_num),aos_grad_array(ao_num,3) call give_all_aos_and_grad_at_r(r,aos_array,aos_grad_array) mos_array=0d0 mos_grad_array=0d0 - do j = 1, mo_tot_num + do j = 1, mo_num do k=1, ao_num mos_array(j) += mo_coef(k,j)*aos_array(k) mos_grad_array(j,1) += mo_coef(k,j)*aos_grad_array(k,1) @@ -32,15 +32,15 @@ end subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_lapl_array) implicit none double precision, intent(in) :: r(3) - double precision, intent(out) :: mos_array(mo_tot_num) - double precision, intent(out) :: mos_grad_array(mo_tot_num,3),mos_lapl_array(mo_tot_num,3) + double precision, intent(out) :: mos_array(mo_num) + double precision, intent(out) :: mos_grad_array(mo_num,3),mos_lapl_array(mo_num,3) integer :: i,j,k double precision :: aos_array(ao_num),aos_grad_array(ao_num,3),aos_lapl_array(ao_num,3) call give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array) mos_array=0d0 mos_grad_array=0d0 mos_lapl_array=0d0 - do j = 1, mo_tot_num + do j = 1, mo_num do k=1, ao_num mos_array(j) += mo_coef(k,j)*aos_array(k) mos_grad_array(j,1) += mo_coef(k,j)*aos_grad_array(k,1) diff --git a/src/mo_basis/track_orb.irp.f b/src/mo_basis/track_orb.irp.f index ff7886a3..a0333077 100644 --- a/src/mo_basis/track_orb.irp.f +++ b/src/mo_basis/track_orb.irp.f @@ -1,4 +1,4 @@ -BEGIN_PROVIDER [ double precision, mo_coef_begin_iteration, (ao_num,mo_tot_num) ] +BEGIN_PROVIDER [ double precision, mo_coef_begin_iteration, (ao_num,mo_num) ] implicit none BEGIN_DOC ! Void provider to store the coefficients of the |MO| basis at the beginning of the SCF iteration @@ -26,12 +26,12 @@ subroutine reorder_active_orb double precision, allocatable :: accu(:) integer, allocatable :: index_active_orb(:),iorder(:) double precision, allocatable :: mo_coef_tmp(:,:) - allocate(accu(mo_tot_num),index_active_orb(n_act_orb),iorder(mo_tot_num)) - allocate(mo_coef_tmp(ao_num,mo_tot_num)) + allocate(accu(mo_num),index_active_orb(n_act_orb),iorder(mo_num)) + allocate(mo_coef_tmp(ao_num,mo_num)) do i = 1, n_act_orb iorb = list_act(i) - do j = 1, mo_tot_num + do j = 1, mo_num accu(j) = 0.d0 iorder(j) = j do k = 1, ao_num @@ -41,7 +41,7 @@ subroutine reorder_active_orb enddo accu(j) = -dabs(accu(j)) enddo - call dsort(accu,iorder,mo_tot_num) + call dsort(accu,iorder,mo_num) index_active_orb(i) = iorder(1) enddo diff --git a/src/mo_basis/utils.irp.f b/src/mo_basis/utils.irp.f index df93f45b..c9758a79 100644 --- a/src/mo_basis/utils.irp.f +++ b/src/mo_basis/utils.irp.f @@ -5,12 +5,12 @@ subroutine save_mos call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename)) - call ezfio_set_mo_basis_mo_tot_num(mo_tot_num) + call ezfio_set_mo_basis_mo_num(mo_num) call ezfio_set_mo_basis_mo_label(mo_label) call ezfio_set_mo_basis_ao_md5(ao_md5) - allocate ( buffer(ao_num,mo_tot_num) ) + allocate ( buffer(ao_num,mo_num) ) buffer = 0.d0 - do j = 1, mo_tot_num + do j = 1, mo_num do i = 1, ao_num buffer(i,j) = mo_coef(i,j) enddo @@ -28,7 +28,7 @@ subroutine save_mos_truncated(n) call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename)) - call ezfio_set_mo_basis_mo_tot_num(n) + call ezfio_set_mo_basis_mo_num(n) call ezfio_set_mo_basis_mo_label(mo_label) call ezfio_set_mo_basis_ao_md5(ao_md5) allocate ( buffer(ao_num,n) ) @@ -56,8 +56,8 @@ subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label,sign,output) !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: mo_coef_new, R call write_time(6) - if (m /= mo_tot_num) then - print *, irp_here, ': Error : m/= mo_tot_num' + if (m /= mo_num) then + print *, irp_here, ': Error : m/= mo_num' stop 1 endif allocate(A(n,m),R(n,m),mo_coef_new(ao_num,m),eigvalues(m)) @@ -117,8 +117,8 @@ subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: mo_coef_new, U, Vt, A call write_time(6) - if (m /= mo_tot_num) then - print *, irp_here, ': Error : m/= mo_tot_num' + if (m /= mo_num) then + print *, irp_here, ': Error : m/= mo_num' stop 1 endif @@ -170,8 +170,8 @@ subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label) !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: mo_coef_new, U, Vt, A call write_time(6) - if (m /= mo_tot_num) then - print *, irp_here, ': Error : m/= mo_tot_num' + if (m /= mo_num) then + print *, irp_here, ': Error : m/= mo_num' stop 1 endif diff --git a/src/mo_guess/NEED b/src/mo_guess/NEED index 8d2a8e6a..4a62e076 100644 --- a/src/mo_guess/NEED +++ b/src/mo_guess/NEED @@ -1,2 +1,2 @@ mo_basis -mo_one_e_integrals +mo_one_e_ints diff --git a/src/mo_guess/h_core_guess_routine.irp.f b/src/mo_guess/h_core_guess_routine.irp.f index 5b4ede91..8fc3f6f2 100644 --- a/src/mo_guess/h_core_guess_routine.irp.f +++ b/src/mo_guess/h_core_guess_routine.irp.f @@ -5,9 +5,9 @@ subroutine hcore_guess implicit none character*(64) :: label 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,1,.false.) + call mo_as_eigvectors_of_mo_matrix(mo_one_e_integrals, & + size(mo_one_e_integrals,1), & + size(mo_one_e_integrals,2),label,1,.false.) call save_mos SOFT_TOUCH mo_coef mo_label end diff --git a/src/mo_guess/pot_mo_ortho_canonical_ints.irp.f b/src/mo_guess/pot_mo_ortho_canonical_ints.irp.f index 78fe7948..984d45a5 100644 --- a/src/mo_guess/pot_mo_ortho_canonical_ints.irp.f +++ b/src/mo_guess/pot_mo_ortho_canonical_ints.irp.f @@ -1,21 +1,21 @@ -BEGIN_PROVIDER [double precision, ao_ortho_canonical_nucl_elec_integral, (mo_tot_num,mo_tot_num)] +BEGIN_PROVIDER [double precision, ao_ortho_canonical_nucl_elec_integrals, (mo_num,mo_num)] implicit none integer :: i1,j1,i,j double precision :: c_i1,c_j1 - ao_ortho_canonical_nucl_elec_integral = 0.d0 + ao_ortho_canonical_nucl_elec_integrals = 0.d0 !$OMP PARALLEL DO DEFAULT(none) & !$OMP PRIVATE(i,j,i1,j1,c_j1,c_i1) & - !$OMP SHARED(mo_tot_num,ao_num,ao_ortho_canonical_coef, & - !$OMP ao_ortho_canonical_nucl_elec_integral, ao_nucl_elec_integral) - do i = 1, mo_tot_num - do j = 1, mo_tot_num + !$OMP SHARED(mo_num,ao_num,ao_ortho_canonical_coef, & + !$OMP ao_ortho_canonical_nucl_elec_integrals, ao_integrals_n_e) + do i = 1, mo_num + do j = 1, mo_num do i1 = 1,ao_num c_i1 = ao_ortho_canonical_coef(i1,i) do j1 = 1,ao_num c_j1 = c_i1*ao_ortho_canonical_coef(j1,j) - ao_ortho_canonical_nucl_elec_integral(j,i) = ao_ortho_canonical_nucl_elec_integral(j,i) + & - c_j1 * ao_nucl_elec_integral(j1,i1) + ao_ortho_canonical_nucl_elec_integrals(j,i) = ao_ortho_canonical_nucl_elec_integrals(j,i) + & + c_j1 * ao_integrals_n_e(j1,i1) enddo enddo enddo diff --git a/src/mo_guess/pot_mo_ortho_lowdin_ints.irp.f b/src/mo_guess/pot_mo_ortho_lowdin_ints.irp.f index 27ad6503..5a9f9978 100644 --- a/src/mo_guess/pot_mo_ortho_lowdin_ints.irp.f +++ b/src/mo_guess/pot_mo_ortho_lowdin_ints.irp.f @@ -1,21 +1,21 @@ -BEGIN_PROVIDER [double precision, ao_ortho_lowdin_nucl_elec_integral, (mo_tot_num,mo_tot_num)] +BEGIN_PROVIDER [double precision, ao_ortho_lowdin_nucl_elec_integrals, (mo_num,mo_num)] implicit none integer :: i1,j1,i,j double precision :: c_i1,c_j1 - ao_ortho_lowdin_nucl_elec_integral = 0.d0 + ao_ortho_lowdin_nucl_elec_integrals = 0.d0 !$OMP PARALLEL DO DEFAULT(none) & !$OMP PRIVATE(i,j,i1,j1,c_j1,c_i1) & - !$OMP SHARED(mo_tot_num,ao_num,ao_ortho_lowdin_coef, & - !$OMP ao_ortho_lowdin_nucl_elec_integral, ao_nucl_elec_integral) - do i = 1, mo_tot_num - do j = 1, mo_tot_num + !$OMP SHARED(mo_num,ao_num,ao_ortho_lowdin_coef, & + !$OMP ao_ortho_lowdin_nucl_elec_integrals, ao_integrals_n_e) + do i = 1, mo_num + do j = 1, mo_num do i1 = 1,ao_num c_i1 = ao_ortho_lowdin_coef(i1,i) do j1 = 1,ao_num c_j1 = c_i1*ao_ortho_lowdin_coef(j1,j) - ao_ortho_lowdin_nucl_elec_integral(j,i) = ao_ortho_lowdin_nucl_elec_integral(j,i) + & - c_j1 * ao_nucl_elec_integral(j1,i1) + ao_ortho_lowdin_nucl_elec_integrals(j,i) = ao_ortho_lowdin_nucl_elec_integrals(j,i) + & + c_j1 * ao_integrals_n_e(j1,i1) enddo enddo enddo diff --git a/src/mo_one_e_integrals/.gitignore b/src/mo_one_e_integrals/.gitignore deleted file mode 120000 index a10a1637..00000000 --- a/src/mo_one_e_integrals/.gitignore +++ /dev/null @@ -1 +0,0 @@ -../../data/module_gitignore \ No newline at end of file diff --git a/src/mo_one_e_integrals/EZFIO.cfg b/src/mo_one_e_integrals/EZFIO.cfg deleted file mode 100644 index b0ac1f94..00000000 --- a/src/mo_one_e_integrals/EZFIO.cfg +++ /dev/null @@ -1,24 +0,0 @@ -[integral_nuclear] -type: double precision -doc: Nucleus-electron integrals in |MO| basis set -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) -interface: ezfio - -[integral_kinetic] -type: double precision -doc: Kinetic energy integrals in |MO| basis set -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) -interface: ezfio - -[integral_pseudo] -type: double precision -doc: Pseudopotential integrals in |MO| basis set -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) -interface: ezfio - - -[disk_access_mo_one_integrals] -type: Disk_access -doc: Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ] -interface: ezfio,provider,ocaml -default: None diff --git a/src/mo_one_e_integrals/NEED b/src/mo_one_e_integrals/NEED deleted file mode 100644 index 33c2d37f..00000000 --- a/src/mo_one_e_integrals/NEED +++ /dev/null @@ -1,3 +0,0 @@ -ao_one_e_integrals -mo_basis -pseudo diff --git a/src/mo_one_e_integrals/README.rst b/src/mo_one_e_integrals/README.rst deleted file mode 100644 index f947de06..00000000 --- a/src/mo_one_e_integrals/README.rst +++ /dev/null @@ -1,13 +0,0 @@ -================== -mo_one_e_integrals -================== - -All the one-electron integrals in |MO| basis are defined here. - -The most important providers for usual quantum-chemistry calculation are: - -* `mo_kinetic_integral` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_mo_ints.irp.f`) -* `mo_nucl_elec_integral` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_mo_ints.irp.f`) -* `mo_mono_elec_integral` which are the the h_core operator integrals on the |AO| basis (see :file:`mo_mono_ints.irp.f`) - -Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_mo.irp.f`. diff --git a/src/mo_one_e_integrals/kin_mo_ints.irp.f b/src/mo_one_e_integrals/kin_mo_ints.irp.f deleted file mode 100644 index 308dd323..00000000 --- a/src/mo_one_e_integrals/kin_mo_ints.irp.f +++ /dev/null @@ -1,24 +0,0 @@ -BEGIN_PROVIDER [double precision, mo_kinetic_integral, (mo_tot_num,mo_tot_num)] - implicit none - BEGIN_DOC - ! Kinetic energy integrals in the MO basis - END_DOC - - if (read_mo_one_integrals) then - call ezfio_get_mo_one_e_integrals_integral_kinetic(mo_kinetic_integral) - print *, 'MO kinetic integrals read from disk' - else - call ao_to_mo( & - ao_kinetic_integral, & - size(ao_kinetic_integral,1), & - mo_kinetic_integral, & - size(mo_kinetic_integral,1) & - ) - endif - if (write_mo_one_integrals) then - call ezfio_set_mo_one_e_integrals_integral_kinetic(mo_kinetic_integral) - print *, 'MO kinetic integrals written to disk' - endif - -END_PROVIDER - diff --git a/src/mo_one_e_integrals/mo_mono_ints.irp.f b/src/mo_one_e_integrals/mo_mono_ints.irp.f deleted file mode 100644 index 891ed3d5..00000000 --- a/src/mo_one_e_integrals/mo_mono_ints.irp.f +++ /dev/null @@ -1,26 +0,0 @@ -BEGIN_PROVIDER [ double precision, mo_mono_elec_integral,(mo_tot_num,mo_tot_num)] - implicit none - integer :: i,j,n,l - BEGIN_DOC - ! array of the mono electronic hamiltonian on the MOs basis : - ! sum of the kinetic and nuclear electronic potential (and pseudo potential if needed) - END_DOC - print*,'Providing the mono electronic integrals' - - IF (do_pseudo) THEN - do j = 1, mo_tot_num - do i = 1, mo_tot_num - mo_mono_elec_integral(i,j) = mo_nucl_elec_integral(i,j) + mo_kinetic_integral(i,j) & - + mo_pseudo_integral(i,j) - enddo - enddo - - ELSE - do j = 1, mo_tot_num - do i = 1, mo_tot_num - mo_mono_elec_integral(i,j) = mo_nucl_elec_integral(i,j) + mo_kinetic_integral(i,j) - enddo - enddo - - END IF -END_PROVIDER diff --git a/src/mo_one_e_integrals/pot_mo_ints.irp.f b/src/mo_one_e_integrals/pot_mo_ints.irp.f deleted file mode 100644 index 70139a89..00000000 --- a/src/mo_one_e_integrals/pot_mo_ints.irp.f +++ /dev/null @@ -1,46 +0,0 @@ -BEGIN_PROVIDER [double precision, mo_nucl_elec_integral, (mo_tot_num,mo_tot_num)] - implicit none - BEGIN_DOC -! Nucleus-electron interaction on the |MO| basis - END_DOC - - if (read_mo_one_integrals) then - call ezfio_get_mo_one_e_integrals_integral_nuclear(mo_nucl_elec_integral) - print *, 'MO N-e integrals read from disk' - else - call ao_to_mo( & - ao_nucl_elec_integral, & - size(ao_nucl_elec_integral,1), & - mo_nucl_elec_integral, & - size(mo_nucl_elec_integral,1) & - ) - endif - if (write_mo_one_integrals) then - call ezfio_set_mo_one_e_integrals_integral_nuclear(mo_nucl_elec_integral) - print *, 'MO N-e integrals written to disk' - endif - -END_PROVIDER - - -BEGIN_PROVIDER [double precision, mo_nucl_elec_integral_per_atom, (mo_tot_num,mo_tot_num,nucl_num)] - implicit none - BEGIN_DOC -! mo_nucl_elec_integral_per_atom(i,j,k) = -! $\langle \phi_i| -\frac{1}{|r-R_k|} | \phi_j \rangle$. -! where R_k is the coordinate of the k-th nucleus. - END_DOC - - integer :: k - mo_nucl_elec_integral_per_atom = 0.d0 - do k = 1, nucl_num - call ao_to_mo( & - ao_nucl_elec_integral_per_atom(1,1,k), & - size(ao_nucl_elec_integral_per_atom,1), & - mo_nucl_elec_integral_per_atom(1,1,k), & - size(mo_nucl_elec_integral_per_atom,1) & - ) - enddo - -END_PROVIDER - diff --git a/src/mo_one_e_integrals/pot_mo_pseudo_ints.irp.f b/src/mo_one_e_integrals/pot_mo_pseudo_ints.irp.f deleted file mode 100644 index 5e09168f..00000000 --- a/src/mo_one_e_integrals/pot_mo_pseudo_ints.irp.f +++ /dev/null @@ -1,25 +0,0 @@ -BEGIN_PROVIDER [double precision, mo_pseudo_integral, (mo_tot_num,mo_tot_num)] - implicit none - BEGIN_DOC - ! interaction nuclear electron on the MO basis - END_DOC - - if (read_mo_one_integrals) then - call ezfio_get_mo_one_e_integrals_integral_pseudo(mo_pseudo_integral) - print *, 'MO pseudopotential integrals read from disk' - else - call ao_to_mo( & - ao_pseudo_integral, & - size(ao_pseudo_integral,1), & - mo_pseudo_integral, & - size(mo_pseudo_integral,1) & - ) - endif - if (write_mo_one_integrals) then - call ezfio_set_mo_one_e_integrals_integral_pseudo(mo_pseudo_integral) - print *, 'MO pseudopotential integrals written to disk' - endif - -END_PROVIDER - - diff --git a/src/mo_one_e_integrals/read_write.irp.f b/src/mo_one_e_integrals/read_write.irp.f deleted file mode 100644 index d9488357..00000000 --- a/src/mo_one_e_integrals/read_write.irp.f +++ /dev/null @@ -1,28 +0,0 @@ - BEGIN_PROVIDER [ logical, read_mo_one_integrals ] -&BEGIN_PROVIDER [ logical, write_mo_one_integrals ] - - BEGIN_DOC - ! One level of abstraction for disk_access_mo_integrals - END_DOC - implicit none - - if (disk_access_mo_one_integrals.EQ.'Read') then - read_mo_one_integrals = .True. - write_mo_one_integrals = .False. - - else if (disk_access_mo_one_integrals.EQ.'Write') then - read_mo_one_integrals = .False. - write_mo_one_integrals = .True. - - else if (disk_access_mo_one_integrals.EQ.'None') then - read_mo_one_integrals = .False. - write_mo_one_integrals = .False. - - else - print *, 'mo_one_e_integrals/disk_access_mo_one_integrals has a wrong type' - stop 1 - - endif - -END_PROVIDER - diff --git a/src/ao_one_e_integrals/.gitignore b/src/mo_one_e_ints/.gitignore similarity index 100% rename from src/ao_one_e_integrals/.gitignore rename to src/mo_one_e_ints/.gitignore diff --git a/src/mo_one_e_ints/EZFIO.cfg b/src/mo_one_e_ints/EZFIO.cfg new file mode 100644 index 00000000..79a3b351 --- /dev/null +++ b/src/mo_one_e_ints/EZFIO.cfg @@ -0,0 +1,51 @@ +[mo_integrals_e_n] +type: double precision +doc: Nucleus-electron integrals in |MO| basis set +size: (mo_basis.mo_num,mo_basis.mo_num) +interface: ezfio + +[io_mo_integrals_e_n] +type: Disk_access +doc: Read/Write |MO| electron-nucleus attraction integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + + +[mo_integrals_kinetic] +type: double precision +doc: Kinetic energy integrals in |MO| basis set +size: (mo_basis.mo_num,mo_basis.mo_num) +interface: ezfio + +[io_mo_integrals_kinetic] +type: Disk_access +doc: Read/Write |MO| one-electron kinetic integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + + + +[mo_integrals_pseudo] +type: double precision +doc: Pseudopotential integrals in |MO| basis set +size: (mo_basis.mo_num,mo_basis.mo_num) +interface: ezfio + +[io_mo_integrals_pseudo] +type: Disk_access +doc: Read/Write |MO| pseudopotential integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + +[mo_one_e_integrals] +type: double precision +doc: One-electron integrals in |MO| basis set +size: (mo_basis.mo_num,mo_basis.mo_num) +interface: ezfio + +[io_mo_one_e_integrals] +type: Disk_access +doc: Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + diff --git a/src/mo_one_e_ints/NEED b/src/mo_one_e_ints/NEED new file mode 100644 index 00000000..3bb37618 --- /dev/null +++ b/src/mo_one_e_ints/NEED @@ -0,0 +1,3 @@ +ao_one_e_ints +mo_basis +pseudo diff --git a/src/mo_one_e_ints/README.rst b/src/mo_one_e_ints/README.rst new file mode 100644 index 00000000..15bcedaf --- /dev/null +++ b/src/mo_one_e_ints/README.rst @@ -0,0 +1,13 @@ +================== +mo_one_e_integrals +================== + +All the one-electron integrals in |MO| basis are defined here. + +The most important providers for usual quantum-chemistry calculation are: + +* `mo_kinetic_integrals` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_mo_ints.irp.f`) +* `mo_integrals_n_e` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_mo_ints.irp.f`) +* `mo_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`mo_mono_ints.irp.f`) + +Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_mo.irp.f`. diff --git a/src/mo_one_e_integrals/ao_to_mo.irp.f b/src/mo_one_e_ints/ao_to_mo.irp.f similarity index 72% rename from src/mo_one_e_integrals/ao_to_mo.irp.f rename to src/mo_one_e_ints/ao_to_mo.irp.f index 2d0fc431..4216abef 100644 --- a/src/mo_one_e_integrals/ao_to_mo.irp.f +++ b/src/mo_one_e_ints/ao_to_mo.irp.f @@ -6,18 +6,18 @@ subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) ! (S.C).A_mo.(S.C)t END_DOC integer, intent(in) :: LDA_ao,LDA_mo - double precision, intent(in) :: A_mo(LDA_mo,mo_tot_num) + double precision, intent(in) :: A_mo(LDA_mo,mo_num) double precision, intent(out) :: A_ao(LDA_ao,ao_num) double precision, allocatable :: T(:,:) - allocate ( T(mo_tot_num,ao_num) ) + allocate ( T(mo_num,ao_num) ) - call dgemm('N','T', mo_tot_num, ao_num, mo_tot_num, & + call dgemm('N','T', mo_num, ao_num, mo_num, & 1.d0, A_mo,size(A_mo,1), & S_mo_coef, size(S_mo_coef,1), & 0.d0, T, size(T,1)) - call dgemm('N','N', ao_num, ao_num, mo_tot_num, & + call dgemm('N','N', ao_num, ao_num, mo_num, & 1.d0, S_mo_coef, size(S_mo_coef,1), & T, size(T,1), & 0.d0, A_ao, size(A_ao,1)) @@ -25,13 +25,13 @@ subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) deallocate(T) end -BEGIN_PROVIDER [ double precision, S_mo_coef, (ao_num, mo_tot_num) ] +BEGIN_PROVIDER [ double precision, S_mo_coef, (ao_num, mo_num) ] implicit none BEGIN_DOC ! Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. END_DOC - call dgemm('N','N', ao_num, mo_tot_num, ao_num, & + call dgemm('N','N', ao_num, mo_num, ao_num, & 1.d0, ao_overlap,size(ao_overlap,1), & mo_coef, size(mo_coef,1), & 0.d0, S_mo_coef, size(S_mo_coef,1)) diff --git a/src/mo_one_e_ints/kin_mo_ints.irp.f b/src/mo_one_e_ints/kin_mo_ints.irp.f new file mode 100644 index 00000000..216628bb --- /dev/null +++ b/src/mo_one_e_ints/kin_mo_ints.irp.f @@ -0,0 +1,24 @@ +BEGIN_PROVIDER [double precision, mo_kinetic_integrals, (mo_num,mo_num)] + implicit none + BEGIN_DOC + ! Kinetic energy integrals in the MO basis + END_DOC + + if (read_mo_integrals_kinetic) then + call ezfio_get_mo_one_e_ints_mo_integrals_kinetic(mo_kinetic_integrals) + print *, 'MO kinetic integrals read from disk' + else + call ao_to_mo( & + ao_kinetic_integrals, & + size(ao_kinetic_integrals,1), & + mo_kinetic_integrals, & + size(mo_kinetic_integrals,1) & + ) + endif + if (write_mo_integrals_kinetic) then + call ezfio_set_mo_one_e_ints_mo_integrals_kinetic(mo_kinetic_integrals) + print *, 'MO kinetic integrals written to disk' + endif + +END_PROVIDER + diff --git a/src/mo_one_e_ints/mo_one_e_ints.irp.f b/src/mo_one_e_ints/mo_one_e_ints.irp.f new file mode 100644 index 00000000..88a40f24 --- /dev/null +++ b/src/mo_one_e_ints/mo_one_e_ints.irp.f @@ -0,0 +1,26 @@ +BEGIN_PROVIDER [ double precision, mo_one_e_integrals,(mo_num,mo_num)] + implicit none + integer :: i,j,n,l + BEGIN_DOC + ! array of the mono electronic hamiltonian on the MOs basis : + ! sum of the kinetic and nuclear electronic potential (and pseudo potential if needed) + END_DOC + print*,'Providing the mono electronic integrals' + + IF (read_mo_one_e_integrals) THEN + call ezfio_get_mo_one_e_ints_mo_one_e_integrals(mo_one_e_integrals) + ELSE + mo_one_e_integrals = mo_integrals_n_e + mo_kinetic_integrals + + IF (DO_PSEUDO) THEN + mo_one_e_integrals += mo_pseudo_integrals + ENDIF + + ENDIF + + IF (write_mo_one_e_integrals) THEN + call ezfio_set_mo_one_e_ints_mo_one_e_integrals(mo_one_e_integrals) + print *, 'MO one-e integrals written to disk' + ENDIF + +END_PROVIDER diff --git a/src/mo_one_e_integrals/mo_overlap.irp.f b/src/mo_one_e_ints/mo_overlap.irp.f similarity index 79% rename from src/mo_one_e_integrals/mo_overlap.irp.f rename to src/mo_one_e_ints/mo_overlap.irp.f index 291bb38d..4ce83fcd 100644 --- a/src/mo_one_e_integrals/mo_overlap.irp.f +++ b/src/mo_one_e_ints/mo_overlap.irp.f @@ -1,16 +1,21 @@ -BEGIN_PROVIDER [ double precision, mo_overlap,(mo_tot_num,mo_tot_num)] +BEGIN_PROVIDER [ double precision, mo_overlap,(mo_num,mo_num) ] implicit none + BEGIN_DOC +! Provider to check that the MOs are indeed orthonormal. + END_DOC integer :: i,j,n,l double precision :: f integer :: lmax + + lmax = (ao_num/4) * 4 !$OMP PARALLEL DO SCHEDULE(STATIC) DEFAULT(NONE) & !$OMP PRIVATE(i,j,n,l) & !$OMP SHARED(mo_overlap,mo_coef,ao_overlap, & - !$OMP mo_tot_num,ao_num,lmax) - do j=1,mo_tot_num - do i= 1,mo_tot_num + !$OMP mo_num,ao_num,lmax) + do j=1,mo_num + do i= 1,mo_num mo_overlap(i,j) = 0.d0 do n = 1, lmax,4 do l = 1, ao_num @@ -29,5 +34,6 @@ BEGIN_PROVIDER [ double precision, mo_overlap,(mo_tot_num,mo_tot_num)] enddo enddo !$OMP END PARALLEL DO + END_PROVIDER diff --git a/src/mo_one_e_integrals/orthonormalize.irp.f b/src/mo_one_e_ints/orthonormalize.irp.f similarity index 74% rename from src/mo_one_e_integrals/orthonormalize.irp.f rename to src/mo_one_e_ints/orthonormalize.irp.f index 23956eef..bba75f17 100644 --- a/src/mo_one_e_integrals/orthonormalize.irp.f +++ b/src/mo_one_e_ints/orthonormalize.irp.f @@ -3,7 +3,7 @@ subroutine orthonormalize_mos integer :: m,p,s m = size(mo_coef,1) p = size(mo_overlap,1) - call ortho_lowdin(mo_overlap,p,mo_tot_num,mo_coef,m,ao_num) + call ortho_lowdin(mo_overlap,p,mo_num,mo_coef,m,ao_num) mo_label = 'Orthonormalized' SOFT_TOUCH mo_coef mo_label end diff --git a/src/mo_one_e_ints/pot_mo_ints.irp.f b/src/mo_one_e_ints/pot_mo_ints.irp.f new file mode 100644 index 00000000..e60ab072 --- /dev/null +++ b/src/mo_one_e_ints/pot_mo_ints.irp.f @@ -0,0 +1,46 @@ +BEGIN_PROVIDER [double precision, mo_integrals_n_e, (mo_num,mo_num)] + implicit none + BEGIN_DOC +! Nucleus-electron interaction on the |MO| basis + END_DOC + + if (read_mo_integrals_e_n) then + call ezfio_get_mo_one_e_ints_mo_integrals_e_n(mo_integrals_n_e) + print *, 'MO N-e integrals read from disk' + else + call ao_to_mo( & + ao_integrals_n_e, & + size(ao_integrals_n_e,1), & + mo_integrals_n_e, & + size(mo_integrals_n_e,1) & + ) + endif + if (write_mo_integrals_e_n) then + call ezfio_set_mo_one_e_ints_mo_integrals_e_n(mo_integrals_n_e) + print *, 'MO N-e integrals written to disk' + endif + +END_PROVIDER + + +BEGIN_PROVIDER [double precision, mo_integrals_n_e_per_atom, (mo_num,mo_num,nucl_num)] + implicit none + BEGIN_DOC +! mo_integrals_n_e_per_atom(i,j,k) = +! $\langle \phi_i| -\frac{1}{|r-R_k|} | \phi_j \rangle$. +! where R_k is the coordinate of the k-th nucleus. + END_DOC + + integer :: k + mo_integrals_n_e_per_atom = 0.d0 + do k = 1, nucl_num + call ao_to_mo( & + ao_integrals_n_e_per_atom(1,1,k), & + size(ao_integrals_n_e_per_atom,1), & + mo_integrals_n_e_per_atom(1,1,k), & + size(mo_integrals_n_e_per_atom,1) & + ) + enddo + +END_PROVIDER + diff --git a/src/mo_one_e_ints/pot_mo_pseudo_ints.irp.f b/src/mo_one_e_ints/pot_mo_pseudo_ints.irp.f new file mode 100644 index 00000000..8fe2aa40 --- /dev/null +++ b/src/mo_one_e_ints/pot_mo_pseudo_ints.irp.f @@ -0,0 +1,28 @@ +BEGIN_PROVIDER [double precision, mo_pseudo_integrals, (mo_num,mo_num)] + implicit none + BEGIN_DOC + ! Pseudopotential integrals in |MO| basis + END_DOC + + if (read_mo_integrals_pseudo) then + call ezfio_get_mo_one_e_ints_mo_integrals_pseudo(mo_pseudo_integrals) + print *, 'MO pseudopotential integrals read from disk' + else if (do_pseudo) then + call ao_to_mo( & + ao_pseudo_integrals, & + size(ao_pseudo_integrals,1), & + mo_pseudo_integrals, & + size(mo_pseudo_integrals,1) & + ) + else + mo_pseudo_integrals = 0.d0 + endif + + if (write_mo_integrals_pseudo) then + call ezfio_set_mo_one_e_ints_mo_integrals_pseudo(mo_pseudo_integrals) + print *, 'MO pseudopotential integrals written to disk' + endif + +END_PROVIDER + + diff --git a/src/mo_one_e_integrals/spread_dipole_mo.irp.f b/src/mo_one_e_ints/spread_dipole_mo.irp.f similarity index 85% rename from src/mo_one_e_integrals/spread_dipole_mo.irp.f rename to src/mo_one_e_ints/spread_dipole_mo.irp.f index 9e21ec21..e4484433 100644 --- a/src/mo_one_e_integrals/spread_dipole_mo.irp.f +++ b/src/mo_one_e_ints/spread_dipole_mo.irp.f @@ -1,6 +1,6 @@ - BEGIN_PROVIDER [double precision, mo_dipole_x , (mo_tot_num,mo_tot_num)] -&BEGIN_PROVIDER [double precision, mo_dipole_y , (mo_tot_num,mo_tot_num)] -&BEGIN_PROVIDER [double precision, mo_dipole_z , (mo_tot_num,mo_tot_num)] + BEGIN_PROVIDER [double precision, mo_dipole_x , (mo_num,mo_num)] +&BEGIN_PROVIDER [double precision, mo_dipole_y , (mo_num,mo_num)] +&BEGIN_PROVIDER [double precision, mo_dipole_z , (mo_num,mo_num)] BEGIN_DOC ! array of the integrals of MO_i * x MO_j ! array of the integrals of MO_i * y MO_j @@ -29,9 +29,9 @@ END_PROVIDER - BEGIN_PROVIDER [double precision, mo_spread_x , (mo_tot_num,mo_tot_num)] -&BEGIN_PROVIDER [double precision, mo_spread_y , (mo_tot_num,mo_tot_num)] -&BEGIN_PROVIDER [double precision, mo_spread_z , (mo_tot_num,mo_tot_num)] + BEGIN_PROVIDER [double precision, mo_spread_x , (mo_num,mo_num)] +&BEGIN_PROVIDER [double precision, mo_spread_y , (mo_num,mo_num)] +&BEGIN_PROVIDER [double precision, mo_spread_z , (mo_num,mo_num)] BEGIN_DOC ! array of the integrals of MO_i * x^2 MO_j ! array of the integrals of MO_i * y^2 MO_j diff --git a/src/mo_two_e_erf_integrals/NEED b/src/mo_two_e_erf_integrals/NEED deleted file mode 100644 index 525f3eba..00000000 --- a/src/mo_two_e_erf_integrals/NEED +++ /dev/null @@ -1,3 +0,0 @@ -ao_two_e_erf_integrals -mo_two_e_integrals -mo_basis diff --git a/src/mo_two_e_erf_integrals/ints_erf_3_index.irp.f b/src/mo_two_e_erf_integrals/ints_erf_3_index.irp.f deleted file mode 100644 index bd3da12b..00000000 --- a/src/mo_two_e_erf_integrals/ints_erf_3_index.irp.f +++ /dev/null @@ -1,28 +0,0 @@ - BEGIN_PROVIDER [double precision, int_erf_3_index, (mo_tot_num,mo_tot_num, mo_tot_num)] -&BEGIN_PROVIDER [double precision, int_erf_3_index_exc,(mo_tot_num,mo_tot_num, mo_tot_num)] - implicit none - BEGIN_DOC - ! int_erf_3_index(i,j) = = (ii|jj) with the erf interaction - ! - ! int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction - END_DOC - integer :: i,j,k,l - double precision :: get_mo_bielec_integral_erf - double precision :: integral - - do k = 1, mo_tot_num - do i = 1, mo_tot_num - do j = 1, mo_tot_num - l = j - integral = get_mo_bielec_integral_erf(i,j,k,l,mo_integrals_erf_map) - int_erf_3_index(j,i,k) = integral - l = j - integral = get_mo_bielec_integral_erf(i,j,l,k,mo_integrals_erf_map) - int_erf_3_index_exc(j,i,k) = integral - enddo - enddo - enddo - - -END_PROVIDER - diff --git a/src/mo_two_e_erf_integrals/read_write_erf.irp.f b/src/mo_two_e_erf_integrals/read_write_erf.irp.f deleted file mode 100644 index 4683350b..00000000 --- a/src/mo_two_e_erf_integrals/read_write_erf.irp.f +++ /dev/null @@ -1,27 +0,0 @@ - BEGIN_PROVIDER [ logical, read_mo_integrals_erf ] -&BEGIN_PROVIDER [ logical, write_mo_integrals_erf ] - implicit none - - BEGIN_DOC - ! Flag to read or write the |MO| erf integrals - END_DOC - - if (disk_access_mo_integrals_erf.EQ.'Read') then - read_mo_integrals_erf = .True. - write_mo_integrals_erf = .False. - - else if (disk_access_mo_integrals_erf.EQ.'Write') then - read_mo_integrals_erf = .False. - write_mo_integrals_erf = .True. - - else if (disk_access_mo_integrals_erf.EQ.'None') then - read_mo_integrals_erf = .False. - write_mo_integrals_erf = .False. - - else - print *, 'disk_access_mo_integrals_erf has a wrong type' - stop 1 - - endif - -END_PROVIDER diff --git a/src/mo_two_e_erf_integrals/EZFIO.cfg b/src/mo_two_e_erf_ints/EZFIO.cfg similarity index 84% rename from src/mo_two_e_erf_integrals/EZFIO.cfg rename to src/mo_two_e_erf_ints/EZFIO.cfg index 5c882d60..57137e65 100644 --- a/src/mo_two_e_erf_integrals/EZFIO.cfg +++ b/src/mo_two_e_erf_ints/EZFIO.cfg @@ -1,4 +1,4 @@ -[disk_access_mo_integrals_erf] +[io_mo_two_e_integrals_erf] type: Disk_access doc: Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ] interface: ezfio,provider,ocaml diff --git a/src/mo_two_e_erf_ints/NEED b/src/mo_two_e_erf_ints/NEED new file mode 100644 index 00000000..7adb17a1 --- /dev/null +++ b/src/mo_two_e_erf_ints/NEED @@ -0,0 +1,3 @@ +ao_two_e_erf_ints +mo_two_e_ints +mo_basis diff --git a/src/mo_two_e_erf_integrals/README.rst b/src/mo_two_e_erf_ints/README.rst similarity index 79% rename from src/mo_two_e_erf_integrals/README.rst rename to src/mo_two_e_erf_ints/README.rst index ecd34cbc..634a9916 100644 --- a/src/mo_two_e_erf_integrals/README.rst +++ b/src/mo_two_e_erf_ints/README.rst @@ -1,15 +1,15 @@ ====================== -mo_two_e_erf_integrals +mo_two_e_erf_ints ====================== Here, all two-electron integrals (:math:`erf({\mu}_{erf} * r_{12})/r_{12}`) are computed. As they have 4 indices and many are zero, they are stored in a map, as defined in :file:`Utils/map_module.f90`. -The range separation parameter :math:`{\mu}_{erf}` is the variable :option:`ao_two_e_erf_integrals mu_erf`. +The range separation parameter :math:`{\mu}_{erf}` is the variable :option:`ao_two_e_erf_ints mu_erf`. To fetch an |MO| integral, use -`get_mo_bielec_integral_erf(i,j,k,l,mo_integrals_map_erf)` +`get_mo_two_e_integral_erf(i,j,k,l,mo_integrals_map_erf)` The conventions are: diff --git a/src/mo_two_e_erf_integrals/core_quantities_erf.irp.f b/src/mo_two_e_erf_ints/core_quantities_erf.irp.f similarity index 68% rename from src/mo_two_e_erf_integrals/core_quantities_erf.irp.f rename to src/mo_two_e_erf_ints/core_quantities_erf.irp.f index 9ff4672d..81cc2521 100644 --- a/src/mo_two_e_erf_integrals/core_quantities_erf.irp.f +++ b/src/mo_two_e_erf_ints/core_quantities_erf.irp.f @@ -7,7 +7,7 @@ BEGIN_PROVIDER [double precision, core_energy_erf] core_energy_erf = 0.d0 do i = 1, n_core_orb j = list_core(i) - core_energy_erf += 2.d0 * mo_mono_elec_integral(j,j) + mo_two_e_int_erf_jj(j,j) + core_energy_erf += 2.d0 * mo_one_e_integrals(j,j) + mo_two_e_int_erf_jj(j,j) do k = i+1, n_core_orb l = list_core(k) core_energy_erf += 2.d0 * (2.d0 * mo_two_e_int_erf_jj(j,l) - mo_two_e_int_erf_jj_exchange(j,l)) @@ -17,10 +17,10 @@ BEGIN_PROVIDER [double precision, core_energy_erf] END_PROVIDER -BEGIN_PROVIDER [double precision, core_fock_operator_erf, (mo_tot_num,mo_tot_num)] +BEGIN_PROVIDER [double precision, core_fock_operator_erf, (mo_num,mo_num)] implicit none integer :: i,j,k,l,m,n - double precision :: get_mo_bielec_integral_erf + double precision :: get_mo_two_e_integral_erf BEGIN_DOC ! this is the contribution to the Fock operator from the core electrons with the erf interaction END_DOC @@ -31,7 +31,7 @@ BEGIN_PROVIDER [double precision, core_fock_operator_erf, (mo_tot_num,mo_tot_num l = list_act(k) do m = 1, n_core_orb n = list_core(m) - core_fock_operator_erf(j,l) += 2.d0 * get_mo_bielec_integral_erf(j,n,l,n,mo_integrals_erf_map) - get_mo_bielec_integral_erf(j,n,n,l,mo_integrals_erf_map) + core_fock_operator_erf(j,l) += 2.d0 * get_mo_two_e_integral_erf(j,n,l,n,mo_integrals_erf_map) - get_mo_two_e_integral_erf(j,n,n,l,mo_integrals_erf_map) enddo enddo enddo diff --git a/src/mo_two_e_erf_ints/ints_erf_3_index.irp.f b/src/mo_two_e_erf_ints/ints_erf_3_index.irp.f new file mode 100644 index 00000000..7cbfcf74 --- /dev/null +++ b/src/mo_two_e_erf_ints/ints_erf_3_index.irp.f @@ -0,0 +1,28 @@ + BEGIN_PROVIDER [double precision, int_erf_3_index, (mo_num,mo_num, mo_num)] +&BEGIN_PROVIDER [double precision, int_erf_3_index_exc,(mo_num,mo_num, mo_num)] + implicit none + BEGIN_DOC + ! int_erf_3_index(i,j) = = (ii|jj) with the erf interaction + ! + ! int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction + END_DOC + integer :: i,j,k,l + double precision :: get_mo_two_e_integral_erf + double precision :: integral + + do k = 1, mo_num + do i = 1, mo_num + do j = 1, mo_num + l = j + integral = get_mo_two_e_integral_erf(i,j,k,l,mo_integrals_erf_map) + int_erf_3_index(j,i,k) = integral + l = j + integral = get_mo_two_e_integral_erf(i,j,l,k,mo_integrals_erf_map) + int_erf_3_index_exc(j,i,k) = integral + enddo + enddo + enddo + + +END_PROVIDER + diff --git a/src/mo_two_e_erf_integrals/map_integrals_erf.irp.f b/src/mo_two_e_erf_ints/map_integrals_erf.irp.f similarity index 85% rename from src/mo_two_e_erf_integrals/map_integrals_erf.irp.f rename to src/mo_two_e_erf_ints/map_integrals_erf.irp.f index a7d9dbb1..8176c4dd 100644 --- a/src/mo_two_e_erf_integrals/map_integrals_erf.irp.f +++ b/src/mo_two_e_erf_ints/map_integrals_erf.irp.f @@ -56,7 +56,7 @@ BEGIN_PROVIDER [ type(map_type), mo_integrals_erf_map ] END_DOC integer(key_kind) :: key_max integer(map_size_kind) :: sze - call bielec_integrals_index(mo_tot_num,mo_tot_num,mo_tot_num,mo_tot_num,key_max) + call two_e_integrals_index(mo_num,mo_num,mo_num,mo_num,key_max) sze = key_max call map_init(mo_integrals_erf_map,sze) print*, 'MO erf map initialized' @@ -85,7 +85,7 @@ end ! Min and max values of the MOs for which the integrals are in the cache END_DOC mo_integrals_erf_cache_min = max(1,elec_alpha_num - 31) - mo_integrals_erf_cache_max = min(mo_tot_num,mo_integrals_erf_cache_min+63) + mo_integrals_erf_cache_max = min(mo_num,mo_integrals_erf_cache_min+63) END_PROVIDER @@ -94,7 +94,7 @@ BEGIN_PROVIDER [ double precision, mo_integrals_erf_cache, (0:64*64*64*64) ] BEGIN_DOC ! Cache of |MO| integrals for fast access END_DOC - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map integer :: i,j,k,l integer :: ii integer(key_kind) :: idx @@ -106,7 +106,7 @@ BEGIN_PROVIDER [ double precision, mo_integrals_erf_cache, (0:64*64*64*64) ] do j=mo_integrals_erf_cache_min,mo_integrals_erf_cache_max do i=mo_integrals_erf_cache_min,mo_integrals_erf_cache_max !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,idx) + call two_e_integrals_index(i,j,k,l,idx) !DIR$ FORCEINLINE call map_get(mo_integrals_erf_map,idx,integral) ii = l-mo_integrals_erf_cache_min @@ -123,7 +123,7 @@ BEGIN_PROVIDER [ double precision, mo_integrals_erf_cache, (0:64*64*64*64) ] END_PROVIDER -double precision function get_mo_bielec_integral_erf(i,j,k,l,map) +double precision function get_mo_two_e_integral_erf(i,j,k,l,map) use map_module implicit none BEGIN_DOC @@ -134,42 +134,42 @@ double precision function get_mo_bielec_integral_erf(i,j,k,l,map) integer :: ii type(map_type), intent(inout) :: map real(integral_kind) :: tmp - PROVIDE mo_bielec_integrals_erf_in_map mo_integrals_erf_cache + PROVIDE mo_two_e_integrals_erf_in_map mo_integrals_erf_cache ii = l-mo_integrals_erf_cache_min ii = ior(ii, k-mo_integrals_erf_cache_min) ii = ior(ii, j-mo_integrals_erf_cache_min) ii = ior(ii, i-mo_integrals_erf_cache_min) if (iand(ii, -64) /= 0) then !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,idx) + call two_e_integrals_index(i,j,k,l,idx) !DIR$ FORCEINLINE call map_get(map,idx,tmp) - get_mo_bielec_integral_erf = dble(tmp) + get_mo_two_e_integral_erf = dble(tmp) else ii = l-mo_integrals_erf_cache_min ii = ior( ishft(ii,6), k-mo_integrals_erf_cache_min) ii = ior( ishft(ii,6), j-mo_integrals_erf_cache_min) ii = ior( ishft(ii,6), i-mo_integrals_erf_cache_min) - get_mo_bielec_integral_erf = mo_integrals_erf_cache(ii) + get_mo_two_e_integral_erf = mo_integrals_erf_cache(ii) endif end -double precision function mo_bielec_integral_erf(i,j,k,l) +double precision function mo_two_e_integral_erf(i,j,k,l) implicit none BEGIN_DOC ! Returns one integral $\langle ij|kl \rangle$ in the |MO| basis END_DOC integer, intent(in) :: i,j,k,l - double precision :: get_mo_bielec_integral_erf - PROVIDE mo_bielec_integrals_erf_in_map mo_integrals_erf_cache + double precision :: get_mo_two_e_integral_erf + PROVIDE mo_two_e_integrals_erf_in_map mo_integrals_erf_cache !DIR$ FORCEINLINE - PROVIDE mo_bielec_integrals_erf_in_map - mo_bielec_integral_erf = get_mo_bielec_integral_erf(i,j,k,l,mo_integrals_erf_map) + PROVIDE mo_two_e_integrals_erf_in_map + mo_two_e_integral_erf = get_mo_two_e_integral_erf(i,j,k,l,mo_integrals_erf_map) return end -subroutine get_mo_bielec_integrals_erf(j,k,l,sze,out_val,map) +subroutine get_mo_two_e_integrals_erf(j,k,l,sze,out_val,map) use map_module implicit none BEGIN_DOC @@ -182,11 +182,11 @@ subroutine get_mo_bielec_integrals_erf(j,k,l,sze,out_val,map) integer :: i integer(key_kind) :: hash(sze) real(integral_kind) :: tmp_val(sze) - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map do i=1,sze !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,hash(i)) + call two_e_integrals_index(i,j,k,l,hash(i)) enddo if (key_kind == 8) then @@ -200,7 +200,7 @@ subroutine get_mo_bielec_integrals_erf(j,k,l,sze,out_val,map) endif end -subroutine get_mo_bielec_integrals_erf_ij(k,l,sze,out_array,map) +subroutine get_mo_two_e_integrals_erf_ij(k,l,sze,out_array,map) use map_module implicit none BEGIN_DOC @@ -216,7 +216,7 @@ subroutine get_mo_bielec_integrals_erf_ij(k,l,sze,out_array,map) integer ,allocatable :: pairs(:,:), iorder(:) real(integral_kind), allocatable :: tmp_val(:) - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map allocate (hash(sze*sze), pairs(2,sze*sze),iorder(sze*sze), & tmp_val(sze*sze)) @@ -226,7 +226,7 @@ subroutine get_mo_bielec_integrals_erf_ij(k,l,sze,out_array,map) do i=1,sze kk += 1 !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,hash(kk)) + call two_e_integrals_index(i,j,k,l,hash(kk)) pairs(1,kk) = i pairs(2,kk) = j iorder(kk) = kk @@ -255,7 +255,7 @@ subroutine get_mo_bielec_integrals_erf_ij(k,l,sze,out_array,map) end -subroutine get_mo_bielec_integrals_erf_i1j1(k,l,sze,out_array,map) +subroutine get_mo_two_e_integrals_erf_i1j1(k,l,sze,out_array,map) use map_module implicit none BEGIN_DOC @@ -271,7 +271,7 @@ subroutine get_mo_bielec_integrals_erf_i1j1(k,l,sze,out_array,map) integer ,allocatable :: pairs(:,:), iorder(:) real(integral_kind), allocatable :: tmp_val(:) - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map allocate (hash(sze*sze), pairs(2,sze*sze),iorder(sze*sze), & tmp_val(sze*sze)) @@ -281,7 +281,7 @@ subroutine get_mo_bielec_integrals_erf_i1j1(k,l,sze,out_array,map) do i=1,sze kk += 1 !DIR$ FORCEINLINE - call bielec_integrals_index(i,k,j,l,hash(kk)) + call two_e_integrals_index(i,k,j,l,hash(kk)) pairs(1,kk) = i pairs(2,kk) = j iorder(kk) = kk @@ -310,7 +310,7 @@ subroutine get_mo_bielec_integrals_erf_i1j1(k,l,sze,out_array,map) end -subroutine get_mo_bielec_integrals_erf_coulomb_ii(k,l,sze,out_val,map) +subroutine get_mo_two_e_integrals_erf_coulomb_ii(k,l,sze,out_val,map) use map_module implicit none BEGIN_DOC @@ -325,12 +325,12 @@ subroutine get_mo_bielec_integrals_erf_coulomb_ii(k,l,sze,out_val,map) integer :: i integer(key_kind) :: hash(sze) real(integral_kind) :: tmp_val(sze) - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map integer :: kk do i=1,sze !DIR$ FORCEINLINE - call bielec_integrals_index(k,i,l,i,hash(i)) + call two_e_integrals_index(k,i,l,i,hash(i)) enddo if (key_kind == 8) then @@ -344,7 +344,7 @@ subroutine get_mo_bielec_integrals_erf_coulomb_ii(k,l,sze,out_val,map) endif end -subroutine get_mo_bielec_integrals_erf_exch_ii(k,l,sze,out_val,map) +subroutine get_mo_two_e_integrals_erf_exch_ii(k,l,sze,out_val,map) use map_module implicit none BEGIN_DOC @@ -359,12 +359,12 @@ subroutine get_mo_bielec_integrals_erf_exch_ii(k,l,sze,out_val,map) integer :: i integer(key_kind) :: hash(sze) real(integral_kind) :: tmp_val(sze) - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map integer :: kk do i=1,sze !DIR$ FORCEINLINE - call bielec_integrals_index(k,i,i,l,hash(i)) + call two_e_integrals_index(k,i,i,l,hash(i)) enddo if (key_kind == 8) then diff --git a/src/mo_two_e_erf_integrals/mo_bi_integrals_erf.irp.f b/src/mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f similarity index 72% rename from src/mo_two_e_erf_integrals/mo_bi_integrals_erf.irp.f rename to src/mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f index fe87d332..b507ef2e 100644 --- a/src/mo_two_e_erf_integrals/mo_bi_integrals_erf.irp.f +++ b/src/mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f @@ -1,4 +1,4 @@ -subroutine mo_bielec_integrals_erf_index(i,j,k,l,i1) +subroutine mo_two_e_integrals_erf_index(i,j,k,l,i1) use map_module implicit none BEGIN_DOC @@ -19,26 +19,26 @@ subroutine mo_bielec_integrals_erf_index(i,j,k,l,i1) end -BEGIN_PROVIDER [ logical, mo_bielec_integrals_erf_in_map ] +BEGIN_PROVIDER [ logical, mo_two_e_integrals_erf_in_map ] use map_module implicit none integer(bit_kind) :: mask_ijkl(N_int,4) integer(bit_kind) :: mask_ijk(N_int,3) BEGIN_DOC - ! If True, the map of MO bielectronic integrals is provided + ! If True, the map of MO two-electron integrals is provided END_DOC real :: map_mb - mo_bielec_integrals_erf_in_map = .True. - if (read_mo_integrals_erf) then + mo_two_e_integrals_erf_in_map = .True. + if (read_mo_two_e_integrals_erf) then print*,'Reading the MO integrals_erf' call map_load_from_disk(trim(ezfio_filename)//'/work/mo_ints_erf',mo_integrals_erf_map) print*, 'MO integrals_erf provided' return else - PROVIDE ao_bielec_integrals_erf_in_map + PROVIDE ao_two_e_integrals_erf_in_map endif ! call four_index_transform_block(ao_integrals_erf_map,mo_integrals_erf_map, & @@ -52,22 +52,22 @@ BEGIN_PROVIDER [ logical, mo_bielec_integrals_erf_in_map ] ! print*,'Molecular integrals ERF provided:' ! print*,' Size of MO ERF map ', map_mb(mo_integrals_erf_map) ,'MB' ! print*,' Number of MO ERF integrals: ', mo_erf_map_size - if (write_mo_integrals_erf) then + if (write_mo_two_e_integrals_erf) then call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints_erf',mo_integrals_erf_map) - call ezfio_set_mo_two_e_erf_integrals_disk_access_mo_integrals_erf("Read") + call ezfio_set_mo_two_e_erf_ints_io_mo_two_e_integrals_erf("Read") endif END_PROVIDER - BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_from_ao, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_exchange_from_ao, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_anti_from_ao, (mo_tot_num,mo_tot_num) ] + BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_from_ao, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_exchange_from_ao, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_anti_from_ao, (mo_num,mo_num) ] BEGIN_DOC - ! mo_bielec_integral_jj_from_ao(i,j) = J_ij - ! mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij - ! mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij + ! mo_two_e_integral_jj_from_ao(i,j) = J_ij + ! mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij + ! mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij END_DOC implicit none integer :: i,j,p,q,r,s @@ -80,7 +80,7 @@ END_PROVIDER double precision, allocatable :: iqrs(:,:), iqsr(:,:), iqis(:), iqri(:) if (.not.do_direct_integrals) then - PROVIDE ao_bielec_integrals_erf_in_map mo_coef + PROVIDE ao_two_e_integrals_erf_in_map mo_coef endif mo_two_e_int_erf_jj_from_ao = 0.d0 @@ -92,13 +92,13 @@ END_PROVIDER !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE (i,j,p,q,r,s,integral,c,n,pp,int_value,int_idx, & !$OMP iqrs, iqsr,iqri,iqis) & - !$OMP SHARED(mo_tot_num,mo_coef_transp,ao_num,& + !$OMP SHARED(mo_num,mo_coef_transp,ao_num,& !$OMP ao_integrals_threshold,do_direct_integrals) & !$OMP REDUCTION(+:mo_two_e_int_erf_jj_from_ao,mo_two_e_int_erf_jj_exchange_from_ao) allocate( int_value(ao_num), int_idx(ao_num), & - iqrs(mo_tot_num,ao_num), iqis(mo_tot_num), iqri(mo_tot_num),& - iqsr(mo_tot_num,ao_num) ) + iqrs(mo_num,ao_num), iqis(mo_num), iqri(mo_num),& + iqsr(mo_num,ao_num) ) !$OMP DO SCHEDULE (guided) do s=1,ao_num @@ -106,31 +106,31 @@ END_PROVIDER do j=1,ao_num !DIR$ VECTOR ALIGNED - do i=1,mo_tot_num + do i=1,mo_num iqrs(i,j) = 0.d0 iqsr(i,j) = 0.d0 enddo enddo if (do_direct_integrals) then - double precision :: ao_bielec_integral_erf + double precision :: ao_two_e_integral_erf do r=1,ao_num - call compute_ao_bielec_integrals_erf(q,r,s,ao_num,int_value) + call compute_ao_two_e_integrals_erf(q,r,s,ao_num,int_value) do p=1,ao_num integral = int_value(p) if (abs(integral) > ao_integrals_threshold) then !DIR$ VECTOR ALIGNED - do i=1,mo_tot_num + do i=1,mo_num iqrs(i,r) += mo_coef_transp(i,p) * integral enddo endif enddo - call compute_ao_bielec_integrals_erf(q,s,r,ao_num,int_value) + call compute_ao_two_e_integrals_erf(q,s,r,ao_num,int_value) do p=1,ao_num integral = int_value(p) if (abs(integral) > ao_integrals_threshold) then !DIR$ VECTOR ALIGNED - do i=1,mo_tot_num + do i=1,mo_num iqsr(i,r) += mo_coef_transp(i,p) * integral enddo endif @@ -140,24 +140,24 @@ END_PROVIDER else do r=1,ao_num - call get_ao_bielec_integrals_erf_non_zero(q,r,s,ao_num,int_value,int_idx,n) + call get_ao_two_e_integrals_erf_non_zero(q,r,s,ao_num,int_value,int_idx,n) do pp=1,n p = int_idx(pp) integral = int_value(pp) if (abs(integral) > ao_integrals_threshold) then !DIR$ VECTOR ALIGNED - do i=1,mo_tot_num + do i=1,mo_num iqrs(i,r) += mo_coef_transp(i,p) * integral enddo endif enddo - call get_ao_bielec_integrals_erf_non_zero(q,s,r,ao_num,int_value,int_idx,n) + call get_ao_two_e_integrals_erf_non_zero(q,s,r,ao_num,int_value,int_idx,n) do pp=1,n p = int_idx(pp) integral = int_value(pp) if (abs(integral) > ao_integrals_threshold) then !DIR$ VECTOR ALIGNED - do i=1,mo_tot_num + do i=1,mo_num iqsr(i,r) += mo_coef_transp(i,p) * integral enddo endif @@ -168,14 +168,14 @@ END_PROVIDER iqri = 0.d0 do r=1,ao_num !DIR$ VECTOR ALIGNED - do i=1,mo_tot_num + do i=1,mo_num iqis(i) += mo_coef_transp(i,r) * iqrs(i,r) iqri(i) += mo_coef_transp(i,r) * iqsr(i,r) enddo enddo - do i=1,mo_tot_num + do i=1,mo_num !DIR$ VECTOR ALIGNED - do j=1,mo_tot_num + do j=1,mo_num c = mo_coef_transp(j,q)*mo_coef_transp(j,s) mo_two_e_int_erf_jj_from_ao(j,i) += c * iqis(i) mo_two_e_int_erf_jj_exchange_from_ao(j,i) += c * iqri(i) @@ -195,27 +195,27 @@ END_PROVIDER END_PROVIDER - BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_exchange, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_anti, (mo_tot_num,mo_tot_num) ] + BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_exchange, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_int_erf_jj_anti, (mo_num,mo_num) ] implicit none BEGIN_DOC - ! mo_bielec_integral_jj(i,j) = J_ij - ! mo_bielec_integral_jj_exchange(i,j) = K_ij - ! mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij + ! mo_two_e_integrals_jj(i,j) = J_ij + ! mo_two_e_integrals_jj_exchange(i,j) = K_ij + ! mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij END_DOC integer :: i,j - double precision :: get_mo_bielec_integral_erf + double precision :: get_mo_two_e_integral_erf - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map mo_two_e_int_erf_jj = 0.d0 mo_two_e_int_erf_jj_exchange = 0.d0 - do j=1,mo_tot_num - do i=1,mo_tot_num - mo_two_e_int_erf_jj(i,j) = get_mo_bielec_integral_erf(i,j,i,j,mo_integrals_erf_map) - mo_two_e_int_erf_jj_exchange(i,j) = get_mo_bielec_integral_erf(i,j,j,i,mo_integrals_erf_map) + do j=1,mo_num + do i=1,mo_num + mo_two_e_int_erf_jj(i,j) = get_mo_two_e_integral_erf(i,j,i,j,mo_integrals_erf_map) + mo_two_e_int_erf_jj_exchange(i,j) = get_mo_two_e_integral_erf(i,j,j,i,mo_integrals_erf_map) mo_two_e_int_erf_jj_anti(i,j) = mo_two_e_int_erf_jj(i,j) - mo_two_e_int_erf_jj_exchange(i,j) enddo enddo @@ -230,7 +230,7 @@ subroutine clear_mo_erf_map END_DOC call map_deinit(mo_integrals_erf_map) FREE mo_integrals_erf_map mo_two_e_int_erf_jj mo_two_e_int_erf_jj_anti - FREE mo_two_e_int_erf_jj_exchange mo_bielec_integrals_erf_in_map + FREE mo_two_e_int_erf_jj_exchange mo_two_e_integrals_erf_in_map end @@ -238,7 +238,7 @@ end subroutine provide_all_mo_integrals_erf implicit none provide mo_integrals_erf_map mo_two_e_int_erf_jj mo_two_e_int_erf_jj_anti - provide mo_two_e_int_erf_jj_exchange mo_bielec_integrals_erf_in_map + provide mo_two_e_int_erf_jj_exchange mo_two_e_integrals_erf_in_map end @@ -259,12 +259,12 @@ subroutine add_integrals_to_map_erf(mask_ijkl) integer, allocatable :: list_ijkl(:,:) integer :: n_i, n_j, n_k, n_l - integer, allocatable :: bielec_tmp_0_idx(:) - real(integral_kind), allocatable :: bielec_tmp_0(:,:) - double precision, allocatable :: bielec_tmp_1(:) - double precision, allocatable :: bielec_tmp_2(:,:) - double precision, allocatable :: bielec_tmp_3(:,:,:) - !DIR$ ATTRIBUTES ALIGN : 64 :: bielec_tmp_1, bielec_tmp_2, bielec_tmp_3 + integer, allocatable :: two_e_tmp_0_idx(:) + real(integral_kind), allocatable :: two_e_tmp_0(:,:) + double precision, allocatable :: two_e_tmp_1(:) + double precision, allocatable :: two_e_tmp_2(:,:) + double precision, allocatable :: two_e_tmp_3(:,:,:) + !DIR$ ATTRIBUTES ALIGN : 64 :: two_e_tmp_1, two_e_tmp_2, two_e_tmp_3 integer :: n_integrals integer :: size_buffer @@ -276,12 +276,12 @@ subroutine add_integrals_to_map_erf(mask_ijkl) integer :: i2,i3,i4 double precision,parameter :: thr_coef = 1.d-10 - PROVIDE ao_bielec_integrals_in_map mo_coef + PROVIDE ao_two_e_integrals_in_map mo_coef !Get list of MOs for i,j,k and l !------------------------------- - allocate(list_ijkl(mo_tot_num,4)) + allocate(list_ijkl(mo_num,4)) call bitstring_to_list( mask_ijkl(1,1), list_ijkl(1,1), n_i, N_int ) call bitstring_to_list( mask_ijkl(1,2), list_ijkl(1,2), n_j, N_int ) call bitstring_to_list( mask_ijkl(1,3), list_ijkl(1,3), n_k, N_int ) @@ -333,7 +333,7 @@ subroutine add_integrals_to_map_erf(mask_ijkl) size_buffer = min(ao_num*ao_num*ao_num,16000000) print*, 'Providing the ERF molecular integrals ' - print*, 'Buffers : ', 8.*(mo_tot_num*(n_j)*(n_k+1) + mo_tot_num+& + print*, 'Buffers : ', 8.*(mo_num*(n_j)*(n_k+1) + mo_num+& ao_num+ao_num*ao_num+ size_buffer*3)/(1024*1024), 'MB / core' call wall_time(wall_1) @@ -342,22 +342,22 @@ subroutine add_integrals_to_map_erf(mask_ijkl) accu_bis = 0.d0 !$OMP PARALLEL PRIVATE(l1,k1,j1,i1,i2,i3,i4,i,j,k,l,c, ii1,kmax, & - !$OMP bielec_tmp_0_idx, bielec_tmp_0, bielec_tmp_1,bielec_tmp_2,bielec_tmp_3,& + !$OMP two_e_tmp_0_idx, two_e_tmp_0, two_e_tmp_1,two_e_tmp_2,two_e_tmp_3,& !$OMP buffer_i,buffer_value,n_integrals,wall_2,i0,j0,k0,l0, & !$OMP wall_0,thread_num,accu_bis) & !$OMP DEFAULT(NONE) & - !$OMP SHARED(size_buffer,ao_num,mo_tot_num,n_i,n_j,n_k,n_l, & + !$OMP SHARED(size_buffer,ao_num,mo_num,n_i,n_j,n_k,n_l, & !$OMP mo_coef_transp, & !$OMP mo_coef_transp_is_built, list_ijkl, & !$OMP mo_coef_is_built, wall_1, & !$OMP mo_coef,mo_integrals_threshold,mo_integrals_erf_map) n_integrals = 0 wall_0 = wall_1 - allocate(bielec_tmp_3(mo_tot_num, n_j, n_k), & - bielec_tmp_1(mo_tot_num), & - bielec_tmp_0(ao_num,ao_num), & - bielec_tmp_0_idx(ao_num), & - bielec_tmp_2(mo_tot_num, n_j), & + allocate(two_e_tmp_3(mo_num, n_j, n_k), & + two_e_tmp_1(mo_num), & + two_e_tmp_0(ao_num,ao_num), & + two_e_tmp_0_idx(ao_num), & + two_e_tmp_2(mo_num, n_j), & buffer_i(size_buffer), & buffer_value(size_buffer) ) @@ -365,57 +365,57 @@ subroutine add_integrals_to_map_erf(mask_ijkl) !$ thread_num = omp_get_thread_num() !$OMP DO SCHEDULE(guided) do l1 = 1,ao_num - bielec_tmp_3 = 0.d0 + two_e_tmp_3 = 0.d0 do k1 = 1,ao_num - bielec_tmp_2 = 0.d0 + two_e_tmp_2 = 0.d0 do j1 = 1,ao_num - call get_ao_bielec_integrals_erf(j1,k1,l1,ao_num,bielec_tmp_0(1,j1)) ! all integrals for a given l1, k1 - ! call compute_ao_bielec_integrals(j1,k1,l1,ao_num,bielec_tmp_0(1,j1)) + call get_ao_two_e_integrals_erf(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) ! all integrals for a given l1, k1 + ! call compute_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) enddo do j1 = 1,ao_num kmax = 0 do i1 = 1,ao_num - c = bielec_tmp_0(i1,j1) + c = two_e_tmp_0(i1,j1) if (c == 0.d0) then cycle endif kmax += 1 - bielec_tmp_0(kmax,j1) = c - bielec_tmp_0_idx(kmax) = i1 + two_e_tmp_0(kmax,j1) = c + two_e_tmp_0_idx(kmax) = i1 enddo if (kmax==0) then cycle endif - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 ii1=1 ! sum_m c_m^i (m) do ii1 = 1,kmax-4,4 - i1 = bielec_tmp_0_idx(ii1) - i2 = bielec_tmp_0_idx(ii1+1) - i3 = bielec_tmp_0_idx(ii1+2) - i4 = bielec_tmp_0_idx(ii1+3) + i1 = two_e_tmp_0_idx(ii1) + i2 = two_e_tmp_0_idx(ii1+1) + i3 = two_e_tmp_0_idx(ii1+2) + i4 = two_e_tmp_0_idx(ii1+3) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + & - mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + & - mo_coef_transp(i,i2) * bielec_tmp_0(ii1+1,j1) + & - mo_coef_transp(i,i3) * bielec_tmp_0(ii1+2,j1) + & - mo_coef_transp(i,i4) * bielec_tmp_0(ii1+3,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + & + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) + & + mo_coef_transp(i,i2) * two_e_tmp_0(ii1+1,j1) + & + mo_coef_transp(i,i3) * two_e_tmp_0(ii1+2,j1) + & + mo_coef_transp(i,i4) * two_e_tmp_0(ii1+3,j1) enddo ! i enddo ! ii1 i2 = ii1 do ii1 = i2,kmax - i1 = bielec_tmp_0_idx(ii1) + i1 = two_e_tmp_0_idx(ii1) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) enddo ! i enddo ! ii1 c = 0.d0 do i = list_ijkl(1,1), list_ijkl(n_i,1) - c = max(c,abs(bielec_tmp_1(i))) + c = max(c,abs(two_e_tmp_1(i))) if (c>mo_integrals_threshold) exit enddo if ( c < mo_integrals_threshold ) then @@ -429,11 +429,11 @@ subroutine add_integrals_to_map_erf(mask_ijkl) cycle endif do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_2(i,j0) = bielec_tmp_2(i,j0) + c * bielec_tmp_1(i) + two_e_tmp_2(i,j0) = two_e_tmp_2(i,j0) + c * two_e_tmp_1(i) enddo ! i enddo ! j enddo !j1 - if ( maxval(abs(bielec_tmp_2)) < mo_integrals_threshold ) then + if ( maxval(abs(two_e_tmp_2)) < mo_integrals_threshold ) then cycle endif @@ -448,7 +448,7 @@ subroutine add_integrals_to_map_erf(mask_ijkl) do j0 = 1, n_j j = list_ijkl(j0,2) do i = list_ijkl(1,1), k - bielec_tmp_3(i,j0,k0) = bielec_tmp_3(i,j0,k0) + c* bielec_tmp_2(i,j0) + two_e_tmp_3(i,j0,k0) = two_e_tmp_3(i,j0,k0) + c* two_e_tmp_2(i,j0) enddo!i enddo !j @@ -478,13 +478,13 @@ subroutine add_integrals_to_map_erf(mask_ijkl) else exit endif - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 do i0 = 1, n_i i = list_ijkl(i0,1) if (i>k) then exit endif - bielec_tmp_1(i) = c*bielec_tmp_3(i,j0,k0) + two_e_tmp_1(i) = c*two_e_tmp_3(i,j0,k0) ! i1+=1 enddo @@ -493,13 +493,13 @@ subroutine add_integrals_to_map_erf(mask_ijkl) if(i> min(k,j1-i1+list_ijkl(1,1)-1))then exit endif - if (abs(bielec_tmp_1(i)) < mo_integrals_threshold) then + if (abs(two_e_tmp_1(i)) < mo_integrals_threshold) then cycle endif n_integrals += 1 - buffer_value(n_integrals) = bielec_tmp_1(i) + buffer_value(n_integrals) = two_e_tmp_1(i) !DIR$ FORCEINLINE - call mo_bielec_integrals_index(i,j,k,l,buffer_i(n_integrals)) + call mo_two_e_integrals_index(i,j,k,l,buffer_i(n_integrals)) if (n_integrals == size_buffer) then call insert_into_mo_integrals_erf_map(n_integrals,buffer_i,buffer_value,& real(mo_integrals_threshold,integral_kind)) @@ -520,7 +520,7 @@ subroutine add_integrals_to_map_erf(mask_ijkl) endif enddo !$OMP END DO NOWAIT - deallocate (bielec_tmp_1,bielec_tmp_2,bielec_tmp_3) + deallocate (two_e_tmp_1,two_e_tmp_2,two_e_tmp_3) integer :: index_needed diff --git a/src/mo_two_e_erf_integrals/routines_save_integrals_erf.irp.f b/src/mo_two_e_erf_ints/routines_save_integrals_erf.irp.f similarity index 51% rename from src/mo_two_e_erf_integrals/routines_save_integrals_erf.irp.f rename to src/mo_two_e_erf_ints/routines_save_integrals_erf.irp.f index 00845ba8..52fb8f63 100644 --- a/src/mo_two_e_erf_integrals/routines_save_integrals_erf.irp.f +++ b/src/mo_two_e_erf_ints/routines_save_integrals_erf.irp.f @@ -1,19 +1,19 @@ -subroutine save_erf_bi_elec_integrals_mo +subroutine save_erf_two_e_integrals_mo implicit none integer :: i,j,k,l - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints_erf',mo_integrals_erf_map) - call ezfio_set_mo_two_e_erf_integrals_disk_access_mo_integrals_erf('Read') + call ezfio_set_mo_two_e_erf_ints_io_mo_two_e_integrals_erf('Read') end -subroutine save_erf_bielec_ints_mo_into_ints_mo +subroutine save_erf_two_e_ints_mo_into_ints_mo implicit none integer :: i,j,k,l - PROVIDE mo_bielec_integrals_erf_in_map + PROVIDE mo_two_e_integrals_erf_in_map call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints',mo_integrals_erf_map) - call ezfio_set_mo_two_e_integrals_disk_access_mo_integrals('Read') + call ezfio_set_mo_two_e_ints_io_mo_two_e_integrals('Read') end diff --git a/src/mo_two_e_integrals/NEED b/src/mo_two_e_integrals/NEED deleted file mode 100644 index df8ba165..00000000 --- a/src/mo_two_e_integrals/NEED +++ /dev/null @@ -1,7 +0,0 @@ -ao_one_e_integrals -mo_one_e_integrals -ao_two_e_integrals -pseudo -bitmask -zmq -mo_basis diff --git a/src/mo_two_e_integrals/read_write.irp.f b/src/mo_two_e_integrals/read_write.irp.f deleted file mode 100644 index 4a846fa3..00000000 --- a/src/mo_two_e_integrals/read_write.irp.f +++ /dev/null @@ -1,27 +0,0 @@ - BEGIN_PROVIDER [ logical, read_mo_integrals ] -&BEGIN_PROVIDER [ logical, write_mo_integrals ] - - BEGIN_DOC - ! Flag to read or write the |MO| integrals - END_DOC - implicit none - - if (disk_access_mo_integrals.EQ.'Read') then - read_mo_integrals = .True. - write_mo_integrals = .False. - - else if (disk_access_mo_integrals.EQ.'Write') then - read_mo_integrals = .False. - write_mo_integrals = .True. - - else if (disk_access_mo_integrals.EQ.'None') then - read_mo_integrals = .False. - write_mo_integrals = .False. - - else - print *, 'disk_access_mo_integrals has a wrong type' - stop 1 - - endif - -END_PROVIDER diff --git a/src/mo_two_e_integrals/EZFIO.cfg b/src/mo_two_e_ints/EZFIO.cfg similarity index 97% rename from src/mo_two_e_integrals/EZFIO.cfg rename to src/mo_two_e_ints/EZFIO.cfg index bc18c779..57681638 100644 --- a/src/mo_two_e_integrals/EZFIO.cfg +++ b/src/mo_two_e_ints/EZFIO.cfg @@ -1,4 +1,4 @@ -[disk_access_mo_integrals] +[io_mo_two_e_integrals] type: Disk_access doc: Read/Write |MO| integrals from/to disk [ Write | Read | None ] interface: ezfio,provider,ocaml diff --git a/src/mo_two_e_ints/NEED b/src/mo_two_e_ints/NEED new file mode 100644 index 00000000..30b7f6e3 --- /dev/null +++ b/src/mo_two_e_ints/NEED @@ -0,0 +1,7 @@ +ao_one_e_ints +mo_one_e_ints +ao_two_e_ints +pseudo +bitmask +zmq +mo_basis diff --git a/src/mo_two_e_integrals/README.rst b/src/mo_two_e_ints/README.rst similarity index 69% rename from src/mo_two_e_integrals/README.rst rename to src/mo_two_e_ints/README.rst index 2e627dc6..e302dc2e 100644 --- a/src/mo_two_e_integrals/README.rst +++ b/src/mo_two_e_ints/README.rst @@ -1,5 +1,5 @@ ================== -mo_two_e_integrals +mo_two_e_ints ================== Here, all two-electron integrals (:math:`1/r_{12}`) are computed. @@ -7,10 +7,10 @@ As they have 4 indices and many are zero, they are stored in a map, as defined in :file:`Utils/map_module.f90`. To fetch an |AO| integral, use the -`get_ao_bielec_integral(i,j,k,l,ao_integrals_map)` function, and +`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function, and to fetch an |MO| integral, use -`get_mo_bielec_integral(i,j,k,l,mo_integrals_map)` or -`mo_bielec_integral(i,j,k,l)`. +`get_two_e_integral(i,j,k,l,mo_integrals_map)` or +`mo_two_e_integral(i,j,k,l)`. The conventions are: diff --git a/src/mo_two_e_integrals/core_quantities.irp.f b/src/mo_two_e_ints/core_quantities.irp.f similarity index 59% rename from src/mo_two_e_integrals/core_quantities.irp.f rename to src/mo_two_e_ints/core_quantities.irp.f index ba573675..47b4bc82 100644 --- a/src/mo_two_e_integrals/core_quantities.irp.f +++ b/src/mo_two_e_ints/core_quantities.irp.f @@ -7,20 +7,20 @@ BEGIN_PROVIDER [double precision, core_energy] core_energy = 0.d0 do i = 1, n_core_orb j = list_core(i) - core_energy += 2.d0 * mo_mono_elec_integral(j,j) + mo_bielec_integral_jj(j,j) + core_energy += 2.d0 * mo_one_e_integrals(j,j) + mo_two_e_integrals_jj(j,j) do k = i+1, n_core_orb l = list_core(k) - core_energy += 2.d0 * (2.d0 * mo_bielec_integral_jj(j,l) - mo_bielec_integral_jj_exchange(j,l)) + core_energy += 2.d0 * (2.d0 * mo_two_e_integrals_jj(j,l) - mo_two_e_integrals_jj_exchange(j,l)) enddo enddo core_energy += nuclear_repulsion END_PROVIDER -BEGIN_PROVIDER [double precision, core_fock_operator, (mo_tot_num,mo_tot_num)] +BEGIN_PROVIDER [double precision, core_fock_operator, (mo_num,mo_num)] implicit none integer :: i,j,k,l,m,n - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral BEGIN_DOC ! this is the contribution to the Fock operator from the core electrons END_DOC @@ -31,7 +31,7 @@ BEGIN_PROVIDER [double precision, core_fock_operator, (mo_tot_num,mo_tot_num)] l = list_act(k) do m = 1, n_core_orb n = list_core(m) - core_fock_operator(j,l) += 2.d0 * get_mo_bielec_integral(j,n,l,n,mo_integrals_map) - get_mo_bielec_integral(j,n,n,l,mo_integrals_map) + core_fock_operator(j,l) += 2.d0 * get_two_e_integral(j,n,l,n,mo_integrals_map) - get_two_e_integral(j,n,n,l,mo_integrals_map) enddo enddo enddo diff --git a/src/mo_two_e_integrals/integrals_3_index.irp.f b/src/mo_two_e_ints/integrals_3_index.irp.f similarity index 61% rename from src/mo_two_e_integrals/integrals_3_index.irp.f rename to src/mo_two_e_ints/integrals_3_index.irp.f index 9d31a017..bee19178 100644 --- a/src/mo_two_e_integrals/integrals_3_index.irp.f +++ b/src/mo_two_e_ints/integrals_3_index.irp.f @@ -1,5 +1,5 @@ - BEGIN_PROVIDER [double precision, big_array_coulomb_integrals, (mo_tot_num,mo_tot_num, mo_tot_num)] -&BEGIN_PROVIDER [double precision, big_array_exchange_integrals,(mo_tot_num,mo_tot_num, mo_tot_num)] + BEGIN_PROVIDER [double precision, big_array_coulomb_integrals, (mo_num,mo_num, mo_num)] +&BEGIN_PROVIDER [double precision, big_array_exchange_integrals,(mo_num,mo_num, mo_num)] implicit none BEGIN_DOC ! big_array_coulomb_integrals(i,j) = = (ii|jj) @@ -7,17 +7,17 @@ ! big_array_exchange_integrals(i,j) = = (ij|ij) END_DOC integer :: i,j,k,l - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral double precision :: integral - do k = 1, mo_tot_num - do i = 1, mo_tot_num - do j = 1, mo_tot_num + do k = 1, mo_num + do i = 1, mo_num + do j = 1, mo_num l = j - integral = get_mo_bielec_integral(i,j,k,l,mo_integrals_map) + integral = get_two_e_integral(i,j,k,l,mo_integrals_map) big_array_coulomb_integrals(j,i,k) = integral l = j - integral = get_mo_bielec_integral(i,j,l,k,mo_integrals_map) + integral = get_two_e_integral(i,j,l,k,mo_integrals_map) big_array_exchange_integrals(j,i,k) = integral enddo enddo diff --git a/src/mo_two_e_integrals/map_integrals.irp.f b/src/mo_two_e_ints/map_integrals.irp.f similarity index 87% rename from src/mo_two_e_integrals/map_integrals.irp.f rename to src/mo_two_e_ints/map_integrals.irp.f index bb5b2a85..99d50167 100644 --- a/src/mo_two_e_integrals/map_integrals.irp.f +++ b/src/mo_two_e_ints/map_integrals.irp.f @@ -10,7 +10,7 @@ BEGIN_PROVIDER [ type(map_type), mo_integrals_map ] END_DOC integer(key_kind) :: key_max integer(map_size_kind) :: sze - call bielec_integrals_index(mo_tot_num,mo_tot_num,mo_tot_num,mo_tot_num,key_max) + call two_e_integrals_index(mo_num,mo_num,mo_num,mo_num,key_max) sze = key_max call map_init(mo_integrals_map,sze) print*, 'MO map initialized: ', sze @@ -41,9 +41,9 @@ end ! Min and max values of the MOs for which the integrals are in the cache END_DOC mo_integrals_cache_min_8 = max(1_8,elec_alpha_num - 63_8) - mo_integrals_cache_max_8 = min(int(mo_tot_num,8),mo_integrals_cache_min_8+127_8) + mo_integrals_cache_max_8 = min(int(mo_num,8),mo_integrals_cache_min_8+127_8) mo_integrals_cache_min = max(1,elec_alpha_num - 63) - mo_integrals_cache_max = min(mo_tot_num,mo_integrals_cache_min+127) + mo_integrals_cache_max = min(mo_num,mo_integrals_cache_min+127) END_PROVIDER @@ -52,7 +52,7 @@ BEGIN_PROVIDER [ double precision, mo_integrals_cache, (0_8:128_8*128_8*128_8*12 BEGIN_DOC ! Cache of MO integrals for fast access END_DOC - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map integer*8 :: i,j,k,l integer*4 :: i4,j4,k4,l4 integer*8 :: ii @@ -69,7 +69,7 @@ BEGIN_PROVIDER [ double precision, mo_integrals_cache, (0_8:128_8*128_8*128_8*12 do i=mo_integrals_cache_min_8,mo_integrals_cache_max_8 i4 = int(i,4) !DIR$ FORCEINLINE - call bielec_integrals_index(i4,j4,k4,l4,idx) + call two_e_integrals_index(i4,j4,k4,l4,idx) !DIR$ FORCEINLINE call map_get(mo_integrals_map,idx,integral) ii = l-mo_integrals_cache_min_8 @@ -86,7 +86,7 @@ BEGIN_PROVIDER [ double precision, mo_integrals_cache, (0_8:128_8*128_8*128_8*12 END_PROVIDER -double precision function get_mo_bielec_integral(i,j,k,l,map) +double precision function get_two_e_integral(i,j,k,l,map) use map_module implicit none BEGIN_DOC @@ -98,42 +98,42 @@ double precision function get_mo_bielec_integral(i,j,k,l,map) integer*8 :: ii_8 type(map_type), intent(inout) :: map real(integral_kind) :: tmp - PROVIDE mo_bielec_integrals_in_map mo_integrals_cache + PROVIDE mo_two_e_integrals_in_map mo_integrals_cache ii = l-mo_integrals_cache_min ii = ior(ii, k-mo_integrals_cache_min) ii = ior(ii, j-mo_integrals_cache_min) ii = ior(ii, i-mo_integrals_cache_min) if (iand(ii, -128) /= 0) then !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,idx) + call two_e_integrals_index(i,j,k,l,idx) !DIR$ FORCEINLINE call map_get(map,idx,tmp) - get_mo_bielec_integral = dble(tmp) + get_two_e_integral = dble(tmp) else ii_8 = int(l,8)-mo_integrals_cache_min_8 ii_8 = ior( shiftl(ii_8,7), int(k,8)-mo_integrals_cache_min_8) ii_8 = ior( shiftl(ii_8,7), int(j,8)-mo_integrals_cache_min_8) ii_8 = ior( shiftl(ii_8,7), int(i,8)-mo_integrals_cache_min_8) - get_mo_bielec_integral = mo_integrals_cache(ii_8) + get_two_e_integral = mo_integrals_cache(ii_8) endif end -double precision function mo_bielec_integral(i,j,k,l) +double precision function mo_two_e_integral(i,j,k,l) implicit none BEGIN_DOC ! Returns one integral in the MO basis END_DOC integer, intent(in) :: i,j,k,l - double precision :: get_mo_bielec_integral - PROVIDE mo_bielec_integrals_in_map mo_integrals_cache - PROVIDE mo_bielec_integrals_in_map + double precision :: get_two_e_integral + PROVIDE mo_two_e_integrals_in_map mo_integrals_cache + PROVIDE mo_two_e_integrals_in_map !DIR$ FORCEINLINE - mo_bielec_integral = get_mo_bielec_integral(i,j,k,l,mo_integrals_map) + mo_two_e_integral = get_two_e_integral(i,j,k,l,mo_integrals_map) return end -subroutine get_mo_bielec_integrals(j,k,l,sze,out_val,map) +subroutine get_mo_two_e_integrals(j,k,l,sze,out_val,map) use map_module implicit none BEGIN_DOC @@ -144,15 +144,15 @@ subroutine get_mo_bielec_integrals(j,k,l,sze,out_val,map) double precision, intent(out) :: out_val(sze) type(map_type), intent(inout) :: map integer :: i - double precision, external :: get_mo_bielec_integral - PROVIDE mo_bielec_integrals_in_map mo_integrals_cache + double precision, external :: get_two_e_integral + PROVIDE mo_two_e_integrals_in_map mo_integrals_cache integer :: ii, ii0 integer*8 :: ii_8, ii0_8 real(integral_kind) :: tmp integer(key_kind) :: i1, idx integer(key_kind) :: p,q,r,s,i2 - PROVIDE mo_bielec_integrals_in_map mo_integrals_cache + PROVIDE mo_two_e_integrals_in_map mo_integrals_cache ii0 = l-mo_integrals_cache_min ii0 = ior(ii0, k-mo_integrals_cache_min) @@ -185,7 +185,7 @@ subroutine get_mo_bielec_integrals(j,k,l,sze,out_val,map) enddo end -subroutine get_mo_bielec_integrals_ij(k,l,sze,out_array,map) +subroutine get_mo_two_e_integrals_ij(k,l,sze,out_array,map) use map_module implicit none BEGIN_DOC @@ -201,7 +201,7 @@ subroutine get_mo_bielec_integrals_ij(k,l,sze,out_array,map) integer ,allocatable :: pairs(:,:), iorder(:) real(integral_kind), allocatable :: tmp_val(:) - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map allocate (hash(sze*sze), pairs(2,sze*sze),iorder(sze*sze), & tmp_val(sze*sze)) @@ -211,7 +211,7 @@ subroutine get_mo_bielec_integrals_ij(k,l,sze,out_array,map) do i=1,sze kk += 1 !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,hash(kk)) + call two_e_integrals_index(i,j,k,l,hash(kk)) pairs(1,kk) = i pairs(2,kk) = j iorder(kk) = kk @@ -239,7 +239,7 @@ subroutine get_mo_bielec_integrals_ij(k,l,sze,out_array,map) deallocate(pairs,hash,iorder,tmp_val) end -subroutine get_mo_bielec_integrals_i1j1(k,l,sze,out_array,map) +subroutine get_mo_two_e_integrals_i1j1(k,l,sze,out_array,map) use map_module implicit none BEGIN_DOC @@ -255,7 +255,7 @@ subroutine get_mo_bielec_integrals_i1j1(k,l,sze,out_array,map) integer ,allocatable :: pairs(:,:), iorder(:) real(integral_kind), allocatable :: tmp_val(:) - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map allocate (hash(sze*sze), pairs(2,sze*sze),iorder(sze*sze), & tmp_val(sze*sze)) @@ -265,7 +265,7 @@ subroutine get_mo_bielec_integrals_i1j1(k,l,sze,out_array,map) do i=1,sze kk += 1 !DIR$ FORCEINLINE - call bielec_integrals_index(i,k,j,l,hash(kk)) + call two_e_integrals_index(i,k,j,l,hash(kk)) pairs(1,kk) = i pairs(2,kk) = j iorder(kk) = kk @@ -294,7 +294,7 @@ subroutine get_mo_bielec_integrals_i1j1(k,l,sze,out_array,map) end -subroutine get_mo_bielec_integrals_coulomb_ii(k,l,sze,out_val,map) +subroutine get_mo_two_e_integrals_coulomb_ii(k,l,sze,out_val,map) use map_module implicit none BEGIN_DOC @@ -308,12 +308,12 @@ subroutine get_mo_bielec_integrals_coulomb_ii(k,l,sze,out_val,map) integer :: i integer(key_kind) :: hash(sze) real(integral_kind) :: tmp_val(sze) - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map integer :: kk do i=1,sze !DIR$ FORCEINLINE - call bielec_integrals_index(k,i,l,i,hash(i)) + call two_e_integrals_index(k,i,l,i,hash(i)) enddo if (integral_kind == 8) then @@ -327,7 +327,7 @@ subroutine get_mo_bielec_integrals_coulomb_ii(k,l,sze,out_val,map) endif end -subroutine get_mo_bielec_integrals_exch_ii(k,l,sze,out_val,map) +subroutine get_mo_two_e_integrals_exch_ii(k,l,sze,out_val,map) use map_module implicit none BEGIN_DOC @@ -341,12 +341,12 @@ subroutine get_mo_bielec_integrals_exch_ii(k,l,sze,out_val,map) integer :: i integer(key_kind) :: hash(sze) real(integral_kind) :: tmp_val(sze) - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map integer :: kk do i=1,sze !DIR$ FORCEINLINE - call bielec_integrals_index(k,i,i,l,hash(i)) + call two_e_integrals_index(k,i,i,l,hash(i)) enddo if (integral_kind == 8) then diff --git a/src/mo_two_e_integrals/mo_bi_integrals.irp.f b/src/mo_two_e_ints/mo_bi_integrals.irp.f similarity index 71% rename from src/mo_two_e_integrals/mo_bi_integrals.irp.f rename to src/mo_two_e_ints/mo_bi_integrals.irp.f index d0fba0ce..1cf6674d 100644 --- a/src/mo_two_e_integrals/mo_bi_integrals.irp.f +++ b/src/mo_two_e_ints/mo_bi_integrals.irp.f @@ -1,4 +1,4 @@ -subroutine mo_bielec_integrals_index(i,j,k,l,i1) +subroutine mo_two_e_integrals_index(i,j,k,l,i1) use map_module implicit none BEGIN_DOC @@ -19,14 +19,14 @@ subroutine mo_bielec_integrals_index(i,j,k,l,i1) end -BEGIN_PROVIDER [ logical, mo_bielec_integrals_in_map ] +BEGIN_PROVIDER [ logical, mo_two_e_integrals_in_map ] use map_module implicit none integer(bit_kind) :: mask_ijkl(N_int,4) integer(bit_kind) :: mask_ijk(N_int,3) BEGIN_DOC - ! If True, the map of MO bielectronic integrals is provided + ! If True, the map of MO two-electron integrals is provided END_DOC ! The following line avoids a subsequent crash when the memory used is more @@ -34,14 +34,14 @@ BEGIN_PROVIDER [ logical, mo_bielec_integrals_in_map ] ! with EZFIO PROVIDE mo_class - mo_bielec_integrals_in_map = .True. - if (read_mo_integrals) then + mo_two_e_integrals_in_map = .True. + if (read_mo_two_e_integrals) then print*,'Reading the MO integrals' call map_load_from_disk(trim(ezfio_filename)//'/work/mo_ints',mo_integrals_map) print*, 'MO integrals provided' return else - PROVIDE ao_bielec_integrals_in_map + PROVIDE ao_two_e_integrals_in_map endif print *, '' @@ -142,17 +142,17 @@ BEGIN_PROVIDER [ logical, mo_bielec_integrals_in_map ] ! call four_index_transform(ao_integrals_map,mo_integrals_map, & ! mo_coef, size(mo_coef,1), & ! 1, 1, 1, 1, ao_num, ao_num, ao_num, ao_num, & -! 1, 1, 1, 1, mo_tot_num, mo_tot_num, mo_tot_num, mo_tot_num) +! 1, 1, 1, 1, mo_num, mo_num, mo_num, mo_num) integer*8 :: get_mo_map_size, mo_map_size mo_map_size = get_mo_map_size() print*,'Molecular integrals provided' endif - if (write_mo_integrals.and.mpi_master) then + if (write_mo_two_e_integrals.and.mpi_master) then call ezfio_set_work_empty(.False.) call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints',mo_integrals_map) - call ezfio_set_mo_two_e_integrals_disk_access_mo_integrals('Read') + call ezfio_set_mo_two_e_ints_io_mo_two_e_integrals('Read') endif END_PROVIDER @@ -174,12 +174,12 @@ subroutine add_integrals_to_map(mask_ijkl) integer, allocatable :: list_ijkl(:,:) integer :: n_i, n_j, n_k, n_l - integer, allocatable :: bielec_tmp_0_idx(:) - real(integral_kind), allocatable :: bielec_tmp_0(:,:) - double precision, allocatable :: bielec_tmp_1(:) - double precision, allocatable :: bielec_tmp_2(:,:) - double precision, allocatable :: bielec_tmp_3(:,:,:) - !DIR$ ATTRIBUTES ALIGN : 64 :: bielec_tmp_1, bielec_tmp_2, bielec_tmp_3 + integer, allocatable :: two_e_tmp_0_idx(:) + real(integral_kind), allocatable :: two_e_tmp_0(:,:) + double precision, allocatable :: two_e_tmp_1(:) + double precision, allocatable :: two_e_tmp_2(:,:) + double precision, allocatable :: two_e_tmp_3(:,:,:) + !DIR$ ATTRIBUTES ALIGN : 64 :: two_e_tmp_1, two_e_tmp_2, two_e_tmp_3 integer :: n_integrals integer :: size_buffer @@ -191,12 +191,12 @@ subroutine add_integrals_to_map(mask_ijkl) integer :: i2,i3,i4 double precision,parameter :: thr_coef = 1.d-10 - PROVIDE ao_bielec_integrals_in_map mo_coef + PROVIDE ao_two_e_integrals_in_map mo_coef !Get list of MOs for i,j,k and l !------------------------------- - allocate(list_ijkl(mo_tot_num,4)) + allocate(list_ijkl(mo_num,4)) call bitstring_to_list( mask_ijkl(1,1), list_ijkl(1,1), n_i, N_int ) call bitstring_to_list( mask_ijkl(1,2), list_ijkl(1,2), n_j, N_int ) call bitstring_to_list( mask_ijkl(1,3), list_ijkl(1,3), n_k, N_int ) @@ -248,7 +248,7 @@ subroutine add_integrals_to_map(mask_ijkl) size_buffer = min(ao_num*ao_num*ao_num,16000000) print*, 'Providing the molecular integrals ' - print*, 'Buffers : ', 8.*(mo_tot_num*(n_j)*(n_k+1) + mo_tot_num+& + print*, 'Buffers : ', 8.*(mo_num*(n_j)*(n_k+1) + mo_num+& ao_num+ao_num*ao_num+ size_buffer*3)/(1024*1024), 'MB / core' call wall_time(wall_1) @@ -257,22 +257,22 @@ subroutine add_integrals_to_map(mask_ijkl) accu_bis = 0.d0 !$OMP PARALLEL PRIVATE(l1,k1,j1,i1,i2,i3,i4,i,j,k,l,c, ii1,kmax, & - !$OMP bielec_tmp_0_idx, bielec_tmp_0, bielec_tmp_1,bielec_tmp_2,bielec_tmp_3,& + !$OMP two_e_tmp_0_idx, two_e_tmp_0, two_e_tmp_1,two_e_tmp_2,two_e_tmp_3,& !$OMP buffer_i,buffer_value,n_integrals,wall_2,i0,j0,k0,l0, & !$OMP wall_0,thread_num,accu_bis) & !$OMP DEFAULT(NONE) & - !$OMP SHARED(size_buffer,ao_num,mo_tot_num,n_i,n_j,n_k,n_l, & + !$OMP SHARED(size_buffer,ao_num,mo_num,n_i,n_j,n_k,n_l, & !$OMP mo_coef_transp, & !$OMP mo_coef_transp_is_built, list_ijkl, & !$OMP mo_coef_is_built, wall_1, & !$OMP mo_coef,mo_integrals_threshold,mo_integrals_map) n_integrals = 0 wall_0 = wall_1 - allocate(bielec_tmp_3(mo_tot_num, n_j, n_k), & - bielec_tmp_1(mo_tot_num), & - bielec_tmp_0(ao_num,ao_num), & - bielec_tmp_0_idx(ao_num), & - bielec_tmp_2(mo_tot_num, n_j), & + allocate(two_e_tmp_3(mo_num, n_j, n_k), & + two_e_tmp_1(mo_num), & + two_e_tmp_0(ao_num,ao_num), & + two_e_tmp_0_idx(ao_num), & + two_e_tmp_2(mo_num, n_j), & buffer_i(size_buffer), & buffer_value(size_buffer) ) @@ -280,56 +280,56 @@ subroutine add_integrals_to_map(mask_ijkl) !$ thread_num = omp_get_thread_num() !$OMP DO SCHEDULE(guided) do l1 = 1,ao_num - bielec_tmp_3 = 0.d0 + two_e_tmp_3 = 0.d0 do k1 = 1,ao_num - bielec_tmp_2 = 0.d0 + two_e_tmp_2 = 0.d0 do j1 = 1,ao_num - call get_ao_bielec_integrals(j1,k1,l1,ao_num,bielec_tmp_0(1,j1)) - ! call compute_ao_bielec_integrals(j1,k1,l1,ao_num,bielec_tmp_0(1,j1)) + call get_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) + ! call compute_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) enddo do j1 = 1,ao_num kmax = 0 do i1 = 1,ao_num - c = bielec_tmp_0(i1,j1) + c = two_e_tmp_0(i1,j1) if (c == 0.d0) then cycle endif kmax += 1 - bielec_tmp_0(kmax,j1) = c - bielec_tmp_0_idx(kmax) = i1 + two_e_tmp_0(kmax,j1) = c + two_e_tmp_0_idx(kmax) = i1 enddo if (kmax==0) then cycle endif - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 ii1=1 do ii1 = 1,kmax-4,4 - i1 = bielec_tmp_0_idx(ii1) - i2 = bielec_tmp_0_idx(ii1+1) - i3 = bielec_tmp_0_idx(ii1+2) - i4 = bielec_tmp_0_idx(ii1+3) + i1 = two_e_tmp_0_idx(ii1) + i2 = two_e_tmp_0_idx(ii1+1) + i3 = two_e_tmp_0_idx(ii1+2) + i4 = two_e_tmp_0_idx(ii1+3) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + & - mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + & - mo_coef_transp(i,i2) * bielec_tmp_0(ii1+1,j1) + & - mo_coef_transp(i,i3) * bielec_tmp_0(ii1+2,j1) + & - mo_coef_transp(i,i4) * bielec_tmp_0(ii1+3,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + & + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) + & + mo_coef_transp(i,i2) * two_e_tmp_0(ii1+1,j1) + & + mo_coef_transp(i,i3) * two_e_tmp_0(ii1+2,j1) + & + mo_coef_transp(i,i4) * two_e_tmp_0(ii1+3,j1) enddo ! i enddo ! ii1 i2 = ii1 do ii1 = i2,kmax - i1 = bielec_tmp_0_idx(ii1) + i1 = two_e_tmp_0_idx(ii1) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) enddo ! i enddo ! ii1 c = 0.d0 do i = list_ijkl(1,1), list_ijkl(n_i,1) - c = max(c,abs(bielec_tmp_1(i))) + c = max(c,abs(two_e_tmp_1(i))) if (c>mo_integrals_threshold) exit enddo if ( c < mo_integrals_threshold ) then @@ -343,11 +343,11 @@ subroutine add_integrals_to_map(mask_ijkl) cycle endif do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_2(i,j0) = bielec_tmp_2(i,j0) + c * bielec_tmp_1(i) + two_e_tmp_2(i,j0) = two_e_tmp_2(i,j0) + c * two_e_tmp_1(i) enddo ! i enddo ! j enddo !j1 - if ( maxval(abs(bielec_tmp_2)) < mo_integrals_threshold ) then + if ( maxval(abs(two_e_tmp_2)) < mo_integrals_threshold ) then cycle endif @@ -362,7 +362,7 @@ subroutine add_integrals_to_map(mask_ijkl) do j0 = 1, n_j j = list_ijkl(j0,2) do i = list_ijkl(1,1), k - bielec_tmp_3(i,j0,k0) = bielec_tmp_3(i,j0,k0) + c* bielec_tmp_2(i,j0) + two_e_tmp_3(i,j0,k0) = two_e_tmp_3(i,j0,k0) + c* two_e_tmp_2(i,j0) enddo!i enddo !j @@ -392,13 +392,13 @@ subroutine add_integrals_to_map(mask_ijkl) else exit endif - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 do i0 = 1, n_i i = list_ijkl(i0,1) if (i>k) then exit endif - bielec_tmp_1(i) = c*bielec_tmp_3(i,j0,k0) + two_e_tmp_1(i) = c*two_e_tmp_3(i,j0,k0) ! i1+=1 enddo @@ -407,13 +407,13 @@ subroutine add_integrals_to_map(mask_ijkl) if(i> min(k,j1-i1+list_ijkl(1,1)-1))then exit endif - if (abs(bielec_tmp_1(i)) < mo_integrals_threshold) then + if (abs(two_e_tmp_1(i)) < mo_integrals_threshold) then cycle endif n_integrals += 1 - buffer_value(n_integrals) = bielec_tmp_1(i) + buffer_value(n_integrals) = two_e_tmp_1(i) !DIR$ FORCEINLINE - call mo_bielec_integrals_index(i,j,k,l,buffer_i(n_integrals)) + call mo_two_e_integrals_index(i,j,k,l,buffer_i(n_integrals)) if (n_integrals == size_buffer) then call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_value,& real(mo_integrals_threshold,integral_kind)) @@ -434,7 +434,7 @@ subroutine add_integrals_to_map(mask_ijkl) endif enddo !$OMP END DO NOWAIT - deallocate (bielec_tmp_1,bielec_tmp_2,bielec_tmp_3) + deallocate (two_e_tmp_1,two_e_tmp_2,two_e_tmp_3) integer :: index_needed @@ -478,12 +478,12 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) integer, allocatable :: list_ijkl(:,:) integer :: n_i, n_j, n_k integer :: m - integer, allocatable :: bielec_tmp_0_idx(:) - real(integral_kind), allocatable :: bielec_tmp_0(:,:) - double precision, allocatable :: bielec_tmp_1(:) - double precision, allocatable :: bielec_tmp_2(:,:) - double precision, allocatable :: bielec_tmp_3(:,:,:) - !DIR$ ATTRIBUTES ALIGN : 64 :: bielec_tmp_1, bielec_tmp_2, bielec_tmp_3 + integer, allocatable :: two_e_tmp_0_idx(:) + real(integral_kind), allocatable :: two_e_tmp_0(:,:) + double precision, allocatable :: two_e_tmp_1(:) + double precision, allocatable :: two_e_tmp_2(:,:) + double precision, allocatable :: two_e_tmp_3(:,:,:) + !DIR$ ATTRIBUTES ALIGN : 64 :: two_e_tmp_1, two_e_tmp_2, two_e_tmp_3 integer :: n_integrals integer :: size_buffer @@ -495,12 +495,12 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) integer :: i2,i3,i4 double precision,parameter :: thr_coef = 1.d-10 - PROVIDE ao_bielec_integrals_in_map mo_coef + PROVIDE ao_two_e_integrals_in_map mo_coef !Get list of MOs for i,j,k and l !------------------------------- - allocate(list_ijkl(mo_tot_num,4)) + allocate(list_ijkl(mo_num,4)) call bitstring_to_list( mask_ijk(1,1), list_ijkl(1,1), n_i, N_int ) call bitstring_to_list( mask_ijk(1,2), list_ijkl(1,2), n_j, N_int ) call bitstring_to_list( mask_ijk(1,3), list_ijkl(1,3), n_k, N_int ) @@ -540,7 +540,7 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) size_buffer = min(ao_num*ao_num*ao_num,16000000) print*, 'Providing the molecular integrals ' - print*, 'Buffers : ', 8.*(mo_tot_num*(n_j)*(n_k+1) + mo_tot_num+& + print*, 'Buffers : ', 8.*(mo_num*(n_j)*(n_k+1) + mo_num+& ao_num+ao_num*ao_num+ size_buffer*3)/(1024*1024), 'MB / core' call wall_time(wall_1) @@ -548,78 +548,78 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) double precision :: accu_bis accu_bis = 0.d0 !$OMP PARALLEL PRIVATE(m,l1,k1,j1,i1,i2,i3,i4,i,j,k,l,c, ii1,kmax, & - !$OMP bielec_tmp_0_idx, bielec_tmp_0, bielec_tmp_1,bielec_tmp_2,bielec_tmp_3,& + !$OMP two_e_tmp_0_idx, two_e_tmp_0, two_e_tmp_1,two_e_tmp_2,two_e_tmp_3,& !$OMP buffer_i,buffer_value,n_integrals,wall_2,i0,j0,k0,l0, & !$OMP wall_0,thread_num,accu_bis) & !$OMP DEFAULT(NONE) & - !$OMP SHARED(size_buffer,ao_num,mo_tot_num,n_i,n_j,n_k, & + !$OMP SHARED(size_buffer,ao_num,mo_num,n_i,n_j,n_k, & !$OMP mo_coef_transp, & !$OMP mo_coef_transp_is_built, list_ijkl, & !$OMP mo_coef_is_built, wall_1, & !$OMP mo_coef,mo_integrals_threshold,mo_integrals_map) n_integrals = 0 wall_0 = wall_1 - allocate(bielec_tmp_3(mo_tot_num, n_j, n_k), & - bielec_tmp_1(mo_tot_num), & - bielec_tmp_0(ao_num,ao_num), & - bielec_tmp_0_idx(ao_num), & - bielec_tmp_2(mo_tot_num, n_j), & - buffer_i(size_buffer), & + allocate(two_e_tmp_3(mo_num, n_j, n_k), & + two_e_tmp_1(mo_num), & + two_e_tmp_0(ao_num,ao_num), & + two_e_tmp_0_idx(ao_num), & + two_e_tmp_2(mo_num, n_j), & + buffer_i(size_buffer), & buffer_value(size_buffer) ) thread_num = 0 !$ thread_num = omp_get_thread_num() !$OMP DO SCHEDULE(guided) do l1 = 1,ao_num - bielec_tmp_3 = 0.d0 + two_e_tmp_3 = 0.d0 do k1 = 1,ao_num - bielec_tmp_2 = 0.d0 + two_e_tmp_2 = 0.d0 do j1 = 1,ao_num - call get_ao_bielec_integrals(j1,k1,l1,ao_num,bielec_tmp_0(1,j1)) + call get_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) enddo do j1 = 1,ao_num kmax = 0 do i1 = 1,ao_num - c = bielec_tmp_0(i1,j1) + c = two_e_tmp_0(i1,j1) if (c == 0.d0) then cycle endif kmax += 1 - bielec_tmp_0(kmax,j1) = c - bielec_tmp_0_idx(kmax) = i1 + two_e_tmp_0(kmax,j1) = c + two_e_tmp_0_idx(kmax) = i1 enddo if (kmax==0) then cycle endif - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 ii1=1 do ii1 = 1,kmax-4,4 - i1 = bielec_tmp_0_idx(ii1) - i2 = bielec_tmp_0_idx(ii1+1) - i3 = bielec_tmp_0_idx(ii1+2) - i4 = bielec_tmp_0_idx(ii1+3) + i1 = two_e_tmp_0_idx(ii1) + i2 = two_e_tmp_0_idx(ii1+1) + i3 = two_e_tmp_0_idx(ii1+2) + i4 = two_e_tmp_0_idx(ii1+3) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + & - mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + & - mo_coef_transp(i,i2) * bielec_tmp_0(ii1+1,j1) + & - mo_coef_transp(i,i3) * bielec_tmp_0(ii1+2,j1) + & - mo_coef_transp(i,i4) * bielec_tmp_0(ii1+3,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + & + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) + & + mo_coef_transp(i,i2) * two_e_tmp_0(ii1+1,j1) + & + mo_coef_transp(i,i3) * two_e_tmp_0(ii1+2,j1) + & + mo_coef_transp(i,i4) * two_e_tmp_0(ii1+3,j1) enddo ! i enddo ! ii1 i2 = ii1 do ii1 = i2,kmax - i1 = bielec_tmp_0_idx(ii1) + i1 = two_e_tmp_0_idx(ii1) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) enddo ! i enddo ! ii1 c = 0.d0 do i = list_ijkl(1,1), list_ijkl(n_i,1) - c = max(c,abs(bielec_tmp_1(i))) + c = max(c,abs(two_e_tmp_1(i))) if (c>mo_integrals_threshold) exit enddo if ( c < mo_integrals_threshold ) then @@ -633,11 +633,11 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) cycle endif do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_2(i,j0) = bielec_tmp_2(i,j0) + c * bielec_tmp_1(i) + two_e_tmp_2(i,j0) = two_e_tmp_2(i,j0) + c * two_e_tmp_1(i) enddo ! i enddo ! j enddo !j1 - if ( maxval(abs(bielec_tmp_2)) < mo_integrals_threshold ) then + if ( maxval(abs(two_e_tmp_2)) < mo_integrals_threshold ) then cycle endif @@ -652,7 +652,7 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) do j0 = 1, n_j j = list_ijkl(j0,2) do i = list_ijkl(1,1), k - bielec_tmp_3(i,j0,k0) = bielec_tmp_3(i,j0,k0) + c* bielec_tmp_2(i,j0) + two_e_tmp_3(i,j0,k0) = two_e_tmp_3(i,j0,k0) + c* two_e_tmp_2(i,j0) enddo!i enddo !j @@ -670,7 +670,7 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) do k0 = 1, n_k k = list_ijkl(k0,3) i1 = shiftr((k*k-k),1) - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 j0 = l0 j = list_ijkl(j0,2) do i0 = 1, n_i @@ -678,7 +678,7 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) if (i>k) then exit endif - bielec_tmp_1(i) = c*bielec_tmp_3(i,j0,k0) + two_e_tmp_1(i) = c*two_e_tmp_3(i,j0,k0) enddo do i0 = 1, n_i @@ -686,16 +686,16 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) if (i>k) then !min(k,j1-i1) exit endif - if (abs(bielec_tmp_1(i)) < mo_integrals_threshold) then + if (abs(two_e_tmp_1(i)) < mo_integrals_threshold) then cycle endif n_integrals += 1 - buffer_value(n_integrals) = bielec_tmp_1(i) + buffer_value(n_integrals) = two_e_tmp_1(i) if(i==k .and. j==l .and. i.ne.j)then buffer_value(n_integrals) = buffer_value(n_integrals) *0.5d0 endif !DIR$ FORCEINLINE - call mo_bielec_integrals_index(i,j,k,l,buffer_i(n_integrals)) + call mo_two_e_integrals_index(i,j,k,l,buffer_i(n_integrals)) if (n_integrals == size_buffer) then call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_value,& real(mo_integrals_threshold,integral_kind)) @@ -714,7 +714,7 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) do k0 = 1, n_k k = list_ijkl(k0,3) i1 = shiftr((k*k-k),1) - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 j0 = k0 j = list_ijkl(k0,2) i0 = l0 @@ -722,12 +722,12 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) if (k==l) then cycle endif - bielec_tmp_1(i) = c*bielec_tmp_3(i,j0,k0) + two_e_tmp_1(i) = c*two_e_tmp_3(i,j0,k0) n_integrals += 1 - buffer_value(n_integrals) = bielec_tmp_1(i) + buffer_value(n_integrals) = two_e_tmp_1(i) !DIR$ FORCEINLINE - call mo_bielec_integrals_index(i,j,k,l,buffer_i(n_integrals)) + call mo_two_e_integrals_index(i,j,k,l,buffer_i(n_integrals)) if (n_integrals == size_buffer) then call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_value,& real(mo_integrals_threshold,integral_kind)) @@ -746,7 +746,7 @@ subroutine add_integrals_to_map_three_indices(mask_ijk) endif enddo !$OMP END DO NOWAIT - deallocate (bielec_tmp_1,bielec_tmp_2,bielec_tmp_3) + deallocate (two_e_tmp_1,two_e_tmp_2,two_e_tmp_3) integer :: index_needed @@ -789,12 +789,12 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) integer, allocatable :: list_ijkl(:,:) integer :: n_i, n_j, n_k, n_l - integer, allocatable :: bielec_tmp_0_idx(:) - real(integral_kind), allocatable :: bielec_tmp_0(:,:) - double precision, allocatable :: bielec_tmp_1(:) - double precision, allocatable :: bielec_tmp_2(:,:) - double precision, allocatable :: bielec_tmp_3(:,:,:) - !DIR$ ATTRIBUTES ALIGN : 64 :: bielec_tmp_1, bielec_tmp_2, bielec_tmp_3 + integer, allocatable :: two_e_tmp_0_idx(:) + real(integral_kind), allocatable :: two_e_tmp_0(:,:) + double precision, allocatable :: two_e_tmp_1(:) + double precision, allocatable :: two_e_tmp_2(:,:) + double precision, allocatable :: two_e_tmp_3(:,:,:) + !DIR$ ATTRIBUTES ALIGN : 64 :: two_e_tmp_1, two_e_tmp_2, two_e_tmp_3 integer :: n_integrals integer :: size_buffer @@ -806,12 +806,12 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) integer :: i2,i3,i4 double precision,parameter :: thr_coef = 1.d-10 - PROVIDE ao_bielec_integrals_in_map mo_coef + PROVIDE ao_two_e_integrals_in_map mo_coef !Get list of MOs for i,j,k and l !------------------------------- - allocate(list_ijkl(mo_tot_num,4)) + allocate(list_ijkl(mo_num,4)) call bitstring_to_list( mask_ijkl(1,1), list_ijkl(1,1), n_i, N_int ) call bitstring_to_list( mask_ijkl(1,2), list_ijkl(1,2), n_j, N_int ) call bitstring_to_list( mask_ijkl(1,3), list_ijkl(1,3), n_k, N_int ) @@ -819,29 +819,29 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) size_buffer = min(ao_num*ao_num*ao_num,16000000) print*, 'Providing the molecular integrals ' - print*, 'Buffers : ', 8.*(mo_tot_num*(n_j)*(n_k+1) + mo_tot_num+& + print*, 'Buffers : ', 8.*(mo_num*(n_j)*(n_k+1) + mo_num+& ao_num+ao_num*ao_num+ size_buffer*3)/(1024*1024), 'MB / core' call wall_time(wall_1) call cpu_time(cpu_1) !$OMP PARALLEL PRIVATE(l1,k1,j1,i1,i2,i3,i4,i,j,k,l,c, ii1,kmax, & - !$OMP bielec_tmp_0_idx, bielec_tmp_0, bielec_tmp_1,bielec_tmp_2,bielec_tmp_3,& + !$OMP two_e_tmp_0_idx, two_e_tmp_0, two_e_tmp_1,two_e_tmp_2,two_e_tmp_3,& !$OMP buffer_i,buffer_value,n_integrals,wall_2,i0,j0,k0,l0, & !$OMP wall_0,thread_num) & !$OMP DEFAULT(NONE) & - !$OMP SHARED(size_buffer,ao_num,mo_tot_num,n_i,n_j,n_k,n_l, & + !$OMP SHARED(size_buffer,ao_num,mo_num,n_i,n_j,n_k,n_l, & !$OMP mo_coef_transp, & !$OMP mo_coef_transp_is_built, list_ijkl, & !$OMP mo_coef_is_built, wall_1, & !$OMP mo_coef,mo_integrals_threshold,mo_integrals_map) n_integrals = 0 wall_0 = wall_1 - allocate(bielec_tmp_3(mo_tot_num, n_j, n_k), & - bielec_tmp_1(mo_tot_num), & - bielec_tmp_0(ao_num,ao_num), & - bielec_tmp_0_idx(ao_num), & - bielec_tmp_2(mo_tot_num, n_j), & + allocate(two_e_tmp_3(mo_num, n_j, n_k), & + two_e_tmp_1(mo_num), & + two_e_tmp_0(ao_num,ao_num), & + two_e_tmp_0_idx(ao_num), & + two_e_tmp_2(mo_num, n_j), & buffer_i(size_buffer), & buffer_value(size_buffer) ) @@ -854,56 +854,56 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) ! cycle ! endif !IRP_ENDIF - bielec_tmp_3 = 0.d0 + two_e_tmp_3 = 0.d0 do k1 = 1,ao_num - bielec_tmp_2 = 0.d0 + two_e_tmp_2 = 0.d0 do j1 = 1,ao_num - call get_ao_bielec_integrals(j1,k1,l1,ao_num,bielec_tmp_0(1,j1)) - ! call compute_ao_bielec_integrals(j1,k1,l1,ao_num,bielec_tmp_0(1,j1)) + call get_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) + ! call compute_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) enddo do j1 = 1,ao_num kmax = 0 do i1 = 1,ao_num - c = bielec_tmp_0(i1,j1) + c = two_e_tmp_0(i1,j1) if (c == 0.d0) then cycle endif kmax += 1 - bielec_tmp_0(kmax,j1) = c - bielec_tmp_0_idx(kmax) = i1 + two_e_tmp_0(kmax,j1) = c + two_e_tmp_0_idx(kmax) = i1 enddo if (kmax==0) then cycle endif - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 ii1=1 do ii1 = 1,kmax-4,4 - i1 = bielec_tmp_0_idx(ii1) - i2 = bielec_tmp_0_idx(ii1+1) - i3 = bielec_tmp_0_idx(ii1+2) - i4 = bielec_tmp_0_idx(ii1+3) + i1 = two_e_tmp_0_idx(ii1) + i2 = two_e_tmp_0_idx(ii1+1) + i3 = two_e_tmp_0_idx(ii1+2) + i4 = two_e_tmp_0_idx(ii1+3) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + & - mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + & - mo_coef_transp(i,i2) * bielec_tmp_0(ii1+1,j1) + & - mo_coef_transp(i,i3) * bielec_tmp_0(ii1+2,j1) + & - mo_coef_transp(i,i4) * bielec_tmp_0(ii1+3,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + & + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) + & + mo_coef_transp(i,i2) * two_e_tmp_0(ii1+1,j1) + & + mo_coef_transp(i,i3) * two_e_tmp_0(ii1+2,j1) + & + mo_coef_transp(i,i4) * two_e_tmp_0(ii1+3,j1) enddo ! i enddo ! ii1 i2 = ii1 do ii1 = i2,kmax - i1 = bielec_tmp_0_idx(ii1) + i1 = two_e_tmp_0_idx(ii1) do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_1(i) = bielec_tmp_1(i) + mo_coef_transp(i,i1) * bielec_tmp_0(ii1,j1) + two_e_tmp_1(i) = two_e_tmp_1(i) + mo_coef_transp(i,i1) * two_e_tmp_0(ii1,j1) enddo ! i enddo ! ii1 c = 0.d0 do i = list_ijkl(1,1), list_ijkl(n_i,1) - c = max(c,abs(bielec_tmp_1(i))) + c = max(c,abs(two_e_tmp_1(i))) if (c>mo_integrals_threshold) exit enddo if ( c < mo_integrals_threshold ) then @@ -917,11 +917,11 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) cycle endif do i = list_ijkl(1,1), list_ijkl(n_i,1) - bielec_tmp_2(i,j0) = bielec_tmp_2(i,j0) + c * bielec_tmp_1(i) + two_e_tmp_2(i,j0) = two_e_tmp_2(i,j0) + c * two_e_tmp_1(i) enddo ! i enddo ! j enddo !j1 - if ( maxval(abs(bielec_tmp_2)) < mo_integrals_threshold ) then + if ( maxval(abs(two_e_tmp_2)) < mo_integrals_threshold ) then cycle endif @@ -936,7 +936,7 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) do j0 = 1, n_j j = list_ijkl(j0,2) do i = list_ijkl(1,1), k - bielec_tmp_3(i,j0,k0) = bielec_tmp_3(i,j0,k0) + c* bielec_tmp_2(i,j0) + two_e_tmp_3(i,j0,k0) = two_e_tmp_3(i,j0,k0) + c* two_e_tmp_2(i,j0) enddo!i enddo !j @@ -961,13 +961,13 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) do k0 = 1, n_k k = list_ijkl(k0,3) i1 = shiftr((k*k-k),1) - bielec_tmp_1 = 0.d0 + two_e_tmp_1 = 0.d0 do i0 = 1, n_i i = list_ijkl(i0,1) if (i>k) then exit endif - bielec_tmp_1(i) = c*bielec_tmp_3(i,j0,k0) + two_e_tmp_1(i) = c*two_e_tmp_3(i,j0,k0) enddo do i0 = 1, n_i @@ -976,13 +976,13 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) exit endif - if (abs(bielec_tmp_1(i)) < mo_integrals_threshold) then + if (abs(two_e_tmp_1(i)) < mo_integrals_threshold) then cycle endif n_integrals += 1 - buffer_value(n_integrals) = bielec_tmp_1(i) + buffer_value(n_integrals) = two_e_tmp_1(i) !DIR$ FORCEINLINE - call mo_bielec_integrals_index(i,j,k,l,buffer_i(n_integrals)) + call mo_two_e_integrals_index(i,j,k,l,buffer_i(n_integrals)) if (n_integrals == size_buffer) then call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_value,& real(mo_integrals_threshold,integral_kind)) @@ -1003,7 +1003,7 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl) endif enddo !$OMP END DO NOWAIT - deallocate (bielec_tmp_1,bielec_tmp_2,bielec_tmp_3) + deallocate (two_e_tmp_1,two_e_tmp_2,two_e_tmp_3) call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_value,& real(mo_integrals_threshold,integral_kind)) @@ -1034,14 +1034,14 @@ end - BEGIN_PROVIDER [ double precision, mo_bielec_integral_jj_from_ao, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_bielec_integral_jj_exchange_from_ao, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_bielec_integral_jj_anti_from_ao, (mo_tot_num,mo_tot_num) ] + BEGIN_PROVIDER [ double precision, mo_two_e_integral_jj_from_ao, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_exchange_from_ao, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_anti_from_ao, (mo_num,mo_num) ] implicit none BEGIN_DOC - ! mo_bielec_integral_jj_from_ao(i,j) = J_ij - ! mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij - ! mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij + ! mo_two_e_integral_jj_from_ao(i,j) = J_ij + ! mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij + ! mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij END_DOC integer :: i,j,p,q,r,s @@ -1054,11 +1054,11 @@ end double precision, allocatable :: iqrs(:,:), iqsr(:,:), iqis(:), iqri(:) if (.not.do_direct_integrals) then - PROVIDE ao_bielec_integrals_in_map mo_coef + PROVIDE ao_two_e_integrals_in_map mo_coef endif - mo_bielec_integral_jj_from_ao = 0.d0 - mo_bielec_integral_jj_exchange_from_ao = 0.d0 + mo_two_e_integral_jj_from_ao = 0.d0 + mo_two_e_integrals_jj_exchange_from_ao = 0.d0 !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: iqrs, iqsr @@ -1066,42 +1066,42 @@ end !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE (i,j,p,q,r,s,integral,c,n,pp,int_value,int_idx, & !$OMP iqrs, iqsr,iqri,iqis) & - !$OMP SHARED(mo_tot_num,mo_coef_transp,ao_num, & + !$OMP SHARED(mo_num,mo_coef_transp,ao_num, & !$OMP ao_integrals_threshold,do_direct_integrals) & - !$OMP REDUCTION(+:mo_bielec_integral_jj_from_ao,mo_bielec_integral_jj_exchange_from_ao) + !$OMP REDUCTION(+:mo_two_e_integral_jj_from_ao,mo_two_e_integrals_jj_exchange_from_ao) allocate( int_value(ao_num), int_idx(ao_num), & - iqrs(mo_tot_num,ao_num), iqis(mo_tot_num), iqri(mo_tot_num),& - iqsr(mo_tot_num,ao_num) ) + iqrs(mo_num,ao_num), iqis(mo_num), iqri(mo_num), & + iqsr(mo_num,ao_num) ) !$OMP DO SCHEDULE (guided) do s=1,ao_num do q=1,ao_num do j=1,ao_num - do i=1,mo_tot_num + do i=1,mo_num iqrs(i,j) = 0.d0 iqsr(i,j) = 0.d0 enddo enddo if (do_direct_integrals) then - double precision :: ao_bielec_integral + double precision :: ao_two_e_integral do r=1,ao_num - call compute_ao_bielec_integrals(q,r,s,ao_num,int_value) + call compute_ao_two_e_integrals(q,r,s,ao_num,int_value) do p=1,ao_num integral = int_value(p) if (abs(integral) > ao_integrals_threshold) then - do i=1,mo_tot_num + do i=1,mo_num iqrs(i,r) += mo_coef_transp(i,p) * integral enddo endif enddo - call compute_ao_bielec_integrals(q,s,r,ao_num,int_value) + call compute_ao_two_e_integrals(q,s,r,ao_num,int_value) do p=1,ao_num integral = int_value(p) if (abs(integral) > ao_integrals_threshold) then - do i=1,mo_tot_num + do i=1,mo_num iqsr(i,r) += mo_coef_transp(i,p) * integral enddo endif @@ -1111,22 +1111,22 @@ end else do r=1,ao_num - call get_ao_bielec_integrals_non_zero(q,r,s,ao_num,int_value,int_idx,n) + call get_ao_two_e_integrals_non_zero(q,r,s,ao_num,int_value,int_idx,n) do pp=1,n p = int_idx(pp) integral = int_value(pp) if (abs(integral) > ao_integrals_threshold) then - do i=1,mo_tot_num + do i=1,mo_num iqrs(i,r) += mo_coef_transp(i,p) * integral enddo endif enddo - call get_ao_bielec_integrals_non_zero(q,s,r,ao_num,int_value,int_idx,n) + call get_ao_two_e_integrals_non_zero(q,s,r,ao_num,int_value,int_idx,n) do pp=1,n p = int_idx(pp) integral = int_value(pp) if (abs(integral) > ao_integrals_threshold) then - do i=1,mo_tot_num + do i=1,mo_num iqsr(i,r) += mo_coef_transp(i,p) * integral enddo endif @@ -1136,16 +1136,16 @@ end iqis = 0.d0 iqri = 0.d0 do r=1,ao_num - do i=1,mo_tot_num + do i=1,mo_num iqis(i) += mo_coef_transp(i,r) * iqrs(i,r) iqri(i) += mo_coef_transp(i,r) * iqsr(i,r) enddo enddo - do i=1,mo_tot_num - do j=1,mo_tot_num + do i=1,mo_num + do j=1,mo_num c = mo_coef_transp(j,q)*mo_coef_transp(j,s) - mo_bielec_integral_jj_from_ao(j,i) += c * iqis(i) - mo_bielec_integral_jj_exchange_from_ao(j,i) += c * iqri(i) + mo_two_e_integral_jj_from_ao(j,i) += c * iqis(i) + mo_two_e_integrals_jj_exchange_from_ao(j,i) += c * iqri(i) enddo enddo @@ -1155,19 +1155,19 @@ end deallocate(iqrs,iqsr,int_value,int_idx) !$OMP END PARALLEL - mo_bielec_integral_jj_anti_from_ao = mo_bielec_integral_jj_from_ao - mo_bielec_integral_jj_exchange_from_ao + mo_two_e_integrals_jj_anti_from_ao = mo_two_e_integral_jj_from_ao - mo_two_e_integrals_jj_exchange_from_ao END_PROVIDER - BEGIN_PROVIDER [ double precision, mo_bielec_integral_vv_from_ao, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_bielec_integral_vv_exchange_from_ao, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_bielec_integral_vv_anti_from_ao, (mo_tot_num,mo_tot_num) ] + BEGIN_PROVIDER [ double precision, mo_two_e_integrals_vv_from_ao, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_vv_exchange_from_ao, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_vv_anti_from_ao, (mo_num,mo_num) ] implicit none BEGIN_DOC - ! mo_bielec_integral_vv_from_ao(i,j) = J_ij - ! mo_bielec_integral_vv_exchange_from_ao(i,j) = J_ij - ! mo_bielec_integral_vv_anti_from_ao(i,j) = J_ij - K_ij + ! mo_two_e_integrals_vv_from_ao(i,j) = J_ij + ! mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij + ! mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij ! but only for the virtual orbitals END_DOC @@ -1182,25 +1182,25 @@ END_PROVIDER double precision, allocatable :: iqrs(:,:), iqsr(:,:), iqis(:), iqri(:) if (.not.do_direct_integrals) then - PROVIDE ao_bielec_integrals_in_map mo_coef + PROVIDE ao_two_e_integrals_in_map mo_coef endif - mo_bielec_integral_vv_from_ao = 0.d0 - mo_bielec_integral_vv_exchange_from_ao = 0.d0 + mo_two_e_integrals_vv_from_ao = 0.d0 + mo_two_e_integrals_vv_exchange_from_ao = 0.d0 !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: iqrs, iqsr - !$OMP PARALLEL DEFAULT(NONE) & - !$OMP PRIVATE (i0,j0,i,j,p,q,r,s,integral,c,n,pp,int_value,int_idx,& - !$OMP iqrs, iqsr,iqri,iqis) & - !$OMP SHARED(n_virt_orb,mo_tot_num,list_virt,mo_coef_transp,ao_num,& - !$OMP ao_integrals_threshold,do_direct_integrals) & - !$OMP REDUCTION(+:mo_bielec_integral_vv_from_ao,mo_bielec_integral_vv_exchange_from_ao) + !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PRIVATE (i0,j0,i,j,p,q,r,s,integral,c,n,pp,int_value,int_idx, & + !$OMP iqrs, iqsr,iqri,iqis) & + !$OMP SHARED(n_virt_orb,mo_num,list_virt,mo_coef_transp,ao_num, & + !$OMP ao_integrals_threshold,do_direct_integrals) & + !$OMP REDUCTION(+:mo_two_e_integrals_vv_from_ao,mo_two_e_integrals_vv_exchange_from_ao) allocate( int_value(ao_num), int_idx(ao_num), & - iqrs(mo_tot_num,ao_num), iqis(mo_tot_num), iqri(mo_tot_num),& - iqsr(mo_tot_num,ao_num) ) + iqrs(mo_num,ao_num), iqis(mo_num), iqri(mo_num),& + iqsr(mo_num,ao_num) ) !$OMP DO SCHEDULE (guided) do s=1,ao_num @@ -1215,9 +1215,9 @@ END_PROVIDER enddo if (do_direct_integrals) then - double precision :: ao_bielec_integral + double precision :: ao_two_e_integral do r=1,ao_num - call compute_ao_bielec_integrals(q,r,s,ao_num,int_value) + call compute_ao_two_e_integrals(q,r,s,ao_num,int_value) do p=1,ao_num integral = int_value(p) if (abs(integral) > ao_integrals_threshold) then @@ -1227,7 +1227,7 @@ END_PROVIDER enddo endif enddo - call compute_ao_bielec_integrals(q,s,r,ao_num,int_value) + call compute_ao_two_e_integrals(q,s,r,ao_num,int_value) do p=1,ao_num integral = int_value(p) if (abs(integral) > ao_integrals_threshold) then @@ -1242,7 +1242,7 @@ END_PROVIDER else do r=1,ao_num - call get_ao_bielec_integrals_non_zero(q,r,s,ao_num,int_value,int_idx,n) + call get_ao_two_e_integrals_non_zero(q,r,s,ao_num,int_value,int_idx,n) do pp=1,n p = int_idx(pp) integral = int_value(pp) @@ -1253,7 +1253,7 @@ END_PROVIDER enddo endif enddo - call get_ao_bielec_integrals_non_zero(q,s,r,ao_num,int_value,int_idx,n) + call get_ao_two_e_integrals_non_zero(q,s,r,ao_num,int_value,int_idx,n) do pp=1,n p = int_idx(pp) integral = int_value(pp) @@ -1280,8 +1280,8 @@ END_PROVIDER do j0=1,n_virt_orb j = list_virt(j0) c = mo_coef_transp(j,q)*mo_coef_transp(j,s) - mo_bielec_integral_vv_from_ao(j,i) += c * iqis(i) - mo_bielec_integral_vv_exchange_from_ao(j,i) += c * iqri(i) + mo_two_e_integrals_vv_from_ao(j,i) += c * iqis(i) + mo_two_e_integrals_vv_exchange_from_ao(j,i) += c * iqri(i) enddo enddo @@ -1291,11 +1291,11 @@ END_PROVIDER deallocate(iqrs,iqsr,int_value,int_idx) !$OMP END PARALLEL - mo_bielec_integral_vv_anti_from_ao = mo_bielec_integral_vv_from_ao - mo_bielec_integral_vv_exchange_from_ao + mo_two_e_integrals_vv_anti_from_ao = mo_two_e_integrals_vv_from_ao - mo_two_e_integrals_vv_exchange_from_ao ! print*, '**********' ! do i0 =1, n_virt_orb ! i = list_virt(i0) - ! print*, mo_bielec_integral_vv_from_ao(i,i) + ! print*, mo_two_e_integrals_vv_from_ao(i,i) ! enddo ! print*, '**********' @@ -1303,28 +1303,28 @@ END_PROVIDER END_PROVIDER - BEGIN_PROVIDER [ double precision, mo_bielec_integral_jj, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_bielec_integral_jj_exchange, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, mo_bielec_integral_jj_anti, (mo_tot_num,mo_tot_num) ] + BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_exchange, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_anti, (mo_num,mo_num) ] implicit none BEGIN_DOC - ! mo_bielec_integral_jj(i,j) = J_ij - ! mo_bielec_integral_jj_exchange(i,j) = K_ij - ! mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij + ! mo_two_e_integrals_jj(i,j) = J_ij + ! mo_two_e_integrals_jj_exchange(i,j) = K_ij + ! mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij END_DOC integer :: i,j - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral - PROVIDE mo_bielec_integrals_in_map - mo_bielec_integral_jj = 0.d0 - mo_bielec_integral_jj_exchange = 0.d0 + PROVIDE mo_two_e_integrals_in_map + mo_two_e_integrals_jj = 0.d0 + mo_two_e_integrals_jj_exchange = 0.d0 - do j=1,mo_tot_num - do i=1,mo_tot_num - mo_bielec_integral_jj(i,j) = get_mo_bielec_integral(i,j,i,j,mo_integrals_map) - mo_bielec_integral_jj_exchange(i,j) = get_mo_bielec_integral(i,j,j,i,mo_integrals_map) - mo_bielec_integral_jj_anti(i,j) = mo_bielec_integral_jj(i,j) - mo_bielec_integral_jj_exchange(i,j) + do j=1,mo_num + do i=1,mo_num + mo_two_e_integrals_jj(i,j) = get_two_e_integral(i,j,i,j,mo_integrals_map) + mo_two_e_integrals_jj_exchange(i,j) = get_two_e_integral(i,j,j,i,mo_integrals_map) + mo_two_e_integrals_jj_anti(i,j) = mo_two_e_integrals_jj(i,j) - mo_two_e_integrals_jj_exchange(i,j) enddo enddo @@ -1337,9 +1337,7 @@ subroutine clear_mo_map ! Frees the memory of the MO map END_DOC call map_deinit(mo_integrals_map) - FREE mo_integrals_map mo_bielec_integral_jj mo_bielec_integral_jj_anti - FREE mo_bielec_integral_jj_exchange mo_bielec_integrals_in_map - - + FREE mo_integrals_map mo_two_e_integrals_jj mo_two_e_integrals_jj_anti + FREE mo_two_e_integrals_jj_exchange mo_two_e_integrals_in_map end diff --git a/src/perturbation/pert_single.irp.f b/src/perturbation/pert_single.irp.f index e2fbc9bf..80d900c4 100644 --- a/src/perturbation/pert_single.irp.f +++ b/src/perturbation/pert_single.irp.f @@ -47,7 +47,7 @@ subroutine pt2_h_core(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minili endif integer :: h1,p1,h2,p2,s1,s2 call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - c_pert = phase * mo_mono_elec_integral(h1,p1) - e_2_pert = -dabs(mo_mono_elec_integral(h1,p1)+1.d0) + c_pert = phase * mo_one_e_integrals(h1,p1) + e_2_pert = -dabs(mo_one_e_integrals(h1,p1)+1.d0) end diff --git a/src/perturbation/perturbation.template.f b/src/perturbation/perturbation.template.f index 6da5028f..67f7eb60 100644 --- a/src/perturbation/perturbation.template.f +++ b/src/perturbation/perturbation.template.f @@ -13,7 +13,7 @@ subroutine perturb_buffer_$PERT(i_generator,buffer,buffer_size,e_2_pert_buffer,c integer, intent(in) :: Nint, N_st, buffer_size, i_generator integer(bit_kind), intent(in) :: buffer(Nint,2,buffer_size) integer(bit_kind),intent(in) :: key_mask(Nint,2) - double precision, intent(in) :: fock_diag_tmp(2,0:mo_tot_num) + double precision, intent(in) :: fock_diag_tmp(2,0:mo_num) double precision, intent(in) :: electronic_energy(N_st) double precision, intent(inout) :: sum_norm_pert(N_st),sum_e_2_pert(N_st) double precision, intent(inout) :: coef_pert_buffer(N_st,buffer_size),e_2_pert_buffer(N_st,buffer_size),sum_H_pert_diag(N_st) @@ -63,13 +63,13 @@ subroutine perturb_buffer_$PERT(i_generator,buffer,buffer_size,e_2_pert_buffer,c call create_minilist(key_mask, psi_selectors, minilist, idx_miniList, N_det_selectors, N_minilist, Nint) allocate( microlist(Nint,2,N_minilist*4), & idx_microlist(N_minilist*4), & - ptr_microlist(0:mo_tot_num*2+1), & - N_microlist(0:mo_tot_num*2) ) + ptr_microlist(0:mo_num*2+1), & + N_microlist(0:mo_num*2) ) allocate( microlist_gen(Nint,2,N_minilist_gen*4), & idx_microlist_gen(N_minilist_gen*4 ), & - ptr_microlist_gen(0:mo_tot_num*2+1), & - N_microlist_gen(0:mo_tot_num*2) ) + ptr_microlist_gen(0:mo_num*2+1), & + N_microlist_gen(0:mo_num*2) ) if(key_mask(1,1) /= 0) then @@ -80,7 +80,7 @@ subroutine perturb_buffer_$PERT(i_generator,buffer,buffer_size,e_2_pert_buffer,c allocate(idx_microlist_zero(N_minilist)) - do i=0,mo_tot_num*2 + do i=0,mo_num*2 do k=ptr_microlist(i),ptr_microlist(i+1)-1 idx_microlist(k) = idx_minilist(idx_microlist(k)) end do @@ -192,7 +192,7 @@ subroutine perturb_buffer_by_mono_$PERT(i_generator,buffer,buffer_size,e_2_pert_ integer, intent(in) :: Nint, N_st, buffer_size, i_generator integer(bit_kind), intent(in) :: buffer(Nint,2,buffer_size) integer(bit_kind),intent(in) :: key_mask(Nint,2) - double precision, intent(in) :: fock_diag_tmp(2,0:mo_tot_num) + double precision, intent(in) :: fock_diag_tmp(2,0:mo_num) double precision, intent(in) :: electronic_energy(N_st) double precision, intent(inout) :: sum_norm_pert(N_st),sum_e_2_pert(N_st) double precision, intent(inout) :: coef_pert_buffer(N_st,buffer_size),e_2_pert_buffer(N_st,buffer_size),sum_H_pert_diag(N_st) diff --git a/src/perturbation/pt2_equations.irp.f b/src/perturbation/pt2_equations.irp.f index db9fa148..267919f1 100644 --- a/src/perturbation/pt2_equations.irp.f +++ b/src/perturbation/pt2_equations.irp.f @@ -347,7 +347,7 @@ electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nin integer, intent(in) :: N_minilist integer(bit_kind), intent(in) :: det_ref (Nint,2) integer(bit_kind), intent(in) :: det_pert(Nint,2) - double precision , intent(in) :: fock_diag_tmp(2,mo_tot_num+1) + double precision , intent(in) :: fock_diag_tmp(2,mo_num+1) double precision , intent(in) :: electronic_energy(N_st) double precision , intent(out) :: c_pert(N_st) double precision , intent(out) :: e_2_pert(N_st) diff --git a/src/scf_utils/diagonalize_fock.irp.f b/src/scf_utils/diagonalize_fock.irp.f index 2d198f62..d5573d0c 100644 --- a/src/scf_utils/diagonalize_fock.irp.f +++ b/src/scf_utils/diagonalize_fock.irp.f @@ -1,4 +1,4 @@ -BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_tot_num) ] +BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_num) ] implicit none BEGIN_DOC ! Eigenvector of the Fock matrix in the MO basis obtained with level shift. @@ -11,11 +11,11 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_tot_n double precision, allocatable :: diag(:) - allocate( F(mo_tot_num,mo_tot_num) ) - allocate (diag(mo_tot_num) ) + allocate( F(mo_num,mo_num) ) + allocate (diag(mo_num) ) - do j=1,mo_tot_num - do i=1,mo_tot_num + do j=1,mo_num + do i=1,mo_num F(i,j) = Fock_matrix_mo(i,j) enddo enddo @@ -47,11 +47,11 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_tot_n F(i,i) += 0.5d0*level_shift enddo - do i = elec_alpha_num+1, mo_tot_num + do i = elec_alpha_num+1, mo_num F(i,i) += level_shift enddo - n = mo_tot_num + n = mo_num lwork = 1+6*n + 2*n*n liwork = 3 + 5*n @@ -61,7 +61,7 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_tot_n lwork = -1 liwork = -1 - call dsyevd( 'V', 'U', mo_tot_num, F, & + call dsyevd( 'V', 'U', mo_num, F, & size(F,1), diag, work, lwork, iwork, liwork, info) if (info /= 0) then @@ -75,13 +75,13 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_tot_n allocate(work(lwork)) allocate(iwork(liwork) ) - call dsyevd( 'V', 'U', mo_tot_num, F, & + call dsyevd( 'V', 'U', mo_num, F, & size(F,1), diag, work, lwork, iwork, liwork, info) deallocate(iwork) if (info /= 0) then - call dsyev( 'V', 'L', mo_tot_num, F, & + call dsyev( 'V', 'L', mo_num, F, & size(F,1), diag, work, lwork, info) if (info /= 0) then @@ -90,7 +90,7 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_tot_n endif endif - call dgemm('N','N',ao_num,mo_tot_num,mo_tot_num, 1.d0, & + call dgemm('N','N',ao_num,mo_num,mo_num, 1.d0, & mo_coef, size(mo_coef,1), F, size(F,1), & 0.d0, eigenvectors_Fock_matrix_mo, size(eigenvectors_Fock_matrix_mo,1)) deallocate(work, F, diag) diff --git a/src/scf_utils/diis.irp.f b/src/scf_utils/diis.irp.f index dfc43015..3dfc9865 100644 --- a/src/scf_utils/diis.irp.f +++ b/src/scf_utils/diis.irp.f @@ -60,7 +60,7 @@ BEGIN_PROVIDER [double precision, FPS_SPF_Matrix_AO, (AO_num, AO_num)] END_PROVIDER -bEGIN_PROVIDER [double precision, FPS_SPF_Matrix_MO, (mo_tot_num, mo_tot_num)] +bEGIN_PROVIDER [double precision, FPS_SPF_Matrix_MO, (mo_num, mo_num)] implicit none begin_doc ! Commutator FPS - SPF in MO basis diff --git a/src/scf_utils/fock_matrix.irp.f b/src/scf_utils/fock_matrix.irp.f index 178fec85..39fa7067 100644 --- a/src/scf_utils/fock_matrix.irp.f +++ b/src/scf_utils/fock_matrix.irp.f @@ -1,5 +1,5 @@ - BEGIN_PROVIDER [ double precision, Fock_matrix_mo, (mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, Fock_matrix_diag_mo, (mo_tot_num)] + BEGIN_PROVIDER [ double precision, Fock_matrix_mo, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, Fock_matrix_diag_mo, (mo_num)] implicit none BEGIN_DOC ! Fock matrix on the MO basis. @@ -34,7 +34,7 @@ + 0.5d0*(Fock_matrix_mo_beta(i,j) - Fock_matrix_mo_alpha(i,j)) enddo ! F - do i=elec_alpha_num+1, mo_tot_num + do i=elec_alpha_num+1, mo_num Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_mo_alpha(i,j)+Fock_matrix_mo_beta(i,j)) enddo enddo @@ -50,13 +50,13 @@ Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_mo_alpha(i,j)+Fock_matrix_mo_beta(i,j)) enddo ! F-K/2 - do i=elec_alpha_num+1, mo_tot_num + do i=elec_alpha_num+1, mo_num Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_mo_alpha(i,j)+Fock_matrix_mo_beta(i,j))& - 0.5d0*(Fock_matrix_mo_beta(i,j) - Fock_matrix_mo_alpha(i,j)) enddo enddo - do j=elec_alpha_num+1, mo_tot_num + do j=elec_alpha_num+1, mo_num ! F do i=1,elec_beta_num Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_mo_alpha(i,j)+Fock_matrix_mo_beta(i,j)) @@ -67,7 +67,7 @@ - 0.5d0*(Fock_matrix_mo_beta(i,j) - Fock_matrix_mo_alpha(i,j)) enddo ! F+K - do i=elec_alpha_num+1,mo_tot_num + do i=elec_alpha_num+1,mo_num Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_mo_alpha(i,j)+Fock_matrix_mo_beta(i,j)) & + (Fock_matrix_mo_beta(i,j) - Fock_matrix_mo_alpha(i,j)) enddo @@ -75,14 +75,14 @@ endif - do i = 1, mo_tot_num + do i = 1, mo_num Fock_matrix_diag_mo(i) = Fock_matrix_mo(i,i) enddo END_PROVIDER -BEGIN_PROVIDER [ double precision, Fock_matrix_mo_alpha, (mo_tot_num,mo_tot_num) ] +BEGIN_PROVIDER [ double precision, Fock_matrix_mo_alpha, (mo_num,mo_num) ] implicit none BEGIN_DOC ! Fock matrix on the MO basis @@ -92,7 +92,7 @@ BEGIN_PROVIDER [ double precision, Fock_matrix_mo_alpha, (mo_tot_num,mo_tot_num) END_PROVIDER -BEGIN_PROVIDER [ double precision, Fock_matrix_mo_beta, (mo_tot_num,mo_tot_num) ] +BEGIN_PROVIDER [ double precision, Fock_matrix_mo_beta, (mo_num,mo_num) ] implicit none BEGIN_DOC ! Fock matrix on the MO basis @@ -135,8 +135,8 @@ BEGIN_PROVIDER [ double precision, SCF_energy ] do j=1,ao_num do i=1,ao_num SCF_energy += 0.5d0 * ( & - (ao_mono_elec_integral(i,j) + Fock_matrix_ao_alpha(i,j) ) * SCF_density_matrix_ao_alpha(i,j) +& - (ao_mono_elec_integral(i,j) + Fock_matrix_ao_beta (i,j) ) * SCF_density_matrix_ao_beta (i,j) ) + (ao_one_e_integrals(i,j) + Fock_matrix_ao_alpha(i,j) ) * SCF_density_matrix_ao_alpha(i,j) +& + (ao_one_e_integrals(i,j) + Fock_matrix_ao_beta (i,j) ) * SCF_density_matrix_ao_beta (i,j) ) enddo enddo SCF_energy += extra_e_contrib_density diff --git a/src/scf_utils/huckel.irp.f b/src/scf_utils/huckel.irp.f index c9e32ad5..ac104a72 100644 --- a/src/scf_utils/huckel.irp.f +++ b/src/scf_utils/huckel.irp.f @@ -15,9 +15,9 @@ subroutine huckel_guess A = 0.d0 do j=1,ao_num do i=1,ao_num - A(i,j) = c * ao_overlap(i,j) * (ao_mono_elec_integral_diag(i) + ao_mono_elec_integral_diag(j)) + A(i,j) = c * ao_overlap(i,j) * (ao_one_e_integrals_diag(i) + ao_one_e_integrals_diag(j)) enddo - A(j,j) = ao_mono_elec_integral_diag(j) + ao_bi_elec_integral_alpha(j,j) + A(j,j) = ao_one_e_integrals_diag(j) + ao_two_e_integral_alpha(j,j) enddo Fock_matrix_ao_alpha(1:ao_num,1:ao_num) = A(1:ao_num,1:ao_num) diff --git a/src/scf_utils/roothaan_hall_scf.irp.f b/src/scf_utils/roothaan_hall_scf.irp.f index 3b217b7e..ac7339ca 100644 --- a/src/scf_utils/roothaan_hall_scf.irp.f +++ b/src/scf_utils/roothaan_hall_scf.irp.f @@ -17,7 +17,7 @@ END_DOC PROVIDE ao_md5 mo_occ level_shift - allocate(mo_coef_save(ao_num,mo_tot_num), & + allocate(mo_coef_save(ao_num,mo_num), & Fock_matrix_DIIS (ao_num,ao_num,max_dim_DIIS), & error_matrix_DIIS(ao_num,ao_num,max_dim_DIIS) & ) @@ -43,7 +43,10 @@ END_DOC ! ! Start of main SCF loop ! - do while(( (max_error_DIIS > threshold_DIIS_nonzero).or.(dabs(Delta_energy_SCF) > thresh_SCF) ) .and. (iteration_SCF < n_it_SCF_max)) + do while ( & + ( (max_error_DIIS > threshold_DIIS_nonzero) .or. & + (dabs(Delta_energy_SCF) > thresh_SCF) & + ) .and. (iteration_SCF < n_it_SCF_max) ) ! Increment cycle number @@ -106,16 +109,16 @@ END_DOC double precision :: level_shift_save level_shift_save = level_shift - mo_coef_save(1:ao_num,1:mo_tot_num) = mo_coef(1:ao_num,1:mo_tot_num) + mo_coef_save(1:ao_num,1:mo_num) = mo_coef(1:ao_num,1:mo_num) do while (Delta_energy_SCF .ge. 0.d0) - mo_coef(1:ao_num,1:mo_tot_num) = mo_coef_save + mo_coef(1:ao_num,1:mo_num) = mo_coef_save TOUCH mo_coef if (level_shift <= 0.d0) then level_shift = 1.d0 else level_shift = level_shift * 2.0d0 endif - mo_coef(1:ao_num,1:mo_tot_num) = eigenvectors_Fock_matrix_MO(1:ao_num,1:mo_tot_num) + mo_coef(1:ao_num,1:mo_num) = eigenvectors_Fock_matrix_MO(1:ao_num,1:mo_num) if(no_oa_or_av_opt)then call reorder_active_orb call initialize_mo_coef_begin_iteration @@ -145,6 +148,9 @@ END_DOC enddo + if (iteration_SCF < n_it_SCF_max) then + mo_label = "Canonical" + endif ! ! End of Main SCF loop ! @@ -158,8 +164,7 @@ END_DOC call save_mos endif - call write_double(6, Energy_SCF, 'SCF energy ') -! call ezfio_set_hartree_fock_energy(Energy_SCF) + call write_double(6, Energy_SCF, 'SCF energy') call write_time(6) diff --git a/src/slave/slave_cipsi.irp.f b/src/slave/slave_cipsi.irp.f index 226a8ad2..adc6374a 100644 --- a/src/slave/slave_cipsi.irp.f +++ b/src/slave/slave_cipsi.irp.f @@ -14,8 +14,8 @@ program slave end subroutine provide_everything - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context N_states_diag - PROVIDE pt2_e0_denominator mo_tot_num N_int ci_energy mpi_master zmq_state zmq_context + PROVIDE H_apply_buffer_allocated mo_two_e_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context N_states_diag + PROVIDE pt2_e0_denominator mo_num N_int ci_energy mpi_master zmq_state zmq_context PROVIDE psi_det psi_coef threshold_generators state_average_weight PROVIDE N_det_selectors pt2_stoch_istate N_det end diff --git a/src/slave/slave_eri.irp.f b/src/slave/slave_eri.irp.f index e0c03ff1..64056467 100644 --- a/src/slave/slave_eri.irp.f +++ b/src/slave/slave_eri.irp.f @@ -20,8 +20,8 @@ program qp_ao_ints zmq_state = 'ao_integrals' ! Provide everything needed - double precision :: integral, ao_bielec_integral - integral = ao_bielec_integral(1,1,1,1) + double precision :: integral, ao_two_e_integral + integral = ao_two_e_integral(1,1,1,1) do call wait_for_state('ao_integrals',zmq_state) @@ -31,7 +31,7 @@ program qp_ao_ints !$OMP PARALLEL DEFAULT(PRIVATE) PRIVATE(i) i = omp_get_thread_num() - call ao_bielec_integrals_in_map_slave_tcp(i) + call ao_two_e_integrals_in_map_slave_tcp(i) !$OMP END PARALLEL IRP_IF MPI call MPI_BARRIER(MPI_COMM_WORLD, ierr) diff --git a/src/tools/NEED b/src/tools/NEED index 08682750..98afd7a1 100644 --- a/src/tools/NEED +++ b/src/tools/NEED @@ -1,3 +1,3 @@ fci -mo_two_e_erf_integrals +mo_two_e_erf_ints aux_quantities diff --git a/src/tools/fcidump.irp.f b/src/tools/fcidump.irp.f index ee035728..a4a86092 100644 --- a/src/tools/fcidump.irp.f +++ b/src/tools/fcidump.irp.f @@ -26,9 +26,9 @@ program fcidump integer(key_kind), allocatable :: keys(:) double precision, allocatable :: values(:) integer(cache_map_size_kind) :: n_elements, n_elements_max - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map - double precision :: get_mo_bielec_integral, integral + double precision :: get_two_e_integral, integral do l=1,n_act_orb l1 = list_act(l) @@ -39,7 +39,7 @@ program fcidump do i=k,n_act_orb i1 = list_act(i) if (i1>=j1) then - integral = get_mo_bielec_integral(i1,j1,k1,l1,mo_integrals_map) + integral = get_two_e_integral(i1,j1,k1,l1,mo_integrals_map) if (dabs(integral) > mo_integrals_threshold) then write(i_unit_output,*) integral, i,k,j,l endif @@ -53,7 +53,7 @@ program fcidump j1 = list_act(j) do i=j,n_act_orb i1 = list_act(i) - integral = mo_mono_elec_integral(i1,j1) + core_fock_operator(i1,j1) + integral = mo_one_e_integrals(i1,j1) + core_fock_operator(i1,j1) if (dabs(integral) > mo_integrals_threshold) then write(i_unit_output,*) integral, i,j,0,0 endif diff --git a/src/tools/four_idx_transform.irp.f b/src/tools/four_idx_transform.irp.f index 2433021c..c2a595db 100644 --- a/src/tools/four_idx_transform.irp.f +++ b/src/tools/four_idx_transform.irp.f @@ -4,9 +4,9 @@ program four_idx_transform ! 4-index transformation of two-electron integrals from AO to MO integrals END_DOC - disk_access_mo_integrals = 'Write' - SOFT_TOUCH disk_access_mo_integrals + io_mo_two_e_integrals = 'Write' + SOFT_TOUCH io_mo_two_e_integrals if (.true.) then - PROVIDE mo_bielec_integrals_in_map + PROVIDE mo_two_e_integrals_in_map endif end diff --git a/src/tools/molden.irp.f b/src/tools/molden.irp.f index 62892e2e..00284062 100644 --- a/src/tools/molden.irp.f +++ b/src/tools/molden.irp.f @@ -125,7 +125,7 @@ subroutine write_Mo_basis(i_unit_output) write(i_unit_output,*) ' ----------------------' write(i_unit_output,*) ' ' - do j = 1, mo_tot_num + do j = 1, mo_num write(i_unit_output,'(18X,I3)')j write(i_unit_output,*)'' write(i_unit_output,'(18X,F8.5)')-1.d0 diff --git a/src/tools/print_wf.irp.f b/src/tools/print_wf.irp.f index 99e8dfad..92b1d6af 100644 --- a/src/tools/print_wf.irp.f +++ b/src/tools/print_wf.irp.f @@ -25,7 +25,7 @@ subroutine routine integer :: exc(0:2,2,2) double precision :: phase integer :: h1,p1,h2,p2,s1,s2 - double precision :: get_mo_bielec_integral + double precision :: get_two_e_integral double precision :: norm_mono_a,norm_mono_b double precision :: norm_mono_a_2,norm_mono_b_2 double precision :: norm_mono_a_pert_2,norm_mono_b_pert_2 diff --git a/src/tools/save_natorb.irp.f b/src/tools/save_natorb.irp.f index df02dc9f..750915af 100644 --- a/src/tools/save_natorb.irp.f +++ b/src/tools/save_natorb.irp.f @@ -7,7 +7,10 @@ program save_natorb touch read_wf call save_natural_mos call save_ref_determinant - call ezfio_set_mo_two_e_integrals_disk_access_mo_integrals('None') - call ezfio_set_mo_one_e_integrals_disk_access_mo_one_integrals('None') + call ezfio_set_mo_two_e_ints_io_mo_two_e_integrals('None') + call ezfio_set_mo_one_e_ints_io_mo_one_e_integrals('None') + call ezfio_set_mo_one_e_ints_io_mo_integrals_kinetic('None') + call ezfio_set_mo_one_e_ints_io_mo_integrals_e_n('None') + call ezfio_set_mo_one_e_ints_io_mo_integrals_pseudo('None') end diff --git a/src/tools/write_integrals_erf.irp.f b/src/tools/write_integrals_erf.irp.f index 1b71ace6..6f350874 100644 --- a/src/tools/write_integrals_erf.irp.f +++ b/src/tools/write_integrals_erf.irp.f @@ -1,20 +1,20 @@ program write_integrals implicit none BEGIN_DOC - ! Saves the bielec erf integrals into the EZFIO + ! Saves the two-electron erf integrals into the EZFIO END_DOC - disk_access_mo_integrals = 'None' - touch disk_access_mo_integrals - disk_access_ao_integrals = 'None' - touch disk_access_ao_integrals + io_mo_two_e_integrals = 'None' + touch io_mo_two_e_integrals + io_ao_two_e_integrals = 'None' + touch io_ao_two_e_integrals call routine end subroutine routine implicit none - call save_erf_bi_elec_integrals_ao - call save_erf_bi_elec_integrals_mo + call save_erf_two_e_integrals_ao + call save_erf_two_e_integrals_mo end