10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-10-09 09:33:20 +02:00
quantum_package/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f

268 lines
8.6 KiB
Fortran
Raw Normal View History

2015-05-11 17:58:42 +02:00
BEGIN_PROVIDER [ double precision, ao_pseudo_integral, (ao_num_align,ao_num)]
2015-05-11 15:33:08 +02:00
implicit none
BEGIN_DOC
2016-09-22 11:28:27 +02:00
! Pseudo-potential integrals
2015-05-11 15:33:08 +02:00
END_DOC
Bugs to fix (#50) * Add config for knl * Add mising readme * Add .gitignore * Add pseudo to qp_convert * Working pseudo * Dressed matrix for pt2 works for one state * now eigenfunction of S^2 * minor modifs in printing * Fixed the perturbation with psi_ref instead of psi_det * Trying do really fo sin free multiple excitations * Beginning to merge MRCC and MRPT * final version of MRPT, at least I hope * Fix 404: Update Zlib Url. * Delete ifort_knl.cfg * Update module_handler.py * Update pot_ao_pseudo_ints.irp.f * Update map_module.f90 * Restaure map_module.f90 * Update configure * Update configure * Update sort.irp.f * Update sort.irp.f * Update selection.irp.f * Update selection.irp.f * Update dressing.irp.f * TApplencourt IRPF90 -> LCPQ * Remove `irpf90.make` in dependency * Update configure * Missing PROVIDE * Missing PROVIDE * Missing PROVIDE * Missing PROVIDE * Update configure * pouet * density based mrpt2 * debugging FOBOCI * Added SCF_density * New version of FOBOCI * added density.irp.f * minor changes in plugins/FOBOCI/SC2_1h1p.irp.f * added track_orb.irp.f * minor changes * minor modifs in FOBOCI * med * Minor changes * minor changes * strange things in MRPT * minor modifs mend * Fix #185 (Graphviz API / Python 2.6) * beginning to debug dft * fixed the factor 2 in lebedev * DFT integration works for non overlapping densities * DFT begins to work with lda * KS LDA is okay * added core integrals * mend * Beginning logn range integrals * Trying to handle two sets of integrals * beginning to clean erf integrals * Handling of two different mo and ao integrals map
2017-04-20 08:36:11 +02:00
2016-09-22 11:28:27 +02:00
if (read_ao_one_integrals) then
call read_one_e_integrals('ao_pseudo_integral', ao_pseudo_integral,&
size(ao_pseudo_integral,1), size(ao_pseudo_integral,2))
print *, 'AO pseudopotential integrals read from disk'
else
ao_pseudo_integral = 0.d0
if (do_pseudo) then
if (pseudo_klocmax > 0) then
ao_pseudo_integral += ao_pseudo_integral_local
endif
if (pseudo_kmax > 0) then
ao_pseudo_integral += ao_pseudo_integral_non_local
endif
2016-05-10 18:38:54 +02:00
endif
2015-05-11 17:58:42 +02:00
endif
2016-09-22 11:28:27 +02:00
if (write_ao_one_integrals) then
call write_one_e_integrals('ao_pseudo_integral', ao_pseudo_integral,&
size(ao_pseudo_integral,1), size(ao_pseudo_integral,2))
print *, 'AO pseudopotential integrals written to disk'
endif
2015-05-11 15:33:08 +02:00
END_PROVIDER
2015-11-17 12:20:19 +01:00
BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num_align,ao_num)]
2015-05-11 15:33:08 +02:00
implicit none
BEGIN_DOC
2015-11-17 12:20:19 +01:00
! Local pseudo-potential
2015-05-11 15:33:08 +02:00
END_DOC
2015-12-11 14:52:29 +01:00
include 'Utils/constants.include.F'
2015-11-17 12:20:19 +01:00
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
integer :: omp_get_thread_num
2015-11-17 12:20:19 +01:00
2015-05-11 17:58:42 +02:00
ao_pseudo_integral_local = 0.d0
2015-11-17 12:20:19 +01:00
2015-11-17 12:13:33 +01:00
print*, 'Providing the nuclear electron pseudo integrals (local)'
2015-05-02 12:39:09 +02:00
call wall_time(wall_1)
call cpu_time(cpu_1)
2015-11-17 12:20:19 +01:00
thread_num = 0
2017-03-17 19:05:30 +01:00
!$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 wall_0,wall_2,thread_num) &
!$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,&
!$OMP ao_pseudo_integral_local,nucl_num,nucl_charge, &
!$OMP pseudo_klocmax,pseudo_lmax,pseudo_kmax,pseudo_v_k_transp,pseudo_n_k_transp, pseudo_dz_k_transp,&
!$OMP wall_1)
!$ thread_num = omp_get_thread_num()
2017-04-12 18:26:57 +02:00
wall_0 = wall_1
2017-03-17 19:05:30 +01:00
!$OMP DO SCHEDULE (guided)
2015-05-11 15:06:22 +02:00
2015-11-17 12:13:33 +01:00
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_ordered_transp(l,j)
do m=1,ao_prim_num(i)
beta = ao_expo_ordered_transp(m,i)
double precision :: c
c = 0.d0
if (dabs(ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i))&
2015-12-11 14:52:29 +01:00
< thresh) then
2015-11-17 12:13:33 +01:00
cycle
endif
do k = 1, nucl_num
double precision :: Z
Z = nucl_charge(k)
C_center(1:3) = nucl_coord(k,1:3)
2015-12-02 00:32:04 +01:00
c = c + Vloc(pseudo_klocmax, &
pseudo_v_k_transp (1,k), &
pseudo_n_k_transp (1,k), &
pseudo_dz_k_transp(1,k), &
2015-11-17 12:13:33 +01:00
A_center,power_A,alpha,B_center,power_B,beta,C_center)
enddo
ao_pseudo_integral_local(i,j) = ao_pseudo_integral_local(i,j) +&
ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i)*c
enddo
2015-05-02 12:39:09 +02:00
enddo
2015-11-17 12:13:33 +01:00
enddo
2015-05-02 12:39:09 +02:00
call wall_time(wall_2)
if (thread_num == 0) then
if (wall_2 - wall_0 > 1.d0) then
wall_0 = wall_2
2015-11-17 12:13:33 +01:00
print*, 100.*float(j)/float(ao_num), '% in ', &
wall_2-wall_1, 's'
2015-05-02 12:39:09 +02:00
endif
endif
enddo
2017-03-17 19:05:30 +01:00
!$OMP END DO
!$OMP END PARALLEL
2015-05-02 12:39:09 +02:00
2015-05-11 15:33:08 +02:00
END_PROVIDER
2015-05-11 15:50:39 +02:00
2015-05-11 17:58:42 +02:00
BEGIN_PROVIDER [ double precision, ao_pseudo_integral_non_local, (ao_num_align,ao_num)]
2015-05-11 15:50:39 +02:00
implicit none
BEGIN_DOC
2015-11-17 12:20:19 +01:00
! Local pseudo-potential
2015-05-11 15:50:39 +02:00
END_DOC
2015-12-11 14:52:29 +01:00
include 'Utils/constants.include.F'
2015-11-17 12:20:19 +01:00
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
integer :: omp_get_thread_num
2015-11-17 12:20:19 +01:00
double precision :: cpu_1, cpu_2, wall_1, wall_2, wall_0
integer :: thread_num
2015-05-11 17:58:42 +02:00
ao_pseudo_integral_non_local = 0.d0
2015-11-17 12:20:19 +01:00
2015-11-17 12:13:33 +01:00
print*, 'Providing the nuclear electron pseudo integrals (non-local)'
2015-05-11 15:50:39 +02:00
call wall_time(wall_1)
call cpu_time(cpu_1)
2015-11-17 12:20:19 +01:00
thread_num = 0
2016-10-01 17:24:08 +02:00
2017-03-17 19:05:30 +01:00
!$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 wall_0,wall_2,thread_num) &
!$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,&
!$OMP ao_pseudo_integral_non_local,nucl_num,nucl_charge,&
!$OMP pseudo_klocmax,pseudo_lmax,pseudo_kmax,pseudo_n_kl_transp, pseudo_v_kl_transp, pseudo_dz_kl_transp,&
!$OMP wall_1)
!$ thread_num = omp_get_thread_num()
2017-04-12 18:26:57 +02:00
wall_0 = wall_1
2017-03-17 19:05:30 +01:00
!$OMP DO SCHEDULE (guided)
2017-03-17 18:45:52 +01:00
!
2015-11-17 12:13:33 +01:00
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_ordered_transp(l,j)
do m=1,ao_prim_num(i)
beta = ao_expo_ordered_transp(m,i)
double precision :: c
c = 0.d0
if (dabs(ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i))&
2015-12-11 14:52:29 +01:00
< thresh) then
2015-11-17 12:13:33 +01:00
cycle
endif
2015-11-17 12:13:33 +01:00
do k = 1, nucl_num
double precision :: Z
Z = nucl_charge(k)
C_center(1:3) = nucl_coord(k,1:3)
2015-12-02 00:32:04 +01:00
c = c + Vpseudo(pseudo_lmax,pseudo_kmax, &
pseudo_v_kl_transp(1,0,k), &
pseudo_n_kl_transp(1,0,k), &
pseudo_dz_kl_transp(1,0,k), &
A_center,power_A,alpha,B_center,power_B,beta,C_center)
2015-11-17 12:13:33 +01:00
enddo
ao_pseudo_integral_non_local(i,j) = ao_pseudo_integral_non_local(i,j) +&
ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i)*c
enddo
2015-05-11 15:50:39 +02:00
enddo
2015-11-17 12:13:33 +01:00
enddo
2015-05-11 15:50:39 +02:00
call wall_time(wall_2)
if (thread_num == 0) then
if (wall_2 - wall_0 > 1.d0) then
wall_0 = wall_2
2015-11-17 12:13:33 +01:00
print*, 100.*float(j)/float(ao_num), '% in ', &
wall_2-wall_1, 's'
2015-05-11 15:50:39 +02:00
endif
endif
enddo
2017-03-17 19:05:30 +01:00
!$OMP END DO
!$OMP END PARALLEL
2015-11-17 12:20:19 +01:00
END_PROVIDER
2015-05-11 15:50:39 +02:00
2015-12-02 00:32:04 +01:00
BEGIN_PROVIDER [ double precision, pseudo_v_k_transp, (pseudo_klocmax,nucl_num) ]
&BEGIN_PROVIDER [ integer , pseudo_n_k_transp, (pseudo_klocmax,nucl_num) ]
&BEGIN_PROVIDER [ double precision, pseudo_dz_k_transp, (pseudo_klocmax,nucl_num)]
implicit none
BEGIN_DOC
! Transposed arrays for pseudopotentials
END_DOC
2015-05-13 22:52:03 +02:00
2015-12-02 00:32:04 +01:00
integer :: i,j
do j=1,nucl_num
do i=1,pseudo_klocmax
pseudo_v_k_transp (i,j) = pseudo_v_k (j,i)
pseudo_n_k_transp (i,j) = pseudo_n_k (j,i)
pseudo_dz_k_transp(i,j) = pseudo_dz_k(j,i)
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, pseudo_v_kl_transp, (pseudo_kmax,0:pseudo_lmax,nucl_num) ]
&BEGIN_PROVIDER [ integer , pseudo_n_kl_transp, (pseudo_kmax,0:pseudo_lmax,nucl_num) ]
&BEGIN_PROVIDER [ double precision, pseudo_dz_kl_transp, (pseudo_kmax,0:pseudo_lmax,nucl_num)]
implicit none
BEGIN_DOC
! Transposed arrays for pseudopotentials
END_DOC
integer :: i,j,l
do j=1,nucl_num
do l=0,pseudo_lmax
do i=1,pseudo_kmax
pseudo_v_kl_transp (i,l,j) = pseudo_v_kl (j,i,l)
pseudo_n_kl_transp (i,l,j) = pseudo_n_kl (j,i,l)
pseudo_dz_kl_transp(i,l,j) = pseudo_dz_kl(j,i,l)
enddo
enddo
enddo
END_PROVIDER
2015-05-11 15:50:39 +02:00