2019-03-19 10:13:33 +01:00
|
|
|
subroutine G0W0(COHSEX,SOSEX,BSE,TDA,singlet_manifold,triplet_manifold, &
|
2019-05-07 22:55:36 +02:00
|
|
|
nBas,nC,nO,nV,nR,nS,ENuc,ERHF,Hc,H,ERI,PHF,cHF,eHF,eG0W0)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Perform G0W0 calculation
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
2019-04-02 22:58:24 +02:00
|
|
|
logical,intent(in) :: COHSEX
|
|
|
|
logical,intent(in) :: SOSEX
|
|
|
|
logical,intent(in) :: BSE
|
|
|
|
logical,intent(in) :: TDA
|
|
|
|
logical,intent(in) :: singlet_manifold
|
|
|
|
logical,intent(in) :: triplet_manifold
|
2019-03-19 10:13:33 +01:00
|
|
|
integer,intent(in) :: nBas,nC,nO,nV,nR,nS
|
2019-05-23 09:53:23 +02:00
|
|
|
double precision,intent(in) :: ENuc
|
|
|
|
double precision,intent(in) :: ERHF
|
2019-04-02 22:58:24 +02:00
|
|
|
double precision,intent(in) :: eHF(nBas)
|
|
|
|
double precision,intent(in) :: cHF(nBas,nBas)
|
|
|
|
double precision,intent(in) :: PHF(nBas,nBas)
|
|
|
|
double precision,intent(in) :: Hc(nBas,nBas)
|
2019-05-07 22:55:36 +02:00
|
|
|
double precision,intent(in) :: H(nBas,nBas)
|
|
|
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
logical :: dRPA
|
2019-05-04 17:13:50 +02:00
|
|
|
integer :: ispin,jspin
|
|
|
|
double precision :: EcRPA(nspin)
|
|
|
|
double precision :: EcBSE(nspin)
|
2019-04-02 22:58:24 +02:00
|
|
|
double precision :: EcGM
|
|
|
|
double precision,allocatable :: SigC(:)
|
|
|
|
double precision,allocatable :: Z(:)
|
|
|
|
double precision,allocatable :: Omega(:,:)
|
|
|
|
double precision,allocatable :: XpY(:,:,:)
|
|
|
|
double precision,allocatable :: rho(:,:,:,:)
|
|
|
|
double precision,allocatable :: rhox(:,:,:,:)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision :: eG0W0(nBas)
|
|
|
|
|
|
|
|
! Hello world
|
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'************************************************'
|
|
|
|
write(*,*)'| One-shot G0W0 calculation |'
|
|
|
|
write(*,*)'************************************************'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
! SOSEX correction
|
|
|
|
|
|
|
|
if(SOSEX) write(*,*) 'SOSEX correction activated!'
|
|
|
|
write(*,*)
|
|
|
|
|
2019-07-15 14:22:32 +02:00
|
|
|
! COHSEX approximation
|
|
|
|
|
|
|
|
if(COHSEX) write(*,*) 'COHSEX approximation activated!'
|
|
|
|
write(*,*)
|
|
|
|
|
2019-03-19 10:13:33 +01:00
|
|
|
! Switch off exchange for G0W0
|
|
|
|
|
|
|
|
dRPA = .true.
|
|
|
|
|
|
|
|
! Spin manifold
|
|
|
|
|
|
|
|
ispin = 1
|
|
|
|
|
|
|
|
! Memory allocation
|
|
|
|
|
2019-05-07 22:55:36 +02:00
|
|
|
allocate(SigC(nBas),Z(nBas),Omega(nS,nspin),XpY(nS,nS,nspin), &
|
2019-03-19 10:13:33 +01:00
|
|
|
rho(nBas,nBas,nS,nspin),rhox(nBas,nBas,nS,nspin))
|
|
|
|
|
|
|
|
! Compute linear response
|
|
|
|
|
2019-05-07 22:55:36 +02:00
|
|
|
call linear_response(ispin,dRPA,TDA,.false.,nBas,nC,nO,nV,nR,nS,eHF,ERI, &
|
2019-05-04 17:13:50 +02:00
|
|
|
rho(:,:,:,ispin),EcRPA(ispin),Omega(:,ispin),XpY(:,:,ispin))
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Compute correlation part of the self-energy
|
|
|
|
|
2019-05-07 22:55:36 +02:00
|
|
|
call excitation_density(nBas,nC,nO,nR,nS,ERI,XpY(:,:,ispin),rho(:,:,:,ispin))
|
2019-03-19 10:13:33 +01:00
|
|
|
|
2019-05-07 22:55:36 +02:00
|
|
|
if(SOSEX) call excitation_density_SOSEX(nBas,nC,nO,nR,nS,ERI,XpY(:,:,ispin),rhox(:,:,:,ispin))
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
call self_energy_correlation_diag(COHSEX,SOSEX,nBas,nC,nO,nV,nR,nS,eHF, &
|
2019-04-02 22:58:24 +02:00
|
|
|
Omega(:,ispin),rho(:,:,:,ispin),rhox(:,:,:,ispin),EcGM,SigC)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! COHSEX static approximation
|
|
|
|
|
|
|
|
if(COHSEX) then
|
|
|
|
|
|
|
|
Z(:) = 1d0
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call renormalization_factor(SOSEX,nBas,nC,nO,nV,nR,nS,eHF,Omega(:,ispin),rho(:,:,:,ispin),rhox(:,:,:,ispin),Z)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
! Solve the quasi-particle equation
|
|
|
|
|
2019-04-02 22:58:24 +02:00
|
|
|
eG0W0(:) = eHF(:) + Z(:)*SigC(:)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Dump results
|
|
|
|
|
|
|
|
call print_excitation('RPA ',ispin,nS,Omega(:,ispin))
|
2019-05-04 17:13:50 +02:00
|
|
|
call print_G0W0(nBas,nO,eHF,ENuc,ERHF,SigC,Z,eG0W0,EcRPA(ispin),EcGM)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Plot stuff
|
|
|
|
|
|
|
|
call plot_GW(nBas,nC,nO,nV,nR,nS,eHF,eG0W0,Omega(:,ispin),rho(:,:,:,ispin),rhox(:,:,:,ispin))
|
|
|
|
|
|
|
|
! Perform BSE calculation
|
|
|
|
|
|
|
|
if(BSE) then
|
|
|
|
|
|
|
|
! Singlet manifold
|
|
|
|
|
|
|
|
if(singlet_manifold) then
|
|
|
|
|
|
|
|
ispin = 1
|
2019-05-04 17:13:50 +02:00
|
|
|
EcBSE(ispin) = 0d0
|
|
|
|
|
2019-05-07 22:55:36 +02:00
|
|
|
call linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,eG0W0,ERI, &
|
2019-05-04 17:13:50 +02:00
|
|
|
rho(:,:,:,ispin),EcBSE(ispin),Omega(:,ispin),XpY(:,:,ispin))
|
2019-03-19 10:13:33 +01:00
|
|
|
call print_excitation('BSE ',ispin,nS,Omega(:,ispin))
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
! Triplet manifold
|
|
|
|
|
|
|
|
if(triplet_manifold) then
|
|
|
|
|
|
|
|
ispin = 2
|
2019-05-04 17:13:50 +02:00
|
|
|
EcBSE(ispin) = 0d0
|
|
|
|
|
2019-05-07 22:55:36 +02:00
|
|
|
call linear_response(ispin,dRPA,TDA,.false.,nBas,nC,nO,nV,nR,nS,eHF,ERI, &
|
2019-05-04 17:13:50 +02:00
|
|
|
rho(:,:,:,ispin),EcRPA(ispin),Omega(:,ispin),XpY(:,:,ispin))
|
2019-05-07 22:55:36 +02:00
|
|
|
call excitation_density(nBas,nC,nO,nR,nS,ERI,XpY(:,:,ispin),rho(:,:,:,ispin))
|
2019-03-19 10:13:33 +01:00
|
|
|
|
2019-05-07 22:55:36 +02:00
|
|
|
call linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,eG0W0,ERI, &
|
2019-05-04 17:13:50 +02:00
|
|
|
rho(:,:,:,1),EcBSE(ispin),Omega(:,ispin),XpY(:,:,ispin))
|
2019-03-19 10:13:33 +01:00
|
|
|
call print_excitation('BSE ',ispin,nS,Omega(:,ispin))
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2019-05-04 17:13:50 +02:00
|
|
|
write(*,*)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,'(2X,A40,F15.6)') 'BSE@G0W0 correlation energy (singlet) =',EcBSE(1)
|
|
|
|
write(*,'(2X,A40,F15.6)') 'BSE@G0W0 correlation energy (triplet) =',EcBSE(2)
|
|
|
|
write(*,'(2X,A40,F15.6)') 'BSE@G0W0 correlation energy =',EcBSE(1) + EcBSE(2)
|
|
|
|
write(*,'(2X,A40,F15.6)') 'BSE@G0W0 total energy =',ENuc + ERHF + EcBSE(1) + EcBSE(2)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
2019-03-19 10:13:33 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine G0W0
|