From 3560133e9c2acdebed40bd3ff25ecd2b94ccd5f6 Mon Sep 17 00:00:00 2001 From: AbdAmmar Date: Thu, 22 Dec 2022 00:46:31 +0100 Subject: [PATCH] added explicit PROVIDE in F(3e) --- src/tc_scf/fock_3e_bi_ortho_uhf.irp.f | 6 ++++++ src/tc_scf/fock_three_bi_ortho_new_new.irp.f | 22 +++++++++++++++++++- src/tc_scf/tc_scf.irp.f | 14 ++++++------- src/tc_scf/test_int.irp.f | 2 +- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/tc_scf/fock_3e_bi_ortho_uhf.irp.f b/src/tc_scf/fock_3e_bi_ortho_uhf.irp.f index 37fb3cba..048255f6 100644 --- a/src/tc_scf/fock_3e_bi_ortho_uhf.irp.f +++ b/src/tc_scf/fock_3e_bi_ortho_uhf.irp.f @@ -8,6 +8,8 @@ BEGIN_PROVIDER [double precision, fock_3e_uhf_mo_cs, (mo_num, mo_num)] double precision :: I_bij_aij, I_bij_ija, I_bij_jai, I_bij_aji, I_bij_iaj, I_bij_jia double precision :: ti, tf + PROVIDE mo_l_coef mo_r_coef + !print *, ' PROVIDING fock_3e_uhf_mo_cs ...' call wall_time(ti) @@ -52,6 +54,8 @@ BEGIN_PROVIDER [double precision, fock_3e_uhf_mo_a, (mo_num, mo_num)] double precision :: I_bij_aij, I_bij_ija, I_bij_jai, I_bij_aji, I_bij_iaj, I_bij_jia double precision :: ti, tf + PROVIDE mo_l_coef mo_r_coef + !print *, ' PROVIDING fock_3e_uhf_mo_a ...' call wall_time(ti) @@ -147,6 +151,8 @@ BEGIN_PROVIDER [double precision, fock_3e_uhf_mo_b, (mo_num, mo_num)] double precision :: I_bij_aij, I_bij_ija, I_bij_jai, I_bij_aji, I_bij_iaj, I_bij_jia double precision :: ti, tf + PROVIDE mo_l_coef mo_r_coef + !print *, ' PROVIDING fock_3e_uhf_mo_b ...' call wall_time(ti) diff --git a/src/tc_scf/fock_three_bi_ortho_new_new.irp.f b/src/tc_scf/fock_three_bi_ortho_new_new.irp.f index 859c06ca..f73171a3 100644 --- a/src/tc_scf/fock_three_bi_ortho_new_new.irp.f +++ b/src/tc_scf/fock_three_bi_ortho_new_new.irp.f @@ -6,6 +6,8 @@ BEGIN_PROVIDER [double precision, fock_a_tot_3e_bi_orth, (mo_num, mo_num)] implicit none integer :: i, a + PROVIDE mo_l_coef mo_r_coef + fock_a_tot_3e_bi_orth = 0.d0 do i = 1, mo_num @@ -25,6 +27,8 @@ BEGIN_PROVIDER [double precision, fock_b_tot_3e_bi_orth, (mo_num, mo_num)] implicit none integer :: i, a + PROVIDE mo_l_coef mo_r_coef + fock_b_tot_3e_bi_orth = 0.d0 do i = 1, mo_num @@ -47,6 +51,8 @@ BEGIN_PROVIDER [double precision, fock_cs_3e_bi_orth, (mo_num, mo_num)] double precision :: direct_int, exch_13_int, exch_23_int, exch_12_int, c_3_int, c_minus_3_int double precision :: new + PROVIDE mo_l_coef mo_r_coef + fock_cs_3e_bi_orth = 0.d0 do i = 1, mo_num @@ -91,6 +97,8 @@ BEGIN_PROVIDER [double precision, fock_a_tmp1_bi_ortho, (mo_num, mo_num)] double precision :: direct_int, exch_13_int, exch_23_int, exch_12_int, c_3_int, c_minus_3_int double precision :: new + PROVIDE mo_l_coef mo_r_coef + fock_a_tmp1_bi_ortho = 0.d0 do i = 1, mo_num @@ -122,6 +130,8 @@ BEGIN_PROVIDER [double precision, fock_a_tmp2_bi_ortho, (mo_num, mo_num)] implicit none integer :: i, a, j, k double precision :: contrib_sss + + PROVIDE mo_l_coef mo_r_coef fock_a_tmp2_bi_ortho = 0.d0 @@ -148,6 +158,8 @@ BEGIN_PROVIDER [double precision, fock_b_tmp1_bi_ortho, (mo_num, mo_num)] double precision :: direct_int, exch_13_int, exch_23_int, exch_12_int double precision :: new + PROVIDE mo_l_coef mo_r_coef + fock_b_tmp1_bi_ortho = 0.d0 do i = 1, mo_num @@ -176,6 +188,8 @@ BEGIN_PROVIDER [double precision, fock_b_tmp2_bi_ortho, (mo_num, mo_num)] integer :: i, a, j, k double precision :: contrib_soo + PROVIDE mo_l_coef mo_r_coef + fock_b_tmp2_bi_ortho = 0.d0 do i = 1, mo_num @@ -199,12 +213,14 @@ subroutine contrib_3e_sss(a, i, j, k, integral) BEGIN_DOC ! returns the pure same spin contribution to F(a,i) from two orbitals j,k END_DOC - + implicit none integer, intent(in) :: a, i, j, k double precision, intent(out) :: integral double precision :: direct_int, exch_13_int, exch_23_int, exch_12_int, c_3_int, c_minus_3_int + PROVIDE mo_l_coef mo_r_coef + call give_integrals_3_body_bi_ort(a, k, j, i, k, j, direct_int )!!! < a k j | i k j > call give_integrals_3_body_bi_ort(a, k, j, j, i, k, c_3_int) ! < a k j | j i k > call give_integrals_3_body_bi_ort(a, k, j, k, j, i, c_minus_3_int)! < a k j | k j i > @@ -233,6 +249,8 @@ subroutine contrib_3e_soo(a,i,j,k,integral) double precision, intent(out) :: integral double precision :: direct_int, exch_23_int + PROVIDE mo_l_coef mo_r_coef + call give_integrals_3_body_bi_ort(a, k, j, i, k, j, direct_int) ! < a k j | i k j > call give_integrals_3_body_bi_ort(a, k, j, i, j, k, exch_23_int)! < a k j | i j k > : E_23 integral = direct_int - exch_23_int @@ -249,6 +267,8 @@ subroutine contrib_3e_sos(a, i, j, k, integral) ! returns the same spin / opposite spin / same spin contribution to F(a,i) from two orbitals j,k END_DOC + PROVIDE mo_l_coef mo_r_coef + implicit none integer, intent(in) :: a, i, j, k double precision, intent(out) :: integral diff --git a/src/tc_scf/tc_scf.irp.f b/src/tc_scf/tc_scf.irp.f index 5090cc97..fd11c48e 100644 --- a/src/tc_scf/tc_scf.irp.f +++ b/src/tc_scf/tc_scf.irp.f @@ -170,7 +170,7 @@ subroutine simple_tcscf() TOUCH mo_l_coef mo_r_coef call ezfio_set_tc_scf_bitc_energy(TC_HF_energy) - !call test_fock_3e_uhf_mo() + call test_fock_3e_uhf_mo() print *, ' ***' print *, '' @@ -226,9 +226,9 @@ subroutine test_fock_3e_uhf_mo() diff_ij = dabs(fock_3e_uhf_mo_a(j,i) - fock_a_tot_3e_bi_orth(j,i)) if(diff_ij .gt. thr_ih) then - print *, ' difference on ', j, i - print *, ' MANU : ', fock_a_tot_3e_bi_orth(j,i) - print *, ' UHF : ', fock_3e_uhf_mo_a (j,i) + !print *, ' difference on ', j, i + !print *, ' MANU : ', fock_a_tot_3e_bi_orth(j,i) + !print *, ' UHF : ', fock_3e_uhf_mo_a (j,i) !stop endif @@ -249,9 +249,9 @@ subroutine test_fock_3e_uhf_mo() diff_ij = dabs(fock_3e_uhf_mo_b(j,i) - fock_b_tot_3e_bi_orth(j,i)) if(diff_ij .gt. thr_ih) then - print *, ' difference on ', j, i - print *, ' MANU : ', fock_b_tot_3e_bi_orth(j,i) - print *, ' UHF : ', fock_3e_uhf_mo_b (j,i) + !print *, ' difference on ', j, i + !print *, ' MANU : ', fock_b_tot_3e_bi_orth(j,i) + !print *, ' UHF : ', fock_3e_uhf_mo_b (j,i) !stop endif diff --git a/src/tc_scf/test_int.irp.f b/src/tc_scf/test_int.irp.f index c9b0d108..b5821cb3 100644 --- a/src/tc_scf/test_int.irp.f +++ b/src/tc_scf/test_int.irp.f @@ -25,7 +25,7 @@ program test_ints !call routine_int2_grad1u2_grad2u2_j1b2 - call test_fock_3e_uhf_ao() + !call test_fock_3e_uhf_ao() call test_fock_3e_uhf_mo() end