10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-18 12:03:57 +01:00

tri alpha/beta simple pour filter_connected_davidson

This commit is contained in:
Yann Garniron 2015-10-21 15:50:15 +02:00
parent 4af7cf1104
commit b6000270ca
11 changed files with 703 additions and 162 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ build.ninja
bin/ bin/
lib/ lib/
config/qp_create_ninja.pickle config/qp_create_ninja.pickle
*/*/README.rst

View File

@ -118,7 +118,7 @@ Documentation
Undocumented Undocumented
`h_apply_cas_sd <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L531>`_ `h_apply_cas_sd <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L536>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
@ -127,92 +127,92 @@ Documentation
Undocumented Undocumented
`h_apply_cas_sd_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L113>`_ `h_apply_cas_sd_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L118>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_cas_sd_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L68>`_ `h_apply_cas_sd_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L96>`_
Undocumented Undocumented
`h_apply_cas_sd_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L381>`_ `h_apply_cas_sd_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L386>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_cas_sd_pt2 <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L3148>`_ `h_apply_cas_sd_pt2 <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L3171>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cas_sd_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2519>`_ `h_apply_cas_sd_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2537>`_
Undocumented Undocumented
`h_apply_cas_sd_pt2_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2651>`_ `h_apply_cas_sd_pt2_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2674>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_cas_sd_pt2_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2595>`_ `h_apply_cas_sd_pt2_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2641>`_
Undocumented Undocumented
`h_apply_cas_sd_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2960>`_ `h_apply_cas_sd_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2983>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_cas_sd_selected <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2271>`_ `h_apply_cas_sd_selected <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2288>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cas_sd_selected_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1606>`_ `h_apply_cas_sd_selected_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1618>`_
Undocumented Undocumented
`h_apply_cas_sd_selected_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1740>`_ `h_apply_cas_sd_selected_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1757>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_cas_sd_selected_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1683>`_ `h_apply_cas_sd_selected_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1723>`_
Undocumented Undocumented
`h_apply_cas_sd_selected_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2069>`_ `h_apply_cas_sd_selected_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L2086>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_cas_sd_selected_no_skip <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1386>`_ `h_apply_cas_sd_selected_no_skip <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1397>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cas_sd_selected_no_skip_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L721>`_ `h_apply_cas_sd_selected_no_skip_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L727>`_
Undocumented Undocumented
`h_apply_cas_sd_selected_no_skip_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L855>`_ `h_apply_cas_sd_selected_no_skip_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L866>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_cas_sd_selected_no_skip_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L798>`_ `h_apply_cas_sd_selected_no_skip_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L832>`_
Undocumented Undocumented
`h_apply_cas_sd_selected_no_skip_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1184>`_ `h_apply_cas_sd_selected_no_skip_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/CAS_SD/H_apply.irp.f_shell_22#L1195>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.

View File

@ -27,7 +27,7 @@ Documentation
Undocumented Undocumented
`h_apply_fci <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L668>`_ `h_apply_fci <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L673>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
@ -36,192 +36,192 @@ Documentation
Undocumented Undocumented
`h_apply_fci_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L137>`_ `h_apply_fci_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L142>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_fci_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L80>`_ `h_apply_fci_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L108>`_
Undocumented Undocumented
`h_apply_fci_mono <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3306>`_ `h_apply_fci_mono <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3329>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_fci_mono_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2639>`_ `h_apply_fci_mono_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2657>`_
Undocumented Undocumented
`h_apply_fci_mono_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2773>`_ `h_apply_fci_mono_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2796>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_fci_mono_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2716>`_ `h_apply_fci_mono_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2762>`_
Undocumented Undocumented
`h_apply_fci_mono_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3102>`_ `h_apply_fci_mono_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3125>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_fci_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L466>`_ `h_apply_fci_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L471>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_fci_no_skip <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2419>`_ `h_apply_fci_no_skip <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2436>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_fci_no_skip_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1754>`_ `h_apply_fci_no_skip_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1766>`_
Undocumented Undocumented
`h_apply_fci_no_skip_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1888>`_ `h_apply_fci_no_skip_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1905>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_fci_no_skip_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1831>`_ `h_apply_fci_no_skip_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1871>`_
Undocumented Undocumented
`h_apply_fci_no_skip_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2217>`_ `h_apply_fci_no_skip_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L2234>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_fci_pt2 <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1545>`_ `h_apply_fci_pt2 <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1556>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_fci_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L916>`_ `h_apply_fci_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L922>`_
Undocumented Undocumented
`h_apply_fci_pt2_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1048>`_ `h_apply_fci_pt2_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1059>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_fci_pt2_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L992>`_ `h_apply_fci_pt2_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1026>`_
Undocumented Undocumented
`h_apply_fci_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1357>`_ `h_apply_fci_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L1368>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_pt2_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5100>`_ `h_apply_pt2_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5135>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_pt2_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4469>`_ `h_apply_pt2_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4499>`_
Undocumented Undocumented
`h_apply_pt2_mono_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4601>`_ `h_apply_pt2_mono_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4636>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_pt2_mono_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4545>`_ `h_apply_pt2_mono_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4603>`_
Undocumented Undocumented
`h_apply_pt2_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4910>`_ `h_apply_pt2_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4945>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_pt2_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6851>`_ `h_apply_pt2_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6898>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_pt2_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6222>`_ `h_apply_pt2_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6264>`_
Undocumented Undocumented
`h_apply_pt2_mono_di_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6354>`_ `h_apply_pt2_mono_di_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6401>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_pt2_mono_di_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6298>`_ `h_apply_pt2_mono_di_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6368>`_
Undocumented Undocumented
`h_apply_pt2_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6663>`_ `h_apply_pt2_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6710>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_select_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4221>`_ `h_apply_select_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4250>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_select_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3554>`_ `h_apply_select_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3578>`_
Undocumented Undocumented
`h_apply_select_mono_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3688>`_ `h_apply_select_mono_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3717>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_select_mono_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3631>`_ `h_apply_select_mono_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L3683>`_
Undocumented Undocumented
`h_apply_select_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4017>`_ `h_apply_select_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L4046>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_select_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5974>`_ `h_apply_select_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L6015>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_select_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5309>`_ `h_apply_select_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5345>`_
Undocumented Undocumented
`h_apply_select_mono_di_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5443>`_ `h_apply_select_mono_di_delta_rho_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5484>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_select_mono_di_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5386>`_ `h_apply_select_mono_di_delta_rho_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5450>`_
Undocumented Undocumented
`h_apply_select_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5772>`_ `h_apply_select_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/Full_CI/H_apply.irp.f_shell_43#L5813>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.

View File

@ -258,11 +258,11 @@ Documentation
N_states lowest eigenvalues of the dressed CI matrix N_states lowest eigenvalues of the dressed CI matrix
`create_minilist <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L16>`_ `create_minilist <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L17>`_
Undocumented Undocumented
`davidson_diag_hjj_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/davidson.irp.f#L56>`_ `davidson_diag_hjj_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/davidson.irp.f#L59>`_
Davidson diagonalization with specific diagonal elements of the H matrix Davidson diagonalization with specific diagonal elements of the H matrix
.br .br
H_jj : specific diagonal H matrix elements to diagonalize de Davidson H_jj : specific diagonal H matrix elements to diagonalize de Davidson
@ -283,7 +283,7 @@ Documentation
Initial guess vectors are not necessarily orthonormal Initial guess vectors are not necessarily orthonormal
`davidson_diag_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/davidson.irp.f#L1>`_ `davidson_diag_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/davidson.irp.f#L4>`_
Davidson diagonalization. Davidson diagonalization.
.br .br
dets_in : bitmasks corresponding to determinants dets_in : bitmasks corresponding to determinants
@ -330,10 +330,6 @@ Documentation
Dressing matrix in N_det basis Dressing matrix in N_det basis
`det_inf <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L81>`_
Undocumented
`diagonalize_ci_dressed <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_utils.irp.f#L247>`_ `diagonalize_ci_dressed <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_utils.irp.f#L247>`_
Replace the coefficients of the CI states by the coefficients of the Replace the coefficients of the CI states by the coefficients of the
eigenstates of the CI matrix eigenstates of the CI matrix
@ -378,7 +374,7 @@ Documentation
Find A.C = B Find A.C = B
`find_triples_and_quadruples <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L371>`_ `find_triples_and_quadruples <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L271>`_
Undocumented Undocumented
@ -439,7 +435,7 @@ Documentation
Undocumented Undocumented
`h_apply_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L547>`_ `h_apply_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L552>`_
Calls H_apply on the HF determinant and selects all connected single and double 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. excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
@ -448,17 +444,17 @@ Documentation
Undocumented Undocumented
`h_apply_mrcc_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L121>`_ `h_apply_mrcc_diexcorg <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L126>`_
Generate all double excitations of key_in using the bit masks of holes and Generate all double excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
`h_apply_mrcc_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L72>`_ `h_apply_mrcc_diexcp <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L100>`_
Undocumented Undocumented
`h_apply_mrcc_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L393>`_ `h_apply_mrcc_monoexc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/H_apply.irp.f_shell_27#L398>`_
Generate all single excitations of key_in using the bit masks of holes and Generate all single excitations of key_in using the bit masks of holes and
particles. particles.
Assume N_int is already provided. Assume N_int is already provided.
@ -468,7 +464,15 @@ Documentation
Dressed H with Delta_ij Dressed H with Delta_ij
`h_u_0_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/davidson.irp.f#L360>`_ `h_u_0_mrcc <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/davidson.irp.f#L370>`_
Computes v_0 = H|u_0>
.br
n : number of determinants
.br
H_jj : array of <j|H|j>
`h_u_0_mrcc_org <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/davidson.irp.f#L525>`_
Computes v_0 = H|u_0> Computes v_0 = H|u_0>
.br .br
n : number of determinants n : number of determinants
@ -773,11 +777,11 @@ Documentation
n! n!
`mrcc_dress <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L164>`_ `mrcc_dress <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L65>`_
Undocumented Undocumented
`mrcc_dress_simple <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L325>`_ `mrcc_dress_simple <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L225>`_
Undocumented Undocumented
@ -871,7 +875,7 @@ Documentation
Current status for displaying progress bars. Global variable. Current status for displaying progress bars. Global variable.
`psi_ref_lock <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L3>`_ `psi_ref_lock <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L4>`_
Locks on ref determinants to fill delta_ij Locks on ref determinants to fill delta_ij
@ -944,10 +948,6 @@ Documentation
contains the new order of the elements. contains the new order of the elements.
`sort_detlist <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L139>`_
Undocumented
`start_progress <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/progress.irp.f#L1>`_ `start_progress <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/progress.irp.f#L1>`_
Starts the progress bar Starts the progress bar
@ -956,10 +956,6 @@ Documentation
Stop the progress bar Stop the progress bar
`tamiser <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/mrcc_dress.irp.f#L104>`_
Undocumented
`trap_signals <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/abort.irp.f#L19>`_ `trap_signals <http://github.com/LCPQ/quantum_package/tree/master/plugins/MRCC_Utils/abort.irp.f#L19>`_
What to do when a signal is caught. Here, trap Ctrl-C and call the control_C subroutine. What to do when a signal is caught. Here, trap Ctrl-C and call the control_C subroutine.

View File

@ -1,3 +1,6 @@
subroutine davidson_diag_mrcc(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit,istate) subroutine davidson_diag_mrcc(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit,istate)
use bitmasks use bitmasks
implicit none implicit none
@ -102,6 +105,9 @@ subroutine davidson_diag_hjj_mrcc(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nin
double precision :: to_print(2,N_st) double precision :: to_print(2,N_st)
double precision :: cpu, wall double precision :: cpu, wall
integer(bit_kind) :: dets_in_sorted(Nint,2,sze)
integer :: idx(sze), shortcut(0:sze+1),sh,ii,tmp
PROVIDE det_connections PROVIDE det_connections
call write_time(iunit) call write_time(iunit)
@ -147,6 +153,9 @@ subroutine davidson_diag_hjj_mrcc(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nin
! Initialization ! Initialization
! ============== ! ==============
dets_in_sorted(:,:,:) = dets_in(:,:,:)
call sort_dets_ab(dets_in_sorted, idx, shortcut, sze, Nint)
k_pairs=0 k_pairs=0
do l=1,N_st do l=1,N_st
do k=1,l do k=1,l
@ -205,7 +214,8 @@ subroutine davidson_diag_hjj_mrcc(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nin
! ---------------------- ! ----------------------
do k=1,N_st do k=1,N_st
call H_u_0_mrcc(W(1,k,iter),U(1,k,iter),H_jj,sze,dets_in,Nint,istate) call H_u_0_mrcc(W(1,k,iter),U(1,k,iter),H_jj,sze,dets_in_sorted,shortcut,idx,Nint,istate)
!call H_u_0_mrcc_org(W(1,k,iter),U(1,k,iter),H_jj,sze,dets_in,Nint,istate)
enddo enddo
! Compute h_kl = <u_k | W_l> = <u_k| H |u_l> ! Compute h_kl = <u_k | W_l> = <u_k| H |u_l>
@ -357,7 +367,7 @@ subroutine davidson_diag_hjj_mrcc(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nin
abort_here = abort_all abort_here = abort_all
end end
subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate) subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,shortcut,sort_idx,Nint,istate)
use bitmasks use bitmasks
implicit none implicit none
BEGIN_DOC BEGIN_DOC
@ -377,6 +387,166 @@ subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate)
double precision, allocatable :: vt(:) double precision, allocatable :: vt(:)
integer :: i,j,k,l, jj,ii integer :: i,j,k,l, jj,ii
integer :: i0, j0 integer :: i0, j0
integer,intent(in) :: shortcut(0:n+1), sort_idx(n)
integer :: tmp, warp(2,0:n+1), sh, ni
!
ASSERT (Nint > 0)
ASSERT (Nint == N_int)
ASSERT (n>0)
PROVIDE ref_bitmask_energy delta_ij
integer, parameter :: block_size = 157
!$OMP PARALLEL DEFAULT(NONE) &
!$OMP PRIVATE(i,hij,j,k,idx,jj,vt,ii,warp,tmp,sh) &
!$OMP SHARED(n_det_ref,n_det_non_ref,idx_ref,idx_non_ref,n,H_jj,u_0,keys_tmp,Nint,v_0,istate,delta_ij,shortcut,sort_idx)
!$OMP DO SCHEDULE(static)
do i=1,n
v_0(i) = H_jj(i) * u_0(i)
enddo
!$OMP END DO
allocate(idx(0:n), vt(n))
Vt = 0.d0
!$OMP DO SCHEDULE(dynamic)
do sh=1,shortcut(0)
warp(1,0) = 0
do ii=1,sh!shortcut(0)
tmp = 0
do ni=1,Nint
tmp = popcnt(xor(keys_tmp(ni,1, shortcut(ii)), keys_tmp(ni,1,shortcut(sh))))
end do
if(tmp <= 4) then
tmp = warp(1,0) + 1
warp(1,0) = tmp
warp(1,tmp) = shortcut(ii)
warp(2,tmp) = shortcut(ii+1)-1
end if
end do
do ii=shortcut(sh),shortcut(sh+1)-1
idx(0) = ii
!call filter_connected_davidson_mwen(keys_tmp,shortcut,keys_tmp(1,1,ii),Nint,ii-1,idx)
call filter_connected_davidson_warp(keys_tmp,warp,keys_tmp(1,1,ii),Nint,ii-1,idx)
i = sort_idx(ii)
do jj=1,idx(0)
j = sort_idx(idx(jj))
!j = idx(jj)
if ( (dabs(u_0(j)) > 1.d-7).or.((dabs(u_0(i)) > 1.d-7)) ) then
call i_H_j(keys_tmp(1,1,idx(jj)),keys_tmp(1,1,ii),Nint,hij)
vt (i) = vt (i) + hij*u_0(j)
vt (j) = vt (j) + hij*u_0(i)
endif
enddo
enddo
enddo
!$OMP END DO
!$OMP DO SCHEDULE(guided)
do ii=1,n_det_ref
i = idx_ref(ii)
do jj = 1, n_det_non_ref
j = idx_non_ref(jj)
vt (i) = vt (i) + delta_ij(ii,jj,istate)*u_0(j)
vt (j) = vt (j) + delta_ij(ii,jj,istate)*u_0(i)
enddo
enddo
!$OMP END DO
!$OMP CRITICAL
do i=1,n
v_0(i) = v_0(i) + vt(i)
enddo
!$OMP END CRITICAL
deallocate(idx,vt)
!$OMP END PARALLEL
!
!
!
! ASSERT (Nint > 0)
! ASSERT (Nint == N_int)
! ASSERT (n>0)
! PROVIDE ref_bitmask_energy delta_ij
! integer, parameter :: block_size = 157
! !$OMP PARALLEL DEFAULT(NONE) &
! !$OMP PRIVATE(i,hij,j,k,idx,jj,ii,vt) &
! !$OMP SHARED(n_det_ref,n_det_non_ref,idx_ref,idx_non_ref,n,H_jj,u_0,keys_tmp,Nint,v_0,istate,delta_ij)
! !$OMP DO SCHEDULE(static)
! do i=1,n
! v_0(i) = H_jj(i) * u_0(i)
! enddo
! !$OMP END DO
! allocate(idx(0:n), vt(n))
! Vt = 0.d0
! !$OMP DO SCHEDULE(guided)
! do i=1,n
! idx(0) = i
! call filter_connected_davidson(keys_tmp,keys_tmp(1,1,i),Nint,i-1,idx)
! do jj=1,idx(0)
! j = idx(jj)
! ! if ( (dabs(u_0(j)) > 1.d-7).or.((dabs(u_0(i)) > 1.d-7)) ) then
! call i_H_j(keys_tmp(1,1,j),keys_tmp(1,1,i),Nint,hij)
! hij = hij
! vt (i) = vt (i) + hij*u_0(j)
! vt (j) = vt (j) + hij*u_0(i)
! ! endif
! enddo
! enddo
! !$OMP END DO
!
! !$OMP DO SCHEDULE(guided)
! do ii=1,n_det_ref
! i = idx_ref(ii)
! do jj = 1, n_det_non_ref
! j = idx_non_ref(jj)
! vt (i) = vt (i) + delta_ij(ii,jj,istate)*u_0(j)
! vt (j) = vt (j) + delta_ij(ii,jj,istate)*u_0(i)
! enddo
! enddo
! !$OMP END DO
! !$OMP CRITICAL
! do i=1,n
! v_0(i) = v_0(i) + vt(i)
! enddo
! !$OMP END CRITICAL
! deallocate(idx,vt)
! !$OMP END PARALLEL
end
subroutine H_u_0_mrcc_org(v_0,u_0,H_jj,n,keys_tmp,Nint,istate)
use bitmasks
implicit none
BEGIN_DOC
! Computes v_0 = H|u_0>
!
! n : number of determinants
!
! H_jj : array of <j|H|j>
END_DOC
integer, intent(in) :: n,Nint,istate
double precision, intent(out) :: v_0(n)
double precision, intent(in) :: u_0(n)
double precision, intent(in) :: H_jj(n)
integer(bit_kind),intent(in) :: keys_tmp(Nint,2,n)
integer, allocatable :: idx(:)
double precision :: hij
double precision, allocatable :: vt(:)
integer :: i,j,k,l, jj,ii
integer :: i0, j0
ASSERT (Nint > 0) ASSERT (Nint > 0)
ASSERT (Nint == N_int) ASSERT (Nint == N_int)
ASSERT (n>0) ASSERT (n>0)
@ -427,4 +597,3 @@ subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate)
!$OMP END PARALLEL !$OMP END PARALLEL
end end

View File

@ -1,4 +1,5 @@
use omp_lib use omp_lib
use bitmasks
BEGIN_PROVIDER [ integer(omp_lock_kind), psi_ref_lock, (psi_det_size) ] BEGIN_PROVIDER [ integer(omp_lock_kind), psi_ref_lock, (psi_det_size) ]
implicit none implicit none
@ -94,7 +95,6 @@ subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_ref, Ndet_non_ref,i_generator,n
integer :: idx_miniList(N_det_non_ref), N_miniList integer :: idx_miniList(N_det_non_ref), N_miniList
call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq) call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq)
allocate (dIa_hla(N_states,Ndet_non_ref)) allocate (dIa_hla(N_states,Ndet_non_ref))
@ -286,6 +286,7 @@ subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq
integer :: c_ref integer :: c_ref
integer :: connected_to_ref integer :: connected_to_ref
N_tq = 0 N_tq = 0
do i=1,N_selected do i=1,N_selected
c_ref = connected_to_ref(det_buffer(1,1,i),psi_det_generators,Nint, & c_ref = connected_to_ref(det_buffer(1,1,i),psi_det_generators,Nint, &

View File

@ -1,13 +1,15 @@
subroutine $subroutine_diexc(key_in, hole_1,particl_1, hole_2, particl_2, i_generator, iproc_in $parameters ) subroutine $subroutine_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, i_generator, iproc_in $parameters )
integer(bit_kind), intent(in) :: key_in(N_int, 2), hole_1(N_int, 2), hole_2(N_int, 2) integer(bit_kind), intent(in) :: key_in(N_int, 2), hole_1(N_int, 2), hole_2(N_int, 2)
integer(bit_kind), intent(in) :: particl_1(N_int, 2), particl_2(N_int, 2) integer(bit_kind), intent(in) :: particl_1(N_int, 2), particl_2(N_int, 2)
integer(bit_kind) :: p1_mask(N_int, 2), p2_mask(N_int, 2) integer(bit_kind) :: p1_mask(N_int, 2), p2_mask(N_int, 2), tmp
integer,intent(in) :: i_generator,iproc_in integer,intent(in) :: i_generator,iproc_in
integer(bit_kind) :: status(N_int*bit_kind_size, 2) integer(bit_kind) :: status(N_int*bit_kind_size, 2)
integer :: highest, p1,p2,sp,ni,i,mi integer :: highest, p1,p2,sp,ni,i,mi,nt,ns
integer(bit_kind), intent(in) :: key_prev(N_int, 2, *)
$declarations $declarations
@ -29,6 +31,32 @@ subroutine $subroutine_diexc(key_in, hole_1,particl_1, hole_2, particl_2, i_gene
end do end do
end do end do
! GEL D'ELECTRONS
! nt = 0
! do i=1,i_generator-1
! if(key_in(1,1) == key_prev(1,1,i)) then
! tmp = xor(key_in(1,2), key_prev(1,2,i))
! if(popcnt(tmp) == 2) then
! ns = 1+trailz(iand(tmp, key_in(1,2)))
! if(status(ns, 2) /= 0) then
! nt += 1
! end if
! status(ns, 2) = 0
! end if
! else if(key_in(1,2) == key_prev(1,2,i)) then
! tmp = xor(key_in(1,1), key_prev(1,1,i))
! if(popcnt(tmp) == 2) then
! ns = 1+trailz(iand(tmp, key_in(1,1)))
! if(status(ns, 1) /= 0) then
! nt += 1
! end if
! status(ns, 1) = 0
! end if
! end if
! end do
! print *, "nt", nt, i_generator
do sp=1,2 do sp=1,2
do p1=1,highest do p1=1,highest
if(status(p1, sp) == 0) then if(status(p1, sp) == 0) then
@ -76,35 +104,12 @@ subroutine $subroutine_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2,
p1_mask(:,:) = 0 p1_mask(:,:) = 0
p2_mask(:,:) = 0 p2_mask(:,:) = 0
p1_mask(fh1/bit_kind_size + 1, fs1) = 2**(mod(fh1-1,bit_kind_size)) p1_mask(ishft(fh1,-bit_kind_shift) + 1, fs1) = ishft(1,iand(fh1-1,bit_kind_size-1))
p2_mask(fh2/bit_kind_size + 1, fs2) = 2**(mod(fh2-1,bit_kind_size)) p2_mask(ishft(fh2,-bit_kind_shift) + 1, fs2) = ishft(1,iand(fh2-1,bit_kind_size-1))
! n_alpha = 0
! n_beta = 0
key_mask(:,:) = key_in(:,:) key_mask(:,:) = key_in(:,:)
key_mask(fh1/bit_kind_size + 1, fs1) -= 2**(mod(fh1-1,bit_kind_size)) key_mask(ishft(fh1,-bit_kind_shift) + 1, fs1) -= ishft(1,iand(fh1-1,bit_kind_size-1))
key_mask(fh2/bit_kind_size + 1, fs2) -= 2**(mod(fh2-1,bit_kind_size)) key_mask(ishft(fh2,-bit_kind_shift) + 1, fs2) -= ishft(1,iand(fh2-1,bit_kind_size-1))
!
! do i=1,N_int
! n_alpha = n_alpha + popcnt(key_mask(i, 1))
! n_beta = n_beta + popcnt(key_mask(i, 2))
! end do
!
! do i=1, N_det
! deg(1) = n_alpha
! deg(2) = n_beta
!
! do ni = 1, N_int
! ! deg(1) = deg(1) - popcnt(iand(key_mask(ni, 1), psi_non_ref(ni, 1, i)))
! ! deg(2) = deg(2) - popcnt(iand(key_mask(ni, 2), psi_non_ref(ni, 2, i)))
! end do
!
!
! if(deg(1) + deg(2) <= 2) then
! ! ndet_out = ndet_out + 1
! ! idx(ndet_out) = i
! end if
! end do
call $subroutine_diexcOrg(key_in, key_mask, p1_mask, particl_1, p2_mask, particl_2, i_generator, iproc_in $parameters ) call $subroutine_diexcOrg(key_in, key_mask, p1_mask, particl_1, p2_mask, particl_2, i_generator, iproc_in $parameters )
end subroutine end subroutine
@ -530,7 +535,6 @@ subroutine $subroutine($params_main)
nmax = mod( N_det_generators,nproc ) nmax = mod( N_det_generators,nproc )
!$ call omp_init_lock(lck) !$ call omp_init_lock(lck)
call start_progress(N_det_generators,'Selection (norm)',0.d0) call start_progress(N_det_generators,'Selection (norm)',0.d0)
@ -572,6 +576,7 @@ subroutine $subroutine($params_main)
enddo enddo
if($do_double_excitations)then if($do_double_excitations)then
call $subroutine_diexc(psi_det_generators(1,1,i_generator), & call $subroutine_diexc(psi_det_generators(1,1,i_generator), &
psi_det_generators(1,1,1), &
mask(1,1,d_hole1), mask(1,1,d_part1), & mask(1,1,d_hole1), mask(1,1,d_part1), &
mask(1,1,d_hole2), mask(1,1,d_part2), & mask(1,1,d_hole2), mask(1,1,d_part2), &
i_generator, iproc $params_post) i_generator, iproc $params_post)
@ -632,6 +637,7 @@ subroutine $subroutine($params_main)
if($do_double_excitations)then if($do_double_excitations)then
call $subroutine_diexc(psi_det_generators(1,1,i_generator), & call $subroutine_diexc(psi_det_generators(1,1,i_generator), &
psi_det_generators(1,1,1), &
mask(1,1,d_hole1), mask(1,1,d_part1), & mask(1,1,d_hole1), mask(1,1,d_part1), &
mask(1,1,d_hole2), mask(1,1,d_part2), & mask(1,1,d_hole2), mask(1,1,d_part2), &
i_generator, iproc $params_post) i_generator, iproc $params_post)

View File

@ -54,7 +54,7 @@ Documentation
.. by the `update_README.py` script. .. by the `update_README.py` script.
`a_operator <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1109>`_ `a_operator <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1155>`_
Needed for diag_H_mat_elem Needed for diag_H_mat_elem
@ -66,7 +66,7 @@ Documentation
Max and min values of the coefficients Max and min values of the coefficients
`ac_operator <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1154>`_ `ac_operator <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1200>`_
Needed for diag_H_mat_elem Needed for diag_H_mat_elem
@ -157,11 +157,11 @@ Documentation
of alpha and beta determinants of alpha and beta determinants
`davidson_converged <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L382>`_ `davidson_converged <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L491>`_
True if the Davidson algorithm is converged True if the Davidson algorithm is converged
`davidson_criterion <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L372>`_ `davidson_criterion <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L481>`_
Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] Can be : [ energy | residual | both | wall_time | cpu_time | iterations ]
@ -184,7 +184,7 @@ Documentation
Initial guess vectors are not necessarily orthonormal Initial guess vectors are not necessarily orthonormal
`davidson_diag_hjj <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L68>`_ `davidson_diag_hjj <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L168>`_
Davidson diagonalization with specific diagonal elements of the H matrix Davidson diagonalization with specific diagonal elements of the H matrix
.br .br
H_jj : specific diagonal H matrix elements to diagonalize de Davidson H_jj : specific diagonal H matrix elements to diagonalize de Davidson
@ -213,7 +213,7 @@ Documentation
Max number of Davidson sizes Max number of Davidson sizes
`davidson_threshold <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L373>`_ `davidson_threshold <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L482>`_
Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] Can be : [ energy | residual | both | wall_time | cpu_time | iterations ]
@ -229,10 +229,14 @@ Documentation
det_coef det_coef
`det_connections <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1284>`_ `det_connections <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1356>`_
Build connection proxy between determinants Build connection proxy between determinants
`det_inf <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L69>`_
Undocumented
`det_num <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/ezfio_interface.irp.f#L248>`_ `det_num <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/ezfio_interface.irp.f#L248>`_
det_num det_num
@ -253,7 +257,7 @@ Documentation
Diagonalization algorithm (Davidson or Lapack) Diagonalization algorithm (Davidson or Lapack)
`diag_h_mat_elem <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1047>`_ `diag_h_mat_elem <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1093>`_
Computes <i|H|i> Computes <i|H|i>
@ -313,7 +317,7 @@ Documentation
idx(0) is the number of determinants that interact with key1 idx(0) is the number of determinants that interact with key1
`filter_connected_davidson <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L163>`_ `filter_connected_davidson <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L318>`_
Filters out the determinants that are not connected by H Filters out the determinants that are not connected by H
returns the array idx which contains the index of the returns the array idx which contains the index of the
determinants in the array key1 that interact determinants in the array key1 that interact
@ -323,7 +327,27 @@ Documentation
key1 should come from psi_det_sorted_ab. key1 should come from psi_det_sorted_ab.
`filter_connected_i_h_psi0 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L293>`_ `filter_connected_davidson_shortcut <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L253>`_
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.
.br
idx(0) is the number of determinants that interact with key1
key1 should come from psi_det_sorted_ab.
`filter_connected_davidson_warp <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L161>`_
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.
.br
idx(0) is the number of determinants that interact with key1
key1 should come from psi_det_sorted_ab.
`filter_connected_i_h_psi0 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L448>`_
returns the array idx which contains the index of the returns the array idx which contains the index of the
.br .br
determinants in the array key1 that interact determinants in the array key1 that interact
@ -333,7 +357,7 @@ Documentation
idx(0) is the number of determinants that interact with key1 idx(0) is the number of determinants that interact with key1
`filter_connected_i_h_psi0_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L392>`_ `filter_connected_i_h_psi0_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/filter_connected.irp.f#L547>`_
standard filter_connected_i_H_psi but returns in addition standard filter_connected_i_H_psi but returns in addition
.br .br
the array of the index of the non connected determinants to key1 the array of the index of the non connected determinants to key1
@ -359,7 +383,7 @@ Documentation
Create a wave function from all possible alpha x beta determinants Create a wave function from all possible alpha x beta determinants
`get_double_excitation <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L141>`_ `get_double_excitation <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L187>`_
Returns the two excitation operators between two doubly excited determinants and the phase Returns the two excitation operators between two doubly excited determinants and the phase
@ -371,7 +395,7 @@ Documentation
Returns the excitation degree between two determinants Returns the excitation degree between two determinants
`get_excitation_degree_vector <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L952>`_ `get_excitation_degree_vector <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L998>`_
Applies get_excitation_degree to an array of determinants Applies get_excitation_degree to an array of determinants
@ -387,11 +411,11 @@ Documentation
Returns the index of the determinant in the ``psi_det_sorted_bit`` array Returns the index of the determinant in the ``psi_det_sorted_bit`` array
`get_mono_excitation <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L274>`_ `get_mono_excitation <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L320>`_
Returns the excitation operator between two singly excited determinants and the phase Returns the excitation operator between two singly excited determinants and the phase
`get_occ_from_key <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1202>`_ `get_occ_from_key <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1248>`_
Returns a list of occupation numbers from a bitstring Returns a list of occupation numbers from a bitstring
@ -425,7 +449,7 @@ Documentation
Undocumented Undocumented
`h_u_0 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1218>`_ `h_u_0 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1264>`_
Computes v_0 = H|u_0> Computes v_0 = H|u_0>
.br .br
n : number of determinants n : number of determinants
@ -433,23 +457,23 @@ Documentation
H_jj : array of <j|H|j> H_jj : array of <j|H|j>
`i_h_j <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L355>`_ `i_h_j <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L401>`_
Returns <i|H|j> where i and j are determinants Returns <i|H|j> where i and j are determinants
`i_h_j_phase_out <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L491>`_ `i_h_j_phase_out <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L537>`_
Returns <i|H|j> where i and j are determinants Returns <i|H|j> where i and j are determinants
`i_h_j_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L627>`_ `i_h_j_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L673>`_
Returns <i|H|j> where i and j are determinants Returns <i|H|j> where i and j are determinants
`i_h_psi <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L766>`_ `i_h_psi <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L812>`_
<key|H|psi> for the various Nstates <key|H|psi> for the various Nstates
`i_h_psi_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L849>`_ `i_h_psi_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L895>`_
<key|H|psi> for the various Nstate <key|H|psi> for the various Nstate
.br .br
returns in addition returns in addition
@ -463,7 +487,7 @@ Documentation
to repeat the excitations to repeat the excitations
`i_h_psi_sc2_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L896>`_ `i_h_psi_sc2_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L942>`_
<key|H|psi> for the various Nstate <key|H|psi> for the various Nstate
.br .br
returns in addition returns in addition
@ -477,7 +501,7 @@ Documentation
to repeat the excitations to repeat the excitations
`i_h_psi_sec_ord <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L802>`_ `i_h_psi_sec_ord <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L848>`_
<key|H|psi> for the various Nstates <key|H|psi> for the various Nstates
@ -524,7 +548,7 @@ Documentation
Energy of the reference bitmask used in Slater rules Energy of the reference bitmask used in Slater rules
`n_con_int <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1276>`_ `n_con_int <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1348>`_
Number of integers to represent the connections between determinants Number of integers to represent the connections between determinants
@ -889,6 +913,10 @@ Documentation
for a given couple of hole/particle excitations i. for a given couple of hole/particle excitations i.
`sort_dets_ab <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L124>`_
Undocumented
`sort_dets_by_3_highest_electrons <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L489>`_ `sort_dets_by_3_highest_electrons <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L489>`_
Determinants on which we apply <i|H|j>. Determinants on which we apply <i|H|j>.
They are sorted by the 3 highest electrons in the alpha part, They are sorted by the 3 highest electrons in the alpha part,
@ -910,6 +938,10 @@ Documentation
Weights in the state-average calculation of the density matrix Weights in the state-average calculation of the density matrix
`tamiser <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/davidson.irp.f#L91>`_
Undocumented
`threshold_convergence_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/diagonalize_CI_SC2.irp.f#L18>`_ `threshold_convergence_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/diagonalize_CI_SC2.irp.f#L18>`_
convergence of the correlation energy of SC2 iterations convergence of the correlation energy of SC2 iterations

View File

@ -65,6 +65,106 @@ subroutine davidson_diag(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit)
deallocate (H_jj) deallocate (H_jj)
end end
logical function det_inf(key1, key2, Nint)
use bitmasks
implicit none
integer(bit_kind),intent(in) :: key1(Nint, 2), key2(Nint, 2)
integer,intent(in) :: Nint
integer :: i,j
det_inf = .false.
do i=1,2
do j=Nint,1,-1
if(key1(j,i) < key2(j,i)) then
det_inf = .true.
return
else if(key1(j,i) > key2(j,i)) then
return
end if
end do
end do
end function
subroutine tamiser(key, idx, no, n, Nint, N_key)
use bitmasks
implicit none
integer(bit_kind),intent(inout) :: key(Nint, 2, N_key)
integer,intent(in) :: no, n, Nint, N_key
integer,intent(inout) :: idx(N_key)
integer :: k,j,tmpidx
integer(bit_kind) :: tmp(Nint, 2)
logical :: det_inf
k = no
j = 2*k
do while(j <= n)
if(j < n .and. det_inf(key(:,:,j), key(:,:,j+1), Nint)) then
j = j+1
end if
if(det_inf(key(:,:,k), key(:,:,j), Nint)) then
tmp(:,:) = key(:,:,k)
key(:,:,k) = key(:,:,j)
key(:,:,j) = tmp(:,:)
tmpidx = idx(k)
idx(k) = idx(j)
idx(j) = tmpidx
k = j
j = 2*k
else
return
end if
end do
end subroutine
subroutine sort_dets_ab(key, idx, shortcut, N_key, Nint)
use bitmasks
implicit none
integer(bit_kind),intent(inout) :: key(Nint,2,N_key)
integer,intent(out) :: idx(N_key)
integer,intent(out) :: shortcut(0:N_key+1)
integer, intent(in) :: Nint, N_key
integer(bit_kind) :: tmp(Nint, 2)
integer :: tmpidx,i,ni
do i=1,N_key
idx(i) = i
end do
do i=N_key/2,1,-1
call tamiser(key, idx, i, N_key, Nint, N_key)
end do
do i=N_key,2,-1
tmp(:,:) = key(:,:,i)
key(:,:,i) = key(:,:,1)
key(:,:,1) = tmp(:,:)
tmpidx = idx(i)
idx(i) = idx(1)
idx(1) = tmpidx
call tamiser(key, idx, 1, i-1, Nint, N_key)
end do
shortcut(0) = 1
shortcut(1) = 1
do i=2,N_key
do ni=1,nint
if(key(ni,1,i) /= key(ni,1,i-1)) then
shortcut(0) = shortcut(0) + 1
shortcut(shortcut(0)) = i
exit
end if
end do
end do
shortcut(shortcut(0)+1) = N_key+1
end subroutine
subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iunit) subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iunit)
use bitmasks use bitmasks
implicit none implicit none
@ -106,7 +206,7 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iun
integer :: k_pairs, kl integer :: k_pairs, kl
integer :: iter2 integer :: iter2
double precision, allocatable :: W(:,:,:), U(:,:,:), R(:,:) double precision, allocatable :: W(:,:,:), U(:,:,:), R(:,:), Wt(:)
double precision, allocatable :: y(:,:,:,:), h(:,:,:,:), lambda(:) double precision, allocatable :: y(:,:,:,:), h(:,:,:,:), lambda(:)
double precision :: diag_h_mat_elem double precision :: diag_h_mat_elem
double precision :: residual_norm(N_st) double precision :: residual_norm(N_st)
@ -114,6 +214,9 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iun
double precision :: to_print(2,N_st) double precision :: to_print(2,N_st)
double precision :: cpu, wall double precision :: cpu, wall
integer(bit_kind) :: dets_in_sorted(Nint, 2, sze)
integer :: idx(sze), shortcut(0:sze+1)
PROVIDE det_connections PROVIDE det_connections
call write_time(iunit) call write_time(iunit)
@ -145,6 +248,7 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iun
allocate( & allocate( &
kl_pairs(2,N_st*(N_st+1)/2), & kl_pairs(2,N_st*(N_st+1)/2), &
W(sze,N_st,davidson_sze_max), & W(sze,N_st,davidson_sze_max), &
Wt(sze), &
U(sze,N_st,davidson_sze_max), & U(sze,N_st,davidson_sze_max), &
R(sze,N_st), & R(sze,N_st), &
h(N_st,davidson_sze_max,N_st,davidson_sze_max), & h(N_st,davidson_sze_max,N_st,davidson_sze_max), &
@ -159,6 +263,9 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iun
! Initialization ! Initialization
! ============== ! ==============
dets_in_sorted(:,:,:) = dets_in(:,:,:)
call sort_dets_ab(dets_in_sorted, idx, shortcut, sze, Nint)
k_pairs=0 k_pairs=0
do l=1,N_st do l=1,N_st
do k=1,l do k=1,l
@ -170,7 +277,7 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iun
!$OMP PARALLEL DEFAULT(NONE) & !$OMP PARALLEL DEFAULT(NONE) &
!$OMP SHARED(U,sze,N_st,overlap,kl_pairs,k_pairs, & !$OMP SHARED(U,sze,N_st,overlap,kl_pairs,k_pairs, &
!$OMP Nint,dets_in,u_in) & !$OMP Nint,dets_in_sorted,dets_in,u_in) &
!$OMP PRIVATE(k,l,kl,i) !$OMP PRIVATE(k,l,kl,i)
@ -217,9 +324,10 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iun
! ---------------------- ! ----------------------
do k=1,N_st do k=1,N_st
call H_u_0(W(1,k,iter),U(1,k,iter),H_jj,sze,dets_in,Nint) call H_u_0(W(1,k,iter),U(1,k,iter),H_jj,sze,dets_in_sorted,shortcut,idx,Nint)
enddo enddo
! Compute h_kl = <u_k | W_l> = <u_k| H |u_l> ! Compute h_kl = <u_k | W_l> = <u_k| H |u_l>
! ------------------------------------------- ! -------------------------------------------
@ -360,6 +468,7 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,Nint,iun
deallocate ( & deallocate ( &
kl_pairs, & kl_pairs, &
W, & W, &
Wt, &
U, & U, &
R, & R, &
h, & h, &

View File

@ -158,7 +158,162 @@ subroutine filter_connected_sorted_ab(key1,key2,next,Nint,sze,idx)
end end
subroutine filter_connected_davidson_warp(key1,warp,key2,Nint,sze,idx)
use bitmasks
implicit none
BEGIN_DOC
! 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
! key1 should come from psi_det_sorted_ab.
END_DOC
integer, intent(in) :: Nint, sze
integer(bit_kind), intent(in) :: key1(Nint,2,sze)
integer(bit_kind), intent(in) :: key2(Nint,2)
integer, intent(out) :: idx(0:sze)
integer,intent(in) :: warp(2,0:sze+1)
integer :: i,j,k,l
integer :: degree_x2
integer :: i_alpha, i_beta, exc_a, exc_b, endloop, ni
integer(bit_kind) :: tmp1, tmp2
ASSERT (Nint > 0)
ASSERT (sze >= 0)
l=1
i_alpha = 0
if (Nint /= 1) then
do while(i_alpha < warp(1,0) .and. warp(1,i_alpha+1) <= sze)
i_alpha = i_alpha + 1
exc_a = 0
do ni=1,Nint
exc_a += popcnt(xor(key1(ni,1,warp(1,i_alpha)), key2(ni,1)))
end do
endloop = min(warp(2,i_alpha), sze)
if(exc_a == 4) then
do i_beta=warp(1,i_alpha),endloop
do ni=1,Nint
if(key1(ni,2,i_beta) /= key2(ni,2)) then
exit
else if(ni == Nint) then
idx(l) = i_beta
l = l + 1
end if
end do
end do
else
do i_beta=warp(1,i_alpha),endloop
exc_b = 0
do ni=1,Nint
exc_b += popcnt(xor(key1(ni,2,i_beta), key2(ni,2)))
end do
if(exc_b + exc_a <= 4) then
idx(l) = i_beta
l = l + 1
end if
end do
end if
end do
else
do while(i_alpha < warp(1,0) .and. warp(1,i_alpha+1) <= sze)
i_alpha = i_alpha + 1
exc_a = popcnt(xor(key1(1,1,warp(1,i_alpha)), key2(1,1)))
endloop = min(warp(2,i_alpha), sze)
if(exc_a == 4) then
do i_beta=warp(1,i_alpha),endloop
if(key1(1,2,i_beta) == key2(1,2)) then
idx(l) = i_beta
l = l + 1
exit
end if
end do
else
do i_beta=warp(1,i_alpha),endloop
exc_b = popcnt(xor(key1(1,2,i_beta), key2(1,2)))
if(exc_b + exc_a <= 4) then
idx(l) = i_beta
l = l + 1
end if
end do
end if
end do
end if
idx(0) = l-1
end
subroutine filter_connected_davidson_shortcut(key1,shortcut,key2,Nint,sze,idx)
use bitmasks
implicit none
BEGIN_DOC
! 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
! key1 should come from psi_det_sorted_ab.
END_DOC
integer, intent(in) :: Nint, sze
integer(bit_kind), intent(in) :: key1(Nint,2,sze)
integer(bit_kind), intent(in) :: key2(Nint,2)
integer, intent(out) :: idx(0:sze)
integer,intent(in) :: shortcut(0:sze+1)
integer :: i,j,k,l
integer :: degree_x2
integer :: i_alpha, i_beta, exc_a, exc_b, endloop
integer(bit_kind) :: tmp1, tmp2
ASSERT (Nint > 0)
ASSERT (sze >= 0)
l=1
i_alpha = 0
if (Nint==1) then
do while(shortcut(i_alpha+1) < sze)
i_alpha = i_alpha + 1
!print *, i_alpha, shortcut(i_alpha), sze
exc_a = popcnt(xor(key1(1,1,shortcut(i_alpha)), key2(1,1)))
if(exc_a > 4) then
cycle
end if
endloop = min(shortcut(i_alpha+1)-1, sze)
if(exc_a == 4) then
do i_beta = shortcut(i_alpha), endloop
if(key1(1,2,i_beta) == key2(1,2)) then
idx(l) = i_beta
l = l + 1
exit
end if
end do
else
do i_beta = shortcut(i_alpha), endloop
exc_b = popcnt(xor(key1(1,2,i_beta), key2(1,2)))
if(exc_b + exc_a <= 4) then
idx(l) = i_beta
l = l + 1
end if
end do
end if
end do
else
print *, "TBD : filter_connected_davidson_shortcut Nint>1"
stop
end if
idx(0) = l-1
end
subroutine filter_connected_davidson(key1,key2,Nint,sze,idx) subroutine filter_connected_davidson(key1,key2,Nint,sze,idx)
use bitmasks use bitmasks
@ -190,7 +345,7 @@ subroutine filter_connected_davidson(key1,key2,Nint,sze,idx)
if (Nint==1) then if (Nint==1) then
i = idx(0) i = idx(0) ! lecture dans un intent(out) ?
do j_int=1,N_con_int do j_int=1,N_con_int
itmp = det_connections(j_int,i) itmp = det_connections(j_int,i)
do while (itmp /= 0_8) do while (itmp /= 0_8)

View File

@ -138,6 +138,52 @@ subroutine decode_exc(exc,degree,h1,p1,h2,p2,s1,s2)
end select end select
end end
!
! subroutine get_double_excitation(det1, det2, exc, phase, Nint)
! integer, intent(in) :: Nint
! integer(bit_kind), intent(in) :: det1(Nint,2)
! integer(bit_kind), intent(in) :: det2(Nint,2)
! integer, intent(out) :: exc(0:2,2,2)
! double precision, intent(out) :: phase
!
! integer(bit_kind) :: detp, deth, detp_f, deth_f, tmp
! integer :: i,sp,hole_fnd
!
! fi(:) = 0
! fs(:) = 0
! fn = 0
! detp = 0
! deth = 0
! tmp = 0
! deth_f = 0
! detp_f = 0
! do sp=1,2
! do i=1,Nint
! tmp = xor(det1(i,sp), det2(i,sp))
! if(tmp == 0) then
! cycle
! end if
! detp = iand(det2(i,sp), tmp)
! deth = iand(det1(i,sp), tmp)
!
! detp_f = ior(detp_f, detp)
! deth_f = ior(deth_f, deth)
!
! if(detp /= 0) then
! fn = fn + 1
! fs(fn) = sp
! fi(fn) = i
! end if
! end do
! end do
! if(fn /= 2) then
! print *, "WHUUUUT??"
! stop 1
! end if
!
! end subroutine
subroutine get_double_excitation(det1,det2,exc,phase,Nint) subroutine get_double_excitation(det1,det2,exc,phase,Nint)
use bitmasks use bitmasks
implicit none implicit none
@ -1215,7 +1261,7 @@ subroutine get_occ_from_key(key,occ,Nint)
end end
subroutine H_u_0(v_0,u_0,H_jj,n,keys_tmp,Nint) subroutine H_u_0(v_0,u_0,H_jj,n,keys_tmp,shortcut,sort_idx,Nint)
use bitmasks use bitmasks
implicit none implicit none
BEGIN_DOC BEGIN_DOC
@ -1233,31 +1279,57 @@ subroutine H_u_0(v_0,u_0,H_jj,n,keys_tmp,Nint)
integer, allocatable :: idx(:) integer, allocatable :: idx(:)
double precision :: hij double precision :: hij
double precision, allocatable :: vt(:) double precision, allocatable :: vt(:)
integer :: i,j,k,l, jj integer :: i,j,k,l, jj,ii,sh
integer :: i0, j0 integer :: i0, j0
integer,intent(in) :: shortcut(0:n+1), sort_idx(n)
integer :: tmp, warp(2,0:n+1), ni
ASSERT (Nint > 0) ASSERT (Nint > 0)
ASSERT (Nint == N_int) ASSERT (Nint == N_int)
ASSERT (n>0) ASSERT (n>0)
PROVIDE ref_bitmask_energy PROVIDE ref_bitmask_energy
!$OMP PARALLEL DEFAULT(NONE) & !$OMP PARALLEL DEFAULT(NONE) &
!$OMP PRIVATE(i,hij,j,k,idx,jj,vt) & !$OMP PRIVATE(i,hij,j,k,idx,jj,vt,ii,warp,tmp,sh) &
!$OMP SHARED(n,H_jj,u_0,keys_tmp,Nint,v_0,davidson_threshold) !$OMP SHARED(n,H_jj,u_0,keys_tmp,Nint,v_0,davidson_threshold,shortcut,sort_idx)
allocate(idx(0:n), vt(n)) allocate(idx(0:n), vt(n))
Vt = 0.d0 Vt = 0.d0
v_0 = 0.d0 v_0 = 0.d0
!$OMP DO SCHEDULE(guided) !$OMP DO SCHEDULE(guided)
do i=1,n
idx(0) = i
call filter_connected_davidson(keys_tmp,keys_tmp(1,1,i),Nint,i-1,idx) do sh=1,shortcut(0)
warp(1,0) = 0
do ii=1,sh!shortcut(0)
tmp = 0
do ni=1,Nint
tmp = popcnt(xor(keys_tmp(ni,1, shortcut(ii)), keys_tmp(ni,1,shortcut(sh))))
end do
if(tmp <= 4) then
warp(1,0) = warp(1,0) + 1
warp(1,warp(1,0)) = shortcut(ii)
warp(2,warp(1,0)) = shortcut(ii+1)-1
end if
end do
do ii=shortcut(sh),shortcut(sh+1)-1
idx(0) = ii
call filter_connected_davidson_warp(keys_tmp,warp,keys_tmp(1,1,ii),Nint,ii-1,idx)
i = sort_idx(ii)
do jj=1,idx(0) do jj=1,idx(0)
j = idx(jj) j = sort_idx(idx(jj))
if ( dabs(u_0(j)) + dabs(u_0(i)) > davidson_threshold ) then if ( dabs(u_0(j)) + dabs(u_0(i)) > davidson_threshold ) then
call i_H_j(keys_tmp(1,1,j),keys_tmp(1,1,i),Nint,hij) call i_H_j(keys_tmp(1,1,idx(jj)),keys_tmp(1,1,ii),Nint,hij)
vt (i) = vt (i) + hij*u_0(j) vt (i) = vt (i) + hij*u_0(j)
vt (j) = vt (j) + hij*u_0(i) vt (j) = vt (j) + hij*u_0(i)
endif endif
enddo enddo
enddo enddo
enddo
!$OMP END DO !$OMP END DO
!$OMP CRITICAL !$OMP CRITICAL
do i=1,n do i=1,n