From 6a7e7fb602c65257fd58cadbe1c728c64bf45f34 Mon Sep 17 00:00:00 2001 From: Antoine MARIE Date: Wed, 3 Jul 2024 16:43:41 +0200 Subject: [PATCH] debug TDAppBSEDynamicGW --- input/methods.default | 22 ---------------------- input/options.default | 18 ------------------ src/GW/GW_ppBSE.f90 | 4 ++-- src/GW/GW_ppBSE_dynamic_kernel_B.f90 | 7 ++----- src/GW/GW_ppBSE_dynamic_kernel_C.f90 | 16 ++++++---------- src/GW/GW_ppBSE_dynamic_kernel_D.f90 | 14 +++++--------- src/GW/GW_ppBSE_dynamic_perturbation.f90 | 17 +++++++++++------ src/make_ninja.py | 4 ++-- 8 files changed, 28 insertions(+), 74 deletions(-) delete mode 100644 input/methods.default delete mode 100644 input/options.default diff --git a/input/methods.default b/input/methods.default deleted file mode 100644 index 685092a..0000000 --- a/input/methods.default +++ /dev/null @@ -1,22 +0,0 @@ -# RHF UHF GHF ROHF - F F F F -# MP2 MP3 - F F -# CCD pCCD DCD CCSD CCSD(T) - F F F F F -# drCCD rCCD crCCD lCCD - F F F F -# CIS CIS(D) CID CISD FCI - F F F F F -# phRPA phRPAx crRPA ppRPA - F F F F -# G0F2 evGF2 qsGF2 ufGF2 G0F3 evGF3 - F F F F F F -# G0W0 evGW qsGW SRG-qsGW ufG0W0 ufGW - F F F F F F -# G0T0pp evGTpp qsGTpp ufG0T0pp - F F F F -# G0T0eh evGTeh qsGTeh - F F F -# Rtest Utest Gtest - F F F diff --git a/input/options.default b/input/options.default deleted file mode 100644 index 8a86013..0000000 --- a/input/options.default +++ /dev/null @@ -1,18 +0,0 @@ -# HF: maxSCF thresh DIIS guess mix shift stab search - 256 0.00001 5 1 0.0 0.0 F F -# MP: reg - F -# CC: maxSCF thresh DIIS - 64 0.00001 5 -# spin: TDA singlet triplet - F T T -# GF: maxSCF thresh DIIS lin eta renorm reg - 256 0.00001 5 F 0.0 0 F -# GW: maxSCF thresh DIIS lin eta TDA_W reg - 256 0.00001 5 F 0.0 F F -# GT: maxSCF thresh DIIS lin eta TDA_T reg - 256 0.00001 5 F 0.0 F F -# ACFDT: AC Kx XBS - F F T -# BSE: phBSE phBSE2 ppBSE dBSE dTDA - F F F F T diff --git a/src/GW/GW_ppBSE.f90 b/src/GW/GW_ppBSE.f90 index 4fb3713..c1d6daa 100644 --- a/src/GW/GW_ppBSE.f90 +++ b/src/GW/GW_ppBSE.f90 @@ -131,9 +131,9 @@ subroutine GW_ppBSE(TDA_W,TDA,dBSE,dTDA,singlet,triplet,eta,nBas,nC,nO,nV,nR,nS, if(dBSE) & call GW_ppBSE_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,eW,eGW,ERI,dipole_int,OmRPA,rho_RPA, & Om1,X1,Y1,Om2,X2,Y2,KB_sta,KC_sta,KD_sta) - + write(*,*) "Deallocate not done" deallocate(Om1,X1,Y1,Om2,X2,Y2,Bpp,Cpp,Dpp,KB_sta,KC_sta,KD_sta) - + write(*,*) "Deallocate done" end if !------------------- diff --git a/src/GW/GW_ppBSE_dynamic_kernel_B.f90 b/src/GW/GW_ppBSE_dynamic_kernel_B.f90 index c1b5784..d837bfe 100644 --- a/src/GW/GW_ppBSE_dynamic_kernel_B.f90 +++ b/src/GW/GW_ppBSE_dynamic_kernel_B.f90 @@ -75,9 +75,8 @@ subroutine GW_ppBSE_dynamic_kernel_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambd KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - KB_dyn(ab,ij) = 2d0*KB_dyn(ab,ij)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(i,j))) - end do + KB_dyn(ab,ij) = 2d0*KB_dyn(ab,ij)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(i,j))) end do end do @@ -121,10 +120,8 @@ subroutine GW_ppBSE_dynamic_kernel_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambd KB_dyn(ab,ij) = KB_dyn(ab,ij) - num*dem/(dem**2 + eta**2) - KB_dyn(ab,ij) = 2d0*KB_dyn(ab,ij) - end do - + KB_dyn(ab,ij) = 2d0*KB_dyn(ab,ij) end do end do diff --git a/src/GW/GW_ppBSE_dynamic_kernel_C.f90 b/src/GW/GW_ppBSE_dynamic_kernel_C.f90 index 6c6b684..c9f6445 100644 --- a/src/GW/GW_ppBSE_dynamic_kernel_C.f90 +++ b/src/GW/GW_ppBSE_dynamic_kernel_C.f90 @@ -55,7 +55,6 @@ subroutine GW_ppBSE_dynamic_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nS,nVV,lambda,eG cd = cd + 1 do m=1,nS - dem = OmBSE - eGW(c) - Om(m) - eGW(b) num = rho(a,c,m)*rho(b,d,m) @@ -80,11 +79,9 @@ subroutine GW_ppBSE_dynamic_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nS,nVV,lambda,eG KC_dyn(ab,cd) = KC_dyn(ab,cd) + num*dem/(dem**2 + eta**2) ZC_dyn(ab,cd) = ZC_dyn(ab,cd) - num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 - KC_dyn(ab,cd) = 2d0*KC_dyn(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) - ZC_dyn(ab,cd) = 2d0*ZC_dyn(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) - - end do - + end do + KC_dyn(ab,cd) = 2d0*KC_dyn(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) + ZC_dyn(ab,cd) = 2d0*ZC_dyn(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) end do end do @@ -131,11 +128,10 @@ subroutine GW_ppBSE_dynamic_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nS,nVV,lambda,eG KC_dyn(ab,cd) = KC_dyn(ab,cd) - num*dem/(dem**2 + eta**2) ZC_dyn(ab,cd) = ZC_dyn(ab,cd) + num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 - KC_dyn(ab,cd) = 2d0*KC_dyn(ab,cd) - ZC_dyn(ab,cd) = 2d0*ZC_dyn(ab,cd) - end do - + + KC_dyn(ab,cd) = 2d0*KC_dyn(ab,cd) + ZC_dyn(ab,cd) = 2d0*ZC_dyn(ab,cd) end do end do diff --git a/src/GW/GW_ppBSE_dynamic_kernel_D.f90 b/src/GW/GW_ppBSE_dynamic_kernel_D.f90 index ed95489..a429a36 100644 --- a/src/GW/GW_ppBSE_dynamic_kernel_D.f90 +++ b/src/GW/GW_ppBSE_dynamic_kernel_D.f90 @@ -80,11 +80,9 @@ subroutine GW_ppBSE_dynamic_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,lambda,eG KD_dyn(ij,kl) = KD_dyn(ij,kl) + num*dem/(dem**2 + eta**2) ZD_dyn(ij,kl) = ZD_dyn(ij,kl) - num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 - KD_dyn(ij,kl) = 2d0*KD_dyn(ij,kl)/sqrt((1d0 + Kronecker_delta(i,j))*(1d0 + Kronecker_delta(k,l))) - ZD_dyn(ij,kl) = 2d0*ZD_dyn(ij,kl)/sqrt((1d0 + Kronecker_delta(i,j))*(1d0 + Kronecker_delta(k,l))) - end do - + KD_dyn(ij,kl) = 2d0*KD_dyn(ij,kl)/sqrt((1d0 + Kronecker_delta(i,j))*(1d0 + Kronecker_delta(k,l))) + ZD_dyn(ij,kl) = 2d0*ZD_dyn(ij,kl)/sqrt((1d0 + Kronecker_delta(i,j))*(1d0 + Kronecker_delta(k,l))) end do end do @@ -131,11 +129,9 @@ subroutine GW_ppBSE_dynamic_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,lambda,eG KD_dyn(ij,kl) = KD_dyn(ij,kl) - num*dem/(dem**2 + eta**2) ZD_dyn(ij,kl) = ZD_dyn(ij,kl) + num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 - KD_dyn(ij,kl) = 2d0*KD_dyn(ij,kl) - ZD_dyn(ij,kl) = 2d0*ZD_dyn(ij,kl) - - end do - + end do + KD_dyn(ij,kl) = 2d0*KD_dyn(ij,kl) + ZD_dyn(ij,kl) = 2d0*ZD_dyn(ij,kl) end do end do diff --git a/src/GW/GW_ppBSE_dynamic_perturbation.f90 b/src/GW/GW_ppBSE_dynamic_perturbation.f90 index 3d45425..a72736d 100644 --- a/src/GW/GW_ppBSE_dynamic_perturbation.f90 +++ b/src/GW/GW_ppBSE_dynamic_perturbation.f90 @@ -56,10 +56,15 @@ subroutine GW_ppBSE_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOO, ! Memory allocation - allocate(Om1Dyn(maxVV),Om2Dyn(maxOO),Z1Dyn(maxVV),Z2Dyn(maxOO), & + allocate(Om1Dyn(nOO),Om2Dyn(nOO),Z1Dyn(nOO),Z2Dyn(nOO), & KB_dyn(nVV,nOO),KC_dyn(nVV,nVV),KD_dyn(nOO,nOO), & ZC_dyn(nVV,nVV),ZD_dyn(nOO,nOO)) + Om1Dyn(:) = 0d0 + Om2Dyn(:) = 0d0 + Z1Dyn(:) = 0d0 + Z2Dyn(:) = 0d0 + if(dTDA) then write(*,*) write(*,*) '*** dynamical TDA activated ***' @@ -77,8 +82,8 @@ subroutine GW_ppBSE_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOO, ! if(.not.dTDA) call GW_ppBSE_dynamic_kernel_B(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,1d0,eGW,OmRPA,rho_RPA,OmBSE(ab),KB_dyn) call GW_ppBSE_dynamic_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nS,nVV,1d0,eGW,OmRPA,rho_RPA,Om1(ab),KC_dyn,ZC_dyn) - Z1Dyn(ab) = dot_product(X1(:,ab),matmul(ZC_dyn,X1(:,ab))) - Om1Dyn(ab) = dot_product(X1(:,ab),matmul(KC_dyn - KC_sta,X1(:,ab))) + Z1Dyn(ab) = dot_product(X1(ab,:),matmul(ZC_dyn,X1(ab,:))) + Om1Dyn(ab) = dot_product(X1(ab,:),matmul(KC_dyn - KC_sta,X1(ab,:))) Z1Dyn(ab) = 1d0/(1d0 - Z1Dyn(ab)) Om1Dyn(ab) = Z1Dyn(ab)*Om1Dyn(ab) @@ -101,8 +106,8 @@ subroutine GW_ppBSE_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOO, ! if(.not.dTDA) call GW_ppBSE_dynamic_kernel_B(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,1d0,eGW,OmRPA,rho_RPA,OmBSE(ab),KB_dyn) call GW_ppBSE_dynamic_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,1d0,eGW,OmRPA,rho_RPA,Om2(ij),KD_dyn,ZD_dyn) - Z2Dyn(ij) = dot_product(Y2(:,ij),matmul(ZD_dyn,Y2(:,ij))) - Om2Dyn(ij) = dot_product(Y2(:,ij),matmul(KD_dyn - KD_sta,Y2(:,ij))) + Z2Dyn(ij) = dot_product(Y2(ij,:),matmul(ZD_dyn,Y2(ij,:))) + Om2Dyn(ij) = dot_product(Y2(ij,:),matmul(KD_dyn - KD_sta,Y2(ij,:))) Z2Dyn(ij) = 1d0/(1d0 - Z2Dyn(ij)) Om2Dyn(ij) = Z2Dyn(ij)*Om2Dyn(ij) @@ -112,6 +117,6 @@ subroutine GW_ppBSE_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOO, end do write(*,*) '---------------------------------------------------------------------------------------------------' - write(*,*) + write(*,*) end subroutine diff --git a/src/make_ninja.py b/src/make_ninja.py index 37a21c3..1ac16ed 100755 --- a/src/make_ninja.py +++ b/src/make_ninja.py @@ -78,8 +78,8 @@ FIX_ORDER_OF_LIBS=-Wl,--start-group if sys.platform in ["linux", "linux2"]: -# compiler = compile_gfortran_linux - compiler = compile_ifort_linux + compiler = compile_gfortran_linux +# compiler = compile_ifort_linux elif sys.platform == "darwin": compiler = compile_gfortran_mac else: