mirror of
https://github.com/pfloos/quack
synced 2024-12-23 04:43:53 +01:00
GF clean up
This commit is contained in:
parent
5f75ec478b
commit
97d5958add
@ -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
|
||||
|
@ -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,39 +42,6 @@ subroutine G0F2(linearize,nBas,nC,nO,nV,nR,V,e0)
|
||||
! Frequency-dependent second-order contribution
|
||||
|
||||
Bpp(:,:) = 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
|
||||
|
||||
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)
|
||||
|
||||
Bpp(p,2) = Bpp(p,2) &
|
||||
+ (2d0*V(p,i,a,b) - V(p,i,b,a))*V(p,i,a,b)/eps
|
||||
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
||||
! Compute the renormalization factor
|
||||
|
||||
Z(:) = 0d0
|
||||
|
||||
do p=nC+1,nBas-nR
|
||||
@ -81,9 +49,10 @@ subroutine G0F2(linearize,nBas,nC,nO,nV,nR,V,e0)
|
||||
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
|
||||
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
|
||||
@ -95,16 +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)
|
||||
|
||||
Z(p) = Z(p) - (2d0*V(p,i,a,b) - V(p,i,b,a))*V(p,i,a,b)/eps**2
|
||||
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
|
||||
|
||||
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
|
||||
|
@ -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
|
||||
@ -23,23 +24,23 @@ subroutine print_G0F2(nBas,nO,eHF,eGF2)
|
||||
|
||||
! 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
|
||||
|
Loading…
Reference in New Issue
Block a user