4
1
mirror of https://github.com/pfloos/quack synced 2024-12-22 20:35:36 +01:00

change ordering of some loop to increase speed of qsGW

This commit is contained in:
Antoine Marie 2022-12-08 15:06:18 +01:00
parent ab2857b377
commit 8c1dcd96e1
3 changed files with 29 additions and 26 deletions

View File

@ -20,13 +20,13 @@ subroutine excitation_density(nBas,nC,nO,nR,nS,ERI,XpY,rho)
rho(:,:,:) = 0d0
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
jb = 0
do j=nC+1,nO
do b=nO+1,nBas-nR
jb = jb + 1
do ia=1,nS
jb = 0
do j=nC+1,nO
do b=nO+1,nBas-nR
jb = jb + 1
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
rho(p,q,ia) = rho(p,q,ia) + ERI(p,j,q,b)*XpY(ia,jb)
enddo
enddo

View File

@ -78,10 +78,10 @@ subroutine self_energy_correlation(COHSEX,eta,nBas,nC,nO,nV,nR,nS,e,Omega,rho,Ec
! Occupied part of the correlation self-energy
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do i=nC+1,nO
do jb=1,nS
do jb=1,nS
do i=nC+1,nO
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
eps = e(p) - e(i) + Omega(jb)
SigC(p,q) = SigC(p,q) + 2d0*rho(p,i,jb)*rho(q,i,jb)*eps/(eps**2 + eta**2)
end do
@ -91,10 +91,10 @@ subroutine self_energy_correlation(COHSEX,eta,nBas,nC,nO,nV,nR,nS,e,Omega,rho,Ec
! Virtual part of the correlation self-energy
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do a=nO+1,nBas-nR
do jb=1,nS
do jb=1,nS
do a=nO+1,nBas-nR
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
eps = e(p) - e(a) - Omega(jb)
SigC(p,q) = SigC(p,q) + 2d0*rho(p,a,jb)*rho(q,a,jb)*eps/(eps**2 + eta**2)
end do
@ -105,9 +105,9 @@ subroutine self_energy_correlation(COHSEX,eta,nBas,nC,nO,nV,nR,nS,e,Omega,rho,Ec
! Galitskii-Migdal correlation energy
EcGM = 0d0
do i=nC+1,nO
do jb=1,nS
do a=nO+1,nBas-nR
do jb=1,nS
do i=nC+1,nO
eps = e(a) - e(i) + Omega(jb)
EcGM = EcGM - 4d0*rho(a,i,jb)*rho(a,i,jb)*eps/(eps**2 + eta**2)
end do

View File

@ -40,13 +40,15 @@ subroutine self_energy_correlation_SRG(eta,nBas,nC,nO,nV,nR,nS,e,Omega,rho,EcGM,
! Occupied part of the correlation self-energy
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do i=nC+1,nO
do m=1,nS
do m=1,nS
do i=nC+1,nO
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
Dpim = e(p) - e(i) + Omega(m)
Dqim = e(q) - e(i) + Omega(m)
SigC(p,q) = SigC(p,q) + 2d0*rho(p,i,m)*rho(q,i,m)*(Dpim + Dqim)/(Dpim**2 + Dqim**2)
SigC(p,q) = SigC(p,q) + 2d0*rho(p,i,m)*rho(q,i,m)*(1-exp(-eta*Dpim**2)*exp(-eta*Dqim**2)) &
*(Dpim + Dqim)/(Dpim**2 + Dqim**2)
end do
end do
end do
@ -54,13 +56,14 @@ subroutine self_energy_correlation_SRG(eta,nBas,nC,nO,nV,nR,nS,e,Omega,rho,EcGM,
! Virtual part of the correlation self-energy
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do a=nO+1,nBas-nR
do m=1,nS
do m=1,nS
do a=nO+1,nBas-nR
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
Dpam = e(p) - e(a) - Omega(m)
Dqam = e(q) - e(a) - Omega(m)
SigC(p,q) = SigC(p,q) + 2d0*rho(p,a,m)*rho(q,a,m)*(Dpam + Dqam)/(Dpam**2 + Dqam**2)
SigC(p,q) = SigC(p,q) + 2d0*rho(p,a,m)*rho(q,a,m)*(1-exp(-eta*Dpam**2)*exp(-eta*Dqam**2)) &
*(Dpam + Dqam)/(Dpam**2 + Dqam**2)
end do
end do
end do