10
1
mirror of https://github.com/pfloos/quack synced 2025-01-07 03:43:13 +01:00
QuAcK/src/GW/RGW.f90

200 lines
6.7 KiB
Fortran
Raw Normal View History

2024-09-11 17:58:36 +02:00
subroutine RGW(dotest,doG0W0,doevGW,doqsGW,doufG0W0,doufGW,maxSCF,thresh,max_diis,doACFDT, &
exchange_kernel,doXBS,dophBSE,dophBSE2,doppBSE,TDA_W,TDA,dBSE,dTDA,singlet,triplet, &
linearize,eta,doSRG,nNuc,ZNuc,rNuc,ENuc,nBas,nOrb,nC,nO,nV,nR,nS,ERHF, &
2024-09-03 16:06:09 +02:00
S,X,T,V,Hc,ERI_AO,ERI_MO,dipole_int_AO,dipole_int_MO,PHF,cHF,eHF)
2023-07-23 17:41:44 +02:00
2023-11-28 10:40:15 +01:00
! Restricted GW module
2023-07-23 17:41:44 +02:00
implicit none
include 'parameters.h'
! Input variables
2023-11-13 17:39:30 +01:00
logical,intent(in) :: dotest
logical,intent(in) :: doG0W0
logical,intent(in) :: doevGW
logical,intent(in) :: doqsGW
logical,intent(in) :: doufG0W0
logical,intent(in) :: doufGW
2023-07-23 17:41:44 +02:00
integer,intent(in) :: maxSCF
integer,intent(in) :: max_diis
double precision,intent(in) :: thresh
logical,intent(in) :: doACFDT
logical,intent(in) :: exchange_kernel
logical,intent(in) :: doXBS
logical,intent(in) :: dophBSE
logical,intent(in) :: dophBSE2
logical,intent(in) :: TDA_W
logical,intent(in) :: TDA
logical,intent(in) :: dBSE
logical,intent(in) :: dTDA
logical,intent(in) :: doppBSE
logical,intent(in) :: singlet
logical,intent(in) :: triplet
logical,intent(in) :: linearize
double precision,intent(in) :: eta
2024-09-11 17:58:36 +02:00
logical,intent(in) :: doSRG
2023-07-23 17:41:44 +02:00
integer,intent(in) :: nNuc
double precision,intent(in) :: ZNuc(nNuc)
double precision,intent(in) :: rNuc(nNuc,ncart)
double precision,intent(in) :: ENuc
2024-09-03 16:06:09 +02:00
integer,intent(in) :: nBas
integer,intent(in) :: nOrb
2023-11-29 16:20:53 +01:00
integer,intent(in) :: nC
integer,intent(in) :: nO
integer,intent(in) :: nV
integer,intent(in) :: nR
integer,intent(in) :: nS
2023-07-23 17:41:44 +02:00
2023-11-24 15:31:29 +01:00
double precision,intent(in) :: ERHF
double precision,intent(in) :: eHF(nOrb)
double precision,intent(in) :: cHF(nBas,nOrb)
double precision,intent(in) :: PHF(nBas,nBas)
double precision,intent(in) :: S(nBas,nBas)
double precision,intent(in) :: T(nBas,nBas)
double precision,intent(in) :: V(nBas,nBas)
double precision,intent(in) :: Hc(nBas,nBas)
double precision,intent(in) :: X(nBas,nOrb)
double precision,intent(in) :: ERI_AO(nBas,nBas,nBas,nBas)
double precision,intent(in) :: ERI_MO(nOrb,nOrb,nOrb,nOrb)
double precision,intent(in) :: dipole_int_AO(nBas,nBas,ncart)
double precision,intent(in) :: dipole_int_MO(nOrb,nOrb,ncart)
2023-07-23 17:41:44 +02:00
! Local variables
double precision :: start_GW ,end_GW ,t_GW
2024-09-16 22:30:23 +02:00
logical :: doccG0W0,doccGW
2024-09-16 15:59:16 +02:00
2023-07-23 17:41:44 +02:00
!------------------------------------------------------------------------
2024-09-16 15:59:16 +02:00
! Perform G0W0 calculation
2023-07-23 17:41:44 +02:00
!------------------------------------------------------------------------
if(doG0W0) then
call wall_time(start_GW)
2023-11-13 17:39:30 +01:00
call RG0W0(dotest,doACFDT,exchange_kernel,doXBS,dophBSE,dophBSE2,TDA_W,TDA,dBSE,dTDA,doppBSE,singlet,triplet, &
2024-09-11 17:58:36 +02:00
linearize,eta,doSRG,nBas,nOrb,nC,nO,nV,nR,nS,ENuc,ERHF,ERI_MO,dipole_int_MO,eHF)
2023-07-23 17:41:44 +02:00
call wall_time(end_GW)
t_GW = end_GW - start_GW
2024-08-29 00:00:41 +02:00
write(*,'(A65,1X,F9.3,A8)') 'Total wall time for G0W0 = ',t_GW,' seconds'
2023-07-23 17:41:44 +02:00
write(*,*)
end if
!------------------------------------------------------------------------
! Perform evGW calculation
!------------------------------------------------------------------------
if(doevGW) then
call wall_time(start_GW)
2023-11-13 17:39:30 +01:00
call evRGW(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,dophBSE2,TDA_W,TDA,dBSE,dTDA,doppBSE, &
2024-09-11 17:58:36 +02:00
singlet,triplet,linearize,eta,doSRG,nBas,nOrb,nC,nO,nV,nR,nS,ENuc,ERHF,ERI_MO,dipole_int_MO,eHF)
2023-07-23 17:41:44 +02:00
call wall_time(end_GW)
t_GW = end_GW - start_GW
2024-08-29 00:00:41 +02:00
write(*,'(A65,1X,F9.3,A8)') 'Total wall time for evGW = ',t_GW,' seconds'
2023-07-23 17:41:44 +02:00
write(*,*)
end if
!------------------------------------------------------------------------
! Perform qsGW calculation
!------------------------------------------------------------------------
if(doqsGW) then
call wall_time(start_GW)
2024-09-03 16:06:09 +02:00
call qsRGW(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,dophBSE2, &
2024-09-11 17:58:36 +02:00
TDA_W,TDA,dBSE,dTDA,doppBSE,singlet,triplet,eta,doSRG,nNuc,ZNuc,rNuc, &
2024-09-03 16:06:09 +02:00
ENuc,nBas,nOrb,nC,nO,nV,nR,nS,ERHF,S,X,T,V,Hc,ERI_AO,ERI_MO, &
dipole_int_AO,dipole_int_MO,PHF,cHF,eHF)
2023-07-23 17:41:44 +02:00
call wall_time(end_GW)
t_GW = end_GW - start_GW
2024-08-29 00:00:41 +02:00
write(*,'(A65,1X,F9.3,A8)') 'Total wall time for qsGW = ',t_GW,' seconds'
2023-07-23 17:41:44 +02:00
write(*,*)
end if
!------------------------------------------------------------------------
2024-09-16 15:59:16 +02:00
! Perform ufG0W0 calculation
2023-07-23 17:41:44 +02:00
!------------------------------------------------------------------------
if(doufG0W0) then
call wall_time(start_GW)
2024-08-29 00:00:41 +02:00
! TODO
2024-09-16 22:30:23 +02:00
call ufRG0W0(dotest,TDA_W,nBas,nOrb,nC,nO,nV,nR,nS,ENuc,ERHF,ERI_MO,eHF)
2024-09-19 20:38:18 +02:00
! call eomRG0W0(dotest,nBas,nOrb,nC,nO,nV,nR,nS,ENuc,ERHF,ERI_MO,eHF)
2023-07-23 17:41:44 +02:00
call wall_time(end_GW)
t_GW = end_GW - start_GW
2024-08-29 00:00:41 +02:00
write(*,'(A65,1X,F9.3,A8)') 'Total wall time for ufG0W0 = ',t_GW,' seconds'
2023-07-23 17:41:44 +02:00
write(*,*)
end if
!------------------------------------------------------------------------
2024-09-16 15:59:16 +02:00
! Perform ufGW calculation
2023-07-23 17:41:44 +02:00
!------------------------------------------------------------------------
if(doufGW) then
call wall_time(start_GW)
2024-08-29 00:00:41 +02:00
! TODO
2024-09-10 09:40:22 +02:00
call ufRGW(dotest,TDA_W,nBas,nOrb,nC,nO,nV,nR,nS,ENuc,ERHF,ERI_MO,eHF)
2023-07-23 17:41:44 +02:00
call wall_time(end_GW)
t_GW = end_GW - start_GW
2024-08-29 00:00:41 +02:00
write(*,'(A65,1X,F9.3,A8)') 'Total wall time for ufGW = ',t_GW,' seconds'
2023-07-23 17:41:44 +02:00
write(*,*)
end if
2024-09-16 15:59:16 +02:00
!------------------------------------------------------------------------
! Perform CC-based G0W0 calculation
!------------------------------------------------------------------------
2024-10-11 15:34:35 +02:00
doccG0W0 = .false.
2024-09-16 15:59:16 +02:00
2024-09-16 22:30:23 +02:00
if(doccG0W0) then
2024-09-16 15:59:16 +02:00
call wall_time(start_GW)
2024-09-30 23:06:00 +02:00
call ccRG0W0(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,nS,ERI_MO,ENuc,ERHF,eHF)
! call ccRG0W0_TDA(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,ERI_MO,ENuc,ERHF,eHF)
2024-09-16 15:59:16 +02:00
call wall_time(end_GW)
t_GW = end_GW - start_GW
write(*,'(A65,1X,F9.3,A8)') 'Total wall time for ufGW = ',t_GW,' seconds'
write(*,*)
end if
!------------------------------------------------------------------------
! Perform CC-based GW calculation
!------------------------------------------------------------------------
2024-09-17 09:10:16 +02:00
doccGW = .false.
2024-09-16 15:59:16 +02:00
2024-09-16 22:30:23 +02:00
if(doccGW) then
2024-09-16 15:59:16 +02:00
call wall_time(start_GW)
2024-09-30 23:06:00 +02:00
call ccRGW(maxSCF,thresh,nBas,nOrb,nC,nO,nV,nR,ERI_MO,ENuc,ERHF,eHF)
2024-09-16 15:59:16 +02:00
call wall_time(end_GW)
t_GW = end_GW - start_GW
2024-09-17 20:15:06 +02:00
write(*,'(A65,1X,F9.3,A8)') 'Total wall time for ccGW = ',t_GW,' seconds'
2024-09-16 15:59:16 +02:00
write(*,*)
end if
2023-07-23 17:41:44 +02:00
end subroutine