mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-25 05:51:46 +02:00
Working !
This commit is contained in:
parent
fbab2d613e
commit
cda3a5ee9c
@ -253,7 +253,6 @@ if __name__ == "__main__":
|
||||
alpha_tot += alpha
|
||||
beta_tot += beta
|
||||
l_zeff.append(zeff)
|
||||
|
||||
# _
|
||||
# /\ _| _| _|_ _ _ _ _|_ o _
|
||||
# /--\ (_| (_| |_ (_) (/_ /_ | | (_)
|
||||
|
@ -102,38 +102,38 @@ Documentation
|
||||
`ao_nucl_elec_integral <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L1>`_
|
||||
interaction nuclear electron
|
||||
|
||||
`ao_nucl_elec_integral_per_atom <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L199>`_
|
||||
`ao_nucl_elec_integral_per_atom <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L219>`_
|
||||
ao_nucl_elec_integral_per_atom(i,j,k) = -<AO(i)|1/|r-Rk|AO(j)>
|
||||
where Rk is the geometry of the kth atom
|
||||
|
||||
`give_polynom_mult_center_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L346>`_
|
||||
`give_polynom_mult_center_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L366>`_
|
||||
Undocumented
|
||||
|
||||
`i_x1_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L474>`_
|
||||
`i_x1_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L494>`_
|
||||
Undocumented
|
||||
|
||||
`i_x2_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L545>`_
|
||||
`i_x2_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L565>`_
|
||||
Undocumented
|
||||
|
||||
`int_gaus_pol <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L616>`_
|
||||
`int_gaus_pol <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L636>`_
|
||||
Undocumented
|
||||
|
||||
`nai_pol_mult <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L267>`_
|
||||
`nai_pol_mult <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L287>`_
|
||||
Undocumented
|
||||
|
||||
`v_e_n <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L597>`_
|
||||
`v_e_n <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L617>`_
|
||||
Undocumented
|
||||
|
||||
`v_phi <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L661>`_
|
||||
`v_phi <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L681>`_
|
||||
Undocumented
|
||||
|
||||
`v_r <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L645>`_
|
||||
`v_r <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L665>`_
|
||||
Undocumented
|
||||
|
||||
`v_theta <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L674>`_
|
||||
`v_theta <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L694>`_
|
||||
Undocumented
|
||||
|
||||
`wallis <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L690>`_
|
||||
`wallis <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L710>`_
|
||||
Undocumented
|
||||
|
||||
`mo_nucl_elec_integral <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_mo_ints.irp.f#L1>`_
|
||||
|
@ -188,9 +188,9 @@ double precision, intent(in) :: a(3),g_a,b(3),g_b,c(3)
|
||||
integer kmax_max,lmax_max,ntot_max,nkl_max
|
||||
parameter (kmax_max=2,lmax_max=2,nkl_max=4)
|
||||
parameter (ntot_max=10)
|
||||
integer, intent(in) :: lmax,kmax,n_kl(kmax_max,0:lmax_max)
|
||||
integer, intent(in) :: lmax,kmax,n_kl(kmax,0:lmax)
|
||||
integer, intent(in) :: n_a(3),n_b(3)
|
||||
double precision, intent(in) :: v_kl(kmax_max,0:lmax_max),dz_kl(kmax_max,0:lmax_max)
|
||||
double precision, intent(in) :: v_kl(kmax,0:lmax),dz_kl(kmax,0:lmax)
|
||||
|
||||
|
||||
!
|
||||
|
@ -4,21 +4,93 @@
|
||||
END_DOC
|
||||
implicit none
|
||||
double precision :: alpha, beta, gama, delta
|
||||
integer :: i_c,num_A,num_B
|
||||
integer :: num_A,num_B
|
||||
double precision :: A_center(3),B_center(3),C_center(3)
|
||||
integer :: power_A(3),power_B(3)
|
||||
integer :: i,j,k,l,n_pt_in,m
|
||||
double precision ::overlap_x,overlap_y,overlap_z,overlap,dx,NAI_pol_mult, Vloc, Vpseudo, Vpseudo_num
|
||||
double precision :: dump
|
||||
integer :: nucl_numC
|
||||
! Important for OpenMP
|
||||
double precision ::overlap_x,overlap_y,overlap_z,overlap,dx,NAI_pol_mult
|
||||
|
||||
ao_nucl_elec_integral = 0.d0
|
||||
ao_nucl_elec_integral = ao_nucl_elec_integral_pseudo ! 0.d0
|
||||
|
||||
! _
|
||||
! /| / |_)
|
||||
! | / | \
|
||||
!
|
||||
|
||||
!$OMP PARALLEL &
|
||||
!$OMP DEFAULT (NONE) &
|
||||
!$OMP PRIVATE (i,j,k,l,m,alpha,beta,A_center,B_center,C_center,power_A,power_B, &
|
||||
!$OMP num_A,num_B,Z,c,n_pt_in) &
|
||||
!$OMP SHARED (ao_num,ao_prim_num,ao_expo_transp,ao_power,ao_nucl,nucl_coord,ao_coef_transp, &
|
||||
!$OMP n_pt_max_integrals,ao_nucl_elec_integral,nucl_num,nucl_charge)
|
||||
|
||||
n_pt_in = n_pt_max_integrals
|
||||
|
||||
!$OMP DO SCHEDULE (guided)
|
||||
|
||||
do j = 1, ao_num
|
||||
num_A = ao_nucl(j)
|
||||
power_A(1:3)= ao_power(j,1:3)
|
||||
A_center(1:3) = nucl_coord(num_A,1:3)
|
||||
|
||||
do i = 1, ao_num
|
||||
|
||||
num_B = ao_nucl(i)
|
||||
power_B(1:3)= ao_power(i,1:3)
|
||||
B_center(1:3) = nucl_coord(num_B,1:3)
|
||||
|
||||
do l=1,ao_prim_num(j)
|
||||
alpha = ao_expo_transp(l,j)
|
||||
|
||||
do m=1,ao_prim_num(i)
|
||||
beta = ao_expo_transp(m,i)
|
||||
|
||||
double precision :: c
|
||||
c = 0.d0
|
||||
|
||||
do k = 1, nucl_num
|
||||
double precision :: Z
|
||||
Z = nucl_charge(k)
|
||||
|
||||
C_center(1:3) = nucl_coord(k,1:3)
|
||||
|
||||
c = c - Z*NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in)
|
||||
|
||||
enddo
|
||||
ao_nucl_elec_integral(i,j) = ao_nucl_elec_integral(i,j) + &
|
||||
ao_coef_transp(l,j)*ao_coef_transp(m,i)*c
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
|
||||
!$OMP END DO
|
||||
!$OMP END PARALLEL
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral_pseudo, (ao_num_align,ao_num)]
|
||||
BEGIN_DOC
|
||||
! interaction nuclear electron
|
||||
END_DOC
|
||||
implicit none
|
||||
double precision :: alpha, beta, gama, delta
|
||||
integer :: num_A,num_B
|
||||
double precision :: A_center(3),B_center(3),C_center(3)
|
||||
integer :: power_A(3),power_B(3)
|
||||
integer :: i,j,k,l,n_pt_in,m
|
||||
double precision :: Vloc, Vpseudo
|
||||
|
||||
double precision :: cpu_1, cpu_2, wall_1, wall_2, wall_0
|
||||
integer :: thread_num
|
||||
|
||||
ao_nucl_elec_integral_pseudo = 0.d0
|
||||
|
||||
!
|
||||
! | _ _ _. |
|
||||
! |_ (_) (_ (_| |
|
||||
!
|
||||
!! Parameters of the local part of pseudo:
|
||||
|
||||
integer klocmax
|
||||
integer, allocatable :: n_k(:,:)
|
||||
@ -32,38 +104,17 @@
|
||||
call ezfio_get_pseudo_n_k(n_k)
|
||||
call ezfio_get_pseudo_dz_k(dz_k)
|
||||
|
||||
! klocmax = 3
|
||||
!
|
||||
! integer :: n_k(3)
|
||||
! double precision :: v_k(3), dz_k(3)
|
||||
!
|
||||
! v_k(1) = 1.00000000d0
|
||||
! v_k(2) = 5.35838717
|
||||
! v_k(3) = -2.07764789
|
||||
!
|
||||
! n_k(1) = -1
|
||||
! n_k(2) = 1
|
||||
! n_k(3) = 0
|
||||
!
|
||||
! dz_k(1) = 5.35838717
|
||||
! dz_k(2) = 3.67918975
|
||||
! dz_k(3) = 1.60507673
|
||||
print*, "======================="
|
||||
print*, "======================="
|
||||
print*, "======================="
|
||||
!! Dump array
|
||||
integer, allocatable :: n_k_dump(:)
|
||||
double precision, allocatable :: v_k_dump(:), dz_k_dump(:)
|
||||
|
||||
print*, "nucl_num", nucl_num
|
||||
print*, "klocmax", klocmax
|
||||
allocate(n_k_dump(1:klocmax), v_k_dump(1:klocmax), dz_k_dump(1:klocmax))
|
||||
|
||||
print*, "n_k_ezfio", n_k
|
||||
print*, "v_k_ezfio",v_k
|
||||
print*, "dz_k_ezfio", dz_k
|
||||
|
||||
!
|
||||
! |\ | _ ._ | _ _ _. |
|
||||
! | \| (_) | | | (_) (_ (_| |
|
||||
!
|
||||
|
||||
!! Parameters of non local part of pseudo:
|
||||
|
||||
integer :: kmax,lmax
|
||||
@ -81,120 +132,111 @@
|
||||
call ezfio_get_pseudo_v_kl(v_kl)
|
||||
call ezfio_get_pseudo_dz_kl(dz_kl)
|
||||
|
||||
print*, "kmax", kmax
|
||||
print*, "lmax",lmax
|
||||
|
||||
print*,"n_kl_ezfio", n_kl
|
||||
print*,"v_kl_ezfio", v_kl
|
||||
print*,"dz_kl_ezfio", dz_kl
|
||||
|
||||
print*, "======================="
|
||||
print*, "======================="
|
||||
print*, "======================="
|
||||
|
||||
|
||||
! lmax = 1
|
||||
! kmax = 1
|
||||
|
||||
! integer :: n_kl(1,0:1)
|
||||
! double precision :: v_kl(1,0:1), dz_kl(1,0:1)
|
||||
|
||||
! v_kl(1,0) =10.69640234
|
||||
! n_kl(1,0) = 0
|
||||
! dz_kl(1,0) = 1.32389367
|
||||
!
|
||||
! v_kl(1,1) = 10.11238853
|
||||
! n_kl(1,1) = 0
|
||||
! dz_kl(1,1) = 1.14052020
|
||||
!
|
||||
! print*, "kmax", kmax
|
||||
! print*, "lmax",lmax
|
||||
!
|
||||
! print*,"n_kl_ezfio", n_kl
|
||||
! print*,"v_kl_ezfio", v_kl
|
||||
! print*,"dz_kl_ezfio", dz_kl
|
||||
|
||||
|
||||
!! Dump array
|
||||
integer, allocatable :: n_kl_dump(:,:)
|
||||
double precision, allocatable :: v_kl_dump(:,:), dz_kl_dump(:,:)
|
||||
|
||||
allocate(n_kl_dump(kmax,0:lmax), v_kl_dump(kmax,0:lmax), dz_kl_dump(kmax,0:lmax))
|
||||
|
||||
! _
|
||||
! / _. | _ |
|
||||
! \_ (_| | (_ |_| |
|
||||
!
|
||||
|
||||
write(output_monoints,*) 'Providing the nuclear electron pseudo integrals '
|
||||
|
||||
call wall_time(wall_1)
|
||||
call cpu_time(cpu_1)
|
||||
|
||||
!$OMP PARALLEL &
|
||||
!$OMP DEFAULT (NONE) &
|
||||
!$OMP PRIVATE (i,j,k,l,m,alpha,beta,A_center,B_center,C_center,power_A,power_B, &
|
||||
!$OMP num_A,num_B,Z,c,n_pt_in, &
|
||||
!$OMP v_k_dump,n_k_dump, dz_k_dump, n_kl_dump, v_kl_dump, dz_kl_dump, &
|
||||
!$OMP wall_0,wall_2,thread_num, output_monoints) &
|
||||
!$OMP SHARED (ao_num,ao_prim_num,ao_expo_transp,ao_power,ao_nucl,nucl_coord,ao_coef_transp, &
|
||||
!$OMP n_pt_max_integrals,ao_nucl_elec_integral_pseudo,nucl_num,nucl_charge, &
|
||||
!$OMP klocmax,lmax,kmax,v_k,n_k, dz_k, n_kl, v_kl, dz_kl, &
|
||||
!$OMP wall_1)
|
||||
|
||||
n_pt_in = n_pt_max_integrals
|
||||
|
||||
!$OMP DO SCHEDULE (guided)
|
||||
|
||||
do j = 1, ao_num
|
||||
|
||||
num_A = ao_nucl(j)
|
||||
power_A(1:3)= ao_power(j,1:3)
|
||||
A_center(1:3) = nucl_coord(num_A,1:3)
|
||||
|
||||
print*, "J", j, "/", ao_num
|
||||
print*,"==================="
|
||||
|
||||
do i = 1, ao_num
|
||||
|
||||
num_B = ao_nucl(i)
|
||||
power_B(1:3)= ao_power(i,1:3)
|
||||
B_center(1:3) = nucl_coord(num_B,1:3)
|
||||
|
||||
|
||||
print*, "i", i, "/", ao_num
|
||||
|
||||
do l=1,ao_prim_num(j)
|
||||
alpha = ao_expo_transp(l,j)
|
||||
|
||||
do m=1,ao_prim_num(i)
|
||||
beta = ao_expo_transp(m,i)
|
||||
|
||||
double precision :: c
|
||||
c = 0.d0
|
||||
|
||||
do k = 1, nucl_num
|
||||
double precision :: Z
|
||||
Z = nucl_charge(k)
|
||||
|
||||
C_center(1:3) = nucl_coord(k,1:3)
|
||||
|
||||
c = c - Z*NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in)
|
||||
v_k_dump = v_k(k,1:klocmax)
|
||||
n_k_dump = n_k(k,1:klocmax)
|
||||
dz_k_dump = dz_k(k,1:klocmax)
|
||||
|
||||
! c = c + Vloc( klocmax ,v_k(k,:) ,n_k(k,:) ,dz_k(k,:), A_center,power_A,alpha,B_center,power_B,beta,C_center)
|
||||
c = c + Vloc(klocmax, v_k_dump,n_k_dump, dz_k_dump, &
|
||||
A_center,power_A,alpha,B_center,power_B,beta,C_center)
|
||||
|
||||
|
||||
n_kl_dump = n_kl(k,1:kmax,0:lmax)
|
||||
v_kl_dump = v_kl(k,1:kmax,0:lmax)
|
||||
dz_kl_dump = dz_kl(k,1:kmax,0:lmax)
|
||||
|
||||
! print*, "lmax",lmax
|
||||
! print*, "kmax",kmax
|
||||
! print*, "v_kl",v_kl_dump
|
||||
! print*, "n_kl",n_kl_dump
|
||||
! print*, n_kl_ump(1,0)
|
||||
! print*, n_kl_dump(1,1)
|
||||
! print*, "dz_kl",dz_kl_dump
|
||||
! print*, dz_kl_dump(1,0)
|
||||
! print*, dz_kl_dump(1,1)
|
||||
! print*, "A_center", A_center
|
||||
! print*, "power_A",power_A
|
||||
! print*, "alpha", alpha
|
||||
! print*, "B_center", B_center
|
||||
! print*, "power_B", power_B
|
||||
! print*, "beta", beta
|
||||
! print*, "C_center",C_center
|
||||
|
||||
c = c + Vpseudo(lmax,kmax,v_kl_dump,n_kl_dump,dz_kl_dump,A_center,power_A,alpha,B_center,power_B,beta,C_center)
|
||||
dump = Vpseudo(lmax,kmax,v_kl_dump,n_kl_dump,dz_kl_dump,A_center,power_A,alpha,B_center,power_B,beta,C_center)
|
||||
print*, dump
|
||||
! c = c - Vps(A_center,power_A,alpha,B_center,power_B,beta,C_center,klocmax,v_k,n_k,dz_k,lmax,kmax,v_kl,n_kl,dz_kl)
|
||||
|
||||
! print*, "#################"
|
||||
! print*, "#################"
|
||||
enddo
|
||||
ao_nucl_elec_integral(i,j) = ao_nucl_elec_integral(i,j) + &
|
||||
ao_nucl_elec_integral_pseudo(i,j) = ao_nucl_elec_integral_pseudo(i,j) + &
|
||||
ao_coef_transp(l,j)*ao_coef_transp(m,i)*c
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
|
||||
call wall_time(wall_2)
|
||||
if (thread_num == 0) then
|
||||
if (wall_2 - wall_0 > 1.d0) then
|
||||
wall_0 = wall_2
|
||||
write(output_monoints,*) 100.*float(j)/float(ao_num), '% in ', &
|
||||
wall_2-wall_1, 's'
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
|
||||
!$OMP END DO
|
||||
!$OMP END PARALLEL
|
||||
|
||||
|
||||
! _
|
||||
! | \ _ _. | | _ _ _. _|_ _
|
||||
! |_/ (/_ (_| | | (_) (_ (_| |_ (/_
|
||||
!
|
||||
|
||||
deallocate(n_k,v_k, dz_k)
|
||||
deallocate(n_k_dump,v_k_dump, dz_k_dump)
|
||||
|
||||
deallocate(n_kl,v_kl, dz_kl)
|
||||
deallocate(n_kl_dump,v_kl_dump, dz_kl_dump)
|
||||
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
|
||||
@ -210,7 +252,6 @@ END_PROVIDER
|
||||
integer :: power_A(3),power_B(3)
|
||||
integer :: i,j,k,l,n_pt_in,m
|
||||
double precision ::overlap_x,overlap_y,overlap_z,overlap,dx,NAI_pol_mult
|
||||
integer :: nucl_numC
|
||||
! Important for OpenMP
|
||||
|
||||
ao_nucl_elec_integral_per_atom = 0.d0
|
||||
|
@ -1,4 +1,5 @@
|
||||
pseudo
|
||||
do_pseudo logical
|
||||
klocmax integer
|
||||
v_k double precision (nuclei_nucl_num,pseudo_klocmax)
|
||||
n_k integer (nuclei_nucl_num,pseudo_klocmax)
|
||||
|
Loading…
Reference in New Issue
Block a user