From 58044a8a89d08045b0b76c77e422743599fcc46d Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Mon, 18 Oct 2021 14:14:46 +0200 Subject: [PATCH] OK for ufGW --- input/methods | 2 +- src/MBPT/ufGW.f90 | 42 ++++++++++++++++++++++-------------------- src/QuAcK/QuAcK.f90 | 21 ++++++++++++++++++++- 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/input/methods b/input/methods index ff3db34..52c4b14 100644 --- a/input/methods +++ b/input/methods @@ -15,7 +15,7 @@ # G0W0* evGW* qsGW* F F F # G0T0 evGT qsGT - T T T + F F F # MCMP2 F # * unrestricted version available diff --git a/src/MBPT/ufGW.f90 b/src/MBPT/ufGW.f90 index e3aa076..6403193 100644 --- a/src/MBPT/ufGW.f90 +++ b/src/MBPT/ufGW.f90 @@ -48,8 +48,8 @@ subroutine ufGW(eta,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF) ! Dimension of the supermatrix - n2h1p = nBas*nO*nS - n2p1h = nBas*nV*nS + n2h1p = nO*nO*nS + n2p1h = nV*nV*nO nH = nBas + n2h1p + n2p1h ! Memory allocation @@ -76,7 +76,7 @@ subroutine ufGW(eta,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF) ! Block F ! !---------! - do p=nC+1,nBas-nV + do p=nC+1,nBas-nR H(p,p) = eHF(p) end do @@ -84,12 +84,12 @@ subroutine ufGW(eta,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF) ! Block V2h1p ! !-------------! - do p=nC+1,nBas-nV + do p=nC+1,nBas-nR klc = 0 do k=nC+1,nO do l=nC+1,nO - do c=nO+1,nBas-nV + do c=nO+1,nBas-nR klc = klc + 1 H(p ,nBas+klc) = sqrt(2d0)*ERI(p,c,k,l) @@ -105,16 +105,16 @@ subroutine ufGW(eta,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF) ! Block V2p1h ! !-------------! - do p=nC+1,nBas-nV + do p=nC+1,nBas-nR kcd = 0 do k=nC+1,nO - do c=nO+1,nBas-nV - do d=nO+1,nBas-nV + do c=nO+1,nBas-nR + do d=nO+1,nBas-nR kcd = kcd + 1 - H(p ,nBas+kcd) = sqrt(2d0)*ERI(p,k,d,c) - H(nBas+kcd,p ) = sqrt(2d0)*ERI(p,k,d,c) + H(p ,nBas+n2h1P+kcd) = sqrt(2d0)*ERI(p,k,d,c) + H(nBas+n2h1p+kcd,p ) = sqrt(2d0)*ERI(p,k,d,c) end do end do @@ -129,17 +129,18 @@ subroutine ufGW(eta,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF) ija = 0 do i=nC+1,nO do j=nC+1,nO - do a=nO+1,nBas-nV + do a=nO+1,nBas-nR ija = ija + 1 klc = 0 do k=nC+1,nO do l=nC+1,nO - do c=nO+1,nBas-nV + do c=nO+1,nBas-nR klc = klc + 1 - H(nBas+ija,nBas+klc) = ((eHF(i) + eHF(j) - eHF(a))*Kronecker_delta(j,l)*Kronecker_delta(a,c) & - - ERI(j,c,a,l))**Kronecker_delta(i,k) + H(nBas+ija,nBas+klc) & + = ((eHF(i) + eHF(j) - eHF(a))*Kronecker_delta(j,l)*Kronecker_delta(a,c) & + - 2d0*ERI(j,c,a,l))*Kronecker_delta(i,k) end do end do @@ -155,18 +156,19 @@ subroutine ufGW(eta,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF) iab = 0 do i=nC+1,nO - do a=nO+1,nBas-nV - do b=nO+1,nBas-nV + do a=nO+1,nBas-nR + do b=nO+1,nBas-nR iab = iab + 1 kcd = 0 do k=nC+1,nO - do c=nO+1,nBas-nV - do d=nO+1,nBas-nV + do c=nO+1,nBas-nR + do d=nO+1,nBas-nR kcd = kcd + 1 - H(nBas+iab,nBas+kcd) = ((eHF(a) + eHF(b) - eHF(i))*Kronecker_delta(i,k)*Kronecker_delta(a,c) & - - ERI(j,c,a,l))**Kronecker_delta(b,d) + H(nBas+n2h1p+iab,nBas+n2h1p+kcd) & + = ((eHF(a) + eHF(b) - eHF(i))*Kronecker_delta(i,k)*Kronecker_delta(a,c) & + + 2d0*ERI(a,k,i,c))*Kronecker_delta(b,d) end do end do diff --git a/src/QuAcK/QuAcK.f90 b/src/QuAcK/QuAcK.f90 index dbf2dd0..fd62a13 100644 --- a/src/QuAcK/QuAcK.f90 +++ b/src/QuAcK/QuAcK.f90 @@ -15,7 +15,7 @@ program QuAcK logical :: doRPA,doRPAx,doppRPA logical :: doADC logical :: doG0F2,doevGF2,doqsGF2,doG0F3,doevGF3 - logical :: doG0W0,doevGW,doqsGW + logical :: doG0W0,doevGW,doqsGW,doufGW logical :: doG0T0,doevGT,doqsGT logical :: doMCMP2,doMinMCMP2 logical :: doGTGW = .false. @@ -99,6 +99,7 @@ program QuAcK double precision :: start_G0W0 ,end_G0W0 ,t_G0W0 double precision :: start_evGW ,end_evGW ,t_evGW double precision :: start_qsGW ,end_qsGW ,t_qsGW + double precision :: start_ufGW ,end_ufGW ,t_ufGW double precision :: start_G0T0 ,end_G0T0 ,t_G0T0 double precision :: start_evGT ,end_evGT ,t_evGT double precision :: start_qsGT ,end_qsGT ,t_qsGT @@ -1023,6 +1024,24 @@ program QuAcK end if +!------------------------------------------------------------------------ +! Perform ufGW calculatiom +!------------------------------------------------------------------------ + + doufGW = .true. + + if(doufGW) then + + call cpu_time(start_ufGW) + call ufGW(eta_GW,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI_MO,eHF) + call cpu_time(end_ufGW) + + t_ufGW = end_ufGW - start_ufGW + write(*,'(A65,1X,F9.3,A8)') 'Total CPU time for ufGW = ',t_ufGW,' seconds' + write(*,*) + + end if + !------------------------------------------------------------------------ ! Perform G0T0 calculatiom !------------------------------------------------------------------------