From 29294ef5a4c5531773435179c37c1cc8740ece0d Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Mon, 1 Jun 2020 22:01:21 +0200 Subject: [PATCH] BSE almost done --- input/basis | 119 ++++++------ input/methods | 6 +- input/molecule | 5 +- input/molecule.xyz | 5 +- input/options | 2 +- src/QuAcK/BSE2.f90 | 6 +- src/QuAcK/BSE2_A_matrix_dynamic.f90 | 175 ++++++++++++++---- src/QuAcK/BSE2_dynamic_perturbation.f90 | 68 +++---- .../Bethe_Salpeter_dynamic_perturbation.f90 | 2 +- src/QuAcK/G0W0.f90 | 2 +- src/QuAcK/evGW.f90 | 2 +- src/QuAcK/qsGW.f90 | 2 +- 12 files changed, 236 insertions(+), 158 deletions(-) diff --git a/input/basis b/input/basis index bbe0bfe..27669ff 100644 --- a/input/basis +++ b/input/basis @@ -1,71 +1,66 @@ -1 9 -S 8 - 1 9046.0000000 0.0007000 - 2 1357.0000000 0.0053890 - 3 309.3000000 0.0274060 - 4 87.7300000 0.1032070 - 5 28.5600000 0.2787230 - 6 10.2100000 0.4485400 - 7 3.8380000 0.2782380 - 8 0.7466000 0.0154400 -S 8 - 1 9046.0000000 -0.0001530 - 2 1357.0000000 -0.0012080 - 3 309.3000000 -0.0059920 - 4 87.7300000 -0.0245440 - 5 28.5600000 -0.0674590 - 6 10.2100000 -0.1580780 - 7 3.8380000 -0.1218310 - 8 0.7466000 0.5490030 +1 21 +S 10 + 1 54620.0000000 0.0000180 + 2 8180.0000000 0.0001380 + 3 1862.0000000 0.0007230 + 4 527.3000000 0.0030390 + 5 172.0000000 0.0109080 + 6 62.1000000 0.0340350 + 7 24.2100000 0.0911930 + 8 9.9930000 0.1992680 + 9 4.3050000 0.3293550 + 10 1.9210000 0.3404890 +S 10 + 1 54620.0000000 -0.0000030 + 2 8180.0000000 -0.0000250 + 3 1862.0000000 -0.0001310 + 4 527.3000000 -0.0005580 + 5 172.0000000 -0.0019880 + 6 62.1000000 -0.0063700 + 7 24.2100000 -0.0172170 + 8 9.9930000 -0.0408580 + 9 4.3050000 -0.0742370 + 10 1.9210000 -0.1192340 S 1 - 1 0.2248000 1.0000000 + 1 0.8663000 1.0000000 S 1 - 1 0.0612400 1.0000000 -P 3 - 1 13.5500000 0.0399190 - 2 2.9170000 0.2171690 - 3 0.7973000 0.5103190 -P 1 - 1 0.2185000 1.0000000 -P 1 - 1 0.0561100 1.0000000 -D 1 - 1 0.8170000 1.0000000 -D 1 - 1 0.2300000 1.0000000 -2 9 -S 8 - 1 9046.0000000 0.0007000 - 2 1357.0000000 0.0053890 - 3 309.3000000 0.0274060 - 4 87.7300000 0.1032070 - 5 28.5600000 0.2787230 - 6 10.2100000 0.4485400 - 7 3.8380000 0.2782380 - 8 0.7466000 0.0154400 -S 8 - 1 9046.0000000 -0.0001530 - 2 1357.0000000 -0.0012080 - 3 309.3000000 -0.0059920 - 4 87.7300000 -0.0245440 - 5 28.5600000 -0.0674590 - 6 10.2100000 -0.1580780 - 7 3.8380000 -0.1218310 - 8 0.7466000 0.5490030 + 1 0.2475000 1.0000000 S 1 - 1 0.2248000 1.0000000 + 1 0.1009000 1.0000000 S 1 - 1 0.0612400 1.0000000 -P 3 - 1 13.5500000 0.0399190 - 2 2.9170000 0.2171690 - 3 0.7973000 0.5103190 + 1 0.0412900 1.0000000 +P 4 + 1 43.7500000 0.0006330 + 2 10.3300000 0.0048080 + 3 3.2260000 0.0205270 + 4 1.1270000 0.0678160 P 1 - 1 0.2185000 1.0000000 + 1 0.4334000 1.0000000 P 1 - 1 0.0561100 1.0000000 + 1 0.1808000 1.0000000 +P 1 + 1 0.0782700 1.0000000 +P 1 + 1 0.0337200 1.0000000 D 1 - 1 0.8170000 1.0000000 + 1 1.6350000 1.0000000 D 1 - 1 0.2300000 1.0000000 + 1 0.7410000 1.0000000 +D 1 + 1 0.3350000 1.0000000 +D 1 + 1 0.1519000 1.0000000 +F 1 + 1 0.6860000 1.0000000 +F 1 + 1 0.4010000 1.0000000 +F 1 + 1 0.2350000 1.0000000 +G 1 + 1 0.6030000 1.0000000 +G 1 + 1 0.3240000 1.0000000 +H 1 + 1 0.5100000 1.0000000 + diff --git a/input/methods b/input/methods index 3704d04..296048d 100644 --- a/input/methods +++ b/input/methods @@ -7,13 +7,13 @@ # drCCD rCCD lCCD pCCD F F F F # CIS CID CISD - F F F + T F F # RPA RPAx ppRPA F T F # G0F2 evGF2 G0F3 evGF3 - F F F F + T F F F # G0W0 evGW qsGW - T F F + F F F # G0T0 evGT qsGT F F F # MCMP2 diff --git a/input/molecule b/input/molecule index 76ebcdf..6a6f6d1 100644 --- a/input/molecule +++ b/input/molecule @@ -1,5 +1,4 @@ # nAt nEla nElb nCore nRyd - 2 7 7 0 0 + 1 2 2 0 0 # Znuc x y z - N 0. 0. -1.04008632 - N 0. 0. +1.04008632 + Be 0.0 0.0 0.0 diff --git a/input/molecule.xyz b/input/molecule.xyz index e1773f0..8023e37 100644 --- a/input/molecule.xyz +++ b/input/molecule.xyz @@ -1,4 +1,3 @@ - 2 + 1 - N 0.0000000000 0.0000000000 -0.5503900175 - N 0.0000000000 0.0000000000 0.5503900175 + Be 0.0000000000 0.0000000000 0.0000000000 diff --git a/input/options b/input/options index c88bdf9..cd0edbf 100644 --- a/input/options +++ b/input/options @@ -9,7 +9,7 @@ # GF: maxSCF thresh DIIS n_diis lin renorm 256 0.00001 T 5 T 3 # GW/GT: maxSCF thresh DIIS n_diis COHSEX SOSEX BSE TDA G0W GW0 lin eta - 256 0.00001 T 10 F F T F F F T 0.00367493 + 256 0.00001 T 10 F F T T F F T 0.0 # ACFDT: AC Kx XBS F F T # MCMP2: nMC nEq nWalk dt nPrint iSeed doDrift diff --git a/src/QuAcK/BSE2.f90 b/src/QuAcK/BSE2.f90 index 9ea3bd9..7d51e37 100644 --- a/src/QuAcK/BSE2.f90 +++ b/src/QuAcK/BSE2.f90 @@ -61,7 +61,8 @@ subroutine BSE2(TDA,singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS,ER ! call Bethe_Salpeter_2_dynamic_perturbation_iterative(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF(:),eGF(:), & ! OmBSE(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) else - call BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF(:),eGF(:),OmBSE(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) + call BSE2_dynamic_perturbation(singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS, & + ERI(:,:,:,:),eHF(:),eGF(:),OmBSE(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) end if end if @@ -88,7 +89,8 @@ subroutine BSE2(TDA,singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS,ER ! call Bethe_Salpeter_2_dynamic_perturbation_iterative(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF(:),eGF(:), & ! OmBSE(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) else - call BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF(:),eGF(:),OmBSE(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) + call BSE2_dynamic_perturbation(singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS, & + ERI(:,:,:,:),eHF(:),eGF(:),OmBSE(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) end if end if diff --git a/src/QuAcK/BSE2_A_matrix_dynamic.f90 b/src/QuAcK/BSE2_A_matrix_dynamic.f90 index 13bbcfe..74dec79 100644 --- a/src/QuAcK/BSE2_A_matrix_dynamic.f90 +++ b/src/QuAcK/BSE2_A_matrix_dynamic.f90 @@ -1,76 +1,171 @@ -subroutine BSE2_A_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,OmRPA,OmBSE,rho,A_dyn) +subroutine BSE2_A_matrix_dynamic(singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS,lambda, & + ERI,eHF,eGF,OmBSE,A_dyn,ZA_dyn) -! Compute the dynamic part of the Bethe-Salpeter equation matrices +! Compute the resonant part of the dynamic BSE2 matrix implicit none include 'parameters.h' ! Input variables + logical,intent(in) :: singlet_manifold + logical,intent(in) :: triplet_manifold integer,intent(in) :: nBas,nC,nO,nV,nR,nS double precision,intent(in) :: eta double precision,intent(in) :: lambda - double precision,intent(in) :: eGW(nBas) - double precision,intent(in) :: OmRPA(nS) + double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas) + double precision,intent(in) :: eHF(nBas) + double precision,intent(in) :: eGF(nBas) double precision,intent(in) :: OmBSE - double precision,intent(in) :: rho(nBas,nBas,nS) ! Local variables - integer :: maxS - double precision :: chi - double precision :: eps - integer :: i,j,a,b,ia,jb,kc + double precision :: dem,num + integer :: i,j,k,l + integer :: a,b,c,d + integer :: ia,jb ! Output variables double precision,intent(out) :: A_dyn(nS,nS) + double precision,intent(out) :: ZA_dyn(nS,nS) ! Initialization - A_dyn(:,:) = 0d0 + A_dyn(:,:) = 0d0 + ZA_dyn(:,:) = 0d0 -! Number of poles taken into account +! Second-order correlation kernel for the block A of the singlet manifold - maxS = nS + if(singlet_manifold) then -! Build dynamic A matrix - - ia = 0 - do i=nC+1,nO - do a=nO+1,nBas-nR - ia = ia + 1 - jb = 0 - do j=nC+1,nO - do b=nO+1,nBas-nR - jb = jb + 1 + ia = 0 + do i=nC+1,nO + do a=nO+1,nBas-nR + ia = ia + 1 - chi = 0d0 - do kc=1,maxS + jb = 0 + do j=nC+1,nO + do b=nO+1,nBas-nR + jb = jb + 1 + + do k=nC+1,nO + do c=nO+1,nBas-nR + + dem = OmBSE - eGF(a) + eGF(k) - eGF(c) + eGF(j) + num = 2d0*ERI(j,k,i,c)*ERI(a,c,b,k) - ERI(j,k,i,c)*ERI(a,c,k,b) & + - ERI(j,k,c,i)*ERI(a,c,b,k) + 2d0*ERI(j,k,c,i)*ERI(a,c,k,b) - eps = OmRPA(kc)**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*OmRPA(kc)/eps + A_dyn(ia,jb) = A_dyn(ia,jb) - num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) + num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + dem = OmBSE + eGF(i) - eGF(c) + eGF(k) - eGF(b) + num = 2d0*ERI(j,c,i,k)*ERI(a,k,b,c) - ERI(j,c,i,k)*ERI(a,k,c,b) & + - ERI(j,c,k,i)*ERI(a,k,b,c) + 2d0*ERI(j,c,k,i)*ERI(a,k,c,b) - enddo + A_dyn(ia,jb) = A_dyn(ia,jb) - num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) + num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + end do + end do - A_dyn(ia,jb) = A_dyn(ia,jb) - 4d0*lambda*chi + do c=nO+1,nBas-nR + do d=nO+1,nBas-nR + + dem = OmBSE + eGF(i) + eGF(j) - eGF(c) - eGF(d) + num = 2d0*ERI(a,j,c,d)*ERI(c,d,i,b) - ERI(a,j,c,d)*ERI(c,d,b,i) & + - ERI(a,j,d,c)*ERI(c,d,i,b) + 2d0*ERI(a,j,d,c)*ERI(c,d,b,i) - chi = 0d0 - do kc=1,maxS + A_dyn(ia,jb) = A_dyn(ia,jb) + 0.5d0*num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) - 0.5d0*num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + end do + end do - eps = (OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*(OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))/eps + do k=nC+1,nO + do l=nC+1,nO - eps = (OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*(OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))/eps + dem = OmBSE - eGF(a) - eGF(b) + eGF(k) + eGF(l) + num = 2d0*ERI(a,j,k,l)*ERI(k,l,i,b) - ERI(a,j,k,l)*ERI(k,l,b,i) & + - ERI(a,j,l,k)*ERI(k,l,i,b) + 2d0*ERI(a,j,l,k)*ERI(k,l,b,i) - enddo + A_dyn(ia,jb) = A_dyn(ia,jb) + 0.5d0*num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) - 0.5d0*num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + end do + end do + + end do + end do - A_dyn(ia,jb) = A_dyn(ia,jb) - 2d0*lambda*chi + end do + end do + + end if + +! Second-order correlation kernel for the block A of the triplet manifold + + if(triplet_manifold) then + + ia = 0 + do i=nC+1,nO + do a=nO+1,nBas-nR + ia = ia + 1 + + jb = 0 + do j=nC+1,nO + do b=nO+1,nBas-nR + jb = jb + 1 + + do k=nC+1,nO + do c=nO+1,nBas-nR + + dem = OmBSE - eGF(a) + eGF(k) - eGF(c) + eGF(j) + num = 2d0*ERI(j,k,i,c)*ERI(a,c,b,k) - ERI(j,k,i,c)*ERI(a,c,k,b) - ERI(j,k,c,i)*ERI(a,c,b,k) + + A_dyn(ia,jb) = A_dyn(ia,jb) - num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) + num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + dem = OmBSE + eGF(i) - eGF(c) + eGF(k) - eGF(b) + num = 2d0*ERI(j,c,i,k)*ERI(a,k,b,c) - ERI(j,c,i,k)*ERI(a,k,c,b) - ERI(j,c,k,i)*ERI(a,k,b,c) + + A_dyn(ia,jb) = A_dyn(ia,jb) - num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) + num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + end do + end do + + do c=nO+1,nBas-nR + do d=nO+1,nBas-nR + + dem = OmBSE + eGF(i) + eGF(j) - eGF(c) - eGF(d) + num = ERI(a,j,c,d)*ERI(c,d,b,i) + ERI(a,j,d,c)*ERI(c,d,i,b) + + A_dyn(ia,jb) = A_dyn(ia,jb) - 0.5d0*num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) + 0.5d0*num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + end do + end do + + do k=nC+1,nO + do l=nC+1,nO + + dem = OmBSE - eGF(a) - eGF(b) + eGF(k) + eGF(l) + num = ERI(a,j,k,l)*ERI(k,l,b,i) + ERI(a,j,l,k)*ERI(k,l,i,b) + + A_dyn(ia,jb) = A_dyn(ia,jb) - 0.5d0*num*dem/(dem**2 + eta**2) + ZA_dyn(ia,jb) = ZA_dyn(ia,jb) + 0.5d0*num*(dem**2 - eta**2)/(dem**2 + eta**2)**2 + + end do + end do + + end do + end do + + end do + end do + + end if - enddo - enddo - enddo - enddo end subroutine BSE2_A_matrix_dynamic diff --git a/src/QuAcK/BSE2_dynamic_perturbation.f90 b/src/QuAcK/BSE2_dynamic_perturbation.f90 index c332a47..9eef3bf 100644 --- a/src/QuAcK/BSE2_dynamic_perturbation.f90 +++ b/src/QuAcK/BSE2_dynamic_perturbation.f90 @@ -1,4 +1,4 @@ -subroutine BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF,eGF,OmBSE,XpY,XmY) +subroutine BSE2_dynamic_perturbation(singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS,ERI,eHF,eGF,OmBSE,XpY,XmY) ! Compute dynamical effects via perturbation theory for BSE @@ -7,7 +7,8 @@ subroutine BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF,eGF,OmBSE,X ! Input variables - logical,intent(in) :: TDA + logical,intent(in) :: singlet_manifold + logical,intent(in) :: triplet_manifold double precision,intent(in) :: eta integer,intent(in) :: nBas integer,intent(in) :: nC @@ -16,6 +17,7 @@ subroutine BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF,eGF,OmBSE,X integer,intent(in) :: nR integer,intent(in) :: nS + double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas) double precision,intent(in) :: eHF(nBas) double precision,intent(in) :: eGF(nBas) double precision,intent(in) :: OmBSE(nS) @@ -24,7 +26,7 @@ subroutine BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF,eGF,OmBSE,X ! Local variables - logical :: dTDA = .false. + logical :: dTDA = .true. integer :: ia integer,parameter :: maxS = 10 double precision :: gapGF @@ -34,21 +36,17 @@ subroutine BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF,eGF,OmBSE,X double precision,allocatable :: X(:) double precision,allocatable :: Y(:) - double precision,allocatable :: Ap_dyn(:,:) - double precision,allocatable :: Am_dyn(:,:) - double precision,allocatable :: ZAp_dyn(:,:) - double precision,allocatable :: ZAm_dyn(:,:) + double precision,allocatable :: A_dyn(:,:) + double precision,allocatable :: ZA_dyn(:,:) - double precision,allocatable :: Bp_dyn(:,:) - double precision,allocatable :: Bm_dyn(:,:) - double precision,allocatable :: ZBp_dyn(:,:) - double precision,allocatable :: ZBm_dyn(:,:) + double precision,allocatable :: B_dyn(:,:) + double precision,allocatable :: ZB_dyn(:,:) ! Memory allocation - allocate(OmDyn(nS),ZDyn(nS),X(nS),Y(nS),Ap_dyn(nS,nS),ZAp_dyn(nS,nS)) + allocate(OmDyn(nS),ZDyn(nS),X(nS),Y(nS),A_dyn(nS,nS),ZA_dyn(nS,nS)) - if(.not.dTDA) allocate(Am_dyn(nS,nS),ZAm_dyn(nS,nS),Bp_dyn(nS,nS),Bm_dyn(nS,nS),ZBp_dyn(nS,nS),ZBm_dyn(nS,nS)) + if(.not.dTDA) allocate(B_dyn(nS,nS),ZB_dyn(nS,nS)) gapGF = eGF(nO+1) - eGF(nO) @@ -63,42 +61,32 @@ subroutine BSE2_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eHF,eGF,OmBSE,X X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:)) Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:)) - ! First-order correction + ! Resonant part of the BSE correction for dynamical TDA + + call BSE2_A_matrix_dynamic(singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS,1d0, & + ERI(:,:,:,:),eHF(:),eGF(:),OmBSE(ia),A_dyn(:,:),ZA_dyn(:,:)) if(dTDA) then - ! Resonant part of the BSE correction for dynamical TDA - - call BSE2_A_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,1d0,eHF(:),eGF(:),OmBSE(ia),Ap_dyn(:,:)) - - ! Renormalization factor of the resonant parts for dynamical TDA - - call BSE2_ZA_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,1d0,eHF(:),eGF(:),OmBSE(ia),ZAp_dyn(:,:)) - - ZDyn(ia) = dot_product(X(:),matmul(ZAp_dyn(:,:),X(:))) - OmDyn(ia) = dot_product(X(:),matmul(Ap_dyn(:,:),X(:))) + ZDyn(ia) = dot_product(X(:),matmul(ZA_dyn(:,:),X(:))) + OmDyn(ia) = dot_product(X(:),matmul(A_dyn(:,:),X(:))) else - ! Resonant and anti-resonant part of the BSE correction + ! Anti-resonant part of the BSE correction -! call Bethe_Salpeter_AB_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,1d0,eHF(:),eGF(:),OmBSE(ia), & -! Ap_dyn(:,:),Am_dyn(:,:),Bp_dyn(:,:),Bm_dyn(:,:)) + call BSE2_B_matrix_dynamic(singlet_manifold,triplet_manifold,eta,nBas,nC,nO,nV,nR,nS,1d0, & + ERI(:,:,:,:),eHF(:),eGF(:),OmBSE(ia),B_dyn(:,:),ZB_dyn(:,:)) - ! Renormalization factor of the resonant and anti-resonant parts + ZDyn(ia) = dot_product(X(:),matmul(ZA_dyn(:,:),X(:))) & + - dot_product(Y(:),matmul(ZA_dyn(:,:),Y(:))) & + + dot_product(X(:),matmul(ZB_dyn(:,:),Y(:))) & + - dot_product(Y(:),matmul(ZB_dyn(:,:),X(:))) -! call Bethe_Salpeter_ZAB_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,1d0,eHF(:),eGF(:),OmBSE(ia), & -! ZAp_dyn(:,:),ZAm_dyn(:,:),ZBp_dyn(:,:),ZBm_dyn(:,:)) - - ZDyn(ia) = dot_product(X(:),matmul(ZAp_dyn(:,:),X(:))) & - - dot_product(Y(:),matmul(ZAm_dyn(:,:),Y(:))) & - + dot_product(X(:),matmul(ZBp_dyn(:,:),Y(:))) & - - dot_product(Y(:),matmul(ZBm_dyn(:,:),X(:))) - - OmDyn(ia) = dot_product(X(:),matmul(Ap_dyn(:,:),X(:))) & - - dot_product(Y(:),matmul(Am_dyn(:,:),Y(:))) & - + dot_product(X(:),matmul(Bp_dyn(:,:),Y(:))) & - - dot_product(Y(:),matmul(Bm_dyn(:,:),X(:))) + OmDyn(ia) = dot_product(X(:),matmul(A_dyn(:,:),X(:))) & + - dot_product(Y(:),matmul(A_dyn(:,:),Y(:))) & + + dot_product(X(:),matmul(B_dyn(:,:),Y(:))) & + - dot_product(Y(:),matmul(B_dyn(:,:),X(:))) end if diff --git a/src/QuAcK/Bethe_Salpeter_dynamic_perturbation.f90 b/src/QuAcK/Bethe_Salpeter_dynamic_perturbation.f90 index cf480a9..ee5cd3f 100644 --- a/src/QuAcK/Bethe_Salpeter_dynamic_perturbation.f90 +++ b/src/QuAcK/Bethe_Salpeter_dynamic_perturbation.f90 @@ -25,7 +25,7 @@ subroutine Bethe_Salpeter_dynamic_perturbation(TDA,eta,nBas,nC,nO,nV,nR,nS,eGW,O ! Local variables - logical :: dTDA = .false. + logical :: dTDA = .true. integer :: ia integer,parameter :: maxS = 10 double precision :: gapGW diff --git a/src/QuAcK/G0W0.f90 b/src/QuAcK/G0W0.f90 index 8bf40b4..d4d468a 100644 --- a/src/QuAcK/G0W0.f90 +++ b/src/QuAcK/G0W0.f90 @@ -83,7 +83,7 @@ subroutine G0W0(doACFDT,exchange_kernel,doXBS,COHSEX,SOSEX,BSE,TDA, & ! Compute linear response - call linear_response(ispin,.true.,TDA,.false.,eta,nBas,nC,nO,nV,nR,nS,1d0,eHF,ERI, & + call linear_response(ispin,.true.,.false.,.false.,eta,nBas,nC,nO,nV,nR,nS,1d0,eHF,ERI, & rho(:,:,:,ispin),EcRPA(ispin),Omega(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) ! Compute correlation part of the self-energy diff --git a/src/QuAcK/evGW.f90 b/src/QuAcK/evGW.f90 index 3db7bd2..007bc4a 100644 --- a/src/QuAcK/evGW.f90 +++ b/src/QuAcK/evGW.f90 @@ -112,7 +112,7 @@ subroutine evGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,SOSE if(.not. GW0 .or. nSCF == 0) then - call linear_response(ispin,.true.,TDA,.false.,eta,nBas,nC,nO,nV,nR,nS,1d0,eGW,ERI, & + call linear_response(ispin,.true.,.false.,.false.,eta,nBas,nC,nO,nV,nR,nS,1d0,eGW,ERI, & rho(:,:,:,ispin),EcRPA(ispin),Omega(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) endif diff --git a/src/QuAcK/qsGW.f90 b/src/QuAcK/qsGW.f90 index 07c54dd..503d03d 100644 --- a/src/QuAcK/qsGW.f90 +++ b/src/QuAcK/qsGW.f90 @@ -141,7 +141,7 @@ subroutine qsGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, if(.not. GW0 .or. nSCF == 0) then - call linear_response(ispin,.true.,TDA,.false.,eta,nBas,nC,nO,nV,nR,nS,1d0,eGW,ERI_MO_basis, & + call linear_response(ispin,.true.,.false.,.false.,eta,nBas,nC,nO,nV,nR,nS,1d0,eGW,ERI_MO_basis, & rho(:,:,:,ispin),EcRPA(ispin),Omega(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) endif