2021-03-01 14:55:29 +01:00
|
|
|
subroutine print_qsGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,c,ENuc,P,T,V,J,K,F,SigC,Z,EcGM,EcRPA,EqsGW,dipole)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Print one-electron energies and other stuff for qsGW
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
2021-03-01 14:55:29 +01:00
|
|
|
integer,intent(in) :: nBas
|
|
|
|
integer,intent(in) :: nO
|
|
|
|
integer,intent(in) :: nSCF
|
|
|
|
double precision,intent(in) :: ENuc
|
|
|
|
double precision,intent(in) :: EcGM
|
|
|
|
double precision,intent(in) :: EcRPA
|
|
|
|
double precision,intent(in) :: Conv
|
|
|
|
double precision,intent(in) :: thresh
|
|
|
|
double precision,intent(in) :: eHF(nBas)
|
|
|
|
double precision,intent(in) :: eGW(nBas)
|
|
|
|
double precision,intent(in) :: c(nBas)
|
|
|
|
double precision,intent(in) :: 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)
|
2020-10-21 12:58:37 +02:00
|
|
|
double precision,intent(in) :: dipole(ncart)
|
2019-03-19 10:13:33 +01:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
2020-10-21 12:58:37 +02:00
|
|
|
integer :: x,ixyz,HOMO,LUMO
|
2021-03-06 23:08:43 +01:00
|
|
|
double precision :: Gap,ET,EV,EJ,Ex
|
2019-03-19 10:13:33 +01:00
|
|
|
double precision,external :: trace_matrix
|
|
|
|
|
2019-09-23 13:31:01 +02:00
|
|
|
! 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)
|
|
|
|
|
2020-11-03 21:47:57 +01:00
|
|
|
! Compute energies
|
|
|
|
|
2019-03-19 10:13:33 +01:00
|
|
|
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))
|
2021-03-06 23:08:43 +01:00
|
|
|
EqsGW = ET + EV + EJ + Ex
|
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)') &
|
2020-11-03 21:47:57 +01:00
|
|
|
'|','#','|','e_HF (eV)','|','Sig_c (eV)','|','Z','|','e_QP (eV)','|'
|
2019-03-19 10:13:33 +01:00
|
|
|
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)') &
|
2020-11-03 21:47:57 +01:00
|
|
|
'|',x,'|',eHF(x)*HaToeV,'|',SigC(x,x)*HaToeV,'|',Z(x),'|',eGW(x)*HaToeV,'|'
|
2019-03-19 10:13:33 +01:00
|
|
|
enddo
|
|
|
|
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,'(2X,A10,I3)') 'Iteration ',nSCF
|
|
|
|
write(*,'(2X,A19,F15.5)')'max(|FPS - SPF|) = ',Conv
|
|
|
|
write(*,*)'-------------------------------------------'
|
2020-11-03 22:07:16 +01:00
|
|
|
write(*,'(2X,A30,F15.6,A3)') 'qsGW HOMO energy:',eGW(HOMO)*HaToeV,' eV'
|
|
|
|
write(*,'(2X,A30,F15.6,A3)') 'qsGW LUMO energy:',eGW(LUMO)*HaToeV,' eV'
|
|
|
|
write(*,'(2X,A30,F15.6,A3)') 'qsGW HOMO-LUMO gap :',Gap*HaToeV,' eV'
|
2019-03-19 10:13:33 +01:00
|
|
|
write(*,*)'-------------------------------------------'
|
2021-03-15 15:43:51 +01:00
|
|
|
write(*,'(2X,A30,F15.6,A3)') ' qsGW total energy:',ENuc + EqsGW,' au'
|
2020-11-04 14:49:45 +01:00
|
|
|
write(*,'(2X,A30,F15.6,A3)') ' qsGW exchange energy:',Ex,' au'
|
2021-03-06 23:08:43 +01:00
|
|
|
write(*,'(2X,A30,F15.6,A3)') ' GM@qsGW correlation energy:',EcGM,' au'
|
2020-11-03 22:07:16 +01:00
|
|
|
write(*,'(2X,A30,F15.6,A3)') 'RPA@qsGW correlation energy:',EcRPA,' au'
|
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)') '---------------------------------------'
|
2020-11-03 22:07:16 +01:00
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' One-electron energy: ',ET + EV,' au'
|
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Kinetic energy: ',ET,' au'
|
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Potential energy: ',EV,' au'
|
2019-03-19 10:13:33 +01:00
|
|
|
write(*,'(A50)') '---------------------------------------'
|
2020-11-03 22:07:16 +01:00
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Two-electron energy: ',EJ + Ex,' au'
|
2020-11-04 14:47:45 +01:00
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Hartree energy: ',EJ,' au'
|
2020-11-03 22:07:16 +01:00
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Exchange energy: ',Ex,' au'
|
2021-03-01 14:55:29 +01:00
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Correlation energy: ',EcGM,' au'
|
2019-03-19 10:13:33 +01:00
|
|
|
write(*,'(A50)') '---------------------------------------'
|
2020-11-03 22:07:16 +01:00
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Electronic energy: ',EqsGW,' au'
|
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' Nuclear repulsion: ',ENuc,' au'
|
2021-03-15 15:43:51 +01:00
|
|
|
write(*,'(A32,1X,F16.10,A3)') ' qsGW energy: ',ENuc + EqsGW,' au'
|
2019-03-19 10:13:33 +01:00
|
|
|
write(*,'(A50)') '---------------------------------------'
|
2020-10-21 12:58:37 +02:00
|
|
|
write(*,'(A35)') ' Dipole moment (Debye) '
|
|
|
|
write(*,'(10X,4A10)') 'X','Y','Z','Tot.'
|
|
|
|
write(*,'(10X,4F10.6)') (dipole(ixyz)*auToD,ixyz=1,ncart),norm2(dipole)*auToD
|
|
|
|
write(*,'(A50)') '-----------------------------------------'
|
2019-03-19 10:13:33 +01:00
|
|
|
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
|