10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 22:53:52 +01:00
QuantumPackage/src/dft_one_e/mu_erf_dft.irp.f

81 lines
2.2 KiB
Fortran
Raw Normal View History

2019-01-25 11:39:31 +01:00
BEGIN_PROVIDER [double precision, mu_erf_dft]
implicit none
BEGIN_DOC
2020-03-31 14:13:49 +02:00
! range separation parameter used in RS-DFT.
!
2023-10-16 16:37:08 +02:00
! It is set to mu_erf in order to be consistent with the module "hamiltonian"
2019-01-25 11:39:31 +01:00
END_DOC
mu_erf_dft = mu_erf
END_PROVIDER
BEGIN_PROVIDER [double precision, mu_of_r_dft, (n_points_final_grid)]
implicit none
integer :: i
2021-10-07 23:05:43 +02:00
if(mu_dft_type == "Read")then
call ezfio_get_mu_of_r_mu_of_r_disk(mu_of_r_dft)
else
do i = 1, n_points_final_grid
if(mu_dft_type == "cst")then
mu_of_r_dft(i) = mu_erf_dft
else if(mu_dft_type == "hf")then
mu_of_r_dft(i) = mu_of_r_hf(i)
else if(mu_dft_type == "rsc")then
mu_of_r_dft(i) = mu_rsc_of_r(i)
2021-11-09 15:48:49 +01:00
else if(mu_dft_type == "grad_rho")then
mu_of_r_dft(i) = mu_grad_rho(i)
2021-10-07 23:05:43 +02:00
else
print*,'mu_dft_type is not of good type = ',mu_dft_type
print*,'it must be of type Read, cst, hf, rsc'
print*,'Stopping ...'
stop
endif
enddo
endif
END_PROVIDER
BEGIN_PROVIDER [double precision, mu_rsc_of_r, (n_points_final_grid)]
implicit none
integer :: i
double precision :: mu_rs_c,rho,r(3), dm_a, dm_b
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)
call dm_dft_alpha_beta_at_r(r,dm_a,dm_b)
rho = dm_a + dm_b
mu_rsc_of_r(i) = mu_rs_c(rho)
enddo
2021-10-22 12:18:01 +02:00
END_PROVIDER
2021-10-07 23:05:43 +02:00
2021-10-22 12:18:01 +02:00
BEGIN_PROVIDER [double precision, mu_grad_rho, (n_points_final_grid)]
implicit none
integer :: i
double precision :: mu_grad_rho_func, r(3)
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)
mu_grad_rho(i) = mu_grad_rho_func(r)
enddo
2021-10-07 23:05:43 +02:00
END_PROVIDER
2021-10-22 12:18:01 +02:00
2021-10-07 23:05:43 +02:00
BEGIN_PROVIDER [double precision, mu_of_r_dft_average]
implicit none
integer :: i
double precision :: mu_rs_c,rho,r(3), dm_a, dm_b
mu_of_r_dft_average = 0.d0
do i = 1, n_points_final_grid
2021-10-07 23:05:43 +02:00
r(1) = final_grid_points(1,i)
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
call dm_dft_alpha_beta_at_r(r,dm_a,dm_b)
rho = dm_a + dm_b
if(mu_of_r_dft(i).gt.1.d+3)cycle
2021-10-07 23:05:43 +02:00
mu_of_r_dft_average += rho * mu_of_r_dft(i) * final_weight_at_r_vector(i)
enddo
2021-10-07 23:05:43 +02:00
mu_of_r_dft_average = mu_of_r_dft_average / dble(elec_alpha_num + elec_beta_num)
print*,'mu_of_r_dft_average = ',mu_of_r_dft_average
END_PROVIDER