mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-08-14 21:48:28 +02:00
modif TODO
This commit is contained in:
parent
e41e34be58
commit
5839f66aad
3
TODO
3
TODO
@ -58,3 +58,6 @@ Re-design de qp command
|
|||||||
Doc: plugins et qp_plugins
|
Doc: plugins et qp_plugins
|
||||||
|
|
||||||
Ajouter les symetries dans devel
|
Ajouter les symetries dans devel
|
||||||
|
|
||||||
|
|
||||||
|
# Parallelize i_H_psi
|
||||||
|
37
ocaml/.gitignore
vendored
37
ocaml/.gitignore
vendored
@ -1,37 +0,0 @@
|
|||||||
_build
|
|
||||||
element_create_db
|
|
||||||
element_create_db.byte
|
|
||||||
ezfio.ml
|
|
||||||
.gitignore
|
|
||||||
Git.ml
|
|
||||||
Input_ao_one_e_ints.ml
|
|
||||||
Input_ao_two_e_erf_ints.ml
|
|
||||||
Input_ao_two_e_ints.ml
|
|
||||||
Input_auto_generated.ml
|
|
||||||
Input_becke_numerical_grid.ml
|
|
||||||
Input_davidson.ml
|
|
||||||
Input_density_for_dft.ml
|
|
||||||
Input_determinants.ml
|
|
||||||
Input_dft_keywords.ml
|
|
||||||
Input_dressing.ml
|
|
||||||
Input_mo_one_e_ints.ml
|
|
||||||
Input_mo_two_e_erf_ints.ml
|
|
||||||
Input_mo_two_e_ints.ml
|
|
||||||
Input_new_functionals.ml
|
|
||||||
Input_nuclei.ml
|
|
||||||
Input_perturbation.ml
|
|
||||||
Input_pseudo.ml
|
|
||||||
Input_scf_utils.ml
|
|
||||||
qp_create_ezfio
|
|
||||||
qp_create_ezfio.native
|
|
||||||
qp_edit
|
|
||||||
qp_edit.ml
|
|
||||||
qp_edit.native
|
|
||||||
qp_print_basis
|
|
||||||
qp_print_basis.native
|
|
||||||
qp_run
|
|
||||||
qp_run.native
|
|
||||||
qp_set_mo_class
|
|
||||||
qp_set_mo_class.native
|
|
||||||
qptypes_generator.byte
|
|
||||||
Qptypes.ml
|
|
@ -17,3 +17,17 @@ BEGIN_PROVIDER [ character*(32), DFT_TYPE]
|
|||||||
DFT_TYPE = "GGA"
|
DFT_TYPE = "GGA"
|
||||||
endif
|
endif
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ logical, same_xc_func ]
|
||||||
|
BEGIN_DOC
|
||||||
|
! true if the exchange and correlation functionals are the same
|
||||||
|
END_DOC
|
||||||
|
implicit none
|
||||||
|
if(trim(correlation_functional).eq.trim(exchange_functional))then
|
||||||
|
same_xc_func = .True.
|
||||||
|
else
|
||||||
|
same_xc_func = .False.
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
@ -133,3 +133,70 @@ END_PROVIDER
|
|||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, Trace_v_xc_new, (N_states)]
|
||||||
|
implicit none
|
||||||
|
integer :: i,j,istate
|
||||||
|
double precision :: dm
|
||||||
|
BEGIN_DOC
|
||||||
|
! Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta)
|
||||||
|
END_DOC
|
||||||
|
do istate = 1, N_states
|
||||||
|
Trace_v_xc_new(istate) = 0.d0
|
||||||
|
do i = 1, mo_num
|
||||||
|
do j = 1, mo_num
|
||||||
|
Trace_v_xc_new(istate) += (potential_xc_alpha_mo(j,i,istate) ) * one_e_dm_mo_alpha_for_dft(j,i,istate)
|
||||||
|
Trace_v_xc_new(istate) += (potential_xc_beta_mo(j,i,istate) ) * one_e_dm_mo_beta_for_dft(j,i,istate)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, potential_xc_alpha_mo,(mo_num,mo_num,N_states)]
|
||||||
|
&BEGIN_PROVIDER [double precision, potential_xc_beta_mo,(mo_num,mo_num,N_states)]
|
||||||
|
implicit none
|
||||||
|
integer :: istate
|
||||||
|
|
||||||
|
do istate = 1, N_states
|
||||||
|
call ao_to_mo( &
|
||||||
|
potential_xc_alpha_ao(1,1,istate), &
|
||||||
|
size(potential_xc_alpha_ao,1), &
|
||||||
|
potential_xc_alpha_mo(1,1,istate), &
|
||||||
|
size(potential_xc_alpha_mo,1) &
|
||||||
|
)
|
||||||
|
|
||||||
|
call ao_to_mo( &
|
||||||
|
potential_xc_beta_ao(1,1,istate), &
|
||||||
|
size(potential_xc_beta_ao,1), &
|
||||||
|
potential_xc_beta_mo(1,1,istate), &
|
||||||
|
size(potential_xc_beta_mo,1) &
|
||||||
|
)
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, potential_xc_alpha_ao,(ao_num,ao_num,N_states)]
|
||||||
|
&BEGIN_PROVIDER [double precision, potential_xc_beta_ao,(ao_num,ao_num,N_states)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! general providers for the alpha/beta exchange/correlation potentials on the AO basis
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
if(trim(exchange_functional)=="short_range_LDA")then
|
||||||
|
potential_xc_alpha_ao = potential_sr_xc_alpha_ao_LDA
|
||||||
|
potential_xc_beta_ao = potential_sr_xc_beta_ao_LDA
|
||||||
|
else if(trim(exchange_functional)=="LDA")then
|
||||||
|
potential_xc_alpha_ao = potential_xc_alpha_ao_LDA
|
||||||
|
potential_xc_beta_ao = potential_xc_beta_ao_LDA
|
||||||
|
else if(exchange_functional.EQ."None")then
|
||||||
|
potential_xc_alpha_ao = 0.d0
|
||||||
|
potential_xc_beta_ao = 0.d0
|
||||||
|
else
|
||||||
|
print*, 'Exchange functional required does not exist ...'
|
||||||
|
print*,'exchange_functional',exchange_functional
|
||||||
|
stop
|
||||||
|
endif
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
@ -1,63 +1,3 @@
|
|||||||
BEGIN_PROVIDER[double precision, aos_vc_alpha_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER[double precision, aos_vc_beta_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER[double precision, aos_vx_alpha_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER[double precision, aos_vx_beta_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j)
|
|
||||||
END_DOC
|
|
||||||
integer :: istate,i,j
|
|
||||||
double precision :: r(3)
|
|
||||||
double precision :: mu,weight
|
|
||||||
double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b
|
|
||||||
double precision, allocatable :: rhoa(:),rhob(:)
|
|
||||||
double precision :: mu_local
|
|
||||||
mu_local = 1.d-9
|
|
||||||
allocate(rhoa(N_states), rhob(N_states))
|
|
||||||
do istate = 1, N_states
|
|
||||||
do j =1, ao_num
|
|
||||||
do i = 1, n_points_final_grid
|
|
||||||
r(1) = final_grid_points(1,i)
|
|
||||||
r(2) = final_grid_points(2,i)
|
|
||||||
r(3) = final_grid_points(3,i)
|
|
||||||
weight = final_weight_at_r_vector(i)
|
|
||||||
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
|
|
||||||
rhob(istate) = one_e_dm_beta_at_r(i,istate)
|
|
||||||
call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b)
|
|
||||||
call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b)
|
|
||||||
aos_vc_alpha_LDA_w(i,j,istate) = vc_a * aos_in_r_array_transp(i,j)*weight
|
|
||||||
aos_vc_beta_LDA_w(i,j,istate) = vc_b * aos_in_r_array_transp(i,j)*weight
|
|
||||||
aos_vx_alpha_LDA_w(i,j,istate) = vx_a * aos_in_r_array_transp(i,j)*weight
|
|
||||||
aos_vx_beta_LDA_w(i,j,istate) = vx_b * aos_in_r_array_transp(i,j)*weight
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [double precision, potential_x_alpha_ao_LDA,(ao_num,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER [double precision, potential_x_beta_ao_LDA ,(ao_num,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER [double precision, potential_c_alpha_ao_LDA,(ao_num,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER [double precision, potential_c_beta_ao_LDA ,(ao_num,ao_num,N_states)]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis
|
|
||||||
END_DOC
|
|
||||||
integer :: istate
|
|
||||||
double precision :: wall_1,wall_2
|
|
||||||
call wall_time(wall_1)
|
|
||||||
do istate = 1, N_states
|
|
||||||
call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vc_alpha_LDA_w(1,1,istate),n_points_final_grid,0.d0,potential_c_alpha_ao_LDA(1,1,istate),ao_num)
|
|
||||||
call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vc_beta_LDA_w(1,1,istate) ,n_points_final_grid,0.d0,potential_c_beta_ao_LDA(1,1,istate),ao_num)
|
|
||||||
call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vx_alpha_LDA_w(1,1,istate),n_points_final_grid,0.d0,potential_x_alpha_ao_LDA(1,1,istate),ao_num)
|
|
||||||
call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vx_beta_LDA_w(1,1,istate) ,n_points_final_grid,0.d0,potential_x_beta_ao_LDA(1,1,istate),ao_num)
|
|
||||||
enddo
|
|
||||||
call wall_time(wall_2)
|
|
||||||
print*,'time to provide potential_x/c_alpha/beta_ao_LDA = ',wall_2 - wall_1
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER[double precision, aos_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)]
|
BEGIN_PROVIDER[double precision, aos_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)]
|
||||||
&BEGIN_PROVIDER[double precision, aos_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]
|
&BEGIN_PROVIDER[double precision, aos_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]
|
||||||
&BEGIN_PROVIDER[double precision, aos_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)]
|
&BEGIN_PROVIDER[double precision, aos_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)]
|
||||||
|
53
src/dft_utils_one_e/pot_ao_lda_smashed.irp.f
Normal file
53
src/dft_utils_one_e/pot_ao_lda_smashed.irp.f
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
|
||||||
|
BEGIN_PROVIDER[double precision, aos_vxc_alpha_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
||||||
|
&BEGIN_PROVIDER[double precision, aos_vxc_beta_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j)
|
||||||
|
END_DOC
|
||||||
|
integer :: istate,i,j
|
||||||
|
double precision :: r(3)
|
||||||
|
double precision :: mu,weight
|
||||||
|
double precision :: e_c,vc_a,vc_b,e_x,vx_a,vx_b
|
||||||
|
double precision, allocatable :: rhoa(:),rhob(:)
|
||||||
|
double precision :: mu_local
|
||||||
|
mu_local = 1.d-9
|
||||||
|
allocate(rhoa(N_states), rhob(N_states))
|
||||||
|
do istate = 1, N_states
|
||||||
|
do i = 1, n_points_final_grid
|
||||||
|
r(1) = final_grid_points(1,i)
|
||||||
|
r(2) = final_grid_points(2,i)
|
||||||
|
r(3) = final_grid_points(3,i)
|
||||||
|
weight = final_weight_at_r_vector(i)
|
||||||
|
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
|
||||||
|
rhob(istate) = one_e_dm_beta_at_r(i,istate)
|
||||||
|
call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b)
|
||||||
|
call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b)
|
||||||
|
do j =1, ao_num
|
||||||
|
aos_vxc_alpha_LDA_w(i,j,istate) = (vc_a + vx_a) * aos_in_r_array(j,i)*weight
|
||||||
|
aos_vxc_beta_LDA_w(i,j,istate) = (vc_b + vx_b) * aos_in_r_array(j,i)*weight
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, potential_xc_alpha_ao_LDA,(ao_num,ao_num,N_states)]
|
||||||
|
&BEGIN_PROVIDER [double precision, potential_xc_beta_ao_LDA ,(ao_num,ao_num,N_states)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis
|
||||||
|
END_DOC
|
||||||
|
integer :: istate
|
||||||
|
double precision :: wall_1,wall_2
|
||||||
|
call wall_time(wall_1)
|
||||||
|
print*,'providing the XC potentials LDA '
|
||||||
|
do istate = 1, N_states
|
||||||
|
call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vxc_alpha_LDA_w(1,1,istate),n_points_final_grid,0.d0,potential_xc_alpha_ao_LDA(1,1,istate),ao_num)
|
||||||
|
call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_vxc_beta_LDA_w(1,1,istate) ,n_points_final_grid,0.d0,potential_xc_beta_ao_LDA(1,1,istate),ao_num)
|
||||||
|
enddo
|
||||||
|
call wall_time(wall_2)
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
BEGIN_PROVIDER [double precision, shifting_constant, (N_states)]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! shifting_constant = (E_{Hxc} - <\Psi | V_{Hxc} | \Psi>) / N_elec
|
|
||||||
! constant to add to the potential in order to obtain the variational energy as
|
|
||||||
! the eigenvalue of the effective long-range Hamiltonian
|
|
||||||
! (see original paper of Levy PRL 113, 113002 (2014), equation (17) )
|
|
||||||
END_DOC
|
|
||||||
integer :: istate
|
|
||||||
do istate = 1, N_states
|
|
||||||
shifting_constant(istate) = energy_x(istate) + energy_c(istate) + short_range_Hartree(istate) - Trace_v_Hxc(istate)
|
|
||||||
enddo
|
|
||||||
shifting_constant = shifting_constant / dble(elec_num)
|
|
||||||
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
@ -1,75 +1,3 @@
|
|||||||
BEGIN_PROVIDER[double precision, aos_sr_vc_alpha_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER[double precision, aos_sr_vc_beta_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER[double precision, aos_sr_vx_alpha_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER[double precision, aos_sr_vx_beta_LDA_w, (n_points_final_grid,ao_num,N_states)]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j)
|
|
||||||
END_DOC
|
|
||||||
integer :: istate,i,j
|
|
||||||
double precision :: r(3)
|
|
||||||
double precision :: mu,weight
|
|
||||||
double precision :: e_c,sr_vc_a,sr_vc_b,e_x,sr_vx_a,sr_vx_b
|
|
||||||
double precision, allocatable :: rhoa(:),rhob(:)
|
|
||||||
allocate(rhoa(N_states), rhob(N_states))
|
|
||||||
do istate = 1, N_states
|
|
||||||
do i = 1, n_points_final_grid
|
|
||||||
r(1) = final_grid_points(1,i)
|
|
||||||
r(2) = final_grid_points(2,i)
|
|
||||||
r(3) = final_grid_points(3,i)
|
|
||||||
weight=final_weight_at_r_vector(i)
|
|
||||||
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
|
|
||||||
rhob(istate) = one_e_dm_beta_at_r(i,istate)
|
|
||||||
call ec_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b)
|
|
||||||
call ex_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b)
|
|
||||||
do j =1, ao_num
|
|
||||||
aos_sr_vc_alpha_LDA_w(i,j,istate) = sr_vc_a * aos_in_r_array(j,i)*weight
|
|
||||||
aos_sr_vc_beta_LDA_w(i,j,istate) = sr_vc_b * aos_in_r_array(j,i)*weight
|
|
||||||
aos_sr_vx_alpha_LDA_w(i,j,istate) = sr_vx_a * aos_in_r_array(j,i)*weight
|
|
||||||
aos_sr_vx_beta_LDA_w(i,j,istate) = sr_vx_b * aos_in_r_array(j,i)*weight
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [double precision, potential_sr_x_alpha_ao_LDA,(ao_num,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER [double precision, potential_sr_x_beta_ao_LDA,(ao_num,ao_num,N_states)]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! short range exchange alpha/beta potentials with LDA functional on the |AO| basis
|
|
||||||
END_DOC
|
|
||||||
! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states.
|
|
||||||
call dgemm('N','N',ao_num,ao_num*N_states,n_points_final_grid,1.d0, &
|
|
||||||
aos_in_r_array,size(aos_in_r_array,1), &
|
|
||||||
aos_sr_vx_alpha_LDA_w,size(aos_sr_vx_alpha_LDA_w,1),0.d0,&
|
|
||||||
potential_sr_x_alpha_ao_LDA,size(potential_sr_x_alpha_ao_LDA,1))
|
|
||||||
call dgemm('N','N',ao_num,ao_num*N_states,n_points_final_grid,1.d0, &
|
|
||||||
aos_in_r_array,size(aos_in_r_array,1), &
|
|
||||||
aos_sr_vx_beta_LDA_w,size(aos_sr_vx_beta_LDA_w,1),0.d0,&
|
|
||||||
potential_sr_x_beta_ao_LDA,size(potential_sr_x_beta_ao_LDA,1))
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [double precision, potential_sr_c_alpha_ao_LDA,(ao_num,ao_num,N_states)]
|
|
||||||
&BEGIN_PROVIDER [double precision, potential_sr_c_beta_ao_LDA,(ao_num,ao_num,N_states)]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! short range correlation alpha/beta potentials with LDA functional on the |AO| basis
|
|
||||||
END_DOC
|
|
||||||
! Second dimension is given as ao_num * N_states so that Lapack does the loop over N_states.
|
|
||||||
call dgemm('N','N',ao_num,ao_num*N_states,n_points_final_grid,1.d0, &
|
|
||||||
aos_in_r_array,size(aos_in_r_array,1), &
|
|
||||||
aos_sr_vc_alpha_LDA_w,size(aos_sr_vc_alpha_LDA_w,1),0.d0,&
|
|
||||||
potential_sr_c_alpha_ao_LDA,size(potential_sr_c_alpha_ao_LDA,1))
|
|
||||||
call dgemm('N','N',ao_num,ao_num*N_states,n_points_final_grid,1.d0, &
|
|
||||||
aos_in_r_array,size(aos_in_r_array,1), &
|
|
||||||
aos_sr_vc_beta_LDA_w,size(aos_sr_vc_beta_LDA_w,1),0.d0,&
|
|
||||||
potential_sr_c_beta_ao_LDA,size(potential_sr_c_beta_ao_LDA,1))
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER[double precision, aos_sr_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)]
|
BEGIN_PROVIDER[double precision, aos_sr_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)]
|
||||||
&BEGIN_PROVIDER[double precision, aos_sr_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]!(n_points_final_grid,ao_num,N_states)]
|
&BEGIN_PROVIDER[double precision, aos_sr_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]!(n_points_final_grid,ao_num,N_states)]
|
||||||
&BEGIN_PROVIDER[double precision, aos_sr_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)]
|
&BEGIN_PROVIDER[double precision, aos_sr_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)]
|
||||||
|
55
src/dft_utils_one_e/sr_pot_ao_lda_smashed.irp.f
Normal file
55
src/dft_utils_one_e/sr_pot_ao_lda_smashed.irp.f
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
BEGIN_PROVIDER[double precision, aos_sr_vxc_alpha_LDA_w, (ao_num,n_points_final_grid,N_states)]
|
||||||
|
&BEGIN_PROVIDER[double precision, aos_sr_vxc_beta_LDA_w, (ao_num,n_points_final_grid,N_states)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j)
|
||||||
|
END_DOC
|
||||||
|
integer :: istate,i,j
|
||||||
|
double precision :: r(3)
|
||||||
|
double precision :: mu,weight
|
||||||
|
double precision :: e_c,sr_vc_a,sr_vc_b,e_x,sr_vx_a,sr_vx_b
|
||||||
|
double precision, allocatable :: rhoa(:),rhob(:)
|
||||||
|
double precision :: mu_local
|
||||||
|
mu_local = mu_erf_dft
|
||||||
|
allocate(rhoa(N_states), rhob(N_states))
|
||||||
|
do istate = 1, N_states
|
||||||
|
do i = 1, n_points_final_grid
|
||||||
|
r(1) = final_grid_points(1,i)
|
||||||
|
r(2) = final_grid_points(2,i)
|
||||||
|
r(3) = final_grid_points(3,i)
|
||||||
|
weight = final_weight_at_r_vector(i)
|
||||||
|
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
|
||||||
|
rhob(istate) = one_e_dm_beta_at_r(i,istate)
|
||||||
|
call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b)
|
||||||
|
call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b)
|
||||||
|
do j =1, ao_num
|
||||||
|
aos_sr_vxc_alpha_LDA_w(j,i,istate) = (sr_vc_a + sr_vx_a) * aos_in_r_array(j,i)*weight
|
||||||
|
aos_sr_vxc_beta_LDA_w(j,i,istate) = (sr_vc_b + sr_vx_b) * aos_in_r_array(j,i)*weight
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, potential_sr_xc_alpha_ao_LDA,(ao_num,ao_num,N_states)]
|
||||||
|
&BEGIN_PROVIDER [double precision, potential_sr_xc_beta_ao_LDA ,(ao_num,ao_num,N_states)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
call dgemm('N','T',ao_num,ao_num*N_states,n_points_final_grid,1.d0, &
|
||||||
|
aos_in_r_array,size(aos_in_r_array,1), &
|
||||||
|
aos_sr_vxc_alpha_LDA_w,size(aos_sr_vxc_alpha_LDA_w,1),0.d0,&
|
||||||
|
potential_sr_xc_alpha_ao_LDA,size(potential_sr_xc_alpha_ao_LDA,1))
|
||||||
|
|
||||||
|
call dgemm('N','T',ao_num,ao_num*N_states,n_points_final_grid,1.d0, &
|
||||||
|
aos_in_r_array,size(aos_in_r_array,1), &
|
||||||
|
aos_sr_vxc_beta_LDA_w,size(aos_sr_vxc_beta_LDA_w,1),0.d0,&
|
||||||
|
potential_sr_xc_beta_ao_LDA,size(potential_sr_xc_beta_ao_LDA,1))
|
||||||
|
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
@ -109,10 +109,7 @@
|
|||||||
integer(key_kind), allocatable :: keys(:)
|
integer(key_kind), allocatable :: keys(:)
|
||||||
double precision, allocatable :: values(:)
|
double precision, allocatable :: values(:)
|
||||||
|
|
||||||
|
!$OMP PARALLEL DEFAULT(NONE) if (ao_num > 100) &
|
||||||
|
|
||||||
|
|
||||||
!$OMP PARALLEL DEFAULT(NONE) &
|
|
||||||
!$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max, &
|
!$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max, &
|
||||||
!$OMP n_elements,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)&
|
!$OMP n_elements,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)&
|
||||||
!$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,&
|
!$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,&
|
||||||
@ -125,7 +122,7 @@
|
|||||||
ao_two_e_integral_alpha_tmp = 0.d0
|
ao_two_e_integral_alpha_tmp = 0.d0
|
||||||
ao_two_e_integral_beta_tmp = 0.d0
|
ao_two_e_integral_beta_tmp = 0.d0
|
||||||
|
|
||||||
!$OMP DO SCHEDULE(dynamic,64)
|
!$OMP DO SCHEDULE(static,1)
|
||||||
!DIR$ NOVECTOR
|
!DIR$ NOVECTOR
|
||||||
do i8=0_8,ao_integrals_map%map_size
|
do i8=0_8,ao_integrals_map%map_size
|
||||||
n_elements = n_elements_max
|
n_elements = n_elements_max
|
||||||
@ -153,8 +150,6 @@
|
|||||||
!$OMP END DO NOWAIT
|
!$OMP END DO NOWAIT
|
||||||
!$OMP CRITICAL
|
!$OMP CRITICAL
|
||||||
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
|
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
|
||||||
!$OMP END CRITICAL
|
|
||||||
!$OMP CRITICAL
|
|
||||||
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
|
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
|
||||||
!$OMP END CRITICAL
|
!$OMP END CRITICAL
|
||||||
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)
|
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)
|
||||||
|
@ -36,7 +36,7 @@ subroutine check_coherence_functional
|
|||||||
ifound_c = index(correlation_functional,"short_range")
|
ifound_c = index(correlation_functional,"short_range")
|
||||||
endif
|
endif
|
||||||
print*,ifound_x,ifound_c
|
print*,ifound_x,ifound_c
|
||||||
if(ifound_x .eq.0 .or. ifound_c .eq. 0)then
|
if(ifound_x .ne.0 .or. ifound_c .ne. 0)then
|
||||||
print*,'YOU ARE USING THE RANGE SEPARATED KS PROGRAM BUT YOUR INPUT KEYWORD FOR '
|
print*,'YOU ARE USING THE RANGE SEPARATED KS PROGRAM BUT YOUR INPUT KEYWORD FOR '
|
||||||
print*,'exchange_functional is ',exchange_functional
|
print*,'exchange_functional is ',exchange_functional
|
||||||
print*,'correlation_functional is ',correlation_functional
|
print*,'correlation_functional is ',correlation_functional
|
||||||
|
@ -4,12 +4,21 @@
|
|||||||
integer :: i,j,k,l
|
integer :: i,j,k,l
|
||||||
ao_potential_alpha_xc = 0.d0
|
ao_potential_alpha_xc = 0.d0
|
||||||
ao_potential_beta_xc = 0.d0
|
ao_potential_beta_xc = 0.d0
|
||||||
do i = 1, ao_num
|
if(same_xc_func)then
|
||||||
do j = 1, ao_num
|
do i = 1, ao_num
|
||||||
ao_potential_alpha_xc(i,j) = potential_c_alpha_ao(i,j,1) + potential_x_alpha_ao(i,j,1)
|
do j = 1, ao_num
|
||||||
ao_potential_beta_xc(i,j) = potential_c_beta_ao(i,j,1) + potential_x_beta_ao(i,j,1)
|
ao_potential_alpha_xc(i,j) = potential_xc_alpha_ao(i,j,1)
|
||||||
|
ao_potential_beta_xc(i,j) = potential_xc_beta_ao(i,j,1)
|
||||||
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
else
|
||||||
|
do i = 1, ao_num
|
||||||
|
do j = 1, ao_num
|
||||||
|
ao_potential_alpha_xc(i,j) = potential_c_alpha_ao(i,j,1) + potential_x_alpha_ao(i,j,1)
|
||||||
|
ao_potential_beta_xc(i,j) = potential_c_beta_ao(i,j,1) + potential_x_beta_ao(i,j,1)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
endif
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [double precision, e_exchange_dft]
|
BEGIN_PROVIDER [double precision, e_exchange_dft]
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
use map_module
|
use map_module
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Alpha Fock matrix in AO basis set
|
! Alpha Fock matrix in ao basis set
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: i,j,k,l,k1,r,s
|
integer :: i,j,k,l,k1,r,s
|
||||||
@ -35,7 +35,7 @@
|
|||||||
ao_two_e_integral_beta_tmp = 0.d0
|
ao_two_e_integral_beta_tmp = 0.d0
|
||||||
|
|
||||||
q = ao_num*ao_num*ao_num*ao_num
|
q = ao_num*ao_num*ao_num*ao_num
|
||||||
!$OMP DO SCHEDULE(static,64)
|
!$OMP DO SCHEDULE(dynamic)
|
||||||
do p=1_8,q
|
do p=1_8,q
|
||||||
call two_e_integrals_index_reverse(kk,ii,ll,jj,p)
|
call two_e_integrals_index_reverse(kk,ii,ll,jj,p)
|
||||||
if ( (kk(1)>ao_num).or. &
|
if ( (kk(1)>ao_num).or. &
|
||||||
@ -91,6 +91,8 @@
|
|||||||
!$OMP END DO NOWAIT
|
!$OMP END DO NOWAIT
|
||||||
!$OMP CRITICAL
|
!$OMP CRITICAL
|
||||||
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
|
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
|
||||||
|
!$OMP END CRITICAL
|
||||||
|
!$OMP CRITICAL
|
||||||
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
|
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
|
||||||
!$OMP END CRITICAL
|
!$OMP END CRITICAL
|
||||||
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)
|
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)
|
||||||
@ -203,19 +205,18 @@
|
|||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, Fock_matrix_ao_alpha, (ao_num, ao_num) ]
|
BEGIN_PROVIDER [ double precision, Fock_matrix_ao_alpha, (ao_num, ao_num) ]
|
||||||
&BEGIN_PROVIDER [ double precision, Fock_matrix_ao_beta, (ao_num, ao_num) ]
|
&BEGIN_PROVIDER [ double precision, Fock_matrix_ao_beta, (ao_num, ao_num) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Alpha Fock matrix in AO basis set
|
! Alpha Fock matrix in ao basis set
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: i,j
|
integer :: i,j
|
||||||
do j=1,ao_num
|
do j=1,ao_num
|
||||||
do i=1,ao_num
|
do i=1,ao_num
|
||||||
Fock_matrix_ao_alpha(i,j) = Fock_matrix_alpha_no_xc_ao(i,j) + ao_potential_alpha_xc(i,j)
|
Fock_matrix_ao_alpha(i,j) = Fock_matrix_alpha_no_xc_ao(i,j) + ao_potential_alpha_xc(i,j)
|
||||||
Fock_matrix_ao_beta (i,j) = Fock_matrix_beta_no_xc_ao(i,j) + ao_potential_beta_xc(i,j)
|
Fock_matrix_ao_beta(i,j) = Fock_matrix_beta_no_xc_ao(i,j) + ao_potential_beta_xc(i,j)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -226,7 +227,7 @@ END_PROVIDER
|
|||||||
&BEGIN_PROVIDER [ double precision, Fock_matrix_beta_no_xc_ao, (ao_num, ao_num) ]
|
&BEGIN_PROVIDER [ double precision, Fock_matrix_beta_no_xc_ao, (ao_num, ao_num) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Mono electronic an Coulomb matrix in AO basis set
|
! Mono electronic an Coulomb matrix in ao basis set
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: i,j
|
integer :: i,j
|
||||||
|
@ -4,12 +4,22 @@
|
|||||||
integer :: i,j,k,l
|
integer :: i,j,k,l
|
||||||
ao_potential_alpha_xc = 0.d0
|
ao_potential_alpha_xc = 0.d0
|
||||||
ao_potential_beta_xc = 0.d0
|
ao_potential_beta_xc = 0.d0
|
||||||
do i = 1, ao_num
|
!if(same_xc_func)then
|
||||||
do j = 1, ao_num
|
! do i = 1, ao_num
|
||||||
ao_potential_alpha_xc(i,j) = potential_c_alpha_ao(i,j,1) + potential_x_alpha_ao(i,j,1)
|
! do j = 1, ao_num
|
||||||
ao_potential_beta_xc(i,j) = potential_c_beta_ao(i,j,1) + potential_x_beta_ao(i,j,1)
|
! ao_potential_alpha_xc(j,i) = potential_xc_alpha_ao(j,i,1)
|
||||||
|
! ao_potential_beta_xc(j,i) = potential_xc_beta_ao(j,i,1)
|
||||||
|
! enddo
|
||||||
|
! enddo
|
||||||
|
!else
|
||||||
|
do i = 1, ao_num
|
||||||
|
do j = 1, ao_num
|
||||||
|
ao_potential_alpha_xc(j,i) = potential_c_alpha_ao(j,i,1) + potential_x_alpha_ao(j,i,1)
|
||||||
|
ao_potential_beta_xc(j,i) = potential_c_beta_ao(j,i,1) + potential_x_beta_ao(j,i,1)
|
||||||
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
!endif
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [double precision, e_exchange_dft]
|
BEGIN_PROVIDER [double precision, e_exchange_dft]
|
||||||
|
Loading…
Reference in New Issue
Block a user