4
1
mirror of https://github.com/pfloos/quack synced 2024-06-18 11:15:30 +02:00

GF clean up

This commit is contained in:
Pierre-Francois Loos 2020-03-19 10:59:20 +01:00
parent 5f75ec478b
commit 97d5958add
3 changed files with 27 additions and 56 deletions

View File

@ -7,7 +7,7 @@
# CIS/TDHF/BSE: singlet triplet
T T
# GF: maxSCF thresh DIIS n_diis lin renorm
256 0.00001 T 5 T 3
256 0.00001 T 5 F 3
# GW: maxSCF thresh DIIS n_diis COHSEX SOSEX BSE TDA G0W GW0 lin eta
256 0.00001 T 5 F F T F F F T 0.000
# ACFDT: AC Kx XBS

View File

@ -19,6 +19,7 @@ subroutine G0F2(linearize,nBas,nC,nO,nV,nR,V,e0)
! Local variables
double precision :: eps
double precision :: VV
double precision,allocatable :: eGF2(:)
double precision,allocatable :: Bpp(:,:)
double precision,allocatable :: Z(:)
@ -41,16 +42,17 @@ subroutine G0F2(linearize,nBas,nC,nO,nV,nR,V,e0)
! Frequency-dependent second-order contribution
Bpp(:,:) = 0d0
Z(:) = 0d0
do p=nC+1,nBas-nR
do i=nC+1,nO
do j=nC+1,nO
do a=nO+1,nBas-nR
eps = eGF2(p) + e0(a) - e0(i) - e0(j)
Bpp(p,1) = Bpp(p,1) &
+ (2d0*V(p,a,i,j) - V(p,a,j,i))*V(p,a,i,j)/eps
eps = e0(p) + e0(a) - e0(i) - e0(j)
VV = (2d0*V(p,a,i,j) - V(p,a,j,i))*V(p,a,i,j)
Bpp(p,1) = Bpp(p,1) + VV/eps
Z(p) = Z(p) + VV/eps**2
end do
end do
@ -62,49 +64,17 @@ subroutine G0F2(linearize,nBas,nC,nO,nV,nR,V,e0)
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
eps = eGF2(p) + e0(i) - e0(a) - e0(b)
Bpp(p,2) = Bpp(p,2) &
+ (2d0*V(p,i,a,b) - V(p,i,b,a))*V(p,i,a,b)/eps
eps = e0(p) + e0(i) - e0(a) - e0(b)
VV = (2d0*V(p,i,a,b) - V(p,i,b,a))*V(p,i,a,b)
Bpp(p,2) = Bpp(p,2) + VV/eps
Z(p) = Z(p) + VV/eps**2
end do
end do
end do
end do
! Compute the renormalization factor
Z(:) = 0d0
do p=nC+1,nBas-nR
do i=nC+1,nO
do j=nC+1,nO
do a=nO+1,nBas-nR
eps = eGF2(p) + e0(a) - e0(i) - e0(j)
Z(p) = Z(p) - (2d0*V(p,a,i,j) - V(p,a,j,i))*V(p,a,i,j)/eps**2
end do
end do
end do
end do
do p=nC+1,nBas-nR
do i=nC+1,nO
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
eps = eGF2(p) + e0(i) - e0(a) - e0(b)
Z(p) = Z(p) - (2d0*V(p,i,a,b) - V(p,i,b,a))*V(p,i,a,b)/eps**2
end do
end do
end do
end do
Z(:) = 1d0/(1d0 - Z(:))
Z(:) = 1d0/(1d0 + Z(:))
if(linearize) then
@ -117,6 +87,6 @@ subroutine G0F2(linearize,nBas,nC,nO,nV,nR,V,e0)
end if
! Print results
call print_G0F2(nBas,nO,e0,eGF2)
call print_G0F2(nBas,nO,e0,eGF2,Z)
end subroutine G0F2

View File

@ -1,4 +1,4 @@
subroutine print_G0F2(nBas,nO,eHF,eGF2)
subroutine print_G0F2(nBas,nO,eHF,eGF2,Z)
! Print one-electron energies and other stuff for G0F2
@ -9,8 +9,9 @@ subroutine print_G0F2(nBas,nO,eHF,eGF2)
integer,intent(in) :: nO
double precision,intent(in) :: eHF(nBas)
double precision,intent(in) :: eGF2(nBas)
double precision,intent(in) :: Z(nBas)
integer :: x
integer :: p
integer :: HOMO
integer :: LUMO
double precision :: Gap
@ -19,27 +20,27 @@ subroutine print_G0F2(nBas,nO,eHF,eGF2)
HOMO = nO
LUMO = HOMO + 1
Gap = eGF2(LUMO)-eGF2(HOMO)
Gap = eGF2(LUMO) - eGF2(HOMO)
! Dump results
write(*,*)'-------------------------------------------'
write(*,*)'--------------------------------------------------------'
write(*,*)' Frequency-dependent G0F2 calculation'
write(*,*)'-------------------------------------------'
write(*,'(1X,A1,1X,A3,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X)') &
'|','#','|','e_HF (eV)','|','e_G0F2 (eV)','|'
write(*,*)'-------------------------------------------'
write(*,*)'--------------------------------------------------------'
write(*,'(1X,A1,1X,A3,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X,A10,1X,A1,1X)') &
'|','#','|','e_HF (eV)','|','e_G0F2 (eV)','|','Z','|'
write(*,*)'--------------------------------------------------------'
do x=1,nBas
write(*,'(1X,A1,1X,I3,1X,A1,1X,F15.6,1X,A1,1X,F15.6,1X,A1,1X)') &
'|',x,'|',eHF(x)*HaToeV,'|',eGF2(x)*HaToeV,'|'
do p=1,nBas
write(*,'(1X,A1,1X,I3,1X,A1,1X,F15.6,1X,A1,1X,F15.6,1X,A1,1X,F10.6,1X,A1,1X)') &
'|',p,'|',eHF(p)*HaToeV,'|',eGF2(p)*HaToeV,'|',Z(p),'|'
enddo
write(*,*)'-------------------------------------------'
write(*,*)'--------------------------------------------------------'
write(*,'(2X,A27,F15.6)') 'G0F2 HOMO energy (eV):',eGF2(HOMO)*HaToeV
write(*,'(2X,A27,F15.6)') 'G0F2 LUMO energy (eV):',eGF2(LUMO)*HaToeV
write(*,'(2X,A27,F15.6)') 'G0F2 HOMO-LUMO gap (eV):',Gap*HaToeV
write(*,*)'-------------------------------------------'
write(*,*)'--------------------------------------------------------'
write(*,*)
end subroutine print_G0F2