From 42b17e6e3fa9c85bf03fc404bce544df7b9201b8 Mon Sep 17 00:00:00 2001 From: eginer Date: Mon, 24 Oct 2022 16:12:56 +0200 Subject: [PATCH] moved the jastrow parameters to tc_keywords --- src/ao_tc_eff_map/EZFIO.cfg | 18 ------- src/bi_ort_ints/bi_ort_ints.irp.f | 47 ++++++++++++++----- src/bi_ort_ints/semi_num_ints_mo.irp.f | 18 +++++-- src/bi_ort_ints/three_body_ints_bi_ort.irp.f | 42 ++++++++++++++++- src/tc_keywords/EZFIO.cfg | 18 +++++++ src/tc_keywords/NEED | 1 + .../j1b_pen.irp.f | 12 +++-- 7 files changed, 118 insertions(+), 38 deletions(-) delete mode 100644 src/ao_tc_eff_map/EZFIO.cfg rename src/{ao_tc_eff_map => tc_keywords}/j1b_pen.irp.f (86%) diff --git a/src/ao_tc_eff_map/EZFIO.cfg b/src/ao_tc_eff_map/EZFIO.cfg deleted file mode 100644 index 1df2a130..00000000 --- a/src/ao_tc_eff_map/EZFIO.cfg +++ /dev/null @@ -1,18 +0,0 @@ - -[j1b_pen] -type: double precision -doc: exponents of the 1-body Jastrow -interface: ezfio -size: (nuclei.nucl_num) - -[j1b_coeff] -type: double precision -doc: coeff of the 1-body Jastrow -interface: ezfio -size: (nuclei.nucl_num) - -[j1b_type] -type: integer -doc: type of 1-body Jastrow -interface: ezfio, provider, ocaml -default: 0 diff --git a/src/bi_ort_ints/bi_ort_ints.irp.f b/src/bi_ort_ints/bi_ort_ints.irp.f index bb894b44..ca50dd56 100644 --- a/src/bi_ort_ints/bi_ort_ints.irp.f +++ b/src/bi_ort_ints/bi_ort_ints.irp.f @@ -4,18 +4,41 @@ program bi_ort_ints ! TODO : Put the documentation of the program here END_DOC my_grid_becke = .True. - my_n_pt_r_grid = 30 - my_n_pt_a_grid = 50 + my_n_pt_r_grid = 10 + my_n_pt_a_grid = 14 touch my_grid_becke my_n_pt_r_grid my_n_pt_a_grid -! call test_overlap -! call routine_twoe -! call routine_onee -! call test_v_ki_bi_ortho -! call test_x_v_ki_bi_ortho -! call test_3_body_bi_ort -! call test_3_e_diag -! call test_3_e_diag_cycle1 -! call test_3_e -! call routine_test_one_int + call test_3e end +subroutine test_3e + implicit none + integer :: i,k,j,l,m,n,ipoint + double precision :: accu, contrib,new,ref + i = 1 + k = 1 + accu = 0.d0 + do i = 1, mo_num + do k = 1, mo_num + do j = 1, mo_num + do l = 1, mo_num + do m = 1, mo_num + do n = 1, mo_num + call give_integrals_3_body_bi_ort(n, l, k, m, j, i, new) + call give_integrals_3_body_bi_ort_old(n, l, k, m, j, i, ref) + contrib = dabs(new - ref) + accu += contrib + if(contrib .gt. 1.d-10)then + print*,'pb !!' + print*,i,k,j,l,m,n + print*,ref,new,contrib + endif + enddo + enddo + enddo + enddo + enddo + enddo + print*,'accu = ',accu/dble(mo_num)**6 + + +end diff --git a/src/bi_ort_ints/semi_num_ints_mo.irp.f b/src/bi_ort_ints/semi_num_ints_mo.irp.f index e7c1fdd1..e32d4707 100644 --- a/src/bi_ort_ints/semi_num_ints_mo.irp.f +++ b/src/bi_ort_ints/semi_num_ints_mo.irp.f @@ -122,8 +122,6 @@ BEGIN_PROVIDER [ double precision, int2_grad1_u12_ao_transp, (ao_num, ao_num, 3, END_PROVIDER -! --- - BEGIN_PROVIDER [ double precision, int2_grad1_u12_bimo_transp, (mo_num, mo_num, 3, n_points_final_grid)] implicit none @@ -148,6 +146,19 @@ BEGIN_PROVIDER [ double precision, int2_grad1_u12_bimo_transp, (mo_num, mo_num, END_PROVIDER ! --- +BEGIN_PROVIDER [ double precision, int2_grad1_u12_bimo_t, (n_points_final_grid,3, mo_num, mo_num )] + implicit none + integer :: i, j, ipoint + do ipoint = 1, n_points_final_grid + do i = 1, mo_num + do j = 1, mo_num + int2_grad1_u12_bimo_t(ipoint,1,j,i) = int2_grad1_u12_bimo_transp(j,i,1,ipoint) + int2_grad1_u12_bimo_t(ipoint,2,j,i) = int2_grad1_u12_bimo_transp(j,i,2,ipoint) + int2_grad1_u12_bimo_t(ipoint,3,j,i) = int2_grad1_u12_bimo_transp(j,i,3,ipoint) + enddo + enddo + enddo +END_PROVIDER BEGIN_PROVIDER [ double precision, int2_grad1_u12_bimo, (3, mo_num, mo_num, n_points_final_grid)] @@ -159,7 +170,8 @@ BEGIN_PROVIDER [ double precision, int2_grad1_u12_bimo, (3, mo_num, mo_num, n_po implicit none integer :: ipoint - + print*,'Wrong !!' + stop !$OMP PARALLEL & !$OMP DEFAULT (NONE) & !$OMP PRIVATE (ipoint) & diff --git a/src/bi_ort_ints/three_body_ints_bi_ort.irp.f b/src/bi_ort_ints/three_body_ints_bi_ort.irp.f index 2cca84a2..c1c27f06 100644 --- a/src/bi_ort_ints/three_body_ints_bi_ort.irp.f +++ b/src/bi_ort_ints/three_body_ints_bi_ort.irp.f @@ -85,6 +85,44 @@ subroutine give_integrals_3_body_bi_ort(n, l, k, m, j, i, integral) do ipoint = 1, n_points_final_grid weight = final_weight_at_r_vector(ipoint) + integral += weight * mos_l_in_r_array_transp(ipoint,k) * mos_r_in_r_array_transp(ipoint,i) & + * ( int2_grad1_u12_bimo_t(ipoint,1,n,m) * int2_grad1_u12_bimo_t(ipoint,1,l,j) & + + int2_grad1_u12_bimo_t(ipoint,2,n,m) * int2_grad1_u12_bimo_t(ipoint,2,l,j) & + + int2_grad1_u12_bimo_t(ipoint,3,n,m) * int2_grad1_u12_bimo_t(ipoint,3,l,j) ) + integral += weight * mos_l_in_r_array_transp(ipoint,l) * mos_r_in_r_array_transp(ipoint,j) & + * ( int2_grad1_u12_bimo_t(ipoint,1,n,m) * int2_grad1_u12_bimo_t(ipoint,1,k,i) & + + int2_grad1_u12_bimo_t(ipoint,2,n,m) * int2_grad1_u12_bimo_t(ipoint,2,k,i) & + + int2_grad1_u12_bimo_t(ipoint,3,n,m) * int2_grad1_u12_bimo_t(ipoint,3,k,i) ) + integral += weight * mos_l_in_r_array_transp(ipoint,n) * mos_r_in_r_array_transp(ipoint,m) & + * ( int2_grad1_u12_bimo_t(ipoint,1,l,j) * int2_grad1_u12_bimo_t(ipoint,1,k,i) & + + int2_grad1_u12_bimo_t(ipoint,2,l,j) * int2_grad1_u12_bimo_t(ipoint,2,k,i) & + + int2_grad1_u12_bimo_t(ipoint,3,l,j) * int2_grad1_u12_bimo_t(ipoint,3,k,i) ) + + enddo + +end subroutine give_integrals_3_body_bi_ort + +! --- + + +subroutine give_integrals_3_body_bi_ort_old(n, l, k, m, j, i, integral) + + BEGIN_DOC + ! + ! < n l k | -L | m j i > with a BI-ORTHONORMAL ORBITALS + ! + END_DOC + + implicit none + integer, intent(in) :: n, l, k, m, j, i + double precision, intent(out) :: integral + integer :: ipoint + double precision :: weight + + integral = 0.d0 + do ipoint = 1, n_points_final_grid + weight = final_weight_at_r_vector(ipoint) +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! integral += weight * mos_l_in_r_array_transp(ipoint,k) * mos_r_in_r_array_transp(ipoint,i) & ! * ( x_W_ki_bi_ortho_erf_rk(ipoint,1,n,m) * x_W_ki_bi_ortho_erf_rk(ipoint,1,l,j) & ! + x_W_ki_bi_ortho_erf_rk(ipoint,2,n,m) * x_W_ki_bi_ortho_erf_rk(ipoint,2,l,j) & @@ -111,6 +149,8 @@ subroutine give_integrals_3_body_bi_ort(n, l, k, m, j, i, integral) ! + int2_grad1_u12_bimo(2,l,j,ipoint) * int2_grad1_u12_bimo(2,k,i,ipoint) & ! + int2_grad1_u12_bimo(3,l,j,ipoint) * int2_grad1_u12_bimo(3,k,i,ipoint) ) +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + integral += weight * mos_l_in_r_array_transp(ipoint,k) * mos_r_in_r_array_transp(ipoint,i) & * ( int2_grad1_u12_bimo_transp(n,m,1,ipoint) * int2_grad1_u12_bimo_transp(l,j,1,ipoint) & + int2_grad1_u12_bimo_transp(n,m,2,ipoint) * int2_grad1_u12_bimo_transp(l,j,2,ipoint) & @@ -126,7 +166,7 @@ subroutine give_integrals_3_body_bi_ort(n, l, k, m, j, i, integral) enddo -end subroutine give_integrals_3_body_bi_ort +end subroutine give_integrals_3_body_bi_ort_old ! --- diff --git a/src/tc_keywords/EZFIO.cfg b/src/tc_keywords/EZFIO.cfg index eedede5b..6bf47252 100644 --- a/src/tc_keywords/EZFIO.cfg +++ b/src/tc_keywords/EZFIO.cfg @@ -105,3 +105,21 @@ type: integer doc: if +1: only positive is selected, -1: only negative is selected, :0 both positive and negative interface: ezfio,provider,ocaml default: 0 + +[j1b_pen] +type: double precision +doc: exponents of the 1-body Jastrow +interface: ezfio +size: (nuclei.nucl_num) + +[j1b_coeff] +type: double precision +doc: coeff of the 1-body Jastrow +interface: ezfio +size: (nuclei.nucl_num) + +[j1b_type] +type: integer +doc: type of 1-body Jastrow +interface: ezfio, provider, ocaml +default: 0 diff --git a/src/tc_keywords/NEED b/src/tc_keywords/NEED index 5a3182ed..f1c051ff 100644 --- a/src/tc_keywords/NEED +++ b/src/tc_keywords/NEED @@ -1 +1,2 @@ ezfio_files +nuclei diff --git a/src/ao_tc_eff_map/j1b_pen.irp.f b/src/tc_keywords/j1b_pen.irp.f similarity index 86% rename from src/ao_tc_eff_map/j1b_pen.irp.f rename to src/tc_keywords/j1b_pen.irp.f index f829108b..57250b52 100644 --- a/src/ao_tc_eff_map/j1b_pen.irp.f +++ b/src/tc_keywords/j1b_pen.irp.f @@ -13,7 +13,7 @@ BEGIN_PROVIDER [ double precision, j1b_pen, (nucl_num) ] PROVIDE ezfio_filename if (mpi_master) then - call ezfio_has_ao_tc_eff_map_j1b_pen(exists) + call ezfio_has_tc_keywords_j1b_pen(exists) endif IRP_IF MPI_DEBUG @@ -34,7 +34,7 @@ BEGIN_PROVIDER [ double precision, j1b_pen, (nucl_num) ] if (mpi_master) then write(6,'(A)') '.. >>>>> [ IO READ: j1b_pen ] <<<<< ..' - call ezfio_get_ao_tc_eff_map_j1b_pen(j1b_pen) + call ezfio_get_tc_keywords_j1b_pen(j1b_pen) IRP_IF MPI call MPI_BCAST(j1b_pen, (nucl_num), MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) if (ierr /= MPI_SUCCESS) then @@ -51,6 +51,10 @@ BEGIN_PROVIDER [ double precision, j1b_pen, (nucl_num) ] enddo endif + print*,'parameters for nuclei jastrow' + do i = 1, nucl_num + print*,'i,Z,j1b_pen(i)',i,nucl_charge(i),j1b_pen(i) + enddo END_PROVIDER @@ -68,7 +72,7 @@ BEGIN_PROVIDER [ double precision, j1b_coeff, (nucl_num) ] PROVIDE ezfio_filename if (mpi_master) then - call ezfio_has_ao_tc_eff_map_j1b_coeff(exists) + call ezfio_has_tc_keywords_j1b_coeff(exists) endif IRP_IF MPI_DEBUG @@ -89,7 +93,7 @@ BEGIN_PROVIDER [ double precision, j1b_coeff, (nucl_num) ] if (mpi_master) then write(6,'(A)') '.. >>>>> [ IO READ: j1b_coeff ] <<<<< ..' - call ezfio_get_ao_tc_eff_map_j1b_coeff(j1b_coeff) + call ezfio_get_tc_keywords_j1b_coeff(j1b_coeff) IRP_IF MPI call MPI_BCAST(j1b_coeff, (nucl_num), MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) if (ierr /= MPI_SUCCESS) then