diff --git a/src/GF/RG0F2.f90 b/src/GF/RG0F2.f90 index 8ed0a38..73e47f6 100644 --- a/src/GF/RG0F2.f90 +++ b/src/GF/RG0F2.f90 @@ -110,7 +110,7 @@ subroutine RG0F2(dotest,dophBSE,doppBSE,TDA,dBSE,dTDA,singlet,triplet,linearize, if(doppBSE) then - call RGF2_ppBSE(TDA,dBSE,dTDA,singlet,triplet,eta,nOrb,nC,nO,nV,nR,ERI,dipole_int,eGF,EcBSE) + call RGF2_ppBSE(TDA,dBSE,dTDA,singlet,triplet,eta,nOrb,nC,nO,nV,nR,ERI,dipole_int,eGF,EcBSE) EcBSE(2) = 3d0*EcBSE(2) diff --git a/src/GW/GGW_ppBSE_dynamic_kernel_B.f90 b/src/GW/GGW_ppBSE_dynamic_kernel_B.f90 index 52dc5b4..dbdf24a 100644 --- a/src/GW/GGW_ppBSE_dynamic_kernel_B.f90 +++ b/src/GW/GGW_ppBSE_dynamic_kernel_B.f90 @@ -50,28 +50,23 @@ subroutine GGW_ppBSE_dynamic_kernel_B(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,eGW ij = ij + 1 do m=1,nS + + num = (rho(a,i,m)*rho(b,j,m) - rho(b,i,m)*rho(a,j,m))/2 + dem = - Om(m) - eGW(b) + eGW(j) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - dem = eGW(j) - Om(m) - eGW(b) - num = rho(a,i,m)*rho(b,j,m) + dem = - Om(m) - eGW(a) + eGW(i) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) + dem = - Om(m) - eGW(a) + eGW(j) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) + + dem = - Om(m) - eGW(b) + eGW(i) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - dem = eGW(j) - Om(m) - eGW(a) - num = rho(b,i,m)*rho(a,j,m) + end do - KB_dyn(ab,ij) = KB_dyn(ab,ij) - num*dem/(dem**2 + eta**2) - - dem = eGW(i) - Om(m) - eGW(a) - num = rho(a,i,m)*rho(b,j,m) - - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - - dem = eGW(i) - Om(m) - eGW(b) - num = rho(b,i,m)*rho(a,j,m) - - KB_dyn(ab,ij) = KB_dyn(ab,ij) - num*dem/(dem**2 + eta**2) - - end do + KB_dyn(ab,ij) = 0.5d0*KB_dyn(ab,ij) end do end do diff --git a/src/GW/GGW_ppBSE_dynamic_kernel_C.f90 b/src/GW/GGW_ppBSE_dynamic_kernel_C.f90 index 75c0050..c61a280 100644 --- a/src/GW/GGW_ppBSE_dynamic_kernel_C.f90 +++ b/src/GW/GGW_ppBSE_dynamic_kernel_C.f90 @@ -52,36 +52,28 @@ subroutine GGW_ppBSE_dynamic_kernel_C(eta,nBas,nC,nO,nV,nR,nS,nVV,lambda,eGW,Om, cd = cd + 1 do m=1,nS + + num = (rho(a,c,m)*rho(b,d,m) - rho(b,c,m)*rho(a,d,m))/2 + dem = OmBSE - Om(m) - eGW(b) - eGW(d) + 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 - dem = OmBSE - (eGW(a) + eGW(c) + Om(m)) -! num = 0.5d0*(rho(a,c,m)*rho(b,d,m) - rho(b,c,m)*rho(a,d,m)) - num = - rho(b,c,m)*rho(a,d,m) + dem = OmBSE - Om(m) - eGW(a) - eGW(c) + 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) = 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 + dem = OmBSE - Om(m) - eGW(a) - eGW(d) + 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 + + dem = OmBSE - Om(m) - eGW(b) - eGW(c) + 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 - dem = OmBSE - (eGW(b) + eGW(d) + Om(m)) -! num = 0.5d0*(rho(a,c,m)*rho(b,d,m) - rho(b,c,m)*rho(a,d,m)) - num = - rho(b,c,m)*rho(a,d,m) + end do - 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 - - dem = OmBSE - (eGW(b) + eGW(c) + Om(m)) - num = rho(a,c,m)*rho(b,d,m) -! num = 0.5d0*(rho(a,c,m)*rho(b,d,m) - rho(b,c,m)*rho(a,d,m)) - - 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 - - dem = OmBSE - (eGW(a) + eGW(d) + Om(m)) - num = rho(a,c,m)*rho(b,d,m) -! num = 0.5d0*(rho(a,c,m)*rho(b,d,m) - rho(b,c,m)*rho(a,d,m)) - - 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 - - end do + KC_dyn(ab,cd) = 0.5d0*KC_dyn(ab,cd) + ZC_dyn(ab,cd) = 0.5d0*ZC_dyn(ab,cd) end do end do diff --git a/src/GW/RGW_ppBSE_dynamic_kernel_B.f90 b/src/GW/RGW_ppBSE_dynamic_kernel_B.f90 index 838b017..87c42da 100644 --- a/src/GW/RGW_ppBSE_dynamic_kernel_B.f90 +++ b/src/GW/RGW_ppBSE_dynamic_kernel_B.f90 @@ -53,30 +53,23 @@ subroutine RGW_ppBSE_dynamic_kernel_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lamb ij = ij + 1 do m=1,nS + num = (rho(a,i,m)*rho(b,j,m) + rho(b,i,m)*rho(a,j,m))/2 - dem = eGW(j) - Om(m) - eGW(b) - num = rho(a,i,m)*rho(b,j,m) + dem = - Om(m) - eGW(b) + eGW(j) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) + dem = - Om(m) - eGW(a) + eGW(i) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - dem = eGW(j) - Om(m) - eGW(a) - num = rho(b,i,m)*rho(a,j,m) + dem = - Om(m) - eGW(a) + eGW(j) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - - dem = eGW(i) - Om(m) - eGW(a) - num = rho(a,i,m)*rho(b,j,m) - - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - - dem = eGW(i) - Om(m) - eGW(b) - num = rho(b,i,m)*rho(a,j,m) - - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) + dem = - Om(m) - eGW(b) + eGW(i) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) end do - KB_dyn(ab,ij) = 2d0*KB_dyn(ab,ij)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(i,j))) + KB_dyn(ab,ij) = KB_dyn(ab,ij)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(i,j))) end do end do @@ -99,31 +92,22 @@ subroutine RGW_ppBSE_dynamic_kernel_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lamb ij = ij + 1 do m=1,nS + num = (rho(a,i,m)*rho(b,j,m) - rho(b,i,m)*rho(a,j,m))/2 - dem = eGW(j) - Om(m) - eGW(b) - num = rho(a,i,m)*rho(b,j,m) + dem = - Om(m) - eGW(b) + eGW(j) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) + dem = - Om(m) - eGW(a) + eGW(i) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - dem = eGW(j) - Om(m) - eGW(a) - num = rho(b,i,m)*rho(a,j,m) + dem = - Om(m) - eGW(a) + eGW(j) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - KB_dyn(ab,ij) = KB_dyn(ab,ij) - num*dem/(dem**2 + eta**2) - - dem = eGW(i) - Om(m) - eGW(a) - num = rho(a,i,m)*rho(b,j,m) - - KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) - - dem = eGW(i) - Om(m) - eGW(b) - num = rho(b,i,m)*rho(a,j,m) - - KB_dyn(ab,ij) = KB_dyn(ab,ij) - num*dem/(dem**2 + eta**2) + dem = - Om(m) - eGW(b) + eGW(i) + KB_dyn(ab,ij) = KB_dyn(ab,ij) + num*dem/(dem**2 + eta**2) end do - KB_dyn(ab,ij) = 2d0*KB_dyn(ab,ij) - end do end do diff --git a/src/GW/RGW_ppBSE_dynamic_kernel_C.f90 b/src/GW/RGW_ppBSE_dynamic_kernel_C.f90 index 04ce120..a90217b 100644 --- a/src/GW/RGW_ppBSE_dynamic_kernel_C.f90 +++ b/src/GW/RGW_ppBSE_dynamic_kernel_C.f90 @@ -55,35 +55,28 @@ subroutine RGW_ppBSE_dynamic_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nS,nVV,lambda,e cd = cd + 1 do m=1,nS + num = (rho(a,c,m)*rho(b,d,m) + rho(b,c,m)*rho(a,d,m))/2 - dem = OmBSE - eGW(c) - Om(m) - eGW(b) - num = rho(a,c,m)*rho(b,d,m) + dem = OmBSE - Om(m) - eGW(b) - eGW(d) + 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) = 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 + dem = OmBSE - Om(m) - eGW(a) - eGW(c) + 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 - dem = OmBSE - eGW(c) - Om(m) - eGW(a) - num = rho(b,c,m)*rho(a,d,m) + dem = OmBSE - Om(m) - eGW(a) - eGW(d) + 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) = 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 - - dem = OmBSE - eGW(d) - Om(m) - eGW(a) - num = rho(a,c,m)*rho(b,d,m) - - 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 - - dem = OmBSE - eGW(d) - Om(m) - eGW(b) - num = rho(b,c,m)*rho(a,d,m) - - 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 + dem = OmBSE - Om(m) - eGW(b) - eGW(c) + 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 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))) + KC_dyn(ab,cd) = KC_dyn(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) + ZC_dyn(ab,cd) = ZC_dyn(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) end do end do @@ -106,35 +99,25 @@ subroutine RGW_ppBSE_dynamic_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nS,nVV,lambda,e cd = cd + 1 do m=1,nS + num = (rho(a,c,m)*rho(b,d,m) - rho(b,c,m)*rho(a,d,m))/2 - dem = OmBSE - eGW(c) - Om(m) - eGW(b) - num = rho(a,c,m)*rho(b,d,m) + dem = OmBSE - Om(m) - eGW(b) - eGW(d) + 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) = 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 + dem = OmBSE - Om(m) - eGW(a) - eGW(c) + 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 - dem = OmBSE - eGW(c) - Om(m) - eGW(a) - num = rho(b,c,m)*rho(a,d,m) + dem = OmBSE - Om(m) - eGW(a) - eGW(d) + 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) = 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 - - dem = OmBSE - eGW(d) - Om(m) - eGW(a) - num = rho(a,c,m)*rho(b,d,m) - - 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 - - dem = OmBSE - eGW(d) - Om(m) - eGW(b) - num = rho(b,c,m)*rho(a,d,m) - - 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 + dem = OmBSE - Om(m) - eGW(b) - eGW(c) + 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 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/RGW_ppBSE_dynamic_kernel_D.f90 b/src/GW/RGW_ppBSE_dynamic_kernel_D.f90 index 6e5e332..e8d4ecf 100644 --- a/src/GW/RGW_ppBSE_dynamic_kernel_D.f90 +++ b/src/GW/RGW_ppBSE_dynamic_kernel_D.f90 @@ -57,7 +57,6 @@ subroutine RGW_ppBSE_dynamic_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,lambda,e do m=1,nS num = (rho(i,k,m)*rho(j,l,m) + rho(j,k,m)*rho(i,l,m))/2 -! dem = - Om(m) dem = - OmBSE - Om(m) + eGW(j) + eGW(l) 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 @@ -101,6 +100,7 @@ subroutine RGW_ppBSE_dynamic_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,lambda,e do m=1,nS num = (rho(i,k,m)*rho(j,l,m) - rho(j,k,m)*rho(i,l,m))/2 + dem = - OmBSE - Om(m) + eGW(j) + eGW(l) 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 @@ -119,9 +119,6 @@ subroutine RGW_ppBSE_dynamic_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,lambda,e end do - KD_dyn(ij,kl) = KD_dyn(ij,kl) - ZD_dyn(ij,kl) = ZD_dyn(ij,kl) - end do end do