2023-11-13 18:36:09 +01:00
|
|
|
subroutine RG0T0pp(dotest,doACFDT,exchange_kernel,doXBS,dophBSE,TDA_T,TDA,dBSE,dTDA,doppBSE,singlet,triplet, &
|
2024-09-11 10:13:11 +02:00
|
|
|
linearize,eta,regularize,nBas,nOrb,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,dipole_int,eHF)
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2020-03-14 23:00:44 +01:00
|
|
|
! Perform one-shot calculation with a T-matrix self-energy (G0T0)
|
2019-10-16 18:14:47 +02:00
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
2023-11-13 18:36:09 +01:00
|
|
|
logical,intent(in) :: dotest
|
|
|
|
|
2020-03-21 21:09:48 +01:00
|
|
|
logical,intent(in) :: doACFDT
|
|
|
|
logical,intent(in) :: exchange_kernel
|
|
|
|
logical,intent(in) :: doXBS
|
2023-07-21 12:30:29 +02:00
|
|
|
logical,intent(in) :: dophBSE
|
|
|
|
logical,intent(in) :: doppBSE
|
2021-10-15 22:32:22 +02:00
|
|
|
logical,intent(in) :: TDA_T
|
2020-03-21 21:09:48 +01:00
|
|
|
logical,intent(in) :: TDA
|
2020-06-14 21:20:01 +02:00
|
|
|
logical,intent(in) :: dBSE
|
2020-06-14 13:04:16 +02:00
|
|
|
logical,intent(in) :: dTDA
|
2020-09-28 21:25:25 +02:00
|
|
|
logical,intent(in) :: singlet
|
|
|
|
logical,intent(in) :: triplet
|
2020-03-21 21:09:48 +01:00
|
|
|
logical,intent(in) :: linearize
|
2019-10-16 18:14:47 +02:00
|
|
|
double precision,intent(in) :: eta
|
2021-12-17 11:41:40 +01:00
|
|
|
logical,intent(in) :: regularize
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
integer,intent(in) :: nBas
|
2024-09-07 13:59:15 +02:00
|
|
|
integer,intent(in) :: nOrb
|
2020-03-21 21:09:48 +01:00
|
|
|
integer,intent(in) :: nC
|
|
|
|
integer,intent(in) :: nO
|
|
|
|
integer,intent(in) :: nV
|
|
|
|
integer,intent(in) :: nR
|
|
|
|
integer,intent(in) :: nS
|
2019-10-16 18:14:47 +02:00
|
|
|
double precision,intent(in) :: ENuc
|
|
|
|
double precision,intent(in) :: ERHF
|
2024-09-07 13:59:15 +02:00
|
|
|
double precision,intent(in) :: eHF(nOrb)
|
|
|
|
double precision,intent(in) :: ERI(nOrb,nOrb,nOrb,nOrb)
|
|
|
|
double precision,intent(in) :: dipole_int(nOrb,nOrb,ncart)
|
2019-10-16 18:14:47 +02:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
2023-11-29 16:20:53 +01:00
|
|
|
logical :: print_T = .false.
|
2024-09-11 10:13:11 +02:00
|
|
|
double precision :: lambda
|
2023-11-29 16:20:53 +01:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
integer :: isp_T
|
2020-04-13 11:33:48 +02:00
|
|
|
integer :: iblock
|
2023-07-27 19:17:20 +02:00
|
|
|
integer :: nOOs,nOOt
|
|
|
|
integer :: nVVs,nVVt
|
2024-09-07 13:59:15 +02:00
|
|
|
integer :: n_states, n_states_diag
|
2019-10-16 18:14:47 +02:00
|
|
|
double precision :: EcRPA(nspin)
|
|
|
|
double precision :: EcBSE(nspin)
|
2022-01-06 13:48:15 +01:00
|
|
|
double precision :: EcGM
|
2023-07-17 23:05:49 +02:00
|
|
|
double precision,allocatable :: Bpp(:,:)
|
|
|
|
double precision,allocatable :: Cpp(:,:)
|
|
|
|
double precision,allocatable :: Dpp(:,:)
|
2023-07-27 19:17:20 +02:00
|
|
|
double precision,allocatable :: Om1s(:),Om1t(:)
|
|
|
|
double precision,allocatable :: X1s(:,:),X1t(:,:)
|
|
|
|
double precision,allocatable :: Y1s(:,:),Y1t(:,:)
|
|
|
|
double precision,allocatable :: rho1s(:,:,:),rho1t(:,:,:)
|
|
|
|
double precision,allocatable :: Om2s(:),Om2t(:)
|
|
|
|
double precision,allocatable :: X2s(:,:),X2t(:,:)
|
|
|
|
double precision,allocatable :: Y2s(:,:),Y2t(:,:)
|
|
|
|
double precision,allocatable :: rho2s(:,:,:),rho2t(:,:,:)
|
2023-07-12 14:13:45 +02:00
|
|
|
double precision,allocatable :: Sig(:)
|
2019-10-18 23:16:37 +02:00
|
|
|
double precision,allocatable :: Z(:)
|
2023-07-17 13:35:24 +02:00
|
|
|
double precision,allocatable :: eGT(:)
|
2023-06-30 16:47:26 +02:00
|
|
|
double precision,allocatable :: eGTlin(:)
|
2024-09-10 16:27:49 +02:00
|
|
|
integer, allocatable :: supp_data_int(:)
|
|
|
|
double precision, allocatable :: supp_data_dbl(:)
|
2024-09-07 13:59:15 +02:00
|
|
|
double precision, allocatable :: Om(:), R(:,:)
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2024-08-19 18:11:39 +02:00
|
|
|
|
2020-03-11 16:41:20 +01:00
|
|
|
! Output variables
|
2019-10-16 18:14:47 +02:00
|
|
|
|
|
|
|
! Hello world
|
|
|
|
|
|
|
|
write(*,*)
|
2023-11-13 18:36:09 +01:00
|
|
|
write(*,*)'*********************************'
|
|
|
|
write(*,*)'* Restricted G0T0pp Calculation *'
|
|
|
|
write(*,*)'*********************************'
|
2019-10-16 18:14:47 +02:00
|
|
|
write(*,*)
|
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
! Initialization
|
|
|
|
|
|
|
|
lambda = 1d0
|
2023-08-23 16:04:00 +02:00
|
|
|
|
|
|
|
! TDA for T
|
|
|
|
|
|
|
|
if(TDA_T) then
|
2023-11-29 16:20:53 +01:00
|
|
|
write(*,*) 'Tamm-Dancoff approximation activated for pp T-matrix!'
|
2023-08-23 16:04:00 +02:00
|
|
|
write(*,*)
|
|
|
|
end if
|
|
|
|
|
2020-04-09 14:31:50 +02:00
|
|
|
! Dimensions of the pp-RPA linear reponse matrices
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2024-09-10 16:27:49 +02:00
|
|
|
!nOOs = nO*(nO + 1)/2
|
|
|
|
!nVVs = nV*(nV + 1)/2
|
2023-07-31 14:47:09 +02:00
|
|
|
|
2024-09-10 16:27:49 +02:00
|
|
|
nOOs = nO*nO
|
|
|
|
nVVs = nV*nV
|
2020-04-13 11:33:48 +02:00
|
|
|
|
2023-07-27 19:17:20 +02:00
|
|
|
nOOt = nO*(nO - 1)/2
|
|
|
|
nVVt = nV*(nV - 1)/2
|
2019-10-18 23:16:37 +02:00
|
|
|
|
2019-10-16 18:14:47 +02:00
|
|
|
! Memory allocation
|
|
|
|
|
2023-07-27 19:17:20 +02:00
|
|
|
allocate(Om1s(nVVs),X1s(nVVs,nVVs),Y1s(nOOs,nVVs), &
|
|
|
|
Om2s(nOOs),X2s(nVVs,nOOs),Y2s(nOOs,nOOs), &
|
2024-09-07 13:59:15 +02:00
|
|
|
rho1s(nOrb,nOrb,nVVs),rho2s(nOrb,nOrb,nOOs), &
|
2023-07-27 19:17:20 +02:00
|
|
|
Om1t(nVVt),X1t(nVVt,nVVt),Y1t(nOOt,nVVt), &
|
|
|
|
Om2t(nOOt),X2t(nVVt,nOOt),Y2t(nOOt,nOOt), &
|
2024-09-07 13:59:15 +02:00
|
|
|
rho1t(nOrb,nOrb,nVVt),rho2t(nOrb,nOrb,nOOt), &
|
|
|
|
Sig(nOrb),Z(nOrb),eGT(nOrb),eGTlin(nOrb))
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
2020-04-13 11:33:48 +02:00
|
|
|
! alpha-beta block
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
isp_T = 1
|
2024-09-10 16:27:49 +02:00
|
|
|
!iblock = 1
|
|
|
|
iblock = 3
|
2019-10-20 08:18:58 +02:00
|
|
|
|
2019-10-16 18:14:47 +02:00
|
|
|
! Compute linear response
|
|
|
|
|
2023-07-27 19:17:20 +02:00
|
|
|
allocate(Bpp(nVVs,nOOs),Cpp(nVVs,nVVs),Dpp(nOOs,nOOs))
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR_C(iblock,nOrb,nC,nO,nV,nR,nVVs,lambda,eHF,ERI,Cpp)
|
|
|
|
call ppLR_D(iblock,nOrb,nC,nO,nV,nR,nOOs,lambda,eHF,ERI,Dpp)
|
|
|
|
if(.not.TDA_T) call ppLR_B(iblock,nOrb,nC,nO,nV,nR,nOOs,nVVs,lambda,ERI,Bpp)
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR(TDA_T,nOOs,nVVs,Bpp,Cpp,Dpp,Om1s,X1s,Y1s,Om2s,X2s,Y2s,EcRPA(isp_T))
|
2024-09-10 10:13:50 +02:00
|
|
|
deallocate(Bpp,Cpp,Dpp)
|
|
|
|
!print*, 'LAPACK:'
|
|
|
|
!print*, Om2s
|
|
|
|
!print*, Om1s
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
!n_states = nOOs + 5
|
|
|
|
!n_states_diag = n_states + 4
|
|
|
|
!allocate(Om(nOOs+nVVs), R(nOOs+nVVs,n_states_diag))
|
2024-09-10 16:27:49 +02:00
|
|
|
!allocate(supp_data_dbl(1), supp_data_int(1))
|
|
|
|
!supp_data_int(1) = 0
|
|
|
|
!supp_data_dbl(1) = 0.d0
|
|
|
|
!call ppLR_davidson(iblock, TDA_T, nC, nO, nR, nOrb, nOOs, nVVs, &
|
|
|
|
! 1.d0, & ! lambda
|
|
|
|
! eHF(1), &
|
|
|
|
! 0.d0, & ! eF
|
|
|
|
! ERI(1,1,1,1), &
|
|
|
|
! supp_data_int(1), 1, &
|
|
|
|
! supp_data_dbl(1), 1, &
|
|
|
|
! Om(1), R(1,1), n_states, n_states_diag, "RPA")
|
|
|
|
!deallocate(supp_data_dbl, supp_data_int)
|
|
|
|
!deallocate(Om, R)
|
2024-09-07 13:59:15 +02:00
|
|
|
!stop
|
|
|
|
|
2023-11-29 16:20:53 +01:00
|
|
|
if(print_T) call print_excitation_energies('ppRPA@RHF','2p (alpha-beta)',nVVs,Om1s)
|
|
|
|
if(print_T) call print_excitation_energies('ppRPA@RHF','2h (alpha-beta)',nOOs,Om2s)
|
2019-10-20 08:18:58 +02:00
|
|
|
|
|
|
|
!----------------------------------------------
|
2020-04-13 11:33:48 +02:00
|
|
|
! alpha-alpha block
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
isp_T = 2
|
2023-07-31 14:47:09 +02:00
|
|
|
! iblock = 2
|
2020-04-13 11:33:48 +02:00
|
|
|
iblock = 4
|
2019-10-20 08:18:58 +02:00
|
|
|
|
2019-10-28 16:34:09 +01:00
|
|
|
! Compute linear response
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2023-07-27 19:17:20 +02:00
|
|
|
allocate(Bpp(nVVt,nOOt),Cpp(nVVt,nVVt),Dpp(nOOt,nOOt))
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR_C(iblock,nOrb,nC,nO,nV,nR,nVVt,lambda,eHF,ERI,Cpp)
|
|
|
|
call ppLR_D(iblock,nOrb,nC,nO,nV,nR,nOOt,lambda,eHF,ERI,Dpp)
|
|
|
|
if(.not.TDA_T) call ppLR_B(iblock,nOrb,nC,nO,nV,nR,nOOt,nVVt,lambda,ERI,Bpp)
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR(TDA_T,nOOt,nVVt,Bpp,Cpp,Dpp,Om1t,X1t,Y1t,Om2t,X2t,Y2t,EcRPA(isp_T))
|
2023-07-17 23:05:49 +02:00
|
|
|
deallocate(Bpp,Cpp,Dpp)
|
2024-09-10 10:13:50 +02:00
|
|
|
!print*, 'LAPACK:'
|
|
|
|
!print*, Om2t
|
|
|
|
!print*, Om1t
|
|
|
|
|
|
|
|
!n_states = nOOt + 5
|
|
|
|
!n_states_diag = n_states + 4
|
|
|
|
!allocate(Om(nOOt+nVVt), R(nOOt+nVVt,n_states_diag))
|
2024-09-10 16:27:49 +02:00
|
|
|
!allocate(supp_data_dbl(1), supp_data_int(1))
|
|
|
|
!supp_data_int(1) = 0
|
|
|
|
!supp_data_dbl(1) = 0.d0
|
|
|
|
!call ppLR_davidson(iblock, TDA_T, nC, nO, nR, nOrb, nOOt, nVVt, &
|
|
|
|
! 1.d0, & ! lambda
|
|
|
|
! eHF(1), &
|
|
|
|
! 0.d0, & ! eF
|
|
|
|
! ERI(1,1,1,1), &
|
|
|
|
! supp_data_int(1), 1, &
|
|
|
|
! supp_data_dbl(1), 1, &
|
|
|
|
! Om(1), R(1,1), n_states, n_states_diag, "RPA")
|
|
|
|
!deallocate(Om, R)
|
|
|
|
!deallocate(supp_data_dbl)
|
2024-09-10 10:13:50 +02:00
|
|
|
!stop
|
2019-10-20 08:18:58 +02:00
|
|
|
|
2023-11-29 16:20:53 +01:00
|
|
|
if(print_T) call print_excitation_energies('ppRPA@RHF','2p (alpha-alpha)',nVVt,Om1t)
|
|
|
|
if(print_T) call print_excitation_energies('ppRPA@RHF','2h (alpha-alpha)',nOOt,Om2t)
|
2019-10-20 08:18:58 +02:00
|
|
|
|
|
|
|
!----------------------------------------------
|
2023-07-31 14:47:09 +02:00
|
|
|
! Compute excitation densities
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2023-07-31 14:47:09 +02:00
|
|
|
! iblock = 1
|
2022-01-09 23:12:21 +01:00
|
|
|
iblock = 3
|
2024-08-19 18:11:39 +02:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call RGTpp_excitation_density(iblock,nOrb,nC,nO,nV,nR,nOOs,nVVs,ERI,X1s,Y1s,rho1s,X2s,Y2s,rho2s)
|
2020-04-09 14:31:50 +02:00
|
|
|
|
2023-07-31 14:47:09 +02:00
|
|
|
! iblock = 2
|
2022-01-07 15:14:00 +01:00
|
|
|
iblock = 4
|
2024-08-19 18:11:39 +02:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call RGTpp_excitation_density(iblock,nOrb,nC,nO,nV,nR,nOOt,nVVt,ERI,X1t,Y1t,rho1t,X2t,Y2t,rho2t)
|
2020-04-09 14:31:50 +02:00
|
|
|
|
2023-07-31 14:47:09 +02:00
|
|
|
!----------------------------------------------
|
|
|
|
! Compute T-matrix version of the self-energy
|
|
|
|
!----------------------------------------------
|
|
|
|
|
2023-08-01 17:15:44 +02:00
|
|
|
if(regularize) then
|
2024-09-07 13:59:15 +02:00
|
|
|
call GTpp_regularization(nOrb,nC,nO,nV,nR,nOOs,nVVs,eHF,Om1s,rho1s,Om2s,rho2s)
|
|
|
|
call GTpp_regularization(nOrb,nC,nO,nV,nR,nOOt,nVVt,eHF,Om1t,rho1t,Om2t,rho2t)
|
2023-08-01 17:15:44 +02:00
|
|
|
end if
|
2023-08-01 17:00:03 +02:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call RGTpp_self_energy_diag(eta,nOrb,nC,nO,nV,nR,nOOs,nVVs,nOOt,nVVt,eHF,Om1s,rho1s,Om2s,rho2s, &
|
2023-07-27 19:17:20 +02:00
|
|
|
Om1t,rho1t,Om2t,rho2t,EcGM,Sig,Z)
|
2021-02-15 22:00:19 +01:00
|
|
|
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
2019-10-16 18:14:47 +02:00
|
|
|
! Solve the quasi-particle equation
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
2024-08-19 18:11:39 +02:00
|
|
|
|
2023-09-07 14:01:58 +02:00
|
|
|
eGTlin(:) = eHF(:) + Z(:)*Sig(:)
|
|
|
|
|
2020-03-21 21:09:48 +01:00
|
|
|
if(linearize) then
|
|
|
|
|
2023-06-30 16:47:26 +02:00
|
|
|
write(*,*) ' *** Quasiparticle energies obtained by linearization *** '
|
|
|
|
write(*,*)
|
|
|
|
|
2023-09-07 14:01:58 +02:00
|
|
|
eGT(:) = eGTlin(:)
|
2020-03-21 21:09:48 +01:00
|
|
|
|
|
|
|
else
|
2023-06-30 16:47:26 +02:00
|
|
|
|
2023-11-27 10:17:14 +01:00
|
|
|
write(*,*) ' *** Quasiparticle energies obtained by root search *** '
|
2023-06-30 16:47:26 +02:00
|
|
|
write(*,*)
|
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call RGTpp_QP_graph(eta,nOrb,nC,nO,nV,nR,nOOs,nVVs,nOOt,nVVt,eHF,Om1s,rho1s,Om2s,rho2s, &
|
2023-10-02 21:41:37 +02:00
|
|
|
Om1t,rho1t,Om2t,rho2t,eGTlin,eHF,eGT,Z)
|
2020-03-21 21:09:48 +01:00
|
|
|
|
|
|
|
end if
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
! call RGTpp_plot_self_energy(nOrb,nC,nO,nV,nR,nOOs,nVVs,nOOt,nVVt,eHF,eGT,Om1s,rho1s,Om2s,rho2s, &
|
2023-09-07 22:28:47 +02:00
|
|
|
! Om1t,rho1t,Om2t,rho2t)
|
2023-08-24 11:46:45 +02:00
|
|
|
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
2019-10-16 18:14:47 +02:00
|
|
|
! Dump results
|
2019-10-20 08:18:58 +02:00
|
|
|
!----------------------------------------------
|
2019-10-16 18:14:47 +02:00
|
|
|
|
2020-04-13 14:19:14 +02:00
|
|
|
! Compute the ppRPA correlation energy
|
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
isp_T = 1
|
2023-07-31 14:47:09 +02:00
|
|
|
! iblock = 1
|
2022-01-09 23:12:21 +01:00
|
|
|
iblock = 3
|
2022-01-08 13:59:45 +01:00
|
|
|
|
2023-11-29 16:23:49 +01:00
|
|
|
allocate(Bpp(nVVs,nOOs),Cpp(nVVs,nVVs),Dpp(nOOs,nOOs))
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR_C(iblock,nOrb,nC,nO,nV,nR,nVVs,lambda,eGT,ERI,Cpp)
|
|
|
|
call ppLR_D(iblock,nOrb,nC,nO,nV,nR,nOOs,lambda,eGT,ERI,Dpp)
|
|
|
|
if(.not.TDA_T) call ppLR_B(iblock,nOrb,nC,nO,nV,nR,nOOs,nVVs,lambda,ERI,Bpp)
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR(TDA_T,nOOs,nVVs,Bpp,Cpp,Dpp,Om1s,X1s,Y1s,Om2s,X2s,Y2s,EcRPA(isp_T))
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2023-11-29 16:23:49 +01:00
|
|
|
deallocate(Bpp,Cpp,Dpp)
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
isp_T = 2
|
2023-07-31 14:47:09 +02:00
|
|
|
! iblock = 2
|
2020-04-13 23:05:19 +02:00
|
|
|
iblock = 4
|
2022-09-09 21:48:50 +02:00
|
|
|
|
2023-11-29 16:23:49 +01:00
|
|
|
allocate(Bpp(nVVt,nOOt),Cpp(nVVt,nVVt),Dpp(nOOt,nOOt))
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR_C(iblock,nOrb,nC,nO,nV,nR,nVVt,lambda,eGT,ERI,Cpp)
|
|
|
|
call ppLR_D(iblock,nOrb,nC,nO,nV,nR,nOOt,lambda,eGT,ERI,Dpp)
|
|
|
|
if(.not.TDA_T) call ppLR_B(iblock,nOrb,nC,nO,nV,nR,nOOt,nVVt,lambda,ERI,Bpp)
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2024-09-11 10:13:11 +02:00
|
|
|
call ppLR(TDA_T,nOOt,nVVt,Bpp,Cpp,Dpp,Om1t,X1t,Y1t,Om2t,X2t,Y2t,EcRPA(isp_T))
|
2023-07-17 23:05:49 +02:00
|
|
|
|
2023-11-29 16:23:49 +01:00
|
|
|
deallocate(Bpp,Cpp,Dpp)
|
2022-01-02 10:24:30 +01:00
|
|
|
|
2023-11-29 16:23:49 +01:00
|
|
|
EcRPA(1) = EcRPA(1) - EcRPA(2)
|
|
|
|
EcRPA(2) = 3d0*EcRPA(2)
|
2020-04-13 14:19:14 +02:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call print_RG0T0pp(nOrb,nO,eHF,ENuc,ERHF,Sig,Z,eGT,EcGM,EcRPA)
|
2020-04-13 14:19:14 +02:00
|
|
|
|
2020-03-21 21:09:48 +01:00
|
|
|
! Perform BSE calculation
|
|
|
|
|
2023-07-21 12:30:29 +02:00
|
|
|
if(dophBSE) then
|
2020-03-21 21:09:48 +01:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call RGTpp_phBSE(TDA_T,TDA,dBSE,dTDA,singlet,triplet,eta,nOrb,nC,nO,nV,nR,nS,nOOs,nVVs,nOOt,nVVt, &
|
2023-07-27 19:17:20 +02:00
|
|
|
Om1s,X1s,Y1s,Om2s,X2s,Y2s,rho1s,rho2s,Om1t,X1t,Y1t,Om2t,X2t,Y2t,rho1t,rho2t, &
|
2023-07-30 22:01:44 +02:00
|
|
|
ERI,dipole_int,eHF,eGT,EcBSE)
|
2020-03-21 21:09:48 +01:00
|
|
|
|
|
|
|
if(exchange_kernel) then
|
|
|
|
|
2023-07-21 12:30:29 +02:00
|
|
|
EcBSE(1) = 0.5d0*EcBSE(1)
|
|
|
|
EcBSE(2) = 1.5d0*EcBSE(1)
|
2020-03-21 21:09:48 +01:00
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
2023-07-21 12:30:29 +02:00
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@phBSE@G0T0pp correlation energy (singlet) =',EcBSE(1),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@phBSE@G0T0pp correlation energy (triplet) =',EcBSE(2),' au'
|
2023-11-13 18:36:09 +01:00
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@phBSE@G0T0pp correlation energy =',sum(EcBSE),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@phBSE@G0T0pp total energy =',ENuc + ERHF + sum(EcBSE),' au'
|
2020-03-21 21:09:48 +01:00
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
! Compute the BSE correlation energy via the adiabatic connection
|
|
|
|
|
|
|
|
if(doACFDT) then
|
|
|
|
|
2023-07-21 12:30:29 +02:00
|
|
|
write(*,*) '--------------------------------------------------------'
|
|
|
|
write(*,*) 'Adiabatic connection version of phBSE correlation energy'
|
|
|
|
write(*,*) '--------------------------------------------------------'
|
2020-03-21 21:09:48 +01:00
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
if(doXBS) then
|
|
|
|
|
|
|
|
write(*,*) '*** scaled screening version (XBS) ***'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call RGTpp_phACFDT(exchange_kernel,doXBS,.false.,TDA_T,TDA,dophBSE,singlet,triplet,eta,nOrb,nC,nO,nV,nR,nS, &
|
2023-07-27 19:17:20 +02:00
|
|
|
nOOs,nVVs,nOOt,nVVt,Om1s,X1s,Y1s,Om2s,X2s,Y2s,rho1s,rho2s,Om1t,X1t,Y1t, &
|
2023-07-30 22:01:44 +02:00
|
|
|
Om2t,X2t,Y2t,rho1t,rho2t,ERI,eHF,eGT,EcBSE)
|
2020-03-21 21:09:48 +01:00
|
|
|
|
|
|
|
if(exchange_kernel) then
|
|
|
|
|
2023-07-21 12:30:29 +02:00
|
|
|
EcBSE(1) = 0.5d0*EcBSE(1)
|
|
|
|
EcBSE(2) = 1.5d0*EcBSE(2)
|
2020-03-21 21:09:48 +01:00
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
2023-11-29 16:20:53 +01:00
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'AC@phBSE@G0T0pp@RHF correlation energy (singlet) = ',EcBSE(1),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'AC@phBSE@G0T0pp@RHF correlation energy (triplet) = ',EcBSE(2),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'AC@phBSE@G0T0pp@RHF correlation energy = ',sum(EcBSE),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'AC@phBSE@G0T0pp@RHF total energy = ',ENuc + ERHF + sum(EcBSE),' au'
|
2020-03-21 21:09:48 +01:00
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
2023-07-21 12:30:29 +02:00
|
|
|
if(doppBSE) then
|
2022-09-09 21:48:50 +02:00
|
|
|
|
2024-09-07 13:59:15 +02:00
|
|
|
call RGTpp_ppBSE(TDA_T,TDA,dBSE,dTDA,singlet,triplet,eta,nOrb,nC,nO,nV,nR,nOOs,nVVs,nOOt,nVVt, &
|
2023-07-27 19:17:20 +02:00
|
|
|
Om1s,X1s,Y1s,Om2s,X2s,Y2s,rho1s,rho2s,Om1t,X1t,Y1t,Om2t,X2t,Y2t,rho1t,rho2t, &
|
2023-07-30 22:01:44 +02:00
|
|
|
ERI,dipole_int,eHF,eGT,EcBSE)
|
2022-09-09 21:48:50 +02:00
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
2023-11-29 16:20:53 +01:00
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0T0pp@RHF correlation energy (singlet) = ',EcBSE(1),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0T0pp@RHF correlation energy (triplet) = ',EcBSE(2),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0T0pp@RHF correlation energy = ',sum(EcBSE),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0T0pp@RHF total energy = ',ENuc + ERHF + sum(EcBSE),' au'
|
2022-09-09 21:48:50 +02:00
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
2023-11-13 18:36:09 +01:00
|
|
|
! Testing zone
|
|
|
|
|
|
|
|
if(dotest) then
|
|
|
|
|
2023-11-14 14:31:27 +01:00
|
|
|
call dump_test_value('R','G0T0pp correlation energy',sum(EcRPA))
|
|
|
|
call dump_test_value('R','G0T0pp HOMO energy',eGT(nO))
|
|
|
|
call dump_test_value('R','G0T0pp LUMO energy',eGT(nO+1))
|
2023-11-13 18:36:09 +01:00
|
|
|
|
|
|
|
end if
|
|
|
|
|
2023-07-04 10:32:47 +02:00
|
|
|
end subroutine
|