2023-07-27 21:23:40 +02:00
|
|
|
subroutine GW_QP_graph(eta,nBas,nC,nO,nV,nR,nS,eHF,Om,rho,eGWlin,eGW,Z)
|
2020-03-12 15:04:16 +01:00
|
|
|
|
|
|
|
! Compute the graphical solution of the QP equation
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
integer,intent(in) :: nC
|
|
|
|
integer,intent(in) :: nO
|
|
|
|
integer,intent(in) :: nV
|
|
|
|
integer,intent(in) :: nR
|
|
|
|
integer,intent(in) :: nS
|
2023-08-24 00:02:23 +02:00
|
|
|
|
2020-03-12 15:04:16 +01:00
|
|
|
double precision,intent(in) :: eta
|
|
|
|
double precision,intent(in) :: eHF(nBas)
|
2023-07-27 17:43:18 +02:00
|
|
|
double precision,intent(in) :: Om(nS)
|
2020-03-12 15:04:16 +01:00
|
|
|
double precision,intent(in) :: rho(nBas,nBas,nS)
|
|
|
|
|
|
|
|
double precision,intent(in) :: eGWlin(nBas)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: p
|
|
|
|
integer :: nIt
|
|
|
|
integer,parameter :: maxIt = 64
|
|
|
|
double precision,parameter :: thresh = 1d-6
|
2023-07-27 16:43:15 +02:00
|
|
|
double precision,external :: GW_SigC,GW_dSigC
|
2023-08-24 11:18:12 +02:00
|
|
|
double precision :: SigC,dSigC
|
2020-03-12 15:04:16 +01:00
|
|
|
double precision :: f,df
|
|
|
|
double precision :: w
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: eGW(nBas)
|
2023-07-27 21:23:40 +02:00
|
|
|
double precision,intent(out) :: Z(nBas)
|
2020-03-12 15:04:16 +01:00
|
|
|
|
|
|
|
! Run Newton's algorithm to find the root
|
|
|
|
|
|
|
|
do p=nC+1,nBas-nR
|
|
|
|
|
|
|
|
w = eGWlin(p)
|
|
|
|
nIt = 0
|
|
|
|
f = 1d0
|
|
|
|
|
|
|
|
do while (abs(f) > thresh .and. nIt < maxIt)
|
|
|
|
|
|
|
|
nIt = nIt + 1
|
|
|
|
|
2023-08-24 11:18:12 +02:00
|
|
|
SigC = GW_SigC(p,w,eta,nBas,nC,nO,nV,nR,nS,eGWlin,Om,rho)
|
|
|
|
dSigC = GW_dSigC(p,w,eta,nBas,nC,nO,nV,nR,nS,eGWlin,Om,rho)
|
|
|
|
f = w - eHF(p) - SigC
|
|
|
|
df = 1d0/(1d0 - dSigC)
|
2020-03-12 15:04:16 +01:00
|
|
|
|
2023-07-27 21:23:40 +02:00
|
|
|
w = w - df*f
|
2020-03-12 15:04:16 +01:00
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
if(nIt == maxIt) then
|
|
|
|
|
|
|
|
write(*,*) 'Newton root search has not converged!'
|
2023-07-27 21:23:40 +02:00
|
|
|
eGW(p) = eGWlin(p)
|
2020-03-12 15:04:16 +01:00
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
eGW(p) = w
|
2023-07-27 21:23:40 +02:00
|
|
|
Z(p) = df
|
2020-03-12 15:04:16 +01:00
|
|
|
|
2023-08-24 11:57:19 +02:00
|
|
|
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,'(A5,1X,A3,1X,A15,1X,A10)') 'Orb.','It.','e_QP (eV)','Z'
|
|
|
|
write(*,'(I5,1X,I3,1X,F15.9,1X,F10.6)') p,nIt,eGW(p)*HaToeV,Z(p)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
2020-03-12 15:04:16 +01:00
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
2023-07-27 16:43:15 +02:00
|
|
|
end subroutine
|