From 8b22e38c9c3bb9006639d2babb7d278d0aa98f39 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 7 Mar 2019 16:29:06 +0100 Subject: [PATCH] Develop (#15) * fixed laplacian of aos * corrected the laplacians of aos * added dft_one_e * added new feature for new dft functionals * changed the configure to add new functionals * changed the configure * added dft_one_e/README.rst * added README.rst in new_functionals * added source/programmers_guide/new_ks.rst * Thesis Yann * Added gmp installation in configure * improved qp_e_conv_fci * Doc * Typos * Added variance_max * Fixed completion in qp_create * modif TODO * fixed DFT potential for n_states gt 1 * improved pot pbe * trying to improve sr PBE * fixed potential pbe * fixed the vxc smashed for pbe sr and normal * Comments in selection * bug fixed by peter * Fixed bug with zero beta electrons * Update README.rst * Update e_xc_new_func.irp.f * Update links.rst * Update quickstart.rst * Update quickstart.rst * updated cipsi * Fixed energies of non-expected s2 (#9) * Moved diag_algorithm in Davdison * Add print_ci_vector in tools (#11) * Fixed energies of non-expected s2 * Moved diag_algorithm in Davdison * Fixed travis * Added print_ci_vector * Documentation * Cleaned qp_set_mo_class.ml * Removed Core in taskserver * Merge develop-toto and manus (#12) * Fixed energies of non-expected s2 * Moved diag_algorithm in Davdison * Fixed travis * Added print_ci_vector * Documentation * Cleaned qp_set_mo_class.ml * Removed Core in taskserver * Frozen core for heavy atoms * Improved molden module * In sync with manus * Fixed some of the documentation errors * Develop toto (#13) * Fixed energies of non-expected s2 * Moved diag_algorithm in Davdison * Fixed travis * Added print_ci_vector * Documentation * Cleaned qp_set_mo_class.ml * Removed Core in taskserver * Frozen core for heavy atoms * Improved molden module * In sync with manus * Fixed some of the documentation errors * Develop manus (#14) * modified printing for rpt2 * Comment * Fixed plugins * Scripting for functionals * Documentation * Develop (#10) * fixed laplacian of aos * corrected the laplacians of aos * added dft_one_e * added new feature for new dft functionals * changed the configure to add new functionals * changed the configure * added dft_one_e/README.rst * added README.rst in new_functionals * added source/programmers_guide/new_ks.rst * Thesis Yann * Added gmp installation in configure * improved qp_e_conv_fci * Doc * Typos * Added variance_max * Fixed completion in qp_create * modif TODO * fixed DFT potential for n_states gt 1 * improved pot pbe * trying to improve sr PBE * fixed potential pbe * fixed the vxc smashed for pbe sr and normal * Comments in selection * bug fixed by peter * Fixed bug with zero beta electrons * Update README.rst * Update e_xc_new_func.irp.f * Update links.rst * Update quickstart.rst * Update quickstart.rst * updated cipsi * Fixed energies of non-expected s2 (#9) * Moved diag_algorithm in Davdison * some modifs * modified gfortran_debug.cfg * fixed automatization of functionals * modified e_xc_general.irp.f * minor modifs in ref_bitmask.irp.f * modifying functionals * rs_ks_scf and ks_scf compiles with the automatic handling of functionals * removed prints * fixed configure * fixed the new functionals * Merge toto * modified automatic functionals * Changed python into python2 * from_xyz suppressed * Cleaning repo * Update README.md * Update README.md * Contributors * Update GITHUB.md * bibtex --- GITHUB.md | 15 +- README.md | 15 +- REPLACE | 637 ++ TODO | 9 + bin/qp_plugins | 9 +- bin/qp_set_frozen_core | 4 +- config/gfortran_debug.cfg | 2 +- configure | 6 - docs/Makefile | 4 +- docs/source/_static/links.rst | 2 +- docs/source/appendix/contributors.rst | 8 +- docs/source/modules/.gitignore | 1 + docs/source/modules/ao_basis.rst | 1238 +++ docs/source/modules/ao_one_e_ints.rst | 2028 +++++ docs/source/modules/ao_two_e_erf_ints.rst | 905 ++ docs/source/modules/ao_two_e_ints.rst | 1285 +++ docs/source/modules/aux_quantities.rst | 53 + docs/source/modules/becke_numerical_grid.rst | 900 ++ docs/source/modules/bitmask.rst | 3490 +++++++ docs/source/modules/cipsi.rst | 2499 +++++ docs/source/modules/cis.rst | 280 + docs/source/modules/cisd.rst | 273 + docs/source/modules/davidson.rst | 1881 ++++ docs/source/modules/davidson_dressed.rst | 13 + docs/source/modules/davidson_undressed.rst | 75 + docs/source/modules/density_for_dft.rst | 324 + docs/source/modules/determinants.rst | 8039 +++++++++++++++++ docs/source/modules/dft_keywords.rst | 116 + docs/source/modules/dft_one_e.rst | 640 ++ docs/source/modules/dft_utils_in_r.rst | 907 ++ docs/source/modules/dft_utils_one_e.rst | 1187 +++ docs/source/modules/dressing.rst | 36 + docs/source/modules/electrons.rst | 112 + docs/source/modules/ezfio_files.rst | 769 ++ docs/source/modules/fci.rst | 160 + docs/source/modules/generators_cas.rst | 19 + docs/source/modules/generators_full.rst | 293 + docs/source/modules/hartree_fock.rst | 421 + docs/source/modules/iterations.rst | 211 + docs/source/modules/kohn_sham.rst | 95 + docs/source/modules/kohn_sham_rs.rst | 473 + docs/source/modules/mo_basis.rst | 815 ++ docs/source/modules/mo_guess.rst | 160 + docs/source/modules/mo_one_e_ints.rst | 571 ++ docs/source/modules/mo_two_e_erf_ints.rst | 1000 ++ docs/source/modules/mo_two_e_ints.rst | 1312 +++ docs/source/modules/mpi.rst | 294 + docs/source/modules/nuclei.rst | 666 ++ docs/source/modules/perturbation.rst | 981 ++ docs/source/modules/pseudo.rst | 94 + docs/source/modules/psiref_cas.rst | 14 + docs/source/modules/psiref_utils.rst | 16 + docs/source/modules/scf_utils.rst | 795 ++ docs/source/modules/selectors_cassd.rst | 13 + docs/source/modules/selectors_full.rst | 152 + docs/source/modules/selectors_utils.rst | 649 ++ docs/source/modules/single_ref_method.rst | 14 + docs/source/modules/tools.rst | 134 + docs/source/modules/utils.rst | 3026 +++++++ docs/source/modules/zmq.rst | 1550 ++++ .../programmers_guide/index_providers.rst | 105 +- docs/source/programmers_guide/new_ks.rst | 73 +- docs/source/programmers_guide/programming.rst | 41 +- docs/source/programs/.gitignore | 1 + docs/source/programs/fci.rst | 5 +- docs/source/programs/molden.rst | 20 +- docs/source/programs/print_ci_vectors.rst | 41 + docs/source/research.bib | 51 +- ...ezfio_from_xyz.rst => qp_create_ezfio.rst} | 0 docs/source/work.rst | 3 - man/cis.1 | 2 +- man/cisd.1 | 2 +- man/configure.1 | 2 +- man/diagonalize_h.1 | 2 +- man/excited_states.1 | 2 +- man/fci.1 | 20 +- man/fcidump.1 | 2 +- man/four_idx_transform.1 | 2 +- man/interfaces.1 | 2 +- man/ks_scf.1 | 2 +- man/molden.1 | 40 +- man/natural_orbitals.1 | 2 +- man/plugins.1 | 2 +- man/print_e_conv.1 | 2 +- man/print_wf.1 | 2 +- man/printing.1 | 2 +- man/pt2.1 | 2 +- man/qp_convert_output_to_ezfio.1 | 2 +- man/qp_create_ezfio_from_xyz.1 | 235 - man/qp_edit.1 | 2 +- man/qp_export_as_tgz.1 | 2 +- man/qp_plugins.1 | 2 +- man/qp_reset.1 | 2 +- man/qp_run.1 | 2 +- man/qp_set_frozen_core.1 | 2 +- man/qp_set_mo_class.1 | 2 +- man/qp_stop.1 | 2 +- man/qp_update.1 | 2 +- man/qpsh.1 | 2 +- man/rs_ks_scf.1 | 2 +- man/save_natorb.1 | 2 +- man/save_one_e_dm.1 | 2 +- man/save_ortho_mos.1 | 2 +- man/scf.1 | 2 +- man/write_integrals_erf.1 | 2 +- ocaml/TaskServer.ml | 91 +- ocaml/TaskServer.mli | 2 +- ocaml/_tags | 3 + ocaml/c_bindings.c | 69 + ocaml/myocamlbuild.ml | 1 + ocaml/qp_print_basis.ml | 7 +- ocaml/qp_set_mo_class.ml | 79 +- plugins/local/.gitignore | 0 src/ao_basis/aos.irp.f | 20 +- src/becke_numerical_grid/EZFIO.cfg | 5 + .../grid_becke_vector.irp.f | 12 +- src/cipsi/cipsi.irp.f | 1 + src/cipsi/selection_buffer.irp.f | 8 +- src/cipsi/stochastic_cipsi.irp.f | 2 + src/density_for_dft/EZFIO.cfg | 7 + src/density_for_dft/density_for_dft.irp.f | 26 + src/determinants/ref_bitmask.irp.f | 29 + src/determinants/s2.irp.f | 2 +- src/dft_one_e/NEED | 2 +- src/dft_one_e/README.rst | 2 - src/dft_one_e/e_xc_general.irp.f | 111 +- src/dft_one_e/pot_general.irp.f | 415 +- src/dft_utils_one_e/e_xc.irp.f | 86 - src/dft_utils_one_e/exc_sr_pbe.irp.f | 20 +- src/dft_utils_one_e/pot_ao_lda.irp.f | 83 - src/dft_utils_one_e/pot_ao_lda_smashed.irp.f | 53 - src/dft_utils_one_e/pot_ao_pbe.irp.f | 191 - src/dft_utils_one_e/pot_ao_pbe_smashed.irp.f | 147 - src/dft_utils_one_e/sr_exc.irp.f | 32 +- src/dft_utils_one_e/sr_pot_ao_lda.irp.f | 79 - .../sr_pot_ao_lda_smashed.irp.f | 58 - src/dft_utils_one_e/sr_pot_ao_pbe.irp.f | 191 - .../sr_pot_ao_pbe_smashed.irp.f | 149 - src/dft_utils_one_e/utils.irp.f | 54 +- src/dummy/NEED | 1 + src/fci/fci.irp.f | 2 +- src/functionals/NEED | 1 + src/functionals/lda.irp.f | 196 + src/functionals/none.irp.f | 71 + src/functionals/pbe.irp.f | 447 + src/functionals/sr_lda.irp.f | 195 + src/functionals/sr_pbe.irp.f | 397 + src/kohn_sham_rs/61.rsks.bats | 8 +- src/kohn_sham_rs/rs_ks_energy.irp.f | 1 + src/kohn_sham_rs/rs_ks_scf.irp.f | 4 +- src/scf_utils/fock_matrix.irp.f | 48 +- src/scf_utils/scf_density_matrix_ao.irp.f | 6 +- src/tools/molden.irp.f | 221 +- src/tools/print_ci_vectors.irp.f | 35 + 154 files changed, 43991 insertions(+), 2068 deletions(-) mode change 100644 => 100755 REPLACE create mode 100644 docs/source/modules/ao_basis.rst create mode 100644 docs/source/modules/ao_one_e_ints.rst create mode 100644 docs/source/modules/ao_two_e_erf_ints.rst create mode 100644 docs/source/modules/ao_two_e_ints.rst create mode 100644 docs/source/modules/aux_quantities.rst create mode 100644 docs/source/modules/becke_numerical_grid.rst create mode 100644 docs/source/modules/bitmask.rst create mode 100644 docs/source/modules/cipsi.rst create mode 100644 docs/source/modules/cis.rst create mode 100644 docs/source/modules/cisd.rst create mode 100644 docs/source/modules/davidson.rst create mode 100644 docs/source/modules/davidson_dressed.rst create mode 100644 docs/source/modules/davidson_undressed.rst create mode 100644 docs/source/modules/density_for_dft.rst create mode 100644 docs/source/modules/determinants.rst create mode 100644 docs/source/modules/dft_keywords.rst create mode 100644 docs/source/modules/dft_one_e.rst create mode 100644 docs/source/modules/dft_utils_in_r.rst create mode 100644 docs/source/modules/dft_utils_one_e.rst create mode 100644 docs/source/modules/dressing.rst create mode 100644 docs/source/modules/electrons.rst create mode 100644 docs/source/modules/ezfio_files.rst create mode 100644 docs/source/modules/fci.rst create mode 100644 docs/source/modules/generators_cas.rst create mode 100644 docs/source/modules/generators_full.rst create mode 100644 docs/source/modules/hartree_fock.rst create mode 100644 docs/source/modules/iterations.rst create mode 100644 docs/source/modules/kohn_sham.rst create mode 100644 docs/source/modules/kohn_sham_rs.rst create mode 100644 docs/source/modules/mo_basis.rst create mode 100644 docs/source/modules/mo_guess.rst create mode 100644 docs/source/modules/mo_one_e_ints.rst create mode 100644 docs/source/modules/mo_two_e_erf_ints.rst create mode 100644 docs/source/modules/mo_two_e_ints.rst create mode 100644 docs/source/modules/mpi.rst create mode 100644 docs/source/modules/nuclei.rst create mode 100644 docs/source/modules/perturbation.rst create mode 100644 docs/source/modules/pseudo.rst create mode 100644 docs/source/modules/psiref_cas.rst create mode 100644 docs/source/modules/psiref_utils.rst create mode 100644 docs/source/modules/scf_utils.rst create mode 100644 docs/source/modules/selectors_cassd.rst create mode 100644 docs/source/modules/selectors_full.rst create mode 100644 docs/source/modules/selectors_utils.rst create mode 100644 docs/source/modules/single_ref_method.rst create mode 100644 docs/source/modules/tools.rst create mode 100644 docs/source/modules/utils.rst create mode 100644 docs/source/modules/zmq.rst create mode 100644 docs/source/programs/print_ci_vectors.rst rename docs/source/users_guide/{qp_create_ezfio_from_xyz.rst => qp_create_ezfio.rst} (100%) delete mode 100644 docs/source/work.rst delete mode 100644 man/qp_create_ezfio_from_xyz.1 create mode 100644 ocaml/c_bindings.c create mode 100644 plugins/local/.gitignore delete mode 100644 src/dft_utils_one_e/e_xc.irp.f delete mode 100644 src/dft_utils_one_e/pot_ao_lda.irp.f delete mode 100644 src/dft_utils_one_e/pot_ao_lda_smashed.irp.f delete mode 100644 src/dft_utils_one_e/pot_ao_pbe.irp.f delete mode 100644 src/dft_utils_one_e/pot_ao_pbe_smashed.irp.f delete mode 100644 src/dft_utils_one_e/sr_pot_ao_lda.irp.f delete mode 100644 src/dft_utils_one_e/sr_pot_ao_lda_smashed.irp.f delete mode 100644 src/dft_utils_one_e/sr_pot_ao_pbe.irp.f delete mode 100644 src/dft_utils_one_e/sr_pot_ao_pbe_smashed.irp.f create mode 100644 src/functionals/NEED create mode 100644 src/functionals/lda.irp.f create mode 100644 src/functionals/none.irp.f create mode 100644 src/functionals/pbe.irp.f create mode 100644 src/functionals/sr_lda.irp.f create mode 100644 src/functionals/sr_pbe.irp.f create mode 100644 src/tools/print_ci_vectors.irp.f diff --git a/GITHUB.md b/GITHUB.md index f0069c3c6..02836a37d 100644 --- a/GITHUB.md +++ b/GITHUB.md @@ -1,15 +1,22 @@ GitHub Branches =============== -master +master: The current up-to-date working branch, that users download It should only contain the latest release and bug fixes. -develop +develop-lcpq: + Toulouse development branch + +develop-lct: + Paris development branch + +develop: It is a fork of the *master* branch with new developments that will be - merged in the *master* branch for the next release. + merged in the *master* branch for the next release. Other development + branches should be merged on this one. -gh-pages +gh-pages: This is an independent branch, containing only the web site of QP2. diff --git a/README.md b/README.md index bbb146be0..63a45923f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -# Quantum Package +# Quantum Package 2.0 + + +*Quantum package 2.0: an open-source determinant-driven suite of programs*\ +Y. Garniron, K. Gasperich, T. Applencourt, A. Benali, A. Ferté, J. Paquier, B. Pradines, R. Assaraf, P. Reinhardt, J. Toulouse, P. Barbaresco, N. Renon, G. David, J. P. Malrieu, M. Véril, M. Caffarel, P. F. Loos, E. Giner and A. Scemama\ +https://arxiv.org/abs/1902.08154 -A programming environment for wave function methods ![QP](https://raw.githubusercontent.com/QuantumPackage/qp2/master/data/qp2.png) @@ -12,9 +16,10 @@ A programming environment for wave function methods # Build status -* Master: [![master build status](https://travis-ci.org/QuantumPackage/qp2.svg?branch=master)](https://travis-ci.org/QuantumPackage/qp2) -* Development branch : [![dev build status](https://travis-ci.org/QuantumPackage/qp2.svg?branch=develop)](https://travis-ci.org/QuantumPackage/qp2) -* Documentation [![Doc Status](https://quantum-package.readthedocs.io/en/latest/?badge=master) +* Master [![master build status](https://travis-ci.org/QuantumPackage/qp2.svg?branch=master)](https://travis-ci.org/QuantumPackage/qp2) +* Development [![dev build status](https://travis-ci.org/QuantumPackage/qp2.svg?branch=develop)](https://travis-ci.org/QuantumPackage/qp2) +* Documentation [![Documentation Status](https://readthedocs.org/projects/quantum-package/badge/?version=master)](https://quantum-package.readthedocs.io/en/master/?badge=master) + # Credits diff --git a/REPLACE b/REPLACE old mode 100644 new mode 100755 index 555616ac6..10a539589 --- a/REPLACE +++ b/REPLACE @@ -197,3 +197,640 @@ qp_name get_excitation_degree_vector_single_or_exchange_or_exchange -r get_excit qp_name get_excitation_degree_vector_mono_or_exchange_verbose -r get_excitation_degree_vector_single_or_exchange_verbose qp_name i_h_j_mono_spin -r i_h_j_single_spin qp_name i_Wee_j_mono -r i_Wee_j_single + +qp_name potential_sr_x_alpha_ao_lda --rename=potential_x_alpha_ao_sr_lda +qp_name potential_sr_x_beta_ao_lda --rename=potential_x_beta_ao_sr_lda +qp_name potential_sr_c_alpha_ao_lda --rename=potential_c_alpha_ao_sr_lda +qp_name potential_sr_c_beta_ao_lda --rename=potential_c_beta_ao_sr_lda +qp_name potential_sr_xc_alpha_ao_lda --rename=potential_xc_alpha_ao_sr_lda +qp_name potential_sr_xc_beta_ao_lda --rename=potential_xc_beta_ao_sr_lda + +qp_name potential_sr_x_alpha_ao_pbe --rename=potential_x_alpha_ao_sr_pbe +qp_name potential_sr_x_beta_ao_pbe --rename=potential_x_beta_ao_sr_pbe +qp_name potential_sr_c_alpha_ao_pbe --rename=potential_c_alpha_ao_sr_pbe +qp_name potential_sr_c_beta_ao_pbe --rename=potential_c_beta_ao_sr_pbe +qp_name potential_sr_xc_alpha_ao_pbe --rename=potential_xc_alpha_ao_sr_pbe +qp_name potential_sr_xc_beta_ao_pbe --rename=potential_xc_beta_ao_sr_pbe + + +qp_name mo_mono_elec_integral --rename=mo_mono_elec_integrals +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 --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 -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 -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_ +qp_name H_S2_u_0_bielec_nstates_openmp_work_ +qp_name H_S2_u_0_bielec_nstates_openmp_work_ -r H_S2_u_0_two_e_nstates_openmp_work_ +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 +qp_name data_one_body_alpha_dm_mo -r data_one_body_dm_alpha_mo +qp_name data_one_body_beta_dm_mo -r data_one_body_dm_beta_mo +qp_name one_body_dm_alpha_ao_for_dft -r one_e_dm_alpha_ao_for_dft +qp_name one_body_dm_alpha_at_r -r one_e_dm_alpha_at_r +qp_name one_body_dm_ao_alpha -r one_e_dm_ao_alpha +qp_name one_body_dm_ao_beta -r one_e_dm_ao_beta +qp_name one_body_dm_average_mo_for_dft -r one_e_dm_average_mo_for_dft +qp_name one_body_dm_beta_ao_for_dft -r one_e_dm_beta_ao_for_dft +qp_name one_body_dm_beta_at_r -r one_e_dm_beta_at_r +qp_name one_body_dm_dagger_mo_spin_index -r one_e_dm_dagger_mo_spin_index +qp_name one_body_dm_mo -r one_e_dm_mo +qp_name one_body_dm_mo_alpha -r one_e_dm_mo_alpha +qp_name one_body_dm_mo_alpha_average -r one_e_dm_mo_alpha_average +qp_name one_body_dm_mo_alpha_for_dft -r one_e_dm_mo_alpha_for_dft +qp_name one_body_dm_mo_beta -r one_e_dm_mo_beta +qp_name one_body_dm_mo_beta_average -r one_e_dm_mo_beta_average +qp_name one_body_dm_mo_beta_for_dft -r one_e_dm_mo_beta_for_dft +qp_name one_body_dm_mo_diff -r one_e_dm_mo_diff +qp_name one_body_dm_mo_for_dft -r one_e_dm_mo_for_dft +qp_name one_body_dm_mo_spin_index -r one_e_dm_mo_spin_index +qp_name one_body_grad_2_dm_alpha_at_r -r one_e_grad_2_dm_alpha_at_r +qp_name one_body_grad_2_dm_beta_at_r -r one_e_grad_2_dm_beta_at_r +qp_name one_body_spin_density_ao -r one_e_spin_density_ao +qp_name one_body_spin_density_mo -r one_e_spin_density_mo +qp_name one_electron_energy -r one_e_energy +qp_name one_dm_alpha_in_r -r one_e_dm_alpha_in_r +qp_name one_dm_and_grad_alpha_in_r -r one_e_dm_and_grad_alpha_in_r +qp_name one_dm_and_grad_beta_in_r -r one_e_dm_and_grad_beta_in_r +qp_name one_dm_beta_in_r -r one_e_dm_beta_in_r +qp_name ezfio_set_aux_quantities_data_one_body_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_alpha_dm_mo +qp_name ezfio_set_aux_quantities_data_one_body_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_beta_dm_mo +qp_name data_one_body_dm_alpha_mo -r data_one_e_dm_alpha_mo +qp_name data_one_body_dm_beta_mo -r data_one_e_dm_beta_mo +qp_name save_one_body_dm -r save_one_e_dm +qp_name ezfio_set_aux_quantities_data_one_e_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_alpha_mo +qp_name ezfio_set_aux_quantities_data_one_e_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_beta_mo +qp_name two_electron_energy -r two_e_energy +qp_name do_mono_excitation -r do_single_excitation +qp_name get_mono_excitation -r get_single_excitation +qp_name get_mono_excitation_from_fock -r get_single_excitation_from_fock +qp_name is_connected_to_by_mono -r is_connected_to_by_single +qp_name connected_to_ref_by_mono -r connected_to_ref_by_single +qp_name mono_excitation_wee -r single_excitation_wee +qp_name get_mono_excitation_spin +qp_name get_mono_excitation_spin -r get_single_excitation_spin +qp_name get_excitation_degree_vector_mono -r get_excitation_degree_vector_single +qp_name get_excitation_degree_vector_mono_or_exchange -r get_excitation_degree_vector_single_or_exchange_or_exchange +qp_name get_excitation_degree_vector_single_or_exchange_or_exchange -r get_excitation_degree_vector_single_or_exchange +qp_name get_excitation_degree_vector_mono_or_exchange_verbose -r get_excitation_degree_vector_single_or_exchange_verbose +qp_name i_h_j_mono_spin -r i_h_j_single_spin +qp_name i_Wee_j_mono -r i_Wee_j_single +qp_name potential_sr_x_alpha_ao_lda --rename=potential_x_alpha_ao_sr_lda +qp_name potential_sr_x_beta_ao_lda --rename=potential_x_beta_ao_sr_lda +qp_name potential_sr_c_alpha_ao_lda --rename=potential_c_alpha_ao_sr_lda +qp_name potential_sr_c_beta_ao_lda --rename=potential_c_beta_ao_sr_lda +qp_name potential_sr_xc_alpha_ao_lda --rename=potential_xc_alpha_ao_sr_lda +qp_name potential_sr_xc_beta_ao_lda --rename=potential_xc_beta_ao_sr_lda +qp_name potential_sr_x_alpha_ao_pbe --rename=potential_x_alpha_ao_sr_pbe +qp_name potential_sr_x_beta_ao_pbe --rename=potential_x_beta_ao_sr_pbe +qp_name potential_sr_c_alpha_ao_pbe --rename=potential_c_alpha_ao_sr_pbe +qp_name potential_sr_c_beta_ao_pbe --rename=potential_c_beta_ao_sr_pbe +qp_name potential_sr_xc_alpha_ao_pbe --rename=potential_xc_alpha_ao_sr_pbe +qp_name potential_sr_xc_beta_ao_pbe --rename=potential_xc_beta_ao_sr_pbe +qp_name mo_mono_elec_integral --rename=mo_mono_elec_integrals +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 --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 -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 -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_ +qp_name H_S2_u_0_bielec_nstates_openmp_work_ +qp_name H_S2_u_0_bielec_nstates_openmp_work_ -r H_S2_u_0_two_e_nstates_openmp_work_ +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 +qp_name data_one_body_alpha_dm_mo -r data_one_body_dm_alpha_mo +qp_name data_one_body_beta_dm_mo -r data_one_body_dm_beta_mo +qp_name one_body_dm_alpha_ao_for_dft -r one_e_dm_alpha_ao_for_dft +qp_name one_body_dm_alpha_at_r -r one_e_dm_alpha_at_r +qp_name one_body_dm_ao_alpha -r one_e_dm_ao_alpha +qp_name one_body_dm_ao_beta -r one_e_dm_ao_beta +qp_name one_body_dm_average_mo_for_dft -r one_e_dm_average_mo_for_dft +qp_name one_body_dm_beta_ao_for_dft -r one_e_dm_beta_ao_for_dft +qp_name one_body_dm_beta_at_r -r one_e_dm_beta_at_r +qp_name one_body_dm_dagger_mo_spin_index -r one_e_dm_dagger_mo_spin_index +qp_name one_body_dm_mo -r one_e_dm_mo +qp_name one_body_dm_mo_alpha -r one_e_dm_mo_alpha +qp_name one_body_dm_mo_alpha_average -r one_e_dm_mo_alpha_average +qp_name one_body_dm_mo_alpha_for_dft -r one_e_dm_mo_alpha_for_dft +qp_name one_body_dm_mo_beta -r one_e_dm_mo_beta +qp_name one_body_dm_mo_beta_average -r one_e_dm_mo_beta_average +qp_name one_body_dm_mo_beta_for_dft -r one_e_dm_mo_beta_for_dft +qp_name one_body_dm_mo_diff -r one_e_dm_mo_diff +qp_name one_body_dm_mo_for_dft -r one_e_dm_mo_for_dft +qp_name one_body_dm_mo_spin_index -r one_e_dm_mo_spin_index +qp_name one_body_grad_2_dm_alpha_at_r -r one_e_grad_2_dm_alpha_at_r +qp_name one_body_grad_2_dm_beta_at_r -r one_e_grad_2_dm_beta_at_r +qp_name one_body_spin_density_ao -r one_e_spin_density_ao +qp_name one_body_spin_density_mo -r one_e_spin_density_mo +qp_name one_electron_energy -r one_e_energy +qp_name one_dm_alpha_in_r -r one_e_dm_alpha_in_r +qp_name one_dm_and_grad_alpha_in_r -r one_e_dm_and_grad_alpha_in_r +qp_name one_dm_and_grad_beta_in_r -r one_e_dm_and_grad_beta_in_r +qp_name one_dm_beta_in_r -r one_e_dm_beta_in_r +qp_name ezfio_set_aux_quantities_data_one_body_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_alpha_dm_mo +qp_name ezfio_set_aux_quantities_data_one_body_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_beta_dm_mo +qp_name data_one_body_dm_alpha_mo -r data_one_e_dm_alpha_mo +qp_name data_one_body_dm_beta_mo -r data_one_e_dm_beta_mo +qp_name save_one_body_dm -r save_one_e_dm +qp_name ezfio_set_aux_quantities_data_one_e_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_alpha_mo +qp_name ezfio_set_aux_quantities_data_one_e_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_beta_mo +qp_name two_electron_energy -r two_e_energy +qp_name do_mono_excitation -r do_single_excitation +qp_name get_mono_excitation -r get_single_excitation +qp_name get_mono_excitation_from_fock -r get_single_excitation_from_fock +qp_name is_connected_to_by_mono -r is_connected_to_by_single +qp_name connected_to_ref_by_mono -r connected_to_ref_by_single +qp_name mono_excitation_wee -r single_excitation_wee +qp_name get_mono_excitation_spin +qp_name get_mono_excitation_spin -r get_single_excitation_spin +qp_name get_excitation_degree_vector_mono -r get_excitation_degree_vector_single +qp_name get_excitation_degree_vector_mono_or_exchange -r get_excitation_degree_vector_single_or_exchange_or_exchange +qp_name get_excitation_degree_vector_single_or_exchange_or_exchange -r get_excitation_degree_vector_single_or_exchange +qp_name get_excitation_degree_vector_mono_or_exchange_verbose -r get_excitation_degree_vector_single_or_exchange_verbose +qp_name i_h_j_mono_spin -r i_h_j_single_spin +qp_name i_Wee_j_mono -r i_Wee_j_single +qp_name potential_sr_x_alpha_ao_lda --rename=potential_x_alpha_ao_sr_lda +qp_name potential_sr_x_beta_ao_lda --rename=potential_x_beta_ao_sr_lda +qp_name potential_sr_c_alpha_ao_lda --rename=potential_c_alpha_ao_sr_lda +qp_name potential_sr_c_beta_ao_lda --rename=potential_c_beta_ao_sr_lda +qp_name potential_sr_xc_alpha_ao_lda --rename=potential_xc_alpha_ao_sr_lda +qp_name potential_sr_xc_beta_ao_lda --rename=potential_xc_beta_ao_sr_lda +qp_name potential_sr_x_alpha_ao_pbe --rename=potential_x_alpha_ao_sr_pbe +qp_name potential_sr_x_beta_ao_pbe --rename=potential_x_beta_ao_sr_pbe +qp_name potential_sr_c_alpha_ao_pbe --rename=potential_c_alpha_ao_sr_pbe +qp_name potential_sr_c_beta_ao_pbe --rename=potential_c_beta_ao_sr_pbe +qp_name potential_sr_xc_alpha_ao_pbe --rename=potential_xc_alpha_ao_sr_pbe +qp_name potential_sr_xc_beta_ao_pbe --rename=potential_xc_beta_ao_sr_pbe +qp_name mo_mono_elec_integral --rename=mo_mono_elec_integrals +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 --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 -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 -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_ +qp_name H_S2_u_0_bielec_nstates_openmp_work_ +qp_name H_S2_u_0_bielec_nstates_openmp_work_ -r H_S2_u_0_two_e_nstates_openmp_work_ +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 +qp_name data_one_body_alpha_dm_mo -r data_one_body_dm_alpha_mo +qp_name data_one_body_beta_dm_mo -r data_one_body_dm_beta_mo +qp_name one_body_dm_alpha_ao_for_dft -r one_e_dm_alpha_ao_for_dft +qp_name one_body_dm_alpha_at_r -r one_e_dm_alpha_at_r +qp_name one_body_dm_ao_alpha -r one_e_dm_ao_alpha +qp_name one_body_dm_ao_beta -r one_e_dm_ao_beta +qp_name one_body_dm_average_mo_for_dft -r one_e_dm_average_mo_for_dft +qp_name one_body_dm_beta_ao_for_dft -r one_e_dm_beta_ao_for_dft +qp_name one_body_dm_beta_at_r -r one_e_dm_beta_at_r +qp_name one_body_dm_dagger_mo_spin_index -r one_e_dm_dagger_mo_spin_index +qp_name one_body_dm_mo -r one_e_dm_mo +qp_name one_body_dm_mo_alpha -r one_e_dm_mo_alpha +qp_name one_body_dm_mo_alpha_average -r one_e_dm_mo_alpha_average +qp_name one_body_dm_mo_alpha_for_dft -r one_e_dm_mo_alpha_for_dft +qp_name one_body_dm_mo_beta -r one_e_dm_mo_beta +qp_name one_body_dm_mo_beta_average -r one_e_dm_mo_beta_average +qp_name one_body_dm_mo_beta_for_dft -r one_e_dm_mo_beta_for_dft +qp_name one_body_dm_mo_diff -r one_e_dm_mo_diff +qp_name one_body_dm_mo_for_dft -r one_e_dm_mo_for_dft +qp_name one_body_dm_mo_spin_index -r one_e_dm_mo_spin_index +qp_name one_body_grad_2_dm_alpha_at_r -r one_e_grad_2_dm_alpha_at_r +qp_name one_body_grad_2_dm_beta_at_r -r one_e_grad_2_dm_beta_at_r +qp_name one_body_spin_density_ao -r one_e_spin_density_ao +qp_name one_body_spin_density_mo -r one_e_spin_density_mo +qp_name one_electron_energy -r one_e_energy +qp_name one_dm_alpha_in_r -r one_e_dm_alpha_in_r +qp_name one_dm_and_grad_alpha_in_r -r one_e_dm_and_grad_alpha_in_r +qp_name one_dm_and_grad_beta_in_r -r one_e_dm_and_grad_beta_in_r +qp_name one_dm_beta_in_r -r one_e_dm_beta_in_r +qp_name ezfio_set_aux_quantities_data_one_body_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_alpha_dm_mo +qp_name ezfio_set_aux_quantities_data_one_body_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_beta_dm_mo +qp_name data_one_body_dm_alpha_mo -r data_one_e_dm_alpha_mo +qp_name data_one_body_dm_beta_mo -r data_one_e_dm_beta_mo +qp_name save_one_body_dm -r save_one_e_dm +qp_name ezfio_set_aux_quantities_data_one_e_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_alpha_mo +qp_name ezfio_set_aux_quantities_data_one_e_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_beta_mo +qp_name two_electron_energy -r two_e_energy +qp_name do_mono_excitation -r do_single_excitation +qp_name get_mono_excitation -r get_single_excitation +qp_name get_mono_excitation_from_fock -r get_single_excitation_from_fock +qp_name is_connected_to_by_mono -r is_connected_to_by_single +qp_name connected_to_ref_by_mono -r connected_to_ref_by_single +qp_name mono_excitation_wee -r single_excitation_wee +qp_name get_mono_excitation_spin +qp_name get_mono_excitation_spin -r get_single_excitation_spin +qp_name get_excitation_degree_vector_mono -r get_excitation_degree_vector_single +qp_name get_excitation_degree_vector_mono_or_exchange -r get_excitation_degree_vector_single_or_exchange_or_exchange +qp_name get_excitation_degree_vector_single_or_exchange_or_exchange -r get_excitation_degree_vector_single_or_exchange +qp_name get_excitation_degree_vector_mono_or_exchange_verbose -r get_excitation_degree_vector_single_or_exchange_verbose +qp_name i_h_j_mono_spin -r i_h_j_single_spin +qp_name i_Wee_j_mono -r i_Wee_j_single +qp_name potential_sr_x_alpha_ao_lda --rename=potential_x_alpha_ao_sr_lda +qp_name potential_sr_x_beta_ao_lda --rename=potential_x_beta_ao_sr_lda +qp_name potential_sr_c_alpha_ao_lda --rename=potential_c_alpha_ao_sr_lda +qp_name potential_sr_c_beta_ao_lda --rename=potential_c_beta_ao_sr_lda +qp_name potential_sr_xc_alpha_ao_lda --rename=potential_xc_alpha_ao_sr_lda +qp_name potential_sr_xc_beta_ao_lda --rename=potential_xc_beta_ao_sr_lda +qp_name potential_sr_x_alpha_ao_pbe --rename=potential_x_alpha_ao_sr_pbe +qp_name potential_sr_x_beta_ao_pbe --rename=potential_x_beta_ao_sr_pbe +qp_name potential_sr_c_alpha_ao_pbe --rename=potential_c_alpha_ao_sr_pbe +qp_name potential_sr_c_beta_ao_pbe --rename=potential_c_beta_ao_sr_pbe +qp_name potential_sr_xc_alpha_ao_pbe --rename=potential_xc_alpha_ao_sr_pbe +qp_name potential_sr_xc_beta_ao_pbe --rename=potential_xc_beta_ao_sr_pbe diff --git a/TODO b/TODO index 7774e5f71..734ed0839 100644 --- a/TODO +++ b/TODO @@ -57,13 +57,22 @@ Doc: plugins et qp_plugins Ajouter les symetries dans devel +<<<<<<< HEAD +Compiler ezfio avec openmp # Parallelize i_H_psi +======= + +# Parallelize i_H_psi +<<<<<<< HEAD +======= +>>>>>>> minor_modifs IMPORTANT: Davidson Diagonalization ------------------------ Not enough memory: aborting in davidson_diag_hjj_sjj +>>>>>>> 94bacff2d093aa9b32c653ab59bcdb79d13f3264 diff --git a/bin/qp_plugins b/bin/qp_plugins index a032e3b08..1a591e530 100755 --- a/bin/qp_plugins +++ b/bin/qp_plugins @@ -116,9 +116,12 @@ def main(arguments): d_tmp[x] = y repo_of_plugin[y] = x.replace(QP_PLUGINS+'/','') l_repository = d_tmp.keys() - m_instance = ModuleHandler(l_repository) - l_plugins = [module for module in m_instance.l_module] - l_result = l_plugins + if l_repository == []: + l_result = [] + else: + m_instance = ModuleHandler(l_repository) + l_plugins = [module for module in m_instance.l_module] + l_result = l_plugins if arguments["--installed"] or arguments["--uninstalled"]: # Search in src all symbolic links that are modules diff --git a/bin/qp_set_frozen_core b/bin/qp_set_frozen_core index ac5eab455..88e942302 100755 --- a/bin/qp_set_frozen_core +++ b/bin/qp_set_frozen_core @@ -52,8 +52,10 @@ def main(arguments): pass elif charge < 13: n_frozen += 1 - else: + elif charge < 31: n_frozen += 5 + else: + n_frozen += 9 mo_num = ezfio.mo_basis_mo_num diff --git a/config/gfortran_debug.cfg b/config/gfortran_debug.cfg index 6c23db111..0acb5fa58 100644 --- a/config/gfortran_debug.cfg +++ b/config/gfortran_debug.cfg @@ -51,7 +51,7 @@ FCFLAGS : -Ofast # -g : Extra debugging information # [DEBUG] -FCFLAGS : -g -msse4.2 -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant +FCFLAGS : -g -msse4.2 -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized # OpenMP flags ################# diff --git a/configure b/configure index f8c59957a..632c22982 100755 --- a/configure +++ b/configure @@ -9,12 +9,6 @@ eval set -- "$TEMP" export QP_ROOT="$( cd "$(dirname "$0")" ; pwd -P )" echo "QP_ROOT="$QP_ROOT -# Check if the module to create new DFT functionals exists or not -if [[ ! -d ${QP_ROOT}/src/new_functionals ]] ; then - cp -r ${QP_ROOT}/scripts/functionals/do_not_touch_func ${QP_ROOT}/src/new_functionals -fi - - function help() { diff --git a/docs/Makefile b/docs/Makefile index 054f8268c..7f886cbc2 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -18,9 +18,7 @@ auto: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile +%: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -clone: - git clone git@github.com:QuantumPackage/qp2.git --branch=documentation build diff --git a/docs/source/_static/links.rst b/docs/source/_static/links.rst index ab84e5ccc..63bda3523 100644 --- a/docs/source/_static/links.rst +++ b/docs/source/_static/links.rst @@ -38,7 +38,7 @@ .. |OPAM| replace:: `OPAM`_ .. |Python| replace:: `Python`_ .. |qp| replace:: *Quantum Package* -.. |QP| replace:: |qp| +.. |QP| replace:: *Quantum Package* .. |qpsh| replace:: *Quantum Package Shell* .. |QPSH| replace:: |qpsh| .. |resultsFile| replace:: `resultsFile`_ diff --git a/docs/source/appendix/contributors.rst b/docs/source/appendix/contributors.rst index 453560aa3..bf58adc29 100644 --- a/docs/source/appendix/contributors.rst +++ b/docs/source/appendix/contributors.rst @@ -25,19 +25,25 @@ Thomas Applencourt -The following people have contributed (by alphabetical order): +The following people have contributed to this project (by alphabetical order): +* Roland Assaraf +* Pierrette Barbaresco * Anouar Benali * Chandler Bennet * Michel Caffarel * Grégoire David +* Anthony Ferté * Madeline Galbraith * Yann Garniron * Kevin Gasperich * Pierre-François Loos +* Jean-Paul Malrieu * Barry Moore * Julien Paquier * Barthélémy Pradines +* Peter Reinhardt +* Nicolas Renon * Lorenzo Tenti * Julien Toulouse * Mikaël Véril diff --git a/docs/source/modules/.gitignore b/docs/source/modules/.gitignore index e69de29bb..8b1378917 100644 --- a/docs/source/modules/.gitignore +++ b/docs/source/modules/.gitignore @@ -0,0 +1 @@ + diff --git a/docs/source/modules/ao_basis.rst b/docs/source/modules/ao_basis.rst new file mode 100644 index 000000000..8612f0e92 --- /dev/null +++ b/docs/source/modules/ao_basis.rst @@ -0,0 +1,1238 @@ +.. _module_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 + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_coef_normalization_factor (ao_num) + + + Coefficients including the |AO| normalization + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef` + * :c:data:`ao_expo` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ao_prim_num_max` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalization_libint_factor` + * :c:data:`ao_coef_normalized_ordered` + + +.. c:var:: ao_coef_normalization_libint_factor + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_coef_normalization_libint_factor (ao_num) + + + |AO| normalization for interfacing with libint + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized` + * :c:data:`ao_expo` + * :c:data:`ao_l` + * :c:data:`ao_num` + * :c:data:`ao_prim_num` + + + +.. c:var:: ao_coef_normalized + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_coef_normalization_factor (ao_num) + + + Coefficients including the |AO| normalization + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef` + * :c:data:`ao_expo` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ao_prim_num_max` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalization_libint_factor` + * :c:data:`ao_coef_normalized_ordered` + + +.. c:var:: ao_coef_normalized_ordered + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + 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) + + + Sorted primitives to accelerate 4 index |MO| transformation + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized` + * :c:data:`ao_expo` + * :c:data:`ao_num` + * :c:data:`ao_prim_num` + * :c:data:`ao_prim_num_max` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + + +.. c:var:: ao_coef_normalized_ordered_transp + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_coef_normalized_ordered_transp (ao_prim_num_max,ao_num) + + + Transposed :c:data:`ao_coef_normalized_ordered` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered` + * :c:data:`ao_num` + * :c:data:`ao_prim_num_max` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_deriv2_x` + * :c:data:`ao_deriv_1_x` + * :c:data:`ao_dipole_x` + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_integrals_n_e_per_atom` + * :c:data:`ao_overlap` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_pseudo_integrals_local` + * :c:data:`ao_pseudo_integrals_non_local` + * :c:data:`ao_spread_x` + * :c:data:`ao_two_e_integral_alpha` + * :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:var:: ao_coef_normalized_ordered_transp_per_nucl + + + File : :file:`ao_basis/aos_transp.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_coef_normalized_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_prim_num_max` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + + +.. c:var:: ao_expo_ordered + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + 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) + + + Sorted primitives to accelerate 4 index |MO| transformation + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized` + * :c:data:`ao_expo` + * :c:data:`ao_num` + * :c:data:`ao_prim_num` + * :c:data:`ao_prim_num_max` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + + +.. c:var:: ao_expo_ordered_transp + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_expo_ordered_transp (ao_prim_num_max,ao_num) + + + Transposed :c:data:`ao_expo_ordered` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered` + * :c:data:`ao_num` + * :c:data:`ao_prim_num_max` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_deriv2_x` + * :c:data:`ao_deriv_1_x` + * :c:data:`ao_dipole_x` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_integrals_n_e_per_atom` + * :c:data:`ao_overlap` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_pseudo_integrals_local` + * :c:data:`ao_pseudo_integrals_non_local` + * :c:data:`ao_spread_x` + * :c:data:`ao_two_e_integral_alpha` + * :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:var:: ao_expo_ordered_transp_per_nucl + + + File : :file:`ao_basis/aos_transp.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_expo_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_prim_num_max` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + + +.. c:var:: ao_l + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`l_to_character` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + * :c:data:`ao_coef_normalization_libint_factor` + * :c:data:`ao_l_char_space` + * :c:data:`nucl_list_shell_aos` + + +.. c:var:: ao_l_char + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`l_to_character` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + * :c:data:`ao_coef_normalization_libint_factor` + * :c:data:`ao_l_char_space` + * :c:data:`nucl_list_shell_aos` + + +.. c:var:: ao_l_char_space + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + character*(4), allocatable :: ao_l_char_space (ao_num) + + + Converts an l value to a string + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_l` + * :c:data:`ao_num` + * :c:data:`ao_power` + + + +.. c:var:: ao_l_max + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`l_to_character` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + * :c:data:`ao_coef_normalization_libint_factor` + * :c:data:`ao_l_char_space` + * :c:data:`nucl_list_shell_aos` + + +.. c:var:: ao_power_ordered_transp_per_nucl + + + File : :file:`ao_basis/aos_transp.irp.f` + + .. code:: fortran + + integer, allocatable :: ao_power_ordered_transp_per_nucl (3,N_AOs_max,nucl_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_power` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + + +.. c:var:: ao_prim_num_max + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer :: ao_prim_num_max + + + Max number of primitives. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_prim_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef` + * :c:data:`ao_coef_normalized` + * :c:data:`ao_coef_normalized_ordered` + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_expo_ordered_transp_per_nucl` + + +.. c:var:: cart_to_sphe_0 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_0 (1,1) + + + Spherical -> Cartesian Transformation matrix for l=0 + + + +.. c:var:: cart_to_sphe_1 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_1 (3,3) + + + Spherical -> Cartesian Transformation matrix for l=1 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_2 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_2 (6,5) + + + Spherical -> Cartesian Transformation matrix for l=2 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_3 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_3 (10,7) + + + Spherical -> Cartesian Transformation matrix for l=3 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_4 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_4 (15,9) + + + Spherical -> Cartesian Transformation matrix for l=4 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_5 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_5 (21,11) + + + Spherical -> Cartesian Transformation matrix for l=5 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_6 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_6 (28,13) + + + Spherical -> Cartesian Transformation matrix for l=6 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_7 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_7 (36,15) + + + Spherical -> Cartesian Transformation matrix for l=7 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_8 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_8 (45,17) + + + Spherical -> Cartesian Transformation matrix for l=8 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: cart_to_sphe_9 + + + File : :file:`ao_basis/spherical_to_cartesian.irp.f` + + .. code:: fortran + + double precision, allocatable :: cart_to_sphe_9 (55,19) + + + Spherical -> Cartesian Transformation matrix for l=9 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + + +.. c:var:: l_to_character + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + character*(128), allocatable :: l_to_character (0:7) + + + Character corresponding to the "l" value of an |AO| + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_l` + + +.. c:var:: n_aos_max + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: nucl_n_aos (nucl_num) + integer :: n_aos_max + + + Number of |AOs| per atom + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`nucl_aos` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_list_shell_aos` + + +.. c:var:: n_pt_max_i_x + + + File : :file:`ao_basis/dimensions_integrals.irp.f` + + .. code:: fortran + + integer :: n_pt_max_integrals + integer :: n_pt_max_i_x + + + Number of points used in the numerical integrations. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_power` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_integrals_n_e_per_atom` + * :c:data:`ao_two_e_integral_alpha` + * :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:`gauleg_t2` + + +.. c:var:: n_pt_max_integrals + + + File : :file:`ao_basis/dimensions_integrals.irp.f` + + .. code:: fortran + + integer :: n_pt_max_integrals + integer :: n_pt_max_i_x + + + Number of points used in the numerical integrations. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_power` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_integrals_n_e_per_atom` + * :c:data:`ao_two_e_integral_alpha` + * :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:`gauleg_t2` + + +.. c:var:: nucl_aos + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: nucl_aos (nucl_num,N_AOs_max) + + + List of |AOs| centered on each atom + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_list_shell_aos` + + +.. c:var:: nucl_aos_transposed + + + File : :file:`ao_basis/aos_transp.irp.f` + + .. code:: fortran + + integer, allocatable :: nucl_aos_transposed (N_AOs_max,nucl_num) + + + List of AOs attached on each atom + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`nucl_aos` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_power_ordered_transp_per_nucl` + + +.. c:var:: nucl_list_shell_aos + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) + integer, allocatable :: nucl_num_shell_aos (nucl_num) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_l` + * :c:data:`ao_power` + * :c:data:`nucl_aos` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + + +.. c:var:: nucl_n_aos + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: nucl_n_aos (nucl_num) + integer :: n_aos_max + + + Number of |AOs| per atom + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`nucl_aos` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_list_shell_aos` + + +.. c:var:: nucl_num_shell_aos + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) + integer, allocatable :: nucl_num_shell_aos (nucl_num) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_l` + * :c:data:`ao_power` + * :c:data:`nucl_aos` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + + + +Subroutines / functions +----------------------- + +.. c:function:: ao_power_index: + + + File : :file:`ao_basis/aos.irp.f` + + .. code:: fortran + + integer function ao_power_index(nx,ny,nz) + + + 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: + + + File : :file:`ao_basis/aos_in_r.irp.f` + + .. code:: fortran + + double precision function ao_value(i,r) + + + Returns the value of the i-th ao at point $\textbf{r}$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_power` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_nucl` + * :c:data:`nucl_coord` + + +.. c:function:: give_all_aos_and_grad_and_lapl_at_r: + + + File : :file:`ao_basis/aos_in_r.irp.f` + + .. code:: fortran + + subroutine give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array) + + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z + + output : + + * aos_array(i) = ao(i) evaluated at $\textbf{r}$ + * aos_grad_array(1,i) = $\nabla_x$ of the ao(i) evaluated at $\textbf{r}$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`nucl_n_aos` + * :c:data:`ao_num` + * :c:data:`ao_prim_num` + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`give_all_mos_and_grad_and_lapl_at_r` + + +.. c:function:: give_all_aos_and_grad_at_r: + + + File : :file:`ao_basis/aos_in_r.irp.f` + + .. code:: fortran + + subroutine give_all_aos_and_grad_at_r(r,aos_array,aos_grad_array) + + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z + + output : + + * aos_array(i) = ao(i) evaluated at ro + * aos_grad_array(1,i) = gradient X of the ao(i) evaluated at $\textbf{r}$ + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`nucl_n_aos` + * :c:data:`ao_num` + * :c:data:`ao_prim_num` + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`give_all_mos_and_grad_at_r` + + +.. c:function:: give_all_aos_at_r: + + + File : :file:`ao_basis/aos_in_r.irp.f` + + .. code:: fortran + + subroutine give_all_aos_at_r(r,aos_array) + + + input : r == r(1) = x and so on + + output : aos_array(i) = aos(i) evaluated in $\textbf{r}$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`nucl_n_aos` + * :c:data:`ao_num` + * :c:data:`ao_prim_num` + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`give_all_mos_at_r` + + +.. c:function:: primitive_value: + + + File : :file:`ao_basis/aos_in_r.irp.f` + + .. code:: fortran + + double precision function primitive_value(i,j,r) + + + Returns the value of the j-th primitive of the i-th |AO| at point $\textbf{r} + **without the coefficient** + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`nucl_coord` + * :c:data:`ao_power` + 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 000000000..ae8bda046 --- /dev/null +++ b/docs/source/modules/ao_one_e_ints.rst @@ -0,0 +1,2028 @@ +.. _module_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 + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) + integer :: ao_cart_to_sphe_num + + + Coefficients to go from cartesian to spherical coordinates in the current + basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_l` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`cart_to_sphe_1` + * :c:data:`cart_to_sphe_2` + * :c:data:`cart_to_sphe_3` + * :c:data:`cart_to_sphe_4` + * :c:data:`cart_to_sphe_5` + * :c:data:`cart_to_sphe_6` + * :c:data:`cart_to_sphe_7` + * :c:data:`cart_to_sphe_8` + * :c:data:`cart_to_sphe_9` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_inv` + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_ortho_canonical_coef` + + +.. c:var:: ao_cart_to_sphe_inv + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_cart_to_sphe_inv (ao_cart_to_sphe_num,ao_num) + + + Inverse of :c:data:`ao_cart_to_sphe_coef` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + * :c:data:`ao_num` + + + +.. c:var:: ao_cart_to_sphe_num + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) + integer :: ao_cart_to_sphe_num + + + Coefficients to go from cartesian to spherical coordinates in the current + basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_l` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`cart_to_sphe_1` + * :c:data:`cart_to_sphe_2` + * :c:data:`cart_to_sphe_3` + * :c:data:`cart_to_sphe_4` + * :c:data:`cart_to_sphe_5` + * :c:data:`cart_to_sphe_6` + * :c:data:`cart_to_sphe_7` + * :c:data:`cart_to_sphe_8` + * :c:data:`cart_to_sphe_9` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_inv` + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_ortho_canonical_coef` + + +.. c:var:: ao_cart_to_sphe_overlap + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_cart_to_sphe_overlap (ao_cart_to_sphe_num,ao_cart_to_sphe_num) + + + |AO| overlap matrix in the spherical basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + * :c:data:`ao_num` + * :c:data:`ao_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_canonical_coef` + + +.. c:var:: ao_deriv2_x + + + File : :file:`ao_one_e_ints/kin_ao_ints.irp.f` + + .. code:: fortran + + 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) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_kinetic_integrals` + + +.. c:var:: ao_deriv2_y + + + File : :file:`ao_one_e_ints/kin_ao_ints.irp.f` + + .. code:: fortran + + 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) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_kinetic_integrals` + + +.. c:var:: ao_deriv2_z + + + File : :file:`ao_one_e_ints/kin_ao_ints.irp.f` + + .. code:: fortran + + 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) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_kinetic_integrals` + + +.. c:var:: ao_deriv_1_x + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + + +.. c:var:: ao_deriv_1_y + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + + +.. c:var:: ao_deriv_1_z + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + + +.. c:var:: ao_dipole_x + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_dipole_x` + + +.. c:var:: ao_dipole_y + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_dipole_x` + + +.. c:var:: ao_dipole_z + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_dipole_x` + + +.. c:var:: ao_integrals_n_e + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_integrals_n_e (ao_num,ao_num) + + + Nucleus-electron interaction, in the |AO| basis set. + + :math:`\langle \chi_i | -\sum_A \frac{1}{|r-R_A|} | \chi_j \rangle` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`n_pt_max_integrals` + * :c:data:`nucl_charge` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + * :c:data:`read_ao_integrals_e_n` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_ortho_canonical_nucl_elec_integrals` + * :c:data:`ao_ortho_lowdin_nucl_elec_integrals` + * :c:data:`mo_integrals_n_e` + + +.. c:var:: ao_integrals_n_e_per_atom + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_integrals_n_e_per_atom (ao_num,ao_num,nucl_num) + + + Nucleus-electron interaction in the |AO| basis set, per atom A. + + :math:`\langle \chi_i | -\frac{1}{|r-R_A|} | \chi_j \rangle` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`n_pt_max_integrals` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_n_e_per_atom` + + +.. c:var:: ao_kinetic_integrals + + + File : :file:`ao_one_e_ints/kin_ao_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_kinetic_integrals (ao_num,ao_num) + + + Kinetic energy integrals in the |AO| basis. + + :math:`\langle \chi_i |\hat{T}| \chi_j \rangle` + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_deriv2_x` + * :c:data:`ao_num` + * :c:data:`read_ao_integrals_kinetic` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_one_e_integrals` + * :c:data:`mo_kinetic_integrals` + + +.. c:var:: ao_one_e_integrals + + + File : :file:`ao_one_e_ints/ao_one_e_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) + double precision, allocatable :: ao_one_e_integrals_diag (ao_num) + + + One-electron Hamiltonian in the |AO| basis. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_kinetic_integrals` + * :c:data:`ao_num` + * :c:data:`ao_pseudo_integrals` + * :c:data:`do_pseudo` + * :c:data:`read_ao_one_e_integrals` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`hf_energy` + * :c:data:`scf_energy` + + +.. c:var:: ao_one_e_integrals_diag + + + File : :file:`ao_one_e_ints/ao_one_e_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) + double precision, allocatable :: ao_one_e_integrals_diag (ao_num) + + + One-electron Hamiltonian in the |AO| basis. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_kinetic_integrals` + * :c:data:`ao_num` + * :c:data:`ao_pseudo_integrals` + * :c:data:`do_pseudo` + * :c:data:`read_ao_one_e_integrals` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`hf_energy` + * :c:data:`scf_energy` + + +.. c:var:: ao_ortho_canonical_coef + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) + integer :: ao_ortho_canonical_num + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_cartesian` + * :c:data:`ao_num` + * :c:data:`ao_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_canonical_coef_inv` + * :c:data:`ao_ortho_canonical_nucl_elec_integrals` + * :c:data:`ao_ortho_canonical_overlap` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + +.. c:var:: ao_ortho_canonical_coef_inv + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_canonical_coef_inv (ao_num,ao_num) + + + ao_ortho_canonical_coef^(-1) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_ortho_canonical_coef` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef_in_ao_ortho_basis` + + +.. c:var:: ao_ortho_canonical_num + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) + integer :: ao_ortho_canonical_num + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_coef` + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_cartesian` + * :c:data:`ao_num` + * :c:data:`ao_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_canonical_coef_inv` + * :c:data:`ao_ortho_canonical_nucl_elec_integrals` + * :c:data:`ao_ortho_canonical_overlap` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + +.. c:var:: ao_ortho_canonical_overlap + + + File : :file:`ao_one_e_ints/ao_ortho_canonical.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_canonical_overlap (ao_ortho_canonical_num,ao_ortho_canonical_num) + + + overlap matrix of the ao_ortho_canonical. + Expected to be the Identity + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`ao_overlap` + + + +.. c:var:: ao_overlap + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + 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) + + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + * :c:data:`read_ao_integrals_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`ao_ortho_canonical_overlap` + * :c:data:`ao_ortho_lowdin_coef` + * :c:data:`ao_ortho_lowdin_overlap` + * :c:data:`fps_spf_matrix_ao` + * :c:data:`mo_overlap` + * :c:data:`s_half` + * :c:data:`s_half_inv` + * :c:data:`s_inv` + * :c:data:`s_mo_coef` + + +.. c:var:: ao_overlap_abs + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_overlap_abs (ao_num,ao_num) + + + Overlap between absolute values of atomic basis functions: + + :math:`\int |\chi_i(r)| |\chi_j(r)| dr` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`mo_two_e_int_erf_jj_from_ao` + * :c:data:`mo_two_e_integral_jj_from_ao` + * :c:data:`mo_two_e_integrals_vv_from_ao` + + +.. c:var:: ao_overlap_x + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + 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) + + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + * :c:data:`read_ao_integrals_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`ao_ortho_canonical_overlap` + * :c:data:`ao_ortho_lowdin_coef` + * :c:data:`ao_ortho_lowdin_overlap` + * :c:data:`fps_spf_matrix_ao` + * :c:data:`mo_overlap` + * :c:data:`s_half` + * :c:data:`s_half_inv` + * :c:data:`s_inv` + * :c:data:`s_mo_coef` + + +.. c:var:: ao_overlap_y + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + 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) + + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + * :c:data:`read_ao_integrals_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`ao_ortho_canonical_overlap` + * :c:data:`ao_ortho_lowdin_coef` + * :c:data:`ao_ortho_lowdin_overlap` + * :c:data:`fps_spf_matrix_ao` + * :c:data:`mo_overlap` + * :c:data:`s_half` + * :c:data:`s_half_inv` + * :c:data:`s_inv` + * :c:data:`s_mo_coef` + + +.. c:var:: ao_overlap_z + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + 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) + + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + * :c:data:`read_ao_integrals_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cart_to_sphe_overlap` + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`ao_ortho_canonical_overlap` + * :c:data:`ao_ortho_lowdin_coef` + * :c:data:`ao_ortho_lowdin_overlap` + * :c:data:`fps_spf_matrix_ao` + * :c:data:`mo_overlap` + * :c:data:`s_half` + * :c:data:`s_half_inv` + * :c:data:`s_inv` + * :c:data:`s_mo_coef` + + +.. c:var:: ao_pseudo_integrals + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_pseudo_integrals (ao_num,ao_num) + + + Pseudo-potential integrals in the |AO| basis set. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_pseudo_integrals_local` + * :c:data:`ao_pseudo_integrals_non_local` + * :c:data:`do_pseudo` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_kmax` + * :c:data:`read_ao_integrals_pseudo` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_one_e_integrals` + * :c:data:`mo_pseudo_integrals` + + +.. c:var:: ao_pseudo_integrals_local + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_pseudo_integrals_local (ao_num,ao_num) + + + Local pseudo-potential + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_charge` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_v_k_transp` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals` + + +.. c:var:: ao_pseudo_integrals_non_local + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_pseudo_integrals_non_local (ao_num,ao_num) + + + Non-local pseudo-potential + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_charge` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_v_kl_transp` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals` + + +.. c:var:: ao_spread_x + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_spread_x` + + +.. c:var:: ao_spread_y + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_spread_x` + + +.. c:var:: ao_spread_z + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + 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) + + + * 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_spread_x` + + +.. c:function:: give_polynomial_mult_center_one_e_erf: + + + File : :file:`ao_one_e_ints/pot_ao_erf_ints.irp.f` + + .. code:: fortran + + 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) + + + Returns the explicit polynomial in terms of the $t$ variable of the + following polynomial: + + $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)$. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_one_e` + * :c:func:`multiply_poly` + + +.. c:function:: give_polynomial_mult_center_one_e_erf_opt: + + + File : :file:`ao_one_e_ints/pot_ao_erf_ints.irp.f` + + .. code:: fortran + + 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) + + + Returns the explicit polynomial in terms of the $t$ variable of the + following polynomial: + + $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)$. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`nai_pol_mult_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_one_e` + * :c:func:`multiply_poly` + + +.. c:function:: i_x1_pol_mult_one_e: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + recursive subroutine I_x1_pol_mult_one_e(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) + + + Recursive routine involved in the electron-nucleus potential + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`give_polynomial_mult_center_one_e` + * :c:func:`give_polynomial_mult_center_one_e_erf` + * :c:func:`give_polynomial_mult_center_one_e_erf_opt` + * :c:func:`i_x1_pol_mult_one_e` + * :c:func:`i_x2_pol_mult_one_e` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_one_e` + * :c:func:`i_x2_pol_mult_one_e` + * :c:func:`multiply_poly` + + +.. c:function:: i_x2_pol_mult_one_e: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + recursive subroutine I_x2_pol_mult_one_e(c,R1x,R1xp,R2x,d,nd,dim) + + + Recursive routine involved in the electron-nucleus potential + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_one_e` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_one_e` + * :c:func:`multiply_poly` + + +.. c:var:: pseudo_dz_k_transp + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + 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) + + + Transposed arrays for pseudopotentials + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_v_k` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals_local` + + +.. c:var:: pseudo_dz_kl_transp + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + 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) + + + Transposed arrays for pseudopotentials + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_kl` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals_non_local` + + +.. c:var:: pseudo_n_k_transp + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + 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) + + + Transposed arrays for pseudopotentials + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_v_k` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals_local` + + +.. c:var:: pseudo_n_kl_transp + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + 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) + + + Transposed arrays for pseudopotentials + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_kl` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals_non_local` + + +.. c:var:: pseudo_v_k_transp + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + 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) + + + Transposed arrays for pseudopotentials + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_v_k` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals_local` + + +.. c:var:: pseudo_v_kl_transp + + + File : :file:`ao_one_e_ints/pot_ao_pseudo_ints.irp.f` + + .. code:: fortran + + 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) + + + Transposed arrays for pseudopotentials + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_kl` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_pseudo_integrals_non_local` + + +.. c:var:: s_half + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + double precision, allocatable :: s_half (ao_num,ao_num) + + + :math:`S^{1/2}` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_overlap` + + + +.. c:var:: s_half_inv + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + double precision, allocatable :: s_half_inv (AO_num,AO_num) + + + :math:`X = S^{-1/2}` obtained by SVD + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`eigenvalues_fock_matrix_ao` + + +.. c:var:: s_inv + + + File : :file:`ao_one_e_ints/ao_overlap.irp.f` + + .. code:: fortran + + double precision, allocatable :: s_inv (ao_num,ao_num) + + + Inverse of the overlap matrix + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_overlap` + + + + +Subroutines / functions +----------------------- + +.. c:function:: give_all_erf_kl_ao: + + + File : :file:`ao_one_e_ints/pot_ao_erf_ints.irp.f` + + .. code:: fortran + + subroutine give_all_erf_kl_ao(integrals_ao,mu_in,C_center) + + + Subroutine that returns all integrals over $r$ of type + $\frac{ \erf(\mu * | r - R_C | ) }{ | r - R_C | }$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + +.. c:function:: give_polynomial_mult_center_one_e: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + 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) + + + Returns the explicit polynomial in terms of the "t" variable of the following + + $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)$. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`nai_pol_mult` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_one_e` + * :c:func:`multiply_poly` + + +.. c:function:: int_gaus_pol: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision function int_gaus_pol(alpha,n) + + + Computes the integral: + + $\int_{-\infty}^{\infty} x^n \exp(-\alpha x^2) dx$. + + +.. c:function:: nai_pol_mult: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision function NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in) + + + Computes the electron-nucleus attraction with two primitves. + + :math:`\langle g_i | \frac{1}{|r-R_c|} | g_j \rangle` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_polynomial_mult_center_one_e` + + +.. c:function:: nai_pol_mult_erf: + + + File : :file:`ao_one_e_ints/pot_ao_erf_ints.irp.f` + + .. code:: fortran + + double precision function NAI_pol_mult_erf(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in,mu_in) + + + 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 | }$. + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_polynomial_mult_center_one_e_erf_opt` + + +.. c:function:: nai_pol_mult_erf_ao: + + + File : :file:`ao_one_e_ints/pot_ao_erf_ints.irp.f` + + .. code:: fortran + + double precision function NAI_pol_mult_erf_ao(i_ao,j_ao,mu_in,C_center) + + + Computes the following integral : + $\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) \frac{\erf(\mu | r - R_C | )}{ | r - R_C | }$. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_power` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_nucl` + * :c:data:`nucl_coord` + + +.. c:function:: overlap_bourrin_deriv_x: + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + subroutine overlap_bourrin_deriv_x(i_component,A_center,B_center,alpha,beta,power_A,power_B,dx,lower_exp_val,overlap_x,nx) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_deriv_1_x` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`overlap_bourrin_x` + + +.. c:function:: overlap_bourrin_dipole: + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + subroutine overlap_bourrin_dipole(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_dipole_x` + + +.. c:function:: overlap_bourrin_spread: + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + subroutine overlap_bourrin_spread(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + + 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 + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_spread_x` + + +.. c:function:: overlap_bourrin_x: + + + File : :file:`ao_one_e_ints/spread_dipole_ao.irp.f` + + .. code:: fortran + + subroutine overlap_bourrin_x(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`overlap_bourrin_deriv_x` + + +.. c:function:: v_e_n: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision function V_e_n(a_x,a_y,a_z,b_x,b_y,b_z,alpha,beta) + + + Primitve nuclear attraction between the two primitves centered on the same atom. + + $p_1 = x^{a_x} y^{a_y} z^{a_z} \exp(-\alpha r^2)$ + + $p_2 = x^{b_x} y^{b_y} z^{b_z} \exp(-\beta r^2)$ + + +.. c:function:: v_phi: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision function V_phi(n,m) + + + Computes the angular $\phi$ part of the nuclear attraction integral: + + $\int_{0}^{2 \pi} \cos(\phi)^n \sin(\phi)^m d\phi$. + + +.. c:function:: v_r: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision function V_r(n,alpha) + + + Computes the radial part of the nuclear attraction integral: + + $\int_{0}^{\infty} r^n \exp(-\alpha r^2) dr$ + + + +.. c:function:: v_theta: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision function V_theta(n,m) + + + Computes the angular $\theta$ part of the nuclear attraction integral: + + $\int_{0}^{\pi} \cos(\theta)^n \sin(\theta)^m d\theta$ + + +.. c:function:: wallis: + + + File : :file:`ao_one_e_ints/pot_ao_ints.irp.f` + + .. code:: fortran + + double precision function Wallis(n) + + + Wallis integral: + + $\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 000000000..7ee24a880 --- /dev/null +++ b/docs/source/modules/ao_two_e_erf_ints.rst @@ -0,0 +1,905 @@ +.. _module_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 + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_integrals_erf_cache (0:64*64*64*64) + + + Cache of |AO| integrals for fast access + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_cache_min` + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_two_e_integrals_erf_in_map` + + + +.. c:var:: ao_integrals_erf_cache_max + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + integer :: ao_integrals_erf_cache_min + integer :: ao_integrals_erf_cache_max + + + Min and max values of the AOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_cache` + + +.. c:var:: ao_integrals_erf_cache_min + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + integer :: ao_integrals_erf_cache_min + integer :: ao_integrals_erf_cache_max + + + Min and max values of the AOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_cache` + + +.. c:var:: ao_integrals_erf_map + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + type(map_type) :: ao_integrals_erf_map + + + |AO| integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_cache` + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_int_erf_jj_from_ao` + + +.. c:var:: ao_two_e_integral_erf_schwartz + + + File : :file:`ao_two_e_erf_ints/providers_ao_erf.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_two_e_integral_erf_schwartz (ao_num,ao_num) + + + Needed to compute Schwartz inequalities + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`n_pt_max_integrals` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_int_erf_jj_from_ao` + + +.. c:var:: ao_two_e_integrals_erf_in_map + + + File : :file:`ao_two_e_erf_ints/providers_ao_erf.irp.f` + + .. code:: fortran + + logical :: ao_two_e_integrals_erf_in_map + + + Map of Atomic integrals + i(r1) j(r2) 1/r12 k(r1) l(r2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ezfio_filename` + * :c:data:`io_ao_two_e_integrals_erf` + * :c:data:`n_pt_max_integrals` + * :c:data:`nproc` + * :c:data:`nucl_coord` + * :c:data:`read_ao_two_e_integrals_erf` + * :c:data:`zmq_context` + * :c:data:`zmq_socket_pull_tcp_address` + * :c:data:`zmq_state` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_cache` + * :c:data:`mo_two_e_int_erf_jj_from_ao` + * :c:data:`mo_two_e_integrals_erf_in_map` + + +.. c:function:: general_primitive_integral_erf: + + + File : :file:`ao_two_e_erf_ints/two_e_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + Computes the integral where p,q,r,s are Gaussian primitives + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mu_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`add_poly_multiply` + * :c:func:`give_polynom_mult_center_x` + * :c:func:`multiply_poly` + + + +Subroutines / functions +----------------------- + +.. c:function:: ao_two_e_integral_erf: + + + File : :file:`ao_two_e_erf_ints/two_e_integrals_erf.irp.f` + + .. code:: fortran + + double precision function ao_two_e_integral_erf(i,j,k,l) + + + integral of the AO basis or (ij|kl) + i(r1) j(r1) 1/r12 k(r2) l(r2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_power` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_nucl` + * :c:data:`nucl_coord` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_explicit_poly_and_gaussian` + + +.. c:function:: ao_two_e_integral_schwartz_accel_erf: + + + File : :file:`ao_two_e_erf_ints/two_e_integrals_erf.irp.f` + + .. code:: fortran + + double precision function ao_two_e_integral_schwartz_accel_erf(i,j,k,l) + + + integral of the AO basis or (ij|kl) + i(r1) j(r1) 1/r12 k(r2) l(r2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_power` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_nucl` + * :c:data:`nucl_coord` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_explicit_poly_and_gaussian` + + +.. c:function:: ao_two_e_integrals_erf_in_map_collector: + + + File : :file:`ao_two_e_erf_ints/integrals_erf_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_erf_in_map_collector(zmq_socket_pull) + + + Collects results from the AO integral calculation + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`insert_into_ao_integrals_erf_map` + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave: + + + File : :file:`ao_two_e_erf_ints/integrals_erf_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_erf_in_map_slave(thread,iproc) + + + Computes a buffer of integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_erf_in_map_slave_inproc` + * :c:func:`ao_two_e_integrals_erf_in_map_slave_tcp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`compute_ao_integrals_erf_jl` + * :c:func:`end_zmq_push_socket` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`push_integrals` + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave_inproc: + + + File : :file:`ao_two_e_erf_ints/integrals_erf_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_erf_in_map_slave_inproc(i) + + + Computes a buffer of integrals. i is the ID of the current thread. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_erf_in_map_slave` + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave_tcp: + + + File : :file:`ao_two_e_erf_ints/integrals_erf_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_erf_in_map_slave_tcp(i) + + + Computes a buffer of integrals. i is the ID of the current thread. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_erf_in_map_slave` + + +.. c:function:: clear_ao_erf_map: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine clear_ao_erf_map + + + Frees the memory of the |AO| map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_deinit` + + +.. c:function:: compute_ao_integrals_erf_jl: + + + File : :file:`ao_two_e_erf_ints/two_e_integrals_erf.irp.f` + + .. code:: fortran + + subroutine compute_ao_integrals_erf_jl(j,l,n_integrals,buffer_i,buffer_value) + + + Parallel client for AO integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_overlap_abs` + * :c:data:`ao_num` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_two_e_integral_erf_schwartz` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_erf_in_map_slave` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`two_e_integrals_index` + + +.. c:function:: compute_ao_two_e_integrals_erf: + + + File : :file:`ao_two_e_erf_ints/two_e_integrals_erf.irp.f` + + .. code:: fortran + + subroutine compute_ao_two_e_integrals_erf(j,k,l,sze,buffer_value) + + + Compute AO 1/r12 integrals for all i and fixed j,k,l + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_overlap_abs` + * :c:data:`ao_num` + * :c:data:`ao_two_e_integral_erf_schwartz` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_int_erf_jj_from_ao` + + +.. c:function:: dump_ao_integrals_erf: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine dump_ao_integrals_erf(filename) + + + Save to disk the |AO| erf integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_work_empty` + + +.. c:function:: eri_erf: + + + File : :file:`ao_two_e_erf_ints/two_e_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + Atomic primtive two-electron integral between the 4 primitives : + + * primitive 1 : $x_1^{a_x} y_1^{a_y} z_1^{a_z} \exp(-\alpha * r1^2)$ + * primitive 2 : $x_1^{b_x} y_1^{b_y} z_1^{b_z} \exp(- \beta * r1^2)$ + * primitive 3 : $x_2^{c_x} y_2^{c_y} z_2^{c_z} \exp(-\delta * r2^2)$ + * primitive 4 : $x_2^{d_x} y_2^{d_y} z_2^{d_z} \exp(-\gamma * r2^2)$ + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mu_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`integrale_new_erf` + + +.. c:function:: get_ao_erf_map_size: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + function get_ao_erf_map_size() + + + Returns the number of elements in the |AO| map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + + +.. c:function:: get_ao_two_e_integral_erf: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + double precision function get_ao_two_e_integral_erf(i,j,k,l,map) result(result) + + + Gets one |AO| two-electron integral from the |AO| map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_cache_min` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_integrals_erf_cache` + * :c:data:`ao_two_e_integral_erf_schwartz` + * :c:data:`ao_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_ao_two_e_integrals_erf: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine get_ao_two_e_integrals_erf(j,k,l,sze,out_val) + + + Gets multiple |AO| two-electron integral from the |AO| map . + All i are retrieved for j,k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_two_e_integrals_erf_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map_erf` + + +.. c:function:: get_ao_two_e_integrals_erf_non_zero: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine get_ao_two_e_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) + + + Gets multiple |AO| two-electron integrals from the |AO| map . + All non-zero i are retrieved for j,k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_two_e_integral_erf_schwartz` + * :c:data:`ao_two_e_integrals_erf_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_int_erf_jj_from_ao` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get` + * :c:func:`two_e_integrals_index` + + +.. c:function:: insert_into_ao_integrals_erf_map: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine insert_into_ao_integrals_erf_map(n_integrals,buffer_i, buffer_values) + + + Create new entry into |AO| map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_erf_in_map_collector` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_append` + + +.. c:function:: integrale_new_erf: + + + File : :file:`ao_two_e_erf_ints/two_e_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + Calculate the integral of the polynomial : + + $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)$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mu_erf` + * :c:data:`n_pt_max_integrals` + * :c:data:`gauleg_t2` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`eri_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_new` + + +.. c:function:: load_ao_integrals_erf: + + + File : :file:`ao_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + integer function load_ao_integrals_erf(filename) + + + Read from disk the |AO| erf integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`cache_map_reallocate` + * :c:func:`map_deinit` + * :c:func:`map_sort` + + +.. c:function:: save_erf_two_e_integrals_ao: + + + File : :file:`ao_two_e_erf_ints/routines_save_integrals_erf.irp.f` + + .. code:: fortran + + subroutine save_erf_two_e_integrals_ao + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ezfio_filename` + * :c:data:`ao_two_e_integrals_erf_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`routine` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf` + * :c:func:`ezfio_set_work_empty` + * :c:func:`map_save_to_disk` + + +.. c:function:: save_erf_two_e_ints_ao_into_ints_ao: + + + File : :file:`ao_two_e_erf_ints/routines_save_integrals_erf.irp.f` + + .. code:: fortran + + subroutine save_erf_two_e_ints_ao_into_ints_ao + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ezfio_filename` + * :c:data:`ao_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_ao_two_e_ints_io_ao_two_e_integrals` + * :c:func:`ezfio_set_work_empty` + * :c:func:`map_save_to_disk` + 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 000000000..3c833a90f --- /dev/null +++ b/docs/source/modules/ao_two_e_ints.rst @@ -0,0 +1,1285 @@ +.. _module_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 + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_integrals_cache (0:64*64*64*64) + + + Cache of AO integrals for fast access + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_cache_min` + * :c:data:`ao_integrals_map` + * :c:data:`ao_two_e_integrals_in_map` + + + +.. c:var:: ao_integrals_cache_max + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + integer :: ao_integrals_cache_min + integer :: ao_integrals_cache_max + + + Min and max values of the AOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_cache` + + +.. c:var:: ao_integrals_cache_min + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + integer :: ao_integrals_cache_min + integer :: ao_integrals_cache_max + + + Min and max values of the AOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_cache` + + +.. c:var:: ao_integrals_map + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + type(map_type) :: ao_integrals_map + + + AO integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_cache` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`mo_two_e_integral_jj_from_ao` + * :c:data:`mo_two_e_integrals_vv_from_ao` + + +.. c:var:: ao_two_e_integral_schwartz + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_two_e_integral_schwartz (ao_num,ao_num) + + + Needed to compute Schwartz inequalities + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`n_pt_max_integrals` + * :c:data:`nucl_coord` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`mo_two_e_integral_jj_from_ao` + * :c:data:`mo_two_e_integrals_vv_from_ao` + + +.. c:var:: ao_two_e_integrals_in_map + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + logical :: ao_two_e_integrals_in_map + + + Map of Atomic integrals + i(r1) j(r2) 1/r12 k(r1) l(r2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_integrals_map` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ezfio_filename` + * :c:data:`io_ao_two_e_integrals` + * :c:data:`mpi_master` + * :c:data:`n_pt_max_integrals` + * :c:data:`nproc` + * :c:data:`nucl_coord` + * :c:data:`read_ao_two_e_integrals` + * :c:data:`zmq_context` + * :c:data:`zmq_socket_pull_tcp_address` + * :c:data:`zmq_state` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_cache` + * :c:data:`ao_two_e_integral_alpha` + * :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_vv_from_ao` + + +.. c:var:: gauleg_t2 + + + File : :file:`ao_two_e_ints/gauss_legendre.irp.f` + + .. code:: fortran + + 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) + + + t_w(i,1,k) = w(i) + t_w(i,2,k) = t(i) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + + + +.. c:var:: gauleg_w + + + File : :file:`ao_two_e_ints/gauss_legendre.irp.f` + + .. code:: fortran + + 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) + + + t_w(i,1,k) = w(i) + t_w(i,2,k) = t(i) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + + + +.. c:function:: general_primitive_integral: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + 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) + + + Computes the integral where p,q,r,s are Gaussian primitives + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`add_poly_multiply` + * :c:func:`give_polynom_mult_center_x` + * :c:func:`multiply_poly` + + +.. c:function:: i_x1_new: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + recursive subroutine I_x1_new(a,c,B_10,B_01,B_00,res,n_pt) + + + recursive function involved in the two-electron integral + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_new` + * :c:func:`i_x2_new` + * :c:func:`integrale_new` + * :c:func:`integrale_new_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_new` + * :c:func:`i_x2_new` + + +.. c:function:: i_x1_pol_mult_a1: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + recursive subroutine I_x1_pol_mult_a1(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + + Recursive function involved in the two-electron integral + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult` + * :c:func:`i_x1_pol_mult_a2` + * :c:func:`i_x1_pol_mult_recurs` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x2_pol_mult` + * :c:func:`multiply_poly` + + +.. c:function:: i_x1_pol_mult_a2: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + recursive subroutine I_x1_pol_mult_a2(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + + Recursive function involved in the two-electron integral + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult` + * :c:func:`i_x1_pol_mult_recurs` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_a1` + * :c:func:`i_x2_pol_mult` + * :c:func:`multiply_poly` + + +.. c:function:: i_x1_pol_mult_recurs: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + recursive subroutine I_x1_pol_mult_recurs(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + + Recursive function involved in the two-electron integral + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult` + * :c:func:`i_x1_pol_mult_recurs` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_a1` + * :c:func:`i_x1_pol_mult_a2` + * :c:func:`i_x1_pol_mult_recurs` + * :c:func:`multiply_poly` + + +.. c:function:: i_x2_new: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + recursive subroutine I_x2_new(c,B_10,B_01,B_00,res,n_pt) + + + recursive function involved in the two-electron integral + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_new` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_new` + + +.. c:function:: i_x2_pol_mult: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + recursive subroutine I_x2_pol_mult(c,B_10,B_01,B_00,C_00,D_00,d,nd,dim) + + + Recursive function involved in the two-electron integral + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult` + * :c:func:`i_x1_pol_mult_a1` + * :c:func:`i_x1_pol_mult_a2` + * :c:func:`i_x2_pol_mult` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x2_pol_mult` + * :c:func:`multiply_poly` + + + +Subroutines / functions +----------------------- + +.. c:function:: ao_l4: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + integer function ao_l4(i,j,k,l) + + + Computes the product of l values of i,j,k,and l + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_l` + + +.. c:function:: ao_two_e_integral: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + double precision function ao_two_e_integral(i,j,k,l) + + + integral of the AO basis or (ij|kl) + i(r1) j(r1) 1/r12 k(r2) l(r2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_power` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_nucl` + * :c:data:`nucl_coord` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_explicit_poly_and_gaussian` + + +.. c:function:: ao_two_e_integral_schwartz_accel: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + double precision function ao_two_e_integral_schwartz_accel(i,j,k,l) + + + integral of the AO basis or (ij|kl) + i(r1) j(r1) 1/r12 k(r2) l(r2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_power` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_prim_num` + * :c:data:`ao_nucl` + * :c:data:`nucl_coord` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_explicit_poly_and_gaussian` + + +.. c:function:: ao_two_e_integrals_in_map_collector: + + + File : :file:`ao_two_e_ints/integrals_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_in_map_collector(zmq_socket_pull) + + + Collects results from the AO integral calculation + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`insert_into_ao_integrals_map` + + +.. c:function:: ao_two_e_integrals_in_map_slave: + + + File : :file:`ao_two_e_ints/integrals_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_in_map_slave(thread,iproc) + + + Computes a buffer of integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_in_map_slave_inproc` + * :c:func:`ao_two_e_integrals_in_map_slave_tcp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`compute_ao_integrals_jl` + * :c:func:`end_zmq_push_socket` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`push_integrals` + + +.. c:function:: ao_two_e_integrals_in_map_slave_inproc: + + + File : :file:`ao_two_e_ints/integrals_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_in_map_slave_inproc(i) + + + Computes a buffer of integrals. i is the ID of the current thread. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_in_map_slave` + + +.. c:function:: ao_two_e_integrals_in_map_slave_tcp: + + + File : :file:`ao_two_e_ints/integrals_in_map_slave.irp.f` + + .. code:: fortran + + subroutine ao_two_e_integrals_in_map_slave_tcp(i) + + + Computes a buffer of integrals. i is the ID of the current thread. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_in_map_slave` + + +.. c:function:: clear_ao_map: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine clear_ao_map + + + Frees the memory of the AO map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_deinit` + + +.. c:function:: compute_ao_integrals_jl: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + subroutine compute_ao_integrals_jl(j,l,n_integrals,buffer_i,buffer_value) + + + Parallel client for AO integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_overlap_abs` + * :c:data:`ao_num` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_two_e_integral_schwartz` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_in_map_slave` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`two_e_integrals_index` + + +.. c:function:: compute_ao_two_e_integrals: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + subroutine compute_ao_two_e_integrals(j,k,l,sze,buffer_value) + + + Compute AO 1/r12 integrals for all i and fixed j,k,l + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_overlap_abs` + * :c:data:`ao_num` + * :c:data:`ao_two_e_integral_schwartz` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integral_jj_from_ao` + * :c:data:`mo_two_e_integrals_vv_from_ao` + + +.. c:function:: dump_ao_integrals: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine dump_ao_integrals(filename) + + + Save to disk the |AO| integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`mpi_master` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_work_empty` + + +.. c:function:: eri: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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) + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`integrale_new` + + +.. c:function:: gauleg: + + + File : :file:`ao_two_e_ints/gauss_legendre.irp.f` + + .. code:: fortran + + subroutine gauleg(x1,x2,x,w,n) + + + Gauss-Legendre + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`gauleg_t2` + + +.. c:function:: get_ao_map_size: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + function get_ao_map_size() + + + Returns the number of elements in the AO map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + + +.. c:function:: get_ao_two_e_integral: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + double precision function get_ao_two_e_integral(i,j,k,l,map) result(result) + + + Gets one AO bi-electronic integral from the AO map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_overlap_abs` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_integrals_cache` + * :c:data:`ao_integrals_cache_min` + * :c:data:`ao_two_e_integrals_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_ao_two_e_integrals: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine get_ao_two_e_integrals(j,k,l,sze,out_val) + + + Gets multiple AO bi-electronic integral from the AO map . + All i are retrieved for j,k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_two_e_integrals_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map` + * :c:func:`add_integrals_to_map_no_exit_34` + * :c:func:`add_integrals_to_map_three_indices` + + +.. c:function:: get_ao_two_e_integrals_non_zero: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine get_ao_two_e_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) + + + Gets multiple AO bi-electronic integral from the AO map . + All non-zero i are retrieved for j,k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integral_jj_from_ao` + * :c:data:`mo_two_e_integrals_vv_from_ao` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get` + * :c:func:`two_e_integrals_index` + + +.. c:function:: give_polynom_mult_center_x: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + 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) + + + subroutine that returns the explicit polynom in term of the "t" + variable of the following polynomw : + + $I_{x_1}(a_x,d_x,p,q) \, I_{x_1}(a_y,d_y,p,q) \ I_{x_1}(a_z,d_z,p,q)$ + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`general_primitive_integral` + * :c:func:`general_primitive_integral_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult` + + +.. c:function:: i_x1_pol_mult: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + subroutine I_x1_pol_mult(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + + Recursive function involved in the two-electron integral + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`give_polynom_mult_center_x` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_pol_mult_a1` + * :c:func:`i_x1_pol_mult_a2` + * :c:func:`i_x1_pol_mult_recurs` + * :c:func:`i_x2_pol_mult` + + +.. c:function:: insert_into_ao_integrals_map: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine insert_into_ao_integrals_map(n_integrals,buffer_i, buffer_values) + + + Create new entry into AO map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_in_map_collector` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_append` + + +.. c:function:: integrale_new: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + 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) + + + Calculates the integral of the polynomial : + + $I_{x_1}(a_x+b_x,c_x+d_x,p,q) \, I_{x_1}(a_y+b_y,c_y+d_y,p,q) \, I_{x_1}(a_z+b_z,c_z+d_z,p,q)$ + in $( 0 ; 1)$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_pt_max_integrals` + * :c:data:`gauleg_t2` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`eri` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_x1_new` + + +.. c:function:: load_ao_integrals: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + integer function load_ao_integrals(filename) + + + Read from disk the |AO| integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`cache_map_reallocate` + * :c:func:`map_deinit` + * :c:func:`map_sort` + + +.. c:function:: n_pt_sup: + + + File : :file:`ao_two_e_ints/two_e_integrals.irp.f` + + .. code:: fortran + + 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) + + + Returns the upper boundary of the degree of the polynomial involved in the + two-electron integral : + + $I_x(a_x,b_x,c_x,d_x) \, I_y(a_y,b_y,c_y,d_y) \, I_z(a_z,b_z,c_z,d_z)$ + + +.. c:function:: push_integrals: + + + File : :file:`ao_two_e_ints/integrals_in_map_slave.irp.f` + + .. code:: fortran + + subroutine push_integrals(zmq_socket_push, n_integrals, buffer_i, buffer_value, task_id) + + + Push integrals in the push socket + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_erf_in_map_slave` + * :c:func:`ao_two_e_integrals_in_map_slave` + + +.. c:function:: two_e_integrals_index: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine two_e_integrals_index(i,j,k,l,i1) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_cache` + * :c:data:`ao_integrals_erf_cache` + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_integrals_map` + * :c:func:`compute_ao_integrals_erf_jl` + * :c:func:`compute_ao_integrals_jl` + * :c:func:`get_ao_two_e_integral` + * :c:func:`get_ao_two_e_integral_erf` + * :c:func:`get_ao_two_e_integrals_erf_non_zero` + * :c:func:`get_ao_two_e_integrals_non_zero` + * :c:func:`get_mo_two_e_integral_erf` + * :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_two_e_integral` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_integrals_map` + * :c:func:`two_e_integrals_index_reverse` + + +.. c:function:: two_e_integrals_index_reverse: + + + File : :file:`ao_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine two_e_integrals_index_reverse(i,j,k,l,i1) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integral_alpha` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`two_e_integrals_index` + diff --git a/docs/source/modules/aux_quantities.rst b/docs/source/modules/aux_quantities.rst new file mode 100644 index 000000000..e71dc3252 --- /dev/null +++ b/docs/source/modules/aux_quantities.rst @@ -0,0 +1,53 @@ +.. _module_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| directory in a different place than determinants. +This is used in practice to store density matrices which can be obtained from +any method, 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 the convergence. + +The main providers of that module are: + +* :c:data:`data_one_e_dm_alpha_mo` and :c:data:`data_one_e_dm_beta_mo` which + are the one-body alpha and beta densities which are necessary read from the + |EZFIO| directory. + + +Thanks to these providers you can use any density matrix that does not +necessarily 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_e_dm_alpha_mo + + Alpha one body density matrix on the |MO| basis computed with the wave function + + +.. option:: data_one_e_dm_beta_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 000000000..7868a5479 --- /dev/null +++ b/docs/source/modules/becke_numerical_grid.rst @@ -0,0 +1,900 @@ +.. _module_becke_numerical_grid: + +.. program:: becke_numerical_grid + +.. default-role:: option + +==================== +becke_numerical_grid +==================== + +This module contains all quantities needed to build 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 module 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 + +.. option:: n_points_final_grid + + Total number of grid points + + + +Providers +--------- + +.. c:var:: alpha_knowles + + + File : :file:`becke_numerical_grid/integration_radial.irp.f` + + .. code:: fortran + + double precision, allocatable :: alpha_knowles (100) + + + Recommended values for the alpha parameters according to the paper of Knowles (JCP, 104, 1996) + as a function of the nuclear charge + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + + +.. c:var:: angular_quadrature_points + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) + double precision, allocatable :: weights_angular_points (n_points_integration_angular) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_radial_grid` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + + +.. c:var:: dr_radial_integral + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + double precision, allocatable :: grid_points_radial (n_points_radial_grid) + double precision :: dr_radial_integral + + + points in [0,1] to map the radial integral [0,\infty] + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_radial_grid` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + + +.. c:var:: final_grid_points + + + File : :file:`becke_numerical_grid/grid_becke_vector.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + * :c:data:`n_points_final_grid` + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_grad_in_r_array` + * :c:data:`aos_grad_in_r_array_transp` + * :c:data:`aos_grad_in_r_array_transp_xyz` + * :c:data:`aos_in_r_array` + * :c:data:`aos_lapl_in_r_array` + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_pbe` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_lda` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_lda` + * :c:data:`energy_x_sr_pbe` + * :c:data:`mos_in_r_array` + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + +.. c:var:: final_weight_at_r + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + double precision, allocatable :: final_weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) + + + Total weight on each grid point which takes into account all Lebedev, Voronoi and radial weights. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`alpha_knowles` + * :c:data:`angular_quadrature_points` + * :c:data:`grid_points_radial` + * :c:data:`m_knowles` + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_charge` + * :c:data:`nucl_num` + * :c:data:`weight_at_r` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_grid_points` + + +.. c:var:: final_weight_at_r_vector + + + File : :file:`becke_numerical_grid/grid_becke_vector.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + * :c:data:`n_points_final_grid` + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_grad_in_r_array` + * :c:data:`aos_grad_in_r_array_transp` + * :c:data:`aos_grad_in_r_array_transp_xyz` + * :c:data:`aos_in_r_array` + * :c:data:`aos_lapl_in_r_array` + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_pbe` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_lda` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_lda` + * :c:data:`energy_x_sr_pbe` + * :c:data:`mos_in_r_array` + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + +.. c:var:: grid_points_per_atom + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + double precision, allocatable :: grid_points_per_atom (3,n_points_integration_angular,n_points_radial_grid,nucl_num) + + + x,y,z coordinates of grid points used for integration in 3d space + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`alpha_knowles` + * :c:data:`angular_quadrature_points` + * :c:data:`grid_points_radial` + * :c:data:`m_knowles` + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_charge` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_grid_points` + * :c:data:`one_e_dm_alpha_in_r` + * :c:data:`weight_at_r` + + +.. c:var:: grid_points_radial + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + double precision, allocatable :: grid_points_radial (n_points_radial_grid) + double precision :: dr_radial_integral + + + points in [0,1] to map the radial integral [0,\infty] + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_radial_grid` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + + +.. c:var:: index_final_points + + + File : :file:`becke_numerical_grid/grid_becke_vector.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + * :c:data:`n_points_final_grid` + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_grad_in_r_array` + * :c:data:`aos_grad_in_r_array_transp` + * :c:data:`aos_grad_in_r_array_transp_xyz` + * :c:data:`aos_in_r_array` + * :c:data:`aos_lapl_in_r_array` + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_pbe` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_lda` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_lda` + * :c:data:`energy_x_sr_pbe` + * :c:data:`mos_in_r_array` + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + +.. c:var:: index_final_points_reverse + + + File : :file:`becke_numerical_grid/grid_becke_vector.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + * :c:data:`n_points_final_grid` + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_grad_in_r_array` + * :c:data:`aos_grad_in_r_array_transp` + * :c:data:`aos_grad_in_r_array_transp_xyz` + * :c:data:`aos_in_r_array` + * :c:data:`aos_lapl_in_r_array` + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_pbe` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_lda` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_lda` + * :c:data:`energy_x_sr_pbe` + * :c:data:`mos_in_r_array` + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + +.. c:var:: m_knowles + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + integer :: m_knowles + + + value of the "m" parameter in the equation (7) of the paper of Knowles (JCP, 104, 1996) + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + + +.. c:var:: n_points_final_grid + + + File : :file:`becke_numerical_grid/grid_becke_vector.irp.f` + + .. code:: fortran + + integer :: n_points_final_grid + + + Number of points which are non zero + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_grad_in_r_array` + * :c:data:`aos_grad_in_r_array_transp` + * :c:data:`aos_grad_in_r_array_transp_xyz` + * :c:data:`aos_in_r_array` + * :c:data:`aos_lapl_in_r_array` + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_pbe` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_lda` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_lda` + * :c:data:`energy_x_sr_pbe` + * :c:data:`final_grid_points` + * :c:data:`mos_grad_in_r_array` + * :c:data:`mos_in_r_array` + * :c:data:`mos_lapl_in_r_array` + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + * :c:data:`pot_grad_x_alpha_ao_pbe` + * :c:data:`pot_grad_xc_alpha_ao_pbe` + * :c:data:`pot_scal_x_alpha_ao_pbe` + * :c:data:`pot_scal_xc_alpha_ao_pbe` + * :c:data:`pot_sr_grad_x_alpha_ao_pbe` + * :c:data:`pot_sr_grad_xc_alpha_ao_pbe` + * :c:data:`pot_sr_scal_x_alpha_ao_pbe` + * :c:data:`pot_sr_scal_xc_alpha_ao_pbe` + * :c:data:`potential_c_alpha_ao_lda` + * :c:data:`potential_c_alpha_ao_sr_lda` + * :c:data:`potential_x_alpha_ao_lda` + * :c:data:`potential_x_alpha_ao_sr_lda` + * :c:data:`potential_xc_alpha_ao_lda` + * :c:data:`potential_xc_alpha_ao_sr_lda` + + +.. c:var:: n_points_grid_per_atom + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + integer :: n_points_grid_per_atom + + + Number of grid points per atom + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_radial_grid` + + + +.. c:var:: n_points_integration_angular + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`grid_type_sgn` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`angular_quadrature_points` + * :c:data:`final_grid_points` + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + * :c:data:`grid_points_radial` + * :c:data:`n_points_final_grid` + * :c:data:`n_points_grid_per_atom` + * :c:data:`one_e_dm_alpha_in_r` + * :c:data:`weight_at_r` + + +.. c:var:: n_points_radial_grid + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`grid_type_sgn` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`angular_quadrature_points` + * :c:data:`final_grid_points` + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + * :c:data:`grid_points_radial` + * :c:data:`n_points_final_grid` + * :c:data:`n_points_grid_per_atom` + * :c:data:`one_e_dm_alpha_in_r` + * :c:data:`weight_at_r` + + +.. c:var:: weight_at_r + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + double precision, allocatable :: weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`grid_points_per_atom` + * :c:data:`n_points_radial_grid` + * :c:data:`nucl_coord_transp` + * :c:data:`nucl_dist_inv` + * :c:data:`nucl_num` + * :c:data:`slater_bragg_type_inter_distance_ua` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + + +.. c:var:: weights_angular_points + + + File : :file:`becke_numerical_grid/grid_becke.irp.f` + + .. code:: fortran + + double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) + double precision, allocatable :: weights_angular_points (n_points_integration_angular) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_radial_grid` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`final_weight_at_r` + * :c:data:`grid_points_per_atom` + + + +Subroutines / functions +----------------------- + +.. c:function:: cell_function_becke: + + + File : :file:`becke_numerical_grid/step_function_becke.irp.f` + + .. code:: fortran + + double precision function cell_function_becke(r,atom_number) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_dist_inv` + * :c:data:`slater_bragg_type_inter_distance_ua` + * :c:data:`nucl_coord_transp` + * :c:data:`nucl_num` + + +.. c:function:: derivative_knowles_function: + + + File : :file:`becke_numerical_grid/integration_radial.irp.f` + + .. code:: fortran + + double precision function derivative_knowles_function(alpha,m,x) + + + Derivative of the function proposed by Knowles (JCP, 104, 1996) for distributing the radial points + + +.. c:function:: example_becke_numerical_grid: + + + File : :file:`becke_numerical_grid/example.irp.f` + + .. code:: fortran + + subroutine example_becke_numerical_grid + + + subroutine that illustrates the main features available in becke_numerical_grid + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_final_grid` + * :c:data:`final_weight_at_r` + * :c:data:`n_points_radial_grid` + * :c:data:`grid_points_per_atom` + * :c:data:`final_grid_points` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + +.. c:function:: f_function_becke: + + + File : :file:`becke_numerical_grid/step_function_becke.irp.f` + + .. code:: fortran + + double precision function f_function_becke(x) + + + + +.. c:function:: knowles_function: + + + File : :file:`becke_numerical_grid/integration_radial.irp.f` + + .. code:: fortran + + double precision function knowles_function(alpha,m,x) + + + 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: + + + File : :file:`becke_numerical_grid/step_function_becke.irp.f` + + .. code:: fortran + + double precision function step_function_becke(x) + + + 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 000000000..3e7f90778 --- /dev/null +++ b/docs/source/modules/bitmask.rst @@ -0,0 +1,3490 @@ +.. _module_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:: act_bitmask + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: cas_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: cas_bitmask (N_int,2,N_cas_bitmask) + + + Bitmasks for CAS reference determinants. (N_int, alpha/beta, CAS reference) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`full_ijkl_bitmask` + * :c:data:`generators_bitmask_restart` + * :c:data:`hf_bitmask` + * :c:data:`mpi_master` + * :c:data:`n_cas_bitmask` + * :c:data:`n_generators_bitmask` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`closed_shell_ref_bitmask` + * :c:data:`psi_cas` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_act_bitmask` + + +.. c:var:: closed_shell_ref_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: closed_shell_ref_bitmask (N_int,2) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + + +.. c:var:: core_bitmask + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: core_inact_act_bitmask_4 + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: core_inact_act_bitmask_4 (N_int,4) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`reunion_of_core_inact_act_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + + +.. c:var:: core_inact_virt_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) + + + Reunion of the inactive and virtual bitmasks + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`n_int` + + + +.. c:var:: del_bitmask + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: dim_list_act_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: dim_list_core_orb + integer :: dim_list_inact_orb + integer :: dim_list_virt_orb + integer :: dim_list_act_orb + integer :: dim_list_del_orb + + + dimensions for the allocation of list_inact, list_virt, list_core and list_act + it is at least 1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + + +.. c:var:: dim_list_core_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: dim_list_core_orb + integer :: dim_list_inact_orb + integer :: dim_list_virt_orb + integer :: dim_list_act_orb + integer :: dim_list_del_orb + + + dimensions for the allocation of list_inact, list_virt, list_core and list_act + it is at least 1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + + +.. c:var:: dim_list_del_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: dim_list_core_orb + integer :: dim_list_inact_orb + integer :: dim_list_virt_orb + integer :: dim_list_act_orb + integer :: dim_list_del_orb + + + dimensions for the allocation of list_inact, list_virt, list_core and list_act + it is at least 1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + + +.. c:var:: dim_list_inact_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: dim_list_core_orb + integer :: dim_list_inact_orb + integer :: dim_list_virt_orb + integer :: dim_list_act_orb + integer :: dim_list_del_orb + + + dimensions for the allocation of list_inact, list_virt, list_core and list_act + it is at least 1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + + +.. c:var:: dim_list_virt_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: dim_list_core_orb + integer :: dim_list_inact_orb + integer :: dim_list_virt_orb + integer :: dim_list_act_orb + integer :: dim_list_del_orb + + + dimensions for the allocation of list_inact, list_virt, list_core and list_act + it is at least 1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + + +.. c:var:: full_ijkl_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: full_ijkl_bitmask (N_int) + + + Bitmask to include all possible MOs + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + * :c:data:`full_ijkl_bitmask_4` + * :c:data:`generators_bitmask` + * :c:data:`generators_bitmask_restart` + + +.. c:var:: full_ijkl_bitmask_4 + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: full_ijkl_bitmask_4 (N_int,4) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`full_ijkl_bitmask` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_integrals_in_map` + + +.. c:var:: generators_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: generators_bitmask (N_int,2,6,N_generators_bitmask) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`full_ijkl_bitmask` + * :c:data:`mpi_master` + * :c:data:`n_generators_bitmask` + * :c:data:`n_int` + + + +.. c:var:: generators_bitmask_restart + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: generators_bitmask_restart (N_int,2,6,N_generators_bitmask_restart) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`full_ijkl_bitmask` + * :c:data:`mpi_master` + * :c:data:`n_generators_bitmask` + * :c:data:`n_generators_bitmask_restart` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + + +.. c:var:: hf_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: hf_bitmask (N_int,2) + + + Hartree Fock bit mask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`degree_max_generators` + * :c:data:`double_exc_bitmask` + * :c:data:`max_degree_exc` + * :c:data:`psi_cas` + * :c:data:`psi_det` + * :c:data:`ref_bitmask` + * :c:data:`single_exc_bitmask` + * :c:data:`unpaired_alpha_electrons` + + +.. c:var:: i_bitmask_gen + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: i_bitmask_gen + + + Current bitmask for the generators + + + +.. c:var:: inact_bitmask + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: inact_virt_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) + + + Reunion of the inactive and virtual bitmasks + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`n_int` + + + +.. c:var:: index_holes_bitmask + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + integer, allocatable :: index_holes_bitmask (3) + + + Index of the holes in the generators_bitmasks + + + +.. c:var:: index_particl_bitmask + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + integer, allocatable :: index_particl_bitmask (3) + + + Index of the holes in the generators_bitmasks + + + +.. c:var:: list_act + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_act_reverse + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_core + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_core_inact_act + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) + integer, allocatable :: list_core_inact_act_reverse (mo_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`mo_num` + * :c:data:`n_int` + * :c:data:`reunion_of_core_inact_act_bitmask` + + + +.. c:var:: list_core_inact_act_reverse + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) + integer, allocatable :: list_core_inact_act_reverse (mo_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`mo_num` + * :c:data:`n_int` + * :c:data:`reunion_of_core_inact_act_bitmask` + + + +.. c:var:: list_core_reverse + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_del + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_del_reverse + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_inact + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_inact_reverse + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_virt + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: list_virt_reverse + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: mpi_bit_kind + + + File : :file:`bitmask/mpi.irp.f` + + .. code:: fortran + + integer :: mpi_bit_kind + + + MPI bit kind type + + + +.. c:var:: n_act_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: n_core_orb + integer :: n_inact_orb + integer :: n_act_orb + integer :: n_virt_orb + integer :: n_del_orb + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`dim_list_core_orb` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`list_inact` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`n_core_orb_allocate` + * :c:data:`n_inact_orb_allocate` + * :c:data:`n_virt_orb_allocate` + * :c:data:`pt2_f` + + +.. c:var:: n_cas_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_cas_bitmask + + + Number of bitmasks for CAS + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`psi_cas` + + +.. c:var:: n_core_inact_act_orb + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) + integer :: n_core_inact_act_orb + + + Reunion of the core, inactive and active bitmasks + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`n_int` + * :c:data:`reunion_of_core_inact_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_inact_act_bitmask_4` + * :c:data:`list_core_inact_act` + + +.. c:var:: n_core_inact_orb + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_core_inact_orb + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`reunion_of_core_inact_bitmask` + + + +.. c:var:: n_core_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: n_core_orb + integer :: n_inact_orb + integer :: n_act_orb + integer :: n_virt_orb + integer :: n_del_orb + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`dim_list_core_orb` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`list_inact` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`n_core_orb_allocate` + * :c:data:`n_inact_orb_allocate` + * :c:data:`n_virt_orb_allocate` + * :c:data:`pt2_f` + + +.. c:var:: n_core_orb_allocate + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_core_orb_allocate + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + + +.. c:var:: n_del_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: n_core_orb + integer :: n_inact_orb + integer :: n_act_orb + integer :: n_virt_orb + integer :: n_del_orb + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`dim_list_core_orb` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`list_inact` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`n_core_orb_allocate` + * :c:data:`n_inact_orb_allocate` + * :c:data:`n_virt_orb_allocate` + * :c:data:`pt2_f` + + +.. c:var:: n_generators_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_generators_bitmask + + + Number of bitmasks for generators + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`generators_bitmask_restart` + + +.. c:var:: n_generators_bitmask_restart + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_generators_bitmask_restart + + + Number of bitmasks for generators + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask_restart` + + +.. c:var:: n_inact_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: n_core_orb + integer :: n_inact_orb + integer :: n_act_orb + integer :: n_virt_orb + integer :: n_del_orb + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`dim_list_core_orb` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`list_inact` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`n_core_orb_allocate` + * :c:data:`n_inact_orb_allocate` + * :c:data:`n_virt_orb_allocate` + * :c:data:`pt2_f` + + +.. c:var:: n_inact_orb_allocate + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_inact_orb_allocate + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + + +.. c:var:: n_int + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_int + + + Number of 64-bit integers needed to represent determinants as binary strings + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`ci_electronic_energy` + * :c:data:`closed_shell_ref_bitmask` + * :c:data:`coef_hf_selector` + * :c:data:`core_inact_act_bitmask_4` + * :c:data:`degree_max_generators` + * :c:data:`det_to_occ_pattern` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`double_exc_bitmask` + * :c:data:`exc_degree_per_selectors` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + * :c:data:`full_ijkl_bitmask` + * :c:data:`full_ijkl_bitmask_4` + * :c:data:`generators_bitmask` + * :c:data:`generators_bitmask_restart` + * :c:data:`global_selection_buffer` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`h_matrix_all_dets` + * :c:data:`h_matrix_cas` + * :c:data:`hf_bitmask` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`list_inact` + * :c:data:`max_degree_exc` + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_cas_bitmask` + * :c:data:`n_core_inact_orb` + * :c:data:`n_generators_bitmask` + * :c:data:`n_generators_bitmask_restart` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_cas` + * :c:data:`psi_cas_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_hii` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det_sorted_gen` + * :c:data:`psi_energy` + * :c:data:`psi_energy_two_e` + * :c:data:`psi_non_cas` + * :c:data:`psi_non_cas_sorted_bit` + * :c:data:`psi_occ_pattern` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_diag_h_mat` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + * :c:data:`ref_closed_shell_bitmask` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_act_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`s2_matrix_all_dets` + * :c:data:`s2_values` + * :c:data:`single_exc_bitmask` + * :c:data:`singles_alpha_csc` + * :c:data:`singles_alpha_csc_idx` + * :c:data:`singles_beta_csc` + * :c:data:`singles_beta_csc_idx` + * :c:data:`unpaired_alpha_electrons` + * :c:data:`virt_bitmask_4` + + +.. c:var:: n_virt_orb + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer :: n_core_orb + integer :: n_inact_orb + integer :: n_act_orb + integer :: n_virt_orb + integer :: n_del_orb + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`dim_list_core_orb` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`list_inact` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`n_core_orb_allocate` + * :c:data:`n_inact_orb_allocate` + * :c:data:`n_virt_orb_allocate` + * :c:data:`pt2_f` + + +.. c:var:: n_virt_orb_allocate + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer :: n_virt_orb_allocate + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + + + +.. c:var:: ref_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: ref_bitmask (N_int,2) + + + Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`hf_bitmask` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`closed_shell_ref_bitmask` + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`exc_degree_per_selectors` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + * :c:data:`ref_bitmask_energy` + * :c:data:`ref_closed_shell_bitmask` + + +.. c:var:: reunion_of_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: reunion_of_bitmask (N_int,2) + + + Reunion of the inactive, active and virtual bitmasks + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`list_inact` + * :c:data:`n_int` + + + +.. c:var:: reunion_of_cas_inact_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: reunion_of_cas_inact_bitmask (N_int,2) + + + Reunion of the inactive, active and virtual bitmasks + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`list_inact` + * :c:data:`n_int` + + + +.. c:var:: reunion_of_core_inact_act_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) + integer :: n_core_inact_act_orb + + + Reunion of the core, inactive and active bitmasks + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`n_int` + * :c:data:`reunion_of_core_inact_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_inact_act_bitmask_4` + * :c:data:`list_core_inact_act` + + +.. c:var:: reunion_of_core_inact_bitmask + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: reunion_of_core_inact_bitmask (N_int,2) + + + Reunion of the core and inactive and virtual bitmasks + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_inact_orb` + * :c:data:`reunion_of_core_inact_act_bitmask` + + +.. c:var:: unpaired_alpha_electrons + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: unpaired_alpha_electrons (N_int) + + + Bitmask reprenting the unpaired alpha electrons in the HF_bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`hf_bitmask` + * :c:data:`n_int` + + + +.. c:var:: virt_bitmask + + + File : :file:`bitmask/core_inact_act_virt.irp.f` + + .. code:: fortran + + integer, allocatable :: list_inact (dim_list_inact_orb) + integer, allocatable :: list_virt (dim_list_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + integer, allocatable :: list_del_reverse (mo_num) + integer, allocatable :: list_del (mo_num) + integer, allocatable :: list_core (dim_list_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + integer, allocatable :: list_act (dim_list_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: act_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: del_bitmask (N_int,2) + + + 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 + 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 + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dim_list_core_orb` + * :c:data:`mo_class` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_int` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo` + * :c:data:`inact_virt_bitmask` + * :c:data:`list_core_inact_act` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_vv_from_ao` + * :c:data:`reunion_of_bitmask` + * :c:data:`reunion_of_cas_inact_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`virt_bitmask_4` + + +.. c:var:: virt_bitmask_4 + + + File : :file:`bitmask/bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: virt_bitmask_4 (N_int,4) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`n_int` + + + + +Subroutines / functions +----------------------- + +.. c:function:: bitstring_to_hexa: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine bitstring_to_hexa( output, string, Nint ) + + + Transform a bit string to a string in hexadecimal format for printing + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`debug_det` + * :c:func:`debug_spindet` + + +.. c:function:: bitstring_to_list: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine bitstring_to_list( string, list, n_elements, Nint) + + + Gives the inidices(+1) of the bits set to 1 in the bit string + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map` + * :c:func:`add_integrals_to_map_erf` + * :c:func:`add_integrals_to_map_no_exit_34` + * :c:func:`add_integrals_to_map_three_indices` + * :c:func:`create_microlist` + * :c:func:`example_bitmask` + * :c:func:`getmobiles` + * :c:data:`list_core_inact_act` + * :c:data:`ref_bitmask_energy` + + +.. c:function:: bitstring_to_str: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine bitstring_to_str( output, string, Nint ) + + + Transform a bit string to a string for printing + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map` + * :c:func:`add_integrals_to_map_erf` + * :c:func:`add_integrals_to_map_three_indices` + * :c:func:`example_bitmask` + * :c:func:`print_det` + * :c:func:`print_spindet` + + +.. c:function:: broadcast_chunks_bit_kind: + + + File : :file:`bitmask/mpi.irp.f` + + .. code:: fortran + + subroutine broadcast_chunks_bit_kind(A, LDA) + + + Broadcast with chunks of ~2GB + + +.. c:function:: clear_bit_to_integer: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine clear_bit_to_integer(i_physical,key,Nint) + + + set to 0 the bit number i_physical in the bitstring key + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`example_bitmask` + * :c:data:`ref_closed_shell_bitmask` + + +.. c:function:: debug_det: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine debug_det(string,Nint) + + + Subroutine to print the content of a determinant in '+-' notation and + hexadecimal representation. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`build_fock_tmp` + * :c:func:`example_determinants` + * :c:func:`get_excitation_degree_vector_single_or_exchange_verbose` + * :c:func:`number_of_holes_verbose` + * :c:func:`number_of_particles_verbose` + * :c:func:`routine_example_psi_det` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_hexa` + * :c:func:`print_det` + + +.. c:function:: debug_spindet: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine debug_spindet(string,Nint) + + + Subroutine to print the content of a determinant in '+-' notation and + hexadecimal representation. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_hexa` + * :c:func:`print_spindet` + + +.. c:function:: example_bitmask: + + + File : :file:`bitmask/example.irp.f` + + .. code:: fortran + + subroutine example_bitmask + + + subroutine that illustrates the main features available in bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_core_orb` + * :c:data:`list_inact` + * :c:data:`n_int` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list` + * :c:func:`bitstring_to_str` + * :c:func:`clear_bit_to_integer` + * :c:func:`set_bit_to_integer` + + +.. c:function:: initialize_bitmask_to_restart_ones: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine initialize_bitmask_to_restart_ones + + + Initialization of the generators_bitmask to the restart bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask_restart` + * :c:data:`n_generators_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`n_int` + + +.. c:function:: is_a_1h: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_1h(key_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_a_1h1p: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_1h1p(key_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_a_1h2p: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_1h2p(key_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_a_1p: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_1p(key_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_a_2h: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_2h(key_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_a_2h1p: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_2h1p(key_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_a_2p: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_2p(key_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_a_two_holes_two_particles: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_a_two_holes_two_particles(key_in) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`list_inact` + * :c:data:`n_int` + + +.. c:function:: is_i_in_virtual: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + logical function is_i_in_virtual(i) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`n_int` + + +.. c:function:: is_the_hole_in_det: + + + File : :file:`bitmask/find_hole.irp.f` + + .. code:: fortran + + logical function is_the_hole_in_det(key_in,ispin,i_hole) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: is_the_particl_in_det: + + + File : :file:`bitmask/find_hole.irp.f` + + .. code:: fortran + + logical function is_the_particl_in_det(key_in,ispin,i_particl) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: list_to_bitstring: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine list_to_bitstring( string, list, n_elements, Nint) + + + Returns the physical string "string(N_int,2)" from the array of + occupations "list(N_int*bit_kind_size,2) + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`hf_bitmask` + * :c:data:`list_inact` + + +.. c:function:: modify_bitmasks_for_hole: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine modify_bitmasks_for_hole(i_hole) + + + modify the generators_bitmask in order that one can only excite + the electrons occupying i_hole + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_generators_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`n_int` + * :c:data:`index_holes_bitmask` + + +.. c:function:: modify_bitmasks_for_hole_in_out: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine modify_bitmasks_for_hole_in_out(i_hole) + + + modify the generators_bitmask in order that one can only excite + the electrons occupying i_hole + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_generators_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`index_holes_bitmask` + + +.. c:function:: modify_bitmasks_for_particl: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine modify_bitmasks_for_particl(i_part) + + + modify the generators_bitmask in order that one can only excite + the electrons to the orbital i_part + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`index_particl_bitmask` + * :c:data:`n_generators_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`n_int` + + +.. c:function:: number_of_holes: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + integer function number_of_holes(key_in) + + + Function that returns the number of holes in the inact space + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`n_int` + + +.. c:function:: number_of_holes_verbose: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + integer function number_of_holes_verbose(key_in) + + + function that returns the number of holes in the inact space + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`reunion_of_core_inact_bitmask` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`debug_det` + + +.. c:function:: number_of_particles: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + integer function number_of_particles(key_in) + + + function that returns the number of particles in the virtual space + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`list_inact` + * :c:data:`n_int` + + +.. c:function:: number_of_particles_verbose: + + + File : :file:`bitmask/bitmask_cas_routines.irp.f` + + .. code:: fortran + + integer function number_of_particles_verbose(key_in) + + + function that returns the number of particles in the inact space + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`list_inact` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`debug_det` + + +.. c:function:: print_det: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine print_det(string,Nint) + + + Subroutine to print the content of a determinant using the '+-' notation + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`debug_det` + * :c:func:`example_determinants` + * :c:func:`print_generators_bitmasks_holes` + * :c:func:`print_generators_bitmasks_holes_for_one_generator` + * :c:func:`print_generators_bitmasks_particles` + * :c:func:`print_generators_bitmasks_particles_for_one_generator` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_str` + + +.. c:function:: print_generators_bitmasks_holes: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine print_generators_bitmasks_holes + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask` + * :c:data:`n_int` + * :c:data:`index_holes_bitmask` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`print_det` + + +.. c:function:: print_generators_bitmasks_holes_for_one_generator: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine print_generators_bitmasks_holes_for_one_generator(i_gen) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask` + * :c:data:`n_int` + * :c:data:`index_holes_bitmask` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`print_det` + + +.. c:function:: print_generators_bitmasks_particles: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine print_generators_bitmasks_particles + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`index_particl_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`print_det` + + +.. c:function:: print_generators_bitmasks_particles_for_one_generator: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine print_generators_bitmasks_particles_for_one_generator(i_gen) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`index_particl_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`print_det` + + +.. c:function:: print_spindet: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine print_spindet(string,Nint) + + + Subroutine to print the content of a determinant using the '+-' notation + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`debug_spindet` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_str` + + +.. c:function:: set_bit_to_integer: + + + File : :file:`bitmask/bitmasks_routines.irp.f` + + .. code:: fortran + + subroutine set_bit_to_integer(i_physical,key,Nint) + + + set to 1 the bit number i_physical in the bitstring key + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`example_bitmask` + + +.. c:function:: set_bitmask_hole_as_input: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine set_bitmask_hole_as_input(input_bimask) + + + set the generators_bitmask for the holes + as the input_bimask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_generators_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`n_int` + * :c:data:`index_holes_bitmask` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask` + + +.. c:function:: set_bitmask_particl_as_input: + + + File : :file:`bitmask/modify_bitmasks.irp.f` + + .. code:: fortran + + subroutine set_bitmask_particl_as_input(input_bimask) + + + set the generators_bitmask for the particles + as the input_bimask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`index_particl_bitmask` + * :c:data:`n_generators_bitmask` + * :c:data:`generators_bitmask` + * :c:data:`n_int` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask` + diff --git a/docs/source/modules/cipsi.rst b/docs/source/modules/cipsi.rst new file mode 100644 index 000000000..af9f600dc --- /dev/null +++ b/docs/source/modules/cipsi.rst @@ -0,0 +1,2499 @@ +.. _module_cipsi: + +.. program:: cipsi + +.. default-role:: option + +===== +cipsi +===== + +|CIPSI| algorithm. + +The :c:func:`run_stochastic_cipsi` and :c:func:`run_cipsi` subroutines start with a single +determinant, or with the wave function in the |EZFIO| database if +:option:`determinants read_wf` is |true|. + +The :c:func:`run_cipsi` subroutine iteratively: + +* Selects the most important determinants from the external space and adds them to the + internal space +* If :option:`determinants s2_eig` is |true|, it adds all the necessary + determinants to allow the eigenstates of |H| to be eigenstates of |S^2| +* Diagonalizes |H| in the enlarged internal space +* Computes the |PT2| contribution to the energy stochastically :cite:`Garniron_2017.2` + or deterministically, depending on :option:`perturbation do_pt2` +* Extrapolates the variational energy by fitting + :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` + +The difference between :c:func:`run_stochastic_cipsi` and :c:func:`run_cipsi` is that +:c:func:`run_stochastic_cipsi` selects the determinants on the fly with the computation +of the stochastic |PT2| :cite:`Garniron_2017.2`. Hence, it is a semi-stochastic selection. It + +* Selects the most important determinants from the external space and adds them to the + internal space, on the fly with the computation of the PT2 with the stochastic algorithm + presented in :cite:`Garniron_2017.2`. +* If :option:`determinants s2_eig` is |true|, it adds all the necessary + determinants to allow the eigenstates of |H| to be eigenstates of |S^2| +* Extrapolates the variational energy by fitting + :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` +* Diagonalizes |H| in the enlarged internal space + + +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:`module_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. + + + + +Providers +--------- + +.. c:var:: global_selection_buffer + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + type(selection_buffer) :: global_selection_buffer + + + Global buffer for the OpenMP selection + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`global_selection_buffer_lock` + * :c:data:`n_det_generators` + * :c:data:`n_int` + + + +.. c:var:: global_selection_buffer_lock + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + integer(omp_lock_kind) :: global_selection_buffer_lock + + + Global buffer for the OpenMP selection + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`global_selection_buffer` + + +.. c:var:: initialize_pt2_e0_denominator + + + File : :file:`cipsi/energy.irp.f` + + .. code:: fortran + + logical :: initialize_pt2_e0_denominator + + + If true, initialize pt2_E0_denominator + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_e0_denominator` + + +.. c:var:: nthreads_pt2 + + + File : :file:`cipsi/environment.irp.f` + + .. code:: fortran + + integer :: nthreads_pt2 + + + Number of threads for Davidson + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`nproc` + + + +.. c:var:: pt2_cw + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + 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) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_stoch_istate` + * :c:data:`qp_max_mem` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_f` + * :c:data:`pt2_j` + + +.. c:var:: pt2_e0_denominator + + + File : :file:`cipsi/energy.irp.f` + + .. code:: fortran + + double precision, allocatable :: pt2_e0_denominator (N_states) + + + E0 in the denominator of the PT2 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`barycentric_electronic_energy` + * :c:data:`h0_type` + * :c:data:`initialize_pt2_e0_denominator` + * :c:data:`mpi_master` + * :c:data:`n_states` + * :c:data:`nuclear_repulsion` + * :c:data:`psi_coef` + * :c:data:`psi_det_hii` + * :c:data:`psi_energy` + + + +.. c:var:: pt2_f + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer, allocatable :: pt2_f (N_det_generators) + integer :: pt2_n_tasks_max + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mpi_master` + * :c:data:`n_core_orb` + * :c:data:`n_det_generators` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_w` + + + +.. c:var:: pt2_j + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer, allocatable :: pt2_j (N_det_generators) + integer, allocatable :: pt2_r (N_det_generators) + + + pt2_J contains the list of generators after ordering them according to the + Monte Carlo sampling. + + pt2_R(i) is the number of combs drawn when determinant i is computed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`pt2_n_tasks` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_u` + * :c:data:`pt2_w` + * :c:data:`qp_max_mem` + + + +.. c:var:: pt2_mindetinfirstteeth + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer :: pt2_n_teeth + integer :: pt2_mindetinfirstteeth + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`pt2_stoch_istate` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_f` + * :c:data:`pt2_j` + * :c:data:`pt2_w` + + +.. c:var:: pt2_n_0 + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + 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) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_stoch_istate` + * :c:data:`qp_max_mem` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_f` + * :c:data:`pt2_j` + + +.. c:var:: pt2_n_tasks + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer :: pt2_n_tasks + + + Number of parallel tasks for the Monte Carlo + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_j` + + +.. c:var:: pt2_n_tasks_max + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer, allocatable :: pt2_f (N_det_generators) + integer :: pt2_n_tasks_max + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mpi_master` + * :c:data:`n_core_orb` + * :c:data:`n_det_generators` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_w` + + + +.. c:var:: pt2_n_teeth + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer :: pt2_n_teeth + integer :: pt2_mindetinfirstteeth + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`pt2_stoch_istate` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_f` + * :c:data:`pt2_j` + * :c:data:`pt2_w` + + +.. c:var:: pt2_r + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer, allocatable :: pt2_j (N_det_generators) + integer, allocatable :: pt2_r (N_det_generators) + + + pt2_J contains the list of generators after ordering them according to the + Monte Carlo sampling. + + pt2_R(i) is the number of combs drawn when determinant i is computed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`pt2_n_tasks` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_u` + * :c:data:`pt2_w` + * :c:data:`qp_max_mem` + + + +.. c:var:: pt2_stoch_istate + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer :: pt2_stoch_istate + + + State for stochatsic PT2 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_w` + + +.. c:var:: pt2_u + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + double precision, allocatable :: pt2_u (N_det_generators) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_j` + + +.. c:var:: pt2_u_0 + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + 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) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_stoch_istate` + * :c:data:`qp_max_mem` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_f` + * :c:data:`pt2_j` + + +.. c:var:: pt2_w + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + 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) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_stoch_istate` + * :c:data:`qp_max_mem` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_f` + * :c:data:`pt2_j` + + +.. c:var:: pt2_w_t + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + 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) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_stoch_istate` + * :c:data:`qp_max_mem` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_f` + * :c:data:`pt2_j` + + +.. c:var:: selection_weight + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + double precision, allocatable :: selection_weight (N_states) + + + Weights used in the selection criterion + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`c0_weight` + * :c:data:`n_states` + + + + +Subroutines / functions +----------------------- + +.. c:function:: add_to_selection_buffer: + + + File : :file:`cipsi/selection_buffer.irp.f` + + .. code:: fortran + + subroutine add_to_selection_buffer(b, det, val) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`fill_buffer_double` + * :c:func:`pt2_collector` + * :c:func:`selection_collector` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`sort_selection_buffer` + + +.. c:function:: bitstring_to_list_in_selection: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine bitstring_to_list_in_selection( string, list, n_elements, Nint) + + + Gives the inidices(+1) of the bits set to 1 in the bit string + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`splash_pq` + * :c:func:`spot_isinwf` + + +.. c:function:: create_selection_buffer: + + + File : :file:`cipsi/selection_buffer.irp.f` + + .. code:: fortran + + subroutine create_selection_buffer(N, size_in, res) + + + Allocates the memory for a selection buffer. + The arrays have dimension size_in and the maximum number of elements is N + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`global_selection_buffer` + * :c:func:`pt2_collector` + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + * :c:func:`run_selection_slave` + * :c:func:`selection_collector` + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + + +.. c:function:: delete_selection_buffer: + + + File : :file:`cipsi/selection_buffer.irp.f` + + .. code:: fortran + + subroutine delete_selection_buffer(b) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`global_selection_buffer` + * :c:func:`pt2_collector` + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + * :c:func:`run_selection_slave` + * :c:func:`selection_collector` + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + +.. c:function:: fill_buffer_double: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, variance, norm, mat, buf) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_occ_pattern_hii` + * :c:data:`det_to_occ_pattern` + * :c:data:`selection_weight` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`n_int` + * :c:data:`psi_det_hii` + * :c:data:`do_only_1h1p` + * :c:data:`h0_type` + * :c:data:`psi_det_generators` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`select_singles_and_doubles` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`add_to_selection_buffer` + * :c:func:`apply_holes` + * :c:func:`apply_particles` + + +.. c:function:: get_d0: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`n_int` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`splash_pq` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`apply_particles` + * :c:func:`get_mo_two_e_integrals` + * :c:func:`i_h_j` + + +.. c:function:: get_d1: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`n_int` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`splash_pq` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`apply_particles` + * :c:func:`get_mo_two_e_integrals` + * :c:func:`i_h_j` + + +.. c:function:: get_d2: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`n_int` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`splash_pq` + + +.. c:function:: get_mask_phase: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine get_mask_phase(det1, pm, Nint) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`splash_pq` + + +.. c:function:: get_phase_bi: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + double precision function get_phase_bi(phasemask, s1, s2, h1, p1, h2, p2, Nint) + + + + +.. c:function:: make_selection_buffer_s2: + + + File : :file:`cipsi/selection_buffer.irp.f` + + .. code:: fortran + + subroutine make_selection_buffer_s2(b) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`dsort` + * :c:func:`i8sort` + * :c:func:`occ_pattern_to_dets` + * :c:func:`occ_pattern_to_dets_size` + + +.. c:function:: merge_selection_buffers: + + + File : :file:`cipsi/selection_buffer.irp.f` + + .. code:: fortran + + subroutine merge_selection_buffers(b1, b2) + + + Merges the selection buffers b1 and b2 into b2 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_pt2_slave_large` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + + +.. c:function:: past_d1: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine past_d1(bannedOrb, p) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`splash_pq` + + +.. c:function:: past_d2: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine past_d2(banned, p, sp) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`splash_pq` + + +.. c:function:: provide_everything: + + + File : :file:`cipsi/slave_cipsi.irp.f` + + .. code:: fortran + + subroutine provide_everything + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask` + * :c:data:`pt2_stoch_istate` + * :c:data:`psi_selectors` + * :c:data:`psi_det` + * :c:data:`zmq_state` + * :c:data:`psi_coef` + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`zmq_context` + * :c:data:`n_det_selectors` + * :c:data:`state_average_weight` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`pt2_e0_denominator` + * :c:data:`ci_energy` + * :c:data:`n_states_diag` + * :c:data:`threshold_generators` + * :c:data:`psi_det_sorted_bit` + * :c:data:`n_states` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det_generators` + * :c:data:`psi_det_generators` + * :c:data:`n_int` + * :c:data:`psi_det_generators` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_slave_cipsi` + + +.. c:function:: pt2_collector: + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, variance, norm, b, N_) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_j` + * :c:data:`pt2_stoch_istate` + * :c:data:`n_states` + * :c:data:`pt2_f` + * :c:data:`pt2_w` + * :c:data:`n_det_generators` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_u` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`zmq_pt2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`add_to_selection_buffer` + * :c:func:`check_mem` + * :c:func:`create_selection_buffer` + * :c:func:`delete_selection_buffer` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`pull_pt2_results` + * :c:func:`sleep` + * :c:func:`sort_selection_buffer` + * :c:func:`wall_time` + + +.. c:function:: pt2_find_sample: + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer function pt2_find_sample(v, w) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + + +.. c:function:: pt2_find_sample_lr: + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + integer function pt2_find_sample_lr(v, w, l_in, r_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + + +.. c:function:: pt2_slave_inproc: + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + subroutine pt2_slave_inproc(i) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`global_selection_buffer` + * :c:data:`pt2_e0_denominator` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`zmq_pt2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`run_pt2_slave` + + +.. c:function:: pull_pt2_results: + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id, n_tasks, b) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`pt2_collector` + + +.. c:function:: pull_selection_results: + + + File : :file:`cipsi/run_selection_slave.irp.f` + + .. code:: fortran + + subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det, N, task_id, ntask) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`selection_collector` + + +.. c:function:: push_pt2_results: + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, b, task_id, n_tasks) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_pt2_slave_small` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`push_pt2_results_async_recv` + * :c:func:`push_pt2_results_async_send` + + +.. c:function:: push_pt2_results_async_recv: + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + subroutine push_pt2_results_async_recv(zmq_socket_push,mini,sending) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`push_pt2_results` + * :c:func:`run_pt2_slave_large` + + +.. c:function:: push_pt2_results_async_send: + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + subroutine push_pt2_results_async_send(zmq_socket_push, index, pt2, variance, norm, b, task_id, n_tasks, sending) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`push_pt2_results` + * :c:func:`run_pt2_slave_large` + + +.. c:function:: push_selection_results: + + + File : :file:`cipsi/run_selection_slave.irp.f` + + .. code:: fortran + + subroutine push_selection_results(zmq_socket_push, pt2, variance, norm, b, task_id, ntask) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_selection_slave` + + +.. c:function:: remove_duplicates_in_selection_buffer: + + + File : :file:`cipsi/selection_buffer.irp.f` + + .. code:: fortran + + subroutine remove_duplicates_in_selection_buffer(b) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`zmq_pt2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`i8sort` + + +.. c:function:: run_cipsi: + + + File : :file:`cipsi/cipsi.irp.f` + + .. code:: fortran + + subroutine run_cipsi + + + Selected Full Configuration Interaction with deterministic selection and + stochastic PT2. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`correlation_energy_ratio_max` + * :c:data:`n_iter` + * :c:data:`psi_energy_with_nucl_rep` + * :c:data:`psi_occ_pattern` + * :c:data:`n_det_max` + * :c:data:`n_states` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`s2_eig` + * :c:data:`do_pt2` + * :c:data:`psi_energy` + * :c:data:`pt2_relative_error` + * :c:data:`ref_bitmask_energy` + * :c:data:`psi_det` + * :c:data:`n_states_diag` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted` + * :c:data:`pt2_max` + * :c:data:`threshold_generators` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`fci` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`diagonalize_ci` + * :c:func:`ezfio_get_hartree_fock_energy` + * :c:func:`ezfio_has_hartree_fock_energy` + * :c:func:`make_s2_eigenfunction` + * :c:func:`print_extrapolated_energy` + * :c:func:`print_summary` + * :c:func:`save_energy` + * :c:func:`save_iterations` + * :c:func:`save_wavefunction` + * :c:func:`write_double` + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`ci_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`n_det` + * :c:data:`n_iter` + * :c:data:`psi_occ_pattern` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_energy` + * :c:data:`psi_occ_pattern` + * :c:data:`psi_energy` + * :c:data:`pt2_stoch_istate` + * :c:data:`state_average_weight` + * :c:data:`threshold_generators` + + +.. c:function:: run_pt2_slave: + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + subroutine run_pt2_slave(thread,iproc,energy) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states_diag` + * :c:data:`nproc` + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`pt2_slave_inproc` + * :c:func:`run_slave_main` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + + +.. c:function:: run_pt2_slave_large: + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + subroutine run_pt2_slave_large(thread,iproc,energy) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`pt2_f` + * :c:data:`elec_alpha_num` + * :c:data:`n_states_diag` + * :c:data:`global_selection_buffer_lock` + * :c:data:`global_selection_buffer` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_pt2_slave` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_selection_buffer` + * :c:func:`delete_selection_buffer` + * :c:func:`end_zmq_push_socket` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`merge_selection_buffers` + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + * :c:func:`push_pt2_results_async_recv` + * :c:func:`push_pt2_results_async_send` + * :c:func:`select_connected` + * :c:func:`sleep` + * :c:func:`sort_selection_buffer` + * :c:func:`wall_time` + + +.. c:function:: run_pt2_slave_small: + + + File : :file:`cipsi/run_pt2_slave.irp.f` + + .. code:: fortran + + subroutine run_pt2_slave_small(thread,iproc,energy) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + * :c:data:`n_states` + * :c:data:`pt2_f` + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_pt2_slave` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_selection_buffer` + * :c:func:`delete_selection_buffer` + * :c:func:`end_zmq_push_socket` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`push_pt2_results` + * :c:func:`select_connected` + * :c:func:`sleep` + * :c:func:`sort_selection_buffer` + * :c:func:`wall_time` + + +.. c:function:: run_selection_slave: + + + File : :file:`cipsi/run_selection_slave.irp.f` + + .. code:: fortran + + subroutine run_selection_slave(thread,iproc,energy) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`mo_num` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_states` + * :c:data:`pt2_f` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`elec_alpha_num` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`n_int` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det_sorted` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_selectors_coef_transp` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_slave_main` + * :c:func:`selection_slave_inproc` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_selection_buffer` + * :c:func:`delete_selection_buffer` + * :c:func:`end_zmq_push_socket` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`push_selection_results` + * :c:func:`select_connected` + * :c:func:`sleep` + * :c:func:`sort_selection_buffer` + + +.. c:function:: run_slave_cipsi: + + + File : :file:`cipsi/slave_cipsi.irp.f` + + .. code:: fortran + + subroutine run_slave_cipsi + + + Helper program for distributed parallelism + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`read_wf` + * :c:data:`distributed_davidson` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`pt2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_nested` + * :c:func:`provide_everything` + * :c:func:`run_slave_main` + * :c:func:`switch_qp_run_to_master` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`distributed_davidson` + * :c:data:`pt2_e0_denominator` + * :c:data:`pt2_stoch_istate` + * :c:data:`read_wf` + * :c:data:`state_average_weight` + * :c:data:`threshold_generators` + + +.. c:function:: run_slave_main: + + + File : :file:`cipsi/slave_cipsi.irp.f` + + .. code:: fortran + + subroutine run_slave_main + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_stoch_istate` + * :c:data:`psi_det` + * :c:data:`zmq_state` + * :c:data:`psi_coef` + * :c:data:`mpi_rank` + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`zmq_context` + * :c:data:`n_det_selectors` + * :c:data:`state_average_weight` + * :c:data:`mo_num` + * :c:data:`nthreads_pt2` + * :c:data:`elec_alpha_num` + * :c:data:`pt2_e0_denominator` + * :c:data:`h0_type` + * :c:data:`qp_max_mem` + * :c:data:`n_states_diag` + * :c:data:`threshold_generators` + * :c:data:`det_to_occ_pattern` + * :c:data:`n_states` + * :c:data:`pt2_f` + * :c:data:`n_det_generators` + * :c:data:`n_int` + * :c:data:`global_selection_buffer` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_slave_cipsi` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`davidson_slave_tcp` + * :c:func:`mpi_print` + * :c:func:`omp_set_nested` + * :c:func:`resident_memory` + * :c:func:`run_pt2_slave` + * :c:func:`run_selection_slave` + * :c:func:`sleep` + * :c:func:`wait_for_states` + * :c:func:`wall_time` + * :c:func:`write_double` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_e0_denominator` + * :c:data:`pt2_stoch_istate` + * :c:data:`state_average_weight` + * :c:data:`threshold_generators` + + +.. c:function:: run_stochastic_cipsi: + + + File : :file:`cipsi/stochastic_cipsi.irp.f` + + .. code:: fortran + + subroutine run_stochastic_cipsi + + + Selected Full Configuration Interaction with Stochastic selection and PT2. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`correlation_energy_ratio_max` + * :c:data:`n_iter` + * :c:data:`psi_energy_with_nucl_rep` + * :c:data:`psi_occ_pattern` + * :c:data:`pt2_max` + * :c:data:`n_det_max` + * :c:data:`n_states` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`s2_eig` + * :c:data:`variance_max` + * :c:data:`psi_energy` + * :c:data:`pt2_relative_error` + * :c:data:`ref_bitmask_energy` + * :c:data:`psi_det` + * :c:data:`n_states_diag` + * :c:data:`n_generators_bitmask` + * :c:data:`psi_det_sorted` + * :c:data:`psi_coef` + * :c:data:`threshold_generators` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`fci` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`copy_h_apply_buffer_to_wf` + * :c:func:`diagonalize_ci` + * :c:func:`ezfio_get_hartree_fock_energy` + * :c:func:`ezfio_has_hartree_fock_energy` + * :c:func:`make_s2_eigenfunction` + * :c:func:`print_extrapolated_energy` + * :c:func:`print_summary` + * :c:func:`save_energy` + * :c:func:`save_iterations` + * :c:func:`save_wavefunction` + * :c:func:`write_double` + * :c:func:`zmq_pt2` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`ci_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`n_det` + * :c:data:`n_iter` + * :c:data:`psi_occ_pattern` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_energy` + * :c:data:`psi_occ_pattern` + * :c:data:`psi_energy` + * :c:data:`pt2_stoch_istate` + * :c:data:`state_average_weight` + * :c:data:`threshold_generators` + + +.. c:function:: select_connected: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine select_connected(i_generator,E0,pt2,variance,norm,b,subset,csubset) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`generators_bitmask` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`n_int` + * :c:data:`n_generators_bitmask` + * :c:data:`psi_det_generators` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + * :c:func:`run_selection_slave` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`build_fock_tmp` + * :c:func:`select_singles_and_doubles` + + +.. c:function:: select_singles_and_doubles: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,variance,norm,buf,subset,csubset) + + + WARNING /!\ : It is assumed that the generators and selectors are psi_det_sorted + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`mo_num` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_det_selectors` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det_sorted` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_selectors_coef_transp` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`select_connected` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`apply_hole` + * :c:func:`bitstring_to_list_ab` + * :c:func:`fill_buffer_double` + * :c:func:`get_excitation_degree_spin` + * :c:func:`isort` + * :c:func:`splash_pq` + * :c:func:`spot_isinwf` + + +.. c:function:: selection_collector: + + + File : :file:`cipsi/zmq_selection.irp.f` + + .. code:: fortran + + subroutine selection_collector(zmq_socket_pull, b, N, pt2, variance, norm) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`n_states` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`add_to_selection_buffer` + * :c:func:`check_mem` + * :c:func:`create_selection_buffer` + * :c:func:`delete_selection_buffer` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`pull_selection_results` + * :c:func:`sort_selection_buffer` + + +.. c:function:: selection_slave_inproc: + + + File : :file:`cipsi/zmq_selection.irp.f` + + .. code:: fortran + + subroutine selection_slave_inproc(i) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_e0_denominator` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`run_selection_slave` + + +.. c:function:: sort_selection_buffer: + + + File : :file:`cipsi/selection_buffer.irp.f` + + .. code:: fortran + + subroutine sort_selection_buffer(b) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_to_selection_buffer` + * :c:func:`pt2_collector` + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + * :c:func:`run_selection_slave` + * :c:func:`selection_collector` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`dsort` + + +.. c:function:: splash_pq: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, interesting) + + + Computes the contributions A(r,s) by + comparing the external determinant to all the internal determinants det(i). + an applying two particles (r,s) to the mask. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_selectors_coef_transp` + * :c:data:`n_states` + * :c:data:`psi_det_sorted` + * :c:data:`n_int` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`select_singles_and_doubles` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_in_selection` + * :c:func:`get_d0` + * :c:func:`get_d1` + * :c:func:`get_d2` + * :c:func:`get_mask_phase` + * :c:func:`past_d1` + * :c:func:`past_d2` + + +.. c:function:: spot_isinwf: + + + File : :file:`cipsi/selection.irp.f` + + .. code:: fortran + + subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting) + + + Identify the determinants in det which are in the internal space. These are + the determinants that can be produced by creating two particles on the mask. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`select_singles_and_doubles` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_in_selection` + + +.. c:function:: testteethbuilding: + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + logical function testTeethBuilding(minF, N) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_stoch_istate` + * :c:data:`n_det_generators` + * :c:data:`psi_det_sorted_gen` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + + +.. c:function:: zmq_pt2: + + + File : :file:`cipsi/pt2_stoch_routines.irp.f` + + .. code:: fortran + + subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_sorted` + * :c:data:`pt2_stoch_istate` + * :c:data:`psi_selectors` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_alpha_unique` + * :c:data:`pt2_e0_denominator` + * :c:data:`pt2_n_teeth` + * :c:data:`psi_selectors_coef_transp` + * :c:data:`state_average_weight` + * :c:data:`n_det` + * :c:data:`s2_eig` + * :c:data:`pt2_j` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_occ_pattern_hii` + * :c:data:`mo_num` + * :c:data:`nthreads_pt2` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`mo_one_e_integrals` + * :c:data:`elec_alpha_num` + * :c:data:`nproc` + * :c:data:`h0_type` + * :c:data:`qp_max_mem` + * :c:data:`n_generators_bitmask` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`threshold_generators` + * :c:data:`psi_det_beta_unique` + * :c:data:`det_to_occ_pattern` + * :c:data:`psi_det_sorted` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_states` + * :c:data:`pt2_f` + * :c:data:`n_det_generators` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`n_int` + * :c:data:`psi_det_hii` + * :c:data:`pt2_j` + * :c:data:`global_selection_buffer` + * :c:data:`pt2_w` + * :c:data:`pt2_u` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`create_selection_buffer` + * :c:func:`delete_selection_buffer` + * :c:func:`end_parallel_job` + * :c:func:`fill_h_apply_buffer_no_selection` + * :c:func:`make_selection_buffer_s2` + * :c:func:`new_parallel_job` + * :c:func:`omp_set_nested` + * :c:func:`pt2_collector` + * :c:func:`pt2_slave_inproc` + * :c:func:`remove_duplicates_in_selection_buffer` + * :c:func:`resident_memory` + * :c:func:`write_double` + * :c:func:`write_int` + * :c:func:`zmq_selection` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + * :c:data:`pt2_stoch_istate` + * :c:data:`state_average_weight` + + +.. c:function:: zmq_selection: + + + File : :file:`cipsi/zmq_selection.irp.f` + + .. code:: fortran + + subroutine ZMQ_selection(N_in, pt2, variance, norm) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_sorted` + * :c:data:`psi_selectors` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`n_det_selectors` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`state_average_weight` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`pt2_e0_denominator` + * :c:data:`do_pt2` + * :c:data:`nproc` + * :c:data:`s2_eig` + * :c:data:`threshold_generators` + * :c:data:`psi_det_beta_unique` + * :c:data:`qp_max_mem` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_states` + * :c:data:`pt2_f` + * :c:data:`n_det_generators` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`zmq_pt2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`copy_h_apply_buffer_to_wf` + * :c:func:`create_selection_buffer` + * :c:func:`delete_selection_buffer` + * :c:func:`end_parallel_job` + * :c:func:`fill_h_apply_buffer_no_selection` + * :c:func:`make_selection_buffer_s2` + * :c:func:`new_parallel_job` + * :c:func:`save_wavefunction` + * :c:func:`selection_collector` + * :c:func:`selection_slave_inproc` + * :c:func:`write_double` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + diff --git a/docs/source/modules/cis.rst b/docs/source/modules/cis.rst new file mode 100644 index 000000000..7943d7ce7 --- /dev/null +++ b/docs/source/modules/cis.rst @@ -0,0 +1,280 @@ +.. _module_cis: + +.. program:: cis + +.. default-role:: option + +=== +cis +=== + +This module contains a |CIS| program. + +The user point of view +---------------------- + +The :ref:`cis` program performs the CI to obtain the ROHF reference + all +single excitations on top of it. This program can be very useful to: + +* **Ground state calculations**: generate a guess for the ground state wave + function if one is not sure that the :ref:`scf` program gave the lowest |SCF| + solution. In combination with :ref:`save_natorb` it can produce new |MOs| in + order to reperform an :ref:`scf` optimization. + +* **Excited states calculations**: generate guesses for all the + :option:`determinants n_states` wave functions, that will be used by the + :ref:`fci` program. + + +The main keywords/options to be used are: + +* :option:`determinants n_states`: number of states to consider for the |CIS| calculation + +* :option:`determinants s2_eig`: force all states to have the desired value of |S^2| + +* :option:`determinants expected_s2`: desired value of |S^2| + + + + +The programmer's point of view +------------------------------ + +This module was 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 + + + +Programs +-------- + + * :ref:`cis` + +Subroutines / functions +----------------------- + +.. c:function:: h_apply_cis: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cis() + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`n_states` + * :c:data:`generators_bitmask` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`s2_eig` + * :c:data:`n_det_generators` + * :c:data:`i_bitmask_gen` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`build_fock_tmp` + * :c:func:`copy_h_apply_buffer_to_wf` + * :c:func:`dsort` + * :c:func:`h_apply_cis_diexc` + * :c:func:`h_apply_cis_monoexc` + * :c:func:`make_s2_eigenfunction` + * :c:func:`wall_time` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_occ_pattern` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_occ_pattern` + + +.. c:function:: h_apply_cis_diexc: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cis_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_det` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cis` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cis_diexcp` + + +.. c:function:: h_apply_cis_diexcorg: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cis_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cis_diexcp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`fill_h_apply_buffer_no_selection` + + +.. c:function:: h_apply_cis_diexcp: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cis_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_det` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cis_diexc` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cis_diexcorg` + + +.. c:function:: h_apply_cis_monoexc: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cis_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) + + + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cis` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`fill_h_apply_buffer_no_selection` + diff --git a/docs/source/modules/cisd.rst b/docs/source/modules/cisd.rst new file mode 100644 index 000000000..7816de302 --- /dev/null +++ b/docs/source/modules/cisd.rst @@ -0,0 +1,273 @@ +.. _module_cisd: + +.. program:: cisd + +.. default-role:: option + +==== +cisd +==== + +This module contains a CI of single and double excitations. + +The user point of view +---------------------- + +The :command:`cisd` program performs the CI of the ROHF-like + all single and double excitations on top of it. +This program can be very useful to : + +* **Ground state calculations**: generate a guess for the ground state wave function if one is not sure that the :c:func:`scf` program gave the lowest SCF solution. In combination with :c:func:`save_natorb` it can produce new |MOs| in order to reperform an :c:func:`scf` optimization. + +* **Excited states calculations**: generate guess for all the :option:`determinants n_states` wave functions, that will be used by the :c:func:`fci` program. + + +The main keywords/options to be used are: + +* :option:`determinants n_states` : number of states to consider for the |cisd| calculation + +* :option:`determinants s2_eig` : force all states to have the desired value of :math:`S^2` + +* :option:`determinants expected_s2` : desired value of :math:`S^2` + +The programmer point of view +---------------------------- + +This module have been 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 + + + +Programs +-------- + + * :ref:`cisd` + +Subroutines / functions +----------------------- + +.. c:function:: h_apply_cisd: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cisd() + + + Calls H_apply on the |HF| determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`n_states` + * :c:data:`generators_bitmask` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`s2_eig` + * :c:data:`n_det_generators` + * :c:data:`i_bitmask_gen` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`build_fock_tmp` + * :c:func:`copy_h_apply_buffer_to_wf` + * :c:func:`dsort` + * :c:func:`h_apply_cisd_diexc` + * :c:func:`h_apply_cisd_monoexc` + * :c:func:`make_s2_eigenfunction` + * :c:func:`wall_time` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_occ_pattern` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_occ_pattern` + + +.. c:function:: h_apply_cisd_diexc: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cisd_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_det` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cisd` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cisd_diexcp` + + +.. c:function:: h_apply_cisd_diexcorg: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cisd_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cisd_diexcp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`fill_h_apply_buffer_no_selection` + + +.. c:function:: h_apply_cisd_diexcp: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cisd_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_det` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cisd_diexc` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cisd_diexcorg` + + +.. c:function:: h_apply_cisd_monoexc: + + + File : :file:`h_apply.irp.f_shell_8` + + .. code:: fortran + + subroutine H_apply_cisd_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) + + + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_apply_cisd` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`fill_h_apply_buffer_no_selection` + diff --git a/docs/source/modules/davidson.rst b/docs/source/modules/davidson.rst new file mode 100644 index 000000000..9de1a0a71 --- /dev/null +++ b/docs/source/modules/davidson.rst @@ -0,0 +1,1881 @@ +.. _module_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:`module_davidson_dressed` module should be used. If no dressing +is required, the :ref:`module_davidson` module should be used, and it +has a default zero dressing vector. + +The important providers for that module are: + +#. :c:data:`psi_energy` which is the expectation value over the wave + function (:c:data:`psi_det`, :c:data:`psi_coef`) of the Hamiltonian, + dressed or not. It uses the general subroutine :c:func:`u_0_H_u_0`. + +#. :c:data:`psi_energy_two_e` which is the expectation value over the + wave function (:c:data:`psi_det`, :c:data:`psi_coef`) of the standard + two-electron Coulomb operator. It uses the general routine + :c:func:`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: 15 + +.. option:: state_following + + If |true|, the states are re-ordered to match the input states + + Default: False + +.. option:: disk_based_davidson + + If |true|, a memory-mapped file may be used to store the W and S2 vectors if not enough RAM is available + + Default: True + +.. 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 + +.. option:: n_det_max_full + + Maximum number of determinants where |H| is fully diagonalized + + Default: 1000 + + +Providers +--------- + +.. c:var:: ci_eigenvectors + + + File : :file:`davidson/diagonalize_ci.irp.f` + + .. code:: fortran + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_s2 (N_states_diag) + + + Eigenvectors/values of the |CI| matrix + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`diag_algorithm` + * :c:data:`dressing_column_h` + * :c:data:`expected_s2` + * :c:data:`h_matrix_all_dets` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`nthreads_davidson` + * :c:data:`only_expected_s2` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`s2_eig` + * :c:data:`s2_matrix_all_dets` + * :c:data:`s_z` + * :c:data:`threshold_davidson` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_energy` + + +.. c:var:: ci_electronic_energy + + + File : :file:`davidson/diagonalize_ci.irp.f` + + .. code:: fortran + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_s2 (N_states_diag) + + + Eigenvectors/values of the |CI| matrix + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`diag_algorithm` + * :c:data:`dressing_column_h` + * :c:data:`expected_s2` + * :c:data:`h_matrix_all_dets` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`nthreads_davidson` + * :c:data:`only_expected_s2` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`s2_eig` + * :c:data:`s2_matrix_all_dets` + * :c:data:`s_z` + * :c:data:`threshold_davidson` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_energy` + + +.. c:var:: ci_energy + + + File : :file:`davidson/diagonalize_ci.irp.f` + + .. code:: fortran + + double precision, allocatable :: ci_energy (N_states_diag) + + + :c:data:`n_states` lowest eigenvalues of the |CI| matrix + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`nuclear_repulsion` + * :c:data:`output_wall_time_0` + + + +.. c:var:: ci_s2 + + + File : :file:`davidson/diagonalize_ci.irp.f` + + .. code:: fortran + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_s2 (N_states_diag) + + + Eigenvectors/values of the |CI| matrix + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`diag_algorithm` + * :c:data:`dressing_column_h` + * :c:data:`expected_s2` + * :c:data:`h_matrix_all_dets` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`nthreads_davidson` + * :c:data:`only_expected_s2` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`s2_eig` + * :c:data:`s2_matrix_all_dets` + * :c:data:`s_z` + * :c:data:`threshold_davidson` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_energy` + + +.. c:var:: davidson_criterion + + + File : :file:`davidson/parameters.irp.f` + + .. code:: fortran + + character(64) :: davidson_criterion + + + Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] + + + +.. c:var:: diag_algorithm + + + File : :file:`davidson/diagonalization_hs2_dressed.irp.f` + + .. code:: fortran + + character*(64) :: diag_algorithm + + + Diagonalization algorithm (Davidson or Lapack) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_det_max_full` + * :c:data:`n_states` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + + +.. c:var:: dressed_column_idx + + + File : :file:`davidson/diagonalization_hs2_dressed.irp.f` + + .. code:: fortran + + integer, allocatable :: dressed_column_idx (N_states) + + + Index of the dressed columns + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_coef` + + + +.. c:var:: n_states_diag + + + File : :file:`davidson/input.irp.f` + + .. code:: fortran + + integer :: n_states_diag + + + Number of states to consider during the Davdison diagonalization + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + * :c:data:`n_states` + * :c:data:`output_wall_time_0` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`ci_energy` + * :c:data:`psi_energy` + + +.. c:var:: nthreads_davidson + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + integer :: nthreads_davidson + + + Number of threads for Davidson + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`nproc` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + + +.. c:var:: psi_energy + + + File : :file:`davidson/u0_h_u0.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_energy (N_states) + double precision, allocatable :: psi_s2 (N_states) + + + psi_energy(i) = :math:`\langle \Psi_i | H | \Psi_i \rangle` + + psi_s2(i) = :math:`\langle \Psi_i | S^2 | \Psi_i \rangle` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`distributed_davidson` + * :c:data:`h_matrix_all_dets` + * :c:data:`n_det` + * :c:data:`n_det_max_full` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`s2_matrix_all_dets` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_energy_two_e` + * :c:data:`psi_energy_with_nucl_rep` + * :c:data:`pt2_e0_denominator` + + +.. c:var:: psi_energy_two_e + + + File : :file:`davidson/u0_wee_u0.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_energy_two_e (N_states) + + + Energy of the current wave function + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_energy` + + + +.. c:var:: psi_energy_with_nucl_rep + + + File : :file:`davidson/u0_h_u0.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_energy_with_nucl_rep (N_states) + + + Energy of the wave function with the nuclear repulsion energy. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`nuclear_repulsion` + * :c:data:`psi_energy` + + + +.. c:var:: psi_s2 + + + File : :file:`davidson/u0_h_u0.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_energy (N_states) + double precision, allocatable :: psi_s2 (N_states) + + + psi_energy(i) = :math:`\langle \Psi_i | H | \Psi_i \rangle` + + psi_s2(i) = :math:`\langle \Psi_i | S^2 | \Psi_i \rangle` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`distributed_davidson` + * :c:data:`h_matrix_all_dets` + * :c:data:`n_det` + * :c:data:`n_det_max_full` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`s2_matrix_all_dets` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_energy_two_e` + * :c:data:`psi_energy_with_nucl_rep` + * :c:data:`pt2_e0_denominator` + + + +Subroutines / functions +----------------------- + +.. c:function:: davidson_collector: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze, N_st) + + + Routine collecting the results of the workers in Davidson's algorithm. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_zmq` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_pull_results` + + +.. c:function:: davidson_converged: + + + File : :file:`davidson/parameters.irp.f` + + .. code:: fortran + + subroutine davidson_converged(energy,residual,wall,iterations,cpu,N_st,converged) + + + True if the Davidson algorithm is converged + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`threshold_davidson` + * :c:data:`davidson_criterion` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_diag_hjj_sjj` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`cpu_time` + * :c:func:`wall_time` + + +.. c:function:: davidson_diag_hjj_sjj: + + + File : :file:`davidson/diagonalization_hs2_dressed.irp.f` + + .. code:: fortran + + subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_st,N_st_diag_in,Nint,dressing_state,converged) + + + 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_in : Number of states in which H is diagonalized. Assumed > sze + + Initial guess vectors are not necessarily orthonormal + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_coef` + * :c:data:`dressed_column_idx` + * :c:data:`expected_s2` + * :c:data:`s_z` + * :c:data:`n_det` + * :c:data:`dressing_column_h` + * :c:data:`ezfio_work_dir` + * :c:data:`davidson_sze_max` + * :c:data:`state_following` + * :c:data:`psi_det_alpha_unique` + * :c:data:`nuclear_repulsion` + * :c:data:`nproc` + * :c:data:`qp_max_mem` + * :c:data:`disk_based_davidson` + * :c:data:`s2_eig` + * :c:data:`psi_det_beta_unique` + * :c:data:`only_expected_s2` + * :c:data:`distributed_davidson` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_diag_hs2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`c_f_pointer` + * :c:func:`check_mem` + * :c:func:`cpu_time` + * :c:func:`davidson_converged` + * :c:func:`dgemm` + * :c:func:`dswap` + * :c:func:`h_s2_u_0_nstates_openmp` + * :c:func:`h_s2_u_0_nstates_zmq` + * :c:func:`lapack_diag` + * :c:func:`mmap` + * :c:func:`munmap` + * :c:func:`normalize` + * :c:func:`ortho_qr` + * :c:func:`random_number` + * :c:func:`resident_memory` + * :c:func:`sgemm` + * :c:func:`wall_time` + * :c:func:`write_double` + * :c:func:`write_int` + * :c:func:`write_time` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`nthreads_davidson` + + +.. c:function:: davidson_diag_hs2: + + + File : :file:`davidson/diagonalization_hs2_dressed.irp.f` + + .. code:: fortran + + subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_diag,Nint,dressing_state,converged) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`dressing_column_h` + * :c:data:`mo_two_e_integrals_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_diag_hjj_sjj` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`nthreads_davidson` + + +.. c:function:: davidson_pull_results: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_pull_results(zmq_socket_pull, v_t, s_t, imin, imax, task_id) + + + Pull the results of $H | U \rangle$ on the master. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + * :c:data:`n_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_collector` + + +.. c:function:: davidson_push_results: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_push_results(zmq_socket_push, v_t, s_t, imin, imax, task_id) + + + Push the results of $H | U \rangle$ from a worker to the master. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + * :c:data:`n_det` + + +.. c:function:: davidson_push_results_async_recv: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_push_results_async_recv(zmq_socket_push,sending) + + + Push the results of $H | U \rangle$ from a worker to the master. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_slave_work` + + +.. c:function:: davidson_push_results_async_send: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_push_results_async_send(zmq_socket_push, v_t, s_t, imin, imax, task_id,sending) + + + Push the results of $H | U \rangle$ from a worker to the master. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + * :c:data:`n_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_slave_work` + + +.. c:function:: davidson_run_slave: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_run_slave(thread,iproc) + + + Slave routine for Davidson's diagonalization. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + * :c:data:`n_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_slave_inproc` + * :c:func:`davidson_slave_tcp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_slave_work` + * :c:func:`end_zmq_push_socket` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`sleep` + + +.. c:function:: davidson_slave_inproc: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_slave_inproc(i) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_zmq` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_run_slave` + + +.. c:function:: davidson_slave_tcp: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_slave_tcp(i) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_slave_main` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_run_slave` + + +.. c:function:: davidson_slave_work: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine davidson_slave_work(zmq_to_qp_run_socket, zmq_socket_push, N_st, sze, worker_id) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`mpi_rank` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`mpi_initialized` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`nproc` + * :c:data:`ref_bitmask_energy` + * :c:data:`n_states_diag` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_run_slave` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_push_results_async_recv` + * :c:func:`davidson_push_results_async_send` + * :c:func:`h_s2_u_0_nstates_openmp_work` + + +.. c:function:: diagonalize_ci: + + + File : :file:`davidson/diagonalize_ci.irp.f` + + .. code:: fortran + + subroutine diagonalize_CI + + + Replace the coefficients of the |CI| states by the coefficients of the + eigenstates of the |CI| matrix. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`ci_electronic_energy` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`ci_electronic_energy` + * :c:data:`psi_energy` + * :c:data:`ci_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`psi_energy` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`remove_small_contributions` + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`ci_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`psi_coef` + * :c:data:`psi_energy` + * :c:data:`psi_energy` + + +.. c:function:: h_s2_u_0_nstates_openmp: + + + File : :file:`davidson/u0_h_u0.irp.f` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze) + + + Computes $v_0 = H | u_0\rangle$ and $s_0 = S^2 | u_0\rangle$. + + Assumes that the determinants are in psi_det + + istart, iend, ishift, istep are used in ZMQ parallelization. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_diag_hjj_sjj` + * :c:func:`u_0_h_u_0` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dset_order` + * :c:func:`dtranspose` + * :c:func:`h_s2_u_0_nstates_openmp_work` + + +.. c:function:: h_s2_u_0_nstates_openmp_work: + + + File : :file:`davidson/u0_h_u0.irp.f` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t\rangle$ and $s_t = S^2 | u_t\rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask_energy` + * :c:data:`n_det` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_slave_work` + * :c:func:`h_s2_u_0_nstates_openmp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work_1` + * :c:func:`h_s2_u_0_nstates_openmp_work_2` + * :c:func:`h_s2_u_0_nstates_openmp_work_3` + * :c:func:`h_s2_u_0_nstates_openmp_work_4` + * :c:func:`h_s2_u_0_nstates_openmp_work_n_int` + + +.. c:function:: h_s2_u_0_nstates_openmp_work_1: + + + File : :file:`davidson/u0_h_u0.irp.f_template_645` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t\rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`singles_beta_csc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`singles_beta_csc_idx` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_1` + * :c:func:`get_all_spin_singles_and_doubles_1` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_h_j_single_spin` + + +.. c:function:: h_s2_u_0_nstates_openmp_work_2: + + + File : :file:`davidson/u0_h_u0.irp.f_template_645` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t\rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`singles_beta_csc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`singles_beta_csc_idx` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_2` + * :c:func:`get_all_spin_singles_and_doubles_2` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_h_j_single_spin` + + +.. c:function:: h_s2_u_0_nstates_openmp_work_3: + + + File : :file:`davidson/u0_h_u0.irp.f_template_645` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t\rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`singles_beta_csc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`singles_beta_csc_idx` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_3` + * :c:func:`get_all_spin_singles_and_doubles_3` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_h_j_single_spin` + + +.. c:function:: h_s2_u_0_nstates_openmp_work_4: + + + File : :file:`davidson/u0_h_u0.irp.f_template_645` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t\rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`singles_beta_csc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`singles_beta_csc_idx` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_4` + * :c:func:`get_all_spin_singles_and_doubles_4` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_h_j_single_spin` + + +.. c:function:: h_s2_u_0_nstates_openmp_work_n_int: + + + File : :file:`davidson/u0_h_u0.irp.f_template_645` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t\rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`singles_beta_csc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`singles_beta_csc_idx` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles_n_int` + * :c:func:`get_all_spin_singles_n_int` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_h_j_single_spin` + + +.. c:function:: h_s2_u_0_nstates_zmq: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze) + + + Computes $v_0 = H | u_0\rangle$ and $s_0 = S^2 | u_0\rangle$ + + n : number of determinants + + H_jj : array of $\langle j | H | j \rangle$ + + S2_jj : array of $\langle j | S^2 | j \rangle$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`mpi_initialized` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`nproc` + * :c:data:`ref_bitmask_energy` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_diag_hjj_sjj` + * :c:func:`u_0_h_u_0` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_collector` + * :c:func:`davidson_slave_inproc` + * :c:func:`dset_order` + * :c:func:`dtranspose` + * :c:func:`end_parallel_job` + * :c:func:`new_parallel_job` + * :c:func:`omp_set_nested` + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp: + + + File : :file:`davidson/u0_wee_u0.irp.f` + + .. code:: fortran + + subroutine H_S2_u_0_two_e_nstates_openmp(v_0,s_0,u_0,N_st,sze) + + + Computes $v_0 = H | u_0\rangle$ and $s_0 = S^2 | u_0\rangle$ + + Assumes that the determinants are in psi_det + + istart, iend, ishift, istep are used in ZMQ parallelization. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`u_0_h_u_0_two_e` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dset_order` + * :c:func:`dtranspose` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work` + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work: + + + File : :file:`davidson/u0_wee_u0.irp.f` + + .. code:: fortran + + subroutine H_S2_u_0_two_e_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t\rangle$ and $s_t = S^2 | u_t\rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask_energy` + * :c:data:`n_det` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_two_e_nstates_openmp` + + Calls: + + .. hlist:: + :columns: 3 + + * :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:function:: h_s2_u_0_two_e_nstates_openmp_work_1: + + + File : :file:`davidson/u0_wee_u0.irp.f_template_457` + + .. code:: fortran + + subroutine H_S2_u_0_two_e_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t \rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_1` + * :c:func:`get_all_spin_singles_and_doubles_1` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_wee_j_single` + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_2: + + + File : :file:`davidson/u0_wee_u0.irp.f_template_457` + + .. code:: fortran + + subroutine H_S2_u_0_two_e_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t \rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_2` + * :c:func:`get_all_spin_singles_and_doubles_2` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_wee_j_single` + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_3: + + + File : :file:`davidson/u0_wee_u0.irp.f_template_457` + + .. code:: fortran + + subroutine H_S2_u_0_two_e_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t \rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_3` + * :c:func:`get_all_spin_singles_and_doubles_3` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_wee_j_single` + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_4: + + + File : :file:`davidson/u0_wee_u0.irp.f_template_457` + + .. code:: fortran + + subroutine H_S2_u_0_two_e_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t \rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_4` + * :c:func:`get_all_spin_singles_and_doubles_4` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_wee_j_single` + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_n_int: + + + File : :file:`davidson/u0_wee_u0.irp.f_template_457` + + .. code:: fortran + + 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) + + + Computes $v_t = H | u_t \rangle$ and $s_t = S^2 | u_t \rangle$ + + Default should be 1,N_det,0,1 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`nthreads_davidson` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`psi_bilinear_matrix_columns_loc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles_n_int` + * :c:func:`get_all_spin_singles_n_int` + * :c:func:`get_s2` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_double_spin` + * :c:func:`i_wee_j_single` + + +.. c:function:: u_0_h_u_0: + + + File : :file:`davidson/u0_h_u0.irp.f` + + .. code:: fortran + + subroutine u_0_H_u_0(e_0,s_0,u_0,n,keys_tmp,Nint,N_st,sze) + + + Computes $E_0 = \frac{\langle u_0 | H | u_0 \rangle}{\langle u_0 | u_0 \rangle}$ + + and $S_0 = \frac{\langle u_0 | S^2 | u_0 \rangle}{\langle u_0 | u_0 \rangle}$ + + n : number of determinants + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_all_dets` + * :c:data:`s2_matrix_all_dets` + * :c:data:`n_states_diag` + * :c:data:`distributed_davidson` + * :c:data:`n_det_max_full` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_energy` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp` + * :c:func:`h_s2_u_0_nstates_zmq` + + +.. c:function:: u_0_h_u_0_two_e: + + + File : :file:`davidson/u0_wee_u0.irp.f` + + .. code:: fortran + + subroutine u_0_H_u_0_two_e(e_0,u_0,n,keys_tmp,Nint,N_st,sze) + + + Computes $E_0 = \frac{ \langle u_0 | H | u_0\rangle}{\langle u_0 | u_0 \rangle}$. + + n : number of determinants + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_energy_two_e` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_two_e_nstates_openmp` + + +.. c:function:: zmq_get_n_states_diag: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + integer function zmq_get_N_states_diag(zmq_to_qp_run_socket, worker_id) + + + Get N_states_diag from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + + +.. c:function:: zmq_put_n_states_diag: + + + File : :file:`davidson/davidson_parallel.irp.f` + + .. code:: fortran + + integer function zmq_put_N_states_diag(zmq_to_qp_run_socket,worker_id) + + + Put N_states_diag on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states_diag` + * :c:data:`zmq_state` + diff --git a/docs/source/modules/davidson_dressed.rst b/docs/source/modules/davidson_dressed.rst new file mode 100644 index 000000000..38d8fc1e0 --- /dev/null +++ b/docs/source/modules/davidson_dressed.rst @@ -0,0 +1,13 @@ +.. _module_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 000000000..326f48d94 --- /dev/null +++ b/docs/source/modules/davidson_undressed.rst @@ -0,0 +1,75 @@ +.. _module_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 + + + File : :file:`davidson_undressed/null_dressing_vector.irp.f` + + .. code:: fortran + + double precision, allocatable :: dressing_column_h (N_det,N_states) + double precision, allocatable :: dressing_column_s (N_det,N_states) + + + Null dressing vectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + + +.. c:var:: dressing_column_s + + + File : :file:`davidson_undressed/null_dressing_vector.irp.f` + + .. code:: fortran + + double precision, allocatable :: dressing_column_h (N_det,N_states) + double precision, allocatable :: dressing_column_s (N_det,N_states) + + + Null dressing vectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + diff --git a/docs/source/modules/density_for_dft.rst b/docs/source/modules/density_for_dft.rst new file mode 100644 index 000000000..fb48eb83d --- /dev/null +++ b/docs/source/modules/density_for_dft.rst @@ -0,0 +1,324 @@ +.. _module_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| directory (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 + +.. option:: no_core_density + + if [no_core_dm] then all elements of the density matrix involving at least one orbital set as core are set to zero + + Default: full_density + + +Providers +--------- + +.. c:var:: one_body_dm_mo_alpha_one_det + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_body_dm_mo_alpha_one_det (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta_one_det (mo_num,mo_num,N_states) + + + One body density matrix on the |MO| basis for a single determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`n_states` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + +.. c:var:: one_body_dm_mo_beta_one_det + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_body_dm_mo_alpha_one_det (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta_one_det (mo_num,mo_num,N_states) + + + One body density matrix on the |MO| basis for a single determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`n_states` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + +.. c:var:: one_e_dm_alpha_ao_for_dft + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_e_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + + + one body density matrix on the AO basis based on one_e_dm_mo_alpha_for_dft + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_alpha_in_r` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + +.. c:var:: one_e_dm_average_mo_for_dft + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_average_mo_for_dft (mo_num,mo_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_for_dft` + * :c:data:`state_average_weight` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`short_range_hartree_operator` + + +.. c:var:: one_e_dm_beta_ao_for_dft + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_e_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + + + one body density matrix on the AO basis based on one_e_dm_mo_alpha_for_dft + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_alpha_in_r` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + +.. c:var:: one_e_dm_mo_alpha_for_dft + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_alpha_for_dft (mo_num,mo_num,N_states) + + + density matrix for alpha electrons in the MO basis used for all DFT calculations based on the density + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`damping_for_rs_dft` + * :c:data:`data_one_e_dm_alpha_mo` + * :c:data:`density_for_dft` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_states` + * :c:data:`no_core_density` + * :c:data:`one_body_dm_mo_alpha_one_det` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`one_e_dm_mo_alpha_average` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_alpha_ao_for_dft` + * :c:data:`one_e_dm_mo_for_dft` + * :c:data:`psi_dft_energy_kinetic` + * :c:data:`trace_v_xc` + * :c:data:`trace_v_xc_new` + + +.. c:var:: one_e_dm_mo_beta_for_dft + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_beta_for_dft (mo_num,mo_num,N_states) + + + density matrix for beta electrons in the MO basis used for all DFT calculations based on the density + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`damping_for_rs_dft` + * :c:data:`data_one_e_dm_beta_mo` + * :c:data:`density_for_dft` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + * :c:data:`n_states` + * :c:data:`no_core_density` + * :c:data:`one_body_dm_mo_alpha_one_det` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`one_e_dm_mo_alpha_average` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_alpha_ao_for_dft` + * :c:data:`one_e_dm_mo_for_dft` + * :c:data:`psi_dft_energy_kinetic` + * :c:data:`trace_v_xc` + * :c:data:`trace_v_xc_new` + + +.. c:var:: one_e_dm_mo_for_dft + + + File : :file:`density_for_dft/density_for_dft.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_for_dft (mo_num,mo_num,N_states) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_average_mo_for_dft` + * :c:data:`short_range_hartree_operator` + diff --git a/docs/source/modules/determinants.rst b/docs/source/modules/determinants.rst new file mode 100644 index 000000000..0f2b7348c --- /dev/null +++ b/docs/source/modules/determinants.rst @@ -0,0 +1,8039 @@ +.. _module_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 +* :c:data:`psi_det`: list of determinants in the wave function used in many routines/providers of the |QP|. +* :c:data:`psi_coef`: list of coefficients, for all :option:`determinants n_states` states, and all determinants. + +The main routines for this module are: + +* :c:func:`i_H_j`: computes the Hamiltonian matrix element between two arbitrary Slater determinants. +* :c:func:`i_H_j_s2`: computes the Hamiltonian and (|S^2|) matrix element between two arbitrary Slater determinants. +* :c:func:`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. +* :c:func:`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_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 + + Weight used in the calculation of the one-electron density matrix. 0: 1./(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi)) + + Default: 1 + +.. 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:`module_bitmask`) + + +.. option:: bit_kind + + (set in module :ref:`module_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 + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Max and min values of the coefficients + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_states` + * :c:data:`psi_coef` + + + +.. c:var:: abs_psi_coef_min + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Max and min values of the coefficients + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_states` + * :c:data:`psi_coef` + + + +.. c:var:: barycentric_electronic_energy + + + File : :file:`determinants/energy.irp.f` + + .. code:: fortran + + double precision, allocatable :: barycentric_electronic_energy (N_states) + + + :math:`E_n = \sum_i {c_i^{(n)}}^2 H_{ii}` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_coef` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_e0_denominator` + + +.. c:var:: c0_weight + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: c0_weight (N_states) + + + Weight of the states in the selection : :math:`\frac{1}{c_0^2}` . + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`psi_coef` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`selection_weight` + * :c:data:`state_average_weight` + + +.. c:var:: det_alpha_norm + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) + double precision, allocatable :: det_beta_norm (N_det_beta_unique) + + + Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: + + :math:`||D_\alpha||_i = \sum_j C_{ij}^2` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + * :c:data:`state_average_weight` + + + +.. c:var:: det_beta_norm + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) + double precision, allocatable :: det_beta_norm (N_det_beta_unique) + + + Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: + + :math:`||D_\alpha||_i = \sum_j C_{ij}^2` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + * :c:data:`state_average_weight` + + + +.. c:var:: det_to_occ_pattern + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + integer, allocatable :: det_to_occ_pattern (N_det) + + + Returns the index of the occupation pattern for each determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_occ_pattern` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_occ_pattern_hii` + * :c:data:`weight_occ_pattern` + + +.. c:var:: diagonal_h_matrix_on_psi_det + + + File : :file:`determinants/energy.irp.f` + + .. code:: fortran + + double precision, allocatable :: diagonal_h_matrix_on_psi_det (N_det) + + + Diagonal of the Hamiltonian ordered as psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`barycentric_electronic_energy` + + +.. c:var:: double_exc_bitmask + + + File : :file:`determinants/determinants_bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: double_exc_bitmask (N_int,4,N_double_exc_bitmasks) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`hf_bitmask` + * :c:data:`n_double_exc_bitmasks` + * :c:data:`n_int` + + + +.. c:var:: expected_s2 + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + double precision :: expected_s2 + + + Expected value of |S^2| : S*(S+1) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + + +.. c:var:: fock_operator_closed_shell_ref_bitmask + + + File : :file:`determinants/single_excitations.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_operator_closed_shell_ref_bitmask (mo_num,mo_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`full_ijkl_bitmask` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_int` + * :c:data:`ref_closed_shell_bitmask` + + + +.. c:var:: fock_wee_closed_shell + + + File : :file:`determinants/single_excitation_two_e.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_wee_closed_shell (mo_num,mo_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`full_ijkl_bitmask` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_int` + * :c:data:`ref_closed_shell_bitmask` + + + +.. c:var:: h_apply_buffer_allocated + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + logical :: h_apply_buffer_allocated + integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) + + + Buffer of determinants/coefficients/perturbative energy for H_apply. + Uninitialized. Filled by H_apply subroutines. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`nproc` + + + +.. c:var:: h_apply_buffer_lock + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + logical :: h_apply_buffer_allocated + integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) + + + Buffer of determinants/coefficients/perturbative energy for H_apply. + Uninitialized. Filled by H_apply subroutines. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`nproc` + + + +.. c:var:: h_matrix_all_dets + + + File : :file:`determinants/utils.irp.f` + + .. code:: fortran + + double precision, allocatable :: h_matrix_all_dets (N_det,N_det) + + + |H| matrix on the basis of the Slater determinants defined by psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`psi_energy` + + +.. c:var:: h_matrix_cas + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + double precision, allocatable :: h_matrix_cas (N_det_cas,N_det_cas) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_int` + * :c:data:`psi_cas` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_cas_energy` + * :c:data:`psi_coef_cas_diagonalized` + + +.. c:var:: idx_cas + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + |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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`hf_bitmask` + * :c:data:`mpi_master` + * :c:data:`n_cas_bitmask` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_cas` + * :c:data:`psi_cas_energy` + * :c:data:`psi_cas_sorted_bit` + * :c:data:`psi_coef_cas_diagonalized` + * :c:data:`psi_non_cas` + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: idx_non_cas + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: max_degree_exc + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + integer :: max_degree_exc + + + Maximum degree of excitation in the wave function with respect to the Hartree-Fock + determinant. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`hf_bitmask` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + + + +.. c:var:: n_det + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + integer :: n_det + + + Number of determinants in the wave function + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mo_label` + * :c:data:`mpi_master` + * :c:data:`nproc` + * :c:data:`read_wf` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`barycentric_electronic_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`ci_energy` + * :c:data:`det_alpha_norm` + * :c:data:`det_to_occ_pattern` + * :c:data:`diag_algorithm` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`dressed_column_idx` + * :c:data:`dressing_column_h` + * :c:data:`extrapolated_energy` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`h_matrix_all_dets` + * :c:data:`max_degree_exc` + * :c:data:`n_det_generators` + * :c:data:`n_det_selectors` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_average_norm_contrib` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_cas` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_hii` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_energy` + * :c:data:`psi_energy_two_e` + * :c:data:`psi_non_cas` + * :c:data:`psi_occ_pattern` + * :c:data:`psi_occ_pattern_hii` + * :c:data:`s2_matrix_all_dets` + * :c:data:`s2_values` + * :c:data:`weight_occ_pattern` + + +.. c:var:: n_det_alpha_unique + + + File : :file:`determinants/spindeterminants.irp.f_template_144` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) + integer :: n_det_alpha_unique + + + Unique :math:`\alpha` determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det_alpha` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`singles_alpha_csc` + * :c:data:`singles_alpha_csc_idx` + + +.. c:var:: n_det_beta_unique + + + File : :file:`determinants/spindeterminants.irp.f_template_144` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) + integer :: n_det_beta_unique + + + Unique :math:`\beta` determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det_beta` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`singles_beta_csc` + * :c:data:`singles_beta_csc_idx` + + +.. c:var:: n_det_cas + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + |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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`hf_bitmask` + * :c:data:`mpi_master` + * :c:data:`n_cas_bitmask` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_cas` + * :c:data:`psi_cas_energy` + * :c:data:`psi_cas_sorted_bit` + * :c:data:`psi_coef_cas_diagonalized` + * :c:data:`psi_non_cas` + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: n_det_non_cas + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: n_double_exc_bitmasks + + + File : :file:`determinants/determinants_bitmasks.irp.f` + + .. code:: fortran + + integer :: n_double_exc_bitmasks + + + Number of double excitation bitmasks + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`double_exc_bitmask` + + +.. c:var:: n_occ_pattern + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) + integer :: n_occ_pattern + + + 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` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_to_occ_pattern` + * :c:data:`psi_occ_pattern_hii` + * :c:data:`weight_occ_pattern` + + +.. c:var:: n_single_exc_bitmasks + + + File : :file:`determinants/determinants_bitmasks.irp.f` + + .. code:: fortran + + integer :: n_single_exc_bitmasks + + + Number of single excitation bitmasks + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`single_exc_bitmask` + + +.. c:var:: one_e_dm_ao_alpha + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_e_dm_ao_beta (ao_num,ao_num) + + + One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` . + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`one_e_dm_mo_alpha_average` + + + +.. c:var:: one_e_dm_ao_beta + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_e_dm_ao_beta (ao_num,ao_num) + + + One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` . + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`one_e_dm_mo_alpha_average` + + + +.. c:var:: one_e_dm_dagger_mo_spin_index + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_dagger_mo_spin_index (mo_num,mo_num,N_states,2) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha` + + + +.. c:var:: one_e_dm_mo + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo (mo_num,mo_num) + + + One-body density matrix + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`one_e_dm_mo_alpha_average` + + + +.. c:var:: one_e_dm_mo_alpha + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_beta (mo_num,mo_num,N_states) + + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_dagger_mo_spin_index` + * :c:data:`one_e_dm_mo_alpha_average` + * :c:data:`one_e_dm_mo_diff` + * :c:data:`one_e_dm_mo_spin_index` + * :c:data:`psi_energy_h_core` + + +.. c:var:: one_e_dm_mo_alpha_average + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_e_dm_mo_beta_average (mo_num,mo_num) + + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`state_average_weight` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_ao_alpha` + * :c:data:`one_e_dm_mo` + * :c:data:`one_e_spin_density_mo` + + +.. c:var:: one_e_dm_mo_beta + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_beta (mo_num,mo_num,N_states) + + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_dagger_mo_spin_index` + * :c:data:`one_e_dm_mo_alpha_average` + * :c:data:`one_e_dm_mo_diff` + * :c:data:`one_e_dm_mo_spin_index` + * :c:data:`psi_energy_h_core` + + +.. c:var:: one_e_dm_mo_beta_average + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_e_dm_mo_beta_average (mo_num,mo_num) + + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`state_average_weight` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_ao_alpha` + * :c:data:`one_e_dm_mo` + * :c:data:`one_e_spin_density_mo` + + +.. c:var:: one_e_dm_mo_diff + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_diff (mo_num,mo_num,2:N_states) + + + Difference of the one-body density matrix with respect to the ground state + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha` + + + +.. c:var:: one_e_dm_mo_spin_index + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_mo_spin_index (mo_num,mo_num,N_states,2) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha` + + + +.. c:var:: one_e_spin_density_ao + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_spin_density_ao (ao_num,ao_num) + + + One body spin density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha) - \rho_{AO}(\beta)` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`one_e_spin_density_mo` + + + +.. c:var:: one_e_spin_density_mo + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_spin_density_mo (mo_num,mo_num) + + + :math:`\rho(\alpha) - \rho(\beta)` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`one_e_dm_mo_alpha_average` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_spin_density_ao` + + +.. c:var:: psi_average_norm_contrib + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_average_norm_contrib (psi_det_size) + + + Contribution of determinants to the state-averaged density. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det_size` + * :c:data:`state_average_weight` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_sorted` + + +.. c:var:: psi_average_norm_contrib_sorted + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_average_norm_contrib` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`n_det_selectors` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`psi_selectors` + + +.. c:var:: psi_bilinear_matrix + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_bilinear_matrix (N_det_alpha_unique,N_det_beta_unique,N_states) + + + Coefficient matrix if the wave function is expressed in a bilinear form : + + :math:`D_\alpha^\dagger.C.D_\beta` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + + + +.. c:var:: psi_bilinear_matrix_columns + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_transp_values` + + +.. c:var:: psi_bilinear_matrix_columns_loc + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer, allocatable :: psi_bilinear_matrix_columns_loc (N_det_beta_unique+1) + + + 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 :c:data:`psi_det` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_beta_unique` + + + +.. c:var:: psi_bilinear_matrix_order + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_transp_values` + + +.. c:var:: psi_bilinear_matrix_order_reverse + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer, allocatable :: psi_bilinear_matrix_order_reverse (N_det) + + + Order which allows to go from :c:data:`psi_bilinear_matrix` to :c:data:`psi_det` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_values` + + + +.. c:var:: psi_bilinear_matrix_order_transp_reverse + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer, allocatable :: psi_bilinear_matrix_order_transp_reverse (N_det) + + + Order which allows to go from :c:data:`psi_bilinear_matrix_order_transp` to + :c:data:`psi_bilinear_matrix` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + + + +.. c:var:: psi_bilinear_matrix_rows + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_transp_values` + + +.. c:var:: psi_bilinear_matrix_transp_columns + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + Transpose of :c:data:`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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + + +.. c:var:: psi_bilinear_matrix_transp_order + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + Transpose of :c:data:`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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + + +.. c:var:: psi_bilinear_matrix_transp_rows + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + Transpose of :c:data:`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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + + +.. c:var:: psi_bilinear_matrix_transp_rows_loc + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer, allocatable :: psi_bilinear_matrix_transp_rows_loc (N_det_alpha_unique+1) + + + Location of the columns in the :c:data:`psi_bilinear_matrix` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_det_alpha_unique` + + + +.. c:var:: psi_bilinear_matrix_transp_values + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + Transpose of :c:data:`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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix_order_transp_reverse` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + + +.. c:var:: psi_bilinear_matrix_values + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_bilinear_matrix_order_reverse` + * :c:data:`psi_bilinear_matrix_transp_values` + + +.. c:var:: psi_cas + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + |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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`hf_bitmask` + * :c:data:`mpi_master` + * :c:data:`n_cas_bitmask` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_cas` + * :c:data:`psi_cas_energy` + * :c:data:`psi_cas_sorted_bit` + * :c:data:`psi_coef_cas_diagonalized` + * :c:data:`psi_non_cas` + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: psi_cas_coef + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + |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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`cas_bitmask` + * :c:data:`hf_bitmask` + * :c:data:`mpi_master` + * :c:data:`n_cas_bitmask` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_cas` + * :c:data:`psi_cas_energy` + * :c:data:`psi_cas_sorted_bit` + * :c:data:`psi_coef_cas_diagonalized` + * :c:data:`psi_non_cas` + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: psi_cas_coef_sorted_bit + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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) + + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave + function. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_det_size` + + + +.. c:var:: psi_cas_energy + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_cas_energy (N_states) + + + Variational energy of :math:`\Psi_{CAS}` , where :math:`\Psi_{CAS} = \sum_{I \in CAS} \I \rangle \langle I | \Psi \rangle` . + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_cas` + * :c:data:`n_states` + * :c:data:`psi_cas` + + + +.. c:var:: psi_cas_energy_diagonalized + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) + double precision, allocatable :: psi_cas_energy_diagonalized (N_states) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_cas` + * :c:data:`n_states` + * :c:data:`psi_cas` + + + +.. c:var:: psi_cas_sorted_bit + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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) + + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave + function. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_det_size` + + + +.. c:var:: psi_coef + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_coef (psi_det_size,N_states) + + + The wave function coefficients. Initialized with Hartree-Fock if the |EZFIO| file + is empty. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mo_label` + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_det_size` + * :c:data:`read_wf` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`barycentric_electronic_energy` + * :c:data:`c0_weight` + * :c:data:`ci_electronic_energy` + * :c:data:`dressed_column_idx` + * :c:data:`psi_average_norm_contrib` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_cas` + * :c:data:`psi_coef_max` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_energy` + * :c:data:`psi_energy_two_e` + * :c:data:`psi_non_cas` + * :c:data:`pt2_e0_denominator` + * :c:data:`s2_values` + * :c:data:`weight_occ_pattern` + + +.. c:var:: psi_coef_cas_diagonalized + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) + double precision, allocatable :: psi_cas_energy_diagonalized (N_states) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`h_matrix_cas` + * :c:data:`n_states` + * :c:data:`psi_cas` + + + +.. c:var:: psi_coef_max + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Max and min values of the coefficients + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_states` + * :c:data:`psi_coef` + + + +.. c:var:: psi_coef_min + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Max and min values of the coefficients + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_states` + * :c:data:`psi_coef` + + + +.. c:var:: psi_coef_sorted + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_average_norm_contrib` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`n_det_selectors` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`psi_selectors` + + +.. c:var:: psi_coef_sorted_bit + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + + +.. c:var:: psi_det + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det (N_int,2,psi_det_size) + + + The determinants of the wave function. Initialized with Hartree-Fock if the |EZFIO| file + is empty. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`hf_bitmask` + * :c:data:`mo_coef` + * :c:data:`mo_label` + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det_size` + * :c:data:`read_wf` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`det_to_occ_pattern` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`h_matrix_all_dets` + * :c:data:`max_degree_exc` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_cas` + * :c:data:`psi_det_alpha` + * :c:data:`psi_det_beta` + * :c:data:`psi_det_hii` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_energy` + * :c:data:`psi_energy_two_e` + * :c:data:`psi_non_cas` + * :c:data:`psi_occ_pattern` + * :c:data:`s2_matrix_all_dets` + * :c:data:`s2_values` + + +.. c:var:: psi_det_alpha + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_alpha (N_int,psi_det_size) + + + List of :math:`\alpha` determinants of psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_alpha_unique` + + +.. c:var:: psi_det_alpha_unique + + + File : :file:`determinants/spindeterminants.irp.f_template_144` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) + integer :: n_det_alpha_unique + + + Unique :math:`\alpha` determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det_alpha` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_transp_rows_loc` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`singles_alpha_csc` + * :c:data:`singles_alpha_csc_idx` + + +.. c:var:: psi_det_beta + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_beta (N_int,psi_det_size) + + + List of :math:`\beta` determinants of psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + + +.. c:var:: psi_det_beta_unique + + + File : :file:`determinants/spindeterminants.irp.f_template_144` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) + integer :: n_det_beta_unique + + + Unique :math:`\beta` determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det_beta` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`psi_bilinear_matrix` + * :c:data:`psi_bilinear_matrix_columns_loc` + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`singles_beta_csc` + * :c:data:`singles_beta_csc_idx` + + +.. c:var:: psi_det_hii + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_det_hii (N_det) + + + :math:`\langle i|h|i \rangle` for all determinants. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_occ_pattern_hii` + * :c:data:`pt2_e0_denominator` + + +.. c:var:: psi_det_size + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + integer :: psi_det_size + + + Size of the psi_det and psi_coef arrays + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_average_norm_contrib` + * :c:data:`psi_cas` + * :c:data:`psi_cas_sorted_bit` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det_sorted_gen` + * :c:data:`psi_energy` + * :c:data:`psi_energy_two_e` + * :c:data:`psi_non_cas` + * :c:data:`psi_non_cas_sorted_bit` + * :c:data:`psi_occ_pattern` + * :c:data:`psi_selectors_size` + * :c:data:`s2_values` + + +.. c:var:: psi_det_sorted + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_average_norm_contrib` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`n_det_selectors` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`psi_selectors` + + +.. c:var:: psi_det_sorted_bit + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_transp_values` + * :c:data:`psi_bilinear_matrix_values` + + +.. c:var:: psi_det_sorted_order + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + 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) + + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_average_norm_contrib` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`n_det_selectors` + * :c:data:`psi_det_generators` + * :c:data:`psi_det_sorted_gen` + * :c:data:`psi_selectors` + + +.. c:var:: psi_energy_h_core + + + File : :file:`determinants/psi_energy_mono_elec.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_energy_h_core (N_states) + + + psi_energy_h_core = :math:`\langle \Psi | h_{core} |\Psi \rangle` + + computed using the :c:data:`one_e_dm_mo_alpha` + + :c:data:`one_e_dm_mo_beta` and :c:data:`mo_one_e_integrals` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`mo_one_e_integrals` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha` + + + +.. c:var:: psi_non_cas + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: psi_non_cas_coef + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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 + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_non_cas_sorted_bit` + + +.. c:var:: psi_non_cas_coef_sorted_bit + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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) + + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave + function. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_det_size` + * :c:data:`psi_non_cas` + + + +.. c:var:: psi_non_cas_sorted_bit + + + File : :file:`determinants/psi_cas.irp.f` + + .. code:: fortran + + 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) + + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave + function. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_cas` + * :c:data:`psi_det_size` + * :c:data:`psi_non_cas` + + + +.. c:var:: psi_occ_pattern + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) + integer :: n_occ_pattern + + + 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` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_to_occ_pattern` + * :c:data:`psi_occ_pattern_hii` + * :c:data:`weight_occ_pattern` + + +.. c:var:: psi_occ_pattern_hii + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_occ_pattern_hii (N_occ_pattern) + + + :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` . + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`det_to_occ_pattern` + * :c:data:`n_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_occ_pattern` + + + +.. c:var:: ref_bitmask_e_n_energy + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_bitmask_energy + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_bitmask_energy_aa + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_bitmask_energy_ab + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_bitmask_energy_bb + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_bitmask_kinetic_energy + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_bitmask_one_e_energy + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_bitmask_two_e_energy + + + File : :file:`determinants/ref_bitmask.irp.f` + + .. code:: fortran + + 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 + double precision :: ref_bitmask_energy_ab + double precision :: ref_bitmask_energy_bb + double precision :: ref_bitmask_energy_aa + + + Energy of the reference bitmask used in Slater rules + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: ref_closed_shell_bitmask + + + File : :file:`determinants/single_excitations.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: ref_closed_shell_bitmask (N_int,2) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`n_int` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + + +.. c:var:: s2_matrix_all_dets + + + File : :file:`determinants/utils.irp.f` + + .. code:: fortran + + double precision, allocatable :: s2_matrix_all_dets (N_det,N_det) + + + |S^2| matrix on the basis of the Slater determinants defined by psi_det + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`psi_energy` + + +.. c:var:: s2_values + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + double precision, allocatable :: s2_values (N_states) + + + array of the averaged values of the S^2 operator on the various states + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`s_z` + + + +.. c:var:: s_z + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + double precision :: s_z + double precision :: s_z2_sz + + + z component of the Spin + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`s2_values` + + +.. c:var:: s_z2_sz + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + double precision :: s_z + double precision :: s_z2_sz + + + z component of the Spin + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`s2_values` + + +.. c:var:: single_exc_bitmask + + + File : :file:`determinants/determinants_bitmasks.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: single_exc_bitmask (N_int,2,N_single_exc_bitmasks) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`hf_bitmask` + * :c:data:`n_int` + * :c:data:`n_single_exc_bitmasks` + + + +.. c:var:: singles_alpha_csc + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer, allocatable :: singles_alpha_csc (singles_alpha_csc_size) + + + Indices of all single excitations + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`psi_det_alpha_unique` + * :c:data:`singles_alpha_csc_idx` + + + +.. c:var:: singles_alpha_csc_idx + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) + integer*8 :: singles_alpha_csc_size + + + singles_alpha_csc_size : Dimension of the :c:data:`singles_alpha_csc` array + + singles_alpha_csc_idx : Index where the single excitations of determinant i start + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + * :c:data:`n_int` + * :c:data:`psi_det_alpha_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`singles_alpha_csc` + + +.. c:var:: singles_alpha_csc_size + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) + integer*8 :: singles_alpha_csc_size + + + singles_alpha_csc_size : Dimension of the :c:data:`singles_alpha_csc` array + + singles_alpha_csc_idx : Index where the single excitations of determinant i start + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + * :c:data:`n_int` + * :c:data:`psi_det_alpha_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`singles_alpha_csc` + + +.. c:var:: singles_beta_csc + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer, allocatable :: singles_beta_csc (singles_beta_csc_size) + + + Indices of all single excitations + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`psi_det_beta_unique` + * :c:data:`singles_beta_csc_idx` + + + +.. c:var:: singles_beta_csc_idx + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer*8, allocatable :: singles_beta_csc_idx (N_det_beta_unique+1) + integer*8 :: singles_beta_csc_size + + + singles_beta_csc_size : Dimension of the :c:data:`singles_beta_csc` array + + singles_beta_csc_idx : Index where the single excitations of determinant i start + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`n_int` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`singles_beta_csc` + + +.. c:var:: singles_beta_csc_size + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer*8, allocatable :: singles_beta_csc_idx (N_det_beta_unique+1) + integer*8 :: singles_beta_csc_size + + + singles_beta_csc_size : Dimension of the :c:data:`singles_beta_csc` array + + singles_beta_csc_idx : Index where the single excitations of determinant i start + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`n_int` + * :c:data:`psi_det_beta_unique` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`singles_beta_csc` + + +.. c:var:: state_average_weight + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: state_average_weight (N_states) + + + Weights in the state-average calculation of the density matrix + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`c0_weight` + * :c:data:`n_states` + * :c:data:`used_weight` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`det_alpha_norm` + * :c:data:`one_e_dm_mo_alpha_average` + * :c:data:`psi_average_norm_contrib` + + +.. c:var:: weight_occ_pattern + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + double precision, allocatable :: weight_occ_pattern (N_occ_pattern,N_states) + + + Weight of the occupation patterns in the wave function + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`det_to_occ_pattern` + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_occ_pattern` + + + + +Subroutines / functions +----------------------- + +.. c:function:: a_operator: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine a_operator(iorb,ispin,key,hjj,Nint,na,nb) + + + Needed for :c:func:`diag_H_mat_elem`. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`mo_one_e_integrals` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diag_h_mat_elem` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: a_operator_two_e: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + subroutine a_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) + + + Needed for :c:func:`diag_Wee_mat_elem`. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_jj` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diag_wee_mat_elem` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: ac_operator: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb) + + + Needed for :c:func:`diag_H_mat_elem`. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diag_h_mat_elem` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: ac_operator_two_e: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + subroutine ac_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) + + + Needed for :c:func:`diag_Wee_mat_elem`. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_jj` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diag_wee_mat_elem` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: apply_excitation: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine apply_excitation(det, exc, res, ok, Nint) + + + + +.. c:function:: apply_hole: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine apply_hole(det, s1, h1, res, ok, Nint) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`select_singles_and_doubles` + + +.. c:function:: apply_holes: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine apply_holes(det, s1, h1, s2, h2, res, ok, Nint) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`fill_buffer_double` + + +.. c:function:: apply_particle: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine apply_particle(det, s1, p1, res, ok, Nint) + + + + +.. c:function:: apply_particles: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine apply_particles(det, s1, p1, s2, p2, res, ok, Nint) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`fill_buffer_double` + * :c:func:`get_d0` + * :c:func:`get_d1` + + +.. c:function:: bitstring_to_list_ab: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine bitstring_to_list_ab( string, list, n_elements, Nint) + + + Gives the inidices(+1) of the bits set to 1 in the bit string + For alpha/beta determinants. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`a_operator` + * :c:func:`a_operator_two_e` + * :c:func:`ac_operator` + * :c:func:`ac_operator_two_e` + * :c:func:`build_fock_tmp` + * :c:func:`diag_h_mat_elem` + * :c:func:`diag_h_mat_elem_one_e` + * :c:func:`diag_wee_mat_elem` + * :c:func:`example_determinants` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + * :c:func:`get_occupation_from_dets` + * :c:func:`get_single_excitation_from_fock` + * :c:func:`i_h_j` + * :c:func:`i_h_j_s2` + * :c:func:`i_h_j_two_e` + * :c:func:`i_h_j_verbose` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`ref_closed_shell_bitmask` + * :c:func:`select_singles_and_doubles` + * :c:func:`single_excitation_wee` + + +.. c:function:: build_fock_tmp: + + + File : :file:`determinants/fock_diag.irp.f` + + .. code:: fortran + + subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint) + + + Build the diagonal of the Fock matrix corresponding to a generator + determinant. $F_{00}$ is $\langle i|H|i \rangle = E_0$. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_beta_num` + * :c:data:`mo_num` + * :c:data:`mo_one_e_integrals` + * :c:data:`elec_alpha_num` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`select_connected` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`debug_det` + + +.. c:function:: connected_to_ref: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + integer function connected_to_ref(key,keys,Nint,N_past_in,Ndet) + + + 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_single: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + integer function connected_to_ref_by_single(key,keys,Nint,N_past_in,Ndet) + + + 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: + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + subroutine copy_H_apply_buffer_to_wf + + + Copies the H_apply buffer to psi_coef. + After calling this subroutine, N_det, psi_det and psi_coef need to be touched + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`n_states` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`psi_det_size` + * :c:data:`n_int` + * :c:data:`nproc` + * :c:data:`psi_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`generate_all_alpha_beta_det_products` + * :c:func:`make_s2_eigenfunction` + * :c:func:`run_stochastic_cipsi` + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`normalize` + * :c:func:`remove_duplicates_in_psi_det` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + + +.. c:function:: copy_psi_bilinear_to_psi: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine copy_psi_bilinear_to_psi(psi, isize) + + + Overwrites :c:data:`psi_det` and :c:data:`psi_coef` with the wave function + in bilinear order + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + + +.. c:function:: create_microlist: + + + File : :file:`determinants/filter_connected.irp.f` + + .. code:: fortran + + subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_microlist, N_microlist, ptr_microlist, Nint) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_dummy` + * :c:func:`perturb_buffer_epstein_nesbet` + * :c:func:`perturb_buffer_epstein_nesbet_2x2` + * :c:func:`perturb_buffer_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`perturb_buffer_moller_plesset` + * :c:func:`perturb_buffer_qdpt` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list` + + +.. c:function:: create_minilist: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine create_minilist(key_mask, fullList, miniList, idx_miniList, N_fullList, N_miniList, Nint) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_dummy` + * :c:func:`perturb_buffer_by_mono_epstein_nesbet` + * :c:func:`perturb_buffer_by_mono_epstein_nesbet_2x2` + * :c:func:`perturb_buffer_by_mono_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`perturb_buffer_by_mono_moller_plesset` + * :c:func:`perturb_buffer_by_mono_qdpt` + * :c:func:`perturb_buffer_dummy` + * :c:func:`perturb_buffer_epstein_nesbet` + * :c:func:`perturb_buffer_epstein_nesbet_2x2` + * :c:func:`perturb_buffer_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`perturb_buffer_moller_plesset` + * :c:func:`perturb_buffer_qdpt` + + +.. c:function:: create_minilist_find_previous: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine create_minilist_find_previous(key_mask, fullList, miniList, N_fullList, N_miniList, fullMatch, Nint) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_dummy` + * :c:func:`perturb_buffer_by_mono_epstein_nesbet` + * :c:func:`perturb_buffer_by_mono_epstein_nesbet_2x2` + * :c:func:`perturb_buffer_by_mono_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`perturb_buffer_by_mono_moller_plesset` + * :c:func:`perturb_buffer_by_mono_qdpt` + * :c:func:`perturb_buffer_dummy` + * :c:func:`perturb_buffer_epstein_nesbet` + * :c:func:`perturb_buffer_epstein_nesbet_2x2` + * :c:func:`perturb_buffer_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`perturb_buffer_moller_plesset` + * :c:func:`perturb_buffer_qdpt` + + +.. c:function:: create_wf_of_psi_bilinear_matrix: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine create_wf_of_psi_bilinear_matrix(truncate) + + + Generates a wave function containing all possible products + of $\alpha$ and $\beta$ determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_sorted_bit` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_sorted` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`generate_all_alpha_beta_det_products` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + + +.. c:function:: decode_exc: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) + + + 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 + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diag_h_mat_elem_fock` + * :c:func:`example_determinants` + * :c:func:`pt2_moller_plesset` + + +.. c:function:: decode_exc_spin: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine decode_exc_spin(exc,h1,p1,h2,p2) + + + Decodes the exc arrays returned by get_excitation. + + h1,h2 : Holes + + p1,p2 : Particles + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha` + + +.. c:function:: det_inf: + + + File : :file:`determinants/sort_dets_ab.irp.f` + + .. code:: fortran + + logical function det_inf(key1, key2, Nint) + + + Ordering function for determinants. + + +.. c:function:: det_search_key: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + integer*8 function det_search_key(det,Nint) + + + Return an integer*8 corresponding to a determinant index for searching + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + + +.. c:function:: detcmp: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + integer function detCmp(a,b,Nint) + + + + +.. c:function:: deteq: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + logical function detEq(a,b,Nint) + + + + +.. c:function:: diag_h_mat_elem: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + double precision function diag_H_mat_elem(det_in,Nint) + + + Computes $\langle i|H|i \rangle$. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask_energy` + * :c:data:`elec_num` + * :c:data:`ref_bitmask` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`a_operator` + * :c:func:`ac_operator` + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: diag_h_mat_elem_fock: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Nint) + + + Computes $\langle i|H|i \rangle$ when $i$ is at most a double excitation from + a reference. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`decode_exc` + * :c:func:`get_double_excitation` + * :c:func:`get_excitation_degree` + * :c:func:`get_single_excitation` + + +.. c:function:: diag_h_mat_elem_one_e: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + double precision function diag_H_mat_elem_one_e(det_in,Nint) + + + Computes $\langle i|H|i \rangle$. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_one_e_integrals` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: diag_s_mat_elem: + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + double precision function diag_S_mat_elem(key_i,Nint) + + + Returns + + +.. c:function:: diag_wee_mat_elem: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + double precision function diag_wee_mat_elem(det_in,Nint) + + + Computes $\langle i|H|i \rangle$. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask_energy` + * :c:data:`elec_num` + * :c:data:`ref_bitmask` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`a_operator_two_e` + * :c:func:`ac_operator_two_e` + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: do_single_excitation: + + + File : :file:`determinants/create_excitations.irp.f` + + .. code:: fortran + + subroutine do_single_excitation(key_in,i_hole,i_particle,ispin,i_ok) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_num` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`example_determinants` + + +.. c:function:: example_determinants: + + + File : :file:`determinants/example.irp.f` + + .. code:: fortran + + subroutine example_determinants + + + subroutine that illustrates the main features available in determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask` + * :c:data:`elec_alpha_num` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`debug_det` + * :c:func:`decode_exc` + * :c:func:`do_single_excitation` + * :c:func:`get_excitation` + * :c:func:`get_excitation_degree` + * :c:func:`i_h_j` + * :c:func:`print_det` + + +.. c:function:: example_determinants_psi_det: + + + File : :file:`determinants/example.irp.f` + + .. code:: fortran + + subroutine example_determinants_psi_det + + + subroutine that illustrates the main features available in determinants using the psi_det/psi_coef + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`read_wf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`routine_example_psi_det` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`read_wf` + + +.. c:function:: fill_h_apply_buffer_no_selection: + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + subroutine fill_H_apply_buffer_no_selection(n_selected,det_buffer,Nint,iproc) + + + Fill the H_apply buffer with determiants for |CISD| + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`generate_all_alpha_beta_det_products` + * :c:func:`make_s2_eigenfunction` + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + * :c:func:`resize_h_apply_buffer` + + +.. c:function:: filter_connected: + + + File : :file:`determinants/filter_connected.irp.f` + + .. code:: fortran + + subroutine filter_connected(key1,key2,Nint,sze,idx) + + + 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 + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_uj_s2_ui` + + +.. c:function:: filter_connected_i_h_psi0: + + + File : :file:`determinants/filter_connected.irp.f` + + .. code:: fortran + + subroutine filter_connected_i_H_psi0(key1,key2,Nint,sze,idx) + + + 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 + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_h_psi` + * :c:func:`i_h_psi_minilist` + * :c:func:`i_s2_psi_minilist` + + +.. c:function:: filter_not_connected: + + + File : :file:`determinants/filter_connected.irp.f` + + .. code:: fortran + + subroutine filter_not_connected(key1,key2,Nint,sze,idx) + + + 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: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine generate_all_alpha_beta_det_products + + + Creates a wave function from all possible $\alpha \times \beta$ determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_alpha_unique` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`create_wf_of_psi_bilinear_matrix` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`copy_h_apply_buffer_to_wf` + * :c:func:`fill_h_apply_buffer_no_selection` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + + +.. c:function:: get_all_spin_doubles: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine get_all_spin_doubles(buffer, idx, spindet, Nint, size_buffer, doubles, n_doubles) + + + + Returns the indices of all the double excitations in the list of + unique $\alpha$ determinants. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_doubles_1` + * :c:func:`get_all_spin_doubles_2` + * :c:func:`get_all_spin_doubles_3` + * :c:func:`get_all_spin_doubles_4` + * :c:func:`get_all_spin_doubles_n_int` + + +.. c:function:: get_all_spin_doubles_1: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine get_all_spin_doubles_1(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + + + Returns the indices of all the double excitations in the list of + unique $\alpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_doubles` + + +.. c:function:: get_all_spin_doubles_2: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_doubles_2(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + + + Returns the indices of all the double excitations in the list of + unique $lpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_doubles` + + +.. c:function:: get_all_spin_doubles_3: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_doubles_3(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + + + Returns the indices of all the double excitations in the list of + unique $lpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_doubles` + + +.. c:function:: get_all_spin_doubles_4: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_doubles_4(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + + + Returns the indices of all the double excitations in the list of + unique $lpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_doubles` + + +.. c:function:: get_all_spin_doubles_n_int: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_doubles_N_int(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + + + Returns the indices of all the double excitations in the list of + unique $lpha$ determinants. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_doubles` + + +.. c:function:: get_all_spin_singles: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine get_all_spin_singles(buffer, idx, spindet, Nint, size_buffer, singles, n_singles) + + + + Returns the indices of all the single excitations in the list of + unique $\alpha$ determinants. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`singles_alpha_csc` + * :c:data:`singles_alpha_csc_idx` + * :c:data:`singles_beta_csc` + * :c:data:`singles_beta_csc_idx` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_1` + * :c:func:`get_all_spin_singles_2` + * :c:func:`get_all_spin_singles_3` + * :c:func:`get_all_spin_singles_4` + * :c:func:`get_all_spin_singles_n_int` + + +.. c:function:: get_all_spin_singles_1: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine get_all_spin_singles_1(buffer, idx, spindet, size_buffer, singles, n_singles) + + + + Returns the indices of all the single excitations in the list of + unique $\alpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles` + * :c:func:`h_s2_u_0_nstates_openmp_work_1` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_1` + + +.. c:function:: get_all_spin_singles_2: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_2(buffer, idx, spindet, size_buffer, singles, n_singles) + + + + Returns the indices of all the single excitations in the list of + unique $lpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles` + * :c:func:`h_s2_u_0_nstates_openmp_work_2` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_2` + + +.. c:function:: get_all_spin_singles_3: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_3(buffer, idx, spindet, size_buffer, singles, n_singles) + + + + Returns the indices of all the single excitations in the list of + unique $lpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles` + * :c:func:`h_s2_u_0_nstates_openmp_work_3` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_3` + + +.. c:function:: get_all_spin_singles_4: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_4(buffer, idx, spindet, size_buffer, singles, n_singles) + + + + Returns the indices of all the single excitations in the list of + unique $lpha$ determinants. + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles` + * :c:func:`h_s2_u_0_nstates_openmp_work_4` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_4` + + +.. c:function:: get_all_spin_singles_and_doubles: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine get_all_spin_singles_and_doubles(buffer, idx, spindet, Nint, size_buffer, singles, doubles, n_singles, n_doubles) + + + + Returns the indices of all the single and double excitations in the list of + unique $\alpha$ determinants. + + Warning: The buffer is transposed. + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles_1` + * :c:func:`get_all_spin_singles_and_doubles_2` + * :c:func:`get_all_spin_singles_and_doubles_3` + * :c:func:`get_all_spin_singles_and_doubles_4` + * :c:func:`get_all_spin_singles_and_doubles_n_int` + + +.. c:function:: get_all_spin_singles_and_doubles_1: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine get_all_spin_singles_and_doubles_1(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + + + Returns the indices of all the single and double excitations in the list of + unique $\alpha$ determinants. + + /!\ : The buffer is transposed ! + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles` + * :c:func:`h_s2_u_0_nstates_openmp_work_1` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_1` + + +.. c:function:: get_all_spin_singles_and_doubles_2: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_and_doubles_2(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + + + Returns the indices of all the single and double excitations in the list of + unique $lpha$ determinants. + + /!\ : The buffer is transposed ! + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles` + * :c:func:`h_s2_u_0_nstates_openmp_work_2` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_2` + + +.. c:function:: get_all_spin_singles_and_doubles_3: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_and_doubles_3(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + + + Returns the indices of all the single and double excitations in the list of + unique $lpha$ determinants. + + /!\ : The buffer is transposed ! + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles` + * :c:func:`h_s2_u_0_nstates_openmp_work_3` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_3` + + +.. c:function:: get_all_spin_singles_and_doubles_4: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_and_doubles_4(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + + + Returns the indices of all the single and double excitations in the list of + unique $lpha$ determinants. + + /!\ : The buffer is transposed ! + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles` + * :c:func:`h_s2_u_0_nstates_openmp_work_4` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_4` + + +.. c:function:: get_all_spin_singles_and_doubles_n_int: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_and_doubles_N_int(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + + + Returns the indices of all the single and double excitations in the list of + unique $lpha$ determinants. + + /!\ : The buffer is transposed ! + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles_and_doubles` + * :c:func:`h_s2_u_0_nstates_openmp_work_n_int` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_n_int` + + +.. c:function:: get_all_spin_singles_n_int: + + + File : :file:`determinants/spindeterminants.irp.f_template_1291` + + .. code:: fortran + + subroutine get_all_spin_singles_N_int(buffer, idx, spindet, size_buffer, singles, n_singles) + + + + Returns the indices of all the single excitations in the list of + unique $lpha$ determinants. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_all_spin_singles` + * :c:func:`h_s2_u_0_nstates_openmp_work_n_int` + * :c:func:`h_s2_u_0_two_e_nstates_openmp_work_n_int` + + +.. c:function:: get_double_excitation: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_double_excitation(det1,det2,exc,phase,Nint) + + + Returns the two excitation operators between two doubly excited determinants and the phase. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diag_h_mat_elem_fock` + * :c:func:`get_excitation` + * :c:func:`get_s2` + * :c:func:`i_h_j` + * :c:func:`i_h_j_s2` + * :c:func:`i_h_j_two_e` + * :c:func:`i_h_j_verbose` + + +.. c:function:: get_double_excitation_spin: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_double_excitation_spin(det1,det2,exc,phase,Nint) + + + Returns the two excitation operators between two doubly excited spin-determinants + and the phase. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_excitation_spin` + * :c:func:`i_h_j_double_spin` + + +.. c:function:: get_excitation: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation(det1,det2,exc,degree,phase,Nint) + + + Returns the excitation operators between two determinants and the phase. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`example_determinants` + * :c:func:`get_phase` + * :c:func:`pt2_moller_plesset` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_double_excitation` + * :c:func:`get_excitation_degree` + * :c:func:`get_single_excitation` + + +.. c:function:: get_excitation_degree: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_degree(key1,key2,degree,Nint) + + + Returns the excitation degree between two determinants. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`degree_max_generators` + * :c:func:`diag_h_mat_elem_fock` + * :c:func:`example_determinants` + * :c:data:`exc_degree_per_selectors` + * :c:func:`get_excitation` + * :c:func:`get_s2` + * :c:func:`i_h_j` + * :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:data:`max_degree_exc` + * :c:data:`psi_non_cas` + * :c:func:`pt2_qdpt` + + +.. c:function:: get_excitation_degree_spin: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_degree_spin(key1,key2,degree,Nint) + + + Returns the excitation degree between two determinants. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_excitation_spin` + * :c:data:`one_e_dm_mo_alpha` + * :c:func:`select_singles_and_doubles` + + +.. c:function:: get_excitation_degree_vector: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_degree_vector(key1,key2,degree,Nint,sze,idx) + + + Applies get_excitation_degree to an array of determinants. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`routine_example_psi_det` + + +.. c:function:: get_excitation_degree_vector_double_alpha_beta: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_degree_vector_double_alpha_beta(key1,key2,degree,Nint,sze,idx) + + + 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_single: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_degree_vector_single(key1,key2,degree,Nint,sze,idx) + + + Applies get_excitation_degree to an array of determinants and returns only + the single excitations. + + +.. c:function:: get_excitation_degree_vector_single_or_exchange: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_degree_vector_single_or_exchange(key1,key2,degree,Nint,sze,idx) + + + 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_single_or_exchange_verbose: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_degree_vector_single_or_exchange_verbose(key1,key2,degree,Nint,sze,idx) + + + Applies get_excitation_degree to an array of determinants and return only the single + excitations and the connections through exchange integrals. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`debug_det` + + +.. c:function:: get_excitation_spin: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_excitation_spin(det1,det2,exc,degree,phase,Nint) + + + Returns the excitation operators between two determinants and the phase. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_double_excitation_spin` + * :c:func:`get_excitation_degree_spin` + * :c:func:`get_single_excitation_spin` + + +.. c:function:: get_index_in_psi_det_alpha_unique: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer function get_index_in_psi_det_alpha_unique(key,Nint) + + + Returns the index of the determinant in the :c:data:`psi_det_alpha_unique` array + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_alpha_unique` + + +.. c:function:: get_index_in_psi_det_beta_unique: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer function get_index_in_psi_det_beta_unique(key,Nint) + + + Returns the index of the determinant in the :c:data:`psi_det_beta_unique` array + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + + +.. c:function:: get_index_in_psi_det_sorted_bit: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + integer function get_index_in_psi_det_sorted_bit(key,Nint) + + + Returns the index of the determinant in the ``psi_det_sorted_bit`` array + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_sorted_bit` + * :c:data:`n_det` + + +.. c:function:: get_occupation_from_dets: + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + subroutine get_occupation_from_dets(istate,occupation) + + + Returns the average occupation of the MOs + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`n_int` + * :c:data:`n_det` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: get_phase: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_phase(key1,key2,phase,Nint) + + + Returns the phase between key1 and key2. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_excitation` + + +.. c:function:: get_phasemask_bit: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_phasemask_bit(det1, pm, Nint) + + + + +.. c:function:: get_s2: + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + subroutine get_s2(key_i,key_j,Nint,s2) + + + Returns $\langle S^2 \rangle - S_z^2 S_z$ + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_uj_s2_ui` + * :c:func:`h_s2_u_0_nstates_openmp_work_1` + * :c:func:`h_s2_u_0_nstates_openmp_work_2` + * :c:func:`h_s2_u_0_nstates_openmp_work_3` + * :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_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:`i_s2_psi_minilist` + * :c:data:`s2_matrix_all_dets` + * :c:func:`s2_u_0_nstates` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_double_excitation` + * :c:func:`get_excitation_degree` + + +.. c:function:: get_single_excitation: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_single_excitation(det1,det2,exc,phase,Nint) + + + Returns the excitation operator between two singly excited determinants and the phase. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diag_h_mat_elem_fock` + * :c:func:`get_excitation` + * :c:func:`i_h_j` + * :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:function:: get_single_excitation_from_fock: + + + File : :file:`determinants/single_excitations.irp.f` + + .. code:: fortran + + subroutine get_single_excitation_from_fock(det_1,det_2,h,p,spin,phase,hij) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_closed_shell_bitmask` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_h_j` + * :c:func:`i_h_j_s2` + * :c:func:`i_h_j_single_spin` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: get_single_excitation_spin: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine get_single_excitation_spin(det1,det2,exc,phase,Nint) + + + Returns the excitation operator between two singly excited determinants and the phase. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_excitation_spin` + * :c:func:`i_h_j_double_alpha_beta` + * :c:func:`i_h_j_mono_spin_one_e` + * :c:func:`i_h_j_single_spin` + * :c:func:`i_wee_j_single` + * :c:data:`one_e_dm_mo_alpha` + + +.. c:function:: get_uj_s2_ui: + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + subroutine get_uJ_s2_uI(psi_keys_tmp,psi_coefs_tmp,n,nmax_coefs,nmax_keys,s2,nstates) + + + returns the matrix elements of S^2 "s2(i,j)" between the "nstates" states + psi_coefs_tmp(:,i) and psi_coefs_tmp(:,j) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`filter_connected` + * :c:func:`get_s2` + + +.. c:function:: getmobiles: + + + File : :file:`determinants/filter_connected.irp.f` + + .. code:: fortran + + subroutine getMobiles(key,key_mask, mobiles,Nint) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_dummy` + * :c:func:`perturb_buffer_epstein_nesbet` + * :c:func:`perturb_buffer_epstein_nesbet_2x2` + * :c:func:`perturb_buffer_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`perturb_buffer_moller_plesset` + * :c:func:`perturb_buffer_qdpt` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list` + + +.. c:function:: i_h_j: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_j(key_i,key_j,Nint,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_integrals_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:func:`example_determinants` + * :c:func:`get_d0` + * :c:func:`get_d1` + * :c:data:`h_matrix_all_dets` + * :c:data:`h_matrix_cas` + * :c:func:`i_h_psi` + * :c:func:`i_h_psi_minilist` + * :c:func:`pt2_qdpt` + * :c:func:`routine_example_psi_det` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`get_double_excitation` + * :c:func:`get_excitation_degree` + * :c:func:`get_single_excitation` + * :c:func:`get_single_excitation_from_fock` + + +.. c:function:: i_h_j_double_alpha_beta: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_j_double_alpha_beta(key_i,key_j,Nint,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants differing by + an opposite-spin double excitation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_integrals_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work_1` + * :c:func:`h_s2_u_0_nstates_openmp_work_2` + * :c:func:`h_s2_u_0_nstates_openmp_work_3` + * :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_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` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_single_excitation_spin` + + +.. c:function:: i_h_j_double_spin: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_j_double_spin(key_i,key_j,Nint,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants differing by + a same-spin double excitation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_integrals_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work_1` + * :c:func:`h_s2_u_0_nstates_openmp_work_2` + * :c:func:`h_s2_u_0_nstates_openmp_work_3` + * :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_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` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_double_excitation_spin` + + +.. c:function:: i_h_j_mono_spin_one_e: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + subroutine i_H_j_mono_spin_one_e(key_i,key_j,Nint,spin,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants differing by + a single excitation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_one_e_integrals` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_single_excitation_spin` + + +.. c:function:: i_h_j_one_e: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + subroutine i_H_j_one_e(key_i,key_j,Nint,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_one_e_integrals` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_excitation_degree` + * :c:func:`get_single_excitation` + + +.. c:function:: i_h_j_s2: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) + + + Returns $\langle i|H|j \rangle$ and $\langle i|S^2|j \rangle$ + where $i$ and $j$ are determinants. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`get_double_excitation` + * :c:func:`get_excitation_degree` + * :c:func:`get_single_excitation` + * :c:func:`get_single_excitation_from_fock` + + +.. c:function:: i_h_j_single_spin: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_j_single_spin(key_i,key_j,Nint,spin,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants differing by + a single excitation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_two_e_integrals_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`h_s2_u_0_nstates_openmp_work_1` + * :c:func:`h_s2_u_0_nstates_openmp_work_2` + * :c:func:`h_s2_u_0_nstates_openmp_work_3` + * :c:func:`h_s2_u_0_nstates_openmp_work_4` + * :c:func:`h_s2_u_0_nstates_openmp_work_n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_single_excitation_from_fock` + * :c:func:`get_single_excitation_spin` + + +.. c:function:: i_h_j_two_e: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + subroutine i_H_j_two_e(key_i,key_j,Nint,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask_energy` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`get_double_excitation` + * :c:func:`get_excitation_degree` + * :c:func:`get_single_excitation` + * :c:func:`single_excitation_wee` + + +.. c:function:: i_h_j_verbose: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_beta_num` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`elec_alpha_num` + * :c:data:`mo_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + * :c:func:`get_double_excitation` + * :c:func:`get_excitation_degree` + * :c:func:`get_single_excitation` + + +.. c:function:: i_h_psi: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_psi(key,keys,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) + + + Computes $\langle i|H|Psi \rangle = \sum_J c_J \langle i | H | J \rangle$. + + Uses filter_connected_i_H_psi0 to get all the $|J \rangle$ to which $|i \rangle$ + is connected. + The i_H_psi_minilist is much faster but requires to build the + minilists. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`pt2_epstein_nesbet_2x2` + * :c:func:`pt2_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`remove_small_contributions` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`filter_connected_i_h_psi0` + * :c:func:`i_h_j` + + +.. c:function:: i_h_psi_minilist: + + + File : :file:`determinants/slater_rules.irp.f` + + .. code:: fortran + + subroutine i_H_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) + + + Computes $\langle i|H|\Psi \rangle = \sum_J c_J \langle i|H|J\rangle$. + + Uses filter_connected_i_H_psi0 to get all the $|J \rangle$ to which $|i \rangle$ + is connected. The $|J\rangle$ are searched in short pre-computed lists. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`pt2_dummy` + * :c:func:`pt2_epstein_nesbet` + * :c:func:`pt2_moller_plesset` + * :c:func:`pt2_qdpt` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`filter_connected_i_h_psi0` + * :c:func:`i_h_j` + + +.. c:function:: i_s2_psi_minilist: + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + subroutine i_S2_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_S2_psi_array) + + + Computes $\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 $|J\rangle$ to which $|i\rangle$ + is connected. The $|J\rangle$ are searched in short pre-computed lists. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`filter_connected_i_h_psi0` + * :c:func:`get_s2` + + +.. c:function:: i_wee_j_single: + + + File : :file:`determinants/slater_rules_wee_mono.irp.f` + + .. code:: fortran + + subroutine i_Wee_j_single(key_i,key_j,Nint,spin,hij) + + + Returns $\langle i|H|j \rangle$ where $i$ and $j$ are determinants differing by a + single excitation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`mo_two_e_integrals_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :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` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_single_excitation_spin` + * :c:func:`single_excitation_wee` + + +.. c:function:: is_connected_to: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + logical function is_connected_to(key,keys,Nint,Ndet) + + + Returns |true| if determinant ``key`` is connected to ``keys`` + + +.. c:function:: is_connected_to_by_single: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + logical function is_connected_to_by_single(key,keys,Nint,Ndet) + + + Returns |true| is ``key`` is connected to ``keys`` by a single excitation. + + +.. c:function:: is_in_wavefunction: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + logical function is_in_wavefunction(key,Nint) + + + |true| if the determinant ``det`` is in the wave function + + +.. c:function:: is_spin_flip_possible: + + + File : :file:`determinants/create_excitations.irp.f` + + .. code:: fortran + + logical function is_spin_flip_possible(key_in,i_flip,ispin) + + + returns |true| if the spin-flip of spin ispin in the orbital i_flip is possible + on key_in + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + +.. c:function:: make_s2_eigenfunction: + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + subroutine make_s2_eigenfunction + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_occ_pattern` + * :c:data:`psi_occ_pattern` + * :c:data:`elec_alpha_num` + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`psi_det` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`copy_h_apply_buffer_to_wf` + * :c:func:`fill_h_apply_buffer_no_selection` + * :c:func:`occ_pattern_to_dets` + * :c:func:`occ_pattern_to_dets_size` + * :c:func:`write_int` + * :c:func:`write_time` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_occ_pattern` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_occ_pattern` + + +.. c:function:: occ_pattern_of_det: + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + subroutine occ_pattern_of_det(d,o,Nint) + + + Transforms a determinant to an occupation pattern + + occ(:,1) : Single occupations + + occ(:,2) : Double occupations + + + +.. c:function:: occ_pattern_search_key: + + + File : :file:`determinants/connected_to_ref.irp.f` + + .. code:: fortran + + integer*8 function occ_pattern_search_key(det,Nint) + + + Return an integer*8 corresponding to a determinant index for searching + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + + +.. c:function:: occ_pattern_to_dets: + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + subroutine occ_pattern_to_dets(o,d,sze,n_alpha,Nint) + + + Generate all possible determinants for a give occ_pattern + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`binom_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`make_s2_eigenfunction` + * :c:func:`make_selection_buffer_s2` + + +.. c:function:: occ_pattern_to_dets_size: + + + File : :file:`determinants/occ_pattern.irp.f` + + .. code:: fortran + + subroutine occ_pattern_to_dets_size(o,sze,n_alpha,Nint) + + + Number of possible determinants for a given occ_pattern + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`binom_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`make_s2_eigenfunction` + * :c:func:`make_selection_buffer_s2` + + +.. c:function:: pull_pt2: + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + subroutine pull_pt2(zmq_socket_pull,pt2,norm_pert,H_pert_diag,i_generator,N_st,n,task_id) + + + Pull |PT2| calculation in the collector + + +.. c:function:: push_pt2: + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + subroutine push_pt2(zmq_socket_push,pt2,norm_pert,H_pert_diag,i_generator,N_st,task_id) + + + Push |PT2| calculation to the collector + + +.. c:function:: read_dets: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine read_dets(det,Nint,Ndet) + + + Reads the determinants from the |EZFIO| file + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_get_determinants_bit_kind` + * :c:func:`ezfio_get_determinants_n_int` + * :c:func:`ezfio_get_determinants_psi_det` + + +.. c:function:: remove_duplicates_in_psi_det: + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + subroutine remove_duplicates_in_psi_det(found_duplicates) + + + Removes duplicate determinants in the wave function. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`c0_weight` + * :c:data:`n_det` + * :c:data:`psi_det_sorted_bit` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_sorted` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`copy_h_apply_buffer_to_wf` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`c0_weight` + * :c:data:`psi_coef` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_det` + * :c:data:`psi_det_sorted_bit` + + +.. c:function:: resize_h_apply_buffer: + + + File : :file:`determinants/h_apply.irp.f` + + .. code:: fortran + + subroutine resize_H_apply_buffer(new_size,iproc) + + + Resizes the H_apply buffer of proc iproc. The buffer lock should + be set before calling this function. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`fill_h_apply_buffer_no_selection` + * :c:func:`fill_h_apply_buffer_selection` + + +.. c:function:: routine_example_psi_det: + + + File : :file:`determinants/example.irp.f` + + .. code:: fortran + + subroutine routine_example_psi_det + + + subroutine that illustrates the main features available in determinants using many determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`example_determinants_psi_det` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`debug_det` + * :c:func:`get_excitation_degree_vector` + * :c:func:`i_h_j` + + +.. c:function:: s2_u_0: + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + subroutine S2_u_0(v_0,u_0,n,keys_tmp,Nint) + + + Computes v_0 = S^2|u_0> + + n : number of determinants + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`s2_u_0_nstates` + + +.. c:function:: s2_u_0_nstates: + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) + + + Computes v_0 = S^2|u_0> + + n : number of determinants + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask_energy` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`s2_u_0` + * :c:func:`u_0_s2_u_0` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_s2` + * :c:func:`sort_dets_ab_v` + * :c:func:`sort_dets_ba_v` + + +.. c:function:: save_natural_mos: + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + subroutine save_natural_mos + + + Save natural orbitals, obtained by diagonalization of the one-body density matrix in + the |MO| basis + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`save_natorb` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`save_mos` + * :c:func:`set_natural_mos` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_occ` + + +.. c:function:: save_ref_determinant: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine save_ref_determinant + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`ref_bitmask` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`save_natorb` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`save_wavefunction_general` + + +.. c:function:: save_wavefunction: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine save_wavefunction + + + Save the wave function into the |EZFIO| file + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`read_wf` + * :c:data:`n_states` + * :c:data:`psi_det_sorted` + * :c:data:`n_det` + * :c:data:`mpi_master` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`save_wavefunction_general` + + +.. c:function:: save_wavefunction_general: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) + + + Save the wave function into the |EZFIO| file + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_int` + * :c:data:`mo_label` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`save_ref_determinant` + * :c:func:`save_wavefunction` + * :c:func:`save_wavefunction_truncated` + * :c:func:`save_wavefunction_unsorted` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_determinants_bit_kind` + * :c:func:`ezfio_set_determinants_mo_label` + * :c:func:`ezfio_set_determinants_n_det` + * :c:func:`ezfio_set_determinants_n_int` + * :c:func:`ezfio_set_determinants_n_states` + * :c:func:`ezfio_set_determinants_psi_coef` + * :c:func:`ezfio_set_determinants_psi_det` + * :c:func:`normalize` + * :c:func:`write_int` + + +.. c:function:: save_wavefunction_specified: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,index_det_save) + + + Save the wave function into the |EZFIO| file + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`mo_label` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_determinants_bit_kind` + * :c:func:`ezfio_set_determinants_mo_label` + * :c:func:`ezfio_set_determinants_n_det` + * :c:func:`ezfio_set_determinants_n_int` + * :c:func:`ezfio_set_determinants_n_states` + * :c:func:`ezfio_set_determinants_psi_coef` + * :c:func:`ezfio_set_determinants_psi_det` + * :c:func:`write_int` + + +.. c:function:: save_wavefunction_truncated: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine save_wavefunction_truncated(thr) + + + Save the wave function into the |EZFIO| file + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`psi_det_sorted` + * :c:data:`n_det` + * :c:data:`mpi_master` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`save_wavefunction_general` + + +.. c:function:: save_wavefunction_unsorted: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine save_wavefunction_unsorted + + + Save the wave function into the |EZFIO| file + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`mpi_master` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`save_wavefunction_general` + + +.. c:function:: set_natural_mos: + + + File : :file:`determinants/density_matrix.irp.f` + + .. code:: fortran + + subroutine set_natural_mos + + + Set natural orbitals, obtained by diagonalization of the one-body density matrix + in the |MO| basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_occ` + * :c:data:`one_e_dm_mo` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`save_natural_mos` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`mo_as_svd_vectors_of_mo_matrix_eig` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_occ` + + +.. c:function:: single_excitation_wee: + + + File : :file:`determinants/single_excitation_two_e.irp.f` + + .. code:: fortran + + subroutine single_excitation_wee(det_1,det_2,h,p,spin,phase,hij) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_closed_shell_bitmask` + * :c:data:`fock_wee_closed_shell` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i_h_j_two_e` + * :c:func:`i_wee_j_single` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list_ab` + + +.. c:function:: sort_dets_ab: + + + File : :file:`determinants/sort_dets_ab.irp.f` + + .. code:: fortran + + subroutine sort_dets_ab(key, idx, shortcut, N_key, Nint) + + + Deprecated routine + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`tamiser` + + +.. c:function:: sort_dets_ab_v: + + + File : :file:`determinants/sort_dets_ab.irp.f` + + .. code:: fortran + + subroutine sort_dets_ab_v(key_in, key_out, idx, shortcut, version, N_key, Nint) + + + Deprecated routine + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`s2_u_0_nstates` + * :c:func:`sort_dets_ba_v` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`tamiser` + + +.. c:function:: sort_dets_ba_v: + + + File : :file:`determinants/sort_dets_ab.irp.f` + + .. code:: fortran + + subroutine sort_dets_ba_v(key_in, key_out, idx, shortcut, version, N_key, Nint) + + + Deprecated routine + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`s2_u_0_nstates` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`sort_dets_ab_v` + + +.. c:function:: sort_dets_by_det_search_key: + + + File : :file:`determinants/determinants.irp.f` + + .. code:: fortran + + subroutine sort_dets_by_det_search_key(Ndet, det_in, coef_in, sze, det_out, coef_out, N_st) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_cas_sorted_bit` + * :c:data:`psi_det_sorted_bit` + * :c:data:`psi_non_cas_sorted_bit` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i8sort` + + +.. c:function:: spin_det_search_key: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + integer*8 function spin_det_search_key(det,Nint) + + + Returns an integer(8) corresponding to a determinant index for searching + + +.. c:function:: tamiser: + + + File : :file:`determinants/sort_dets_ab.irp.f` + + .. code:: fortran + + subroutine tamiser(key, idx, no, n, Nint, N_key) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`sort_dets_ab` + * :c:func:`sort_dets_ab_v` + + +.. c:function:: u_0_s2_u_0: + + + File : :file:`determinants/s2.irp.f` + + .. code:: fortran + + subroutine u_0_S2_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8) + + + Computes e_0 = / + + n : number of determinants + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`s_z` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`s2_values` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`s2_u_0_nstates` + + +.. c:function:: wf_of_psi_bilinear_matrix: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine wf_of_psi_bilinear_matrix(truncate) + + + Generate a wave function containing all possible products + of $\alpha$ and $\beta$ determinants + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_alpha_unique` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + * :c:data:`psi_det` + * :c:data:`psi_det_sorted` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_coef` + * :c:data:`psi_det` + + +.. c:function:: write_spindeterminants: + + + File : :file:`determinants/spindeterminants.irp.f` + + .. code:: fortran + + subroutine write_spindeterminants + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_alpha_unique` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_spindeterminants_bit_kind` + * :c:func:`ezfio_set_spindeterminants_n_det` + * :c:func:`ezfio_set_spindeterminants_n_det_alpha` + * :c:func:`ezfio_set_spindeterminants_n_det_beta` + * :c:func:`ezfio_set_spindeterminants_n_int` + * :c:func:`ezfio_set_spindeterminants_n_states` + * :c:func:`ezfio_set_spindeterminants_psi_coef_matrix_columns` + * :c:func:`ezfio_set_spindeterminants_psi_coef_matrix_rows` + * :c:func:`ezfio_set_spindeterminants_psi_coef_matrix_values` + * :c:func:`ezfio_set_spindeterminants_psi_det_alpha` + * :c:func:`ezfio_set_spindeterminants_psi_det_beta` + + +.. c:function:: zmq_get_n_det: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_get_N_det(zmq_to_qp_run_socket, worker_id) + + + Get N_det from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`n_det` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_n_det_alpha_unique: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_get_N_det_alpha_unique(zmq_to_qp_run_socket, worker_id) + + + Get N_det_alpha_unique from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_alpha_unique` + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_n_det_beta_unique: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_get_N_det_beta_unique(zmq_to_qp_run_socket, worker_id) + + + Get N_det_beta_unique from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_n_states: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_get_N_states(zmq_to_qp_run_socket, worker_id) + + + Get N_states from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_psi: + + + File : :file:`determinants/zmq.irp.f` + + .. code:: fortran + + integer function zmq_get_psi(zmq_to_qp_run_socket, worker_id) + + + Get the wave function from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`psi_det_size` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_states` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + + +.. c:function:: zmq_get_psi_bilinear: + + + File : :file:`determinants/zmq.irp.f` + + .. code:: fortran + + integer function zmq_get_psi_bilinear(zmq_to_qp_run_socket, worker_id) + + + Get the wave function from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_det_alpha_unique` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`n_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_size` + * :c:data:`psi_det` + * :c:data:`psi_bilinear_matrix_values` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + * :c:data:`n_states` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_bilinear_matrix_values` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_size` + + +.. c:function:: zmq_get_psi_bilinear_matrix_columns: + + + File : :file:`determinants/zmq.irp.f_template_500` + + .. code:: fortran + + integer*8 function zmq_get_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) + + + Get psi_bilinear_matrix_columns on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_get_psi_bilinear_matrix_order: + + + File : :file:`determinants/zmq.irp.f_template_500` + + .. code:: fortran + + integer*8 function zmq_get_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) + + + Get psi_bilinear_matrix_order on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_get_psi_bilinear_matrix_rows: + + + File : :file:`determinants/zmq.irp.f_template_500` + + .. code:: fortran + + integer*8 function zmq_get_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) + + + Get psi_bilinear_matrix_rows on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_get_psi_bilinear_matrix_values: + + + File : :file:`determinants/zmq.irp.f_template_564` + + .. code:: fortran + + integer*8 function zmq_get_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) + + + get psi_bilinear_matrix_values on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_get_psi_coef: + + + File : :file:`determinants/zmq.irp.f_template_564` + + .. code:: fortran + + integer*8 function zmq_get_psi_coef(zmq_to_qp_run_socket,worker_id) + + + get psi_coef on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + + +.. c:function:: zmq_get_psi_det: + + + File : :file:`determinants/zmq.irp.f_template_440` + + .. code:: fortran + + integer*8 function zmq_get_psi_det(zmq_to_qp_run_socket,worker_id) + + + Get psi_det on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det` + + +.. c:function:: zmq_get_psi_det_alpha_unique: + + + File : :file:`determinants/zmq.irp.f_template_440` + + .. code:: fortran + + integer*8 function zmq_get_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + + Get psi_det_alpha_unique on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_alpha_unique` + + +.. c:function:: zmq_get_psi_det_beta_unique: + + + File : :file:`determinants/zmq.irp.f_template_440` + + .. code:: fortran + + integer*8 function zmq_get_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + + Get psi_det_beta_unique on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + + +.. c:function:: zmq_get_psi_det_size: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_get_psi_det_size(zmq_to_qp_run_socket, worker_id) + + + Get psi_det_size from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`psi_det_size` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_psi_notouch: + + + File : :file:`determinants/zmq.irp.f` + + .. code:: fortran + + integer function zmq_get_psi_notouch(zmq_to_qp_run_socket, worker_id) + + + Get the wave function from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`n_states` + * :c:data:`n_int` + * :c:data:`psi_det_size` + + +.. c:function:: zmq_put_n_det: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_put_N_det(zmq_to_qp_run_socket,worker_id) + + + Put N_det on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`n_det` + + +.. c:function:: zmq_put_n_det_alpha_unique: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_put_N_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + + Put N_det_alpha_unique on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_alpha_unique` + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_n_det_beta_unique: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_put_N_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + + Put N_det_beta_unique on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_n_states: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_put_N_states(zmq_to_qp_run_socket,worker_id) + + + Put N_states on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_psi: + + + File : :file:`determinants/zmq.irp.f` + + .. code:: fortran + + integer function zmq_put_psi(zmq_to_qp_run_socket,worker_id) + + + Put the wave function on the qp_run scheduler + + +.. c:function:: zmq_put_psi_bilinear: + + + File : :file:`determinants/zmq.irp.f` + + .. code:: fortran + + integer function zmq_put_psi_bilinear(zmq_to_qp_run_socket,worker_id) + + + Put the wave function on the qp_run scheduler + + +.. c:function:: zmq_put_psi_bilinear_matrix_columns: + + + File : :file:`determinants/zmq.irp.f_template_500` + + .. code:: fortran + + integer*8 function zmq_put_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) + + + Put psi_bilinear_matrix_columns on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_put_psi_bilinear_matrix_order: + + + File : :file:`determinants/zmq.irp.f_template_500` + + .. code:: fortran + + integer*8 function zmq_put_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) + + + Put psi_bilinear_matrix_order on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_put_psi_bilinear_matrix_rows: + + + File : :file:`determinants/zmq.irp.f_template_500` + + .. code:: fortran + + integer*8 function zmq_put_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) + + + Put psi_bilinear_matrix_rows on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_put_psi_bilinear_matrix_values: + + + File : :file:`determinants/zmq.irp.f_template_564` + + .. code:: fortran + + integer*8 function zmq_put_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) + + + Put psi_bilinear_matrix_values on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_bilinear_matrix_values` + + +.. c:function:: zmq_put_psi_coef: + + + File : :file:`determinants/zmq.irp.f_template_564` + + .. code:: fortran + + integer*8 function zmq_put_psi_coef(zmq_to_qp_run_socket,worker_id) + + + Put psi_coef on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + + +.. c:function:: zmq_put_psi_det: + + + File : :file:`determinants/zmq.irp.f_template_440` + + .. code:: fortran + + integer*8 function zmq_put_psi_det(zmq_to_qp_run_socket,worker_id) + + + Put psi_det on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det` + + +.. c:function:: zmq_put_psi_det_alpha_unique: + + + File : :file:`determinants/zmq.irp.f_template_440` + + .. code:: fortran + + integer*8 function zmq_put_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + + Put psi_det_alpha_unique on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_alpha_unique` + + +.. c:function:: zmq_put_psi_det_beta_unique: + + + File : :file:`determinants/zmq.irp.f_template_440` + + .. code:: fortran + + integer*8 function zmq_put_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + + Put psi_det_beta_unique on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_beta_unique` + + +.. c:function:: zmq_put_psi_det_size: + + + File : :file:`determinants/zmq.irp.f_template_379` + + .. code:: fortran + + integer function zmq_put_psi_det_size(zmq_to_qp_run_socket,worker_id) + + + Put psi_det_size on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`psi_det_size` + diff --git a/docs/source/modules/dft_keywords.rst b/docs/source/modules/dft_keywords.rst new file mode 100644 index 000000000..f1493bda5 --- /dev/null +++ b/docs/source/modules/dft_keywords.rst @@ -0,0 +1,116 @@ +.. _module_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. +These keywords are related to the following programs of the |QP| core modules: + +* :ref:`ks_scf` : Kohn-Sham |DFT| +* :ref:`rs_ks_scf` : Range separated Hybrids |DFT| + + +Modifying the exchange/correlation functionals +---------------------------------------------- +To modify the exchange/correlation functionals, see the following keywords: + +* :option:`dft_keywords exchange_functional`: type of exchange functionals +* :option:`dft_keywords correlation_functional`: type of correlation functionals + +Each of these keywords can have the following value: +* "LDA" or "short_range_LDA" for, respectively the |LDA| and its short-range version +* "PBE" or "short_range_PBE" for, respectively the |PBE| and its short-range version + + +Modifying the amount of |HF| exchange +------------------------------------- +* :option:`dft_keywords HF_exchange` : only relevent for the :ref:`ks_scf` program + + +Other related keywords not defined in :ref:`module_dft_keywords` +---------------------------------------------------------------- +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 + + + File : :file:`dft_keywords/keywords.irp.f` + + .. code:: fortran + + character*(32) :: dft_type + + + defines the type of DFT applied: LDA, GGA etc ... + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`correlation_functional` + * :c:data:`exchange_functional` + + + +.. c:var:: same_xc_func + + + File : :file:`dft_keywords/keywords.irp.f` + + .. code:: fortran + + logical :: same_xc_func + + + true if the exchange and correlation functionals are the same + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`correlation_functional` + * :c:data:`exchange_functional` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_potential_alpha_xc` + diff --git a/docs/source/modules/dft_one_e.rst b/docs/source/modules/dft_one_e.rst new file mode 100644 index 000000000..a30bcd691 --- /dev/null +++ b/docs/source/modules/dft_one_e.rst @@ -0,0 +1,640 @@ +.. _module_dft_one_e: + +.. program:: dft_one_e + +.. default-role:: option + +dft_one_e +========= + +This module defines the most important providers needed for the |DFT| and |RSDFT| calculations: + +* :c:data:`energy_x` and :c:data:`energy_c` : the *exchange* and *correlation* energy functionals (see :file:`e_xc_general.irp.f`) + +* :c:data:`potential_x_alpha_ao` and :c:data:`potential_x_beta_ao` : the exchange potential for alpha/beta electrons (see :file:`pot_general.irp.f`) + +* :c:data:`potential_c_alpha_ao` and :c:data:`potential_c_beta_ao` : the correlation potential for alpha/beta electrons (see :file:`pot_general.irp.f`) + + +These providers are then used in the :ref:`ks_scf` and :ref:`rs_ks_scf` programs, together within some |RSDFT| external +plugins (see ``_). + +The flexibility of the functionals is handle by the two following keywords (see :ref:`module_dft_keywords`): + +* :option:`dft_keywords exchange_functional` : defines which *exchange* functionals will be set + +* :option:`dft_keywords correlation_functional` : defines which *correlation* functionals will be set + + +In the core modules of the |QP|, two functionals are implemented: + + * "LDA" or "short_range_LDA" for, respectively the |LDA| and its short-range version + + * "PBE" or "short_range_PBE" for, respectively the |PBE| and its short-range version + + + + + +Providers +--------- + +.. c:var:: energy_c + + + File : :file:`dft_one_e/e_xc_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: energy_c (N_states) + + + correlation and exchange energies general providers. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`correlation_functional` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_none` + * :c:data:`energy_c_pbe` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_x_sr_pbe` + * :c:data:`n_states` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`e_correlation_dft` + + +.. c:var:: energy_x + + + File : :file:`dft_one_e/e_xc_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: energy_x (N_states) + + + correlation energies general providers. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`energy_x_lda` + * :c:data:`energy_x_none` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_lda` + * :c:data:`energy_x_sr_pbe` + * :c:data:`exchange_functional` + * :c:data:`n_states` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`e_exchange_dft` + + +.. c:var:: potential_c_alpha_ao + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta correlation potentials on the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`correlation_functional` + * :c:data:`n_states` + * :c:data:`potential_c_alpha_ao_lda` + * :c:data:`potential_c_alpha_ao_none` + * :c:data:`potential_c_alpha_ao_sr_lda` + * :c:data:`potential_c_beta_ao_none` + * :c:data:`potential_x_alpha_ao_pbe` + * :c:data:`potential_x_alpha_ao_sr_pbe` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_potential_alpha_xc` + * :c:data:`potential_c_alpha_mo` + + +.. c:var:: potential_c_alpha_mo + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta correlation potentials on the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_c_alpha_ao` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`effective_one_e_potential` + * :c:data:`trace_v_xc` + + +.. c:var:: potential_c_beta_ao + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta correlation potentials on the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`correlation_functional` + * :c:data:`n_states` + * :c:data:`potential_c_alpha_ao_lda` + * :c:data:`potential_c_alpha_ao_none` + * :c:data:`potential_c_alpha_ao_sr_lda` + * :c:data:`potential_c_beta_ao_none` + * :c:data:`potential_x_alpha_ao_pbe` + * :c:data:`potential_x_alpha_ao_sr_pbe` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_potential_alpha_xc` + * :c:data:`potential_c_alpha_mo` + + +.. c:var:: potential_c_beta_mo + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta correlation potentials on the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_c_alpha_ao` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`effective_one_e_potential` + * :c:data:`trace_v_xc` + + +.. c:var:: potential_x_alpha_ao + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta exchange potentials on the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`exchange_functional` + * :c:data:`n_states` + * :c:data:`potential_x_alpha_ao_lda` + * :c:data:`potential_x_alpha_ao_none` + * :c:data:`potential_x_alpha_ao_pbe` + * :c:data:`potential_x_alpha_ao_sr_lda` + * :c:data:`potential_x_alpha_ao_sr_pbe` + * :c:data:`potential_x_beta_ao_none` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_potential_alpha_xc` + * :c:data:`potential_x_alpha_mo` + + +.. c:var:: potential_x_alpha_mo + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta exchange potentials on the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_x_alpha_ao` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`effective_one_e_potential` + * :c:data:`trace_v_xc` + + +.. c:var:: potential_x_beta_ao + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta exchange potentials on the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`exchange_functional` + * :c:data:`n_states` + * :c:data:`potential_x_alpha_ao_lda` + * :c:data:`potential_x_alpha_ao_none` + * :c:data:`potential_x_alpha_ao_pbe` + * :c:data:`potential_x_alpha_ao_sr_lda` + * :c:data:`potential_x_alpha_ao_sr_pbe` + * :c:data:`potential_x_beta_ao_none` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_potential_alpha_xc` + * :c:data:`potential_x_alpha_mo` + + +.. c:var:: potential_x_beta_mo + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + 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) + + + general providers for the alpha/beta exchange potentials on the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_x_alpha_ao` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`effective_one_e_potential` + * :c:data:`trace_v_xc` + + +.. c:var:: potential_xc_alpha_ao + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: potential_xc_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_xc_beta_ao (ao_num,ao_num,N_states) + + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`exchange_functional` + * :c:data:`n_states` + * :c:data:`potential_xc_alpha_ao_lda` + * :c:data:`potential_xc_alpha_ao_none` + * :c:data:`potential_xc_alpha_ao_pbe` + * :c:data:`potential_xc_alpha_ao_sr_lda` + * :c:data:`potential_xc_alpha_ao_sr_pbe` + * :c:data:`potential_xc_beta_ao_none` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_potential_alpha_xc` + * :c:data:`potential_xc_alpha_mo` + + +.. c:var:: potential_xc_alpha_mo + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: potential_xc_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_xc_beta_mo (mo_num,mo_num,N_states) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_xc_alpha_ao` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`trace_v_xc_new` + + +.. c:var:: potential_xc_beta_ao + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: potential_xc_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_xc_beta_ao (ao_num,ao_num,N_states) + + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`exchange_functional` + * :c:data:`n_states` + * :c:data:`potential_xc_alpha_ao_lda` + * :c:data:`potential_xc_alpha_ao_none` + * :c:data:`potential_xc_alpha_ao_pbe` + * :c:data:`potential_xc_alpha_ao_sr_lda` + * :c:data:`potential_xc_alpha_ao_sr_pbe` + * :c:data:`potential_xc_beta_ao_none` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_potential_alpha_xc` + * :c:data:`potential_xc_alpha_mo` + + +.. c:var:: potential_xc_beta_mo + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: potential_xc_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_xc_beta_mo (mo_num,mo_num,N_states) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_xc_alpha_ao` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`trace_v_xc_new` + + +.. c:var:: trace_v_h + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + + 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} + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + * :c:data:`potential_c_alpha_mo` + * :c:data:`potential_x_alpha_mo` + * :c:data:`short_range_hartree_operator` + + + +.. c:var:: trace_v_hxc + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + + 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} + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + * :c:data:`potential_c_alpha_mo` + * :c:data:`potential_x_alpha_mo` + * :c:data:`short_range_hartree_operator` + + + +.. c:var:: trace_v_xc + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + + 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} + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + * :c:data:`potential_c_alpha_mo` + * :c:data:`potential_x_alpha_mo` + * :c:data:`short_range_hartree_operator` + + + +.. c:var:: trace_v_xc_new + + + File : :file:`dft_one_e/pot_general.irp.f` + + .. code:: fortran + + double precision, allocatable :: trace_v_xc_new (N_states) + + + Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + * :c:data:`potential_xc_alpha_mo` + + 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 000000000..a5164ee57 --- /dev/null +++ b/docs/source/modules/dft_utils_in_r.rst @@ -0,0 +1,907 @@ +.. _module_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_e_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 + + + File : :file:`dft_utils_in_r/ao_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3) + + + aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point + + k = 1 : x, k= 2, y, k 3, z + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`ao_prim_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mos_grad_in_r_array` + + +.. c:var:: aos_grad_in_r_array_transp + + + File : :file:`dft_utils_in_r/ao_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`ao_prim_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + + +.. c:var:: aos_grad_in_r_array_transp_xyz + + + File : :file:`dft_utils_in_r/ao_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: aos_grad_in_r_array_transp_xyz (3,ao_num,n_points_final_grid) + + + aos_grad_in_r_array_transp_xyz(k,i,j) = 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`ao_prim_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_pbe_w` + + +.. c:var:: aos_in_r_array + + + File : :file:`dft_utils_in_r/ao_in_r.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`ao_prim_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`pot_grad_x_alpha_ao_pbe` + * :c:data:`pot_grad_xc_alpha_ao_pbe` + * :c:data:`pot_scal_x_alpha_ao_pbe` + * :c:data:`pot_scal_xc_alpha_ao_pbe` + * :c:data:`pot_sr_grad_x_alpha_ao_pbe` + * :c:data:`pot_sr_grad_xc_alpha_ao_pbe` + * :c:data:`pot_sr_scal_x_alpha_ao_pbe` + * :c:data:`pot_sr_scal_xc_alpha_ao_pbe` + * :c:data:`potential_c_alpha_ao_lda` + * :c:data:`potential_c_alpha_ao_sr_lda` + * :c:data:`potential_x_alpha_ao_lda` + * :c:data:`potential_x_alpha_ao_sr_lda` + * :c:data:`potential_xc_alpha_ao_lda` + * :c:data:`potential_xc_alpha_ao_sr_lda` + + +.. c:var:: aos_in_r_array_transp + + + File : :file:`dft_utils_in_r/ao_in_r.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`ao_prim_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`pot_grad_x_alpha_ao_pbe` + * :c:data:`pot_grad_xc_alpha_ao_pbe` + * :c:data:`pot_scal_x_alpha_ao_pbe` + * :c:data:`pot_scal_xc_alpha_ao_pbe` + * :c:data:`pot_sr_grad_x_alpha_ao_pbe` + * :c:data:`pot_sr_grad_xc_alpha_ao_pbe` + * :c:data:`pot_sr_scal_x_alpha_ao_pbe` + * :c:data:`pot_sr_scal_xc_alpha_ao_pbe` + * :c:data:`potential_c_alpha_ao_lda` + * :c:data:`potential_c_alpha_ao_sr_lda` + * :c:data:`potential_x_alpha_ao_lda` + * :c:data:`potential_x_alpha_ao_sr_lda` + * :c:data:`potential_xc_alpha_ao_lda` + * :c:data:`potential_xc_alpha_ao_sr_lda` + + +.. c:var:: aos_lapl_in_r_array + + + File : :file:`dft_utils_in_r/ao_in_r.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`ao_prim_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mos_lapl_in_r_array` + + +.. c:var:: aos_lapl_in_r_array_transp + + + File : :file:`dft_utils_in_r/ao_in_r.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp_per_nucl` + * :c:data:`ao_expo_ordered_transp_per_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power_ordered_transp_per_nucl` + * :c:data:`ao_prim_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`nucl_aos_transposed` + * :c:data:`nucl_coord` + * :c:data:`nucl_n_aos` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mos_lapl_in_r_array` + + +.. c:var:: mos_grad_in_r_array + + + File : :file:`dft_utils_in_r/mo_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: mos_grad_in_r_array (mo_num,n_points_final_grid,3) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`aos_grad_in_r_array` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + * :c:data:`n_points_final_grid` + + + +.. c:var:: mos_in_r_array + + + File : :file:`dft_utils_in_r/mo_in_r.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + * :c:data:`n_points_final_grid` + + + +.. c:var:: mos_in_r_array_transp + + + File : :file:`dft_utils_in_r/mo_in_r.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + * :c:data:`n_points_final_grid` + + + +.. c:var:: mos_lapl_in_r_array + + + File : :file:`dft_utils_in_r/mo_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: mos_lapl_in_r_array (mo_num,n_points_final_grid,3) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`aos_lapl_in_r_array` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + * :c:data:`n_points_final_grid` + + + +.. c:var:: one_e_dm_alpha_at_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_beta_at_r (n_points_final_grid,N_states) + + + one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) + one_e_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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_x_lda` + * :c:data:`energy_x_sr_lda` + + +.. c:var:: one_e_dm_alpha_in_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_e_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`grid_points_per_atom` + * :c:data:`mo_num` + * :c:data:`n_points_radial_grid` + * :c:data:`n_states` + * :c:data:`nucl_num` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + + +.. c:var:: one_e_dm_and_grad_alpha_in_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) + one_e_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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_pbe` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_pbe` + + +.. c:var:: one_e_dm_and_grad_beta_in_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) + one_e_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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_pbe` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_pbe` + + +.. c:var:: one_e_dm_beta_at_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_beta_at_r (n_points_final_grid,N_states) + + + one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) + one_e_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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`energy_c_lda` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_x_lda` + * :c:data:`energy_x_sr_lda` + + +.. c:var:: one_e_dm_beta_in_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_e_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`grid_points_per_atom` + * :c:data:`mo_num` + * :c:data:`n_points_radial_grid` + * :c:data:`n_states` + * :c:data:`nucl_num` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + + +.. c:var:: one_e_grad_2_dm_alpha_at_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) + one_e_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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_pbe` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_pbe` + + +.. c:var:: one_e_grad_2_dm_beta_at_r + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) + one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) + one_e_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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`final_grid_points` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_ao_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_pbe` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_pbe` + * :c:data:`energy_x_sr_pbe` + + + +Subroutines / functions +----------------------- + +.. c:function:: density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r: + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + 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) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`one_e_dm_alpha_ao_for_dft` + * :c:data:`n_states` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dsymv` + * :c:func:`give_all_aos_and_grad_at_r` + + +.. c:function:: dm_dft_alpha_beta_and_all_aos_at_r: + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + subroutine dm_dft_alpha_beta_and_all_aos_at_r(r,dm_a,dm_b,aos_array) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`one_e_dm_alpha_ao_for_dft` + * :c:data:`n_states` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dsymv` + * :c:func:`give_all_aos_at_r` + + +.. c:function:: dm_dft_alpha_beta_at_r: + + + File : :file:`dft_utils_in_r/dm_in_r.irp.f` + + .. code:: fortran + + subroutine dm_dft_alpha_beta_at_r(r,dm_a,dm_b) + + + 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) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`one_e_dm_alpha_ao_for_dft` + * :c:data:`n_states` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_alpha_at_r` + * :c:data:`one_e_dm_alpha_in_r` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemv` + * :c:func:`give_all_aos_at_r` + 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 000000000..05a75570b --- /dev/null +++ b/docs/source/modules/dft_utils_one_e.rst @@ -0,0 +1,1187 @@ +.. _module_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 with the LDA and PBE functionals. +Therefore, it contains most of the properties which depends on the one-body density and density matrix. + +Some interesting quantities you might take a look at: + +* 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:: ao_effective_one_e_potential + + + File : :file:`dft_utils_one_e/effective_pot.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_effective_one_e_potential (ao_num,ao_num,N_states) + double precision, allocatable :: ao_effective_one_e_potential_without_kin (ao_num,ao_num,N_states) + + + ao_effective_one_e_potential(i,j) = :math:`\rangle i_{AO}| v_{H}^{sr} |j_{AO}\rangle + \rangle i_{AO}| h_{core} |j_{AO}\rangle + \rangle i_{AO}|v_{xc} |j_{AO}\rangle` + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`effective_one_e_potential` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + + + +.. c:var:: ao_effective_one_e_potential_without_kin + + + File : :file:`dft_utils_one_e/effective_pot.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_effective_one_e_potential (ao_num,ao_num,N_states) + double precision, allocatable :: ao_effective_one_e_potential_without_kin (ao_num,ao_num,N_states) + + + ao_effective_one_e_potential(i,j) = :math:`\rangle i_{AO}| v_{H}^{sr} |j_{AO}\rangle + \rangle i_{AO}| h_{core} |j_{AO}\rangle + \rangle i_{AO}|v_{xc} |j_{AO}\rangle` + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`effective_one_e_potential` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_states` + + + +.. c:var:: effective_one_e_potential + + + File : :file:`dft_utils_one_e/effective_pot.irp.f` + + .. code:: fortran + + 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) + + + Effective_one_e_potential(i,j) = :math:`\rangle i_{MO}| v_{H}^{sr} |j_{MO}\rangle + \rangle i_{MO}| h_{core} |j_{MO}\rangle + \rangle i_{MO}|v_{xc} |j_{MO}\rangle` + + on the |MO| basis + 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. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_c_alpha_mo` + * :c:data:`potential_x_alpha_mo` + * :c:data:`short_range_hartree_operator` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_effective_one_e_potential` + + +.. c:var:: effective_one_e_potential_without_kin + + + File : :file:`dft_utils_one_e/effective_pot.irp.f` + + .. code:: fortran + + 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) + + + Effective_one_e_potential(i,j) = :math:`\rangle i_{MO}| v_{H}^{sr} |j_{MO}\rangle + \rangle i_{MO}| h_{core} |j_{MO}\rangle + \rangle i_{MO}|v_{xc} |j_{MO}\rangle` + + on the |MO| basis + 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. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`potential_c_alpha_mo` + * :c:data:`potential_x_alpha_mo` + * :c:data:`short_range_hartree_operator` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_effective_one_e_potential` + + +.. c:var:: energy_sr_c_lda + + + File : :file:`dft_utils_one_e/sr_exc.irp.f` + + .. code:: fortran + + double precision, allocatable :: energy_sr_x_lda (N_states) + double precision, allocatable :: energy_sr_c_lda (N_states) + + + exchange/correlation energy with the short range lda functional + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_grid_points` + * :c:data:`mu_erf_dft` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_at_r` + + + +.. c:var:: energy_sr_c_pbe + + + File : :file:`dft_utils_one_e/sr_exc.irp.f` + + .. code:: fortran + + double precision, allocatable :: energy_sr_x_pbe (N_states) + double precision, allocatable :: energy_sr_c_pbe (N_states) + + + exchange/correlation energy with the short range pbe functional + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_grid_points` + * :c:data:`mu_erf_dft` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + + +.. c:var:: energy_sr_x_lda + + + File : :file:`dft_utils_one_e/sr_exc.irp.f` + + .. code:: fortran + + double precision, allocatable :: energy_sr_x_lda (N_states) + double precision, allocatable :: energy_sr_c_lda (N_states) + + + exchange/correlation energy with the short range lda functional + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_grid_points` + * :c:data:`mu_erf_dft` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_alpha_at_r` + + + +.. c:var:: energy_sr_x_pbe + + + File : :file:`dft_utils_one_e/sr_exc.irp.f` + + .. code:: fortran + + double precision, allocatable :: energy_sr_x_pbe (N_states) + double precision, allocatable :: energy_sr_c_pbe (N_states) + + + exchange/correlation energy with the short range pbe functional + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`final_grid_points` + * :c:data:`mu_erf_dft` + * :c:data:`n_points_final_grid` + * :c:data:`n_states` + * :c:data:`one_e_dm_and_grad_alpha_in_r` + + + +.. c:function:: gga_sr_type_functionals: + + + File : :file:`dft_utils_one_e/utils.irp.f` + + .. code:: fortran + + 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 ) + + + routine that helps in building the x/c potentials on the AO basis for a GGA functional with a short-range interaction + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mu_erf_dft` + * :c:data:`n_states` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_sr_pbe` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_pbe_sr` + * :c:func:`ex_pbe_sr` + * :c:func:`grad_rho_ab_to_grad_rho_oc` + * :c:func:`rho_ab_to_rho_oc` + * :c:func:`v_grad_rho_oc_to_v_grad_rho_ab` + * :c:func:`v_rho_oc_to_v_rho_ab` + + +.. c:function:: gga_type_functionals: + + + File : :file:`dft_utils_one_e/utils.irp.f` + + .. code:: fortran + + 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 ) + + + routine that helps in building the x/c potentials on the AO basis for a GGA functional + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_vc_alpha_pbe_w` + * :c:data:`aos_vxc_alpha_pbe_w` + * :c:data:`energy_c_pbe` + * :c:data:`energy_x_pbe` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_pbe_sr` + * :c:func:`ex_pbe_sr` + * :c:func:`grad_rho_ab_to_grad_rho_oc` + * :c:func:`rho_ab_to_rho_oc` + * :c:func:`v_grad_rho_oc_to_v_grad_rho_ab` + * :c:func:`v_rho_oc_to_v_rho_ab` + + +.. c:var:: mu_erf_dft + + + File : :file:`dft_utils_one_e/mu_erf_dft.irp.f` + + .. code:: fortran + + double precision :: mu_erf_dft + + + range separation parameter used in RS-DFT. It is set to mu_erf in order to be consistent with the two electrons integrals erf + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mu_erf` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vc_alpha_pbe_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_pbe_w` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_sr_x_pbe` + * :c:data:`energy_x_sr_lda` + * :c:data:`energy_x_sr_pbe` + + +.. c:var:: psi_dft_energy_h_core + + + File : :file:`dft_utils_one_e/one_e_energy_dft.irp.f` + + .. code:: fortran + + 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) + + + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + + +.. c:var:: psi_dft_energy_kinetic + + + File : :file:`dft_utils_one_e/one_e_energy_dft.irp.f` + + .. code:: fortran + + 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) + + + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + + +.. c:var:: psi_dft_energy_nuclear_elec + + + File : :file:`dft_utils_one_e/one_e_energy_dft.irp.f` + + .. code:: fortran + + 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) + + + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_num` + * :c:data:`n_states` + * :c:data:`one_e_dm_mo_alpha_for_dft` + * :c:data:`one_e_dm_mo_beta_for_dft` + + + +.. c:var:: short_range_hartree + + + File : :file:`dft_utils_one_e/sr_coulomb.irp.f` + + .. code:: fortran + + double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) + double precision, allocatable :: short_range_hartree (N_states) + + + 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}` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_states` + * :c:data:`one_e_dm_average_mo_for_dft` + * :c:data:`one_e_dm_mo_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`effective_one_e_potential` + * :c:data:`trace_v_xc` + + +.. c:var:: short_range_hartree_operator + + + File : :file:`dft_utils_one_e/sr_coulomb.irp.f` + + .. code:: fortran + + double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) + double precision, allocatable :: short_range_hartree (N_states) + + + 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}` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_states` + * :c:data:`one_e_dm_average_mo_for_dft` + * :c:data:`one_e_dm_mo_for_dft` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`effective_one_e_potential` + * :c:data:`trace_v_xc` + + + +Subroutines / functions +----------------------- + +.. c:function:: berf: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + function berf(a) + + + + +.. c:function:: dberfda: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + function dberfda(a) + + + + +.. c:function:: dpol: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function dpol(rs) + + + + +.. c:function:: dpold: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function dpold(rs) + + + + +.. c:function:: dpoldd: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function dpoldd(rs) + + + + +.. c:function:: ec_lda: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine ec_lda(rho_a,rho_b,ec,vc_a,vc_b) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_pbe_only` + * :c:func:`ec_pbe_sr` + * :c:data:`energy_c_lda` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ecpw` + + +.. c:function:: ec_lda_sr: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine ec_lda_sr(mu,rho_a,rho_b,ec,vc_a,vc_b) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:func:`ec_pbe_only` + * :c:func:`ec_pbe_sr` + * :c:data:`energy_c_sr_lda` + * :c:data:`energy_sr_x_lda` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ecorrlr` + * :c:func:`ecpw` + * :c:func:`vcorrlr` + + +.. c:function:: ec_only_lda_sr: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine ec_only_lda_sr(mu,rho_a,rho_b,ec) + + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ecorrlr` + * :c:func:`ecpw` + + +.. c:function:: ec_pbe_only: + + + File : :file:`dft_utils_one_e/exc_sr_pbe.irp.f` + + .. code:: fortran + + subroutine ec_pbe_only(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec) + + + 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 + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_lda` + * :c:func:`ec_lda_sr` + + +.. c:function:: ec_pbe_sr: + + + File : :file:`dft_utils_one_e/exc_sr_pbe.irp.f` + + .. code:: fortran + + subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo) + + + 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 + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`gga_sr_type_functionals` + * :c:func:`gga_type_functionals` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_lda` + * :c:func:`ec_lda_sr` + + +.. c:function:: ecorrlr: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine ecorrlr(rs,z,mu,eclr) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_lda_sr` + * :c:func:`ec_only_lda_sr` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ecpw` + + +.. c:function:: ecpw: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine ecPW(x,y,ec,ecd,ecz,ecdd,eczd) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_lda` + * :c:func:`ec_lda_sr` + * :c:func:`ec_only_lda_sr` + * :c:func:`ecorrlr` + * :c:func:`vcorrlr` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`gpw` + + +.. c:function:: ex_lda: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine ex_lda(rho_a,rho_b,ex,vx_a,vx_b) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`energy_x_lda` + + +.. c:function:: ex_lda_sr: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine ex_lda_sr(mu,rho_a,rho_b,ex,vx_a,vx_b) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`aos_sr_vc_alpha_lda_w` + * :c:data:`aos_sr_vxc_alpha_lda_w` + * :c:data:`aos_vc_alpha_lda_w` + * :c:data:`aos_vxc_alpha_lda_w` + * :c:data:`energy_sr_x_lda` + * :c:data:`energy_x_sr_lda` + * :c:func:`ex_pbe_sr` + * :c:func:`ex_pbe_sr_only` + + +.. c:function:: ex_pbe_sr: + + + File : :file:`dft_utils_one_e/exc_sr_pbe.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`gga_sr_type_functionals` + * :c:func:`gga_type_functionals` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ex_lda_sr` + + +.. c:function:: ex_pbe_sr_only: + + + File : :file:`dft_utils_one_e/exc_sr_pbe.irp.f` + + .. code:: fortran + + subroutine ex_pbe_sr_only(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex) + + + 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 + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ex_lda_sr` + + +.. c:function:: g0d: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function g0d(rs) + + + + +.. c:function:: g0dd: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function g0dd(rs) + + + + +.. c:function:: g0f: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function g0f(x) + + + + +.. c:function:: gpw: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine GPW(x,Ac,alfa1,beta1,beta2,beta3,beta4,G,Gd,Gdd) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ecpw` + + +.. c:function:: grad_rho_ab_to_grad_rho_oc: + + + File : :file:`dft_utils_one_e/rho_ab_to_rho_tot.irp.f` + + .. code:: fortran + + 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) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`gga_sr_type_functionals` + * :c:func:`gga_type_functionals` + + +.. c:function:: qrpa: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function Qrpa(x) + + + + +.. c:function:: qrpad: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function Qrpad(x) + + + + +.. c:function:: qrpadd: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + double precision function Qrpadd(x) + + + + +.. c:function:: rho_ab_to_rho_oc: + + + File : :file:`dft_utils_one_e/rho_ab_to_rho_tot.irp.f` + + .. code:: fortran + + subroutine rho_ab_to_rho_oc(rho_a,rho_b,rho_o,rho_c) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`gga_sr_type_functionals` + * :c:func:`gga_type_functionals` + + +.. c:function:: rho_oc_to_rho_ab: + + + File : :file:`dft_utils_one_e/rho_ab_to_rho_tot.irp.f` + + .. code:: fortran + + subroutine rho_oc_to_rho_ab(rho_o,rho_c,rho_a,rho_b) + + + + +.. c:function:: v_grad_rho_oc_to_v_grad_rho_ab: + + + File : :file:`dft_utils_one_e/rho_ab_to_rho_tot.irp.f` + + .. code:: fortran + + 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) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`gga_sr_type_functionals` + * :c:func:`gga_type_functionals` + + +.. c:function:: v_rho_ab_to_v_rho_oc: + + + File : :file:`dft_utils_one_e/rho_ab_to_rho_tot.irp.f` + + .. code:: fortran + + subroutine v_rho_ab_to_v_rho_oc(v_rho_a,v_rho_b,v_rho_o,v_rho_c) + + + + +.. c:function:: v_rho_oc_to_v_rho_ab: + + + File : :file:`dft_utils_one_e/rho_ab_to_rho_tot.irp.f` + + .. code:: fortran + + subroutine v_rho_oc_to_v_rho_ab(v_rho_o,v_rho_c,v_rho_a,v_rho_b) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`gga_sr_type_functionals` + * :c:func:`gga_type_functionals` + + +.. c:function:: vcorrlr: + + + File : :file:`dft_utils_one_e/exc_sr_lda.irp.f` + + .. code:: fortran + + subroutine vcorrlr(rs,z,mu,vclrup,vclrdown,vclrupd,vclrdownd) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ec_lda_sr` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ecpw` + diff --git a/docs/source/modules/dressing.rst b/docs/source/modules/dressing.rst new file mode 100644 index 000000000..17695be46 --- /dev/null +++ b/docs/source/modules/dressing.rst @@ -0,0 +1,36 @@ +.. _module_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 000000000..5945ef08d --- /dev/null +++ b/docs/source/modules/electrons.rst @@ -0,0 +1,112 @@ +.. _module_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 + + + File : :file:`electrons/electrons.irp.f` + + .. code:: fortran + + integer :: elec_num + integer, allocatable :: elec_num_tab (2) + + + Numbers of alpha ("up") , beta ("down") and total electrons + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`ezfio_filename` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: elec_num_tab + + + File : :file:`electrons/electrons.irp.f` + + .. code:: fortran + + integer :: elec_num + integer, allocatable :: elec_num_tab (2) + + + Numbers of alpha ("up") , beta ("down") and total electrons + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`ezfio_filename` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`diagonal_h_matrix_on_psi_det` + * :c:data:`psi_det_hii` + * :c:data:`psi_selectors_diag_h_mat` + diff --git a/docs/source/modules/ezfio_files.rst b/docs/source/modules/ezfio_files.rst new file mode 100644 index 000000000..f9cb0aded --- /dev/null +++ b/docs/source/modules/ezfio_files.rst @@ -0,0 +1,769 @@ +.. _module_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 + + + File : :file:`ezfio_files/ezfio.irp.f` + + .. code:: fortran + + character*(128) :: ezfio_filename + + + Name of EZFIO file. It is obtained from the QPACKAGE_INPUT environment + variable if it is set, or as the 1st argument of the command line. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_initialized` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cartesian` + * :c:data:`ao_coef` + * :c:data:`ao_expo` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_md5` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`cas_bitmask` + * :c:data:`correlation_energy_ratio_max` + * :c:data:`data_energy_proj` + * :c:data:`data_energy_var` + * :c:data:`data_one_e_dm_alpha_mo` + * :c:data:`data_one_e_dm_beta_mo` + * :c:data:`davidson_sze_max` + * :c:data:`disk_access_nuclear_repulsion` + * :c:data:`disk_based_davidson` + * :c:data:`distributed_davidson` + * :c:data:`do_direct_integrals` + * :c:data:`do_pseudo` + * :c:data:`do_pt2` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`elec_num` + * :c:data:`energy_iterations` + * :c:data:`ezfio_work_dir` + * :c:data:`frozen_orb_scf` + * :c:data:`generators_bitmask` + * :c:data:`generators_bitmask_restart` + * :c:data:`h0_type` + * :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:`level_shift` + * :c:data:`max_dim_diis` + * :c:data:`mo_class` + * :c:data:`mo_coef` + * :c:data:`mo_guess_type` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_label` + * :c:data:`mo_num` + * :c:data:`mo_occ` + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mu_erf` + * :c:data:`n_cas_bitmask` + * :c:data:`n_det` + * :c:data:`n_det_iterations` + * :c:data:`n_det_max` + * :c:data:`n_det_max_full` + * :c:data:`n_det_print_wf` + * :c:data:`n_generators_bitmask` + * :c:data:`n_generators_bitmask_restart` + * :c:data:`n_it_scf_max` + * :c:data:`n_iter` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`no_ivvv_integrals` + * :c:data:`no_vvv_integrals` + * :c:data:`no_vvvv_integrals` + * :c:data:`nucl_charge` + * :c:data:`nucl_charge_remove` + * :c:data:`nucl_coord` + * :c:data:`nucl_label` + * :c:data:`nucl_num` + * :c:data:`only_expected_s2` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_grid_rmax` + * :c:data:`pseudo_grid_size` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_k` + * :c:data:`pseudo_v_kl` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_det_size` + * :c:data:`pt2_iterations` + * :c:data:`pt2_max` + * :c:data:`pt2_relative_error` + * :c:data:`qp_stop_filename` + * :c:data:`read_wf` + * :c:data:`s2_eig` + * :c:data:`scf_algorithm` + * :c:data:`state_following` + * :c:data:`target_energy` + * :c:data:`thresh_scf` + * :c:data:`threshold_davidson` + * :c:data:`threshold_diis` + * :c:data:`threshold_generators` + * :c:data:`used_weight` + * :c:data:`variance_max` + + +.. c:var:: ezfio_work_dir + + + File : :file:`ezfio_files/ezfio.irp.f` + + .. code:: fortran + + character*(128) :: ezfio_work_dir + + + EZFIO/work/ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + + + +.. c:var:: file_lock + + + File : :file:`ezfio_files/lock.irp.f` + + .. code:: fortran + + integer(omp_lock_kind) :: file_lock + + + OpenMP Lock for I/O + + + +.. c:var:: output_cpu_time_0 + + + File : :file:`ezfio_files/output.irp.f` + + .. code:: fortran + + double precision :: output_wall_time_0 + double precision :: output_cpu_time_0 + + + Initial CPU and wall times when printing in the output files + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cartesian` + * :c:data:`ao_coef` + * :c:data:`ao_expo` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_md5` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ci_energy` + * :c:data:`correlation_energy_ratio_max` + * :c:data:`data_energy_proj` + * :c:data:`data_energy_var` + * :c:data:`data_one_e_dm_alpha_mo` + * :c:data:`data_one_e_dm_beta_mo` + * :c:data:`davidson_sze_max` + * :c:data:`disk_access_nuclear_repulsion` + * :c:data:`disk_based_davidson` + * :c:data:`distributed_davidson` + * :c:data:`do_direct_integrals` + * :c:data:`do_pseudo` + * :c:data:`do_pt2` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`energy_iterations` + * :c:data:`frozen_orb_scf` + * :c:data:`h0_type` + * :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:`level_shift` + * :c:data:`max_dim_diis` + * :c:data:`mo_class` + * :c:data:`mo_guess_type` + * :c:data:`mo_integrals_threshold` + * :c:data:`mu_erf` + * :c:data:`n_det_generators` + * :c:data:`n_det_iterations` + * :c:data:`n_det_max` + * :c:data:`n_det_max_full` + * :c:data:`n_det_print_wf` + * :c:data:`n_det_selectors` + * :c:data:`n_it_scf_max` + * :c:data:`n_iter` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`no_ivvv_integrals` + * :c:data:`no_vvv_integrals` + * :c:data:`no_vvvv_integrals` + * :c:data:`nucl_charge` + * :c:data:`nucl_charge_remove` + * :c:data:`nucl_coord` + * :c:data:`nucl_label` + * :c:data:`nucl_num` + * :c:data:`nuclear_repulsion` + * :c:data:`only_expected_s2` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_grid_rmax` + * :c:data:`pseudo_grid_size` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_k` + * :c:data:`pseudo_v_kl` + * :c:data:`pt2_iterations` + * :c:data:`pt2_max` + * :c:data:`pt2_relative_error` + * :c:data:`read_wf` + * :c:data:`s2_eig` + * :c:data:`scf_algorithm` + * :c:data:`state_following` + * :c:data:`target_energy` + * :c:data:`thresh_scf` + * :c:data:`threshold_davidson` + * :c:data:`threshold_diis` + * :c:data:`threshold_generators` + * :c:data:`used_weight` + * :c:data:`variance_max` + + +.. c:var:: output_wall_time_0 + + + File : :file:`ezfio_files/output.irp.f` + + .. code:: fortran + + double precision :: output_wall_time_0 + double precision :: output_cpu_time_0 + + + Initial CPU and wall times when printing in the output files + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cartesian` + * :c:data:`ao_coef` + * :c:data:`ao_expo` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_md5` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ci_energy` + * :c:data:`correlation_energy_ratio_max` + * :c:data:`data_energy_proj` + * :c:data:`data_energy_var` + * :c:data:`data_one_e_dm_alpha_mo` + * :c:data:`data_one_e_dm_beta_mo` + * :c:data:`davidson_sze_max` + * :c:data:`disk_access_nuclear_repulsion` + * :c:data:`disk_based_davidson` + * :c:data:`distributed_davidson` + * :c:data:`do_direct_integrals` + * :c:data:`do_pseudo` + * :c:data:`do_pt2` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`energy_iterations` + * :c:data:`frozen_orb_scf` + * :c:data:`h0_type` + * :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:`level_shift` + * :c:data:`max_dim_diis` + * :c:data:`mo_class` + * :c:data:`mo_guess_type` + * :c:data:`mo_integrals_threshold` + * :c:data:`mu_erf` + * :c:data:`n_det_generators` + * :c:data:`n_det_iterations` + * :c:data:`n_det_max` + * :c:data:`n_det_max_full` + * :c:data:`n_det_print_wf` + * :c:data:`n_det_selectors` + * :c:data:`n_it_scf_max` + * :c:data:`n_iter` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`no_ivvv_integrals` + * :c:data:`no_vvv_integrals` + * :c:data:`no_vvvv_integrals` + * :c:data:`nucl_charge` + * :c:data:`nucl_charge_remove` + * :c:data:`nucl_coord` + * :c:data:`nucl_label` + * :c:data:`nucl_num` + * :c:data:`nuclear_repulsion` + * :c:data:`only_expected_s2` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_grid_rmax` + * :c:data:`pseudo_grid_size` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_k` + * :c:data:`pseudo_v_kl` + * :c:data:`pt2_iterations` + * :c:data:`pt2_max` + * :c:data:`pt2_relative_error` + * :c:data:`read_wf` + * :c:data:`s2_eig` + * :c:data:`scf_algorithm` + * :c:data:`state_following` + * :c:data:`target_energy` + * :c:data:`thresh_scf` + * :c:data:`threshold_davidson` + * :c:data:`threshold_diis` + * :c:data:`threshold_generators` + * :c:data:`used_weight` + * :c:data:`variance_max` + + +.. c:var:: qp_kill_filename + + + File : :file:`ezfio_files/qp_stop.irp.f` + + .. code:: fortran + + character*(128) :: qp_stop_filename + character*(128) :: qp_kill_filename + integer :: qp_stop_variable + + + Name of the file to check for qp stop + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + + + +.. c:var:: qp_stop_filename + + + File : :file:`ezfio_files/qp_stop.irp.f` + + .. code:: fortran + + character*(128) :: qp_stop_filename + character*(128) :: qp_kill_filename + integer :: qp_stop_variable + + + Name of the file to check for qp stop + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + + + +.. c:var:: qp_stop_variable + + + File : :file:`ezfio_files/qp_stop.irp.f` + + .. code:: fortran + + character*(128) :: qp_stop_filename + character*(128) :: qp_kill_filename + integer :: qp_stop_variable + + + Name of the file to check for qp stop + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + + + + +Subroutines / functions +----------------------- + +.. c:function:: getunitandopen: + + + File : :file:`ezfio_files/get_unit_and_open.irp.f` + + .. code:: fortran + + integer function getUnitAndOpen(f,mode) + + + :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:: qp_stop: + + + File : :file:`ezfio_files/qp_stop.irp.f` + + .. code:: fortran + + logical function qp_stop() + + + Checks if the qp_stop command was invoked for the clean termination of the program + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_stop_filename` + + +.. c:function:: write_bool: + + + File : :file:`ezfio_files/output.irp.f` + + .. code:: fortran + + subroutine write_bool(iunit,value,label) + + + Write an logical value in output + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + +.. c:function:: write_double: + + + File : :file:`ezfio_files/output.irp.f` + + .. code:: fortran + + subroutine write_double(iunit,value,label) + + + Write a double precision value in output + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_energy` + * :c:func:`damping_scf` + * :c:func:`davidson_diag_hjj_sjj` + * :c:data:`nuclear_repulsion` + * :c:data:`psi_coef_max` + * :c:data:`pt2_e0_denominator` + * :c:func:`roothaan_hall_scf` + * :c:func:`run_cipsi` + * :c:func:`run_slave_main` + * :c:func:`run_stochastic_cipsi` + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + +.. c:function:: write_int: + + + File : :file:`ezfio_files/output.irp.f` + + .. code:: fortran + + subroutine write_int(iunit,value,label) + + + Write an integer value in output + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_diag_hjj_sjj` + * :c:func:`make_s2_eigenfunction` + * :c:data:`mo_num` + * :c:data:`n_cas_bitmask` + * :c:data:`n_core_orb` + * :c:data:`n_det` + * :c:data:`n_det_generators` + * :c:data:`n_det_selectors` + * :c:data:`n_generators_bitmask` + * :c:data:`n_generators_bitmask_restart` + * :c:data:`n_int` + * :c:data:`nthreads_davidson` + * :c:data:`nthreads_pt2` + * :c:data:`psi_cas` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_size` + * :c:data:`pt2_f` + * :c:data:`pt2_n_teeth` + * :c:data:`qp_max_mem` + * :c:func:`remove_small_contributions` + * :c:func:`save_wavefunction_general` + * :c:func:`save_wavefunction_specified` + * :c:func:`zmq_pt2` + + +.. c:function:: write_time: + + + File : :file:`ezfio_files/output.irp.f` + + .. code:: fortran + + subroutine write_time(iunit) + + + Write a time stamp in the output for chronological reconstruction + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`output_wall_time_0` + * :c:data:`mpi_master` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cartesian` + * :c:data:`ao_coef` + * :c:data:`ao_expo` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_md5` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ci_energy` + * :c:data:`correlation_energy_ratio_max` + * :c:func:`damping_scf` + * :c:data:`data_energy_proj` + * :c:data:`data_energy_var` + * :c:data:`data_one_e_dm_alpha_mo` + * :c:data:`data_one_e_dm_beta_mo` + * :c:func:`davidson_diag_hjj_sjj` + * :c:data:`davidson_sze_max` + * :c:data:`disk_access_nuclear_repulsion` + * :c:data:`disk_based_davidson` + * :c:data:`distributed_davidson` + * :c:data:`do_direct_integrals` + * :c:data:`do_pseudo` + * :c:data:`do_pt2` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`energy_iterations` + * :c:data:`frozen_orb_scf` + * :c:data:`h0_type` + * :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:`level_shift` + * :c:func:`make_s2_eigenfunction` + * :c:data:`max_dim_diis` + * :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:data:`mo_class` + * :c:data:`mo_guess_type` + * :c:data:`mo_integrals_threshold` + * :c:data:`mu_erf` + * :c:data:`n_det_generators` + * :c:data:`n_det_iterations` + * :c:data:`n_det_max` + * :c:data:`n_det_max_full` + * :c:data:`n_det_print_wf` + * :c:data:`n_det_selectors` + * :c:data:`n_it_scf_max` + * :c:data:`n_iter` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`no_ivvv_integrals` + * :c:data:`no_vvv_integrals` + * :c:data:`no_vvvv_integrals` + * :c:data:`nucl_charge` + * :c:data:`nucl_charge_remove` + * :c:data:`nucl_coord` + * :c:data:`nucl_label` + * :c:data:`nucl_num` + * :c:data:`nuclear_repulsion` + * :c:data:`only_expected_s2` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_grid_rmax` + * :c:data:`pseudo_grid_size` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_k` + * :c:data:`pseudo_v_kl` + * :c:data:`pt2_iterations` + * :c:data:`pt2_max` + * :c:data:`pt2_relative_error` + * :c:data:`read_wf` + * :c:func:`roothaan_hall_scf` + * :c:data:`s2_eig` + * :c:data:`scf_algorithm` + * :c:data:`state_following` + * :c:data:`target_energy` + * :c:data:`thresh_scf` + * :c:data:`threshold_davidson` + * :c:data:`threshold_diis` + * :c:data:`threshold_generators` + * :c:data:`used_weight` + * :c:data:`variance_max` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`cpu_time` + * :c:func:`print_memory_usage` + * :c:func:`wall_time` + diff --git a/docs/source/modules/fci.rst b/docs/source/modules/fci.rst new file mode 100644 index 000000000..2d2bb6393 --- /dev/null +++ b/docs/source/modules/fci.rst @@ -0,0 +1,160 @@ +.. _module_fci: + +.. program:: fci + +.. default-role:: option + +=== +fci +=== + + +|CIPSI| algorithm in the full configuration interaction space. + + +The user point of view +---------------------- + +* :ref:`fci` performs |CIPSI| calculations using a stochastic scheme for both + the selection and the |PT2| contribution, + +* :ref:`pt2` computes the |PT2| contribution using the wave function stored in + the |EZFIO| database. + + +The main keywords/options for this module are: + +* :option:`determinants n_det_max` : maximum number of Slater determinants in + the |CIPSI| wave function. The :ref:`fci` program will stop when the size of + the |CIPSI| wave function will exceed :option:`determinants n_det_max`. + +* :option:`perturbation pt2_max` : absolute value of the |PT2| to stop the + |CIPSI| calculation. Once the abs(|PT2|) :math:`<` :option:`perturbation pt2_max`, + the |CIPSI| calculation stops. + +* :option:`determinants n_states` : number of states to consider in the |CIPSI| + calculation. + +* :option:`determinants read_wf` : if |false|, starts with a |ROHF|-like + determinant, if |true|, starts with the current wave function(s) stored in + the |EZFIO| directory. + +.. note:: + For a multi-state calculation, it is recommended to start with :ref:`cis` + or :ref:`cisd` wave functions as a guess. + +* :option:`determinants expected_s2` : expected value of |S^2| for the + desired spin multiplicity. + +* :option:`determinants s2_eig` : if |true|, systematically add all the + determinants needed to have a pure value of |S^2|. Also, if |true|, it + tracks only the states having the good :option:`determinants expected_s2`. + + + + +The programmer's point of view +------------------------------ + +This module was created with the :ref:`module_cipsi` module. + +.. seealso:: + + The documentation of the :ref:`module_cipsi` module. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Calculated Selected |FCI| energy + + +.. option:: energy_pt2 + + Calculated |FCI| energy + |PT2| + + + +Programs +-------- + + * :ref:`fci` + * :ref:`pt2` + +Providers +--------- + +.. c:var:: do_ddci + + + File : :file:`fci/class.irp.f` + + .. code:: fortran + + logical :: do_only_1h1p + logical :: do_ddci + + + In the FCI case, all those are always false + + + +.. c:var:: do_only_1h1p + + + File : :file:`fci/class.irp.f` + + .. code:: fortran + + logical :: do_only_1h1p + logical :: do_ddci + + + In the FCI case, all those are always false + + + + +Subroutines / functions +----------------------- + +.. c:function:: save_energy: + + + File : :file:`fci/save_energy.irp.f` + + .. code:: fortran + + subroutine save_energy(E,pt2) + + + Saves the energy in |EZFIO|. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_fci_energy` + * :c:func:`ezfio_set_fci_energy_pt2` + diff --git a/docs/source/modules/generators_cas.rst b/docs/source/modules/generators_cas.rst new file mode 100644 index 000000000..e4452acaa --- /dev/null +++ b/docs/source/modules/generators_cas.rst @@ -0,0 +1,19 @@ +.. _module_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 000000000..98546ad33 --- /dev/null +++ b/docs/source/modules/generators_full.rst @@ -0,0 +1,293 @@ +.. _module_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 + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + integer :: degree_max_generators + + + Max degree of excitation (respect to HF) of the generators + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`hf_bitmask` + * :c:data:`n_det_generators` + * :c:data:`n_int` + * :c:data:`psi_det_generators` + + + +.. c:var:: n_det_generators + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + integer :: n_det_generators + + + For Single reference wave functions, the number of generators is 1 : the + Hartree-Fock determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`output_wall_time_0` + * :c:data:`psi_det_sorted` + * :c:data:`threshold_generators` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`degree_max_generators` + * :c:data:`global_selection_buffer` + * :c:data:`n_det_selectors` + * :c:data:`pt2_f` + * :c:data:`pt2_j` + * :c:data:`pt2_n_tasks` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_u` + * :c:data:`pt2_w` + + +.. c:var:: psi_coef_generators + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) + + + For Single reference wave functions, the generator is the + Hartree-Fock determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`degree_max_generators` + + +.. c:var:: psi_coef_sorted_gen + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + 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) + + + For Single reference wave functions, the generator is the + Hartree-Fock determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_w` + + +.. c:var:: psi_det_generators + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) + + + For Single reference wave functions, the generator is the + Hartree-Fock determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`degree_max_generators` + + +.. c:var:: psi_det_sorted_gen + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + 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) + + + For Single reference wave functions, the generator is the + Hartree-Fock determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_w` + + +.. c:var:: psi_det_sorted_gen_order + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + 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) + + + For Single reference wave functions, the generator is the + Hartree-Fock determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_det_size` + * :c:data:`psi_det_sorted` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_w` + + +.. c:var:: select_max + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + double precision, allocatable :: select_max (size_select_max) + + + Memo to skip useless selectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`size_select_max` + + + +.. c:var:: size_select_max + + + File : :file:`generators_full/generators.irp.f` + + .. code:: fortran + + integer :: size_select_max + + + Size of the select_max array + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`select_max` + diff --git a/docs/source/modules/hartree_fock.rst b/docs/source/modules/hartree_fock.rst new file mode 100644 index 000000000..90857d0bd --- /dev/null +++ b/docs/source/modules/hartree_fock.rst @@ -0,0 +1,421 @@ +.. _module_hartree_fock: + +.. program:: hartree_fock + +.. default-role:: option + +============ +hartree_fock +============ + + +Quick description +----------------- + +The :ref:`scf` program performs *Restricted* Hartree-Fock +calculations (the spatial part of the |MOs| is common for alpha and beta +spinorbitals). + +.. seealso:: + To see the keywords/options associated to the |SCF| algorithm itself, + see the documentation of the :ref:`module_scf_utils` module. + + +More advanced description +------------------------- + +The Hartree-Fock algorithm is a |SCF| and therefore is based on the +:ref:`module_scf_utils` module. + +The Fock matrix is defined in :file:`fock_matrix_hf.irp.f`. + + +.. seealso:: + For a more detailed description of the |SCF| structure, + see the documentation of the :ref:`module_scf_utils` module. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Energy HF + + + +Programs +-------- + + * :ref:`scf` + +Providers +--------- + +.. c:var:: ao_two_e_integral_alpha + + + File : :file:`hartree_fock/fock_matrix_hf.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + + Alpha and Beta Fock matrices in AO basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`n_pt_max_integrals` + * :c:data:`nucl_coord` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`hf_energy` + + +.. c:var:: ao_two_e_integral_beta + + + File : :file:`hartree_fock/fock_matrix_hf.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + + Alpha and Beta Fock matrices in AO basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalized_ordered_transp` + * :c:data:`ao_expo_ordered_transp` + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`n_pt_max_integrals` + * :c:data:`nucl_coord` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`hf_energy` + + +.. c:var:: extra_e_contrib_density + + + File : :file:`hartree_fock/hf_energy.irp.f` + + .. code:: fortran + + double precision :: extra_e_contrib_density + + + 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 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`scf_energy` + + +.. c:var:: fock_matrix_ao_alpha + + + File : :file:`hartree_fock/fock_matrix_hf.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + + Alpha Fock matrix in AO basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_two_e_integral_alpha` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao` + * :c:data:`fock_matrix_mo_alpha` + * :c:data:`fock_matrix_mo_beta` + * :c:data:`scf_energy` + + +.. c:var:: fock_matrix_ao_beta + + + File : :file:`hartree_fock/fock_matrix_hf.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + + Alpha Fock matrix in AO basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_two_e_integral_alpha` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao` + * :c:data:`fock_matrix_mo_alpha` + * :c:data:`fock_matrix_mo_beta` + * :c:data:`scf_energy` + + +.. c:var:: hf_energy + + + File : :file:`hartree_fock/hf_energy.irp.f` + + .. code:: fortran + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + + +.. c:var:: hf_one_electron_energy + + + File : :file:`hartree_fock/hf_energy.irp.f` + + .. code:: fortran + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + + +.. c:var:: hf_two_electron_energy + + + File : :file:`hartree_fock/hf_energy.irp.f` + + .. code:: fortran + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + + + +Subroutines / functions +----------------------- + +.. c:function:: create_guess: + + + File : :file:`hartree_fock/scf.irp.f` + + .. code:: fortran + + subroutine create_guess + + + Create a MO guess if no MOs are present in the EZFIO directory + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mo_coef` + * :c:data:`mo_guess_type` + * :c:data:`mo_one_e_integrals` + * :c:data:`ao_ortho_lowdin_coef` + * :c:data:`mo_label` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`scf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_has_mo_basis_mo_coef` + * :c:func:`huckel_guess` + * :c:func:`mo_as_eigvectors_of_mo_matrix` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`mo_coef` + * :c:data:`mo_label` + + +.. c:function:: run: + + + File : :file:`hartree_fock/scf.irp.f` + + .. code:: fortran + + subroutine run + + + Run SCF calculation + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`scf_energy` + * :c:data:`mo_label` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`pt2` + * :c:func:`scf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_hartree_fock_energy` + * :c:func:`roothaan_hall_scf` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`mo_coef` + * :c:data:`level_shift` + * :c:data:`mo_coef` + diff --git a/docs/source/modules/iterations.rst b/docs/source/modules/iterations.rst new file mode 100644 index 000000000..ab1d5065b --- /dev/null +++ b/docs/source/modules/iterations.rst @@ -0,0 +1,211 @@ +.. _module_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 + + + File : :file:`iterations/iterations.irp.f` + + .. code:: fortran + + double precision, allocatable :: extrapolated_energy (N_iter,N_states) + + + Extrapolated energy, using E_var = f(PT2) where PT2=0 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`energy_iterations` + * :c:data:`n_det` + * :c:data:`n_iter` + * :c:data:`n_states` + * :c:data:`pt2_iterations` + + + +.. c:var:: n_iter + + + File : :file:`iterations/io.irp.f` + + .. code:: fortran + + integer :: n_iter + + + number of iterations + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + * :c:data:`n_states` + * :c:data:`output_wall_time_0` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extrapolated_energy` + + + +Subroutines / functions +----------------------- + +.. c:function:: print_extrapolated_energy: + + + File : :file:`iterations/print_extrapolation.irp.f` + + .. code:: fortran + + subroutine print_extrapolated_energy + + + Print the extrapolated energy in the output + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`extrapolated_energy` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`pt2_iterations` + * :c:data:`n_iter` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + + +.. c:function:: print_summary: + + + File : :file:`iterations/print_summary.irp.f` + + .. code:: fortran + + subroutine print_summary(e_,pt2_,error_,variance_,norm_,n_det_,n_occ_pattern_,n_st,s2_) + + + Print the extrapolated energy in the output + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`do_pt2` + * :c:data:`s2_eig` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + + +.. c:function:: save_iterations: + + + File : :file:`iterations/iterations.irp.f` + + .. code:: fortran + + subroutine save_iterations(e_, pt2_,n_) + + + Update the energy in the EZFIO file. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_iter` + * :c:data:`energy_iterations` + * :c:data:`n_states` + * :c:data:`pt2_iterations` + * :c:data:`n_det_iterations` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_cipsi` + * :c:func:`run_stochastic_cipsi` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_iterations_energy_iterations` + * :c:func:`ezfio_set_iterations_n_det_iterations` + * :c:func:`ezfio_set_iterations_n_iter` + * :c:func:`ezfio_set_iterations_pt2_iterations` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`n_iter` + diff --git a/docs/source/modules/kohn_sham.rst b/docs/source/modules/kohn_sham.rst new file mode 100644 index 000000000..333e07d8f --- /dev/null +++ b/docs/source/modules/kohn_sham.rst @@ -0,0 +1,95 @@ +.. _module_kohn_sham: + +.. program:: kohn_sham + +.. default-role:: option + +========= +kohn_sham +========= + +Quick description +----------------- + +The Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals). +The program associated to it is the :ref:`ks_scf` executable. + +.. seealso:: + + The documentation of the :ref:`module_dft_keywords` module for the various keywords + such as the exchange/correlation functionals or the amount of |HF| exchange. + + +.. seealso:: + To see the keywords/options associated to the |SCF| algorithm itself, + see the documentation of the :ref:`module_scf_utils` module. + + +More advanced description +------------------------- + +The Kohn-Sham in an SCF and therefore is based on the :ref:`module_scf_utils` structure. + +The definition of the Fock matrix is in :file:`kohn_sham fock_matrix_ks.irp.f` + + +.. seealso:: + For a more detailed description of the |SCF| structure, + see the documentation of the :ref:`module_scf_utils` module. + + + + + +Programs +-------- + + * :ref:`ks_scf` + +Providers +--------- + +.. c:var:: ks_energy + + + File : :file:`ks_enery.irp.f` + + .. code:: fortran + + double precision :: ks_energy + double precision :: two_e_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + + Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_potential_alpha_xc` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`e_correlation_dft` + * :c:data:`e_exchange_dft` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + + + +Subroutines / functions +----------------------- diff --git a/docs/source/modules/kohn_sham_rs.rst b/docs/source/modules/kohn_sham_rs.rst new file mode 100644 index 000000000..e99f6af5f --- /dev/null +++ b/docs/source/modules/kohn_sham_rs.rst @@ -0,0 +1,473 @@ +.. _module_kohn_sham_rs: + +.. program:: kohn_sham_rs + +.. default-role:: option + +============ +kohn_sham_rs +============ + + +Quick description +----------------- + +The Range-separated Kohn-Sham module performs *Restricted* range-separated Hybrid calculation, +which means that only the long-range part of the *exact* exchange is taken into account. + +The program associated to it is the :ref:`rs_ks_scf` executable. + +.. seealso:: + + The documentation of the :ref:`module_dft_keywords` module for the various keywords + such as the exchange/correlation functionals or the range-separation parameter. + + +.. seealso:: + To see the keywords/options associated to the |SCF| algorithm itself, + see the documentation of the :ref:`module_scf_utils` module. + + +More advanced description +------------------------- + +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 :ref:`module_scf_utils` structure. + +The definition of the Fock matrix is in :file:`kohn_sham_rs fock_matrix_rs_ks.irp.f` + + +.. seealso:: + For a more detailed description of the |SCF| structure, + see the documentation of the :ref:`module_scf_utils` module. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Energy range separated hybrid + + + +Programs +-------- + + * :ref:`rs_ks_scf` + +Providers +--------- + +.. c:var:: ao_potential_alpha_xc + + + File : :file:`pot_functionals.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`potential_c_alpha_ao` + * :c:data:`potential_x_alpha_ao` + * :c:data:`potential_xc_alpha_ao` + * :c:data:`same_xc_func` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`rs_ks_energy` + + +.. c:var:: ao_potential_beta_xc + + + File : :file:`pot_functionals.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`potential_c_alpha_ao` + * :c:data:`potential_x_alpha_ao` + * :c:data:`potential_xc_alpha_ao` + * :c:data:`same_xc_func` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`rs_ks_energy` + + +.. c:var:: e_correlation_dft + + + File : :file:`pot_functionals.irp.f` + + .. code:: fortran + + double precision :: e_correlation_dft + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`energy_c` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + * :c:data:`rs_ks_energy` + + +.. c:var:: e_exchange_dft + + + File : :file:`pot_functionals.irp.f` + + .. code:: fortran + + double precision :: e_exchange_dft + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`energy_x` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + * :c:data:`rs_ks_energy` + + +.. c:var:: fock_matrix_alpha_no_xc_ao + + + File : :file:`fock_matrix_rs_ks.irp.f` + + .. code:: fortran + + 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) + + + Mono electronic an Coulomb matrix in ao basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_two_e_integral_alpha` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + + +.. c:var:: fock_matrix_beta_no_xc_ao + + + File : :file:`fock_matrix_rs_ks.irp.f` + + .. code:: fortran + + 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) + + + Mono electronic an Coulomb matrix in ao basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_two_e_integral_alpha` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + + +.. c:var:: fock_matrix_energy + + + File : :file:`rs_ks_energy.irp.f` + + .. code:: fortran + + double precision :: rs_ks_energy + double precision :: two_e_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_potential_alpha_xc` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`e_correlation_dft` + * :c:data:`e_exchange_dft` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + + +.. c:var:: one_e_energy + + + File : :file:`rs_ks_energy.irp.f` + + .. code:: fortran + + double precision :: rs_ks_energy + double precision :: two_e_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_potential_alpha_xc` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`e_correlation_dft` + * :c:data:`e_exchange_dft` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + + +.. c:var:: rs_ks_energy + + + File : :file:`rs_ks_energy.irp.f` + + .. code:: fortran + + double precision :: rs_ks_energy + double precision :: two_e_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_potential_alpha_xc` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`e_correlation_dft` + * :c:data:`e_exchange_dft` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + + +.. c:var:: trace_potential_xc + + + File : :file:`rs_ks_energy.irp.f` + + .. code:: fortran + + double precision :: rs_ks_energy + double precision :: two_e_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_potential_alpha_xc` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`e_correlation_dft` + * :c:data:`e_exchange_dft` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + + +.. c:var:: two_e_energy + + + File : :file:`rs_ks_energy.irp.f` + + .. code:: fortran + + double precision :: rs_ks_energy + double precision :: two_e_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`ao_potential_alpha_xc` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`e_correlation_dft` + * :c:data:`e_exchange_dft` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`extra_e_contrib_density` + + + +Subroutines / functions +----------------------- + +.. c:function:: check_coherence_functional: + + + File : :file:`rs_ks_scf.irp.f` + + .. code:: fortran + + subroutine check_coherence_functional + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`exchange_functional` + * :c:data:`correlation_functional` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`rs_ks_scf` + diff --git a/docs/source/modules/mo_basis.rst b/docs/source/modules/mo_basis.rst new file mode 100644 index 000000000..aae2e4813 --- /dev/null +++ b/docs/source/modules/mo_basis.rst @@ -0,0 +1,815 @@ +.. _module_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 + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_coef (ao_num,mo_num) + + + 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) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`ezfio_filename` + * :c:data:`mo_num` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_mo_alpha` + * :c:data:`fock_matrix_mo_beta` + * :c:data:`fps_spf_matrix_mo` + * :c:data:`mo_coef_in_ao_ortho_basis` + * :c:data:`mo_coef_transp` + * :c:data:`mo_dipole_x` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_integrals_n_e_per_atom` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_overlap` + * :c:data:`mo_pseudo_integrals` + * :c:data:`mo_spread_x` + * :c:data:`mo_two_e_int_erf_jj_from_ao` + * :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_vv_from_ao` + * :c:data:`one_e_dm_ao_alpha` + * :c:data:`one_e_spin_density_ao` + * :c:data:`psi_det` + * :c:data:`s_mo_coef` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + +.. c:var:: mo_coef_begin_iteration + + + File : :file:`mo_basis/track_orb.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_coef_begin_iteration (ao_num,mo_num) + + + Void provider to store the coefficients of the |MO| basis at the beginning of the SCF iteration + + Usefull to track some orbitals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_num` + + + +.. c:var:: mo_coef_in_ao_ortho_basis + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_coef_in_ao_ortho_basis (ao_num,mo_num) + + + |MO| coefficients in orthogonalized |AO| basis + + :math:`C^{-1}.C_{mo}` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_ortho_canonical_coef_inv` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: mo_coef_transp + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_coef_transp (mo_num,ao_num) + + + |MO| coefficients on |AO| basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_int_erf_jj_from_ao` + * :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_vv_from_ao` + + +.. c:var:: mo_label + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + character*(64) :: mo_label + + + |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) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det` + * :c:data:`psi_coef` + * :c:data:`psi_det` + + +.. c:var:: mo_num + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + integer :: mo_num + + + Number of MOs + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_canonical_nucl_elec_integrals` + * :c:data:`ao_ortho_lowdin_nucl_elec_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`core_fock_operator` + * :c:data:`core_fock_operator_erf` + * :c:data:`data_one_e_dm_alpha_mo` + * :c:data:`data_one_e_dm_beta_mo` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_ao` + * :c:data:`fock_matrix_mo` + * :c:data:`fock_matrix_mo_alpha` + * :c:data:`fock_matrix_mo_beta` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + * :c:data:`fps_spf_matrix_mo` + * :c:data:`full_ijkl_bitmask` + * :c:data:`int_erf_3_index` + * :c:data:`list_core_inact_act` + * :c:data:`list_inact` + * :c:data:`mo_class` + * :c:data:`mo_coef` + * :c:data:`mo_coef_begin_iteration` + * :c:data:`mo_coef_in_ao_ortho_basis` + * :c:data:`mo_coef_transp` + * :c:data:`mo_dipole_x` + * :c:data:`mo_integrals_cache_min` + * :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_kinetic_integrals` + * :c:data:`mo_occ` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_overlap` + * :c:data:`mo_pseudo_integrals` + * :c:data:`mo_spread_x` + * :c:data:`mo_two_e_int_erf_jj` + * :c:data:`mo_two_e_int_erf_jj_from_ao` + * :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_vv_from_ao` + * :c:data:`n_core_orb` + * :c:data:`n_int` + * :c:data:`one_e_dm_ao_alpha` + * :c:data:`one_e_dm_dagger_mo_spin_index` + * :c:data:`one_e_dm_mo` + * :c:data:`one_e_dm_mo_alpha` + * :c:data:`one_e_dm_mo_alpha_average` + * :c:data:`one_e_dm_mo_diff` + * :c:data:`one_e_dm_mo_spin_index` + * :c:data:`one_e_spin_density_ao` + * :c:data:`one_e_spin_density_mo` + * :c:data:`psi_energy_h_core` + * :c:data:`s_mo_coef` + * :c:data:`singles_alpha_csc_idx` + * :c:data:`singles_beta_csc_idx` + + +.. c:var:: mo_occ + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_occ (mo_num) + + + |MO| occupation numbers + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`ezfio_filename` + * :c:data:`mo_num` + * :c:data:`mpi_master` + + + + +Subroutines / functions +----------------------- + +.. c:function:: ao_ortho_cano_to_ao: + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + subroutine ao_ortho_cano_to_ao(A_ao,LDA_ao,A,LDA) + + + Transform A from the |AO| basis to the orthogonal |AO| basis + + $C^{-1}.A_{ao}.C^{\dagger-1}$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_ortho_canonical_coef_inv` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + + +.. c:function:: ao_to_mo: + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + subroutine ao_to_mo(A_ao,LDA_ao,A_mo,LDA_mo) + + + Transform A from the |AO| basis to the |MO| basis + + $C^\dagger.A_{ao}.C$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_mo_alpha` + * :c:data:`fock_matrix_mo_beta` + * :c:data:`fps_spf_matrix_mo` + * :c:data:`mo_dipole_x` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_integrals_n_e_per_atom` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_pseudo_integrals` + * :c:data:`mo_spread_x` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + + +.. c:function:: give_all_mos_and_grad_and_lapl_at_r: + + + File : :file:`mo_basis/mos_in_r.irp.f` + + .. code:: fortran + + subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_lapl_array) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_all_aos_and_grad_and_lapl_at_r` + + +.. c:function:: give_all_mos_and_grad_at_r: + + + File : :file:`mo_basis/mos_in_r.irp.f` + + .. code:: fortran + + subroutine give_all_mos_and_grad_at_r(r,mos_array,mos_grad_array) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_all_aos_and_grad_at_r` + + +.. c:function:: give_all_mos_at_r: + + + File : :file:`mo_basis/mos_in_r.irp.f` + + .. code:: fortran + + subroutine give_all_mos_at_r(r,mos_array) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef_transp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemv` + * :c:func:`give_all_aos_at_r` + + +.. c:function:: initialize_mo_coef_begin_iteration: + + + File : :file:`mo_basis/track_orb.irp.f` + + .. code:: fortran + + subroutine initialize_mo_coef_begin_iteration + + + + Initialize :c:data:`mo_coef_begin_iteration` to the current :c:data:`mo_coef` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef_begin_iteration` + * :c:data:`mo_coef` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`damping_scf` + * :c:func:`roothaan_hall_scf` + + +.. c:function:: mix_mo_jk: + + + File : :file:`mo_basis/mos.irp.f` + + .. code:: fortran + + subroutine mix_mo_jk(j,k) + + + Rotates the j-th |MO| with the k-th |MO| to give two new |MOs| that are + + * $+ = \frac{1}{\sqrt{2}} ( | j\rangle + | k\rangle)$ + + * $- = \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)) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_coef` + + +.. c:function:: mo_as_eigvectors_of_mo_matrix: + + + File : :file:`mo_basis/utils.irp.f` + + .. code:: fortran + + subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label,sign,output) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_label` + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`create_guess` + * :c:func:`damping_scf` + * :c:func:`hcore_guess` + * :c:func:`roothaan_hall_scf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + * :c:func:`lapack_diag` + * :c:func:`write_time` + + +.. c:function:: mo_as_svd_vectors_of_mo_matrix: + + + File : :file:`mo_basis/utils.irp.f` + + .. code:: fortran + + subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_label` + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + * :c:func:`svd` + * :c:func:`write_time` + + +.. c:function:: mo_as_svd_vectors_of_mo_matrix_eig: + + + File : :file:`mo_basis/utils.irp.f` + + .. code:: fortran + + subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_label` + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`set_natural_mos` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + * :c:func:`svd` + * :c:func:`write_time` + + +.. c:function:: reorder_core_orb: + + + File : :file:`mo_basis/track_orb.irp.f` + + .. code:: fortran + + subroutine reorder_core_orb + + + routines that takes the current :c:data:`mo_coef` and reorder the core orbitals (see :c:data:`list_core` and :c:data:`n_core_orb`) according to the overlap with :c:data:`mo_coef_begin_iteration` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`mo_coef_begin_iteration` + * :c:data:`mo_coef` + * :c:data:`ao_overlap` + * :c:data:`n_core_orb` + * :c:data:`ao_num` + * :c:data:`list_inact` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`damping_scf` + * :c:func:`roothaan_hall_scf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dsort` + + +.. c:function:: save_mos: + + + File : :file:`mo_basis/utils.irp.f` + + .. code:: fortran + + subroutine save_mos + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_occ` + * :c:data:`ao_md5` + * :c:data:`ezfio_filename` + * :c:data:`mo_num` + * :c:data:`mo_coef` + * :c:data:`ao_num` + * :c:data:`mo_label` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`damping_scf` + * :c:func:`hcore_guess` + * :c:func:`huckel_guess` + * :c:func:`roothaan_hall_scf` + * :c:func:`save_natural_mos` + * :c:func:`save_ortho_mos` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_mo_basis_ao_md5` + * :c:func:`ezfio_set_mo_basis_mo_coef` + * :c:func:`ezfio_set_mo_basis_mo_label` + * :c:func:`ezfio_set_mo_basis_mo_num` + * :c:func:`ezfio_set_mo_basis_mo_occ` + * :c:func:`system` + + +.. c:function:: save_mos_truncated: + + + File : :file:`mo_basis/utils.irp.f` + + .. code:: fortran + + subroutine save_mos_truncated(n) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_occ` + * :c:data:`ao_md5` + * :c:data:`ezfio_filename` + * :c:data:`mo_coef` + * :c:data:`ao_num` + * :c:data:`mo_label` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_mo_basis_ao_md5` + * :c:func:`ezfio_set_mo_basis_mo_coef` + * :c:func:`ezfio_set_mo_basis_mo_label` + * :c:func:`ezfio_set_mo_basis_mo_num` + * :c:func:`ezfio_set_mo_basis_mo_occ` + * :c:func:`system` + diff --git a/docs/source/modules/mo_guess.rst b/docs/source/modules/mo_guess.rst new file mode 100644 index 000000000..25c9acde0 --- /dev/null +++ b/docs/source/modules/mo_guess.rst @@ -0,0 +1,160 @@ +.. _module_mo_guess: + +.. program:: mo_guess + +.. default-role:: option + +======== +mo_guess +======== + +Guess for |MOs|. + + + + +Providers +--------- + +.. c:var:: ao_ortho_canonical_nucl_elec_integrals + + + File : :file:`mo_guess/pot_mo_ortho_canonical_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_canonical_nucl_elec_integrals (mo_num,mo_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_num` + * :c:data:`ao_ortho_canonical_coef` + * :c:data:`mo_num` + + + +.. c:var:: ao_ortho_lowdin_coef + + + File : :file:`mo_guess/mo_ortho_lowdin.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_lowdin_coef (ao_num,ao_num) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_overlap` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_lowdin_nucl_elec_integrals` + * :c:data:`ao_ortho_lowdin_overlap` + + +.. c:var:: ao_ortho_lowdin_nucl_elec_integrals + + + File : :file:`mo_guess/pot_mo_ortho_lowdin_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_lowdin_nucl_elec_integrals (mo_num,mo_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_num` + * :c:data:`ao_ortho_lowdin_coef` + * :c:data:`mo_num` + + + +.. c:var:: ao_ortho_lowdin_overlap + + + File : :file:`mo_guess/mo_ortho_lowdin.irp.f` + + .. code:: fortran + + double precision, allocatable :: ao_ortho_lowdin_overlap (ao_num,ao_num) + + + overlap matrix of the ao_ortho_lowdin + supposed to be the Identity + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_ortho_lowdin_coef` + * :c:data:`ao_overlap` + + + + +Subroutines / functions +----------------------- + +.. c:function:: hcore_guess: + + + File : :file:`mo_guess/h_core_guess_routine.irp.f` + + .. code:: fortran + + subroutine hcore_guess + + + Produce `H_core` MO orbital + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_label` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_coef` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`mo_as_eigvectors_of_mo_matrix` + * :c:func:`save_mos` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef` + * :c:data:`mo_label` + 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 000000000..68a1f7b38 --- /dev/null +++ b/docs/source/modules/mo_one_e_ints.rst @@ -0,0 +1,571 @@ +.. _module_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 + + + File : :file:`mo_one_e_ints/spread_dipole_mo.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_dipole_x` + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: mo_dipole_y + + + File : :file:`mo_one_e_ints/spread_dipole_mo.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_dipole_x` + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: mo_dipole_z + + + File : :file:`mo_one_e_ints/spread_dipole_mo.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_dipole_x` + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: mo_integrals_n_e + + + File : :file:`mo_one_e_ints/pot_mo_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_integrals_n_e (mo_num,mo_num) + + + Nucleus-electron interaction on the |MO| basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`read_mo_integrals_e_n` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_one_e_integrals` + * :c:data:`ref_bitmask_energy` + + +.. c:var:: mo_integrals_n_e_per_atom + + + File : :file:`mo_one_e_ints/pot_mo_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_integrals_n_e_per_atom (mo_num,mo_num,nucl_num) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_n_e_per_atom` + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`nucl_num` + + + +.. c:var:: mo_kinetic_integrals + + + File : :file:`mo_one_e_ints/kin_mo_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_kinetic_integrals (mo_num,mo_num) + + + Kinetic energy integrals in the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_kinetic_integrals` + * :c:data:`ao_num` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`read_mo_integrals_kinetic` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_one_e_integrals` + * :c:data:`ref_bitmask_energy` + + +.. c:var:: mo_one_e_integrals + + + File : :file:`mo_one_e_ints/mo_one_e_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_one_e_integrals (mo_num,mo_num) + + + array of the one-electron Hamiltonian on the |MO| basis : + sum of the kinetic and nuclear electronic potentials (and pseudo potential if needed) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`do_pseudo` + * :c:data:`mo_integrals_n_e` + * :c:data:`mo_kinetic_integrals` + * :c:data:`mo_num` + * :c:data:`mo_pseudo_integrals` + * :c:data:`read_mo_one_e_integrals` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`psi_energy_h_core` + * :c:data:`ref_bitmask_energy` + + +.. c:var:: mo_overlap + + + File : :file:`mo_one_e_ints/mo_overlap.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_overlap (mo_num,mo_num) + + + Provider to check that the MOs are indeed orthonormal. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_overlap` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: mo_pseudo_integrals + + + File : :file:`mo_one_e_ints/pot_mo_pseudo_ints.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_pseudo_integrals (mo_num,mo_num) + + + Pseudopotential integrals in |MO| basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_pseudo_integrals` + * :c:data:`do_pseudo` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`read_mo_integrals_pseudo` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_one_e_integrals` + + +.. c:var:: mo_spread_x + + + File : :file:`mo_one_e_ints/spread_dipole_mo.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_spread_x` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: mo_spread_y + + + File : :file:`mo_one_e_ints/spread_dipole_mo.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_spread_x` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: mo_spread_z + + + File : :file:`mo_one_e_ints/spread_dipole_mo.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_spread_x` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: s_mo_coef + + + File : :file:`mo_one_e_ints/ao_to_mo.irp.f` + + .. code:: fortran + + double precision, allocatable :: s_mo_coef (ao_num,mo_num) + + + Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_overlap` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao` + + + +Subroutines / functions +----------------------- + +.. c:function:: mo_to_ao: + + + File : :file:`mo_one_e_ints/ao_to_mo.irp.f` + + .. code:: fortran + + subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) + + + Transform A from the MO basis to the AO basis + + $(S.C).A_{mo}.(S.C)^\dagger$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`s_mo_coef` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + + +.. c:function:: mo_to_ao_no_overlap: + + + File : :file:`mo_one_e_ints/ao_to_mo.irp.f` + + .. code:: fortran + + subroutine mo_to_ao_no_overlap(A_mo,LDA_mo,A_ao,LDA_ao) + + + $C.A_{mo}.C^\dagger$ + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + + +.. c:function:: orthonormalize_mos: + + + File : :file:`mo_one_e_ints/orthonormalize.irp.f` + + .. code:: fortran + + subroutine orthonormalize_mos + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_label` + * :c:data:`ao_num` + * :c:data:`mo_overlap` + * :c:data:`mo_num` + * :c:data:`mo_coef` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`save_ortho_mos` + * :c:func:`scf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ortho_lowdin` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef` + * :c:data:`mo_label` + 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 000000000..7e85039bd --- /dev/null +++ b/docs/source/modules/mo_two_e_erf_ints.rst @@ -0,0 +1,1000 @@ +.. _module_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 + + + File : :file:`mo_two_e_erf_ints/core_quantities_erf.irp.f` + + .. code:: fortran + + double precision :: core_energy_erf + + + energy from the core : contains all core-core contributionswith the erf interaction + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_int_erf_jj` + * :c:data:`n_core_orb` + * :c:data:`nuclear_repulsion` + + + +.. c:var:: core_fock_operator_erf + + + File : :file:`mo_two_e_erf_ints/core_quantities_erf.irp.f` + + .. code:: fortran + + double precision, allocatable :: core_fock_operator_erf (mo_num,mo_num) + + + this is the contribution to the Fock operator from the core electrons with the erf interaction + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`n_core_orb` + + + +.. c:function:: insert_into_mo_integrals_erf_map: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine insert_into_mo_integrals_erf_map(n_integrals, & + buffer_i, buffer_values, thr) + + + Create new entry into |MO| map, or accumulate in an existing entry + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_update` + + +.. c:var:: int_erf_3_index + + + File : :file:`mo_two_e_erf_ints/ints_erf_3_index.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + + + +.. c:var:: int_erf_3_index_exc + + + File : :file:`mo_two_e_erf_ints/ints_erf_3_index.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + + + +.. c:var:: mo_integrals_erf_cache + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_integrals_erf_cache (0:64*64*64*64) + + + Cache of |MO| integrals for fast access + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_two_e_integrals_erf_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_fock_operator_erf` + * :c:data:`int_erf_3_index` + * :c:data:`mo_two_e_int_erf_jj` + + +.. c:var:: mo_integrals_erf_cache_max + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + integer :: mo_integrals_erf_cache_min + integer :: mo_integrals_erf_cache_max + + + Min and max values of the MOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_fock_operator_erf` + * :c:data:`int_erf_3_index` + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_two_e_int_erf_jj` + + +.. c:var:: mo_integrals_erf_cache_min + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + integer :: mo_integrals_erf_cache_min + integer :: mo_integrals_erf_cache_max + + + Min and max values of the MOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_fock_operator_erf` + * :c:data:`int_erf_3_index` + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_two_e_int_erf_jj` + + +.. c:var:: mo_integrals_erf_map + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + type(map_type) :: mo_integrals_erf_map + + + |MO| integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_fock_operator_erf` + * :c:data:`int_erf_3_index` + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_two_e_int_erf_jj` + * :c:data:`mo_two_e_integrals_erf_in_map` + + +.. c:var:: mo_two_e_int_erf_jj + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy_erf` + + +.. c:var:: mo_two_e_int_erf_jj_anti + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy_erf` + + +.. c:var:: mo_two_e_int_erf_jj_anti_from_ao + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_erf_schwartz` + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + + + +.. c:var:: mo_two_e_int_erf_jj_exchange + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_erf_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy_erf` + + +.. c:var:: mo_two_e_int_erf_jj_exchange_from_ao + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_erf_schwartz` + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + + + +.. c:var:: mo_two_e_int_erf_jj_from_ao + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_erf_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_erf_schwartz` + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + + + +.. c:var:: mo_two_e_integrals_erf_in_map + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + logical :: mo_two_e_integrals_erf_in_map + + + If True, the map of MO two-electron integrals is provided + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`ezfio_filename` + * :c:data:`full_ijkl_bitmask_4` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_num` + * :c:data:`n_int` + * :c:data:`read_mo_two_e_integrals_erf` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_fock_operator_erf` + * :c:data:`int_erf_3_index` + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_two_e_int_erf_jj` + + + +Subroutines / functions +----------------------- + +.. c:function:: add_integrals_to_map_erf: + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + subroutine add_integrals_to_map_erf(mask_ijkl) + + + Adds integrals to tha MO map according to some bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_coef_transp` + * :c:data:`ao_num` + * :c:data:`n_int` + * :c:data:`mo_num` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`mo_integrals_erf_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list` + * :c:func:`bitstring_to_str` + * :c:func:`cpu_time` + * :c:func:`get_ao_two_e_integrals_erf` + * :c:func:`insert_into_mo_integrals_erf_map` + * :c:func:`map_merge` + * :c:func:`mo_two_e_integrals_index` + * :c:func:`wall_time` + + +.. c:function:: clear_mo_erf_map: + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + subroutine clear_mo_erf_map + + + Frees the memory of the MO map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_deinit` + + +.. c:function:: get_mo_erf_map_size: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + integer*8 function get_mo_erf_map_size() + + + Returns the number of elements in the |MO| map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_map` + + +.. c:function:: get_mo_two_e_integral_erf: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + double precision function get_mo_two_e_integral_erf(i,j,k,l,map) + + + Returns one integral $\langle ij|kl \rangle$ in the |MO| basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_cache_min` + * :c:data:`mo_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_erf: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_erf(j,k,l,sze,out_val,map) + + + Returns multiple integrals $\langle ij|kl \rangle$ in the |MO| basis, all + i for j,k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_erf_coulomb_ii: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_erf_coulomb_ii(k,l,sze,out_val,map) + + + Returns multiple integrals $\langle ki|li \rangle$ + + k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) + for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_erf_exch_ii: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_erf_exch_ii(k,l,sze,out_val,map) + + + Returns multiple integrals $\langle ki|il \rangle$ + + $\int k(1)i(2) \frac{1}{r_{12}} i(1)l(2)$ :: out_val(i1) + for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_erf_i1j1: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_erf_i1j1(k,l,sze,out_array,map) + + + Returns multiple integrals $\langle ik|jl \rangle$ in the |MO| basis, all + $\int i(1)j(1) \frac{\erf(\mu * r_{12})}{r_{12}} k(2)l(2)$ + i, j for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i2radix_sort` + * :c:func:`i8radix_sort` + * :c:func:`iradix_sort` + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_erf_ij: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_erf_ij(k,l,sze,out_array,map) + + + Returns multiple integrals $\langle ij|kl \rangle$ in the |MO| basis, all + $\int i(1)j(2) \frac{1}{r_{12}} k(1)l(2)$ + i, j for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i2radix_sort` + * :c:func:`i8radix_sort` + * :c:func:`iradix_sort` + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: load_mo_integrals_erf: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + integer function load_mo_integrals_erf(filename) + + + Read from disk the |MO| erf integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`cache_map_reallocate` + * :c:func:`map_deinit` + * :c:func:`map_sort` + + +.. c:function:: mo_two_e_integral_erf: + + + File : :file:`mo_two_e_erf_ints/map_integrals_erf.irp.f` + + .. code:: fortran + + double precision function mo_two_e_integral_erf(i,j,k,l) + + + Returns one integral $\langle ij|kl \rangle$ in the |MO| basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_erf_cache` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_two_e_integrals_erf_in_map` + + +.. c:function:: mo_two_e_integrals_erf_index: + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + subroutine mo_two_e_integrals_erf_index(i,j,k,l,i1) + + + Computes an unique index for i,j,k,l integrals + + +.. c:function:: provide_all_mo_integrals_erf: + + + File : :file:`mo_two_e_erf_ints/mo_bi_integrals_erf.irp.f` + + .. code:: fortran + + subroutine provide_all_mo_integrals_erf + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_int_erf_jj` + * :c:data:`mo_two_e_int_erf_jj` + * :c:data:`mo_integrals_erf_map` + * :c:data:`mo_two_e_int_erf_jj` + + +.. c:function:: save_erf_two_e_integrals_mo: + + + File : :file:`mo_two_e_erf_ints/routines_save_integrals_erf.irp.f` + + .. code:: fortran + + subroutine save_erf_two_e_integrals_mo + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`ezfio_filename` + * :c:data:`mo_integrals_erf_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`routine` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_mo_two_e_erf_ints_io_mo_two_e_integrals_erf` + * :c:func:`ezfio_set_work_empty` + * :c:func:`map_save_to_disk` + + +.. c:function:: save_erf_two_e_ints_mo_into_ints_mo: + + + File : :file:`mo_two_e_erf_ints/routines_save_integrals_erf.irp.f` + + .. code:: fortran + + subroutine save_erf_two_e_ints_mo_into_ints_mo + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`ezfio_filename` + * :c:data:`mo_integrals_erf_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_mo_two_e_ints_io_mo_two_e_integrals` + * :c:func:`ezfio_set_work_empty` + * :c:func:`map_save_to_disk` + 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 000000000..bb860e594 --- /dev/null +++ b/docs/source/modules/mo_two_e_ints.rst @@ -0,0 +1,1312 @@ +.. _module_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 + + + File : :file:`mo_two_e_ints/integrals_3_index.irp.f` + + .. code:: fortran + + 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) + + + big_array_coulomb_integrals(i,j) = = (ii|jj) + + big_array_exchange_integrals(i,j) = = (ij|ij) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`h_matrix_all_dets` + * :c:data:`h_matrix_cas` + + +.. c:var:: big_array_exchange_integrals + + + File : :file:`mo_two_e_ints/integrals_3_index.irp.f` + + .. code:: fortran + + 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) + + + big_array_coulomb_integrals(i,j) = = (ii|jj) + + big_array_exchange_integrals(i,j) = = (ij|ij) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`h_matrix_all_dets` + * :c:data:`h_matrix_cas` + + +.. c:var:: core_energy + + + File : :file:`mo_two_e_ints/core_quantities.irp.f` + + .. code:: fortran + + double precision :: core_energy + + + energy from the core : contains all core-core contributions + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`mo_one_e_integrals` + * :c:data:`mo_two_e_integrals_jj` + * :c:data:`n_core_orb` + * :c:data:`nuclear_repulsion` + + + +.. c:var:: core_fock_operator + + + File : :file:`mo_two_e_ints/core_quantities.irp.f` + + .. code:: fortran + + double precision, allocatable :: core_fock_operator (mo_num,mo_num) + + + this is the contribution to the Fock operator from the core electrons + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`list_inact` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_core_orb` + + + +.. c:function:: insert_into_mo_integrals_map: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine insert_into_mo_integrals_map(n_integrals, & + buffer_i, buffer_values, thr) + + + Create new entry into MO map, or accumulate in an existing entry + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map` + * :c:func:`add_integrals_to_map_no_exit_34` + * :c:func:`add_integrals_to_map_three_indices` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_update` + + +.. c:var:: mo_integrals_cache + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + double precision, allocatable :: mo_integrals_cache (0_8:128_8*128_8*128_8*128_8) + + + Cache of MO integrals for fast access + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_cache_min` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`core_fock_operator` + * :c:data:`mo_two_e_integrals_jj` + + +.. c:var:: mo_integrals_cache_max + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + 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 + + + Min and max values of the MOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`core_fock_operator` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_two_e_integrals_jj` + + +.. c:var:: mo_integrals_cache_max_8 + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + 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 + + + Min and max values of the MOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`core_fock_operator` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_two_e_integrals_jj` + + +.. c:var:: mo_integrals_cache_min + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + 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 + + + Min and max values of the MOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`core_fock_operator` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_two_e_integrals_jj` + + +.. c:var:: mo_integrals_cache_min_8 + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + 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 + + + Min and max values of the MOs for which the integrals are in the cache + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`core_fock_operator` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_two_e_integrals_jj` + + +.. c:var:: mo_integrals_map + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + type(map_type) :: mo_integrals_map + + + MO integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`coef_hf_selector` + * :c:data:`core_fock_operator` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + * :c:data:`h_matrix_all_dets` + * :c:data:`h_matrix_cas` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_jj` + + +.. c:var:: mo_two_e_integral_jj_from_ao + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + + + +.. c:var:: mo_two_e_integrals_in_map + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + logical :: mo_two_e_integrals_in_map + + + If True, the map of MO two-electron integrals is provided + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`core_inact_act_bitmask_4` + * :c:data:`ezfio_filename` + * :c:data:`full_ijkl_bitmask_4` + * :c:data:`list_inact` + * :c:data:`mo_class` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_integrals_map` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_num` + * :c:data:`mpi_master` + * :c:data:`n_int` + * :c:data:`no_ivvv_integrals` + * :c:data:`no_vvv_integrals` + * :c:data:`no_vvvv_integrals` + * :c:data:`read_mo_two_e_integrals` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`ci_electronic_energy` + * :c:data:`coef_hf_selector` + * :c:data:`core_fock_operator` + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + * :c:data:`h_matrix_all_dets` + * :c:data:`h_matrix_cas` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_two_e_integrals_jj` + + +.. c:var:: mo_two_e_integrals_jj + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`ref_bitmask_energy` + + +.. c:var:: mo_two_e_integrals_jj_anti + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`ref_bitmask_energy` + + +.. c:var:: mo_two_e_integrals_jj_anti_from_ao + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + + + +.. c:var:: mo_two_e_integrals_jj_exchange + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`mo_two_e_integrals_in_map` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`core_energy` + * :c:data:`ref_bitmask_energy` + + +.. c:var:: mo_two_e_integrals_jj_exchange_from_ao + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + + + +.. c:var:: mo_two_e_integrals_vv_anti_from_ao + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`list_inact` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + + + +.. c:var:: mo_two_e_integrals_vv_exchange_from_ao + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`list_inact` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + + + +.. c:var:: mo_two_e_integrals_vv_from_ao + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + 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) + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_integrals_map` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_num` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_two_e_integral_schwartz` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`do_direct_integrals` + * :c:data:`list_inact` + * :c:data:`mo_coef` + * :c:data:`mo_coef_transp` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + + + + +Subroutines / functions +----------------------- + +.. c:function:: add_integrals_to_map: + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + subroutine add_integrals_to_map(mask_ijkl) + + + Adds integrals to tha MO map according to some bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_coef_transp` + * :c:data:`ao_num` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list` + * :c:func:`bitstring_to_str` + * :c:func:`cpu_time` + * :c:func:`get_ao_two_e_integrals` + * :c:func:`insert_into_mo_integrals_map` + * :c:func:`map_merge` + * :c:func:`mo_two_e_integrals_index` + * :c:func:`wall_time` + + +.. c:function:: add_integrals_to_map_no_exit_34: + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + subroutine add_integrals_to_map_no_exit_34(mask_ijkl) + + + Adds integrals to tha MO map according to some bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_coef_transp` + * :c:data:`ao_num` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list` + * :c:func:`cpu_time` + * :c:func:`get_ao_two_e_integrals` + * :c:func:`insert_into_mo_integrals_map` + * :c:func:`map_merge` + * :c:func:`mo_two_e_integrals_index` + * :c:func:`wall_time` + + +.. c:function:: add_integrals_to_map_three_indices: + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + subroutine add_integrals_to_map_three_indices(mask_ijk) + + + Adds integrals to tha MO map according to some bitmask + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_coef_transp` + * :c:data:`ao_num` + * :c:data:`mo_integrals_map` + * :c:data:`mo_num` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`n_int` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`bitstring_to_list` + * :c:func:`bitstring_to_str` + * :c:func:`cpu_time` + * :c:func:`get_ao_two_e_integrals` + * :c:func:`insert_into_mo_integrals_map` + * :c:func:`map_merge` + * :c:func:`mo_two_e_integrals_index` + * :c:func:`wall_time` + + +.. c:function:: clear_mo_map: + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + subroutine clear_mo_map + + + Frees the memory of the MO map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_deinit` + + +.. c:function:: dump_mo_integrals: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine dump_mo_integrals(filename) + + + Save to disk the |MO| integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_map` + * :c:data:`mpi_master` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_work_empty` + + +.. c:function:: get_mo_map_size: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + integer*8 function get_mo_map_size() + + + Return the number of elements in the MO map + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_map` + + +.. c:function:: get_mo_two_e_integrals: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals(j,k,l,sze,out_val,map) + + + Returns multiple integrals in the MO basis, all + i for j,k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`get_d0` + * :c:func:`get_d1` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get` + + +.. c:function:: get_mo_two_e_integrals_coulomb_ii: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_coulomb_ii(k,l,sze,out_val,map) + + + Returns multiple integrals + k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) + for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_exch_ii: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_exch_ii(k,l,sze,out_val,map) + + + Returns multiple integrals + k(1)i(2) 1/r12 i(1)l(2) :: out_val(i1) + for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_operator_closed_shell_ref_bitmask` + * :c:data:`fock_wee_closed_shell` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_i1j1: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_i1j1(k,l,sze,out_array,map) + + + Returns multiple integrals in the MO basis, all + i(1)j(1) 1/r12 k(2)l(2) + i, j for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i2radix_sort` + * :c:func:`i8radix_sort` + * :c:func:`iradix_sort` + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_mo_two_e_integrals_ij: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + subroutine get_mo_two_e_integrals_ij(k,l,sze,out_array,map) + + + Returns multiple integrals in the MO basis, all + i(1)j(2) 1/r12 k(1)l(2) + i, j for k,l fixed. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i2radix_sort` + * :c:func:`i8radix_sort` + * :c:func:`iradix_sort` + * :c:func:`map_get_many` + * :c:func:`two_e_integrals_index` + + +.. c:function:: get_two_e_integral: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + double precision function get_two_e_integral(i,j,k,l,map) + + + Returns one integral in the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_cache_min` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`map_get` + * :c:func:`two_e_integrals_index` + + +.. c:function:: load_mo_integrals: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + integer function load_mo_integrals(filename) + + + Read from disk the |MO| integrals + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`cache_map_reallocate` + * :c:func:`map_deinit` + * :c:func:`map_sort` + + +.. c:function:: mo_two_e_integral: + + + File : :file:`mo_two_e_ints/map_integrals.irp.f` + + .. code:: fortran + + double precision function mo_two_e_integral(i,j,k,l) + + + Returns one integral in the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_integrals_cache` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + + +.. c:function:: mo_two_e_integrals_index: + + + File : :file:`mo_two_e_ints/mo_bi_integrals.irp.f` + + .. code:: fortran + + subroutine mo_two_e_integrals_index(i,j,k,l,i1) + + + Computes an unique index for i,j,k,l integrals + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map` + * :c:func:`add_integrals_to_map_erf` + * :c:func:`add_integrals_to_map_no_exit_34` + * :c:func:`add_integrals_to_map_three_indices` + diff --git a/docs/source/modules/mpi.rst b/docs/source/modules/mpi.rst new file mode 100644 index 000000000..5dde771ac --- /dev/null +++ b/docs/source/modules/mpi.rst @@ -0,0 +1,294 @@ +.. _module_mpi: + +.. program:: mpi + +.. default-role:: option + +=== +mpi +=== + +Contains all the functions and providers for parallelization with |MPI|. + + + +Providers +--------- + +.. c:var:: mpi_initialized + + + File : :file:`mpi/mpi.irp.f` + + .. code:: fortran + + logical :: mpi_initialized + + + Always true. Initialized MPI + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + + +.. c:var:: mpi_master + + + File : :file:`mpi/mpi.irp.f` + + .. code:: fortran + + logical :: mpi_master + + + If true, rank is zero + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_rank` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_cartesian` + * :c:data:`ao_coef` + * :c:data:`ao_expo` + * :c:data:`ao_integrals_threshold` + * :c:data:`ao_md5` + * :c:data:`ao_nucl` + * :c:data:`ao_num` + * :c:data:`ao_power` + * :c:data:`ao_prim_num` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`cas_bitmask` + * :c:data:`ci_energy` + * :c:data:`correlation_energy_ratio_max` + * :c:data:`data_energy_proj` + * :c:data:`data_energy_var` + * :c:data:`data_one_e_dm_alpha_mo` + * :c:data:`data_one_e_dm_beta_mo` + * :c:data:`davidson_sze_max` + * :c:data:`disk_access_nuclear_repulsion` + * :c:data:`disk_based_davidson` + * :c:data:`distributed_davidson` + * :c:data:`do_direct_integrals` + * :c:data:`do_pseudo` + * :c:data:`do_pt2` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`element_name` + * :c:data:`energy_iterations` + * :c:data:`frozen_orb_scf` + * :c:data:`generators_bitmask` + * :c:data:`generators_bitmask_restart` + * :c:data:`h0_type` + * :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:`level_shift` + * :c:data:`max_dim_diis` + * :c:data:`mo_class` + * :c:data:`mo_coef` + * :c:data:`mo_guess_type` + * :c:data:`mo_integrals_threshold` + * :c:data:`mo_label` + * :c:data:`mo_num` + * :c:data:`mo_occ` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`mu_erf` + * :c:data:`n_cas_bitmask` + * :c:data:`n_core_orb` + * :c:data:`n_det` + * :c:data:`n_det_generators` + * :c:data:`n_det_iterations` + * :c:data:`n_det_max` + * :c:data:`n_det_max_full` + * :c:data:`n_det_print_wf` + * :c:data:`n_det_selectors` + * :c:data:`n_generators_bitmask` + * :c:data:`n_generators_bitmask_restart` + * :c:data:`n_int` + * :c:data:`n_it_scf_max` + * :c:data:`n_iter` + * :c:data:`n_states` + * :c:data:`n_states_diag` + * :c:data:`no_ivvv_integrals` + * :c:data:`no_vvv_integrals` + * :c:data:`no_vvvv_integrals` + * :c:data:`nthreads_davidson` + * :c:data:`nthreads_pt2` + * :c:data:`nucl_charge` + * :c:data:`nucl_charge_remove` + * :c:data:`nucl_coord` + * :c:data:`nucl_label` + * :c:data:`nucl_num` + * :c:data:`nuclear_repulsion` + * :c:data:`only_expected_s2` + * :c:data:`pseudo_dz_k` + * :c:data:`pseudo_dz_kl` + * :c:data:`pseudo_grid_rmax` + * :c:data:`pseudo_grid_size` + * :c:data:`pseudo_klocmax` + * :c:data:`pseudo_kmax` + * :c:data:`pseudo_lmax` + * :c:data:`pseudo_n_k` + * :c:data:`pseudo_n_kl` + * :c:data:`pseudo_v_k` + * :c:data:`pseudo_v_kl` + * :c:data:`psi_cas` + * :c:data:`psi_coef` + * :c:data:`psi_coef_max` + * :c:data:`psi_det` + * :c:data:`psi_det_alpha_unique` + * :c:data:`psi_det_beta_unique` + * :c:data:`psi_det_size` + * :c:data:`pt2_e0_denominator` + * :c:data:`pt2_f` + * :c:data:`pt2_iterations` + * :c:data:`pt2_max` + * :c:data:`pt2_n_teeth` + * :c:data:`pt2_relative_error` + * :c:data:`qp_max_mem` + * :c:data:`read_wf` + * :c:data:`s2_eig` + * :c:data:`scf_algorithm` + * :c:data:`state_following` + * :c:data:`target_energy` + * :c:data:`thresh_scf` + * :c:data:`threshold_davidson` + * :c:data:`threshold_diis` + * :c:data:`threshold_generators` + * :c:data:`used_weight` + * :c:data:`variance_max` + + +.. c:var:: mpi_rank + + + File : :file:`mpi/mpi.irp.f` + + .. code:: fortran + + integer :: mpi_rank + integer :: mpi_size + + + Rank of MPI process and number of MPI processes + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + +.. c:var:: mpi_size + + + File : :file:`mpi/mpi.irp.f` + + .. code:: fortran + + integer :: mpi_rank + integer :: mpi_size + + + Rank of MPI process and number of MPI processes + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + + +Subroutines / functions +----------------------- + +.. c:function:: broadcast_chunks_double: + + + File : :file:`mpi/mpi.irp.f_template_97` + + .. code:: fortran + + subroutine broadcast_chunks_double(A, LDA) + + + Broadcast with chunks of ~2GB + + +.. c:function:: broadcast_chunks_integer: + + + File : :file:`mpi/mpi.irp.f_template_97` + + .. code:: fortran + + subroutine broadcast_chunks_integer(A, LDA) + + + Broadcast with chunks of ~2GB + + +.. c:function:: broadcast_chunks_integer8: + + + File : :file:`mpi/mpi.irp.f_template_97` + + .. code:: fortran + + subroutine broadcast_chunks_integer8(A, LDA) + + + Broadcast with chunks of ~2GB + + +.. c:function:: mpi_print: + + + File : :file:`mpi/mpi.irp.f` + + .. code:: fortran + + subroutine mpi_print(string) + + + Print string to stdout if the MPI rank is zero. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_slave_main` + diff --git a/docs/source/modules/nuclei.rst b/docs/source/modules/nuclei.rst new file mode 100644 index 000000000..0bd4b325c --- /dev/null +++ b/docs/source/modules/nuclei.rst @@ -0,0 +1,666 @@ +.. _module_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 + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + double precision, allocatable :: center_of_mass (3) + + + Center of mass of the molecule + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`element_name` + * :c:data:`nucl_charge` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`inertia_tensor` + + +.. c:var:: element_mass + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + character*(4), allocatable :: element_name (0:127) + double precision, allocatable :: element_mass (0:127) + + + Array of the name of element, sorted by nuclear charge (integer) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`center_of_mass` + * :c:data:`inertia_tensor` + + +.. c:var:: element_name + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + character*(4), allocatable :: element_name (0:127) + double precision, allocatable :: element_mass (0:127) + + + Array of the name of element, sorted by nuclear charge (integer) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`center_of_mass` + * :c:data:`inertia_tensor` + + +.. c:var:: inertia_tensor + + + File : :file:`nuclei/inertia.irp.f` + + .. code:: fortran + + double precision, allocatable :: inertia_tensor (3,3) + + + Inertia tensor + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`center_of_mass` + * :c:data:`element_name` + * :c:data:`nucl_charge` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`inertia_tensor_eigenvectors` + + +.. c:var:: inertia_tensor_eigenvalues + + + File : :file:`nuclei/inertia.irp.f` + + .. code:: fortran + + double precision, allocatable :: inertia_tensor_eigenvectors (3,3) + double precision, allocatable :: inertia_tensor_eigenvalues (3) + + + Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`inertia_tensor` + + + +.. c:var:: inertia_tensor_eigenvectors + + + File : :file:`nuclei/inertia.irp.f` + + .. code:: fortran + + double precision, allocatable :: inertia_tensor_eigenvectors (3,3) + double precision, allocatable :: inertia_tensor_eigenvalues (3) + + + Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`inertia_tensor` + + + +.. c:var:: nucl_coord + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + double precision, allocatable :: nucl_coord (nucl_num,3) + + + Nuclear coordinates in the format (:, {x,y,z}) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ezfio_filename` + * :c:data:`mpi_master` + * :c:data:`nucl_charge` + * :c:data:`nucl_label` + * :c:data:`nucl_num` + * :c:data:`output_wall_time_0` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_deriv2_x` + * :c:data:`ao_deriv_1_x` + * :c:data:`ao_dipole_x` + * :c:data:`ao_integrals_n_e` + * :c:data:`ao_integrals_n_e_per_atom` + * :c:data:`ao_overlap` + * :c:data:`ao_overlap_abs` + * :c:data:`ao_pseudo_integrals_local` + * :c:data:`ao_pseudo_integrals_non_local` + * :c:data:`ao_spread_x` + * :c:data:`ao_two_e_integral_alpha` + * :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:`center_of_mass` + * :c:data:`inertia_tensor` + * :c:data:`nucl_coord_transp` + * :c:data:`nucl_dist_2` + * :c:data:`nuclear_repulsion` + + +.. c:var:: nucl_coord_transp + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + double precision, allocatable :: nucl_coord_transp (3,nucl_num) + + + Transposed array of nucl_coord + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + + +.. c:var:: nucl_dist + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + 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) + + + nucl_dist : Nucleus-nucleus distances + nucl_dist_2 : Nucleus-nucleus distances squared + nucl_dist_vec : Nucleus-nucleus distances vectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_dist_inv` + + +.. c:var:: nucl_dist_2 + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + 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) + + + nucl_dist : Nucleus-nucleus distances + nucl_dist_2 : Nucleus-nucleus distances squared + nucl_dist_vec : Nucleus-nucleus distances vectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_dist_inv` + + +.. c:var:: nucl_dist_inv + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + double precision, allocatable :: nucl_dist_inv (nucl_num,nucl_num) + + + Inverse of the distance between nucleus I and nucleus J + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_dist_2` + * :c:data:`nucl_num` + + + +.. c:var:: nucl_dist_vec_x + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + 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) + + + nucl_dist : Nucleus-nucleus distances + nucl_dist_2 : Nucleus-nucleus distances squared + nucl_dist_vec : Nucleus-nucleus distances vectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_dist_inv` + + +.. c:var:: nucl_dist_vec_y + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + 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) + + + nucl_dist : Nucleus-nucleus distances + nucl_dist_2 : Nucleus-nucleus distances squared + nucl_dist_vec : Nucleus-nucleus distances vectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_dist_inv` + + +.. c:var:: nucl_dist_vec_z + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + 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) + + + nucl_dist : Nucleus-nucleus distances + nucl_dist_2 : Nucleus-nucleus distances squared + nucl_dist_vec : Nucleus-nucleus distances vectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_dist_inv` + + +.. c:var:: nuclear_repulsion + + + File : :file:`nuclei/nuclei.irp.f` + + .. code:: fortran + + double precision :: nuclear_repulsion + + + Nuclear repulsion energy + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`disk_access_nuclear_repulsion` + * :c:data:`mpi_master` + * :c:data:`nucl_charge` + * :c:data:`nucl_coord` + * :c:data:`nucl_num` + * :c:data:`output_wall_time_0` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_energy` + * :c:data:`core_energy` + * :c:data:`core_energy_erf` + * :c:data:`hf_energy` + * :c:data:`psi_energy_with_nucl_rep` + * :c:data:`pt2_e0_denominator` + * :c:data:`scf_energy` + + +.. c:var:: slater_bragg_radii + + + File : :file:`nuclei/atomic_radii.irp.f` + + .. code:: fortran + + double precision, allocatable :: slater_bragg_radii (100) + + + 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) + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`slater_bragg_radii_per_atom` + * :c:data:`slater_bragg_radii_ua` + + +.. c:var:: slater_bragg_radii_per_atom + + + File : :file:`nuclei/atomic_radii.irp.f` + + .. code:: fortran + + double precision, allocatable :: slater_bragg_radii_per_atom (nucl_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_charge` + * :c:data:`nucl_num` + * :c:data:`slater_bragg_radii` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`slater_bragg_type_inter_distance` + + +.. c:var:: slater_bragg_radii_per_atom_ua + + + File : :file:`nuclei/atomic_radii.irp.f` + + .. code:: fortran + + double precision, allocatable :: slater_bragg_radii_per_atom_ua (nucl_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_charge` + * :c:data:`nucl_num` + * :c:data:`slater_bragg_radii_ua` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`slater_bragg_type_inter_distance_ua` + + +.. c:var:: slater_bragg_radii_ua + + + File : :file:`nuclei/atomic_radii.irp.f` + + .. code:: fortran + + double precision, allocatable :: slater_bragg_radii_ua (100) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`slater_bragg_radii` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`slater_bragg_radii_per_atom_ua` + + +.. c:var:: slater_bragg_type_inter_distance + + + File : :file:`nuclei/atomic_radii.irp.f` + + .. code:: fortran + + double precision, allocatable :: slater_bragg_type_inter_distance (nucl_num,nucl_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`slater_bragg_radii_per_atom` + + + +.. c:var:: slater_bragg_type_inter_distance_ua + + + File : :file:`nuclei/atomic_radii.irp.f` + + .. code:: fortran + + double precision, allocatable :: slater_bragg_type_inter_distance_ua (nucl_num,nucl_num) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nucl_num` + * :c:data:`slater_bragg_radii_per_atom_ua` + + diff --git a/docs/source/modules/perturbation.rst b/docs/source/modules/perturbation.rst new file mode 100644 index 000000000..764b6312a --- /dev/null +++ b/docs/source/modules/perturbation.rst @@ -0,0 +1,981 @@ +.. _module_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:: variance_max + + The selection process stops when the largest variance (for all the state) is lower than `variance_max` in absolute value + + Default: 0.0 + +.. option:: pt2_relative_error + + Stop stochastic |PT2| when the relative error is smaller than `pT2_relative_error` + + Default: 0.002 + +.. 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 denominator in PT2. [EN | SOP | HF] + + Default: EN + + +Providers +--------- + +.. c:var:: max_exc_pert + + + File : :file:`perturbation/exc_max.irp.f` + + .. code:: fortran + + integer :: max_exc_pert + + + + + +.. c:var:: selection_criterion + + + File : :file:`perturbation/selection.irp.f` + + .. code:: fortran + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + + Threshold to select determinants. Set by selection routines. + + + +.. c:var:: selection_criterion_factor + + + File : :file:`perturbation/selection.irp.f` + + .. code:: fortran + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + + Threshold to select determinants. Set by selection routines. + + + +.. c:var:: selection_criterion_min + + + File : :file:`perturbation/selection.irp.f` + + .. code:: fortran + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + + Threshold to select determinants. Set by selection routines. + + + +.. c:var:: var_pt2_ratio + + + File : :file:`perturbation/var_pt2_ratio_provider.irp.f` + + .. code:: fortran + + double precision :: var_pt2_ratio + + + The selection process stops when the energy ratio variational/(variational+PT2) + is equal to var_pt2_ratio + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`correlation_energy_ratio_max` + + + + +Subroutines / functions +----------------------- + +.. c:function:: fill_h_apply_buffer_selection: + + + File : :file:`perturbation/selection.irp.f` + + .. code:: fortran + + subroutine fill_H_apply_buffer_selection(n_selected,det_buffer,e_2_pert_buffer,coef_pert_buffer, N_st,Nint,iproc,select_max_out) + + + Fill the H_apply buffer with determiants for the selection + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`selection_criterion` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`n_int` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + * :c:func:`resize_h_apply_buffer` + + +.. c:function:: perturb_buffer_by_mono_dummy: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``dummy`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`psi_selectors` + * :c:data:`n_det` + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`pt2_dummy` + + +.. c:function:: perturb_buffer_by_mono_epstein_nesbet: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`psi_selectors` + * :c:data:`n_det` + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`pt2_epstein_nesbet` + + +.. c:function:: perturb_buffer_by_mono_epstein_nesbet_2x2: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`psi_selectors` + * :c:data:`n_det` + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`pt2_epstein_nesbet_2x2` + + +.. c:function:: perturb_buffer_by_mono_epstein_nesbet_2x2_no_ci_diag: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + subroutine perturb_buffer_by_mono_epstein_nesbet_2x2_no_ci_diag(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) + + + Apply pertubration ``epstein_nesbet_2x2_no_ci_diag`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`psi_selectors` + * :c:data:`n_det` + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`pt2_epstein_nesbet_2x2_no_ci_diag` + + +.. c:function:: perturb_buffer_by_mono_moller_plesset: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`psi_selectors` + * :c:data:`n_det` + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`pt2_moller_plesset` + + +.. c:function:: perturb_buffer_by_mono_qdpt: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``qdpt`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_num` + * :c:data:`psi_selectors` + * :c:data:`n_det` + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_det_generators` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`pt2_qdpt` + + +.. c:function:: perturb_buffer_dummy: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``dummy`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_selectors` + * :c:data:`psi_det_generators` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_microlist` + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`getmobiles` + * :c:func:`pt2_dummy` + + +.. c:function:: perturb_buffer_epstein_nesbet: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_selectors` + * :c:data:`psi_det_generators` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_microlist` + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`getmobiles` + * :c:func:`pt2_epstein_nesbet` + + +.. c:function:: perturb_buffer_epstein_nesbet_2x2: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_selectors` + * :c:data:`psi_det_generators` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_microlist` + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`getmobiles` + * :c:func:`pt2_epstein_nesbet_2x2` + + +.. c:function:: perturb_buffer_epstein_nesbet_2x2_no_ci_diag: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + subroutine perturb_buffer_epstein_nesbet_2x2_no_ci_diag(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) + + + Apply pertubration ``epstein_nesbet_2x2_no_ci_diag`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_selectors` + * :c:data:`psi_det_generators` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_microlist` + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`getmobiles` + * :c:func:`pt2_epstein_nesbet_2x2_no_ci_diag` + + +.. c:function:: perturb_buffer_moller_plesset: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_selectors` + * :c:data:`psi_det_generators` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_microlist` + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`getmobiles` + * :c:func:`pt2_moller_plesset` + + +.. c:function:: perturb_buffer_qdpt: + + + File : :file:`perturbation/perturbation.irp.f_shell_13` + + .. code:: fortran + + 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) + + + Apply pertubration ``qdpt`` to the buffer of determinants generated in the H_apply + routine. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_det_generators` + * :c:data:`psi_selectors` + * :c:data:`psi_det_generators` + * :c:data:`mo_num` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`create_microlist` + * :c:func:`create_minilist` + * :c:func:`create_minilist_find_previous` + * :c:func:`getmobiles` + * :c:func:`pt2_qdpt` + + +.. c:function:: pt2_dummy: + + + File : :file:`perturbation/pt2_equations.irp.f_template_305` + + .. code:: fortran + + 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) + + + Dummy perturbation to add all connected determinants. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`selection_criterion` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_size` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_dummy` + * :c:func:`perturb_buffer_dummy` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_h_psi_minilist` + + +.. c:function:: pt2_epstein_nesbet: + + + File : :file:`perturbation/pt2_equations.irp.f_template_305` + + .. code:: fortran + + 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) + + + Compute the standard Epstein-Nesbet perturbative first order coefficient and + second order energetic contribution for the various N_st states. + + `c_pert(i)` = $\frac{\langle i|H|\alpha \rangle}{ E_n - \langle \alpha|H|\alpha \rangle }$. + + `e_2_pert(i)` = $\frac{\langle i|H|\alpha \rangle^2}{ E_n - \langle \alpha|H|\alpha \rangle }$. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`selection_criterion` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_size` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_epstein_nesbet` + * :c:func:`perturb_buffer_epstein_nesbet` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_h_psi_minilist` + + +.. c:function:: pt2_epstein_nesbet_2x2: + + + File : :file:`perturbation/pt2_equations.irp.f_template_305` + + .. code:: fortran + + 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) + + + Computes the Epstein-Nesbet 2x2 diagonalization coefficient and energetic contribution + for the various N_st states. + + `e_2_pert(i)` = $\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)` $\times \frac{1}{ \langle i|H|\alpha \rangle}$. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_size` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_epstein_nesbet_2x2` + * :c:func:`perturb_buffer_epstein_nesbet_2x2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_h_psi` + + +.. c:function:: pt2_epstein_nesbet_2x2_no_ci_diag: + + + File : :file:`perturbation/pt2_equations.irp.f_template_305` + + .. code:: fortran + + subroutine pt2_epstein_nesbet_2x2_no_ci_diag(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) + + + compute the Epstein-Nesbet 2x2 diagonalization coefficient and energetic contribution + + for the various N_st states. + + e_2_pert(i) = 0.5 * (( - E(i) ) - sqrt( ( - E(i)) ^2 + 4 ^2 ) + + c_pert(i) = e_2_pert(i)/ + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_size` + * :c:data:`psi_energy` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_epstein_nesbet_2x2_no_ci_diag` + * :c:func:`perturb_buffer_epstein_nesbet_2x2_no_ci_diag` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i_h_psi` + + +.. c:function:: pt2_moller_plesset: + + + File : :file:`perturbation/pt2_equations.irp.f_template_305` + + .. code:: fortran + + 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) + + + Computes the standard Moller-Plesset perturbative first order coefficient and second + order energetic contribution for the various N_st states. + + `c_pert(i)` = $\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}$. + + `e_2_pert(i)` = $\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}$. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ref_bitmask` + * :c:data:`psi_selectors_size` + * :c:data:`psi_selectors` + * :c:data:`mo_num` + * :c:data:`n_det_selectors` + * :c:data:`fock_matrix_mo` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_moller_plesset` + * :c:func:`perturb_buffer_moller_plesset` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`decode_exc` + * :c:func:`get_excitation` + * :c:func:`i_h_psi_minilist` + + +.. c:function:: pt2_qdpt: + + + File : :file:`perturbation/pt2_equations.irp.f_template_305` + + .. code:: fortran + + 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) + + + Computes the QDPT first order coefficient and second order energetic contribution + for the various N_st states. + + `c_pert(i)` = $\frac{\langle i|H|\alpha \rangle}{\langle i|H|i \rangle - \langle \alpha|H|\alpha \rangle}$. + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`selection_criterion` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_size` + * :c:data:`mo_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`perturb_buffer_by_mono_qdpt` + * :c:func:`perturb_buffer_qdpt` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`get_excitation_degree` + * :c:func:`i_h_j` + * :c:func:`i_h_psi_minilist` + + +.. c:function:: remove_small_contributions: + + + File : :file:`perturbation/selection.irp.f` + + .. code:: fortran + + subroutine remove_small_contributions + + + Remove determinants with small contributions. N_states is assumed to be + provided. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_coef` + * :c:data:`selection_criterion` + * :c:data:`n_states` + * :c:data:`n_det` + * :c:data:`psi_det_size` + * :c:data:`n_det_generators` + * :c:data:`n_int` + * :c:data:`psi_det_sorted` + * :c:data:`psi_det` + * :c:data:`psi_det_sorted` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`diagonalize_ci` + * :c:func:`i_h_psi` + * :c:func:`write_int` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`ci_energy` + * :c:data:`ci_electronic_energy` + * :c:data:`n_det` + * :c:data:`psi_coef` + * :c:data:`psi_det` + * :c:data:`psi_energy` + * :c:data:`psi_energy` + diff --git a/docs/source/modules/pseudo.rst b/docs/source/modules/pseudo.rst new file mode 100644 index 000000000..8a48aa9f1 --- /dev/null +++ b/docs/source/modules/pseudo.rst @@ -0,0 +1,94 @@ +.. _module_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 000000000..c57198fee --- /dev/null +++ b/docs/source/modules/psiref_cas.rst @@ -0,0 +1,14 @@ +.. _module_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 000000000..541fc2c4d --- /dev/null +++ b/docs/source/modules/psiref_utils.rst @@ -0,0 +1,16 @@ +.. _module_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 000000000..4bf431b9c --- /dev/null +++ b/docs/source/modules/scf_utils.rst @@ -0,0 +1,795 @@ +.. _module_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:: frozen_orb_scf + + If true, leave untouched all the orbitals defined as core and optimize all the orbitals defined as active with qp_set_mo_class + + Default: False + + +Providers +--------- + +.. c:var:: eigenvalues_fock_matrix_ao + + + File : :file:`scf_utils/diis.irp.f` + + .. code:: fortran + + double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) + double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) + + + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`fock_matrix_ao` + * :c:data:`s_half_inv` + + + +.. c:var:: eigenvectors_fock_matrix_ao + + + File : :file:`scf_utils/diis.irp.f` + + .. code:: fortran + + double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) + double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) + + + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`fock_matrix_ao` + * :c:data:`s_half_inv` + + + +.. c:var:: eigenvectors_fock_matrix_mo + + + File : :file:`scf_utils/diagonalize_fock.irp.f` + + .. code:: fortran + + double precision, allocatable :: eigenvectors_fock_matrix_mo (ao_num,mo_num) + + + Eigenvectors of the Fock matrix in the MO basis obtained with level shift. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`fock_matrix_mo` + * :c:data:`frozen_orb_scf` + * :c:data:`level_shift` + * :c:data:`list_inact` + * :c:data:`mo_coef` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + + + +.. c:function:: extrapolate_fock_matrix: + + + File : :file:`scf_utils/roothaan_hall_scf.irp.f` + + .. code:: fortran + + subroutine extrapolate_Fock_matrix( & + error_matrix_DIIS,Fock_matrix_DIIS, & + Fock_matrix_AO_,size_Fock_matrix_AO, & + iteration_SCF,dim_DIIS & + ) + + + Compute the extrapolated Fock matrix using the DIIS procedure + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`max_dim_diis` + * :c:data:`ao_num` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`roothaan_hall_scf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + * :c:func:`dsysvx` + + +.. c:var:: fock_matrix_ao + + + File : :file:`scf_utils/fock_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_matrix_ao (ao_num,ao_num) + + + Fock matrix in AO basis set + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fock_matrix_mo` + * :c:data:`frozen_orb_scf` + * :c:data:`level_shift` + * :c:data:`mo_num` + * :c:data:`s_mo_coef` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`eigenvalues_fock_matrix_ao` + * :c:data:`fps_spf_matrix_ao` + + +.. c:var:: fock_matrix_diag_mo + + + File : :file:`scf_utils/fock_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) + double precision, allocatable :: fock_matrix_diag_mo (mo_num) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`fock_matrix_mo_alpha` + * :c:data:`fock_matrix_mo_beta` + * :c:data:`frozen_orb_scf` + * :c:data:`list_inact` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_ao` + + +.. c:var:: fock_matrix_mo + + + File : :file:`scf_utils/fock_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) + double precision, allocatable :: fock_matrix_diag_mo (mo_num) + + + 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 + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`fock_matrix_mo_alpha` + * :c:data:`fock_matrix_mo_beta` + * :c:data:`frozen_orb_scf` + * :c:data:`list_inact` + * :c:data:`mo_num` + * :c:data:`n_core_orb` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`fock_matrix_ao` + + +.. c:var:: fock_matrix_mo_alpha + + + File : :file:`scf_utils/fock_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_matrix_mo_alpha (mo_num,mo_num) + + + Fock matrix on the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_mo` + + +.. c:var:: fock_matrix_mo_beta + + + File : :file:`scf_utils/fock_matrix.irp.f` + + .. code:: fortran + + double precision, allocatable :: fock_matrix_mo_beta (mo_num,mo_num) + + + Fock matrix on the MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_mo` + + +.. c:var:: fps_spf_matrix_ao + + + File : :file:`scf_utils/diis.irp.f` + + .. code:: fortran + + double precision, allocatable :: fps_spf_matrix_ao (AO_num,AO_num) + + + Commutator FPS - SPF + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_overlap` + * :c:data:`fock_matrix_ao` + * :c:data:`scf_density_matrix_ao` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fps_spf_matrix_mo` + + +.. c:var:: fps_spf_matrix_mo + + + File : :file:`scf_utils/diis.irp.f` + + .. code:: fortran + + double precision, allocatable :: fps_spf_matrix_mo (mo_num,mo_num) + + + Commutator FPS - SPF in MO basis + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`fps_spf_matrix_ao` + * :c:data:`mo_coef` + * :c:data:`mo_num` + + + +.. c:var:: scf_density_matrix_ao + + + File : :file:`scf_utils/scf_density_matrix_ao.irp.f` + + .. code:: fortran + + double precision, allocatable :: scf_density_matrix_ao (ao_num,ao_num) + + + Sum of :math:`\alpha` and :math:`\beta` density matrices + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`elec_alpha_num` + * :c:data:`elec_beta_num` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`fps_spf_matrix_ao` + + +.. c:var:: scf_density_matrix_ao_alpha + + + File : :file:`scf_utils/scf_density_matrix_ao.irp.f` + + .. code:: fortran + + double precision, allocatable :: scf_density_matrix_ao_alpha (ao_num,ao_num) + + + :math:`C.C^t` over :math:`\alpha` MOs + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`elec_alpha_num` + * :c:data:`mo_coef` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`hf_energy` + * :c:data:`scf_density_matrix_ao` + * :c:data:`scf_energy` + + +.. c:var:: scf_density_matrix_ao_beta + + + File : :file:`scf_utils/scf_density_matrix_ao.irp.f` + + .. code:: fortran + + double precision, allocatable :: scf_density_matrix_ao_beta (ao_num,ao_num) + + + :math:`C.C^t` over :math:`\beta` MOs + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`elec_beta_num` + * :c:data:`mo_coef` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`hf_energy` + * :c:data:`scf_density_matrix_ao` + * :c:data:`scf_energy` + + +.. c:var:: scf_energy + + + File : :file:`scf_utils/fock_matrix.irp.f` + + .. code:: fortran + + double precision :: scf_energy + + + Hartree-Fock energy + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_num` + * :c:data:`ao_one_e_integrals` + * :c:data:`extra_e_contrib_density` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`nuclear_repulsion` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + + + +.. c:var:: threshold_diis_nonzero + + + File : :file:`scf_utils/diis.irp.f` + + .. code:: fortran + + double precision :: threshold_diis_nonzero + + + If threshold_DIIS is zero, choose sqrt(thresh_scf) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`thresh_scf` + * :c:data:`threshold_diis` + + + + +Subroutines / functions +----------------------- + +.. c:function:: damping_scf: + + + File : :file:`scf_utils/damping_scf.irp.f` + + .. code:: fortran + + subroutine damping_SCF + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mo_coef` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`scf_energy` + * :c:data:`scf_density_matrix_ao_beta` + * :c:data:`fock_matrix_mo` + * :c:data:`ao_num` + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`fock_matrix_ao` + * :c:data:`mo_label` + * :c:data:`n_it_scf_max` + * :c:data:`thresh_scf` + * :c:data:`frozen_orb_scf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_hartree_fock_energy` + * :c:func:`initialize_mo_coef_begin_iteration` + * :c:func:`mo_as_eigvectors_of_mo_matrix` + * :c:func:`reorder_core_orb` + * :c:func:`save_mos` + * :c:func:`write_double` + * :c:func:`write_time` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`scf_density_matrix_ao_alpha` + * :c:data:`scf_density_matrix_ao_beta` + * :c:data:`mo_coef` + + +.. c:function:: huckel_guess: + + + File : :file:`scf_utils/huckel.irp.f` + + .. code:: fortran + + subroutine huckel_guess + + + Build the MOs using the extended Huckel model + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_one_e_integrals` + * :c:data:`mo_coef` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`ao_overlap` + * :c:data:`ao_num` + * :c:data:`ao_two_e_integral_alpha` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fock_matrix_ao_alpha` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`create_guess` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`save_mos` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`mo_coef` + + +.. c:function:: roothaan_hall_scf: + + + File : :file:`scf_utils/roothaan_hall_scf.irp.f` + + .. code:: fortran + + subroutine Roothaan_Hall_SCF + + + Roothaan-Hall algorithm for SCF Hartree-Fock calculation + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`max_dim_diis` + * :c:data:`mo_occ` + * :c:data:`ao_md5` + * :c:data:`mo_coef` + * :c:data:`level_shift` + * :c:data:`fps_spf_matrix_mo` + * :c:data:`eigenvectors_fock_matrix_mo` + * :c:data:`scf_energy` + * :c:data:`mo_num` + * :c:data:`thresh_scf` + * :c:data:`scf_algorithm` + * :c:data:`fock_matrix_mo` + * :c:data:`ao_num` + * :c:data:`fock_matrix_ao` + * :c:data:`mo_label` + * :c:data:`n_it_scf_max` + * :c:data:`threshold_diis_nonzero` + * :c:data:`frozen_orb_scf` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fps_spf_matrix_ao` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`extrapolate_fock_matrix` + * :c:func:`initialize_mo_coef_begin_iteration` + * :c:func:`mo_as_eigvectors_of_mo_matrix` + * :c:func:`reorder_core_orb` + * :c:func:`save_mos` + * :c:func:`write_double` + * :c:func:`write_time` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`fock_matrix_ao_alpha` + * :c:data:`mo_coef` + * :c:data:`level_shift` + * :c:data:`mo_coef` + diff --git a/docs/source/modules/selectors_cassd.rst b/docs/source/modules/selectors_cassd.rst new file mode 100644 index 000000000..0740d91ec --- /dev/null +++ b/docs/source/modules/selectors_cassd.rst @@ -0,0 +1,13 @@ +.. _module_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:`module_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 000000000..dc29007da --- /dev/null +++ b/docs/source/modules/selectors_full.rst @@ -0,0 +1,152 @@ +.. _module_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 + + + File : :file:`selectors_full/selectors.irp.f` + + .. code:: fortran + + integer :: n_det_selectors + + + For Single reference wave functions, the number of selectors is 1 : the + Hartree-Fock determinant + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`mpi_master` + * :c:data:`n_det` + * :c:data:`n_det_generators` + * :c:data:`output_wall_time_0` + * :c:data:`psi_det_sorted` + * :c:data:`threshold_selectors` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`exc_degree_per_selectors` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_coef_transp` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: psi_selectors + + + File : :file:`selectors_full/selectors.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) + double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) + + + Determinants on which we apply for perturbation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_det_sorted` + * :c:data:`psi_selectors_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`exc_degree_per_selectors` + * :c:data:`psi_selectors_coef_transp` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: psi_selectors_coef + + + File : :file:`selectors_full/selectors.irp.f` + + .. code:: fortran + + integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) + double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) + + + Determinants on which we apply for perturbation. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`n_states` + * :c:data:`psi_det_sorted` + * :c:data:`psi_selectors_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + * :c:data:`exc_degree_per_selectors` + * :c:data:`psi_selectors_coef_transp` + * :c:data:`psi_selectors_diag_h_mat` + + +.. c:var:: threshold_selectors + + + File : :file:`selectors_full/selectors.irp.f` + + .. code:: fortran + + double precision :: threshold_selectors + + + Thresholds on selectors (fraction of the square of the norm) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`threshold_generators` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + diff --git a/docs/source/modules/selectors_utils.rst b/docs/source/modules/selectors_utils.rst new file mode 100644 index 000000000..9c4b3bd43 --- /dev/null +++ b/docs/source/modules/selectors_utils.rst @@ -0,0 +1,649 @@ +.. _module_selectors_utils: + +.. program:: selectors_utils + +.. default-role:: option + +=============== +selectors_utils +=============== + +Helper functions for selectors. + + + + +Providers +--------- + +.. c:var:: coef_hf_selector + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: delta_e_per_selector + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: double_index_selectors + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + + +.. c:var:: e_corr_double_only + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: e_corr_per_selectors + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: e_corr_second_order + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: exc_degree_per_selectors + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + + +.. c:var:: i_h_hf_per_selectors + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: inv_selectors_coef_hf + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: inv_selectors_coef_hf_squared + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + 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 + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`big_array_coulomb_integrals` + * :c:data:`big_array_coulomb_integrals` + * :c:data:`exc_degree_per_selectors` + * :c:data:`mo_integrals_map` + * :c:data:`mo_two_e_integrals_in_map` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: n_double_selectors + + + File : :file:`selectors_utils/e_corr_selectors.irp.f` + + .. code:: fortran + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + + 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 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`ref_bitmask` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`coef_hf_selector` + + +.. c:var:: psi_selectors_coef_transp + + + File : :file:`selectors_utils/selectors.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_selectors_coef_transp (N_states,psi_selectors_size) + + + Transposed psi_selectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`n_states` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_size` + + + +.. c:var:: psi_selectors_diag_h_mat + + + File : :file:`selectors_utils/selectors.irp.f` + + .. code:: fortran + + double precision, allocatable :: psi_selectors_diag_h_mat (psi_selectors_size) + + + Diagonal elements of the H matrix for each selectors + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`elec_num` + * :c:data:`n_det_selectors` + * :c:data:`n_int` + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_size` + * :c:data:`ref_bitmask` + * :c:data:`ref_bitmask_energy` + + + +.. c:var:: psi_selectors_size + + + File : :file:`selectors_utils/selectors.irp.f` + + .. code:: fortran + + integer :: psi_selectors_size + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_det_size` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`psi_selectors` + * :c:data:`psi_selectors_coef_transp` + * :c:data:`psi_selectors_diag_h_mat` + + + +Subroutines / functions +----------------------- + +.. c:function:: zmq_get_n_det_generators: + + + File : :file:`selectors_utils/zmq.irp.f_template_102` + + .. code:: fortran + + integer function zmq_get_N_det_generators(zmq_to_qp_run_socket, worker_id) + + + Get N_det_generators from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_n_det_selectors: + + + File : :file:`selectors_utils/zmq.irp.f_template_102` + + .. code:: fortran + + integer function zmq_get_N_det_selectors(zmq_to_qp_run_socket, worker_id) + + + Get N_det_selectors from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_put_n_det_generators: + + + File : :file:`selectors_utils/zmq.irp.f_template_102` + + .. code:: fortran + + integer function zmq_put_N_det_generators(zmq_to_qp_run_socket,worker_id) + + + Put N_det_generators on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_generators` + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_n_det_selectors: + + + File : :file:`selectors_utils/zmq.irp.f_template_102` + + .. code:: fortran + + integer function zmq_put_N_det_selectors(zmq_to_qp_run_socket,worker_id) + + + Put N_det_selectors on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_det_selectors` + * :c:data:`zmq_state` + diff --git a/docs/source/modules/single_ref_method.rst b/docs/source/modules/single_ref_method.rst new file mode 100644 index 000000000..e0d17a001 --- /dev/null +++ b/docs/source/modules/single_ref_method.rst @@ -0,0 +1,14 @@ +.. _module_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/tools.rst b/docs/source/modules/tools.rst new file mode 100644 index 000000000..d8e2aa467 --- /dev/null +++ b/docs/source/modules/tools.rst @@ -0,0 +1,134 @@ +.. _module_tools: + +.. program:: tools + +.. default-role:: option + +===== +tools +===== + +Useful tools are grouped in this module. + + + +Programs +-------- + + * :ref:`diagonalize_h` + * :ref:`fcidump` + * :ref:`four_idx_transform` + * :ref:`molden` + * :ref:`print_ci_vectors` + * :ref:`print_e_conv` + * :ref:`print_wf` + * :ref:`save_natorb` + * :ref:`save_one_e_dm` + * :ref:`save_ortho_mos` + * :ref:`write_integrals_erf` + +Subroutines / functions +----------------------- + +.. c:function:: routine: + + + File : :file:`write_integrals_erf.irp.f` + + .. code:: fortran + + subroutine routine + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`diagonalize_h` + * :c:func:`print_ci_vectors` + * :c:func:`print_wf` + * :c:func:`write_integrals_erf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`save_erf_two_e_integrals_ao` + * :c:func:`save_erf_two_e_integrals_mo` + + +.. c:function:: routine_e_conv: + + + File : :file:`print_e_conv.irp.f` + + .. code:: fortran + + subroutine routine_e_conv + + + routine called by :c:func:`print_e_conv` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`n_states` + * :c:data:`ezfio_filename` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`print_e_conv` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_get_iterations_energy_iterations` + * :c:func:`ezfio_get_iterations_n_det_iterations` + * :c:func:`ezfio_get_iterations_n_iter` + * :c:func:`ezfio_get_iterations_pt2_iterations` + + +.. c:function:: routine_save_one_e_dm: + + + File : :file:`save_one_e_dm.irp.f` + + .. code:: fortran + + subroutine routine_save_one_e_dm + + + routine called by :c:func:`save_one_e_dm` + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`one_e_dm_mo_alpha` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`save_one_e_dm` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`ezfio_set_aux_quantities_data_one_e_dm_alpha_mo` + * :c:func:`ezfio_set_aux_quantities_data_one_e_dm_beta_mo` + diff --git a/docs/source/modules/utils.rst b/docs/source/modules/utils.rst new file mode 100644 index 000000000..f11ee43e0 --- /dev/null +++ b/docs/source/modules/utils.rst @@ -0,0 +1,3026 @@ +.. _module_utils: + +.. program:: utils + +.. default-role:: option + +===== +utils +===== + +Contains general purpose utilities (sorting, maps, etc). + + + + +Providers +--------- + +.. c:var:: binom + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + double precision, allocatable :: binom (0:40,0:40) + double precision, allocatable :: binom_transp (0:40,0:40) + + + Binomial coefficients + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`binom_int` + + +.. c:var:: binom_int + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + integer*8, allocatable :: binom_int (0:40,0:40) + integer*8, allocatable :: binom_int_transp (0:40,0:40) + + + Binomial coefficients, as integers*8 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`binom` + + + +.. c:var:: binom_int_transp + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + integer*8, allocatable :: binom_int (0:40,0:40) + integer*8, allocatable :: binom_int_transp (0:40,0:40) + + + Binomial coefficients, as integers*8 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`binom` + + + +.. c:var:: binom_transp + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + double precision, allocatable :: binom (0:40,0:40) + double precision, allocatable :: binom_transp (0:40,0:40) + + + Binomial coefficients + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`binom_int` + + +.. c:var:: degree_max_integration_lebedev + + + File : :file:`utils/angular_integration.irp.f` + + .. code:: fortran + + integer :: degree_max_integration_lebedev + + + integrate correctly a polynom of order "degree_max_integration_lebedev" + needed for the angular integration according to LEBEDEV formulae + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`n_points_integration_angular_lebedev` + * :c:data:`theta_angular_integration_lebedev` + + +.. c:function:: dtranspose: + + + File : :file:`utils/transpose.irp.f` + + .. code:: fortran + + recursive subroutine dtranspose(A,LDA,B,LDB,d1,d2) + + + Transpose input matrix A into output matrix B + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`dtranspose` + * :c:func:`h_s2_u_0_nstates_openmp` + * :c:func:`h_s2_u_0_nstates_zmq` + * :c:func:`h_s2_u_0_two_e_nstates_openmp` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dtranspose` + + +.. c:var:: fact_inv + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + double precision, allocatable :: fact_inv (128) + + + 1/n! + + + +.. c:function:: i2radix_sort: + + + File : :file:`utils/sort.irp.f_template_644` + + .. code:: fortran + + recursive subroutine i2radix_sort(x,iorder,isize,iradix) + + + 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. + + Called by: + + .. hlist:: + :columns: 3 + + * :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_i1j1` + * :c:func:`get_mo_two_e_integrals_ij` + * :c:func:`i2radix_sort` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i2radix_sort` + * :c:func:`insertion_i2sort` + + +.. c:function:: i8radix_sort: + + + File : :file:`utils/sort.irp.f_template_644` + + .. code:: fortran + + recursive subroutine i8radix_sort(x,iorder,isize,iradix) + + + 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. + + Called by: + + .. hlist:: + :columns: 3 + + * :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_i1j1` + * :c:func:`get_mo_two_e_integrals_ij` + * :c:func:`i8radix_sort` + * :c:data:`psi_bilinear_matrix_transp_values` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i8radix_sort` + * :c:func:`insertion_i8sort` + + +.. c:function:: i8radix_sort_big: + + + File : :file:`utils/sort.irp.f_template_644` + + .. code:: fortran + + recursive subroutine i8radix_sort_big(x,iorder,isize,iradix) + + + 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. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i8radix_sort_big` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`i8radix_sort_big` + * :c:func:`insertion_i8sort_big` + + +.. c:var:: inv_int + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + double precision, allocatable :: inv_int (128) + + + 1/i + + + +.. c:function:: iradix_sort: + + + File : :file:`utils/sort.irp.f_template_644` + + .. code:: fortran + + recursive subroutine iradix_sort(x,iorder,isize,iradix) + + + 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. + + Called by: + + .. hlist:: + :columns: 3 + + * :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_i1j1` + * :c:func:`get_mo_two_e_integrals_ij` + * :c:func:`iradix_sort` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`insertion_isort` + * :c:func:`iradix_sort` + + +.. c:function:: iradix_sort_big: + + + File : :file:`utils/sort.irp.f_template_644` + + .. code:: fortran + + recursive subroutine iradix_sort_big(x,iorder,isize,iradix) + + + 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. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`iradix_sort_big` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`insertion_isort_big` + * :c:func:`iradix_sort_big` + + +.. c:var:: n_points_integration_angular_lebedev + + + File : :file:`utils/angular_integration.irp.f` + + .. code:: fortran + + integer :: n_points_integration_angular_lebedev + + + Number of points needed for the angular integral + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`degree_max_integration_lebedev` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`theta_angular_integration_lebedev` + + +.. c:var:: nproc + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + integer :: nproc + + + Number of current OpenMP threads + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`h_apply_buffer_allocated` + * :c:data:`n_det` + * :c:data:`nthreads_davidson` + * :c:data:`nthreads_pt2` + + +.. c:function:: overlap_gaussian_xyz: + + + File : :file:`utils/one_e_integration.irp.f` + + .. code:: fortran + + subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,& + power_B,overlap_x,overlap_y,overlap_z,overlap,dim) + + + .. 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 + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_coef_normalization_libint_factor` + * :c:data:`ao_coef_normalized` + * :c:data:`ao_deriv2_x` + * :c:data:`ao_deriv_1_x` + * :c:data:`ao_dipole_x` + * :c:data:`ao_overlap` + * :c:data:`ao_spread_x` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`gaussian_product_x` + * :c:func:`give_explicit_poly_and_gaussian` + + +.. c:var:: phi_angular_integration_lebedev + + + File : :file:`utils/angular_integration.irp.f` + + .. code:: fortran + + 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) + + + 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 + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ci_electronic_energy` + * :c:func:`davidson_diag_hjj_sjj` + * :c:func:`mo_as_eigvectors_of_mo_matrix` + * :c:data:`psi_coef_cas_diagonalized` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dsyev` + + +.. c:function:: lapack_diagd: + + + File : :file:`utils/linear_algebra.irp.f` + + .. code:: fortran + + subroutine lapack_diagd(eigvalues,eigvectors,H,nmax,n) + + + 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 + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`inertia_tensor_eigenvectors` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dsyevd` + + +.. c:function:: logfact: + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + double precision function logfact(n) + + + n! + + +.. c:function:: lowercase: + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + subroutine lowercase(txt,n) + + + Transform to lower case + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`end_parallel_job` + * :c:func:`new_parallel_job` + + +.. c:function:: map_load_from_disk: + + + File : :file:`utils/map_functions.irp.f` + + .. code:: fortran + + subroutine map_load_from_disk(filename,map) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_integrals_in_map` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`c_f_pointer` + * :c:func:`mmap` + + +.. c:function:: map_save_to_disk: + + + File : :file:`utils/map_functions.irp.f` + + .. code:: fortran + + subroutine map_save_to_disk(filename,map) + + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:data:`mo_two_e_integrals_erf_in_map` + * :c:data:`mo_two_e_integrals_in_map` + * :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` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`c_f_pointer` + * :c:func:`map_sort` + * :c:func:`mmap` + * :c:func:`msync` + + +.. c:function:: memory_of_double: + + + File : :file:`utils/memory.irp.f` + + .. code:: fortran + + double precision function memory_of_double(n) + + + Computes the memory required for n double precision elements in gigabytes. + + +.. c:function:: memory_of_int: + + + File : :file:`utils/memory.irp.f` + + .. code:: fortran + + double precision function memory_of_int(n) + + + Computes the memory required for n double precision elements in gigabytes. + + +.. c:function:: multiply_poly: + + + File : :file:`utils/integration.irp.f` + + .. code:: fortran + + subroutine multiply_poly(b,nb,c,nc,d,nd) + + + Multiply two polynomials + D(t) =! D(t) +( B(t)*C(t)) + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`general_primitive_integral` + * :c:func:`general_primitive_integral_erf` + * :c:func:`give_explicit_poly_and_gaussian` + * :c:func:`give_explicit_poly_and_gaussian_x` + * :c:func:`give_polynomial_mult_center_one_e` + * :c:func:`give_polynomial_mult_center_one_e_erf` + * :c:func:`give_polynomial_mult_center_one_e_erf_opt` + * :c:func:`i_x1_pol_mult_a1` + * :c:func:`i_x1_pol_mult_a2` + * :c:func:`i_x1_pol_mult_one_e` + * :c:func:`i_x1_pol_mult_recurs` + * :c:func:`i_x2_pol_mult` + * :c:func:`i_x2_pol_mult_one_e` + + +.. c:function:: normalize: + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + subroutine normalize(u,sze) + + + Normalizes vector u + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`copy_h_apply_buffer_to_wf` + * :c:func:`davidson_diag_hjj_sjj` + * :c:func:`save_wavefunction_general` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dscal` + + +.. c:function:: ortho_canonical: + + + File : :file:`utils/linear_algebra.irp.f` + + .. code:: fortran + + subroutine ortho_canonical(overlap,LDA,N,C,LDC,m) + + + 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) ) + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_canonical_coef` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + * :c:func:`svd` + + +.. c:function:: ortho_lowdin: + + + File : :file:`utils/linear_algebra.irp.f` + + .. code:: fortran + + subroutine ortho_lowdin(overlap,LDA,N,C,LDC,m) + + + 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) ) + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_ortho_lowdin_coef` + * :c:func:`orthonormalize_mos` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgemm` + * :c:func:`svd` + + +.. c:function:: ortho_qr: + + + File : :file:`utils/linear_algebra.irp.f` + + .. code:: fortran + + subroutine ortho_qr(A,LDA,m,n) + + + 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 + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`davidson_diag_hjj_sjj` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgeqrf` + * :c:func:`dorgqr` + + +.. c:function:: ortho_qr_unblocked: + + + File : :file:`utils/linear_algebra.irp.f` + + .. code:: fortran + + subroutine ortho_qr_unblocked(A,LDA,m,n) + + + 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 + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgeqr2` + * :c:func:`dorg2r` + + +.. c:function:: overlap_gaussian_x: + + + File : :file:`utils/one_e_integration.irp.f` + + .. code:: fortran + + double precision function overlap_gaussian_x(A_center,B_center,alpha,beta,power_A,power_B,dim) + + + .. 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 + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`give_explicit_poly_and_gaussian_x` + + +.. c:function:: overlap_x_abs: + + + File : :file:`utils/one_e_integration.irp.f` + + .. code:: fortran + + subroutine overlap_x_abs(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + + .. 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 + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_overlap_abs` + + +.. c:function:: print_memory_usage: + + + File : :file:`utils/memory.irp.f` + + .. code:: fortran + + subroutine print_memory_usage() + + + Prints the memory usage in the output + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`write_time` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`resident_memory` + * :c:func:`total_memory` + + +.. c:function:: quick_dsort: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine quick_dsort(x, iorder, isize) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nproc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`dsort` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`rec_d_quicksort` + + +.. c:function:: quick_i2sort: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine quick_i2sort(x, iorder, isize) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nproc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i2sort` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`rec_i2_quicksort` + + +.. c:function:: quick_i8sort: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine quick_i8sort(x, iorder, isize) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nproc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`i8sort` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`rec_i8_quicksort` + + +.. c:function:: quick_isort: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine quick_isort(x, iorder, isize) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nproc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`isort` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`rec_i_quicksort` + + +.. c:function:: quick_sort: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine quick_sort(x, iorder, isize) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`nproc` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`sort` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`rec__quicksort` + + +.. c:function:: recentered_poly2: + + + File : :file:`utils/integration.irp.f` + + .. code:: fortran + + subroutine recentered_poly2(P_new,x_A,x_P,a,P_new2,x_B,x_Q,b) + + + Recenter two polynomials + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`binom` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`give_explicit_poly_and_gaussian` + * :c:func:`give_explicit_poly_and_gaussian_x` + + +.. c:function:: resident_memory: + + + File : :file:`utils/memory.irp.f` + + .. code:: fortran + + subroutine resident_memory(value) + + + Returns the current used memory in gigabytes used by the current process. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`file_lock` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`check_mem` + * :c:func:`davidson_diag_hjj_sjj` + * :c:func:`print_memory_usage` + * :c:func:`run_slave_main` + * :c:func:`zmq_pt2` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: rint: + + + File : :file:`utils/integration.irp.f` + + .. code:: fortran + + double precision function rint(n,rho) + + + .. math:: + + \int_0^1 dx \exp(-p x^2) x^n + + + +.. c:function:: rint1: + + + File : :file:`utils/integration.irp.f` + + .. code:: fortran + + double precision function rint1(n,rho) + + + Standard version of rint + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`inv_int` + * :c:data:`fact_inv` + + +.. c:function:: rint_large_n: + + + File : :file:`utils/integration.irp.f` + + .. code:: fortran + + double precision function rint_large_n(n,rho) + + + Version of rint for large values of n + + +.. c:function:: rint_sum: + + + File : :file:`utils/integration.irp.f` + + .. code:: fortran + + double precision function rint_sum(n_pt_out,rho,d1) + + + Needed for the calculation of two-electron integrals. + + +.. c:function:: rinteg: + + + File : :file:`utils/need.irp.f` + + .. code:: fortran + + double precision function rinteg(n,u) + + + + +.. c:function:: rintgauss: + + + File : :file:`utils/need.irp.f` + + .. code:: fortran + + double precision function rintgauss(n) + + + + +.. c:function:: sabpartial: + + + File : :file:`utils/need.irp.f` + + .. code:: fortran + + double precision function SABpartial(zA,zB,A,B,nA,nB,gamA,gamB,l) + + + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`binom` + + +.. c:function:: set_order: + + + File : :file:`utils/sort.irp.f_template_347` + + .. code:: fortran + + subroutine set_order(x,iorder,isize) + + + 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: + + + File : :file:`utils/sort.irp.f_template_412` + + .. code:: fortran + + subroutine set_order_big(x,iorder,isize) + + + 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: + + + File : :file:`utils/sort.irp.f_template_293` + + .. code:: fortran + + subroutine sort(x,iorder,isize) + + + Sort array x(isize). + iorder in input should be (1,2,3,...,isize), and in output + contains the new order of the elements. + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`insertion_sort` + * :c:func:`quick_sort` + + +.. c:function:: sorted_dnumber: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine sorted_dnumber(x,isize,n) + + + Returns the number of sorted elements + + +.. c:function:: sorted_i2number: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine sorted_i2number(x,isize,n) + + + Returns the number of sorted elements + + +.. c:function:: sorted_i8number: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine sorted_i8number(x,isize,n) + + + Returns the number of sorted elements + + +.. c:function:: sorted_inumber: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine sorted_inumber(x,isize,n) + + + Returns the number of sorted elements + + +.. c:function:: sorted_number: + + + File : :file:`utils/sort.irp.f_template_261` + + .. code:: fortran + + subroutine sorted_number(x,isize,n) + + + Returns the number of sorted elements + + +.. c:function:: svd: + + + File : :file:`utils/linear_algebra.irp.f` + + .. code:: fortran + + subroutine svd(A,LDA,U,LDU,D,Vt,LDVt,m,n) + + + Compute A = U.D.Vt + + LDx : leftmost dimension of x + + Dimsneion of A is m x n + + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`mo_as_svd_vectors_of_mo_matrix` + * :c:func:`mo_as_svd_vectors_of_mo_matrix_eig` + * :c:func:`ortho_canonical` + * :c:func:`ortho_lowdin` + * :c:data:`s_half` + * :c:data:`s_half_inv` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`dgesvd` + + +.. c:function:: total_memory: + + + File : :file:`utils/memory.irp.f` + + .. code:: fortran + + subroutine total_memory(value) + + + Returns the current used memory in gigabytes used by the current process. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`print_memory_usage` + + +.. c:function:: u_dot_u: + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + double precision function u_dot_u(u,sze) + + + Compute + + +.. c:function:: u_dot_v: + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + double precision function u_dot_v(u,v,sze) + + + Compute + + +.. c:function:: wall_time: + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + subroutine wall_time(t) + + + The equivalent of cpu_time, but for the wall time. + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`add_integrals_to_map` + * :c:func:`add_integrals_to_map_erf` + * :c:func:`add_integrals_to_map_no_exit_34` + * :c:func:`add_integrals_to_map_three_indices` + * :c:data:`ao_pseudo_integrals_local` + * :c:data:`ao_pseudo_integrals_non_local` + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:func:`davidson_converged` + * :c:func:`davidson_diag_hjj_sjj` + * :c:data:`output_wall_time_0` + * :c:func:`pt2_collector` + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + * :c:func:`run_slave_main` + * :c:func:`write_time` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`system_clock` + + +.. c:function:: write_git_log: + + + File : :file:`utils/util.irp.f` + + .. code:: fortran + + subroutine write_git_log(iunit) + + + 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 000000000..18ffb8531 --- /dev/null +++ b/docs/source/modules/zmq.rst @@ -0,0 +1,1550 @@ +.. _module_zmq: + +.. program:: zmq + +.. default-role:: option + +=== +zmq +=== + +Definition of |ZeroMQ| sockets and messages. + + + + + +Providers +--------- + +.. c:var:: is_zmq_slave + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + logical :: is_zmq_slave + + + If |true|, the current process is a |ZeroMQ| slave. + + + +.. c:var:: qp_run_address + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + character*(128) :: qp_run_address + integer :: zmq_port_start + + + Address of the qp_run socket + Example : tcp://130.120.229.139:12345 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_socket_pull_tcp_address` + + +.. c:var:: zmq_context + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer(ZMQ_PTR) :: zmq_context + integer(omp_lock_kind) :: zmq_lock + + + Context for the ZeroMQ library + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_lock + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer(ZMQ_PTR) :: zmq_context + integer(omp_lock_kind) :: zmq_lock + + + Context for the ZeroMQ library + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_port_start + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + character*(128) :: qp_run_address + integer :: zmq_port_start + + + Address of the qp_run socket + Example : tcp://130.120.229.139:12345 + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_socket_pull_tcp_address` + + +.. c:var:: zmq_socket_pair_inproc_address + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + 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 + + + Socket which pulls the results (2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_socket_pull_inproc_address + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + 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 + + + Socket which pulls the results (2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_socket_pull_tcp_address + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + 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 + + + Socket which pulls the results (2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_socket_push_inproc_address + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + 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 + + + Socket which pulls the results (2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_socket_push_tcp_address + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + 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 + + + Socket which pulls the results (2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_socket_sub_tcp_address + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + 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 + + + Socket which pulls the results (2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + +.. c:var:: zmq_state + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + character*(128) :: zmq_state + + + Threads executing work through the ZeroMQ interface + + Needed by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + + + +Subroutines / functions +----------------------- + +.. c:function:: add_task_to_taskserver: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) + + + Get a task from the task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: connect_to_taskserver: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) + + + Connect to the task server and obtain the worker ID + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: disconnect_from_taskserver: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function disconnect_from_taskserver(zmq_to_qp_run_socket, worker_id) + + + Disconnect from the task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: disconnect_from_taskserver_state: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, state) + + + Disconnect from the task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: end_parallel_job: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) + + + End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`zmq_context` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:func:`h_s2_u_0_nstates_zmq` + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`end_zmq_pull_socket` + * :c:func:`end_zmq_to_qp_run_socket` + * :c:func:`lowercase` + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + * :c:func:`sleep` + + +.. c:function:: end_zmq_pair_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine end_zmq_pair_socket(zmq_socket_pair) + + + Terminate socket on which the results are sent. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_context` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: end_zmq_pull_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine end_zmq_pull_socket(zmq_socket_pull) + + + Terminate socket on which the results are sent. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_context` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`end_parallel_job` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: end_zmq_push_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine end_zmq_push_socket(zmq_socket_push,thread) + + + Terminate socket on which the results are sent. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_context` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`ao_two_e_integrals_erf_in_map_slave` + * :c:func:`ao_two_e_integrals_in_map_slave` + * :c:func:`davidson_run_slave` + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + * :c:func:`run_selection_slave` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: end_zmq_sub_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine end_zmq_sub_socket(zmq_socket_sub) + + + Terminate socket on which the results are sent. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_context` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`wait_for_next_state` + * :c:func:`wait_for_state` + * :c:func:`wait_for_states` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: end_zmq_to_qp_run_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) + + + Terminate the socket from the application to qp_run + + Called by: + + .. hlist:: + :columns: 3 + + * :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_in_map_collector` + * :c:func:`ao_two_e_integrals_in_map_slave` + * :c:func:`davidson_run_slave` + * :c:func:`end_parallel_job` + * :c:func:`pt2_collector` + * :c:func:`run_pt2_slave_large` + * :c:func:`run_pt2_slave_small` + * :c:func:`run_selection_slave` + * :c:func:`selection_collector` + + +.. c:function:: get_task_from_taskserver: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function get_task_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task) + + + Get a task from the task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: get_tasks_from_taskserver: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task,n_tasks) + + + Get multiple tasks from the task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: new_parallel_job: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) + + + Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`zmq_socket_pull_tcp_address` + * :c:data:`zmq_context` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:data:`ao_two_e_integrals_erf_in_map` + * :c:data:`ao_two_e_integrals_in_map` + * :c:func:`h_s2_u_0_nstates_zmq` + * :c:func:`zmq_pt2` + * :c:func:`zmq_selection` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`lowercase` + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: new_zmq_pair_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + function new_zmq_pair_socket(bind) + + + Socket on which the collector and the main communicate + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_socket_pull_tcp_address` + * :c:data:`zmq_context` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: new_zmq_pull_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + function new_zmq_pull_socket() + + + Socket on which the results are sent. If thread is 1, use inproc + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + * :c:data:`zmq_socket_pull_tcp_address` + * :c:data:`zmq_context` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + * :c:func:`sleep` + + +.. c:function:: new_zmq_push_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + function new_zmq_push_socket(thread) + + + Socket on which the results are sent. If thread is 1, use inproc + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_socket_pull_tcp_address` + * :c:data:`zmq_context` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: new_zmq_sub_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + function new_zmq_sub_socket() + + + Socket to read the state published by the Task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_socket_pull_tcp_address` + * :c:data:`zmq_context` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: new_zmq_to_qp_run_socket: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + function new_zmq_to_qp_run_socket() + + + Socket on which the qp_run process replies + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + * :c:data:`zmq_context` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`omp_set_lock` + * :c:func:`omp_unset_lock` + + +.. c:function:: reset_zmq_addresses: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine reset_zmq_addresses + + + Socket which pulls the results (2) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + * :c:data:`zmq_socket_pull_tcp_address` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`switch_qp_run_to_master` + + +.. c:function:: switch_qp_run_to_master: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine switch_qp_run_to_master + + + Address of the master qp_run socket + Example : tcp://130.120.229.139:12345 + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`is_zmq_slave` + * :c:data:`qp_run_address` + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_slave_cipsi` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`getenv` + * :c:func:`reset_zmq_addresses` + + +.. c:function:: task_done_to_taskserver: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function task_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id) + + + Get a task from the task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: tasks_done_to_taskserver: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function tasks_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id, n_tasks) + + + Get a task from the task server + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: wait_for_next_state: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine wait_for_next_state(state) + + + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`end_zmq_sub_socket` + + +.. c:function:: wait_for_state: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine wait_for_state(state_wait,state) + + + Wait for the ZMQ state to be ready + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`end_zmq_sub_socket` + + +.. c:function:: wait_for_states: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + subroutine wait_for_states(state_wait,state,n) + + + Wait for the ZMQ state to be ready + + Called by: + + .. hlist:: + :columns: 3 + + * :c:func:`run_slave_main` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`end_zmq_sub_socket` + + +.. c:function:: zmq_abort: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_abort(zmq_to_qp_run_socket) + + + Aborts a running parallel computation + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`sleep` + + +.. c:function:: zmq_delete_task: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_delete_task(zmq_to_qp_run_socket,zmq_socket_pull,task_id,more) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_delete_task_async_recv: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_delete_task_async_recv(zmq_to_qp_run_socket,more,sending) + + + 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_task_async_send: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_delete_task_async_send(zmq_to_qp_run_socket,task_id,sending) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_delete_tasks: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_delete_tasks_async_recv: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,more,sending) + + + 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: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_delete_tasks_async_send(zmq_to_qp_run_socket,task_id,n_tasks,sending) + + + 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. + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_get8_dvector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Get a float vector from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get8_ivector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Get a vector of integers from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_dmatrix: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + + Get a float vector from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_dvector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Get a float vector from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_i8matrix: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + + Get a float vector from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_imatrix: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + + Get a float vector from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_int: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get_int(zmq_to_qp_run_socket, worker_id, name, x) + + + Get a vector of integers from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_get_int_nompi: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get_int_nompi(zmq_to_qp_run_socket, worker_id, name, x) + + + Get a vector of integers from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_get_ivector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_get_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Get a vector of integers from the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + * :c:data:`mpi_master` + + +.. c:function:: zmq_port: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + function zmq_port(ishift) + + + Return the value of the ZMQ port from the corresponding integer + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`qp_run_address` + + +.. c:function:: zmq_put8_dvector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Put a float vector on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_put8_ivector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Put a vector of integers on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_dmatrix: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + + Put a float vector on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_dvector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Put a float vector on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_i8matrix: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + + Put a float vector on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_imatrix: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + + Put a float vector on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_int: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put_int(zmq_to_qp_run_socket, worker_id, name, x) + + + Put a vector of integers on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_put_ivector: + + + File : :file:`zmq/put_get.irp.f` + + .. code:: fortran + + integer function zmq_put_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + + Put a vector of integers on the qp_run scheduler + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`zmq_state` + + +.. c:function:: zmq_set_running: + + + File : :file:`zmq/utils.irp.f` + + .. code:: fortran + + integer function zmq_set_running(zmq_to_qp_run_socket) + + + 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 6d1946bd7..4faa03a1e 100644 --- a/docs/source/programmers_guide/index_providers.rst +++ b/docs/source/programmers_guide/index_providers.rst @@ -89,10 +89,14 @@ Index of Providers * :c:data:`aos_dsr_vc_beta_pbe_w` * :c:data:`aos_dsr_vx_alpha_pbe_w` * :c:data:`aos_dsr_vx_beta_pbe_w` +* :c:data:`aos_dsr_vxc_alpha_pbe_w` +* :c:data:`aos_dsr_vxc_beta_pbe_w` * :c:data:`aos_dvc_alpha_pbe_w` * :c:data:`aos_dvc_beta_pbe_w` * :c:data:`aos_dvx_alpha_pbe_w` * :c:data:`aos_dvx_beta_pbe_w` +* :c:data:`aos_dvxc_alpha_pbe_w` +* :c:data:`aos_dvxc_beta_pbe_w` * :c:data:`aos_grad_in_r_array` * :c:data:`aos_grad_in_r_array_transp` * :c:data:`aos_grad_in_r_array_transp_xyz` @@ -108,6 +112,10 @@ Index of Providers * :c:data:`aos_sr_vx_alpha_pbe_w` * :c:data:`aos_sr_vx_beta_lda_w` * :c:data:`aos_sr_vx_beta_pbe_w` +* :c:data:`aos_sr_vxc_alpha_lda_w` +* :c:data:`aos_sr_vxc_alpha_pbe_w` +* :c:data:`aos_sr_vxc_beta_lda_w` +* :c:data:`aos_sr_vxc_beta_pbe_w` * :c:data:`aos_vc_alpha_lda_w` * :c:data:`aos_vc_alpha_pbe_w` * :c:data:`aos_vc_beta_lda_w` @@ -116,6 +124,10 @@ Index of Providers * :c:data:`aos_vx_alpha_pbe_w` * :c:data:`aos_vx_beta_lda_w` * :c:data:`aos_vx_beta_pbe_w` +* :c:data:`aos_vxc_alpha_lda_w` +* :c:data:`aos_vxc_alpha_pbe_w` +* :c:data:`aos_vxc_beta_lda_w` +* :c:data:`aos_vxc_beta_pbe_w` * :c:data:`barycentric_electronic_energy` * :c:data:`big_array_coulomb_integrals` * :c:data:`big_array_exchange_integrals` @@ -207,8 +219,10 @@ Index of Providers * :c:data:`element_name` * :c:data:`energy_c` * :c:data:`energy_c_lda` -* :c:data:`energy_c_new_functional` +* :c:data:`energy_c_none` * :c:data:`energy_c_pbe` +* :c:data:`energy_c_sr_lda` +* :c:data:`energy_c_sr_pbe` * :c:data:`energy_iterations` * :c:data:`energy_sr_c_lda` * :c:data:`energy_sr_c_pbe` @@ -216,8 +230,10 @@ Index of Providers * :c:data:`energy_sr_x_pbe` * :c:data:`energy_x` * :c:data:`energy_x_lda` -* :c:data:`energy_x_new_functional` +* :c:data:`energy_x_none` * :c:data:`energy_x_pbe` +* :c:data:`energy_x_sr_lda` +* :c:data:`energy_x_sr_pbe` * :c:data:`exc_degree_per_selectors` * :c:data:`exchange_functional` * :c:data:`expected_s2` @@ -260,14 +276,6 @@ Index of Providers * :c:data:`give_polynomial_mult_center_one_e_erf_opt` * :c:data:`global_selection_buffer` * :c:data:`global_selection_buffer_lock` -* :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` -* :c:data:`grad_aos_dsr_vx_beta_pbe_w` -* :c:data:`grad_aos_dvc_alpha_pbe_w` -* :c:data:`grad_aos_dvc_beta_pbe_w` -* :c:data:`grad_aos_dvx_alpha_pbe_w` -* :c:data:`grad_aos_dvx_beta_pbe_w` * :c:data:`grid_points_per_atom` * :c:data:`grid_points_radial` * :c:data:`grid_type_sgn` @@ -330,7 +338,7 @@ Index of Providers * :c:data:`iradix_sort_big` * :c:data:`is_zmq_slave` * :c:data:`ks_energy` -* :c:data:`l_to_charater` +* :c:data:`l_to_character` * :c:data:`level_shift` * :c:data:`list_act` * :c:data:`list_act_reverse` @@ -449,6 +457,7 @@ Index of Providers * :c:data:`n_states_diag` * :c:data:`n_virt_orb` * :c:data:`n_virt_orb_allocate` +* :c:data:`no_core_density` * :c:data:`no_ivvv_integrals` * :c:data:`no_vvv_integrals` * :c:data:`no_vvvv_integrals` @@ -507,34 +516,72 @@ Index of Providers * :c:data:`output_wall_time_0` * :c:data:`overlap_gaussian_xyz` * :c:data:`phi_angular_integration_lebedev` +* :c:data:`pot_grad_c_alpha_ao_pbe` +* :c:data:`pot_grad_c_beta_ao_pbe` +* :c:data:`pot_grad_x_alpha_ao_pbe` +* :c:data:`pot_grad_x_beta_ao_pbe` +* :c:data:`pot_grad_xc_alpha_ao_pbe` +* :c:data:`pot_grad_xc_beta_ao_pbe` +* :c:data:`pot_scal_c_alpha_ao_pbe` +* :c:data:`pot_scal_c_beta_ao_pbe` +* :c:data:`pot_scal_x_alpha_ao_pbe` +* :c:data:`pot_scal_x_beta_ao_pbe` +* :c:data:`pot_scal_xc_alpha_ao_pbe` +* :c:data:`pot_scal_xc_beta_ao_pbe` +* :c:data:`pot_sr_grad_c_alpha_ao_pbe` +* :c:data:`pot_sr_grad_c_beta_ao_pbe` +* :c:data:`pot_sr_grad_x_alpha_ao_pbe` +* :c:data:`pot_sr_grad_x_beta_ao_pbe` +* :c:data:`pot_sr_grad_xc_alpha_ao_pbe` +* :c:data:`pot_sr_grad_xc_beta_ao_pbe` +* :c:data:`pot_sr_scal_c_alpha_ao_pbe` +* :c:data:`pot_sr_scal_c_beta_ao_pbe` +* :c:data:`pot_sr_scal_x_alpha_ao_pbe` +* :c:data:`pot_sr_scal_x_beta_ao_pbe` +* :c:data:`pot_sr_scal_xc_alpha_ao_pbe` +* :c:data:`pot_sr_scal_xc_beta_ao_pbe` * :c:data:`potential_c_alpha_ao` * :c:data:`potential_c_alpha_ao_lda` +* :c:data:`potential_c_alpha_ao_none` * :c:data:`potential_c_alpha_ao_pbe` +* :c:data:`potential_c_alpha_ao_sr_lda` +* :c:data:`potential_c_alpha_ao_sr_pbe` * :c:data:`potential_c_alpha_mo` * :c:data:`potential_c_beta_ao` * :c:data:`potential_c_beta_ao_lda` +* :c:data:`potential_c_beta_ao_none` * :c:data:`potential_c_beta_ao_pbe` +* :c:data:`potential_c_beta_ao_sr_lda` +* :c:data:`potential_c_beta_ao_sr_pbe` * :c:data:`potential_c_beta_mo` -* :c:data:`potential_new_functional_c_alpha_ao` -* :c:data:`potential_new_functional_c_beta_ao` -* :c:data:`potential_new_functional_x_alpha_ao` -* :c:data:`potential_new_functional_x_beta_ao` -* :c:data:`potential_sr_c_alpha_ao_lda` -* :c:data:`potential_sr_c_alpha_ao_pbe` -* :c:data:`potential_sr_c_beta_ao_lda` -* :c:data:`potential_sr_c_beta_ao_pbe` -* :c:data:`potential_sr_x_alpha_ao_lda` -* :c:data:`potential_sr_x_alpha_ao_pbe` -* :c:data:`potential_sr_x_beta_ao_lda` -* :c:data:`potential_sr_x_beta_ao_pbe` * :c:data:`potential_x_alpha_ao` * :c:data:`potential_x_alpha_ao_lda` +* :c:data:`potential_x_alpha_ao_none` * :c:data:`potential_x_alpha_ao_pbe` +* :c:data:`potential_x_alpha_ao_sr_lda` +* :c:data:`potential_x_alpha_ao_sr_pbe` * :c:data:`potential_x_alpha_mo` * :c:data:`potential_x_beta_ao` * :c:data:`potential_x_beta_ao_lda` +* :c:data:`potential_x_beta_ao_none` * :c:data:`potential_x_beta_ao_pbe` +* :c:data:`potential_x_beta_ao_sr_lda` +* :c:data:`potential_x_beta_ao_sr_pbe` * :c:data:`potential_x_beta_mo` +* :c:data:`potential_xc_alpha_ao` +* :c:data:`potential_xc_alpha_ao_lda` +* :c:data:`potential_xc_alpha_ao_none` +* :c:data:`potential_xc_alpha_ao_pbe` +* :c:data:`potential_xc_alpha_ao_sr_lda` +* :c:data:`potential_xc_alpha_ao_sr_pbe` +* :c:data:`potential_xc_alpha_mo` +* :c:data:`potential_xc_beta_ao` +* :c:data:`potential_xc_beta_ao_lda` +* :c:data:`potential_xc_beta_ao_none` +* :c:data:`potential_xc_beta_ao_pbe` +* :c:data:`potential_xc_beta_ao_sr_lda` +* :c:data:`potential_xc_beta_ao_sr_pbe` +* :c:data:`potential_xc_beta_mo` * :c:data:`pseudo_dz_k` * :c:data:`pseudo_dz_k_transp` * :c:data:`pseudo_dz_kl` @@ -659,6 +706,9 @@ Index of Providers * :c:data:`ref_bitmask` * :c:data:`ref_bitmask_e_n_energy` * :c:data:`ref_bitmask_energy` +* :c:data:`ref_bitmask_energy_aa` +* :c:data:`ref_bitmask_energy_ab` +* :c:data:`ref_bitmask_energy_bb` * :c:data:`ref_bitmask_kinetic_energy` * :c:data:`ref_bitmask_one_e_energy` * :c:data:`ref_bitmask_two_e_energy` @@ -677,6 +727,7 @@ Index of Providers * :c:data:`s_mo_coef` * :c:data:`s_z` * :c:data:`s_z2_sz` +* :c:data:`same_xc_func` * :c:data:`scf_algorithm` * :c:data:`scf_density_matrix_ao` * :c:data:`scf_density_matrix_ao_alpha` @@ -687,7 +738,6 @@ Index of Providers * :c:data:`selection_criterion_factor` * :c:data:`selection_criterion_min` * :c:data:`selection_weight` -* :c:data:`shifting_constant` * :c:data:`short_range_hartree` * :c:data:`short_range_hartree_operator` * :c:data:`single_exc_bitmask` @@ -718,11 +768,13 @@ Index of Providers * :c:data:`trace_v_h` * :c:data:`trace_v_hxc` * :c:data:`trace_v_xc` +* :c:data:`trace_v_xc_new` * :c:data:`transpose` * :c:data:`two_e_energy` * :c:data:`unpaired_alpha_electrons` * :c:data:`used_weight` * :c:data:`var_pt2_ratio` +* :c:data:`variance_max` * :c:data:`virt_bitmask` * :c:data:`virt_bitmask_4` * :c:data:`weight_at_r` @@ -1191,6 +1243,7 @@ Index of Subroutines/Functions * :c:func:`perturb_buffer_moller_plesset` * :c:func:`perturb_buffer_qdpt` * :c:func:`primitive_value` +* :c:func:`print_ci_vectors` * :c:func:`print_det` * :c:func:`print_e_conv` * :c:func:`print_extrapolated_energy` @@ -1341,15 +1394,11 @@ Index of Subroutines/Functions * :c:func:`wall_time` * :c:func:`wallis` * :c:func:`wf_of_psi_bilinear_matrix` -* :c:func:`write_ao_basis` * :c:func:`write_bool` * :c:func:`write_double` -* :c:func:`write_geometry` * :c:func:`write_git_log` * :c:func:`write_int` * :c:func:`write_integrals_erf` -* :c:func:`write_intro_gamess` -* :c:func:`write_mo_basis` * :c:func:`write_spindeterminants` * :c:func:`write_time` * :c:func:`zmq_abort` diff --git a/docs/source/programmers_guide/new_ks.rst b/docs/source/programmers_guide/new_ks.rst index c60db8c8c..e95fca878 100644 --- a/docs/source/programmers_guide/new_ks.rst +++ b/docs/source/programmers_guide/new_ks.rst @@ -28,72 +28,27 @@ So, at the end of the day, adding a new functional consists only in **setting a The general philosphy --------------------- -We have created a quite easy way to develop new functionals that is based on +The directory **functionals** contains only files ending with .irp.f whose name being the name of a specific functional. +All files in *a_functional*.irp.f **must** contain **at least** the following providers -* the used of **your own external plugins** +* :c:data:`energy_x_a_functional` and :c:data:`energy_c_a_functional` which are of course the exchange and correlation energies -* the module :ref:`module_new_functionals` acting as **hub** +* :c:data:`potential_x_alpha_ao_a_functional` and :c:data:`potential_x_beta_ao_a_functional` which are the exchange alpha/beta potentials -A pictorial representation of the main dependencies can be seen here: +* :c:data:`potential_c_alpha_ao_a_functional` and :c:data:`potential_c_beta_ao_a_functional` which are the correlation alpha/beta potentials - .. image:: /_static/dependencies_func.pdf - :align: center - :width: 200px - :alt: Summary of dependencies +For instance, the file :file:`sr_lda.irp.f` contains the following providers +* :c:data:`energy_x_sr_lda` and :c:data:`energy_c_sr_lda` which are of course the exchange and correlation energies -The main idea is the following: - - 1. Develop *new providers* for the new functionals (energy and potential for exchange and correlation) in some **external plugin**. - - * Example: - - * In an **external plugin** named **fancy_functionals**, you create *e_c_new_fancy_func* for the energy and *pot_ao_alpha_new_func* for the alpha potential - - * If you want to be able to use the |DFT| programs already available in the |QP|, these *providers* must use the providers for the density defined in :ref:`module_density_for_dft` and :ref:`module_dft_utils_in_r` (see below). - - - 2. Add the name of your **external plugin** to the :file:`NEED` in order to link your new providers to **new_functionals** - - * Example: - - * add **fancy_functionals** to the NEED file of **new_functionals** - - 3. Change the file :file:`e_xc_new_func.irp.f` and :file:`pot_xc_new_func.irp.f` to set the value of your new providers to the providers defined in **new_functionals** - - * Example: - - * for the exchange/correlation energy - - - .. code:: fortran - - BEGIN_PROVIDER[double precision, energy_x_new_functional, (N_states) ] - &BEGIN_PROVIDER[double precision, energy_c_new_functional, (N_states) ] - implicit none - BEGIN_DOC - ! energy_x_new_functional = define here your functional - ! energy_c_new_functional = define here your functional - END_DOC - energy_c_new_functional = e_c_new_fancy_func - energy_x_new_functional = e_x_new_fancy_func - - END_PROVIDER - - -4. Compile at the root of the |QP| - - * Example: - - - .. code:: bash - - cd ${QP_ROOT} - ninja - - -5. When you want to execute a program with your new functional, just set the options :option:`dft_keywords exchange_functional` and :option:`dft_keywords correlation_functional` to "my_functional". +* :c:data:`potential_x_alpha_ao_sr_lda` and :c:data:`potential_x_beta_ao_sr_lda` which are the exchange alpha/beta potentials + +* :c:data:`potential_c_alpha_ao_sr_lda` and :c:data:`potential_c_beta_ao_sr_lda` which are the correlation alpha/beta potentials + + +Therefore, if you want to develop a new functional, just design a provider +To use a functional Using the density for DFT calculations in the |QP| ================================================== diff --git a/docs/source/programmers_guide/programming.rst b/docs/source/programmers_guide/programming.rst index 56e327079..cc3499900 100644 --- a/docs/source/programmers_guide/programming.rst +++ b/docs/source/programmers_guide/programming.rst @@ -72,11 +72,40 @@ file by hand. Running :command:`ninja` inside a module will compile only the module, and running :command:`ninja` at the root of the |qp| will build all the modules, as well as the tools. -.. cache compile -.. interface AOs / MOs => resultsFile -.. interface integrals => AO / MO -.. interface integrals MO => FCIDUMP -.. TODO : molden module in resultsFile -.. include:: /work.rst +Algorithms +========== + +The `PhD thesis of Yann Garniron `_ +gives all the details about the implementation of: + +* The data structure for the two-electron integrals (:file:`utils/map_module.f`) +* The Davdison diagonalization (module :ref:`module_davidson`) +* The CIPSI selection (module :ref:`module_cipsi`) +* The hybrid stochastic/deterministic PT2 correction (module :ref:`module_cipsi`) +* The hybrid stochastic/deterministic matrix dressing (module :ref:`module_dressing`) + + +Extracting results for use with other codes +=========================================== + +The |AOs| and |MOs| can be seen with :ref:`qp_edit`. We also provide a utility +to create a file which can be read by `molden` for visualizing the |MOs| (see +:ref:`molden`). For using external |CI| solvers, we provide a utility that +generates a file containing the two-electron integrals in the |MO| basis set +in the `FCIDUMP` format (see :ref:`fcidump`). + +All the results are stored in the |EZFIO| directory, so users willing to fetch +data such as the |MOs| or the |CI| coefficients should use the |EZFIO| API. +There multiple major ways to do this: + +* Write a script in Python or OCaml and use the Python |EZFIO| API. The script + :file:`$QP_ROOT/bin/qp_convert_output_to_ezfio` is a good example to understand + how to use the |EZFIO| API in Python, +* Write an independent program in Fortran or C, link it with the |EZFIO| library + located at :file:`$QP_ROOT/external/ezfio/lib/libezfio.a` and call directly + the |EZFIO| routines, +* Write a new module for the |qp| printing the desired quantities in a suitable + text format. The program :ref:`fcidump` is an example of such a program. + diff --git a/docs/source/programs/.gitignore b/docs/source/programs/.gitignore index e69de29bb..8b1378917 100644 --- a/docs/source/programs/.gitignore +++ b/docs/source/programs/.gitignore @@ -0,0 +1 @@ + diff --git a/docs/source/programs/fci.rst b/docs/source/programs/fci.rst index 2eb25a754..c5717b1ad 100644 --- a/docs/source/programs/fci.rst +++ b/docs/source/programs/fci.rst @@ -60,7 +60,6 @@ fci :columns: 3 * :c:func:`run_cipsi` - * :c:func:`run_slave_cipsi` * :c:func:`run_stochastic_cipsi` Touches: @@ -73,9 +72,9 @@ fci * :c:data:`ci_energy` * :c:data:`ci_electronic_energy` * :c:data:`n_det` + * :c:data:`n_iter` * :c:data:`psi_occ_pattern` * :c:data:`c0_weight` - * :c:data:`distributed_davidson` * :c:data:`psi_coef` * :c:data:`psi_det_sorted_bit` * :c:data:`psi_det` @@ -84,8 +83,6 @@ fci * :c:data:`psi_energy` * :c:data:`psi_occ_pattern` * :c:data:`psi_energy` - * :c:data:`pt2_e0_denominator` * :c:data:`pt2_stoch_istate` - * :c:data:`read_wf` * :c:data:`state_average_weight` * :c:data:`threshold_generators` diff --git a/docs/source/programs/molden.rst b/docs/source/programs/molden.rst index 9611bac02..9c1f9249f 100644 --- a/docs/source/programs/molden.rst +++ b/docs/source/programs/molden.rst @@ -16,14 +16,26 @@ molden .. hlist:: :columns: 3 + * :c:data:`nucl_list_shell_aos` + * :c:data:`mo_occ` * :c:data:`ezfio_filename` + * :c:data:`mo_coef` + * :c:data:`ao_coef` + * :c:data:`ao_power` + * :c:data:`fock_matrix_mo` + * :c:data:`ao_num` + * :c:data:`ao_prim_num` + * :c:data:`mo_num` + * :c:data:`nucl_coord` + * :c:data:`ao_l` + * :c:data:`nucl_charge` + * :c:data:`ao_expo` + * :c:data:`element_name` + * :c:data:`nucl_num` Calls: .. hlist:: :columns: 3 - * :c:func:`write_ao_basis` - * :c:func:`write_geometry` - * :c:func:`write_intro_gamess` - * :c:func:`write_mo_basis` + * :c:func:`isort` diff --git a/docs/source/programs/print_ci_vectors.rst b/docs/source/programs/print_ci_vectors.rst new file mode 100644 index 000000000..2561a7473 --- /dev/null +++ b/docs/source/programs/print_ci_vectors.rst @@ -0,0 +1,41 @@ +.. _print_ci_vectors: + +.. program:: print_ci_vectors + +================ +print_ci_vectors +================ + + + + + Print the ground state wave function stored in the |EZFIO| directory + 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 :) + + Needs: + + .. hlist:: + :columns: 3 + + * :c:data:`read_wf` + + Calls: + + .. hlist:: + :columns: 3 + + * :c:func:`routine` + + Touches: + + .. hlist:: + :columns: 3 + + * :c:data:`read_wf` diff --git a/docs/source/research.bib b/docs/source/research.bib index cf56f2d1e..f22ca6828 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -1,4 +1,14 @@ %%% ARXIV TO BE UPDATED %%% +@misc{BibEntry2019Feb, + title = {{Quantum Package 2.0: An Open-Source Determinant-Driven Suite of +Programs}}, + journal = {arXiv}, + year = {2019}, + month = {Feb}, + note = {[Online; accessed 7. Mar. 2019]}, + url = {https://arxiv.org/abs/1902.08154.pdf} +} + @article{Applencourt2018Dec, author = {Applencourt, Thomas and Gasperich, Kevin and Scemama, Anthony}, title = {{Spin adaptation with determinant-based selected configuration interaction}}, @@ -9,32 +19,35 @@ @article{Applencourt2018Dec url = {https://arxiv.org/abs/1812.06902} } -@article{Loos2018Nov, - author = {Loos, Pierre-Fran{\c{c}}ois and Boggio-Pasqua, Martial and Scemama, Anthony and Caffarel, Michel and Jacquemin, Denis}, +@article{Loos2019Jan, + author = {Loos, Pierre-Fran\c{c}ois and Boggio-Pasqua, Martial and Scemama, Anthony and Caffarel, Michel and Jacquemin, Denis}, title = {{Reference Energies for Double Excitations}}, - journal = {arXiv}, - year = {2018}, - month = {Nov}, - pages = {1811.12861}, - url = {https://arxiv.org/abs/1811.12861} + journal = {J. Chem. Theory Comput.}, + year = {2019}, + month = {Jan}, + issn = {1549-9618}, + publisher = {American Chemical Society}, + doi = {10.1021/acs.jctc.8b01205} } -@article{Flores2018Nov, - author = { {Pineda Flores}, Sergio D. and Neuscamman, Eric}, - title = {{Excited State Specific Multi-Slater Jastrow Wave Functions}}, - journal = {arXiv}, - year = {2018}, - month = {Nov}, - pages = {1811.00583}, - url = {https://arxiv.org/abs/1811.00583} -} - - - %%%% PUBLISHED PAPERS +@article{PinedaFlores2019Feb, + author = {Pineda Flores, Sergio and Neuscamman, Eric}, + title = {{Excited State Specific Multi-Slater Jastrow Wave Functions}}, + journal = {J. Phys. Chem. A}, + volume = {123}, + number = {8}, + pages = {1487--1497}, + year = {2019}, + month = {Feb}, + issn = {1089-5639}, + publisher = {American Chemical Society}, + doi = {10.1021/acs.jpca.8b10671} +} + @phdthesis{yann_garniron_2019_2558127, author = {Yann Garniron}, title = {{Development and parallel implementation of diff --git a/docs/source/users_guide/qp_create_ezfio_from_xyz.rst b/docs/source/users_guide/qp_create_ezfio.rst similarity index 100% rename from docs/source/users_guide/qp_create_ezfio_from_xyz.rst rename to docs/source/users_guide/qp_create_ezfio.rst diff --git a/docs/source/work.rst b/docs/source/work.rst deleted file mode 100644 index 3d7291f7e..000000000 --- a/docs/source/work.rst +++ /dev/null @@ -1,3 +0,0 @@ - -.. image:: http://craniointernational.com/wp-content/uploads/2018/01/work-in-progress.jpg - diff --git a/man/cis.1 b/man/cis.1 index 9a2a30667..5bfa50454 100644 --- a/man/cis.1 +++ b/man/cis.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "CIS" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "CIS" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME cis \- | Quantum Package > . diff --git a/man/cisd.1 b/man/cisd.1 index 5582daa26..e123534f9 100644 --- a/man/cisd.1 +++ b/man/cisd.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "CISD" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "CISD" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME cisd \- | Quantum Package > . diff --git a/man/configure.1 b/man/configure.1 index b6a942e70..97b74e0d1 100644 --- a/man/configure.1 +++ b/man/configure.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "CONFIGURE" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "CONFIGURE" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME configure \- | Quantum Package > . diff --git a/man/diagonalize_h.1 b/man/diagonalize_h.1 index 10c37a64b..ba943f6c1 100644 --- a/man/diagonalize_h.1 +++ b/man/diagonalize_h.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "DIAGONALIZE_H" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "DIAGONALIZE_H" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME diagonalize_h \- | Quantum Package > . diff --git a/man/excited_states.1 b/man/excited_states.1 index 8ed063bab..99199ffdf 100644 --- a/man/excited_states.1 +++ b/man/excited_states.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "EXCITED_STATES" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "EXCITED_STATES" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME excited_states \- | Quantum Package > . diff --git a/man/fci.1 b/man/fci.1 index 18a888f50..389f6453c 100644 --- a/man/fci.1 +++ b/man/fci.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "FCI" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "FCI" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME fci \- | Quantum Package > . @@ -98,11 +98,9 @@ Calls: .UNINDENT .INDENT 2.0 .IP \(bu 2 -\fBrun_slave_cipsi()\fP +\fBrun_stochastic_cipsi()\fP .UNINDENT .INDENT 2.0 -.IP \(bu 2 -\fBrun_stochastic_cipsi()\fP .UNINDENT .UNINDENT .sp @@ -120,13 +118,13 @@ Touches: .IP \(bu 2 \fBn_det\fP .IP \(bu 2 -\fBpsi_occ_pattern\fP +\fBn_iter\fP .IP \(bu 2 -\fBc0_weight\fP +\fBpsi_occ_pattern\fP .UNINDENT .INDENT 2.0 .IP \(bu 2 -\fBdistributed_davidson\fP +\fBc0_weight\fP .IP \(bu 2 \fBpsi_coef\fP .IP \(bu 2 @@ -137,21 +135,17 @@ Touches: \fBpsi_det_size\fP .IP \(bu 2 \fBpsi_det_sorted_bit\fP -.IP \(bu 2 -\fBpsi_energy\fP .UNINDENT .INDENT 2.0 .IP \(bu 2 +\fBpsi_energy\fP +.IP \(bu 2 \fBpsi_occ_pattern\fP .IP \(bu 2 \fBpsi_energy\fP .IP \(bu 2 -\fBpt2_e0_denominator\fP -.IP \(bu 2 \fBpt2_stoch_istate\fP .IP \(bu 2 -\fBread_wf\fP -.IP \(bu 2 \fBstate_average_weight\fP .IP \(bu 2 \fBthreshold_generators\fP diff --git a/man/fcidump.1 b/man/fcidump.1 index 0b979f8dd..93d87dddb 100644 --- a/man/fcidump.1 +++ b/man/fcidump.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "FCIDUMP" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "FCIDUMP" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME fcidump \- | Quantum Package > . diff --git a/man/four_idx_transform.1 b/man/four_idx_transform.1 index f6fc27c8e..a909c5240 100644 --- a/man/four_idx_transform.1 +++ b/man/four_idx_transform.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "FOUR_IDX_TRANSFORM" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "FOUR_IDX_TRANSFORM" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME four_idx_transform \- | Quantum Package > . diff --git a/man/interfaces.1 b/man/interfaces.1 index 37166bc21..c3f6625ca 100644 --- a/man/interfaces.1 +++ b/man/interfaces.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "INTERFACES" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "INTERFACES" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME interfaces \- | Quantum Package > . diff --git a/man/ks_scf.1 b/man/ks_scf.1 index 9bbd6c942..1b2651ca1 100644 --- a/man/ks_scf.1 +++ b/man/ks_scf.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KS_SCF" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "KS_SCF" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME ks_scf \- | Quantum Package > . diff --git a/man/molden.1 b/man/molden.1 index b22c8ffc5..5cc2824ee 100644 --- a/man/molden.1 +++ b/man/molden.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "MOLDEN" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "MOLDEN" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME molden \- | Quantum Package > . @@ -38,11 +38,41 @@ Needs: .INDENT 0.0 .INDENT 2.0 .IP \(bu 2 +\fBnucl_list_shell_aos\fP +.IP \(bu 2 +\fBmo_occ\fP +.IP \(bu 2 \fBezfio_filename\fP +.IP \(bu 2 +\fBmo_coef\fP +.IP \(bu 2 +\fBao_coef\fP +.IP \(bu 2 +\fBao_power\fP .UNINDENT .INDENT 2.0 +.IP \(bu 2 +\fBfock_matrix_mo\fP +.IP \(bu 2 +\fBao_num\fP +.IP \(bu 2 +\fBao_prim_num\fP +.IP \(bu 2 +\fBmo_num\fP +.IP \(bu 2 +\fBnucl_coord\fP .UNINDENT .INDENT 2.0 +.IP \(bu 2 +\fBao_l\fP +.IP \(bu 2 +\fBnucl_charge\fP +.IP \(bu 2 +\fBao_expo\fP +.IP \(bu 2 +\fBelement_name\fP +.IP \(bu 2 +\fBnucl_num\fP .UNINDENT .UNINDENT .sp @@ -50,17 +80,11 @@ Calls: .INDENT 0.0 .INDENT 2.0 .IP \(bu 2 -\fBwrite_ao_basis()\fP -.IP \(bu 2 -\fBwrite_geometry()\fP +\fBisort()\fP .UNINDENT .INDENT 2.0 -.IP \(bu 2 -\fBwrite_intro_gamess()\fP .UNINDENT .INDENT 2.0 -.IP \(bu 2 -\fBwrite_mo_basis()\fP .UNINDENT .UNINDENT .UNINDENT diff --git a/man/natural_orbitals.1 b/man/natural_orbitals.1 index 2499aa69f..0d89070a7 100644 --- a/man/natural_orbitals.1 +++ b/man/natural_orbitals.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "NATURAL_ORBITALS" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "NATURAL_ORBITALS" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME natural_orbitals \- | Quantum Package > . diff --git a/man/plugins.1 b/man/plugins.1 index 080021c81..d1c319a24 100644 --- a/man/plugins.1 +++ b/man/plugins.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "PLUGINS" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "PLUGINS" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME plugins \- | Quantum Package > . diff --git a/man/print_e_conv.1 b/man/print_e_conv.1 index 466a58aba..fb65e3550 100644 --- a/man/print_e_conv.1 +++ b/man/print_e_conv.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "PRINT_E_CONV" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "PRINT_E_CONV" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME print_e_conv \- | Quantum Package > . diff --git a/man/print_wf.1 b/man/print_wf.1 index 913e69c04..bc2fa5701 100644 --- a/man/print_wf.1 +++ b/man/print_wf.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "PRINT_WF" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "PRINT_WF" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME print_wf \- | Quantum Package > . diff --git a/man/printing.1 b/man/printing.1 index 44266cc6b..fd3c6026c 100644 --- a/man/printing.1 +++ b/man/printing.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "PRINTING" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "PRINTING" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME printing \- | Quantum Package > . diff --git a/man/pt2.1 b/man/pt2.1 index edc6a8def..e54469fe5 100644 --- a/man/pt2.1 +++ b/man/pt2.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "PT2" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "PT2" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME pt2 \- | Quantum Package > . diff --git a/man/qp_convert_output_to_ezfio.1 b/man/qp_convert_output_to_ezfio.1 index 404345938..d5f6f147a 100644 --- a/man/qp_convert_output_to_ezfio.1 +++ b/man/qp_convert_output_to_ezfio.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_CONVERT_OUTPUT_TO_EZFIO" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_CONVERT_OUTPUT_TO_EZFIO" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_convert_output_to_ezfio \- | Quantum Package > . diff --git a/man/qp_create_ezfio_from_xyz.1 b/man/qp_create_ezfio_from_xyz.1 deleted file mode 100644 index 2c70fd7bb..000000000 --- a/man/qp_create_ezfio_from_xyz.1 +++ /dev/null @@ -1,235 +0,0 @@ -.\" Man page generated from reStructuredText. -. -.TH "QP_CREATE_EZFIO_FROM_XYZ" "1" "Feb 06, 2019" "2.0" "Quantum Package" -.SH NAME -qp_create_ezfio_from_xyz \- | Quantum Package > -. -.nr rst2man-indent-level 0 -. -.de1 rstReportMargin -\\$1 \\n[an-margin] -level \\n[rst2man-indent-level] -level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] -- -\\n[rst2man-indent0] -\\n[rst2man-indent1] -\\n[rst2man-indent2] -.. -.de1 INDENT -.\" .rstReportMargin pre: -. RS \\$1 -. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] -. nr rst2man-indent-level +1 -.\" .rstReportMargin post: -.. -.de UNINDENT -. RE -.\" indent \\n[an-margin] -.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] -.nr rst2man-indent-level -1 -.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] -.in \\n[rst2man-indent\\n[rst2man-indent-level]]u -.. -.sp -This command creates an \fI\%EZFIO\fP directory from a standard \fIxyz\fP file or -from a \fIz\-matrix\fP file in Gaussian format. -.SH USAGE -.INDENT 0.0 -.INDENT 3.5 -.sp -.nf -.ft C -qp_create_ezfio [\-a] \-b [\-c ] [\-d ] - [\-h] [\-m ] [\-o EZFIO_DIR] [\-p ] [\-x] [\-\-] FILE -.ft P -.fi -.UNINDENT -.UNINDENT -.INDENT 0.0 -.TP -.B \-a, \-\-au -If present, input geometry is in atomic units. -.UNINDENT -.INDENT 0.0 -.TP -.B \-b, \-\-basis= -Name of basis set. The basis set is defined as a single string if -all the atoms are taken from the same basis set, otherwise specific -elements can be defined as follows: -.INDENT 7.0 -.INDENT 3.5 -.sp -.nf -.ft C -\-b "cc\-pcvdz | H:cc\-pvdz | C:6\-31g" -\-b "cc\-pvtz | 1,H:sto\-3g | 3,H:6\-31g" -.ft P -.fi -.UNINDENT -.UNINDENT -.sp -By default, the basis set is obtained from the local database of the. -\fIQuantum Package\fP This option is mandatory . -.sp -If \fB\fP is set to \fBshow\fP, the list of all available basis -sets is displayed. -.UNINDENT -.INDENT 0.0 -.TP -.B \-c, \-\-charge= -Total charge of the molecule. Default is 0. -.UNINDENT -.INDENT 0.0 -.TP -.B \-d, \-\-dummy= -Add dummy atoms (X) between atoms when the distance between two atoms -is less than x \etimes \esum R_\emathrm{cov}, the covalent radii -of the atoms. The default is x=0, so no dummy atom is added. -.UNINDENT -.INDENT 0.0 -.TP -.B \-h, \-\-help -Print the help text and exit -.UNINDENT -.INDENT 0.0 -.TP -.B \-m, \-\-multiplicity= -Spin multiplicity 2S+1 of the molecule. Default is 1. -.UNINDENT -.INDENT 0.0 -.TP -.B \-o, \-\-output=EZFIO_DIR -Name of the created \fI\%EZFIO\fP directory. -.UNINDENT -.INDENT 0.0 -.TP -.B \-p , \-\-pseudo= -Name of the pseudo\-potential. Follows the same conventions as the basis set. -.UNINDENT -.INDENT 0.0 -.TP -.B \-x, \-\-cart -Compute AOs in the Cartesian basis set (6d, 10f, …) -.UNINDENT -.SH USING CUSTOM ATOMIC BASIS SETS -.sp -If a file with the same name as the basis set exists, this file will -be read. For example, if the file containing the basis set is named -\fBcustom.basis\fP, and the \fIxyz\fP geometry is in \fBmolecule.xyz\fP, the -following should be used: -.INDENT 0.0 -.INDENT 3.5 -.sp -.nf -.ft C -qp_create_ezfio \-b custom.basis molecule.xyz -.ft P -.fi -.UNINDENT -.UNINDENT -.sp -Basis set files should be given in \fI\%GAMESS\fP format, where the full -names of the atoms are given, and the basis sets for each element are -separated by a blank line. Here is an example -.INDENT 0.0 -.INDENT 3.5 -.sp -.nf -.ft C -HYDROGEN -S 3 -1 13.0100000 0.0196850 -2 1.9620000 0.1379770 -3 0.4446000 0.4781480 -S 1 -1 0.1220000 1.0000000 -P 1 -1 0.7270000 1.0000000 - -BORON -S 8 -1 4570.0000000 0.0006960 -2 685.9000000 0.0053530 -3 156.5000000 0.0271340 -4 44.4700000 0.1013800 -5 14.4800000 0.2720550 -6 5.1310000 0.4484030 -7 1.8980000 0.2901230 -8 0.3329000 0.0143220 -S 8 -1 4570.0000000 \-0.0001390 -2 685.9000000 \-0.0010970 -3 156.5000000 \-0.0054440 -4 44.4700000 \-0.0219160 -5 14.4800000 \-0.0597510 -6 5.1310000 \-0.1387320 -7 1.8980000 \-0.1314820 -8 0.3329000 0.5395260 -S 1 -1 0.1043000 1.0000000 -P 3 -1 6.0010000 0.0354810 -2 1.2410000 0.1980720 -3 0.3364000 0.5052300 -P 1 -1 0.0953800 1.0000000 -D 1 -1 0.3430000 1.0000000 -.ft P -.fi -.UNINDENT -.UNINDENT -.SH USING CUSTOM PSEUDO-POTENTIALS -.sp -As for the basis set, if a file with the same name as the -pseudo\-potential exists, this file will be read. For example, if the -file containing the custom pseudo\-potential is named \fBcustom.pseudo\fP, -the basis set is named \fBcustom.basis\fP, and the \fIxyz\fP geometry is in -\fBmolecule.xyz\fP, the following command should be used -.INDENT 0.0 -.INDENT 3.5 -.sp -.nf -.ft C -qp_create_ezfio \-b custom.basis \-p custom.pseudo molecule.xyz -.ft P -.fi -.UNINDENT -.UNINDENT -.sp -Pseudo\-potential files should be given in a format very close to -\fI\%GAMESS\fP format. The first line should be formatted as \fB%s GEN %d %d\fP -where the first string is the chemical symbol, the first integer is -the number of core electrons to be removed and the second integer is -LMAX+1 as in \fI\%GAMESS\fP format. The pseudo\-potential for each element are -separated by a blank line. Here is an example -.INDENT 0.0 -.INDENT 3.5 -.sp -.nf -.ft C -Ne GEN 2 1 -3 -8.00000000 1 10.74945199 -85.99561593 3 10.19801460 -\-56.79004456 2 10.18694048 -1 -55.11144535 2 12.85042963 - -F GEN 2 1 -3 -7.00000000 1 11.39210685 -79.74474797 3 10.74911370 -\-49.45159098 2 10.45120693 -1 -50.25646328 2 11.30345826 -.ft P -.fi -.UNINDENT -.UNINDENT -.SH AUTHOR -A. Scemama, E. Giner -.SH COPYRIGHT -2019, A. Scemama, E. Giner -.\" Generated by docutils manpage writer. -. diff --git a/man/qp_edit.1 b/man/qp_edit.1 index fa0791cfb..94b8cb7a4 100644 --- a/man/qp_edit.1 +++ b/man/qp_edit.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_EDIT" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_EDIT" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_edit \- | Quantum Package > . diff --git a/man/qp_export_as_tgz.1 b/man/qp_export_as_tgz.1 index d7e2e6bad..f5d93a017 100644 --- a/man/qp_export_as_tgz.1 +++ b/man/qp_export_as_tgz.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_EXPORT_AS_TGZ" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_EXPORT_AS_TGZ" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_export_as_tgz \- | Quantum Package > . diff --git a/man/qp_plugins.1 b/man/qp_plugins.1 index 6392f38a1..890f72546 100644 --- a/man/qp_plugins.1 +++ b/man/qp_plugins.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_PLUGINS" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_PLUGINS" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_plugins \- | Quantum Package > . diff --git a/man/qp_reset.1 b/man/qp_reset.1 index cef0818f4..c9481bda5 100644 --- a/man/qp_reset.1 +++ b/man/qp_reset.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_RESET" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_RESET" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_reset \- | Quantum Package > . diff --git a/man/qp_run.1 b/man/qp_run.1 index 59ca72eaa..583bce631 100644 --- a/man/qp_run.1 +++ b/man/qp_run.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_RUN" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_RUN" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_run \- | Quantum Package > . diff --git a/man/qp_set_frozen_core.1 b/man/qp_set_frozen_core.1 index 13bbae1f8..2e8ab3f42 100644 --- a/man/qp_set_frozen_core.1 +++ b/man/qp_set_frozen_core.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_SET_FROZEN_CORE" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_SET_FROZEN_CORE" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_set_frozen_core \- | Quantum Package > . diff --git a/man/qp_set_mo_class.1 b/man/qp_set_mo_class.1 index 3ebed3fc9..3dc3cb76c 100644 --- a/man/qp_set_mo_class.1 +++ b/man/qp_set_mo_class.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_SET_MO_CLASS" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_SET_MO_CLASS" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_set_mo_class \- | Quantum Package > . diff --git a/man/qp_stop.1 b/man/qp_stop.1 index 9d060b2dd..f183cd2a1 100644 --- a/man/qp_stop.1 +++ b/man/qp_stop.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_STOP" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_STOP" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_stop \- | Quantum Package > . diff --git a/man/qp_update.1 b/man/qp_update.1 index eb4f0f7ed..2270b0d0a 100644 --- a/man/qp_update.1 +++ b/man/qp_update.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QP_UPDATE" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QP_UPDATE" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qp_update \- | Quantum Package > . diff --git a/man/qpsh.1 b/man/qpsh.1 index aabd57725..6ece5c35e 100644 --- a/man/qpsh.1 +++ b/man/qpsh.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "QPSH" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "QPSH" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME qpsh \- | Quantum Package > . diff --git a/man/rs_ks_scf.1 b/man/rs_ks_scf.1 index f0066ebd6..2c54c2ef9 100644 --- a/man/rs_ks_scf.1 +++ b/man/rs_ks_scf.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "RS_KS_SCF" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "RS_KS_SCF" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME rs_ks_scf \- | Quantum Package > . diff --git a/man/save_natorb.1 b/man/save_natorb.1 index 3a8d60959..3f14b228f 100644 --- a/man/save_natorb.1 +++ b/man/save_natorb.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "SAVE_NATORB" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "SAVE_NATORB" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME save_natorb \- | Quantum Package > . diff --git a/man/save_one_e_dm.1 b/man/save_one_e_dm.1 index f9c2c3c11..f49acb7a0 100644 --- a/man/save_one_e_dm.1 +++ b/man/save_one_e_dm.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "SAVE_ONE_E_DM" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "SAVE_ONE_E_DM" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME save_one_e_dm \- | Quantum Package > . diff --git a/man/save_ortho_mos.1 b/man/save_ortho_mos.1 index b37ea4516..0874c79af 100644 --- a/man/save_ortho_mos.1 +++ b/man/save_ortho_mos.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "SAVE_ORTHO_MOS" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "SAVE_ORTHO_MOS" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME save_ortho_mos \- | Quantum Package > . diff --git a/man/scf.1 b/man/scf.1 index fc70eb9ec..1817bebc3 100644 --- a/man/scf.1 +++ b/man/scf.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "SCF" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "SCF" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME scf \- | Quantum Package > . diff --git a/man/write_integrals_erf.1 b/man/write_integrals_erf.1 index 3b17c07b3..e863c4782 100644 --- a/man/write_integrals_erf.1 +++ b/man/write_integrals_erf.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "WRITE_INTEGRALS_ERF" "1" "Feb 06, 2019" "2.0" "Quantum Package" +.TH "WRITE_INTEGRALS_ERF" "1" "Mar 07, 2019" "2.0" "Quantum Package" .SH NAME write_integrals_erf \- | Quantum Package > . diff --git a/ocaml/TaskServer.ml b/ocaml/TaskServer.ml index 763498440..0d457e385 100644 --- a/ocaml/TaskServer.ml +++ b/ocaml/TaskServer.ml @@ -1,8 +1,5 @@ -open Core open Qptypes -module StringHashtbl = Hashtbl.Make(String) - type pub_state = | Waiting | Running of string @@ -29,15 +26,15 @@ type t = progress_bar : Progress_bar.t option ; running : bool; accepting_clients : bool; - data : string StringHashtbl.t; + data : (string, string) Hashtbl.t; } let debug_env = - match Sys.getenv "QP_TASK_DEBUG" with - | Some x -> x <> "" - | None -> false + try + Sys.getenv "QP_TASK_DEBUG"; true + with Not_found -> false let debug str = @@ -64,7 +61,7 @@ let bind_socket ~socket_type ~socket ~port = Zmq.Socket.bind socket @@ Printf.sprintf "tcp://*:%d" port; loop (-1) with - | Unix.Unix_error _ -> (Time.pause @@ Time.Span.of_sec 1. ; loop (i-1) ) + | Unix.Unix_error _ -> (Unix.sleep 1 ; loop (i-1) ) | other_exception -> raise other_exception in loop 60 @@ -77,28 +74,34 @@ let hostname = lazy ( ) +external get_ipv4_address_for_interface : string -> string = + "get_ipv4_address_for_interface" ;; + let ip_address = lazy ( - match Sys.getenv "QP_NIC" with + let interface = + try Some (Sys.getenv "QP_NIC") + with Not_found -> None + in + match interface with | None -> begin try - Lazy.force hostname - |> Unix.Inet_addr.of_string_or_getbyname - |> Unix.Inet_addr.to_string + let host = + Lazy.force hostname + |> Unix.gethostbyname + in + Unix.string_of_inet_addr host.h_addr_list.(0); with | Unix.Unix_error _ -> failwith "Unable to find IP address from host name." end | Some interface -> - begin - try - ok_exn Linux_ext.get_ipv4_address_for_interface interface - with - | Unix.Unix_error _ -> - Lazy.force hostname - |> Unix.Inet_addr.of_string_or_getbyname - |> Unix.Inet_addr.to_string - end + let result = get_ipv4_address_for_interface interface in + if String.sub result 0 5 = "error" then + Printf.sprintf "Unable to use network interface %s" interface + |> failwith + else + result ) @@ -209,7 +212,7 @@ let end_job msg program_state rep_socket pair_socket = address_inproc = None; running = true; accepting_clients = false; - data = StringHashtbl.create (); + data = Hashtbl.create 23; } and wait n = @@ -335,8 +338,10 @@ let del_task msg program_state rep_socket = and success () = let queue = - List.fold ~f:(fun queue task_id -> Queuing_system.del_task ~task_id queue) - ~init:program_state.queue task_ids + List.fold_left + (fun queue task_id -> Queuing_system.del_task ~task_id queue) + program_state.queue + task_ids in let accepting_clients = (Queuing_system.number_of_queued queue > Queuing_system.number_of_clients queue) @@ -382,11 +387,12 @@ let add_task msg program_state rep_socket = in let result = - let new_queue, new_bar = - List.fold ~f:(fun (queue, bar) task -> - Queuing_system.add_task ~task queue, - increment_progress_bar bar) - ~init:(program_state.queue, program_state.progress_bar) tasks + let new_queue, new_bar = + List.fold_left (fun (queue, bar) task -> + Queuing_system.add_task ~task queue, + increment_progress_bar bar) + (program_state.queue, program_state.progress_bar) + tasks in { program_state with queue = new_queue; @@ -547,10 +553,11 @@ let task_done msg program_state rep_socket = and success () = let new_queue, new_bar = - List.fold ~f:(fun (queue, bar) task_id -> + List.fold_left (fun (queue, bar) task_id -> Queuing_system.end_task ~task_id ~client_id queue, increment_progress_bar bar) - ~init:(program_state.queue, program_state.progress_bar) task_ids + (program_state.queue, program_state.progress_bar) + task_ids in let accepting_clients = @@ -593,7 +600,7 @@ let put_data msg rest_of_msg program_state rep_socket = in let success () = - StringHashtbl.set program_state.data ~key ~data:value ; + Hashtbl.add program_state.data key value ; Message.PutDataReply (Message.PutDataReply_msg.create ()) |> Message.to_string |> Zmq.Socket.send rep_socket; @@ -623,9 +630,8 @@ let get_data msg program_state rep_socket = let success () = let value = - match StringHashtbl.find program_state.data key with - | Some value -> value - | None -> "\000" + try Hashtbl.find program_state.data key with + | Not_found -> "\000" in Message.GetDataReply (Message.GetDataReply_msg.create ~value) |> Message.to_string_list @@ -677,13 +683,16 @@ let abort program_state rep_socket = aux [] queue 1 in let queue = - List.fold ~f:(fun queue task_id -> - Queuing_system.end_task ~task_id ~client_id queue) - ~init:queue tasks + List.fold_left + (fun queue task_id -> Queuing_system.end_task ~task_id ~client_id queue) + queue + tasks in let queue = - List.fold ~f:(fun queue task_id -> Queuing_system.del_task ~task_id queue) - ~init:queue tasks + List.fold_left + (fun queue task_id -> Queuing_system.del_task ~task_id queue) + queue + tasks in let queue = Queuing_system.del_client ~client_id queue @@ -777,7 +786,7 @@ let run ~port = address_inproc = None; progress_bar = None ; accepting_clients = false; - data = StringHashtbl.create (); + data = Hashtbl.create 23; } in diff --git a/ocaml/TaskServer.mli b/ocaml/TaskServer.mli index e3801423f..e4bd87cff 100644 --- a/ocaml/TaskServer.mli +++ b/ocaml/TaskServer.mli @@ -7,7 +7,7 @@ type t = progress_bar : Progress_bar.t option ; running : bool; accepting_clients : bool; - data : (string, string) Core.Hashtbl.t ; + data : (string, string) Hashtbl.t ; } diff --git a/ocaml/_tags b/ocaml/_tags index 42843d257..1ed06ebb8 100644 --- a/ocaml/_tags +++ b/ocaml/_tags @@ -1,3 +1,6 @@ true: package(core,cryptokit,zmq,str,ppx_sexp_conv,ppx_deriving,getopt) true: thread false: profile +<*byte> : linkdep(c_bindings.o), custom +<*.native>: linkdep(c_bindings.o) + diff --git a/ocaml/c_bindings.c b/ocaml/c_bindings.c new file mode 100644 index 000000000..8fb5c9b29 --- /dev/null +++ b/ocaml/c_bindings.c @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include + +#include + + + +/* Adapted from + https://github.com/monadbobo/ocaml-core/blob/master/base/core/lib/linux_ext_stubs.c +*/ + +#include +#include +#include +#include +#include +#include + +CAMLprim value get_ipv4_address_for_interface(value v_interface) +{ + CAMLparam1(v_interface); + struct ifreq ifr; + int fd = -1; + value res; + char* error = NULL; + + memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_addr.sa_family = AF_INET; + /* [ifr] is already initialized to zero, so it doesn't matter if the + incoming string is too long, and [strncpy] fails to add a \0. */ + strncpy(ifr.ifr_name, String_val(v_interface), IFNAMSIZ - 1); + + caml_enter_blocking_section(); + fd = socket(AF_INET, SOCK_DGRAM, 0); + + if (fd == -1) + error = "error: couldn't allocate socket"; + else { + if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) + error = "error: ioctl(fd, SIOCGIFADDR, ...) failed"; + + (void) close(fd); + } + + caml_leave_blocking_section(); + + if (error == NULL) { + /* This is weird but doing the usual casting causes errors when using + * the new gcc on CentOS 6. This solution was picked up on Red Hat's + * bugzilla or something. It also works to memcpy a sockaddr into + * a sockaddr_in. This is faster hopefully. + */ + union { + struct sockaddr sa; + struct sockaddr_in sain; + } u; + u.sa = ifr.ifr_addr; + res = caml_copy_string(inet_ntoa(u.sain.sin_addr)); + } + else + res = caml_copy_string(error); + CAMLreturn(res); + +} + + diff --git a/ocaml/myocamlbuild.ml b/ocaml/myocamlbuild.ml index 8282e7941..d0909c46a 100644 --- a/ocaml/myocamlbuild.ml +++ b/ocaml/myocamlbuild.ml @@ -7,6 +7,7 @@ dispatch begin function | After_rules -> begin flag ["ocaml";"compile";"native";"gprof"] (S [ A "-p"]); + pdep ["link"] "linkdep" (fun param -> [param]); end | _ -> () end diff --git a/ocaml/qp_print_basis.ml b/ocaml/qp_print_basis.ml index 2b21bf624..74c367613 100644 --- a/ocaml/qp_print_basis.ml +++ b/ocaml/qp_print_basis.ml @@ -1,11 +1,10 @@ -open Core open Qptypes let basis () = let ezfio_filename = Sys.argv.(1) in - if (not (Sys.file_exists_exn ezfio_filename)) then + if (not (Sys.file_exists ezfio_filename)) then failwith "Error reading EZFIO file"; Ezfio.set_file ezfio_filename; let basis = @@ -22,7 +21,7 @@ let mo () = let ezfio_filename = Sys.argv.(1) in - if (not (Sys.file_exists_exn ezfio_filename)) then + if (not (Sys.file_exists ezfio_filename)) then failwith "Error reading EZFIO file"; Ezfio.set_file ezfio_filename; let mo_coef = @@ -39,7 +38,7 @@ let psi_det () = let ezfio_filename = Sys.argv.(1) in - if (not (Sys.file_exists_exn ezfio_filename)) then + if (not (Sys.file_exists ezfio_filename)) then failwith "Error reading EZFIO file"; Ezfio.set_file ezfio_filename; let psi_det = diff --git a/ocaml/qp_set_mo_class.ml b/ocaml/qp_set_mo_class.ml index fe3348d9e..e806082cf 100644 --- a/ocaml/qp_set_mo_class.ml +++ b/ocaml/qp_set_mo_class.ml @@ -1,6 +1,5 @@ open Qputils open Qptypes -open Core (* * Command-line arguments @@ -46,7 +45,7 @@ let set ~core ~inact ~act ~virt ~del = let mo_class = - Array.init mo_num ~f:(fun i -> None) + Array.init mo_num (fun i -> None) in (* Check input data *) @@ -113,7 +112,8 @@ let set ~core ~inact ~act ~virt ~del = and av = Excitation.create_single act virt in let single_excitations = [ ia ; aa ; av ] - |> List.map ~f:Excitation.(fun x -> + |> List.map (fun x -> + let open Excitation in match x with | Single (x,y) -> ( MO_class.to_bitlist n_int (Hole.to_mo_class x), @@ -128,7 +128,8 @@ let set ~core ~inact ~act ~virt ~del = Excitation.double_of_singles aa aa ; Excitation.double_of_singles aa av ; Excitation.double_of_singles av av ] - |> List.map ~f:Excitation.(fun x -> + |> List.map (fun x -> + let open Excitation in match x with | Single _ -> assert false | Double (x,y,z,t) -> @@ -146,19 +147,20 @@ let set ~core ~inact ~act ~virt ~del = and extract_hole2 (_,_,h,_) = h and extract_particle2 (_,_,_,p) = p in + let init = Bitlist.zero n_int in let result = [ - List.map ~f:extract_hole single_excitations - |> List.fold ~init:(Bitlist.zero n_int) ~f:Bitlist.or_operator ; - List.map ~f:extract_particle single_excitations - |> List.fold ~init:(Bitlist.zero n_int) ~f:Bitlist.or_operator ; - List.map ~f:extract_hole1 double_excitations - |> List.fold ~init:(Bitlist.zero n_int) ~f:Bitlist.or_operator ; - List.map ~f:extract_particle1 double_excitations - |> List.fold ~init:(Bitlist.zero n_int) ~f:Bitlist.or_operator ; - List.map ~f:extract_hole2 double_excitations - |> List.fold ~init:(Bitlist.zero n_int) ~f:Bitlist.or_operator ; - List.map ~f:extract_particle2 double_excitations - |> List.fold ~init:(Bitlist.zero n_int) ~f:Bitlist.or_operator ; + List.map extract_hole single_excitations + |> List.fold_left Bitlist.or_operator init; + List.map extract_particle single_excitations + |> List.fold_left Bitlist.or_operator init; + List.map extract_hole1 double_excitations + |> List.fold_left Bitlist.or_operator init; + List.map extract_particle1 double_excitations + |> List.fold_left Bitlist.or_operator init; + List.map extract_hole2 double_excitations + |> List.fold_left Bitlist.or_operator init; + List.map extract_particle2 double_excitations + |> List.fold_left Bitlist.or_operator init; ] in @@ -167,10 +169,11 @@ let set ~core ~inact ~act ~virt ~del = *) (* Write masks *) - let result = List.map ~f:(fun x -> - let y = Bitlist.to_int64_list x in y@y ) + let result = + List.map (fun x -> + let y = Bitlist.to_int64_list x in y@y ) result - |> List.concat + |> List.concat in Ezfio.set_bitmasks_n_int (N_int_number.to_int n_int); @@ -194,7 +197,7 @@ let set ~core ~inact ~act ~virt ~del = let data = Array.to_list mo_class - |> List.map ~f:(fun x -> match x with + |> List.map (fun x -> match x with |None -> assert false | Some x -> MO_class.to_string x ) @@ -276,42 +279,6 @@ let run ~q ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio set ~core ~inact ~act ~virt ~del -let ezfio_file = - let failure filename = - eprintf "'%s' is not an EZFIO file.\n%!" filename; - exit 1 - in - Command.Spec.Arg_type.create - (fun filename -> - match Sys.is_directory filename with - | `Yes -> - begin - match Sys.is_file (filename ^ "/.version") with - | `Yes -> filename - | _ -> failure filename - end - | _ -> failure filename - ) - - -let default range = - let failure filename = - eprintf "'%s' is not a regular file.\n%!" filename; - exit 1 - in - Command.Spec.Arg_type.create - (fun filename -> - match Sys.is_directory filename with - | `Yes -> - begin - match Sys.is_file (filename^"/.version") with - | `Yes -> filename - | _ -> failure filename - end - | _ -> failure filename - ) - - let () = let open Command_line in diff --git a/plugins/local/.gitignore b/plugins/local/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/src/ao_basis/aos.irp.f b/src/ao_basis/aos.irp.f index 586e30b5c..f2bf16f0a 100644 --- a/src/ao_basis/aos.irp.f +++ b/src/ao_basis/aos.irp.f @@ -140,7 +140,7 @@ integer :: i do i=1,ao_num ao_l(i) = ao_power(i,1) + ao_power(i,2) + ao_power(i,3) - ao_l_char(i) = l_to_charater(ao_l(i)) + ao_l_char(i) = l_to_character(ao_l(i)) enddo ao_l_max = maxval(ao_l) END_PROVIDER @@ -159,19 +159,19 @@ integer function ao_power_index(nx,ny,nz) end -BEGIN_PROVIDER [ character*(128), l_to_charater, (0:7)] +BEGIN_PROVIDER [ character*(128), l_to_character, (0:7)] BEGIN_DOC ! Character corresponding to the "l" value of an |AO| END_DOC implicit none - l_to_charater(0)='S' - l_to_charater(1)='P' - l_to_charater(2)='D' - l_to_charater(3)='F' - l_to_charater(4)='G' - l_to_charater(5)='H' - l_to_charater(6)='I' - l_to_charater(7)='J' + l_to_character(0)='s' + l_to_character(1)='p' + l_to_character(2)='d' + l_to_character(3)='f' + l_to_character(4)='g' + l_to_character(5)='h' + l_to_character(6)='i' + l_to_character(7)='j' END_PROVIDER diff --git a/src/becke_numerical_grid/EZFIO.cfg b/src/becke_numerical_grid/EZFIO.cfg index 3b2c26254..ed89428c6 100644 --- a/src/becke_numerical_grid/EZFIO.cfg +++ b/src/becke_numerical_grid/EZFIO.cfg @@ -3,3 +3,8 @@ type: integer doc: Type of grid used for the Becke's numerical grid. Can be, by increasing accuracy: [ 0 | 1 | 2 | 3 ] interface: ezfio,provider,ocaml default: 2 + +[n_points_final_grid] +type: integer +doc: Total number of grid points +interface: ezfio diff --git a/src/becke_numerical_grid/grid_becke_vector.irp.f b/src/becke_numerical_grid/grid_becke_vector.irp.f index e8829c7be..a595cd0b3 100644 --- a/src/becke_numerical_grid/grid_becke_vector.irp.f +++ b/src/becke_numerical_grid/grid_becke_vector.irp.f @@ -8,9 +8,9 @@ do j = 1, nucl_num do i = 1, n_points_radial_grid -1 do k = 1, n_points_integration_angular - if(dabs(final_weight_at_r(k,i,j)) < 1.d-30)then - cycle - endif +! if(dabs(final_weight_at_r(k,i,j)) < 1.d-30)then +! cycle +! endif n_points_final_grid += 1 enddo enddo @@ -39,9 +39,9 @@ do j = 1, nucl_num do i = 1, n_points_radial_grid -1 do k = 1, n_points_integration_angular - if(dabs(final_weight_at_r(k,i,j)) < 1.d-30)then - cycle - endif + !if(dabs(final_weight_at_r(k,i,j)) < 1.d-30)then + ! cycle + !endif i_count += 1 final_grid_points(1,i_count) = grid_points_per_atom(1,k,i,j) final_grid_points(2,i_count) = grid_points_per_atom(2,k,i,j) diff --git a/src/cipsi/cipsi.irp.f b/src/cipsi/cipsi.irp.f index 183b5f116..f0cab3848 100644 --- a/src/cipsi/cipsi.irp.f +++ b/src/cipsi/cipsi.irp.f @@ -150,6 +150,7 @@ subroutine run_cipsi do k=1,N_states rpt2(:) = pt2(:)/(1.d0 + norm(k)) enddo + call save_energy(psi_energy_with_nucl_rep, rpt2) call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm,N_det,N_occ_pattern,N_states,psi_s2) call save_energy(psi_energy_with_nucl_rep, pt2) diff --git a/src/cipsi/selection_buffer.irp.f b/src/cipsi/selection_buffer.irp.f index aa3be942d..17b6e9a9f 100644 --- a/src/cipsi/selection_buffer.irp.f +++ b/src/cipsi/selection_buffer.irp.f @@ -1,17 +1,17 @@ -subroutine create_selection_buffer(N, siz_, res) +subroutine create_selection_buffer(N, size_in, res) use selection_types implicit none BEGIN_DOC ! Allocates the memory for a selection buffer. -! The arrays have dimension siz_ and the maximum number of elements is N +! The arrays have dimension size_in and the maximum number of elements is N END_DOC - integer, intent(in) :: N, siz_ + integer, intent(in) :: N, size_in type(selection_buffer), intent(out) :: res integer :: siz - siz = max(siz_,1) + siz = max(size_in,1) double precision :: rss double precision, external :: memory_of_double diff --git a/src/cipsi/stochastic_cipsi.irp.f b/src/cipsi/stochastic_cipsi.irp.f index 3328dc998..3cda76e39 100644 --- a/src/cipsi/stochastic_cipsi.irp.f +++ b/src/cipsi/stochastic_cipsi.irp.f @@ -83,6 +83,7 @@ subroutine run_stochastic_cipsi (psi_energy_with_nucl_rep(1) + pt2(1) - hf_energy_ref) correlation_energy_ratio = min(1.d0,correlation_energy_ratio) + call save_energy(psi_energy_with_nucl_rep, rpt2) call write_double(6,correlation_energy_ratio, 'Correlation ratio') call print_summary(psi_energy_with_nucl_rep,pt2,error,variance,norm,N_det,N_occ_pattern,N_states,psi_s2) @@ -131,6 +132,7 @@ subroutine run_stochastic_cipsi enddo call save_energy(psi_energy_with_nucl_rep, rpt2) + call save_energy(psi_energy_with_nucl_rep, rpt2) call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm,N_det,N_occ_pattern,N_states,psi_s2) call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det) call print_extrapolated_energy() diff --git a/src/density_for_dft/EZFIO.cfg b/src/density_for_dft/EZFIO.cfg index ed1cf9cec..d4d405462 100644 --- a/src/density_for_dft/EZFIO.cfg +++ b/src/density_for_dft/EZFIO.cfg @@ -9,3 +9,10 @@ type: double precision doc: damping factor for the density used in RSFT. interface: ezfio,provider,ocaml default: 0.5 + +[no_core_density] +type: character*(32) +doc: Type of density +doc: if [no_core_dm] then all elements of the density matrix involving at least one orbital set as core are set to zero +interface: ezfio, provider, ocaml +default: full_density diff --git a/src/density_for_dft/density_for_dft.irp.f b/src/density_for_dft/density_for_dft.irp.f index a37d7d0ea..7a9074188 100644 --- a/src/density_for_dft/density_for_dft.irp.f +++ b/src/density_for_dft/density_for_dft.irp.f @@ -15,6 +15,19 @@ else if (density_for_dft .EQ. "KS")then provide mo_coef one_e_dm_mo_alpha_for_dft = one_body_dm_mo_alpha_one_det + else if (density_for_dft .EQ. "state_average_dens")then + one_e_dm_mo_alpha_for_dft = 0.d0 + one_e_dm_mo_alpha_for_dft(:,:,1) = one_e_dm_mo_alpha_average(:,:) + endif + + if(no_core_density .EQ. "no_core_dm")then + integer :: i,j + do i = 1, n_core_orb + do j = 1, mo_num + one_e_dm_mo_alpha_for_dft(j,i,:) = 0.d0 + one_e_dm_mo_alpha_for_dft(i,j,:) = 0.d0 + enddo + enddo endif END_PROVIDER @@ -36,6 +49,19 @@ else if (density_for_dft .EQ. "KS")then provide mo_coef one_e_dm_mo_beta_for_dft = one_body_dm_mo_beta_one_det + else if (density_for_dft .EQ. "state_average_dens")then + one_e_dm_mo_beta_for_dft = 0.d0 + one_e_dm_mo_beta_for_dft(:,:,1) = one_e_dm_mo_beta_average(:,:) + endif + + if(no_core_density .EQ. "no_core_dm")then + integer :: i,j + do i = 1, n_core_orb + do j = 1, mo_num + one_e_dm_mo_beta_for_dft(j,i,:) = 0.d0 + one_e_dm_mo_beta_for_dft(i,j,:) = 0.d0 + enddo + enddo endif END_PROVIDER diff --git a/src/determinants/ref_bitmask.irp.f b/src/determinants/ref_bitmask.irp.f index 14d558794..ef6af40e2 100644 --- a/src/determinants/ref_bitmask.irp.f +++ b/src/determinants/ref_bitmask.irp.f @@ -3,6 +3,10 @@ &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 ] +&BEGIN_PROVIDER [ double precision, ref_bitmask_energy_ab ] +&BEGIN_PROVIDER [ double precision, ref_bitmask_energy_bb ] +&BEGIN_PROVIDER [ double precision, ref_bitmask_energy_aa ] + use bitmasks implicit none BEGIN_DOC @@ -53,5 +57,30 @@ enddo ref_bitmask_one_e_energy = ref_bitmask_kinetic_energy + ref_bitmask_e_n_energy + ref_bitmask_energy_ab = 0.d0 + do i = 1, elec_alpha_num + do j = 1, elec_beta_num + ref_bitmask_energy_ab += mo_two_e_integrals_jj(occ(i,1),occ(j,2)) + enddo + enddo + + ref_bitmask_energy_aa = 0.d0 + do i = 1, elec_alpha_num + do j = 1, elec_alpha_num + ref_bitmask_energy_aa += mo_two_e_integrals_jj_anti(occ(i,1),occ(j,1)) + enddo + enddo + ref_bitmask_energy_aa = ref_bitmask_energy_aa * 0.5d0 + + ref_bitmask_energy_bb = 0.d0 + do i = 1, elec_beta_num + do j = 1, elec_beta_num + ref_bitmask_energy_bb += mo_two_e_integrals_jj_anti(occ(i,2),occ(j,2)) + enddo + enddo + ref_bitmask_energy_bb = ref_bitmask_energy_bb * 0.5d0 + + + END_PROVIDER diff --git a/src/determinants/s2.irp.f b/src/determinants/s2.irp.f index 52c111b29..391d00730 100644 --- a/src/determinants/s2.irp.f +++ b/src/determinants/s2.irp.f @@ -33,7 +33,7 @@ subroutine get_s2(key_i,key_j,Nint,s2) implicit none use bitmasks BEGIN_DOC - ! Returns + ! Returns $\langle S^2 \rangle - S_z^2 S_z$ END_DOC integer, intent(in) :: Nint integer(bit_kind), intent(in) :: key_i(Nint,2) diff --git a/src/dft_one_e/NEED b/src/dft_one_e/NEED index c5d5132ec..2f95a9652 100644 --- a/src/dft_one_e/NEED +++ b/src/dft_one_e/NEED @@ -1,2 +1,2 @@ dft_utils_one_e -new_functionals +functionals diff --git a/src/dft_one_e/README.rst b/src/dft_one_e/README.rst index 4ffe01bf6..3ba16b52f 100644 --- a/src/dft_one_e/README.rst +++ b/src/dft_one_e/README.rst @@ -27,5 +27,3 @@ In the core modules of the |QP|, two functionals are implemented: * "PBE" or "short_range_PBE" for, respectively the |PBE| and its short-range version -If you have designed your own exchange/correlation functionals (see the documentation of the :ref:`module_new_functionals`), -you can use them in all |DFT|-based programs by setting the :option:`dft_keywords exchange_functional` and :option:`dft_keywords correlation_functional` keywords to "my_functional". diff --git a/src/dft_one_e/e_xc_general.irp.f b/src/dft_one_e/e_xc_general.irp.f index 607343abd..dc8b9d9ad 100644 --- a/src/dft_one_e/e_xc_general.irp.f +++ b/src/dft_one_e/e_xc_general.irp.f @@ -1,54 +1,65 @@ - - BEGIN_PROVIDER [double precision, energy_x, (N_states)] - &BEGIN_PROVIDER [double precision, energy_c, (N_states)] - implicit none - BEGIN_DOC - ! correlation and exchange energies general providers. - END_DOC - if(trim(exchange_functional)=="short_range_LDA")then - energy_x = energy_sr_x_LDA - energy_x = energy_sr_x_LDA - else if(exchange_functional.EQ."short_range_PBE")then - energy_x = energy_sr_x_PBE - energy_x = energy_sr_x_PBE - else if(exchange_functional.EQ."PBE")then - energy_x = energy_sr_x_PBE - energy_x = energy_sr_x_PBE - else if(exchange_functional.EQ."LDA")then - energy_x = energy_sr_x_LDA - energy_x = energy_sr_x_LDA - else if(exchange_functional.EQ."None")then - energy_x = 0.d0 - energy_x = 0.d0 - else if(exchange_functional.EQ."my_functional")then - energy_x = energy_x_new_functional +BEGIN_PROVIDER [double precision, energy_x, (N_states)] + implicit none + BEGIN_DOC + ! correlation energies general providers. + END_DOC + + BEGIN_SHELL [ /usr/bin/env python2 ] +import os +import glob +from qp_path import QP_SRC +funcdir=QP_SRC+'/functionals/' +os.chdir(funcdir) +functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f")) +prefix = "" +for f in functionals: + print """ + %sif (trim(exchange_functional) == '%s') then + energy_x = energy_x_%s"""%(prefix, f, f) + prefix = "else " +print """ else - print*, 'Exchange functional required does not exist ...' - print*,'exchange_functional',exchange_functional - stop - endif + print *, 'exchange functional required does not exist ...' + print *, 'exchange_functional ',exchange_functional + stop""" +print "endif" + + END_SHELL + + + END_PROVIDER + + + + + BEGIN_PROVIDER [double precision, energy_c, (N_states)] + implicit none + BEGIN_DOC + ! correlation and exchange energies general providers. + END_DOC + + BEGIN_SHELL [ /usr/bin/env python2 ] +import os +import glob +from qp_path import QP_SRC +funcdir=QP_SRC+'/functionals/' +os.chdir(funcdir) +functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f")) +prefix = "" +for f in functionals: + print """ + %sif (trim(correlation_functional) == '%s') then + energy_c = energy_c_%s"""%(prefix, f, f) + prefix = "else " - if(trim(correlation_functional)=="short_range_LDA")then - energy_c = energy_sr_c_LDA - energy_c = energy_sr_c_LDA - else if(correlation_functional.EQ."short_range_PBE")then - energy_c = energy_sr_c_PBE - energy_c = energy_sr_c_PBE - else if(correlation_functional.EQ."PBE")then - energy_c = energy_sr_c_PBE - energy_c = energy_sr_c_PBE - else if(correlation_functional.EQ."LDA")then - energy_c = energy_sr_c_LDA - energy_c = energy_sr_c_LDA - else if(correlation_functional.EQ."None")then - energy_c = 0.d0 - energy_c = 0.d0 - else if(correlation_functional.EQ."my_functional")then - energy_c = energy_c_new_functional +print """ else - print*, 'Correlation functional required does not ecist ...' - print*,'correlation_functional',correlation_functional - stop - endif + print*, 'Correlation functional required does not exist ...' + print*,'correlation_functional ',correlation_functional + stop""" +print "endif" + + END_SHELL + + END_PROVIDER -END_PROVIDER diff --git a/src/dft_one_e/pot_general.irp.f b/src/dft_one_e/pot_general.irp.f index 9456b54ed..237af8c06 100644 --- a/src/dft_one_e/pot_general.irp.f +++ b/src/dft_one_e/pot_general.irp.f @@ -1,211 +1,228 @@ - BEGIN_PROVIDER [double precision, potential_x_alpha_ao,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_x_beta_ao,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_c_alpha_ao,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_c_beta_ao,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC -! general providers for the alpha/beta exchange/correlation potentials on the AO basis - END_DOC - - if(trim(exchange_functional)=="short_range_LDA")then - potential_x_alpha_ao = potential_sr_x_alpha_ao_LDA - potential_x_beta_ao = potential_sr_x_beta_ao_LDA - else if(exchange_functional.EQ."short_range_PBE")then - potential_x_alpha_ao = potential_sr_x_alpha_ao_PBE - potential_x_beta_ao = potential_sr_x_beta_ao_PBE - else if(trim(exchange_functional)=="LDA")then - potential_x_alpha_ao = potential_x_alpha_ao_LDA - potential_x_beta_ao = potential_x_beta_ao_LDA - else if(exchange_functional.EQ."PBE")then - potential_x_alpha_ao = potential_x_alpha_ao_PBE - potential_x_beta_ao = potential_x_beta_ao_PBE - else if(exchange_functional.EQ."my_functional")then - potential_x_alpha_ao = potential_new_functional_x_alpha_ao - potential_x_beta_ao = potential_new_functional_x_beta_ao - else if(exchange_functional.EQ."None")then - potential_x_alpha_ao = 0.d0 - potential_x_beta_ao = 0.d0 + &BEGIN_PROVIDER [double precision, potential_x_beta_ao ,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! general providers for the alpha/beta exchange potentials on the AO basis + END_DOC + + BEGIN_SHELL [ /usr/bin/env python2 ] +import os +import glob +from qp_path import QP_SRC +funcdir=QP_SRC+'/functionals/' +os.chdir(funcdir) +functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f")) + +prefix = "" +for f in functionals: + print """ + %sif (trim(exchange_functional) == '%s') then + potential_x_alpha_ao = potential_x_alpha_ao_%s + potential_x_beta_ao = potential_x_beta_ao_%s"""%(prefix, f, f, f) + prefix = "else " +print """ else - print*, 'Exchange functional required does not exist ...' - print*,'exchange_functional',exchange_functional - stop - endif + print*, 'exchange functional required does not exist ...' + print*,'exchange_functional ',exchange_functional + stop""" +print "endif" - if(trim(correlation_functional)=="short_range_LDA")then - potential_c_alpha_ao = potential_sr_c_alpha_ao_LDA - potential_c_beta_ao = potential_sr_c_beta_ao_LDA - else if(trim(correlation_functional)=="LDA")then - potential_c_alpha_ao = potential_c_alpha_ao_LDA - potential_c_beta_ao = potential_c_beta_ao_LDA - else if(correlation_functional.EQ."short_range_PBE")then - potential_c_alpha_ao = potential_sr_c_alpha_ao_PBE - potential_c_beta_ao = potential_sr_c_beta_ao_PBE - else if(correlation_functional.EQ."PBE")then - potential_c_alpha_ao = potential_c_alpha_ao_PBE - potential_c_beta_ao = potential_c_beta_ao_PBE - else if(correlation_functional.EQ."my_functional")then - potential_c_alpha_ao = potential_new_functional_c_alpha_ao - potential_c_beta_ao = potential_new_functional_c_beta_ao - else if(correlation_functional.EQ."None")then - potential_c_alpha_ao = 0.d0 - potential_c_beta_ao = 0.d0 + END_SHELL + + + END_PROVIDER + + + + BEGIN_PROVIDER [double precision, potential_c_alpha_ao,(ao_num,ao_num,N_states)] + &BEGIN_PROVIDER [double precision, potential_c_beta_ao,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! general providers for the alpha/beta correlation potentials on the AO basis + END_DOC + + BEGIN_SHELL [ /usr/bin/env python2 ] +import os +import glob +from qp_path import QP_SRC +funcdir=QP_SRC+'/functionals/' +os.chdir(funcdir) +functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f")) + +prefix = "" +for f in functionals: + print """ + %sif (trim(correlation_functional) == '%s') then + potential_c_alpha_ao = potential_c_alpha_ao_%s + potential_c_beta_ao = potential_c_beta_ao_%s"""%(prefix, f, f, f) + prefix = "else " + +print """ else - print*, 'Correlation functional required does not ecist ...' - print*,'correlation_functional',correlation_functional - stop - endif - - -END_PROVIDER - - - + print*, 'Correlation functional required does not exist ...' + print*,'correlation_functional ',correlation_functional + stop""" +print "endif" - - 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 - END_DOC - integer :: istate - do istate = 1, N_states - call ao_to_mo( & - potential_x_alpha_ao(1,1,istate), & - size(potential_x_alpha_ao,1), & - potential_x_alpha_mo(1,1,istate), & - size(potential_x_alpha_mo,1) & - ) - - call ao_to_mo( & - potential_x_beta_ao(1,1,istate), & - size(potential_x_beta_ao,1), & - potential_x_beta_mo(1,1,istate), & - size(potential_x_beta_mo,1) & - ) - - - call ao_to_mo( & - potential_c_alpha_ao(1,1,istate), & - size(potential_c_alpha_ao,1), & - potential_c_alpha_mo(1,1,istate), & - size(potential_c_alpha_mo,1) & - ) - - call ao_to_mo( & - potential_c_beta_ao(1,1,istate), & - size(potential_c_beta_ao,1), & - potential_c_beta_mo(1,1,istate), & - size(potential_c_beta_mo,1) & - ) - - enddo - -END_PROVIDER - - BEGIN_PROVIDER [double precision, Trace_v_xc, (N_states)] -&BEGIN_PROVIDER [double precision, Trace_v_H, (N_states)] -&BEGIN_PROVIDER [double precision, Trace_v_Hxc, (N_states)] - implicit none - integer :: i,j,istate - double precision :: dm - BEGIN_DOC -! 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} - END_DOC - do istate = 1, N_states - Trace_v_xc(istate) = 0.d0 - Trace_v_H(istate) = 0.d0 - 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_e_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_e_dm_mo_beta_for_dft(j,i,istate) - dm = one_e_dm_mo_alpha_for_dft(j,i,istate) + one_e_dm_mo_beta_for_dft(j,i,istate) - Trace_v_H(istate) += dm * short_range_Hartree_operator(j,i,istate) + END_SHELL + + END_PROVIDER + + + + + + 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)] + implicit none + BEGIN_DOC + ! general providers for the alpha/beta exchange potentials on the MO basis + END_DOC + integer :: istate + do istate = 1, N_states + call ao_to_mo( & + potential_x_alpha_ao(1,1,istate), & + size(potential_x_alpha_ao,1), & + potential_x_alpha_mo(1,1,istate), & + size(potential_x_alpha_mo,1) & + ) + + call ao_to_mo( & + potential_x_beta_ao(1,1,istate), & + size(potential_x_beta_ao,1), & + potential_x_beta_mo(1,1,istate), & + size(potential_x_beta_mo,1) & + ) + enddo + + END_PROVIDER + + 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 correlation potentials on the MO basis + END_DOC + integer :: istate + do istate = 1, N_states + call ao_to_mo( & + potential_c_alpha_ao(1,1,istate), & + size(potential_c_alpha_ao,1), & + potential_c_alpha_mo(1,1,istate), & + size(potential_c_alpha_mo,1) & + ) + + call ao_to_mo( & + potential_c_beta_ao(1,1,istate), & + size(potential_c_beta_ao,1), & + potential_c_beta_mo(1,1,istate), & + size(potential_c_beta_mo,1) & + ) + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, Trace_v_xc, (N_states)] + &BEGIN_PROVIDER [double precision, Trace_v_H, (N_states)] + &BEGIN_PROVIDER [double precision, Trace_v_Hxc, (N_states)] + implicit none + integer :: i,j,istate + double precision :: dm + BEGIN_DOC + ! 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} + END_DOC + do istate = 1, N_states + Trace_v_xc(istate) = 0.d0 + Trace_v_H(istate) = 0.d0 + 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_e_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_e_dm_mo_beta_for_dft(j,i,istate) + dm = one_e_dm_mo_alpha_for_dft(j,i,istate) + one_e_dm_mo_beta_for_dft(j,i,istate) + Trace_v_H(istate) += dm * short_range_Hartree_operator(j,i,istate) + enddo enddo + Trace_v_Hxc(istate) = Trace_v_xc(istate) + Trace_v_H(istate) enddo - Trace_v_Hxc(istate) = Trace_v_xc(istate) + Trace_v_H(istate) - enddo - -END_PROVIDER - - BEGIN_PROVIDER [double precision, Trace_v_xc_new, (N_states)] - implicit none - integer :: i,j,istate - double precision :: dm - BEGIN_DOC -! Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) - END_DOC - do istate = 1, N_states - Trace_v_xc_new(istate) = 0.d0 - do i = 1, mo_num - do j = 1, mo_num - Trace_v_xc_new(istate) += (potential_xc_alpha_mo(j,i,istate) ) * one_e_dm_mo_alpha_for_dft(j,i,istate) - Trace_v_xc_new(istate) += (potential_xc_beta_mo(j,i,istate) ) * one_e_dm_mo_beta_for_dft(j,i,istate) + + END_PROVIDER + + BEGIN_PROVIDER [double precision, Trace_v_xc_new, (N_states)] + implicit none + integer :: i,j,istate + double precision :: dm + BEGIN_DOC + ! Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) + END_DOC + do istate = 1, N_states + Trace_v_xc_new(istate) = 0.d0 + do i = 1, mo_num + do j = 1, mo_num + Trace_v_xc_new(istate) += (potential_xc_alpha_mo(j,i,istate) ) * one_e_dm_mo_alpha_for_dft(j,i,istate) + Trace_v_xc_new(istate) += (potential_xc_beta_mo(j,i,istate) ) * one_e_dm_mo_beta_for_dft(j,i,istate) + enddo enddo enddo - enddo - -END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_xc_alpha_mo,(mo_num,mo_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_xc_beta_mo,(mo_num,mo_num,N_states)] - implicit none - integer :: istate - - do istate = 1, N_states - call ao_to_mo( & - potential_xc_alpha_ao(1,1,istate), & - size(potential_xc_alpha_ao,1), & - potential_xc_alpha_mo(1,1,istate), & - size(potential_xc_alpha_mo,1) & - ) - - call ao_to_mo( & - potential_xc_beta_ao(1,1,istate), & - size(potential_xc_beta_ao,1), & - potential_xc_beta_mo(1,1,istate), & - size(potential_xc_beta_mo,1) & - ) - enddo - -END_PROVIDER - - - BEGIN_PROVIDER [double precision, potential_xc_alpha_ao,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_xc_beta_ao,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC -! general providers for the alpha/beta exchange/correlation potentials on the AO basis - END_DOC - - if(trim(exchange_functional)=="short_range_LDA")then - potential_xc_alpha_ao = potential_sr_xc_alpha_ao_LDA - potential_xc_beta_ao = potential_sr_xc_beta_ao_LDA - else if(trim(exchange_functional)=="LDA")then - potential_xc_alpha_ao = potential_xc_alpha_ao_LDA - potential_xc_beta_ao = potential_xc_beta_ao_LDA - else if(exchange_functional.EQ."None")then - potential_xc_alpha_ao = 0.d0 - potential_xc_beta_ao = 0.d0 - else if(trim(exchange_functional)=="short_range_PBE")then - potential_xc_alpha_ao = potential_sr_xc_alpha_ao_PBE - potential_xc_beta_ao = potential_sr_xc_beta_ao_PBE - else if(trim(exchange_functional)=="PBE")then - potential_xc_alpha_ao = potential_xc_alpha_ao_PBE - potential_xc_beta_ao = potential_xc_beta_ao_PBE - else if(exchange_functional.EQ."None")then - potential_xc_alpha_ao = 0.d0 - potential_xc_beta_ao = 0.d0 + + END_PROVIDER + + BEGIN_PROVIDER [double precision, potential_xc_alpha_mo,(mo_num,mo_num,N_states)] + &BEGIN_PROVIDER [double precision, potential_xc_beta_mo,(mo_num,mo_num,N_states)] + implicit none + integer :: istate + + do istate = 1, N_states + call ao_to_mo( & + potential_xc_alpha_ao(1,1,istate), & + size(potential_xc_alpha_ao,1), & + potential_xc_alpha_mo(1,1,istate), & + size(potential_xc_alpha_mo,1) & + ) + + call ao_to_mo( & + potential_xc_beta_ao(1,1,istate), & + size(potential_xc_beta_ao,1), & + potential_xc_beta_mo(1,1,istate), & + size(potential_xc_beta_mo,1) & + ) + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, potential_xc_alpha_ao,(ao_num,ao_num,N_states)] + &BEGIN_PROVIDER [double precision, potential_xc_beta_ao,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! general providers for the alpha/beta exchange/correlation potentials on the AO basis + END_DOC + + BEGIN_SHELL [ /usr/bin/env python2 ] +import os +import glob +from qp_path import QP_SRC +funcdir=QP_SRC+'/functionals/' +os.chdir(funcdir) +functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f")) + +prefix = "" +for f in functionals: + print """ + %sif (trim(exchange_functional) == '%s') then + potential_xc_alpha_ao = potential_xc_alpha_ao_%s + potential_xc_beta_ao = potential_xc_beta_ao_%s"""%(prefix, f, f, f) + prefix = "else " +print """ else - print*, 'Exchange functional required does not exist ...' - print*,'exchange_functional',exchange_functional - stop - endif + print*, 'exchange functional required does not exist ...' + print*,'exchange_functional ',exchange_functional + stop""" +print "endif" -END_PROVIDER +END_SHELL + + END_PROVIDER diff --git a/src/dft_utils_one_e/e_xc.irp.f b/src/dft_utils_one_e/e_xc.irp.f deleted file mode 100644 index 21c6e6c21..000000000 --- a/src/dft_utils_one_e/e_xc.irp.f +++ /dev/null @@ -1,86 +0,0 @@ - - - BEGIN_PROVIDER[double precision, energy_x_LDA, (N_states) ] -&BEGIN_PROVIDER[double precision, energy_c_LDA, (N_states) ] - implicit none - BEGIN_DOC -! exchange/correlation energy with the short range LDA functional - END_DOC - integer :: istate,i,j - double precision :: r(3) - double precision :: mu,weight - double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b - double precision, allocatable :: rhoa(:),rhob(:) - allocate(rhoa(N_states), rhob(N_states)) - energy_x_LDA = 0.d0 - energy_c_LDA = 0.d0 - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rhoa(istate) = one_e_dm_alpha_at_r(i,istate) - rhob(istate) = one_e_dm_beta_at_r(i,istate) - call ec_LDA(rhoa(istate),rhob(istate),e_c,vc_a,vc_b) - call ex_LDA(rhoa(istate),rhob(istate),e_x,vx_a,vx_b) - energy_x_LDA(istate) += weight * e_x - energy_c_LDA(istate) += weight * e_c - enddo - enddo - - END_PROVIDER - - BEGIN_PROVIDER[double precision, energy_x_PBE, (N_states) ] -&BEGIN_PROVIDER[double precision, energy_c_PBE, (N_states) ] - implicit none - BEGIN_DOC -! exchange/correlation energy with the short range PBE functional - END_DOC - integer :: istate,i,j,m - double precision :: r(3) - double precision :: mu,weight - double precision, allocatable :: ex(:), ec(:) - double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) - double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) - double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) - double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) - allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) - allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) - - - allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) - allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) - energy_x_PBE = 0.d0 - energy_c_PBE = 0.d0 - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) - grad_rho_a_2 = 0.d0 - grad_rho_b_2 = 0.d0 - grad_rho_a_b = 0.d0 - do m = 1, 3 - grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) - grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) - grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) - enddo - - ! inputs - call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange - ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation - ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - energy_x_PBE += ex * weight - energy_c_PBE += ec * weight - enddo - enddo - - -END_PROVIDER - diff --git a/src/dft_utils_one_e/exc_sr_pbe.irp.f b/src/dft_utils_one_e/exc_sr_pbe.irp.f index 5bb91246f..4188ebc64 100644 --- a/src/dft_utils_one_e/exc_sr_pbe.irp.f +++ b/src/dft_utils_one_e/exc_sr_pbe.irp.f @@ -1,6 +1,6 @@ subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo) BEGIN_DOC -! Short-range PBE correlation energy functional for erf interaction +! Short-range pbe correlation energy functional for erf interaction ! ! input : ========== ! @@ -101,7 +101,7 @@ subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmac zeta = (rhoa-rhob)/(rhoa+rhob) -! LDA energy density +! lda energy density double precision :: vc_a_lda,vc_b_lda call ec_lda(rhoa,rhob,ecclda,vc_a_lda,vc_b_lda) eclda = ecclda @@ -133,7 +133,7 @@ subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmac ! Derive -! LDA energy density derivative +! lda energy density derivative decerfldadrho = vrhoccerflda decldadrho = 0.5d0 * (vc_a_lda+vc_b_lda) @@ -160,7 +160,7 @@ subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmac decerfpbeddrho2=rho*gamma*phi3*arglogss/arglog end if -! LDA energy density derivative +! lda energy density derivative decerfldadrho = vrhoocerflda decldadrho = 0.5d0 * (vc_a_lda-vc_b_lda) @@ -251,7 +251,7 @@ subroutine ex_pbe_sr(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex,vx_rh ! test on density if (rho >= tol) then -! call srLDA Ex[2*rho_a,2*rho_a] +! call srlda Ex[2*rho_a,2*rho_a] call ex_lda_sr(mu,rho_a,rho_a,exerflda,vxerflda_a,vxerflda_b) dexerfldadrho = (vxerflda_a + vxerflda_b)*0.5d0 @@ -279,7 +279,7 @@ subroutine ex_pbe_sr(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex,vx_rh ! test on density if (rho >= tol) then -! call srLDA Ex[2*rho_b,2*rho_b] +! call srlda Ex[2*rho_b,2*rho_b] call ex_lda_sr(mu,rho_b,rho_b,exerflda,vxerflda_a,vxerflda_b) dexerfldadrho = (vxerflda_a + vxerflda_b)*0.5d0 @@ -355,7 +355,7 @@ subroutine ex_pbe_sr_only(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex) ! test on density if (rho >= tol) then -! call srLDA Ex[2*rho_a,2*rho_a] +! call srlda Ex[2*rho_a,2*rho_a] call ex_lda_sr(mu,rho_a,rho_a,exerflda,vxerflda_a,vxerflda_b) ! square of two times spin alpha density gradient @@ -375,7 +375,7 @@ subroutine ex_pbe_sr_only(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex) ! test on density if (rho >= tol) then -! call srLDA Ex[2*rho_b,2*rho_b] +! call srlda Ex[2*rho_b,2*rho_b] call ex_lda_sr(mu,rho_b,rho_b,exerflda,vxerflda_a,vxerflda_b) ! square of two times spin beta density gradient @@ -396,7 +396,7 @@ subroutine ex_pbe_sr_only(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex) subroutine ec_pbe_only(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec) BEGIN_DOC -! Short-range PBE correlation energy functional for erf interaction +! Short-range pbe correlation energy functional for erf interaction ! ! input : ========== ! @@ -479,7 +479,7 @@ subroutine ec_pbe_only(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec) zeta = (rhoa-rhob)/(rhoa+rhob) zeta = max(zeta,1.d-10) -! LDA energy density +! lda energy density double precision :: vc_a_lda,vc_b_lda call ec_lda(rhoa,rhob,ecclda,vc_a_lda,vc_b_lda) eclda = ecclda diff --git a/src/dft_utils_one_e/pot_ao_lda.irp.f b/src/dft_utils_one_e/pot_ao_lda.irp.f deleted file mode 100644 index d6fe747c3..000000000 --- a/src/dft_utils_one_e/pot_ao_lda.irp.f +++ /dev/null @@ -1,83 +0,0 @@ - - BEGIN_PROVIDER[double precision, aos_vc_alpha_LDA_w, (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_vc_beta_LDA_w, (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_vx_alpha_LDA_w, (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_vx_beta_LDA_w, (ao_num,n_points_final_grid,N_states)] - implicit none - BEGIN_DOC -! aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - END_DOC - integer :: istate,i,j - double precision :: r(3) - double precision :: mu,weight - double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b - double precision, allocatable :: rhoa(:),rhob(:) - double precision :: mu_local - mu_local = 1.d-9 - allocate(rhoa(N_states), rhob(N_states)) - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rhoa(istate) = one_e_dm_alpha_at_r(i,istate) - rhob(istate) = one_e_dm_beta_at_r(i,istate) - call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) - call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) - do j =1, ao_num - aos_vc_alpha_LDA_w(j,i,istate) = vc_a * aos_in_r_array(j,i)*weight - aos_vc_beta_LDA_w(j,i,istate) = vc_b * aos_in_r_array(j,i)*weight - aos_vx_alpha_LDA_w(j,i,istate) = vx_a * aos_in_r_array(j,i)*weight - aos_vx_beta_LDA_w(j,i,istate) = vx_b * aos_in_r_array(j,i)*weight - enddo - enddo - enddo - - END_PROVIDER - - - - - BEGIN_PROVIDER [double precision, potential_x_alpha_ao_LDA,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_x_beta_ao_LDA,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! short range exchange alpha/beta potentials with LDA functional on the |AO| basis - END_DOC - ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. - integer :: istate - do istate = 1, N_states - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_vx_alpha_LDA_w(1,1,istate),size(aos_vx_alpha_LDA_w,1),0.d0,& - potential_x_alpha_ao_LDA(1,1,istate),size(potential_x_alpha_ao_LDA,1)) - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_vx_beta_LDA_w(1,1,istate),size(aos_vx_beta_LDA_w,1),0.d0,& - potential_x_beta_ao_LDA(1,1,istate),size(potential_x_beta_ao_LDA,1)) - enddo - -END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_c_alpha_ao_LDA,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_c_beta_ao_LDA,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC -! short range correlation alpha/beta potentials with LDA functional on the |AO| basis - END_DOC - ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. - integer :: istate - do istate = 1, N_states - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_vc_alpha_LDA_w(1,1,istate),size(aos_vc_alpha_LDA_w,1),0.d0,& - potential_c_alpha_ao_LDA(1,1,istate),size(potential_c_alpha_ao_LDA,1)) - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_vc_beta_LDA_w(1,1,istate),size(aos_vc_beta_LDA_w,1),0.d0,& - potential_c_beta_ao_LDA(1,1,istate),size(potential_c_beta_ao_LDA,1)) - enddo - -END_PROVIDER - diff --git a/src/dft_utils_one_e/pot_ao_lda_smashed.irp.f b/src/dft_utils_one_e/pot_ao_lda_smashed.irp.f deleted file mode 100644 index c71f34bfb..000000000 --- a/src/dft_utils_one_e/pot_ao_lda_smashed.irp.f +++ /dev/null @@ -1,53 +0,0 @@ - - BEGIN_PROVIDER[double precision, aos_vxc_alpha_LDA_w, (n_points_final_grid,ao_num,N_states)] -&BEGIN_PROVIDER[double precision, aos_vxc_beta_LDA_w, (n_points_final_grid,ao_num,N_states)] - implicit none - BEGIN_DOC -! aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - END_DOC - integer :: istate,i,j - double precision :: r(3) - double precision :: mu,weight - double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b - double precision, allocatable :: rhoa(:),rhob(:) - double precision :: mu_local - mu_local = 1.d-9 - allocate(rhoa(N_states), rhob(N_states)) - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rhoa(istate) = one_e_dm_alpha_at_r(i,istate) - rhob(istate) = one_e_dm_beta_at_r(i,istate) - call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) - call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) - do j =1, ao_num - aos_vxc_alpha_LDA_w(i,j,istate) = (vc_a + vx_a) * aos_in_r_array(j,i)*weight - aos_vxc_beta_LDA_w(i,j,istate) = (vc_b + vx_b) * aos_in_r_array(j,i)*weight - enddo - enddo - enddo - - END_PROVIDER - - - BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_LDA,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_xc_beta_ao_LDA ,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC -! short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis - END_DOC - integer :: istate - double precision :: wall_1,wall_2 - call wall_time(wall_1) - print*,'providing the XC potentials LDA ' - do istate = 1, N_states - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vxc_alpha_LDA_w(1,1,istate),n_points_final_grid,0.d0,potential_xc_alpha_ao_LDA(1,1,istate),ao_num) - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vxc_beta_LDA_w(1,1,istate) ,n_points_final_grid,0.d0,potential_xc_beta_ao_LDA(1,1,istate),ao_num) - enddo - call wall_time(wall_2) - - END_PROVIDER - diff --git a/src/dft_utils_one_e/pot_ao_pbe.irp.f b/src/dft_utils_one_e/pot_ao_pbe.irp.f deleted file mode 100644 index ccbb17130..000000000 --- a/src/dft_utils_one_e/pot_ao_pbe.irp.f +++ /dev/null @@ -1,191 +0,0 @@ - BEGIN_PROVIDER[double precision, aos_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_vx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dvc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dvc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dvx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dvx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] - implicit none - BEGIN_DOC -! aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - END_DOC - integer :: istate,i,j,m - double precision :: r(3) - double precision :: mu,weight - double precision, allocatable :: ex(:), ec(:) - double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) - double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) - double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) - double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) - allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) - allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) - allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) - allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) - allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) - - aos_dvc_alpha_PBE_w = 0.d0 - aos_dvc_beta_PBE_w = 0.d0 - aos_dvx_alpha_PBE_w = 0.d0 - aos_dvx_beta_PBE_w = 0.d0 - - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) - grad_rho_a_2 = 0.d0 - grad_rho_b_2 = 0.d0 - grad_rho_a_b = 0.d0 - do m = 1, 3 - grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) - grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) - grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) - enddo - - ! inputs - call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange - ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation - ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - vx_rho_a(istate) *= weight - vc_rho_a(istate) *= weight - vx_rho_b(istate) *= weight - vc_rho_b(istate) *= weight - do m= 1,3 - contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - enddo - do j = 1, ao_num - aos_vc_alpha_PBE_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i) - aos_vc_beta_PBE_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i) - aos_vx_alpha_PBE_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i) - aos_vx_beta_PBE_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i) - enddo - do j = 1, ao_num - do m = 1,3 - aos_dvc_alpha_PBE_w(j,i,istate) += contrib_grad_ca(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dvc_beta_PBE_w (j,i,istate) += contrib_grad_cb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dvx_alpha_PBE_w(j,i,istate) += contrib_grad_xa(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dvx_beta_PBE_w (j,i,istate) += contrib_grad_xb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - enddo - enddo - enddo - enddo - - END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_scal_x_alpha_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_scal_c_alpha_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_scal_x_beta_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_scal_c_beta_ao_PBE, (ao_num,ao_num,N_states)] - implicit none - integer :: istate - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential - END_DOC - pot_scal_c_alpha_ao_PBE = 0.d0 - pot_scal_x_alpha_ao_PBE = 0.d0 - pot_scal_c_beta_ao_PBE = 0.d0 - pot_scal_x_beta_ao_PBE = 0.d0 - double precision :: wall_1,wall_2 - call wall_time(wall_1) - do istate = 1, N_states - ! correlation alpha - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_vc_alpha_PBE_w(1,1,istate),size(aos_vc_alpha_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_scal_c_alpha_ao_PBE(1,1,istate),size(pot_scal_c_alpha_ao_PBE,1)) - ! correlation beta - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_vc_beta_PBE_w(1,1,istate),size(aos_vc_beta_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_scal_c_beta_ao_PBE(1,1,istate),size(pot_scal_c_beta_ao_PBE,1)) - ! exchange alpha - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_vx_alpha_PBE_w(1,1,istate),size(aos_vx_alpha_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_scal_x_alpha_ao_PBE(1,1,istate),size(pot_scal_x_alpha_ao_PBE,1)) - ! exchange beta - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_vx_beta_PBE_w(1,1,istate),size(aos_vx_beta_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_scal_x_beta_ao_PBE(1,1,istate), size(pot_scal_x_beta_ao_PBE,1)) - - enddo - call wall_time(wall_2) - -END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_grad_x_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_grad_x_beta_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_grad_c_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_grad_c_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals - END_DOC - integer :: istate - double precision :: wall_1,wall_2 - call wall_time(wall_1) - pot_grad_c_alpha_ao_PBE = 0.d0 - pot_grad_x_alpha_ao_PBE = 0.d0 - pot_grad_c_beta_ao_PBE = 0.d0 - pot_grad_x_beta_ao_PBE = 0.d0 - do istate = 1, N_states - ! correlation alpha - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dvc_alpha_PBE_w(1,1,istate),size(aos_dvc_alpha_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_grad_c_alpha_ao_PBE(1,1,istate),size(pot_grad_c_alpha_ao_PBE,1)) - ! correlation beta - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dvc_beta_PBE_w(1,1,istate),size(aos_dvc_beta_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_grad_c_beta_ao_PBE(1,1,istate),size(pot_grad_c_beta_ao_PBE,1)) - ! exchange alpha - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dvx_alpha_PBE_w(1,1,istate),size(aos_dvx_alpha_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_grad_x_alpha_ao_PBE(1,1,istate),size(pot_grad_x_alpha_ao_PBE,1)) - ! exchange beta - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dvx_beta_PBE_w(1,1,istate),size(aos_dvx_beta_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_grad_x_beta_ao_PBE(1,1,istate),size(pot_grad_x_beta_ao_PBE,1)) - enddo - - call wall_time(wall_2) - -END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_x_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_x_beta_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_c_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_c_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional - END_DOC - integer :: i,j,istate - do istate = 1, n_states - do i = 1, ao_num - do j = 1, ao_num - potential_x_alpha_ao_PBE(j,i,istate) = pot_scal_x_alpha_ao_PBE(j,i,istate) + pot_grad_x_alpha_ao_PBE(j,i,istate) + pot_grad_x_alpha_ao_PBE(i,j,istate) - potential_x_beta_ao_PBE(j,i,istate) = pot_scal_x_beta_ao_PBE(j,i,istate) + pot_grad_x_beta_ao_PBE(j,i,istate) + pot_grad_x_beta_ao_PBE(i,j,istate) - - potential_c_alpha_ao_PBE(j,i,istate) = pot_scal_c_alpha_ao_PBE(j,i,istate) + pot_grad_c_alpha_ao_PBE(j,i,istate) + pot_grad_c_alpha_ao_PBE(i,j,istate) - potential_c_beta_ao_PBE(j,i,istate) = pot_scal_c_beta_ao_PBE(j,i,istate) + pot_grad_c_beta_ao_PBE(j,i,istate) + pot_grad_c_beta_ao_PBE(i,j,istate) - enddo - enddo - enddo - -END_PROVIDER diff --git a/src/dft_utils_one_e/pot_ao_pbe_smashed.irp.f b/src/dft_utils_one_e/pot_ao_pbe_smashed.irp.f deleted file mode 100644 index 4b492ab9a..000000000 --- a/src/dft_utils_one_e/pot_ao_pbe_smashed.irp.f +++ /dev/null @@ -1,147 +0,0 @@ - BEGIN_PROVIDER[double precision, aos_vxc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_vxc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dvxc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dvxc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] - implicit none - BEGIN_DOC -! aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - END_DOC - integer :: istate,i,j,m - double precision :: r(3) - double precision :: mu,weight - double precision, allocatable :: ex(:), ec(:) - double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) - double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) - double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) - double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) - allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) - allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) - allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) - allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) - allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) - - aos_dvxc_alpha_PBE_w = 0.d0 - aos_dvxc_beta_PBE_w = 0.d0 - - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) - grad_rho_a_2 = 0.d0 - grad_rho_b_2 = 0.d0 - grad_rho_a_b = 0.d0 - do m = 1, 3 - grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) - grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) - grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) - enddo - - ! inputs - call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange - ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation - ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - vx_rho_a(istate) *= weight - vc_rho_a(istate) *= weight - vx_rho_b(istate) *= weight - vc_rho_b(istate) *= weight - do m= 1,3 - contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - enddo - do j = 1, ao_num - aos_vxc_alpha_PBE_w(j,i,istate) = ( vc_rho_a(istate) + vx_rho_a(istate) ) * aos_in_r_array(j,i) - aos_vxc_beta_PBE_w (j,i,istate) = ( vc_rho_b(istate) + vx_rho_b(istate) ) * aos_in_r_array(j,i) - enddo - do j = 1, ao_num - do m = 1,3 - aos_dvxc_alpha_PBE_w(j,i,istate) += ( contrib_grad_ca(m,istate) + contrib_grad_xa(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dvxc_beta_PBE_w (j,i,istate) += ( contrib_grad_cb(m,istate) + contrib_grad_xb(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) - enddo - enddo - enddo - enddo - - END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_scal_xc_alpha_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_scal_xc_beta_ao_PBE, (ao_num,ao_num,N_states)] - implicit none - integer :: istate - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential - END_DOC - pot_scal_xc_alpha_ao_PBE = 0.d0 - pot_scal_xc_beta_ao_PBE = 0.d0 - double precision :: wall_1,wall_2 - call wall_time(wall_1) - do istate = 1, N_states - ! exchange - correlation alpha - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_vxc_alpha_PBE_w(1,1,istate),size(aos_vxc_alpha_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_scal_xc_alpha_ao_PBE(1,1,istate),size(pot_scal_xc_alpha_ao_PBE,1)) - ! exchange - correlation beta - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_vxc_beta_PBE_w(1,1,istate),size(aos_vxc_beta_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_scal_xc_beta_ao_PBE(1,1,istate),size(pot_scal_xc_beta_ao_PBE,1)) - enddo - call wall_time(wall_2) - -END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_grad_xc_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_grad_xc_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals - END_DOC - integer :: istate - double precision :: wall_1,wall_2 - call wall_time(wall_1) - pot_grad_xc_alpha_ao_PBE = 0.d0 - pot_grad_xc_beta_ao_PBE = 0.d0 - do istate = 1, N_states - ! correlation alpha - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dvxc_alpha_PBE_w(1,1,istate),size(aos_dvxc_alpha_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_grad_xc_alpha_ao_PBE(1,1,istate),size(pot_grad_xc_alpha_ao_PBE,1)) - ! correlation beta - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dvxc_beta_PBE_w(1,1,istate),size(aos_dvxc_beta_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_grad_xc_beta_ao_PBE(1,1,istate),size(pot_grad_xc_beta_ao_PBE,1)) - enddo - - call wall_time(wall_2) - -END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_xc_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional - END_DOC - integer :: i,j,istate - do istate = 1, n_states - do i = 1, ao_num - do j = 1, ao_num - potential_xc_alpha_ao_PBE(j,i,istate) = pot_scal_xc_alpha_ao_PBE(j,i,istate) + pot_grad_xc_alpha_ao_PBE(j,i,istate) + pot_grad_xc_alpha_ao_PBE(i,j,istate) - potential_xc_beta_ao_PBE(j,i,istate) = pot_scal_xc_beta_ao_PBE(j,i,istate) + pot_grad_xc_beta_ao_PBE(j,i,istate) + pot_grad_xc_beta_ao_PBE(i,j,istate) - enddo - enddo - enddo - -END_PROVIDER diff --git a/src/dft_utils_one_e/sr_exc.irp.f b/src/dft_utils_one_e/sr_exc.irp.f index 43c789402..3c5a6db52 100644 --- a/src/dft_utils_one_e/sr_exc.irp.f +++ b/src/dft_utils_one_e/sr_exc.irp.f @@ -1,10 +1,10 @@ - BEGIN_PROVIDER[double precision, energy_sr_x_LDA, (N_states) ] -&BEGIN_PROVIDER[double precision, energy_sr_c_LDA, (N_states) ] + BEGIN_PROVIDER[double precision, energy_sr_x_lda, (N_states) ] +&BEGIN_PROVIDER[double precision, energy_sr_c_lda, (N_states) ] implicit none BEGIN_DOC -! exchange/correlation energy with the short range LDA functional +! exchange/correlation energy with the short range lda functional END_DOC integer :: istate,i,j double precision :: r(3) @@ -12,8 +12,8 @@ double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b double precision, allocatable :: rhoa(:),rhob(:) allocate(rhoa(N_states), rhob(N_states)) - energy_sr_x_LDA = 0.d0 - energy_sr_c_LDA = 0.d0 + energy_sr_x_lda = 0.d0 + energy_sr_c_lda = 0.d0 do istate = 1, N_states do i = 1, n_points_final_grid r(1) = final_grid_points(1,i) @@ -22,20 +22,20 @@ weight = final_weight_at_r_vector(i) rhoa(istate) = one_e_dm_alpha_at_r(i,istate) rhob(istate) = one_e_dm_beta_at_r(i,istate) - call ec_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) - call ex_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) - energy_sr_x_LDA(istate) += weight * e_x - energy_sr_c_LDA(istate) += weight * e_c + call ec_lda_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) + call ex_lda_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) + energy_sr_x_lda(istate) += weight * e_x + energy_sr_c_lda(istate) += weight * e_c enddo enddo END_PROVIDER - BEGIN_PROVIDER[double precision, energy_sr_x_PBE, (N_states) ] -&BEGIN_PROVIDER[double precision, energy_sr_c_PBE, (N_states) ] + BEGIN_PROVIDER[double precision, energy_sr_x_pbe, (N_states) ] +&BEGIN_PROVIDER[double precision, energy_sr_c_pbe, (N_states) ] implicit none BEGIN_DOC -! exchange/correlation energy with the short range PBE functional +! exchange/correlation energy with the short range pbe functional END_DOC integer :: istate,i,j,m double precision :: r(3) @@ -51,8 +51,8 @@ allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) - energy_sr_x_PBE = 0.d0 - energy_sr_c_PBE = 0.d0 + energy_sr_x_pbe = 0.d0 + energy_sr_c_pbe = 0.d0 do istate = 1, N_states do i = 1, n_points_final_grid r(1) = final_grid_points(1,i) @@ -76,8 +76,8 @@ call GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - energy_sr_x_PBE += ex * weight - energy_sr_c_PBE += ec * weight + energy_sr_x_pbe += ex * weight + energy_sr_c_pbe += ec * weight enddo enddo diff --git a/src/dft_utils_one_e/sr_pot_ao_lda.irp.f b/src/dft_utils_one_e/sr_pot_ao_lda.irp.f deleted file mode 100644 index 1dbc90e7f..000000000 --- a/src/dft_utils_one_e/sr_pot_ao_lda.irp.f +++ /dev/null @@ -1,79 +0,0 @@ - BEGIN_PROVIDER[double precision, aos_sr_vc_alpha_LDA_w, (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vc_beta_LDA_w, (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vx_alpha_LDA_w, (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vx_beta_LDA_w, (ao_num,n_points_final_grid,N_states)] - implicit none - BEGIN_DOC -! 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) - END_DOC - integer :: istate,i,j - double precision :: r(3) - double precision :: mu,weight - double precision :: e_c,sr_vc_a,sr_vc_b,e_x,sr_vx_a,sr_vx_b - double precision, allocatable :: rhoa(:),rhob(:) - allocate(rhoa(N_states), rhob(N_states)) - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rhoa(istate) = one_e_dm_alpha_at_r(i,istate) - rhob(istate) = one_e_dm_beta_at_r(i,istate) - call ec_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b) - call ex_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b) - do j =1, ao_num - aos_sr_vc_alpha_LDA_w(j,i,istate) = sr_vc_a * aos_in_r_array(j,i)*weight - aos_sr_vc_beta_LDA_w(j,i,istate) = sr_vc_b * aos_in_r_array(j,i)*weight - aos_sr_vx_alpha_LDA_w(j,i,istate) = sr_vx_a * aos_in_r_array(j,i)*weight - aos_sr_vx_beta_LDA_w(j,i,istate) = sr_vx_b * aos_in_r_array(j,i)*weight - enddo - enddo - enddo - - END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_sr_x_alpha_ao_LDA,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_sr_x_beta_ao_LDA,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! short range exchange alpha/beta potentials with LDA functional on the |AO| basis - END_DOC - ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. - - integer :: istate - do istate = 1, N_states - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_sr_vx_alpha_LDA_w,size(aos_sr_vx_alpha_LDA_w,1),0.d0,& - potential_sr_x_alpha_ao_LDA,size(potential_sr_x_alpha_ao_LDA,1)) - - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_sr_vx_beta_LDA_w(1,1,istate),size(aos_sr_vx_beta_LDA_w,1),0.d0,& - potential_sr_x_beta_ao_LDA(1,1,istate),size(potential_sr_x_beta_ao_LDA,1)) - enddo - -END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_sr_c_alpha_ao_LDA,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_sr_c_beta_ao_LDA,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC -! short range correlation alpha/beta potentials with LDA functional on the |AO| basis - END_DOC - ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. - integer :: istate - do istate = 1, N_states - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_sr_vc_alpha_LDA_w(1,1,istate),size(aos_sr_vc_alpha_LDA_w,1),0.d0,& - potential_sr_c_alpha_ao_LDA(1,1,istate),size(potential_sr_c_alpha_ao_LDA,1)) - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_sr_vc_beta_LDA_w(1,1,istate),size(aos_sr_vc_beta_LDA_w,1),0.d0,& - potential_sr_c_beta_ao_LDA(1,1,istate),size(potential_sr_c_beta_ao_LDA,1)) - enddo - -END_PROVIDER - diff --git a/src/dft_utils_one_e/sr_pot_ao_lda_smashed.irp.f b/src/dft_utils_one_e/sr_pot_ao_lda_smashed.irp.f deleted file mode 100644 index 1c74d66b9..000000000 --- a/src/dft_utils_one_e/sr_pot_ao_lda_smashed.irp.f +++ /dev/null @@ -1,58 +0,0 @@ - - BEGIN_PROVIDER[double precision, aos_sr_vxc_alpha_LDA_w, (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vxc_beta_LDA_w, (ao_num,n_points_final_grid,N_states)] - implicit none - BEGIN_DOC -! aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - END_DOC - integer :: istate,i,j - double precision :: r(3) - double precision :: mu,weight - double precision :: e_c,sr_vc_a,sr_vc_b,e_x,sr_vx_a,sr_vx_b - double precision, allocatable :: rhoa(:),rhob(:) - double precision :: mu_local - mu_local = mu_erf_dft - allocate(rhoa(N_states), rhob(N_states)) - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rhoa(istate) = one_e_dm_alpha_at_r(i,istate) - rhob(istate) = one_e_dm_beta_at_r(i,istate) - call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b) - call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b) - do j =1, ao_num - aos_sr_vxc_alpha_LDA_w(j,i,istate) = (sr_vc_a + sr_vx_a) * aos_in_r_array(j,i)*weight - aos_sr_vxc_beta_LDA_w(j,i,istate) = (sr_vc_b + sr_vx_b) * aos_in_r_array(j,i)*weight - enddo - enddo - enddo - - END_PROVIDER - - - BEGIN_PROVIDER [double precision, potential_sr_xc_alpha_ao_LDA,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_sr_xc_beta_ao_LDA ,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC -! short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis - END_DOC - - integer :: istate - do istate = 1, N_states - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_sr_vxc_alpha_LDA_w(1,1,istate),size(aos_sr_vxc_alpha_LDA_w,1),0.d0,& - potential_sr_xc_alpha_ao_LDA(1,1,istate),size(potential_sr_xc_alpha_ao_LDA,1)) - - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_in_r_array,size(aos_in_r_array,1), & - aos_sr_vxc_beta_LDA_w(1,1,istate),size(aos_sr_vxc_beta_LDA_w,1),0.d0,& - potential_sr_xc_beta_ao_LDA(1,1,istate),size(potential_sr_xc_beta_ao_LDA,1)) - enddo - - - END_PROVIDER - diff --git a/src/dft_utils_one_e/sr_pot_ao_pbe.irp.f b/src/dft_utils_one_e/sr_pot_ao_pbe.irp.f deleted file mode 100644 index 78e5c4660..000000000 --- a/src/dft_utils_one_e/sr_pot_ao_pbe.irp.f +++ /dev/null @@ -1,191 +0,0 @@ - BEGIN_PROVIDER[double precision, aos_sr_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dsr_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dsr_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dsr_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dsr_vx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] - implicit none - BEGIN_DOC -! aos_sr_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - END_DOC - integer :: istate,i,j,m - double precision :: r(3) - double precision :: mu,weight - double precision, allocatable :: ex(:), ec(:) - double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) - double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) - double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) - double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) - allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) - allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) - - - allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) - allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) - allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) - aos_dsr_vc_alpha_PBE_w= 0.d0 - aos_dsr_vc_beta_PBE_w = 0.d0 - aos_dsr_vx_alpha_PBE_w= 0.d0 - aos_dsr_vx_beta_PBE_w = 0.d0 - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) - grad_rho_a_2 = 0.d0 - grad_rho_b_2 = 0.d0 - grad_rho_a_b = 0.d0 - do m = 1, 3 - grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) - grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) - grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) - enddo - - ! inputs - call GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange - ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation - ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - vx_rho_a(istate) *= weight - vc_rho_a(istate) *= weight - vx_rho_b(istate) *= weight - vc_rho_b(istate) *= weight - do m= 1,3 - contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - enddo - do j = 1, ao_num - aos_sr_vc_alpha_PBE_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i) - aos_sr_vc_beta_PBE_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i) - aos_sr_vx_alpha_PBE_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i) - aos_sr_vx_beta_PBE_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i) - enddo - do j = 1, ao_num - do m = 1,3 - aos_dsr_vc_alpha_PBE_w(j,i,istate) += contrib_grad_ca(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dsr_vc_beta_PBE_w (j,i,istate) += contrib_grad_cb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dsr_vx_alpha_PBE_w(j,i,istate) += contrib_grad_xa(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dsr_vx_beta_PBE_w (j,i,istate) += contrib_grad_xb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) - enddo - enddo - enddo - enddo - - END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_sr_scal_x_alpha_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_scal_c_alpha_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_scal_x_beta_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_scal_c_beta_ao_PBE, (ao_num,ao_num,N_states)] - implicit none - integer :: istate - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential - END_DOC - pot_sr_scal_c_alpha_ao_PBE = 0.d0 - pot_sr_scal_x_alpha_ao_PBE = 0.d0 - pot_sr_scal_c_beta_ao_PBE = 0.d0 - pot_sr_scal_x_beta_ao_PBE = 0.d0 - double precision :: wall_1,wall_2 - call wall_time(wall_1) - do istate = 1, N_states - ! correlation alpha - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_sr_vc_alpha_PBE_w(1,1,istate),size(aos_sr_vc_alpha_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_sr_scal_c_alpha_ao_PBE(1,1,istate),size(pot_sr_scal_c_alpha_ao_PBE,1)) - ! correlation beta - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_sr_vc_beta_PBE_w(1,1,istate),size(aos_sr_vc_beta_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_sr_scal_c_beta_ao_PBE(1,1,istate),size(pot_sr_scal_c_beta_ao_PBE,1)) - ! exchange alpha - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_sr_vx_alpha_PBE_w(1,1,istate),size(aos_sr_vx_alpha_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_sr_scal_x_alpha_ao_PBE(1,1,istate),size(pot_sr_scal_x_alpha_ao_PBE,1)) - ! exchange beta - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_sr_vx_beta_PBE_w(1,1,istate),size(aos_sr_vx_beta_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_sr_scal_x_beta_ao_PBE(1,1,istate), size(pot_sr_scal_x_beta_ao_PBE,1)) - - enddo - call wall_time(wall_2) - -END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_sr_grad_x_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_grad_x_beta_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_grad_c_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_grad_c_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals - END_DOC - integer :: istate - double precision :: wall_1,wall_2 - call wall_time(wall_1) - pot_sr_grad_c_alpha_ao_PBE = 0.d0 - pot_sr_grad_x_alpha_ao_PBE = 0.d0 - pot_sr_grad_c_beta_ao_PBE = 0.d0 - pot_sr_grad_x_beta_ao_PBE = 0.d0 - do istate = 1, N_states - ! correlation alpha - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dsr_vc_alpha_PBE_w(1,1,istate),size(aos_dsr_vc_alpha_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_sr_grad_c_alpha_ao_PBE(1,1,istate),size(pot_sr_grad_c_alpha_ao_PBE,1)) - ! correlation beta - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dsr_vc_beta_PBE_w(1,1,istate),size(aos_dsr_vc_beta_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_sr_grad_c_beta_ao_PBE(1,1,istate),size(pot_sr_grad_c_beta_ao_PBE,1)) - ! exchange alpha - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dsr_vx_alpha_PBE_w(1,1,istate),size(aos_dsr_vx_alpha_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_sr_grad_x_alpha_ao_PBE(1,1,istate),size(pot_sr_grad_x_alpha_ao_PBE,1)) - ! exchange beta - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dsr_vx_beta_PBE_w(1,1,istate),size(aos_dsr_vx_beta_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_sr_grad_x_beta_ao_PBE(1,1,istate),size(pot_sr_grad_x_beta_ao_PBE,1)) - enddo - - call wall_time(wall_2) - -END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_sr_x_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_sr_x_beta_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_sr_c_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_sr_c_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional - END_DOC - integer :: i,j,istate - do istate = 1, n_states - do i = 1, ao_num - do j = 1, ao_num - potential_sr_x_alpha_ao_PBE(j,i,istate) = pot_sr_scal_x_alpha_ao_PBE(j,i,istate) + pot_sr_grad_x_alpha_ao_PBE(j,i,istate) + pot_sr_grad_x_alpha_ao_PBE(i,j,istate) - potential_sr_x_beta_ao_PBE(j,i,istate) = pot_sr_scal_x_beta_ao_PBE(j,i,istate) + pot_sr_grad_x_beta_ao_PBE(j,i,istate) + pot_sr_grad_x_beta_ao_PBE(i,j,istate) - - potential_sr_c_alpha_ao_PBE(j,i,istate) = pot_sr_scal_c_alpha_ao_PBE(j,i,istate) + pot_sr_grad_c_alpha_ao_PBE(j,i,istate) + pot_sr_grad_c_alpha_ao_PBE(i,j,istate) - potential_sr_c_beta_ao_PBE(j,i,istate) = pot_sr_scal_c_beta_ao_PBE(j,i,istate) + pot_sr_grad_c_beta_ao_PBE(j,i,istate) + pot_sr_grad_c_beta_ao_PBE(i,j,istate) - enddo - enddo - enddo - -END_PROVIDER diff --git a/src/dft_utils_one_e/sr_pot_ao_pbe_smashed.irp.f b/src/dft_utils_one_e/sr_pot_ao_pbe_smashed.irp.f deleted file mode 100644 index d49321e09..000000000 --- a/src/dft_utils_one_e/sr_pot_ao_pbe_smashed.irp.f +++ /dev/null @@ -1,149 +0,0 @@ - BEGIN_PROVIDER[double precision, aos_sr_vxc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_sr_vxc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dsr_vxc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] -&BEGIN_PROVIDER[double precision, aos_dsr_vxc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] - implicit none - BEGIN_DOC -! aos_sr_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - END_DOC - integer :: istate,i,j,m - double precision :: r(3) - double precision :: mu,weight - double precision, allocatable :: ex(:), ec(:) - double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) - double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) - double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) - double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) - allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) - allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) - - - allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) - allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) - allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) - - aos_dsr_vxc_alpha_PBE_w = 0.d0 - aos_dsr_vxc_beta_PBE_w = 0.d0 - - do istate = 1, N_states - 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) - weight = final_weight_at_r_vector(i) - rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) - grad_rho_a_2 = 0.d0 - grad_rho_b_2 = 0.d0 - grad_rho_a_b = 0.d0 - do m = 1, 3 - grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) - grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) - grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) - enddo - - ! inputs - call GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange - ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation - ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - vx_rho_a(istate) *= weight - vc_rho_a(istate) *= weight - vx_rho_b(istate) *= weight - vc_rho_b(istate) *= weight - do m= 1,3 - contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - enddo - do j = 1, ao_num - aos_sr_vxc_alpha_PBE_w(j,i,istate) = ( vc_rho_a(istate) + vx_rho_a(istate) ) * aos_in_r_array(j,i) - aos_sr_vxc_beta_PBE_w (j,i,istate) = ( vc_rho_b(istate) + vx_rho_b(istate) ) * aos_in_r_array(j,i) - enddo - do j = 1, ao_num - do m = 1,3 - aos_dsr_vxc_alpha_PBE_w(j,i,istate) += ( contrib_grad_ca(m,istate) + contrib_grad_xa(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) - aos_dsr_vxc_beta_PBE_w (j,i,istate) += ( contrib_grad_cb(m,istate) + contrib_grad_xb(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) - enddo - enddo - enddo - enddo - - END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_sr_scal_xc_alpha_ao_PBE, (ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_scal_xc_beta_ao_PBE, (ao_num,ao_num,N_states)] - implicit none - integer :: istate - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential - END_DOC - pot_sr_scal_xc_alpha_ao_PBE = 0.d0 - pot_sr_scal_xc_beta_ao_PBE = 0.d0 - double precision :: wall_1,wall_2 - call wall_time(wall_1) - do istate = 1, N_states - ! exchange - correlation alpha - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_sr_vxc_alpha_PBE_w(1,1,istate),size(aos_sr_vxc_alpha_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_sr_scal_xc_alpha_ao_PBE(1,1,istate),size(pot_sr_scal_xc_alpha_ao_PBE,1)) - ! exchange - correlation beta - call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_sr_vxc_beta_PBE_w(1,1,istate),size(aos_sr_vxc_beta_PBE_w,1), & - aos_in_r_array,size(aos_in_r_array,1),1.d0, & - pot_sr_scal_xc_beta_ao_PBE(1,1,istate),size(pot_sr_scal_xc_beta_ao_PBE,1)) - enddo - call wall_time(wall_2) - -END_PROVIDER - - - BEGIN_PROVIDER [double precision, pot_sr_grad_xc_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, pot_sr_grad_xc_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals - END_DOC - integer :: istate - double precision :: wall_1,wall_2 - call wall_time(wall_1) - pot_sr_grad_xc_alpha_ao_PBE = 0.d0 - pot_sr_grad_xc_beta_ao_PBE = 0.d0 - do istate = 1, N_states - ! exchange - correlation alpha - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dsr_vxc_alpha_PBE_w(1,1,istate),size(aos_dsr_vxc_alpha_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_sr_grad_xc_alpha_ao_PBE(1,1,istate),size(pot_sr_grad_xc_alpha_ao_PBE,1)) - ! exchange - correlation beta - call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & - aos_dsr_vxc_beta_PBE_w(1,1,istate),size(aos_dsr_vxc_beta_PBE_w,1), & - aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & - pot_sr_grad_xc_beta_ao_PBE(1,1,istate),size(pot_sr_grad_xc_beta_ao_PBE,1)) - enddo - - call wall_time(wall_2) - -END_PROVIDER - - BEGIN_PROVIDER [double precision, potential_sr_xc_alpha_ao_PBE,(ao_num,ao_num,N_states)] -&BEGIN_PROVIDER [double precision, potential_sr_xc_beta_ao_PBE,(ao_num,ao_num,N_states)] - implicit none - BEGIN_DOC - ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional - END_DOC - integer :: i,j,istate - do istate = 1, n_states - do i = 1, ao_num - do j = 1, ao_num - potential_sr_xc_alpha_ao_PBE(j,i,istate) = pot_sr_scal_xc_alpha_ao_PBE(j,i,istate) + pot_sr_grad_xc_alpha_ao_PBE(j,i,istate) + pot_sr_grad_xc_alpha_ao_PBE(i,j,istate) - potential_sr_xc_beta_ao_PBE(j,i,istate) = pot_sr_scal_xc_beta_ao_PBE(j,i,istate) + pot_sr_grad_xc_beta_ao_PBE(j,i,istate) + pot_sr_grad_xc_beta_ao_PBE(i,j,istate) - enddo - enddo - enddo - -END_PROVIDER diff --git a/src/dft_utils_one_e/utils.irp.f b/src/dft_utils_one_e/utils.irp.f index 1ebd52efc..06ba4f30b 100644 --- a/src/dft_utils_one_e/utils.irp.f +++ b/src/dft_utils_one_e/utils.irp.f @@ -12,23 +12,9 @@ subroutine GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_ integer :: istate double precision :: r2(3),dr2(3), local_potential,r12,dx2,mu do istate = 1, N_states - if(exchange_functional.EQ."short_range_PBE")then - call ex_pbe_sr(mu_erf_dft,rho_a(istate),rho_b(istate),grad_rho_a_2(istate),grad_rho_b_2(istate),grad_rho_a_b(istate),ex(istate),vx_rho_a(istate),vx_rho_b(istate),vx_grad_rho_a_2(istate),vx_grad_rho_b_2(istate),vx_grad_rho_a_b(istate)) - else if(exchange_functional.EQ."None")then - ex = 0.d0 - vx_rho_a = 0.d0 - vx_rho_b = 0.d0 - vx_grad_rho_a_2 = 0.d0 - vx_grad_rho_a_b = 0.d0 - vx_grad_rho_b_2 = 0.d0 - else - print*, 'Exchange functional required does not exist ...' - print*,'exchange_functional',exchange_functional - stop - endif + call ex_pbe_sr(mu_erf_dft,rho_a(istate),rho_b(istate),grad_rho_a_2(istate),grad_rho_b_2(istate),grad_rho_a_b(istate),ex(istate),vx_rho_a(istate),vx_rho_b(istate),vx_grad_rho_a_2(istate),vx_grad_rho_b_2(istate),vx_grad_rho_a_b(istate)) double precision :: rhoc,rhoo,sigmacc,sigmaco,sigmaoo,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo - if(correlation_functional.EQ."short_range_PBE")then ! convertion from (alpha,beta) formalism to (closed, open) formalism call rho_ab_to_rho_oc(rho_a(istate),rho_b(istate),rhoo,rhoc) call grad_rho_ab_to_grad_rho_oc(grad_rho_a_2(istate),grad_rho_b_2(istate),grad_rho_a_b(istate),sigmaoo,sigmacc,sigmaco) @@ -37,18 +23,6 @@ subroutine GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_ call v_rho_oc_to_v_rho_ab(vrhoo,vrhoc,vc_rho_a(istate),vc_rho_b(istate)) call v_grad_rho_oc_to_v_grad_rho_ab(vsigmaoo,vsigmacc,vsigmaco,vc_grad_rho_a_2(istate),vc_grad_rho_b_2(istate),vc_grad_rho_a_b(istate)) - else if(correlation_functional.EQ."None")then - ec = 0.d0 - vc_rho_a = 0.d0 - vc_rho_b = 0.d0 - vc_grad_rho_a_2 = 0.d0 - vc_grad_rho_a_b = 0.d0 - vc_grad_rho_b_2 = 0.d0 - else - print*, 'Correlation functional required does not exist ...' - print*, 'correlation_functional',correlation_functional - stop - endif enddo end @@ -68,23 +42,9 @@ subroutine GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho double precision :: mu_local mu_local = 1.d-9 do istate = 1, N_states - if(exchange_functional.EQ."PBE")then call ex_pbe_sr(mu_local,rho_a(istate),rho_b(istate),grad_rho_a_2(istate),grad_rho_b_2(istate),grad_rho_a_b(istate),ex(istate),vx_rho_a(istate),vx_rho_b(istate),vx_grad_rho_a_2(istate),vx_grad_rho_b_2(istate),vx_grad_rho_a_b(istate)) - else if(exchange_functional.EQ."None")then - ex = 0.d0 - vx_rho_a = 0.d0 - vx_rho_b = 0.d0 - vx_grad_rho_a_2 = 0.d0 - vx_grad_rho_a_b = 0.d0 - vx_grad_rho_b_2 = 0.d0 - else - print*, 'Exchange functional required does not exist ...' - print*,'exchange_functional',exchange_functional - stop - endif double precision :: rhoc,rhoo,sigmacc,sigmaco,sigmaoo,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo - if(correlation_functional.EQ."PBE")then ! convertion from (alpha,beta) formalism to (closed, open) formalism call rho_ab_to_rho_oc(rho_a(istate),rho_b(istate),rhoo,rhoc) call grad_rho_ab_to_grad_rho_oc(grad_rho_a_2(istate),grad_rho_b_2(istate),grad_rho_a_b(istate),sigmaoo,sigmacc,sigmaco) @@ -93,18 +53,6 @@ subroutine GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho call v_rho_oc_to_v_rho_ab(vrhoo,vrhoc,vc_rho_a(istate),vc_rho_b(istate)) call v_grad_rho_oc_to_v_grad_rho_ab(vsigmaoo,vsigmacc,vsigmaco,vc_grad_rho_a_2(istate),vc_grad_rho_b_2(istate),vc_grad_rho_a_b(istate)) - else if(correlation_functional.EQ."None")then - ec = 0.d0 - vc_rho_a = 0.d0 - vc_rho_b = 0.d0 - vc_grad_rho_a_2 = 0.d0 - vc_grad_rho_a_b = 0.d0 - vc_grad_rho_b_2 = 0.d0 - else - print*, 'Correlation functional required does not exist ...' - print*, 'correlation_functional',correlation_functional - stop - endif enddo end diff --git a/src/dummy/NEED b/src/dummy/NEED index 585884753..c1d788cf7 100644 --- a/src/dummy/NEED +++ b/src/dummy/NEED @@ -20,6 +20,7 @@ dressing electrons ezfio_files fci +functionals generators_cas generators_full hartree_fock diff --git a/src/fci/fci.irp.f b/src/fci/fci.irp.f index 5c7470819..3bae1e45d 100644 --- a/src/fci/fci.irp.f +++ b/src/fci/fci.irp.f @@ -48,7 +48,7 @@ program fci else PROVIDE mo_two_e_integrals_in_map - call run_slave_cipsi + !call run_slave_cipsi endif end diff --git a/src/functionals/NEED b/src/functionals/NEED new file mode 100644 index 000000000..d81183d02 --- /dev/null +++ b/src/functionals/NEED @@ -0,0 +1 @@ +dft_utils_one_e diff --git a/src/functionals/lda.irp.f b/src/functionals/lda.irp.f new file mode 100644 index 000000000..73bb8e5c2 --- /dev/null +++ b/src/functionals/lda.irp.f @@ -0,0 +1,196 @@ + + + + BEGIN_PROVIDER[double precision, energy_x_lda, (N_states) ] + implicit none + BEGIN_DOC +! exchange energy with the lda functional + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_x,vx_a,vx_b + double precision, allocatable :: rhoa(:),rhob(:) + allocate(rhoa(N_states), rhob(N_states)) + energy_x_lda = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ex_lda(rhoa(istate),rhob(istate),e_x,vx_a,vx_b) + energy_x_lda(istate) += weight * e_x + enddo + enddo + + END_PROVIDER + + BEGIN_PROVIDER[double precision, energy_c_lda, (N_states) ] + implicit none + BEGIN_DOC +! correlation energy with the lda functional + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_c,vc_a,vc_b + double precision, allocatable :: rhoa(:),rhob(:) + allocate(rhoa(N_states), rhob(N_states)) + energy_c_lda = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ec_lda(rhoa(istate),rhob(istate),e_c,vc_a,vc_b) + energy_c_lda(istate) += weight * e_c + enddo + enddo + + END_PROVIDER + + + + BEGIN_PROVIDER [double precision, potential_x_alpha_ao_lda,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_x_beta_ao_lda,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! short range exchange alpha/beta potentials with lda functional on the |AO| basis + END_DOC + ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. + integer :: istate + do istate = 1, N_states + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_vx_alpha_lda_w(1,1,istate),size(aos_vx_alpha_lda_w,1),0.d0,& + potential_x_alpha_ao_lda(1,1,istate),size(potential_x_alpha_ao_lda,1)) + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_vx_beta_lda_w(1,1,istate),size(aos_vx_beta_lda_w,1),0.d0,& + potential_x_beta_ao_lda(1,1,istate),size(potential_x_beta_ao_lda,1)) + enddo + +END_PROVIDER + + BEGIN_PROVIDER [double precision, potential_c_alpha_ao_lda,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_beta_ao_lda,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC +! short range correlation alpha/beta potentials with lda functional on the |AO| basis + END_DOC + ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. + integer :: istate + do istate = 1, N_states + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_vc_alpha_lda_w(1,1,istate),size(aos_vc_alpha_lda_w,1),0.d0,& + potential_c_alpha_ao_lda(1,1,istate),size(potential_c_alpha_ao_lda,1)) + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_vc_beta_lda_w(1,1,istate),size(aos_vc_beta_lda_w,1),0.d0,& + potential_c_beta_ao_lda(1,1,istate),size(potential_c_beta_ao_lda,1)) + enddo + +END_PROVIDER + + + + BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_lda,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_xc_beta_ao_lda ,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC +! short range exchange/correlation alpha/beta potentials with lda functional on the AO basis + END_DOC + integer :: istate + double precision :: wall_1,wall_2 + call wall_time(wall_1) + print*,'providing the XC potentials lda ' + do istate = 1, N_states + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vxc_alpha_lda_w(1,1,istate),n_points_final_grid,0.d0,potential_xc_alpha_ao_lda(1,1,istate),ao_num) + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vxc_beta_lda_w(1,1,istate) ,n_points_final_grid,0.d0,potential_xc_beta_ao_lda(1,1,istate),ao_num) + enddo + call wall_time(wall_2) + + END_PROVIDER + + + BEGIN_PROVIDER[double precision, aos_vc_alpha_lda_w, (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vc_beta_lda_w, (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vx_alpha_lda_w, (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vx_beta_lda_w, (ao_num,n_points_final_grid,N_states)] + implicit none + BEGIN_DOC +! aos_vxc_alpha_lda_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b + double precision, allocatable :: rhoa(:),rhob(:) + double precision :: mu_local + mu_local = 1.d-9 + allocate(rhoa(N_states), rhob(N_states)) + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ec_lda_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) + call ex_lda_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) + do j =1, ao_num + aos_vc_alpha_lda_w(j,i,istate) = vc_a * aos_in_r_array(j,i)*weight + aos_vc_beta_lda_w(j,i,istate) = vc_b * aos_in_r_array(j,i)*weight + aos_vx_alpha_lda_w(j,i,istate) = vx_a * aos_in_r_array(j,i)*weight + aos_vx_beta_lda_w(j,i,istate) = vx_b * aos_in_r_array(j,i)*weight + enddo + enddo + enddo + + END_PROVIDER + + + + + + BEGIN_PROVIDER[double precision, aos_vxc_alpha_lda_w, (n_points_final_grid,ao_num,N_states)] +&BEGIN_PROVIDER[double precision, aos_vxc_beta_lda_w, (n_points_final_grid,ao_num,N_states)] + implicit none + BEGIN_DOC +! aos_vxc_alpha_lda_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b + double precision, allocatable :: rhoa(:),rhob(:) + double precision :: mu_local + mu_local = 1.d-9 + allocate(rhoa(N_states), rhob(N_states)) + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ec_lda_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) + call ex_lda_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) + do j =1, ao_num + aos_vxc_alpha_lda_w(i,j,istate) = (vc_a + vx_a) * aos_in_r_array(j,i)*weight + aos_vxc_beta_lda_w(i,j,istate) = (vc_b + vx_b) * aos_in_r_array(j,i)*weight + enddo + enddo + enddo + + END_PROVIDER + diff --git a/src/functionals/none.irp.f b/src/functionals/none.irp.f new file mode 100644 index 000000000..2dc782d42 --- /dev/null +++ b/src/functionals/none.irp.f @@ -0,0 +1,71 @@ +BEGIN_PROVIDER[double precision, energy_x_none, (N_states) ] + implicit none + BEGIN_DOC + ! null exchange energy + END_DOC + energy_x_none = 0.d0 +END_PROVIDER + + +BEGIN_PROVIDER[double precision, energy_c_none, (N_states) ] + implicit none + BEGIN_DOC + ! null correlation energy + END_DOC + energy_c_none = 0.d0 +END_PROVIDER + + +BEGIN_PROVIDER [double precision, potential_x_alpha_ao_none,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! Potential for a null exchange-correlation functional + END_DOC + potential_x_alpha_ao_none = 0.d0 +END_PROVIDER + + +BEGIN_PROVIDER [double precision, potential_x_beta_ao_none,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! Potential for a null exchange-correlation functional + END_DOC + potential_x_beta_ao_none = 0.d0 +END_PROVIDER + + +BEGIN_PROVIDER [double precision, potential_c_alpha_ao_none,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! Potential for a null exchange-correlation functional + END_DOC + potential_c_alpha_ao_none = 0.d0 +END_PROVIDER + + +BEGIN_PROVIDER [double precision, potential_c_beta_ao_none,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! Potential for a null exchange-correlation functional + END_DOC + potential_c_beta_ao_none = 0.d0 +END_PROVIDER + + +BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_none ,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! Potential for a null exchange-correlation functional + END_DOC + potential_xc_alpha_ao_none = 0.d0 +END_PROVIDER + + +BEGIN_PROVIDER [double precision, potential_xc_beta_ao_none ,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! Potential for a null exchange-correlation functional + END_DOC + potential_xc_beta_ao_none = 0.d0 +END_PROVIDER + diff --git a/src/functionals/pbe.irp.f b/src/functionals/pbe.irp.f new file mode 100644 index 000000000..f6122f89f --- /dev/null +++ b/src/functionals/pbe.irp.f @@ -0,0 +1,447 @@ + + + BEGIN_PROVIDER[double precision, energy_x_pbe, (N_states) ] + implicit none + BEGIN_DOC +! exchange/correlation energy with the short range pbe functional + END_DOC + integer :: istate,i,j,m + double precision :: r(3) + double precision :: mu,weight + double precision, allocatable :: ex(:), ec(:) + double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) + double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) + double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) + double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) + allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) + allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) + + + allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) + allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) + energy_x_pbe = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) + grad_rho_a_2 = 0.d0 + grad_rho_b_2 = 0.d0 + grad_rho_a_b = 0.d0 + do m = 1, 3 + grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) + grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) + grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) + enddo + + ! inputs + call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + energy_x_pbe += ex * weight + enddo + enddo + + +END_PROVIDER + +BEGIN_PROVIDER[double precision, energy_c_pbe, (N_states) ] + implicit none + BEGIN_DOC +! exchange/correlation energy with the short range pbe functional + END_DOC + integer :: istate,i,j,m + double precision :: r(3) + double precision :: mu,weight + double precision, allocatable :: ex(:), ec(:) + double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) + double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) + double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) + double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) + allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) + allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) + + + allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) + allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) + energy_c_pbe = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) + grad_rho_a_2 = 0.d0 + grad_rho_b_2 = 0.d0 + grad_rho_a_b = 0.d0 + do m = 1, 3 + grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) + grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) + grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) + enddo + + ! inputs + call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + energy_c_pbe += ec * weight + enddo + enddo + + +END_PROVIDER + + + + BEGIN_PROVIDER [double precision, potential_x_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_x_beta_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_beta_ao_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional + END_DOC + integer :: i,j,istate + do istate = 1, n_states + do i = 1, ao_num + do j = 1, ao_num + potential_x_alpha_ao_pbe(j,i,istate) = pot_scal_x_alpha_ao_pbe(j,i,istate) + pot_grad_x_alpha_ao_pbe(j,i,istate) + pot_grad_x_alpha_ao_pbe(i,j,istate) + potential_x_beta_ao_pbe(j,i,istate) = pot_scal_x_beta_ao_pbe(j,i,istate) + pot_grad_x_beta_ao_pbe(j,i,istate) + pot_grad_x_beta_ao_pbe(i,j,istate) + + potential_c_alpha_ao_pbe(j,i,istate) = pot_scal_c_alpha_ao_pbe(j,i,istate) + pot_grad_c_alpha_ao_pbe(j,i,istate) + pot_grad_c_alpha_ao_pbe(i,j,istate) + potential_c_beta_ao_pbe(j,i,istate) = pot_scal_c_beta_ao_pbe(j,i,istate) + pot_grad_c_beta_ao_pbe(j,i,istate) + pot_grad_c_beta_ao_pbe(i,j,istate) + enddo + enddo + enddo + +END_PROVIDER + + + + BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_xc_beta_ao_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional + END_DOC + integer :: i,j,istate + do istate = 1, n_states + do i = 1, ao_num + do j = 1, ao_num + potential_xc_alpha_ao_pbe(j,i,istate) = pot_scal_xc_alpha_ao_pbe(j,i,istate) + pot_grad_xc_alpha_ao_pbe(j,i,istate) + pot_grad_xc_alpha_ao_pbe(i,j,istate) + potential_xc_beta_ao_pbe(j,i,istate) = pot_scal_xc_beta_ao_pbe(j,i,istate) + pot_grad_xc_beta_ao_pbe(j,i,istate) + pot_grad_xc_beta_ao_pbe(i,j,istate) + enddo + enddo + enddo + +END_PROVIDER + + + BEGIN_PROVIDER[double precision, aos_vc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vx_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vx_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dvc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dvc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dvx_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dvx_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] + implicit none + BEGIN_DOC +! aos_vxc_alpha_pbe_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + END_DOC + integer :: istate,i,j,m + double precision :: r(3) + double precision :: mu,weight + double precision, allocatable :: ex(:), ec(:) + double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) + double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) + double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) + double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) + allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) + allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) + allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) + allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) + allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) + + aos_dvc_alpha_pbe_w = 0.d0 + aos_dvc_beta_pbe_w = 0.d0 + aos_dvx_alpha_pbe_w = 0.d0 + aos_dvx_beta_pbe_w = 0.d0 + + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) + grad_rho_a_2 = 0.d0 + grad_rho_b_2 = 0.d0 + grad_rho_a_b = 0.d0 + do m = 1, 3 + grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) + grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) + grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) + enddo + + ! inputs + call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + vx_rho_a(istate) *= weight + vc_rho_a(istate) *= weight + vx_rho_b(istate) *= weight + vc_rho_b(istate) *= weight + do m= 1,3 + contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + enddo + do j = 1, ao_num + aos_vc_alpha_pbe_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i) + aos_vc_beta_pbe_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i) + aos_vx_alpha_pbe_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i) + aos_vx_beta_pbe_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i) + enddo + do j = 1, ao_num + do m = 1,3 + aos_dvc_alpha_pbe_w(j,i,istate) += contrib_grad_ca(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dvc_beta_pbe_w (j,i,istate) += contrib_grad_cb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dvx_alpha_pbe_w(j,i,istate) += contrib_grad_xa(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dvx_beta_pbe_w (j,i,istate) += contrib_grad_xb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + enddo + enddo + enddo + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_scal_x_alpha_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_scal_c_alpha_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_scal_x_beta_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_scal_c_beta_ao_pbe, (ao_num,ao_num,N_states)] + implicit none + integer :: istate + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential + END_DOC + pot_scal_c_alpha_ao_pbe = 0.d0 + pot_scal_x_alpha_ao_pbe = 0.d0 + pot_scal_c_beta_ao_pbe = 0.d0 + pot_scal_x_beta_ao_pbe = 0.d0 + double precision :: wall_1,wall_2 + call wall_time(wall_1) + do istate = 1, N_states + ! correlation alpha + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_vc_alpha_pbe_w(1,1,istate),size(aos_vc_alpha_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_scal_c_alpha_ao_pbe(1,1,istate),size(pot_scal_c_alpha_ao_pbe,1)) + ! correlation beta + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_vc_beta_pbe_w(1,1,istate),size(aos_vc_beta_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_scal_c_beta_ao_pbe(1,1,istate),size(pot_scal_c_beta_ao_pbe,1)) + ! exchange alpha + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_vx_alpha_pbe_w(1,1,istate),size(aos_vx_alpha_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_scal_x_alpha_ao_pbe(1,1,istate),size(pot_scal_x_alpha_ao_pbe,1)) + ! exchange beta + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_vx_beta_pbe_w(1,1,istate),size(aos_vx_beta_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_scal_x_beta_ao_pbe(1,1,istate), size(pot_scal_x_beta_ao_pbe,1)) + + enddo + call wall_time(wall_2) + +END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_grad_x_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_grad_x_beta_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_grad_c_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_grad_c_beta_ao_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals + END_DOC + integer :: istate + double precision :: wall_1,wall_2 + call wall_time(wall_1) + pot_grad_c_alpha_ao_pbe = 0.d0 + pot_grad_x_alpha_ao_pbe = 0.d0 + pot_grad_c_beta_ao_pbe = 0.d0 + pot_grad_x_beta_ao_pbe = 0.d0 + do istate = 1, N_states + ! correlation alpha + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dvc_alpha_pbe_w(1,1,istate),size(aos_dvc_alpha_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_grad_c_alpha_ao_pbe(1,1,istate),size(pot_grad_c_alpha_ao_pbe,1)) + ! correlation beta + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dvc_beta_pbe_w(1,1,istate),size(aos_dvc_beta_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_grad_c_beta_ao_pbe(1,1,istate),size(pot_grad_c_beta_ao_pbe,1)) + ! exchange alpha + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dvx_alpha_pbe_w(1,1,istate),size(aos_dvx_alpha_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_grad_x_alpha_ao_pbe(1,1,istate),size(pot_grad_x_alpha_ao_pbe,1)) + ! exchange beta + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dvx_beta_pbe_w(1,1,istate),size(aos_dvx_beta_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_grad_x_beta_ao_pbe(1,1,istate),size(pot_grad_x_beta_ao_pbe,1)) + enddo + + call wall_time(wall_2) + +END_PROVIDER + + + BEGIN_PROVIDER[double precision, aos_vxc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vxc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dvxc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dvxc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] + implicit none + BEGIN_DOC +! aos_vxc_alpha_pbe_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + END_DOC + integer :: istate,i,j,m + double precision :: r(3) + double precision :: mu,weight + double precision, allocatable :: ex(:), ec(:) + double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) + double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) + double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) + double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) + allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) + allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) + allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) + allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) + allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) + + aos_dvxc_alpha_pbe_w = 0.d0 + aos_dvxc_beta_pbe_w = 0.d0 + + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) + grad_rho_a_2 = 0.d0 + grad_rho_b_2 = 0.d0 + grad_rho_a_b = 0.d0 + do m = 1, 3 + grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) + grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) + grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) + enddo + + ! inputs + call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + vx_rho_a(istate) *= weight + vc_rho_a(istate) *= weight + vx_rho_b(istate) *= weight + vc_rho_b(istate) *= weight + do m= 1,3 + contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + enddo + do j = 1, ao_num + aos_vxc_alpha_pbe_w(j,i,istate) = ( vc_rho_a(istate) + vx_rho_a(istate) ) * aos_in_r_array(j,i) + aos_vxc_beta_pbe_w (j,i,istate) = ( vc_rho_b(istate) + vx_rho_b(istate) ) * aos_in_r_array(j,i) + enddo + do j = 1, ao_num + do m = 1,3 + aos_dvxc_alpha_pbe_w(j,i,istate) += ( contrib_grad_ca(m,istate) + contrib_grad_xa(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dvxc_beta_pbe_w (j,i,istate) += ( contrib_grad_cb(m,istate) + contrib_grad_xb(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) + enddo + enddo + enddo + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_scal_xc_alpha_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_scal_xc_beta_ao_pbe, (ao_num,ao_num,N_states)] + implicit none + integer :: istate + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential + END_DOC + pot_scal_xc_alpha_ao_pbe = 0.d0 + pot_scal_xc_beta_ao_pbe = 0.d0 + double precision :: wall_1,wall_2 + call wall_time(wall_1) + do istate = 1, N_states + ! exchange - correlation alpha + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_vxc_alpha_pbe_w(1,1,istate),size(aos_vxc_alpha_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_scal_xc_alpha_ao_pbe(1,1,istate),size(pot_scal_xc_alpha_ao_pbe,1)) + ! exchange - correlation beta + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_vxc_beta_pbe_w(1,1,istate),size(aos_vxc_beta_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_scal_xc_beta_ao_pbe(1,1,istate),size(pot_scal_xc_beta_ao_pbe,1)) + enddo + call wall_time(wall_2) + +END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_grad_xc_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_grad_xc_beta_ao_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals + END_DOC + integer :: istate + double precision :: wall_1,wall_2 + call wall_time(wall_1) + pot_grad_xc_alpha_ao_pbe = 0.d0 + pot_grad_xc_beta_ao_pbe = 0.d0 + do istate = 1, N_states + ! correlation alpha + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dvxc_alpha_pbe_w(1,1,istate),size(aos_dvxc_alpha_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_grad_xc_alpha_ao_pbe(1,1,istate),size(pot_grad_xc_alpha_ao_pbe,1)) + ! correlation beta + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dvxc_beta_pbe_w(1,1,istate),size(aos_dvxc_beta_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_grad_xc_beta_ao_pbe(1,1,istate),size(pot_grad_xc_beta_ao_pbe,1)) + enddo + + call wall_time(wall_2) + +END_PROVIDER diff --git a/src/functionals/sr_lda.irp.f b/src/functionals/sr_lda.irp.f new file mode 100644 index 000000000..0e009542b --- /dev/null +++ b/src/functionals/sr_lda.irp.f @@ -0,0 +1,195 @@ + + + + BEGIN_PROVIDER[double precision, energy_x_sr_lda, (N_states) ] + implicit none + BEGIN_DOC +! exchange energy with the short range lda functional + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_x,vx_a,vx_b + double precision, allocatable :: rhoa(:),rhob(:) + allocate(rhoa(N_states), rhob(N_states)) + energy_x_sr_lda = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ex_lda_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) + energy_x_sr_lda(istate) += weight * e_x + enddo + enddo + + END_PROVIDER + + BEGIN_PROVIDER[double precision, energy_c_sr_lda, (N_states) ] + implicit none + BEGIN_DOC +! exchange energy with the short range lda functional + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_c,vc_a,vc_b + double precision, allocatable :: rhoa(:),rhob(:) + allocate(rhoa(N_states), rhob(N_states)) + energy_c_sr_lda = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ec_lda_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) + energy_c_sr_lda(istate) += weight * e_c + enddo + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, potential_x_alpha_ao_sr_lda,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_x_beta_ao_sr_lda,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! short range exchange alpha/beta potentials with lda functional on the |AO| basis + END_DOC + ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. + + integer :: istate + do istate = 1, N_states + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_sr_vx_alpha_lda_w,size(aos_sr_vx_alpha_lda_w,1),0.d0,& + potential_x_alpha_ao_sr_lda,size(potential_x_alpha_ao_sr_lda,1)) + + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_sr_vx_beta_lda_w(1,1,istate),size(aos_sr_vx_beta_lda_w,1),0.d0,& + potential_x_beta_ao_sr_lda(1,1,istate),size(potential_x_beta_ao_sr_lda,1)) + enddo + +END_PROVIDER + + BEGIN_PROVIDER [double precision, potential_c_alpha_ao_sr_lda,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_beta_ao_sr_lda,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC +! short range correlation alpha/beta potentials with lda functional on the |AO| basis + END_DOC + ! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states. + integer :: istate + do istate = 1, N_states + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_sr_vc_alpha_lda_w(1,1,istate),size(aos_sr_vc_alpha_lda_w,1),0.d0,& + potential_c_alpha_ao_sr_lda(1,1,istate),size(potential_c_alpha_ao_sr_lda,1)) + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_sr_vc_beta_lda_w(1,1,istate),size(aos_sr_vc_beta_lda_w,1),0.d0,& + potential_c_beta_ao_sr_lda(1,1,istate),size(potential_c_beta_ao_sr_lda,1)) + enddo + +END_PROVIDER + + BEGIN_PROVIDER[double precision, aos_sr_vc_alpha_lda_w, (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vc_beta_lda_w, (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vx_alpha_lda_w, (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vx_beta_lda_w, (ao_num,n_points_final_grid,N_states)] + implicit none + BEGIN_DOC +! 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) + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_c,sr_vc_a,sr_vc_b,e_x,sr_vx_a,sr_vx_b + double precision, allocatable :: rhoa(:),rhob(:) + allocate(rhoa(N_states), rhob(N_states)) + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ec_lda_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b) + call ex_lda_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b) + do j =1, ao_num + aos_sr_vc_alpha_lda_w(j,i,istate) = sr_vc_a * aos_in_r_array(j,i)*weight + aos_sr_vc_beta_lda_w(j,i,istate) = sr_vc_b * aos_in_r_array(j,i)*weight + aos_sr_vx_alpha_lda_w(j,i,istate) = sr_vx_a * aos_in_r_array(j,i)*weight + aos_sr_vx_beta_lda_w(j,i,istate) = sr_vx_b * aos_in_r_array(j,i)*weight + enddo + enddo + enddo + + END_PROVIDER + + + BEGIN_PROVIDER[double precision, aos_sr_vxc_alpha_lda_w, (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vxc_beta_lda_w, (ao_num,n_points_final_grid,N_states)] + implicit none + BEGIN_DOC +! aos_sr_vxc_alpha_lda_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + END_DOC + integer :: istate,i,j + double precision :: r(3) + double precision :: mu,weight + double precision :: e_c,sr_vc_a,sr_vc_b,e_x,sr_vx_a,sr_vx_b + double precision, allocatable :: rhoa(:),rhob(:) + double precision :: mu_local + mu_local = mu_erf_dft + allocate(rhoa(N_states), rhob(N_states)) + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ec_lda_sr(mu_local,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b) + call ex_lda_sr(mu_local,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b) + do j =1, ao_num + aos_sr_vxc_alpha_lda_w(j,i,istate) = (sr_vc_a + sr_vx_a) * aos_in_r_array(j,i)*weight + aos_sr_vxc_beta_lda_w(j,i,istate) = (sr_vc_b + sr_vx_b) * aos_in_r_array(j,i)*weight + enddo + enddo + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_sr_lda,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_xc_beta_ao_sr_lda ,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC +! short range exchange/correlation alpha/beta potentials with lda functional on the AO basis + END_DOC + + integer :: istate + do istate = 1, N_states + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_sr_vxc_alpha_lda_w(1,1,istate),size(aos_sr_vxc_alpha_lda_w,1),0.d0,& + potential_xc_alpha_ao_sr_lda(1,1,istate),size(potential_xc_alpha_ao_sr_lda,1)) + + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_in_r_array,size(aos_in_r_array,1), & + aos_sr_vxc_beta_lda_w(1,1,istate),size(aos_sr_vxc_beta_lda_w,1),0.d0,& + potential_xc_beta_ao_sr_lda(1,1,istate),size(potential_xc_beta_ao_sr_lda,1)) + enddo + + + END_PROVIDER + diff --git a/src/functionals/sr_pbe.irp.f b/src/functionals/sr_pbe.irp.f new file mode 100644 index 000000000..c0cd3cd1b --- /dev/null +++ b/src/functionals/sr_pbe.irp.f @@ -0,0 +1,397 @@ + + BEGIN_PROVIDER[double precision, energy_x_sr_pbe, (N_states) ] +&BEGIN_PROVIDER[double precision, energy_c_sr_pbe, (N_states) ] + implicit none + BEGIN_DOC +! exchange/correlation energy with the short range pbe functional + END_DOC + integer :: istate,i,j,m + double precision :: r(3) + double precision :: mu,weight + double precision, allocatable :: ex(:), ec(:) + double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) + double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) + double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) + double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) + allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) + allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) + + + allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) + allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) + energy_x_sr_pbe = 0.d0 + energy_c_sr_pbe = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) + grad_rho_a_2 = 0.d0 + grad_rho_b_2 = 0.d0 + grad_rho_a_b = 0.d0 + do m = 1, 3 + grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) + grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) + grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) + enddo + + ! inputs + call GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + energy_x_sr_pbe += ex * weight + energy_c_sr_pbe += ec * weight + enddo + enddo + + +END_PROVIDER + + + BEGIN_PROVIDER[double precision, aos_sr_vc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vx_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vx_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dsr_vc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dsr_vc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dsr_vx_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dsr_vx_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] + implicit none + BEGIN_DOC +! aos_sr_vxc_alpha_pbe_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + END_DOC + integer :: istate,i,j,m + double precision :: r(3) + double precision :: mu,weight + double precision, allocatable :: ex(:), ec(:) + double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) + double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) + double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) + double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) + allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) + allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) + + + allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) + allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) + allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) + aos_dsr_vc_alpha_pbe_w= 0.d0 + aos_dsr_vc_beta_pbe_w = 0.d0 + aos_dsr_vx_alpha_pbe_w= 0.d0 + aos_dsr_vx_beta_pbe_w = 0.d0 + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) + grad_rho_a_2 = 0.d0 + grad_rho_b_2 = 0.d0 + grad_rho_a_b = 0.d0 + do m = 1, 3 + grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) + grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) + grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) + enddo + + ! inputs + call GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + vx_rho_a(istate) *= weight + vc_rho_a(istate) *= weight + vx_rho_b(istate) *= weight + vc_rho_b(istate) *= weight + do m= 1,3 + contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + enddo + do j = 1, ao_num + aos_sr_vc_alpha_pbe_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i) + aos_sr_vc_beta_pbe_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i) + aos_sr_vx_alpha_pbe_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i) + aos_sr_vx_beta_pbe_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i) + enddo + do j = 1, ao_num + do m = 1,3 + aos_dsr_vc_alpha_pbe_w(j,i,istate) += contrib_grad_ca(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dsr_vc_beta_pbe_w (j,i,istate) += contrib_grad_cb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dsr_vx_alpha_pbe_w(j,i,istate) += contrib_grad_xa(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dsr_vx_beta_pbe_w (j,i,istate) += contrib_grad_xb(m,istate) * aos_grad_in_r_array_transp_xyz(m,j,i) + enddo + enddo + enddo + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_sr_scal_x_alpha_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_scal_c_alpha_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_scal_x_beta_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_scal_c_beta_ao_pbe, (ao_num,ao_num,N_states)] + implicit none + integer :: istate + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential + END_DOC + pot_sr_scal_c_alpha_ao_pbe = 0.d0 + pot_sr_scal_x_alpha_ao_pbe = 0.d0 + pot_sr_scal_c_beta_ao_pbe = 0.d0 + pot_sr_scal_x_beta_ao_pbe = 0.d0 + double precision :: wall_1,wall_2 + call wall_time(wall_1) + do istate = 1, N_states + ! correlation alpha + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_sr_vc_alpha_pbe_w(1,1,istate),size(aos_sr_vc_alpha_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_sr_scal_c_alpha_ao_pbe(1,1,istate),size(pot_sr_scal_c_alpha_ao_pbe,1)) + ! correlation beta + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_sr_vc_beta_pbe_w(1,1,istate),size(aos_sr_vc_beta_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_sr_scal_c_beta_ao_pbe(1,1,istate),size(pot_sr_scal_c_beta_ao_pbe,1)) + ! exchange alpha + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_sr_vx_alpha_pbe_w(1,1,istate),size(aos_sr_vx_alpha_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_sr_scal_x_alpha_ao_pbe(1,1,istate),size(pot_sr_scal_x_alpha_ao_pbe,1)) + ! exchange beta + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_sr_vx_beta_pbe_w(1,1,istate),size(aos_sr_vx_beta_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_sr_scal_x_beta_ao_pbe(1,1,istate), size(pot_sr_scal_x_beta_ao_pbe,1)) + + enddo + call wall_time(wall_2) + +END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_sr_grad_x_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_grad_x_beta_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_grad_c_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_grad_c_beta_ao_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals + END_DOC + integer :: istate + double precision :: wall_1,wall_2 + call wall_time(wall_1) + pot_sr_grad_c_alpha_ao_pbe = 0.d0 + pot_sr_grad_x_alpha_ao_pbe = 0.d0 + pot_sr_grad_c_beta_ao_pbe = 0.d0 + pot_sr_grad_x_beta_ao_pbe = 0.d0 + do istate = 1, N_states + ! correlation alpha + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dsr_vc_alpha_pbe_w(1,1,istate),size(aos_dsr_vc_alpha_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_sr_grad_c_alpha_ao_pbe(1,1,istate),size(pot_sr_grad_c_alpha_ao_pbe,1)) + ! correlation beta + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dsr_vc_beta_pbe_w(1,1,istate),size(aos_dsr_vc_beta_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_sr_grad_c_beta_ao_pbe(1,1,istate),size(pot_sr_grad_c_beta_ao_pbe,1)) + ! exchange alpha + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dsr_vx_alpha_pbe_w(1,1,istate),size(aos_dsr_vx_alpha_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_sr_grad_x_alpha_ao_pbe(1,1,istate),size(pot_sr_grad_x_alpha_ao_pbe,1)) + ! exchange beta + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dsr_vx_beta_pbe_w(1,1,istate),size(aos_dsr_vx_beta_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_sr_grad_x_beta_ao_pbe(1,1,istate),size(pot_sr_grad_x_beta_ao_pbe,1)) + enddo + + call wall_time(wall_2) + +END_PROVIDER + + BEGIN_PROVIDER [double precision, potential_x_alpha_ao_sr_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_x_beta_ao_sr_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_alpha_ao_sr_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_c_beta_ao_sr_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional + END_DOC + integer :: i,j,istate + do istate = 1, n_states + do i = 1, ao_num + do j = 1, ao_num + potential_x_alpha_ao_sr_pbe(j,i,istate) = pot_sr_scal_x_alpha_ao_pbe(j,i,istate) + pot_sr_grad_x_alpha_ao_pbe(j,i,istate) + pot_sr_grad_x_alpha_ao_pbe(i,j,istate) + potential_x_beta_ao_sr_pbe(j,i,istate) = pot_sr_scal_x_beta_ao_pbe(j,i,istate) + pot_sr_grad_x_beta_ao_pbe(j,i,istate) + pot_sr_grad_x_beta_ao_pbe(i,j,istate) + + potential_c_alpha_ao_sr_pbe(j,i,istate) = pot_sr_scal_c_alpha_ao_pbe(j,i,istate) + pot_sr_grad_c_alpha_ao_pbe(j,i,istate) + pot_sr_grad_c_alpha_ao_pbe(i,j,istate) + potential_c_beta_ao_sr_pbe(j,i,istate) = pot_sr_scal_c_beta_ao_pbe(j,i,istate) + pot_sr_grad_c_beta_ao_pbe(j,i,istate) + pot_sr_grad_c_beta_ao_pbe(i,j,istate) + enddo + enddo + enddo + +END_PROVIDER + + + BEGIN_PROVIDER[double precision, aos_sr_vxc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_sr_vxc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dsr_vxc_alpha_pbe_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_dsr_vxc_beta_pbe_w , (ao_num,n_points_final_grid,N_states)] + implicit none + BEGIN_DOC +! aos_sr_vxc_alpha_pbe_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + END_DOC + integer :: istate,i,j,m + double precision :: r(3) + double precision :: mu,weight + double precision, allocatable :: ex(:), ec(:) + double precision, allocatable :: rho_a(:),rho_b(:),grad_rho_a(:,:),grad_rho_b(:,:),grad_rho_a_2(:),grad_rho_b_2(:),grad_rho_a_b(:) + double precision, allocatable :: contrib_grad_xa(:,:),contrib_grad_xb(:,:),contrib_grad_ca(:,:),contrib_grad_cb(:,:) + double precision, allocatable :: vc_rho_a(:), vc_rho_b(:), vx_rho_a(:), vx_rho_b(:) + double precision, allocatable :: vx_grad_rho_a_2(:), vx_grad_rho_b_2(:), vx_grad_rho_a_b(:), vc_grad_rho_a_2(:), vc_grad_rho_b_2(:), vc_grad_rho_a_b(:) + allocate(vc_rho_a(N_states), vc_rho_b(N_states), vx_rho_a(N_states), vx_rho_b(N_states)) + allocate(vx_grad_rho_a_2(N_states), vx_grad_rho_b_2(N_states), vx_grad_rho_a_b(N_states), vc_grad_rho_a_2(N_states), vc_grad_rho_b_2(N_states), vc_grad_rho_a_b(N_states)) + + + allocate(rho_a(N_states), rho_b(N_states),grad_rho_a(3,N_states),grad_rho_b(3,N_states)) + allocate(grad_rho_a_2(N_states),grad_rho_b_2(N_states),grad_rho_a_b(N_states), ex(N_states), ec(N_states)) + allocate(contrib_grad_xa(3,N_states),contrib_grad_xb(3,N_states),contrib_grad_ca(3,N_states),contrib_grad_cb(3,N_states)) + + aos_dsr_vxc_alpha_pbe_w = 0.d0 + aos_dsr_vxc_beta_pbe_w = 0.d0 + + do istate = 1, N_states + 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) + weight = final_weight_at_r_vector(i) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) + grad_rho_a_2 = 0.d0 + grad_rho_b_2 = 0.d0 + grad_rho_a_b = 0.d0 + do m = 1, 3 + grad_rho_a_2(istate) += grad_rho_a(m,istate) * grad_rho_a(m,istate) + grad_rho_b_2(istate) += grad_rho_b(m,istate) * grad_rho_b(m,istate) + grad_rho_a_b(istate) += grad_rho_a(m,istate) * grad_rho_b(m,istate) + enddo + + ! inputs + call GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + vx_rho_a(istate) *= weight + vc_rho_a(istate) *= weight + vx_rho_b(istate) *= weight + vc_rho_b(istate) *= weight + do m= 1,3 + contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + enddo + do j = 1, ao_num + aos_sr_vxc_alpha_pbe_w(j,i,istate) = ( vc_rho_a(istate) + vx_rho_a(istate) ) * aos_in_r_array(j,i) + aos_sr_vxc_beta_pbe_w (j,i,istate) = ( vc_rho_b(istate) + vx_rho_b(istate) ) * aos_in_r_array(j,i) + enddo + do j = 1, ao_num + do m = 1,3 + aos_dsr_vxc_alpha_pbe_w(j,i,istate) += ( contrib_grad_ca(m,istate) + contrib_grad_xa(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) + aos_dsr_vxc_beta_pbe_w (j,i,istate) += ( contrib_grad_cb(m,istate) + contrib_grad_xb(m,istate) ) * aos_grad_in_r_array_transp_xyz(m,j,i) + enddo + enddo + enddo + enddo + + END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_sr_scal_xc_alpha_ao_pbe, (ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_scal_xc_beta_ao_pbe, (ao_num,ao_num,N_states)] + implicit none + integer :: istate + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the scalar part of the potential + END_DOC + pot_sr_scal_xc_alpha_ao_pbe = 0.d0 + pot_sr_scal_xc_beta_ao_pbe = 0.d0 + double precision :: wall_1,wall_2 + call wall_time(wall_1) + do istate = 1, N_states + ! exchange - correlation alpha + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_sr_vxc_alpha_pbe_w(1,1,istate),size(aos_sr_vxc_alpha_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_sr_scal_xc_alpha_ao_pbe(1,1,istate),size(pot_sr_scal_xc_alpha_ao_pbe,1)) + ! exchange - correlation beta + call dgemm('N','T',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_sr_vxc_beta_pbe_w(1,1,istate),size(aos_sr_vxc_beta_pbe_w,1), & + aos_in_r_array,size(aos_in_r_array,1),1.d0, & + pot_sr_scal_xc_beta_ao_pbe(1,1,istate),size(pot_sr_scal_xc_beta_ao_pbe,1)) + enddo + call wall_time(wall_2) + +END_PROVIDER + + + BEGIN_PROVIDER [double precision, pot_sr_grad_xc_alpha_ao_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, pot_sr_grad_xc_beta_ao_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! intermediate quantity for the calculation of the vxc potentials for the GGA functionals related to the gradienst of the density and orbitals + END_DOC + integer :: istate + double precision :: wall_1,wall_2 + call wall_time(wall_1) + pot_sr_grad_xc_alpha_ao_pbe = 0.d0 + pot_sr_grad_xc_beta_ao_pbe = 0.d0 + do istate = 1, N_states + ! exchange - correlation alpha + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dsr_vxc_alpha_pbe_w(1,1,istate),size(aos_dsr_vxc_alpha_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_sr_grad_xc_alpha_ao_pbe(1,1,istate),size(pot_sr_grad_xc_alpha_ao_pbe,1)) + ! exchange - correlation beta + call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0, & + aos_dsr_vxc_beta_pbe_w(1,1,istate),size(aos_dsr_vxc_beta_pbe_w,1), & + aos_in_r_array_transp,size(aos_in_r_array_transp,1),1.d0, & + pot_sr_grad_xc_beta_ao_pbe(1,1,istate),size(pot_sr_grad_xc_beta_ao_pbe,1)) + enddo + + call wall_time(wall_2) + +END_PROVIDER + + BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_sr_pbe,(ao_num,ao_num,N_states)] +&BEGIN_PROVIDER [double precision, potential_xc_beta_ao_sr_pbe,(ao_num,ao_num,N_states)] + implicit none + BEGIN_DOC + ! exchange / correlation potential for alpha / beta electrons with the Perdew-Burke-Ernzerhof GGA functional + END_DOC + integer :: i,j,istate + do istate = 1, n_states + do i = 1, ao_num + do j = 1, ao_num + potential_xc_alpha_ao_sr_pbe(j,i,istate) = pot_sr_scal_xc_alpha_ao_pbe(j,i,istate) + pot_sr_grad_xc_alpha_ao_pbe(j,i,istate) + pot_sr_grad_xc_alpha_ao_pbe(i,j,istate) + potential_xc_beta_ao_sr_pbe(j,i,istate) = pot_sr_scal_xc_beta_ao_pbe(j,i,istate) + pot_sr_grad_xc_beta_ao_pbe(j,i,istate) + pot_sr_grad_xc_beta_ao_pbe(i,j,istate) + enddo + enddo + enddo + +END_PROVIDER diff --git a/src/kohn_sham_rs/61.rsks.bats b/src/kohn_sham_rs/61.rsks.bats index 27ef20843..558c50273 100644 --- a/src/kohn_sham_rs/61.rsks.bats +++ b/src/kohn_sham_rs/61.rsks.bats @@ -23,19 +23,19 @@ function run() { @test "H3COH" { - run h3coh.ezfio short_range_PBE -115.50238225208 + run h3coh.ezfio sr_pbe -115.50238225208 } @test "HCN" { - run hcn.ezfio short_range_PBE -93.26674673761752 + run hcn.ezfio sr_pbe -93.26674673761752 } @test "N2" { - run n2.ezfio short_range_PBE -109.404692225719 + run n2.ezfio sr_pbe -109.404692225719 } @test "SiH2_3B1" { - run sih2_3b1.ezfio short_range_LDA -289.4398733527755 + run sih2_3b1.ezfio sr_lda -289.4398733527755 } diff --git a/src/kohn_sham_rs/rs_ks_energy.irp.f b/src/kohn_sham_rs/rs_ks_energy.irp.f index 420ff7689..965876dd2 100644 --- a/src/kohn_sham_rs/rs_ks_energy.irp.f +++ b/src/kohn_sham_rs/rs_ks_energy.irp.f @@ -37,6 +37,7 @@ ! ! For a Kohn-Sham or Range-separated Kohn-Sham: the exchange/correlation - 1/2 trace of the V_xc potential END_DOC + extra_e_contrib_density = e_exchange_dft + e_correlation_dft - 0.5d0 * trace_potential_xc END_PROVIDER diff --git a/src/kohn_sham_rs/rs_ks_scf.irp.f b/src/kohn_sham_rs/rs_ks_scf.irp.f index 89ea324ca..5d23544ef 100644 --- a/src/kohn_sham_rs/rs_ks_scf.irp.f +++ b/src/kohn_sham_rs/rs_ks_scf.irp.f @@ -29,13 +29,13 @@ subroutine check_coherence_functional if(exchange_functional.eq."None")then ifound_x = 1 else - ifound_x = index(exchange_functional,"short_range") + ifound_x = index(exchange_functional,"sr") endif if(correlation_functional.eq."None")then ifound_c = 1 else - ifound_c = index(correlation_functional,"short_range") + ifound_c = index(correlation_functional,"sr") endif print*,ifound_x,ifound_c if(ifound_x .eq.0 .or. ifound_c .eq. 0)then diff --git a/src/scf_utils/fock_matrix.irp.f b/src/scf_utils/fock_matrix.irp.f index 4c65f829e..fc9eaaddc 100644 --- a/src/scf_utils/fock_matrix.irp.f +++ b/src/scf_utils/fock_matrix.irp.f @@ -24,33 +24,33 @@ do j=1,elec_beta_num ! F-K - do i=1,elec_beta_num + do i=1,elec_beta_num !CC 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 ! F+K/2 - do i=elec_beta_num+1,elec_alpha_num + do i=elec_beta_num+1,elec_alpha_num !CA 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 ! F - do i=elec_alpha_num+1, mo_num + do i=elec_alpha_num+1, mo_num !CV Fock_matrix_mo(i,j) = 0.5d0*(Fock_matrix_mo_alpha(i,j)+Fock_matrix_mo_beta(i,j)) enddo enddo do j=elec_beta_num+1,elec_alpha_num ! F+K/2 - do i=1,elec_beta_num + do i=1,elec_beta_num !AC 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 ! F - do i=elec_beta_num+1,elec_alpha_num + do i=elec_beta_num+1,elec_alpha_num !AA 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_num + do i=elec_alpha_num+1, mo_num !AV 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 @@ -58,16 +58,16 @@ do j=elec_alpha_num+1, mo_num ! F - do i=1,elec_beta_num + do i=1,elec_beta_num !VC 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_beta_num+1,elec_alpha_num + do i=elec_beta_num+1,elec_alpha_num !VA 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 ! F+K - do i=elec_alpha_num+1,mo_num + do i=elec_alpha_num+1,mo_num !VV 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 @@ -123,22 +123,22 @@ END_DOC if(frozen_orb_scf)then - call mo_to_ao(Fock_matrix_mo,size(Fock_matrix_mo,1), & - Fock_matrix_ao,size(Fock_matrix_ao,1)) - else - if ( (elec_alpha_num == elec_beta_num).and. & - (level_shift == 0.) ) & - then - integer :: i,j - do j=1,ao_num - do i=1,ao_num - Fock_matrix_ao(i,j) = Fock_matrix_ao_alpha(i,j) - enddo - enddo - else - call mo_to_ao(Fock_matrix_mo,size(Fock_matrix_mo,1), & + call mo_to_ao(Fock_matrix_mo,size(Fock_matrix_mo,1), & Fock_matrix_ao,size(Fock_matrix_ao,1)) - endif + else + if ( (elec_alpha_num == elec_beta_num).and. & + (level_shift == 0.) ) & + then + integer :: i,j + do j=1,ao_num + do i=1,ao_num + Fock_matrix_ao(i,j) = Fock_matrix_ao_alpha(i,j) + enddo + enddo + else + call mo_to_ao(Fock_matrix_mo,size(Fock_matrix_mo,1), & + Fock_matrix_ao,size(Fock_matrix_ao,1)) + endif endif END_PROVIDER diff --git a/src/scf_utils/scf_density_matrix_ao.irp.f b/src/scf_utils/scf_density_matrix_ao.irp.f index 6008c8f9e..55fa8e7c5 100644 --- a/src/scf_utils/scf_density_matrix_ao.irp.f +++ b/src/scf_utils/scf_density_matrix_ao.irp.f @@ -1,7 +1,7 @@ BEGIN_PROVIDER [double precision, SCF_density_matrix_ao_alpha, (ao_num,ao_num) ] implicit none BEGIN_DOC - ! S^{-1}.P_alpha.S^{-1} + ! $C.C^t$ over $\alpha$ MOs END_DOC call dgemm('N','T',ao_num,ao_num,elec_alpha_num,1.d0, & @@ -14,7 +14,7 @@ BEGIN_PROVIDER [ double precision, SCF_density_matrix_ao_beta, (ao_num,ao_num) ] implicit none BEGIN_DOC - ! S^{-1}.P_beta.S^{-1} + ! $C.C^t$ over $\beta$ MOs END_DOC call dgemm('N','T',ao_num,ao_num,elec_beta_num,1.d0, & @@ -27,7 +27,7 @@ BEGIN_PROVIDER [ double precision, SCF_density_matrix_ao, (ao_num,ao_num) ] implicit none BEGIN_DOC - ! S^{-1}.P.S^{-1} where P = C.C^t + ! Sum of $\alpha$ and $\beta$ density matrices END_DOC ASSERT (size(SCF_density_matrix_ao,1) == size(SCF_density_matrix_ao_alpha,1)) if (elec_alpha_num== elec_beta_num) then diff --git a/src/tools/molden.irp.f b/src/tools/molden.irp.f index 081e74dbf..6bbbfa396 100644 --- a/src/tools/molden.irp.f +++ b/src/tools/molden.irp.f @@ -5,138 +5,145 @@ program molden END_DOC character*(128) :: output integer :: i_unit_output,getUnitAndOpen - provide ezfio_filename - - integer :: i - print*,trim(ezfio_filename) - output=trim(ezfio_filename)//'.mol' - print*,'output = ',trim(output) - i_unit_output = getUnitAndOpen(output,'w') - print*,'i_unit_output = ',i_unit_output - call write_intro_gamess(i_unit_output) - call write_geometry(i_unit_output) - call write_Ao_basis(i_unit_output) - call write_Mo_basis(i_unit_output) - - - write(i_unit_output,*)'' - write(i_unit_output,*)'' - write(i_unit_output,*)' ------------------------' - - close(i_unit_output) -end - -subroutine write_intro_gamess(i_unit_output) - implicit none - integer, intent(in) :: i_unit_output integer :: i,j,k,l - write(i_unit_output,*)' * GAMESS VERSION = 22 FEB 2006 (R5) *' - write(i_unit_output,*)' * FROM IOWA STATE UNIVERSITY *' - write(i_unit_output,*)' * M.W.SCHMIDT, K.K.BALDRIDGE, J.A.BOATZ, S.T.ELBERT, *' - write(i_unit_output,*)' * M.S.GORDON, J.H.JENSEN, S.KOSEKI, N.MATSUNAGA, *' - write(i_unit_output,*)' * K.A.NGUYEN, S.J.SU, T.L.WINDUS, *' - write(i_unit_output,*)' * TOGETHER WITH M.DUPUIS, J.A.MONTGOMERY *' - write(i_unit_output,*)' * J.COMPUT.CHEM. 14, 1347-1363(1993) *' - write(i_unit_output,*)'' - -end - - - + PROVIDE ezfio_filename -subroutine write_geometry(i_unit_output) - implicit none - integer, intent(in) :: i_unit_output - integer :: i,j,k,l, getUnitAndOpen + output=trim(ezfio_filename)//'.mol' + print*,'output = ',trim(output) + i_unit_output = getUnitAndOpen(output,'w') + write(i_unit_output,'(A)') '[Molden Format]' - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - write(i_unit_output,*)'ATOM ATOMIC COORDINATES (BOHR) ' - write(i_unit_output,*)' CHARGE X Y Z' + write(i_unit_output,'(A)') '[Atoms] AU' do i = 1, nucl_num - ! write(i_unit_output,'(A2 I3 X F3.1 X 3(F16.10))') trim(element_name(int(nucl_charge(i)))),i,(nucl_charge(i)), nucl_coord(i,1), nucl_coord(i,2), nucl_coord(i,3) - write(i_unit_output,'(A2,I1, 9X F5.1 X 3(F16.10 ,4X))') trim(element_name(int(nucl_charge(i)))),i,(nucl_charge(i)), nucl_coord(i,1), nucl_coord(i,2), nucl_coord(i,3) + write(i_unit_output,'(A2,2X,I4,2X,I4,3(2X,F15.10))') & + trim(element_name(int(nucl_charge(i)))), & + i, & + int(nucl_charge(i)), & + nucl_coord(i,1), nucl_coord(i,2), nucl_coord(i,3) enddo - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -end + write(i_unit_output,'(A)') '[GTO]' -subroutine write_Ao_basis(i_unit_output) - implicit none - integer, intent(in) :: i_unit_output - integer :: i,j,k,l, getUnitAndOpen - character*(128) :: character_shell + character*(1) :: character_shell integer :: i_shell,i_prim,i_ao - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - write(i_unit_output,*)'' - write(i_unit_output,*)'' - write(i_unit_output,*)' ATOMIC BASIS SET' - write(i_unit_output,*)' ----------------' - write(i_unit_output,*)'THE CONTRACTED PRIMITIVE FUNCTIONS HAVE BEEN UNNORMALIZED' - write(i_unit_output,*)'THE CONTRACTED BASIS FUNCTIONS ARE NOW NORMALIZED TO UNITY' - write(i_unit_output,*)'' - write(i_unit_output,*)'SHELL TYPE PRIMITIVE EXPONENT CONTRACTION COEFFICIENT(S)' - write(i_unit_output,*)'' - write(i_unit_output,*)'' + integer :: iorder(ao_num) + integer :: nsort(ao_num) i_shell = 0 i_prim = 0 - do i = 1, Nucl_num - write(i_unit_output,'(A2,I1)') trim(element_name(int(nucl_charge(i)))),i - write(i_unit_output,*)' ' - ! write(i_unit_output,*)'Nucl_num_shell_Aos(i) = ',Nucl_num_shell_Aos(i) - do j = 1, Nucl_num_shell_Aos(i) + do i=1,nucl_num + write(i_unit_output,*) i, 0 + do j=1,nucl_num_shell_aos(i) i_shell +=1 - i_ao = Nucl_list_shell_Aos(i,j) + i_ao = nucl_list_shell_aos(i,j) character_shell = trim(ao_l_char(i_ao)) - ! write(i_unit_output,*),j,i_shell,i_ao!trim(character_shell) + write(i_unit_output,*) character_shell, ao_prim_num(i_ao), '1.00' do k = 1, ao_prim_num(i_ao) i_prim +=1 - if(i_prim.lt.100)then - write(i_unit_output,'(4X,I3,3X,A1,6X,I2,6X,F16.7,2X,F16.12)')i_shell,character_shell,i_prim,ao_expo(i_ao,k),ao_coef(i_ao,k) - else - write(i_unit_output,'(4X,I3,3X,A1,5X,I3,6X,F16.7,2X,F16.12)')i_shell,character_shell,i_prim,ao_expo(i_ao,k),ao_coef(i_ao,k) - endif + write(i_unit_output,'(E20.10,2X,E20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k) + enddo + l = i_ao + do while ( ao_l(l) == ao_l(i_ao) ) + nsort(l) = i*10000 + j*100 + l += 1 + if (l > ao_num) exit enddo write(i_unit_output,*)'' enddo enddo - write(i_unit_output,*)'' - write(i_unit_output,'(A47,2X,I3)')'TOTAL NUMBER OF BASIS SET SHELLS =', i_shell - write(i_unit_output,'(A47,2X,I3)')'NUMBER OF CARTESIAN GAUSSIAN BASIS FUNCTIONS =', ao_num - ! this is for the new version of molden - write(i_unit_output,'(A12)')'PP =NONE' - write(i_unit_output,*)'' - -end - -subroutine write_Mo_basis(i_unit_output) - implicit none - integer, intent(in) :: i_unit_output - integer :: i,j,k,l, getUnitAndOpen - integer :: i_5,i_mod - - write(i_unit_output,*) ' ----------------------' - write(i_unit_output,*) ' MCSCF NATURAL ORBITALS' - write(i_unit_output,*) ' ----------------------' - write(i_unit_output,*) ' ' + do i=1,ao_num + iorder(i) = i + ! p + if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 1 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 2 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 3 + ! d + else if ((ao_power(i,1) == 2 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 1 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 2 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 2 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 2 )) then + nsort(i) += 3 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 4 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 5 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 6 + ! f + else if ((ao_power(i,1) == 3 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 1 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 3 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 2 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 3 )) then + nsort(i) += 3 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 2 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 4 + else if ((ao_power(i,1) == 2 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 5 + else if ((ao_power(i,1) == 2 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 6 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 2 )) then + nsort(i) += 7 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 2 )) then + nsort(i) += 8 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 2 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 9 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 10 + ! g + else if ((ao_power(i,1) == 4 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 1 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 4 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 2 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 4 )) then + nsort(i) += 3 + else if ((ao_power(i,1) == 3 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 4 + else if ((ao_power(i,1) == 3 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 5 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 3 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 6 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 3 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 7 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 3 )) then + nsort(i) += 8 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 3 )) then + nsort(i) += 9 + else if ((ao_power(i,1) == 2 ).and.(ao_power(i,2) == 2 ).and.(ao_power(i,3) == 0 )) then + nsort(i) += 10 + else if ((ao_power(i,1) == 2 ).and.(ao_power(i,2) == 0 ).and.(ao_power(i,3) == 2 )) then + nsort(i) += 11 + else if ((ao_power(i,1) == 0 ).and.(ao_power(i,2) == 2 ).and.(ao_power(i,3) == 2 )) then + nsort(i) += 12 + else if ((ao_power(i,1) == 2 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 13 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 2 ).and.(ao_power(i,3) == 1 )) then + nsort(i) += 14 + else if ((ao_power(i,1) == 1 ).and.(ao_power(i,2) == 1 ).and.(ao_power(i,3) == 2 )) then + nsort(i) += 15 + endif + enddo - 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 - write(i_unit_output,*)'' - do i = 1, ao_num - ! write(i_unit_output,'(2X,I3, 2X A1, I3, 2X A4 , F9.6)')i,trim(element_name(int(nucl_charge(ao_nucl(i))))),ao_nucl(i),(ao_l_char_space(i)),mo_coef(i,j) - ! F12.6 for larger coefficients... - write(i_unit_output,'(2X,I3, 2X A1, I3, 2X A4 , F12.6)')i,trim(element_name(int(nucl_charge(ao_nucl(i))))),ao_nucl(i),(ao_l_char_space(i)),mo_coef(i,j) - ! write(i_unit_output,'(I3, X A1, X I3, X A4 X F16.8)')i,trim(element_name(int(nucl_charge(ao_nucl(i))))),ao_nucl(i),(ao_l_char_space(i)) + call isort(nsort,iorder,ao_num) + write(i_unit_output,'(A)') '[MO]' + do i=1,mo_num + write (i_unit_output,*) 'Sym= 1' + write (i_unit_output,*) 'Ene=', fock_matrix_diag_mo(i) + write (i_unit_output,*) 'Spin= Alpha' + write (i_unit_output,*) 'Occup=', mo_occ(i) + do j=1,ao_num + write(i_unit_output, '(I6,2X,E20.10)') j, mo_coef(iorder(j),i) enddo - write(i_unit_output,*)'' enddo - + close(i_unit_output) end + diff --git a/src/tools/print_ci_vectors.irp.f b/src/tools/print_ci_vectors.irp.f new file mode 100644 index 000000000..9ba06d9af --- /dev/null +++ b/src/tools/print_ci_vectors.irp.f @@ -0,0 +1,35 @@ +program print_ci_vectors + implicit none + BEGIN_DOC + ! Print the ground state wave function stored in the |EZFIO| directory + ! 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 :) + END_DOC + + + ! this has to be done in order to be sure that N_det, psi_det and + ! psi_coef are the wave function stored in the |EZFIO| directory. + read_wf = .True. + touch read_wf + call routine +end + +subroutine routine + implicit none + integer :: i,k + integer :: degree + do i = 1, N_det + print *, 'Determinant ', i + call debug_det(psi_det(1,1,i),N_int) + print '(4E20.12,X)', (psi_coef(i,k), k=1,N_states) + print *, '' + print *, '' + enddo + +end