This commit is contained in:
Pierre-Francois Loos 2024-01-18 11:53:02 +01:00
parent 3d5f60139e
commit e277931d14
2 changed files with 109 additions and 12 deletions

View File

@ -146,6 +146,10 @@ subroutine RG0W0(dotest,doACFDT,exchange_kernel,doXBS,dophBSE,dophBSE2,TDA_W,TDA
end if
! Cumulant expansion
call RGWC(dotest,nBas,nC,nO,nR,nS,Om,rho,eHF,eGW,Z)
! call GW_plot_self_energy(nBas,nC,nO,nV,nR,nS,eHF,eHF,Om,rho)
! Compute the RPA correlation energy
@ -159,9 +163,7 @@ subroutine RG0W0(dotest,doACFDT,exchange_kernel,doXBS,dophBSE,dophBSE2,TDA_W,TDA
! Dump results !
!--------------!
call print_RG0W0(nBas,nO,eHF,ENuc,ERHF,SigC,Z,eGW,EcRPA,EcGM)
call RGWC(dotest,nBas,eGW,Z)
! call print_RG0W0(nBas,nO,eHF,ENuc,ERHF,SigC,Z,eGW,EcRPA,EcGM)
! Perform BSE calculation

View File

@ -1,4 +1,4 @@
subroutine RGWC(dotest,nBas,eGW,Z)
subroutine RGWC(dotest,nBas,nC,nO,nR,nS,Om,rho,e,eGW,Z)
! Perform GW+C calculation
@ -10,16 +10,27 @@ subroutine RGWC(dotest,nBas,eGW,Z)
logical,intent(in) :: dotest
integer,intent(in) :: nBas
integer,intent(in) :: nC
integer,intent(in) :: nO
integer,intent(in) :: nR
integer,intent(in) :: nS
double precision,intent(in) :: Om(nS)
double precision,intent(in) :: rho(nBas,nBas,nS)
double precision,intent(in) :: e(nBas)
double precision,intent(in) :: eGW(nBas)
double precision,intent(in) :: Z(nBas)
! Local variables
integer :: p
integer :: p,q,i,a,m
integer :: iSat
double precision,parameter :: cutoff = 1d-3
double precision,allocatable :: eGWC(:)
double precision,allocatable :: de(:,:,:)
double precision,allocatable :: ZC(:)
double precision,allocatable :: ZSat(:,:)
double precision,allocatable :: eSat(:,:)
! Output variables
@ -33,15 +44,41 @@ subroutine RGWC(dotest,nBas,eGW,Z)
! Memory allocation
allocate(eGWC(nBas),ZC(nBas))
allocate(ZC(nBas),eSat(nBas,nS),ZSat(nBas,nS))
! Useful quantities
allocate(de(nBas,nBas,nS))
do p=nC+1,nBas-nR
do i=nC+1,nO
do m=1,nS
de(p,i,m) = eGW(p) - eGW(i) + Om(m)
end do
end do
end do
do p=nC+1,nBas-nR
do a=nO+1,nBas-nR
do m=1,nS
de(p,a,m) = eGW(p) - eGW(a) - Om(m)
end do
end do
end do
! GW+C weights
ZC(:) = exp(1d0 - 1d0/Z(:))
ZC(:) = 0d0
! GW+C quasiparticles
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do m=1,nS
ZC(p) = ZC(p) + 2d0*rho(p,q,m)**2/de(p,q,m)**2
end do
end do
end do
eGWC(:) = eGW(:)
ZC(:) = exp(-ZC(:))
! Dump results
@ -49,17 +86,75 @@ subroutine RGWC(dotest,nBas,eGW,Z)
write(*,*)' GW+C calculation '
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(1X,A1,1X,A3,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X)') &
'|','#','|','e_GW (eV)','|','e_GW+C (eV)','|','Z','|','ZC','|'
'|','#','|','e_GW (eV)','|','e_GW+C (eV)','|','Z_GW','|','Z_GW+C','|'
write(*,*)'-------------------------------------------------------------------------------'
do p=1,nBas
write(*,'(1X,A1,1X,I3,1X,A1,1X,F15.6,1X,A1,1X,F15.6,1X,A1,1X,F15.6,1X,A1,1X,F15.6,1X,A1,1X)') &
'|',p,'|',eGW(p)*HaToeV,'|',eGWC(p)*HaToeV,'|',Z(p),'|',ZC(p),'|'
'|',p,'|',eGW(p)*HaToeV,'|',eGW(p)*HaToeV,'|',Z(p),'|',ZC(p),'|'
end do
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)
! GW+C satellites on hole branch
ZSat(:,:) = 0d0
do i=nC+1,nO
do m=1,nS
eSat(i,m) = eGW(i) - Om(m)
do q=nC+1,nBas-nR
ZSat(i,m) = ZSat(i,m) + ZC(i)*2d0*rho(i,q,m)**2/de(i,q,m)**2
end do
end do
end do
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)' Satellite series from GW+C on hole branch'
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(1X,A5,1X,A5,1X,A5,1X,A15,1X,A15,1X)') '#','i','m','e_Sat (eV)','Z_Sat'
write(*,*)'-------------------------------------------------------------------------------'
iSat = 0
do i=nC+1,nO
do m=1,nS
iSat = iSat + 1
if(ZSat(i,m) > cutoff) &
write(*,'(1X,I5,1X,I5,1X,I5,F15.6,1X,F15.6,1X)') iSat,i,m,eSat(i,m)*HaToeV,ZSat(i,m)
end do
end do
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)
! GW+C satellites on electron branch
ZSat(:,:) = 0d0
do a=nO+1,nBas-nR
do m=1,nS
eSat(a,m) = eGW(a) + Om(m)
do q=nC+1,nBas-nR
ZSat(a,m) = ZSat(a,m) + ZC(a)*2d0*rho(a,q,m)**2/de(a,q,m)**2
end do
end do
end do
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)' Satellite series from GW+C on electron branch'
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(1X,A5,1X,A5,1X,A5,1X,A15,1X,A15,1X)') '#','a','m','e_Sat (eV)','Z_Sat'
write(*,*)'-------------------------------------------------------------------------------'
iSat = 0
do a=nO+1,nBas-nR
do m=1,nS
iSat = iSat + 1
if(ZSat(a,m) > cutoff) &
write(*,'(1X,I5,1X,I5,1X,I5,F15.6,1X,F15.6,1X)') iSat,a,m,eSat(a,m)*HaToeV,ZSat(a,m)
end do
end do
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)
! Testing zone
! if(dotest) then