From bb8ecd90e83147525bf57357526dc5bc9508eafb Mon Sep 17 00:00:00 2001 From: eginer Date: Fri, 6 Dec 2024 15:47:48 +0100 Subject: [PATCH] all one-body potentials are OK --- .../extra_basis_int/extra_basis_int.irp.f | 59 +++++++++- .../extra_basis_int/ref_extra_basis.irp.f | 64 ++++++++++- .../local/extra_basis_int/v_mixed_extra.irp.f | 102 ++++++++++++++++++ 3 files changed, 222 insertions(+), 3 deletions(-) create mode 100644 plugins/local/extra_basis_int/v_mixed_extra.irp.f diff --git a/plugins/local/extra_basis_int/extra_basis_int.irp.f b/plugins/local/extra_basis_int/extra_basis_int.irp.f index 243eb00e..6423cedd 100644 --- a/plugins/local/extra_basis_int/extra_basis_int.irp.f +++ b/plugins/local/extra_basis_int/extra_basis_int.irp.f @@ -5,7 +5,12 @@ program extra_basis_int END_DOC ! call test_overlap ! call routine_test_pot_ne - call routine_test_pot_ne_mixed +! call routine_test_pot_ne_mixed +! call routine_pot_ne_extra +! call routine_test_pot_ne_mixed +! call routine_pot_ne + call routine_test_pot_ne_extra_mixed + end subroutine test_overlap @@ -50,7 +55,7 @@ subroutine routine_test_pot_ne end -subroutine routine_test_pot_ne_mixed +subroutine routine_test_pot_mixed implicit none integer :: i,j double precision :: integral, C_center(3), mu_in @@ -67,3 +72,53 @@ subroutine routine_test_pot_ne_mixed enddo end + +subroutine routine_pot_ne_extra + implicit none + integer :: i,j + double precision :: v_extra_nucl_extra_ao + do i = 1, ao_extra_num + do j = 1, ao_extra_num + write(33,*)v_extra_nucl_extra_ao(i,j) + enddo + enddo +end + + +subroutine routine_pot_ne + implicit none + integer :: i,j + double precision :: v_nucl_extra_ao + do i = 1, ao_extra_num + do j = 1, ao_extra_num + write(33,*)v_nucl_extra_ao(i,j) + enddo + enddo +end + + +subroutine routine_test_pot_ne_mixed + implicit none + integer :: i,j + double precision :: integral,v_extra_nucl_mixed_ao + do j = 1, ao_num + do i = 1, ao_extra_num + integral = v_extra_nucl_mixed_ao(i,j) + write(33,*)integral + enddo + enddo + +end + +subroutine routine_test_pot_ne_extra_mixed + implicit none + integer :: i,j + double precision :: integral,v_nucl_mixed_ao + do j = 1, ao_num + do i = 1, ao_extra_num + integral = v_nucl_mixed_ao(i,j) + write(33,*)integral + enddo + enddo + +end diff --git a/plugins/local/extra_basis_int/ref_extra_basis.irp.f b/plugins/local/extra_basis_int/ref_extra_basis.irp.f index eb2cfd11..39055fd0 100644 --- a/plugins/local/extra_basis_int/ref_extra_basis.irp.f +++ b/plugins/local/extra_basis_int/ref_extra_basis.irp.f @@ -2,7 +2,11 @@ program pouet implicit none ! call ref_overlap ! call ref_pot - call ref_pot_mixed +! call ref_pot_mixed +! call routine_pot_ne_extra +! call ref_pot_ne_mixed +! call ref_pot_ne + call ref_pot_ne_extra_mixed end @@ -51,3 +55,61 @@ subroutine ref_pot_mixed enddo end + +subroutine routine_pot_ne_extra + implicit none + integer :: i,j + double precision :: v_extra_nucl_extra_ao + do i = 1, ao_num + do j = 1, ao_num + write(34,*)ao_integrals_n_e(i,j) + enddo + enddo +end + + +subroutine ref_pot_ne_mixed + implicit none + integer ::i,j,k + double precision :: integral + do i=1, 5 + do j = 6, ao_num + integral = 0.d0 + do k = 2,2 + integral += ao_integrals_n_e_per_atom(i,j,k) * nucl_charge(k) + enddo + write(34,*)integral + enddo + enddo +end + +subroutine ref_pot_ne + implicit none + integer ::i,j,k + double precision :: integral + do i=6,ao_num + do j = 6, ao_num + integral = 0.d0 + do k = 1,1 + integral += ao_integrals_n_e_per_atom(i,j,k) * nucl_charge(k) + enddo + write(34,*)integral + enddo + enddo + +end + +subroutine ref_pot_ne_extra_mixed + implicit none + integer ::i,j,k + double precision :: integral + do i=1, 5 + do j = 6, ao_num + integral = 0.d0 + do k = 1,1 + integral += ao_integrals_n_e_per_atom(i,j,k) * nucl_charge(k) + enddo + write(34,*)integral + enddo + enddo +end diff --git a/plugins/local/extra_basis_int/v_mixed_extra.irp.f b/plugins/local/extra_basis_int/v_mixed_extra.irp.f new file mode 100644 index 00000000..ac856692 --- /dev/null +++ b/plugins/local/extra_basis_int/v_mixed_extra.irp.f @@ -0,0 +1,102 @@ +double precision function v_extra_nucl_extra_ao(i_ao,j_ao) + implicit none + BEGIN_DOC + ! + ! Computes the following integral : + ! $\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) v_ne^{extra}(r)$. + ! + ! + ! where BOTH $\chi_i(r)$ AND $\chi_j(r)$ belongs to the EXTRA basis + ! + ! and v_ne^{extra}(r) is the Coulomb potential coming from the EXTRA nuclei + END_DOC + integer, intent(in) ::i_ao,j_ao + double precision :: mu_in,charge,coord(3) + double precision :: NAI_pol_mult_erf_ao_extra + mu_in = 1.d10 + integer :: i + v_extra_nucl_extra_ao = 0.d0 + do i = 1, extra_nucl_num + charge = extra_nucl_charge(i) + coord(1:3) = extra_nucl_coord_transp(1:3,i) + v_extra_nucl_extra_ao -= charge * NAI_pol_mult_erf_ao_extra(i_ao, j_ao, mu_in, coord) + enddo +end + + +double precision function v_nucl_extra_ao(i_ao,j_ao) + implicit none + BEGIN_DOC + ! + ! Computes the following integral : + ! $\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) v_ne(r)$. + ! + ! + ! where BOTH $\chi_i(r)$ AND $\chi_j(r)$ belongs to the EXTRA basis + ! + ! and v_ne(r) is the Coulomb potential coming from the REGULAR nuclei + END_DOC + integer, intent(in) ::i_ao,j_ao + double precision :: mu_in,charge,coord(3) + double precision :: NAI_pol_mult_erf_ao_extra + mu_in = 1.d10 + integer :: i + v_nucl_extra_ao = 0.d0 + do i = 1, nucl_num + charge = nucl_charge(i) + coord(1:3) = nucl_coord_transp(1:3,i) + v_nucl_extra_ao -= charge * NAI_pol_mult_erf_ao_extra(i_ao, j_ao, mu_in, coord) + enddo +end + + +double precision function v_extra_nucl_mixed_ao(i_ao,j_ao) + implicit none + BEGIN_DOC + ! + ! Computes the following integral : + ! $\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) v_ne^{extra}(r)$. + ! + ! + ! where $\chi_i(r)$ belongs to the EXTRA basis and $\chi_j(r)$ to the REGULAR basis + ! + ! and v_ne^{extra}(r) is the Coulomb potential coming from the EXTRA nuclei + END_DOC + integer, intent(in) ::i_ao,j_ao + double precision :: mu_in,charge,coord(3) + double precision :: NAI_pol_mult_erf_ao_extra_mixed + mu_in = 1.d10 + integer :: i + v_extra_nucl_mixed_ao = 0.d0 + do i = 1, extra_nucl_num + charge = extra_nucl_charge(i) + coord(1:3) = extra_nucl_coord_transp(1:3,i) + v_extra_nucl_mixed_ao -= charge * NAI_pol_mult_erf_ao_extra_mixed(i_ao, j_ao, mu_in, coord) + enddo +end + +double precision function v_nucl_mixed_ao(i_ao,j_ao) + implicit none + BEGIN_DOC + ! + ! Computes the following integral : + ! $\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) v_ne(r)$. + ! + ! + ! where $\chi_i(r)$ belongs to the EXTRA basis and $\chi_j(r)$ to the REGULAR basis + ! + ! and v_ne(r) is the Coulomb potential coming from the REGULAR nuclei + END_DOC + integer, intent(in) ::i_ao,j_ao + double precision :: mu_in,charge,coord(3) + double precision :: NAI_pol_mult_erf_ao_extra_mixed + mu_in = 1.d10 + integer :: i + v_nucl_mixed_ao = 0.d0 + do i = 1, nucl_num + charge = nucl_charge(i) + coord(1:3) = nucl_coord_transp(1:3,i) + v_nucl_mixed_ao -= charge * NAI_pol_mult_erf_ao_extra_mixed(i_ao, j_ao, mu_in, coord) + enddo +end +