10
1
mirror of https://github.com/pfloos/quack synced 2024-11-03 20:53:53 +01:00

clean up code for GT

This commit is contained in:
Pierre-Francois Loos 2021-10-16 18:51:53 +02:00
parent 7c863d4982
commit 41f48188d5
4 changed files with 30 additions and 42 deletions

View File

@ -142,29 +142,27 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
iblock = 3 iblock = 3
dERI = +1d0 dERI = +1d0
xERI = +0d0 xERI = +0d0
alpha = +1d0
call excitation_density_Tmatrix(iblock,dERI,xERI,nBas,nC,nO,nV,nR,nOOs,nVVs,ERI_MO(:,:,:,:), & call excitation_density_Tmatrix(iblock,dERI,xERI,nBas,nC,nO,nV,nR,nOOs,nVVs,ERI_MO(:,:,:,:), &
X1s(:,:),Y1s(:,:),rho1s(:,:,:),X2s(:,:),Y2s(:,:),rho2s(:,:,:)) X1s(:,:),Y1s(:,:),rho1s(:,:,:),X2s(:,:),Y2s(:,:),rho2s(:,:,:))
call self_energy_Tmatrix_diag(alpha,eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF(:), & call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF(:), &
Omega1s(:),rho1s(:,:,:),Omega2s(:),rho2s(:,:,:),SigT(:)) Omega1s(:),rho1s(:,:,:),Omega2s(:),rho2s(:,:,:),SigT(:))
call renormalization_factor_Tmatrix(alpha,eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF(:), & call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF(:), &
Omega1s(:),rho1s(:,:,:),Omega2s(:),rho2s(:,:,:),Z(:)) Omega1s(:),rho1s(:,:,:),Omega2s(:),rho2s(:,:,:),Z(:))
iblock = 4 iblock = 4
dERI = +1d0 dERI = +1d0
xERI = -1d0 xERI = -1d0
alpha = +1d0
call excitation_density_Tmatrix(iblock,dERI,xERI,nBas,nC,nO,nV,nR,nOOt,nVVt,ERI_MO(:,:,:,:), & call excitation_density_Tmatrix(iblock,dERI,xERI,nBas,nC,nO,nV,nR,nOOt,nVVt,ERI_MO(:,:,:,:), &
X1t(:,:),Y1t(:,:),rho1t(:,:,:),X2t(:,:),Y2t(:,:),rho2t(:,:,:)) X1t(:,:),Y1t(:,:),rho1t(:,:,:),X2t(:,:),Y2t(:,:),rho2t(:,:,:))
call self_energy_Tmatrix_diag(alpha,eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF(:), & call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF(:), &
Omega1t(:),rho1t(:,:,:),Omega2t(:),rho2t(:,:,:),SigT(:)) Omega1t(:),rho1t(:,:,:),Omega2t(:),rho2t(:,:,:),SigT(:))
call renormalization_factor_Tmatrix(alpha,eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF(:), & call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF(:), &
Omega1t(:),rho1t(:,:,:),Omega2t(:),rho2t(:,:,:),Z(:)) Omega1t(:),rho1t(:,:,:),Omega2t(:),rho2t(:,:,:),Z(:))
Z(:) = 1d0/(1d0 - Z(:)) Z(:) = 1d0/(1d0 - Z(:))

View File

@ -1,4 +1,4 @@
subroutine renormalization_factor_Tmatrix(alpha,eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,Z) subroutine renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,Z)
! Compute renormalization factor of the T-matrix self-energy ! Compute renormalization factor of the T-matrix self-energy
@ -7,7 +7,6 @@ subroutine renormalization_factor_Tmatrix(alpha,eta,nBas,nC,nO,nV,nR,nOO,nVV,e,O
! Input variables ! Input variables
double precision,intent(in) :: alpha
double precision,intent(in) :: eta double precision,intent(in) :: eta
integer,intent(in) :: nBas,nC,nO,nV,nR integer,intent(in) :: nBas,nC,nO,nV,nR
integer,intent(in) :: nOO integer,intent(in) :: nOO
@ -33,7 +32,7 @@ subroutine renormalization_factor_Tmatrix(alpha,eta,nBas,nC,nO,nV,nR,nOO,nVV,e,O
do i=nC+1,nO do i=nC+1,nO
do cd=1,nVV do cd=1,nVV
eps = e(p) + e(i) - Omega1(cd) eps = e(p) + e(i) - Omega1(cd)
Z(p) = Z(p) - (rho1(p,i,cd)/eps)**2 Z(p) = Z(p) - rho1(p,i,cd)**2*(eps/(eps**2 + eta**2))**2
enddo enddo
enddo enddo
enddo enddo
@ -44,7 +43,7 @@ subroutine renormalization_factor_Tmatrix(alpha,eta,nBas,nC,nO,nV,nR,nOO,nVV,e,O
do a=1,nV-nR do a=1,nV-nR
do kl=1,nOO do kl=1,nOO
eps = e(p) + e(nO+a) - Omega2(kl) eps = e(p) + e(nO+a) - Omega2(kl)
Z(p) = Z(p) - (rho2(p,nO+a,kl)/eps)**2 Z(p) = Z(p) - rho2(p,nO+a,kl)**2*(eps/(eps**2 + eta**2))**2
enddo enddo
enddo enddo
enddo enddo

View File

@ -1,4 +1,4 @@
subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,Omega2,rho1,rho2,SigT) subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,SigT)
! Compute the correlation part of the T-matrix self-energy ! Compute the correlation part of the T-matrix self-energy
@ -17,9 +17,9 @@ subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,Omega2,rho1
integer,intent(in) :: nVV integer,intent(in) :: nVV
double precision,intent(in) :: e(nBas) double precision,intent(in) :: e(nBas)
double precision,intent(in) :: Omega1(nVV) double precision,intent(in) :: Omega1(nVV)
double precision,intent(in) :: rho1(nBas,nO,nVV) double precision,intent(in) :: rho1(nBas,nBas,nVV)
double precision,intent(in) :: Omega2(nOO) double precision,intent(in) :: Omega2(nOO)
double precision,intent(in) :: rho2(nBas,nV,nOO) double precision,intent(in) :: rho2(nBas,nBas,nOO)
! Local variables ! Local variables
@ -28,41 +28,33 @@ subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,Omega2,rho1
! Output variables ! Output variables
double precision,intent(out) :: SigT(nBas,nBas) double precision,intent(out) :: SigT(nBas)
! Initialize !----------------------------------------------
! Occupied part of the T-matrix self-energy
SigT = 0d0 !----------------------------------------------
! Occupied part of the T-matrix self-energy
do p=nC+1,nBas-nR do p=nC+1,nBas-nR
do q=nC+1,nBas-nR do q=nC+1,nBas-nR
do i=nC+1,nO do i=nC+1,nO
cd = 0 do cd=1,nVV
do c=nO+1,nBas-nR eps = e(p) + e(i) - Omega1(cd)
do d=c+1,nBas-nR SigT(p) = SigT(p) + rho1(p,i,cd)*rho1(q,i,cd)*eps/(eps**2 + eta**2)
cd = cd + 1
eps = e(p) + e(i) - Omega1(cd)
SigT(p,q) = SigT(p,q) + 2d0*rho1(p,i,cd)*rho1(q,i,cd)*eps/(eps**2 + eta**2)
enddo
enddo enddo
enddo enddo
enddo enddo
enddo enddo
!----------------------------------------------
! Virtual part of the T-matrix self-energy ! Virtual part of the T-matrix self-energy
!----------------------------------------------
do p=nC+1,nBas-nR do p=nC+1,nBas-nR
do q=nC+1,nBas-nR do q=nC+1,nBas-nR
do a=nO+1,nBas-nR do a=1,nV-nR
kl = 0 do kl=1,nOO
do k=nC+1,nO eps = e(p) + e(nO+a) - Omega2(kl)
do l=k+1,nO SigT(p) = SigT(p) + rho2(p,nO+a,kl)*rho2(q,nO+a,kl)*eps/(eps**2 + eta**2)
kl = kl + 1
eps = e(p) + e(a) - Omega2(kl)
SigT(p,q) = SigT(p,q) + 2d0*rho2(p,a,kl)*rho2(q,a,kl)*eps/(eps**2 + eta**2)
enddo
enddo enddo
enddo enddo
enddo enddo

View File

@ -1,4 +1,4 @@
subroutine self_energy_Tmatrix_diag(alpha,eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,SigT) subroutine self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,SigT)
! Compute diagonal of the correlation part of the T-matrix self-energy ! Compute diagonal of the correlation part of the T-matrix self-energy
@ -7,7 +7,6 @@ subroutine self_energy_Tmatrix_diag(alpha,eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,
! Input variables ! Input variables
double precision,intent(in) :: alpha
double precision,intent(in) :: eta double precision,intent(in) :: eta
integer,intent(in) :: nBas integer,intent(in) :: nBas
integer,intent(in) :: nC integer,intent(in) :: nC
@ -32,27 +31,27 @@ subroutine self_energy_Tmatrix_diag(alpha,eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,
double precision,intent(out) :: SigT(nBas) double precision,intent(out) :: SigT(nBas)
!---------------------------------------------- !----------------------------------------------
! Singlet part of the T-matrix self-energy
!----------------------------------------------
! Occupied part of the T-matrix self-energy ! Occupied part of the T-matrix self-energy
!----------------------------------------------
do p=nC+1,nBas-nR do p=nC+1,nBas-nR
do i=nC+1,nO do i=nC+1,nO
do cd=1,nVV do cd=1,nVV
eps = e(p) + e(i) - Omega1(cd) eps = e(p) + e(i) - Omega1(cd)
SigT(p) = SigT(p) + alpha*rho1(p,i,cd)**2/eps SigT(p) = SigT(p) + rho1(p,i,cd)**2*eps/(eps**2 + eta**2)
enddo enddo
enddo enddo
enddo enddo
! Virtual part of the T-matrix self-energy !----------------------------------------------
! Virtual part of the T-matrix self-energy
!----------------------------------------------
do p=nC+1,nBas-nR do p=nC+1,nBas-nR
do a=1,nV-nR do a=1,nV-nR
do kl=1,nOO do kl=1,nOO
eps = e(p) + e(nO+a) - Omega2(kl) eps = e(p) + e(nO+a) - Omega2(kl)
SigT(p) = SigT(p) + alpha*rho2(p,nO+a,kl)**2/eps SigT(p) = SigT(p) + rho2(p,nO+a,kl)**2*eps/(eps**2 + eta**2)
enddo enddo
enddo enddo
enddo enddo