From 22e54cecd1ba522d44e10bd14958f3a0d1e60492 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 6 Mar 2020 15:47:33 +0100 Subject: [PATCH] Fixed broken filter_integrals in h_apply --- scripts/generate_h_apply.py | 6 ++++++ src/determinants/h_apply.template.f | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/generate_h_apply.py b/scripts/generate_h_apply.py index 8c399e55..ef22a539 100644 --- a/scripts/generate_h_apply.py +++ b/scripts/generate_h_apply.py @@ -11,6 +11,7 @@ declarations decls_main deinit_thread init_main +filter_integrals filter2p filter2h2p_double filter2h2p_single @@ -104,6 +105,11 @@ class H_apply(object): s["do_mono_excitations"] = d[do_mono_exc] s["do_double_excitations"] = d[do_double_exc] s["keys_work"] += "call fill_H_apply_buffer_no_selection(key_idx,keys_out,N_int,iproc)" + s["filter_integrals"] = "array_pairs = .True." + if SingleRef: + s["filter_integrals"] = """ + call get_mo_bielec_integrals_existing_ik(i_a,j_a,mo_num,array_pairs,mo_integrals_map) + """ s["generate_psi_guess"] = """ ! Sort H_jj to find the N_states lowest states diff --git a/src/determinants/h_apply.template.f b/src/determinants/h_apply.template.f index c57f93b5..abdd6862 100644 --- a/src/determinants/h_apply.template.f +++ b/src/determinants/h_apply.template.f @@ -240,7 +240,10 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl ! hole = a^(+)_j_a(ispin) a_i_a(ispin)|key_in> : single exc :: orb(i_a,ispin) --> orb(j_a,ispin) hole_save = hole - if (ispin == 1) then + ! Build array of the non-zero integrals of second excitation + $filter_integrals + + if (ispin == 1) then integer :: jjj i=0 @@ -282,7 +285,7 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl $only_1h_double $only_1p_double $only_2h1p_double - $filter_only_connected_to_hf_double + $filter_only_connected_to_hf_double key_idx += 1 do k=1,N_int keys_out(k,1,key_idx) = key(k,1) @@ -494,7 +497,7 @@ subroutine $subroutine_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generato $filter_only_1h1p_single $filter_only_1h2p_single $filter_only_2h2p_single - $filter_only_connected_to_hf_single + $filter_only_connected_to_hf_single key_idx += 1 do k=1,N_int keys_out(k,1,key_idx) = hole(k,1)