2023-07-25 10:46:56 +02:00
|
|
|
subroutine G0F2(dophBSE,doppBSE,TDA,dBSE,dTDA,singlet,triplet,linearize,eta,regularize, &
|
2021-12-17 11:41:40 +01:00
|
|
|
nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,dipole_int,eHF)
|
2020-03-19 10:21:18 +01:00
|
|
|
|
|
|
|
! Perform a one-shot second-order Green function calculation
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
logical,intent(in) :: dophBSE
|
|
|
|
logical,intent(in) :: doppBSE
|
2020-06-01 17:14:42 +02:00
|
|
|
logical,intent(in) :: TDA
|
2020-06-15 23:04:07 +02:00
|
|
|
logical,intent(in) :: dBSE
|
|
|
|
logical,intent(in) :: dTDA
|
2021-03-05 22:34:48 +01:00
|
|
|
logical,intent(in) :: singlet
|
|
|
|
logical,intent(in) :: triplet
|
2020-03-19 10:21:18 +01:00
|
|
|
logical,intent(in) :: linearize
|
2020-06-01 17:14:42 +02:00
|
|
|
double precision,intent(in) :: eta
|
2021-12-17 11:41:40 +01:00
|
|
|
logical,intent(in) :: regularize
|
2020-03-19 10:21:18 +01:00
|
|
|
integer,intent(in) :: nBas
|
|
|
|
integer,intent(in) :: nO
|
|
|
|
integer,intent(in) :: nC
|
|
|
|
integer,intent(in) :: nV
|
|
|
|
integer,intent(in) :: nR
|
2020-06-01 17:14:42 +02:00
|
|
|
integer,intent(in) :: nS
|
|
|
|
double precision,intent(in) :: ENuc
|
|
|
|
double precision,intent(in) :: ERHF
|
|
|
|
double precision,intent(in) :: eHF(nBas)
|
|
|
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
2020-09-28 21:25:25 +02:00
|
|
|
double precision,intent(in) :: dipole_int(nBas,nBas,ncart)
|
2020-03-19 10:21:18 +01:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
2021-03-06 23:08:43 +01:00
|
|
|
double precision :: Ec
|
2020-06-01 17:14:42 +02:00
|
|
|
double precision :: EcBSE(nspin)
|
2023-07-25 10:46:56 +02:00
|
|
|
double precision,allocatable :: eGF(:)
|
|
|
|
double precision,allocatable :: eGFlin(:)
|
2021-03-06 15:27:35 +01:00
|
|
|
double precision,allocatable :: SigC(:)
|
2020-03-19 10:21:18 +01:00
|
|
|
double precision,allocatable :: Z(:)
|
|
|
|
|
|
|
|
! Hello world
|
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'************************************************'
|
|
|
|
write(*,*)'| One-shot second-order Green function |'
|
|
|
|
write(*,*)'************************************************'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
! Memory allocation
|
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
allocate(SigC(nBas),Z(nBas),eGF(nBas),eGFlin(nBas))
|
2020-03-19 10:21:18 +01:00
|
|
|
|
2020-03-21 16:31:39 +01:00
|
|
|
if(linearize) then
|
|
|
|
|
|
|
|
write(*,*) '*** Quasiparticle equation will be linearized ***'
|
|
|
|
write(*,*)
|
2020-03-19 10:21:18 +01:00
|
|
|
|
2020-03-21 16:31:39 +01:00
|
|
|
end if
|
2020-03-19 10:21:18 +01:00
|
|
|
|
2020-03-21 16:31:39 +01:00
|
|
|
! Frequency-dependent second-order contribution
|
|
|
|
|
2021-12-17 13:36:26 +01:00
|
|
|
if(regularize) then
|
|
|
|
|
2023-07-27 10:11:35 +02:00
|
|
|
call regularized_self_energy_GF2_diag(eta,nBas,nC,nO,nV,nR,eHF,eHF,ERI,SigC,Z)
|
2021-12-17 13:36:26 +01:00
|
|
|
|
|
|
|
else
|
|
|
|
|
2023-07-27 10:11:35 +02:00
|
|
|
call GF2_self_energy_diag(eta,nBas,nC,nO,nV,nR,eHF,eHF,ERI,SigC,Z)
|
2021-12-17 13:36:26 +01:00
|
|
|
|
|
|
|
end if
|
2020-03-19 10:21:18 +01:00
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
eGFlin(:) = eHF(:) + Z(:)*SigC(:)
|
2023-06-30 16:47:26 +02:00
|
|
|
|
2020-03-19 10:21:18 +01:00
|
|
|
if(linearize) then
|
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
eGF(:) = eGFlin(:)
|
2020-03-19 10:21:18 +01:00
|
|
|
|
2023-06-30 16:47:26 +02:00
|
|
|
else
|
|
|
|
|
|
|
|
write(*,*) ' *** Quasiparticle energies obtained by root search (experimental) *** '
|
|
|
|
write(*,*)
|
|
|
|
|
2023-07-27 10:11:35 +02:00
|
|
|
call QP_graph_GF2(eta,nBas,nC,nO,nV,nR,eHF,eGFlin,ERI,eGF)
|
2020-03-19 10:21:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
end if
|
2020-03-21 16:31:39 +01:00
|
|
|
|
2020-03-19 10:21:18 +01:00
|
|
|
! Print results
|
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
call MP2(regularize,nBas,nC,nO,nV,nR,ERI,ENuc,EHF,eGF,Ec)
|
|
|
|
call print_G0F2(nBas,nO,eHF,SigC,eGF,Z,ENuc,ERHF,Ec)
|
2020-03-19 10:21:18 +01:00
|
|
|
|
2020-06-01 17:14:42 +02:00
|
|
|
! Perform BSE2 calculation
|
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
if(dophBSE) then
|
|
|
|
|
|
|
|
call GF2_phBSE2(TDA,dBSE,dTDA,singlet,triplet,eta,nBas,nC,nO,nV,nR,nS,ERI,dipole_int,eGF,EcBSE)
|
2020-06-01 17:14:42 +02:00
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
write(*,*)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,'(2X,A50,F20.10)') 'Tr@phBSE@G0F2 correlation energy (singlet) =',EcBSE(1)
|
|
|
|
write(*,'(2X,A50,F20.10)') 'Tr@phBSE@G0F2 correlation energy (triplet) =',EcBSE(2)
|
|
|
|
write(*,'(2X,A50,F20.10)') 'Tr@phBSE@G0F2 correlation energy =',sum(EcBSE(:))
|
|
|
|
write(*,'(2X,A50,F20.10)') 'Tr@phBSE@G0F2 total energy =',ENuc + EHF + sum(EcBSE(:))
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,*)
|
2020-06-01 17:14:42 +02:00
|
|
|
|
|
|
|
end if
|
2020-06-03 12:24:38 +02:00
|
|
|
|
2023-07-25 10:46:56 +02:00
|
|
|
! Perform ppBSE2 calculation
|
|
|
|
|
2023-07-27 10:11:35 +02:00
|
|
|
if(doppBSE) then
|
|
|
|
|
|
|
|
call GF2_ppBSE2(TDA,dBSE,dTDA,singlet,triplet,eta,nBas,nC,nO,nV,nR,ERI,dipole_int,eGF,EcBSE)
|
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0F2 correlation energy (singlet) =',EcBSE(1),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0F2 correlation energy (triplet) =',3d0*EcBSE(2),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0F2 correlation energy =',EcBSE(1) + 3d0*EcBSE(2),' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppBSE@G0F2 total energy =',ENuc + ERHF + EcBSE(1) + 3d0*EcBSE(2),' au'
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
end if
|
2023-07-25 10:46:56 +02:00
|
|
|
|
2023-07-04 11:56:00 +02:00
|
|
|
end subroutine
|