From 19be97355d73db2ca1e5b52ca114384da0301e86 Mon Sep 17 00:00:00 2001 From: pfloos Date: Tue, 1 Oct 2024 09:42:25 +0200 Subject: [PATCH] saving --- src/GW/ccRG0W0.f90 | 20 ++++---------------- src/GW/ccRG0W0_TDA.f90 | 4 +--- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/GW/ccRG0W0.f90 b/src/GW/ccRG0W0.f90 index d3ec39e..f5ea24e 100644 --- a/src/GW/ccRG0W0.f90 +++ b/src/GW/ccRG0W0.f90 @@ -126,23 +126,19 @@ subroutine ccRG0W0(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,nS,ERI,ENuc,ERHF amp(:,:) = 0d0 res(:,:) = 0d0 - ! Compute energy differences and coupling blocks + ! Compute approximate hessians and coupling blocks do m=1,nS do j=nC+1,nO - del(m,j) = Om(m) + eHF(j) - eHF(p) vec(m,j) = sqrt(2d0)*rho(p,j,m) - end do end do do m=1,nS do b=1,nV-nR - del(m,nO+b) = Om(m) + eHF(nO+b) - eHF(p) vec(m,nO+b) = sqrt(2d0)*rho(p,nO+b,m) - end do end do @@ -166,13 +162,11 @@ subroutine ccRG0W0(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,nS,ERI,ENuc,ERHF ! Compute residual for 2h1p sector - res(:,:) = vec(:,:) + (del(:,:) - Sig(p))*amp(:,:) +! res(:,:) = vec(:,:) + (del(:,:) - Sig(p))*amp(:,:) do m=1,nS do j=nC+1,nO - - res(m,j) = res(m,j) - Om(m)*amp(m,j) - + res(m,j) = vec(m,j) + (eHF(j) - Om(m) - eHF(p) - Sig(p))*amp(m,j) end do end do @@ -180,9 +174,7 @@ subroutine ccRG0W0(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,nS,ERI,ENuc,ERHF do m=nC+1,nO do b=1,nV-nR - - res(m,nO+b) = res(m,nO+b) + Om(m)*amp(m,nO+b) - + res(m,nO+b) = vec(m,nO+b) + (eHF(nO+b) + Om(m) - eHF(p) - Sig(p))*amp(m,nO+b) end do end do @@ -197,10 +189,8 @@ subroutine ccRG0W0(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,nS,ERI,ENuc,ERHF ! DIIS extrapolation if(max_diis > 1) then - n_diis = min(n_diis+1,max_diis) call DIIS_extrapolation(rcond,nS*nOrb,nS*nOrb,n_diis,r_diis,t_diis,res,amp) - end if ! Compute quasiparticle energy @@ -209,9 +199,7 @@ subroutine ccRG0W0(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,nS,ERI,ENuc,ERHF do m=1,nS do q=nC+1,nOrb-nR - Sig(p) = Sig(p) + vec(m,q)*amp(m,q) - end do end do diff --git a/src/GW/ccRG0W0_TDA.f90 b/src/GW/ccRG0W0_TDA.f90 index 4c3ac4c..2842464 100644 --- a/src/GW/ccRG0W0_TDA.f90 +++ b/src/GW/ccRG0W0_TDA.f90 @@ -161,8 +161,7 @@ subroutine ccRG0W0_TDA(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,ERI,ENuc,ERH do k=nC+1,nO do c=1,nV-nR - res(i,a,j) = res(i,a,j) - 2d0*ERI(j,nO+c,nO+a,k)*amp(i,c,k) -! - 2d0*ERI(i,nO+c,nO+a,k)*amp(k,c,j) + res(i,a,j) = res(i,a,j) - 2d0*ERI(j,nO+c,nO+a,k)*amp(i,c,k) end do end do @@ -181,7 +180,6 @@ subroutine ccRG0W0_TDA(maxSCF,thresh,max_diis,nBas,nOrb,nC,nO,nV,nR,ERI,ENuc,ERH do c=1,nV-nR res(i,a,nO+b) = res(i,a,nO+b) + 2d0*ERI(nO+a,k,i,nO+c)*amp(k,c,nO+b) -! + 2d0*ERI(nO+b,k,i,nO+c)*amp(k,a,nO+c) end do end do