10
1
mirror of https://github.com/pfloos/quack synced 2024-12-25 22:03:44 +01:00
QuAcK/src/MBPT/print_qsGW.f90

112 lines
4.4 KiB
Fortran
Raw Normal View History

2020-10-21 12:09:18 +02:00
subroutine print_qsGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,c,ENuc,P,T,V,J,K,F,SigC,Z,EcRPA,EqsGW)
2019-03-19 10:13:33 +01:00
! Print one-electron energies and other stuff for qsGW
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nBas,nO,nSCF
2020-10-21 12:09:18 +02:00
double precision,intent(in) :: ENuc,EcRPA,Conv,thresh
2019-03-19 10:13:33 +01:00
double precision,intent(in) :: eHF(nBas),eGW(nBas),c(nBas),P(nBas,nBas)
2020-10-06 14:24:54 +02:00
double precision,intent(in) :: T(nBas,nBas),V(nBas,nBas)
2019-03-19 10:13:33 +01:00
double precision,intent(in) :: J(nBas,nBas),K(nBas,nBas),F(nBas,nBas)
2020-01-15 22:29:43 +01:00
double precision,intent(in) :: Z(nBas),SigC(nBas,nBas)
2019-03-19 10:13:33 +01:00
! Local variables
integer :: x,HOMO,LUMO
double precision :: Gap,ET,EV,EJ,Ex,Ec
2019-03-19 10:13:33 +01:00
double precision,external :: trace_matrix
! Output variables
double precision,intent(out) :: EqsGW
2019-03-19 10:13:33 +01:00
! HOMO and LUMO
HOMO = nO
LUMO = HOMO + 1
Gap = eGW(LUMO)-eGW(HOMO)
ET = trace_matrix(nBas,matmul(P,T))
EV = trace_matrix(nBas,matmul(P,V))
EJ = 0.5d0*trace_matrix(nBas,matmul(P,J))
2019-03-19 11:21:34 +01:00
Ex = 0.25d0*trace_matrix(nBas,matmul(P,K))
2020-10-21 12:09:18 +02:00
Ec = 0.5d0*trace_matrix(nBas,matmul(P,SigC))
2020-01-15 22:29:43 +01:00
EqsGW = ET + EV + EJ + Ex + Ec
2019-03-19 10:13:33 +01:00
! Dump results
write(*,*)'-------------------------------------------------------------------------------'
if(nSCF < 10) then
write(*,'(1X,A21,I1,A1,I1,A12)')' Self-consistent qsG',nSCF,'W',nSCF,' calculation'
else
write(*,'(1X,A21,I2,A1,I2,A12)')' Self-consistent qsG',nSCF,'W',nSCF,' calculation'
endif
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_HF (eV)','|','e_QP-e_HF (eV)','|','Z','|','e_QP (eV)','|'
write(*,*)'-------------------------------------------------------------------------------'
do x=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)') &
'|',x,'|',eHF(x)*HaToeV,'|',(eGW(x)-eHF(x))*HaToeV,'|',Z(x),'|',eGW(x)*HaToeV,'|'
enddo
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(2X,A10,I3)') 'Iteration ',nSCF
write(*,'(2X,A19,F15.5)')'max(|FPS - SPF|) = ',Conv
write(*,*)'-------------------------------------------'
2019-09-26 22:46:32 +02:00
write(*,'(2X,A30,F15.6)') 'qsGW HOMO energy (eV):',eGW(HOMO)*HaToeV
write(*,'(2X,A30,F15.6)') 'qsGW LUMO energy (eV):',eGW(LUMO)*HaToeV
write(*,'(2X,A30,F15.6)') 'qsGW HOMO-LUMO gap (eV):',Gap*HaToeV
2019-03-19 10:13:33 +01:00
write(*,*)'-------------------------------------------'
2019-09-26 22:46:32 +02:00
write(*,'(2X,A30,F15.6)') 'qsGW total energy =',EqsGW + ENuc
write(*,'(2X,A30,F15.6)') 'qsGW exchange energy =',Ex
write(*,'(2X,A30,F15.6)') 'qsGW correlation energy =',Ec
2020-09-24 11:56:06 +02:00
write(*,'(2X,A30,F15.6)') 'RPA@qsGW correlation energy =',EcRPA
2019-03-19 10:13:33 +01:00
write(*,*)'-------------------------------------------'
write(*,*)
! Dump results for final iteration
if(Conv < thresh) then
write(*,*)
write(*,'(A50)') '---------------------------------------'
write(*,'(A32)') ' Summary '
write(*,'(A50)') '---------------------------------------'
write(*,'(A32,1X,F16.10)') ' One-electron energy ',ET + EV
write(*,'(A32,1X,F16.10)') ' Kinetic energy ',ET
write(*,'(A32,1X,F16.10)') ' Potential energy ',EV
write(*,'(A50)') '---------------------------------------'
write(*,'(A32,1X,F16.10)') ' Two-electron energy ',EJ + Ex
write(*,'(A32,1X,F16.10)') ' Coulomb energy ',EJ
write(*,'(A32,1X,F16.10)') ' Exchange energy ',Ex
write(*,'(A32,1X,F16.10)') ' Correlation energy ',Ec
write(*,'(A50)') '---------------------------------------'
write(*,'(A32,1X,F16.10)') ' Electronic energy ',EqsGW
write(*,'(A32,1X,F16.10)') ' Nuclear repulsion ',ENuc
write(*,'(A32,1X,F16.10)') ' qsGW energy ',ENuc + EqsGW
write(*,'(A50)') '---------------------------------------'
write(*,*)
write(*,'(A50)') '---------------------------------------'
write(*,'(A32)') ' qsGW MO coefficients'
write(*,'(A50)') '---------------------------------------'
call matout(nBas,nBas,c)
write(*,*)
write(*,'(A50)') '---------------------------------------'
write(*,'(A32)') ' qsGW MO energies'
write(*,'(A50)') '---------------------------------------'
call matout(nBas,1,eGW)
write(*,*)
endif
end subroutine print_qsGW