2020-09-24 11:56:06 +02:00
|
|
|
subroutine Bethe_Salpeter_AB_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,OmRPA,rhO_RPA,OmBSE,Ap,Am,Bp,Bm)
|
2020-06-01 11:35:17 +02:00
|
|
|
|
|
|
|
! Compute the dynamic part of the Bethe-Salpeter equation matrices
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
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)
|
2020-09-24 11:56:06 +02:00
|
|
|
double precision,intent(in) :: rho_RPA(nBas,nBas,nS)
|
2020-06-01 11:35:17 +02:00
|
|
|
double precision,intent(in) :: OmBSE
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: maxS
|
2020-06-11 15:36:16 +02:00
|
|
|
double precision :: chi_A,chi_B
|
|
|
|
double precision :: chi_Ap,chi_Bp,eps_Ap,eps_Bp
|
|
|
|
double precision :: chi_Am,chi_Bm,eps_Am,eps_Bm
|
2020-06-01 11:35:17 +02:00
|
|
|
integer :: i,j,a,b,ia,jb,kc
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
double precision,intent(out) :: Ap(nS,nS)
|
|
|
|
double precision,intent(out) :: Am(nS,nS)
|
|
|
|
|
|
|
|
double precision,intent(out) :: Bp(nS,nS)
|
|
|
|
double precision,intent(out) :: Bm(nS,nS)
|
2020-06-01 11:35:17 +02:00
|
|
|
|
|
|
|
! Initialization
|
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
Ap(:,:) = 0d0
|
|
|
|
Am(:,:) = 0d0
|
|
|
|
|
|
|
|
Bp(:,:) = 0d0
|
|
|
|
Bm(:,:) = 0d0
|
2020-06-01 11:35:17 +02:00
|
|
|
|
|
|
|
! Number of poles taken into account
|
|
|
|
|
|
|
|
maxS = nS
|
|
|
|
|
|
|
|
! 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
|
|
|
|
|
|
|
|
chi_A = 0d0
|
|
|
|
chi_B = 0d0
|
|
|
|
|
|
|
|
do kc=1,maxS
|
|
|
|
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_A = chi_A + rho_RPA(i,j,kc)*rho_RPA(a,b,kc)*OmRPA(kc)/(OmRPA(kc)**2 + eta**2)
|
|
|
|
chi_B = chi_B + rho_RPA(i,b,kc)*rho_RPA(a,j,kc)*OmRPA(kc)/(OmRPA(kc)**2 + eta**2)
|
2020-06-01 11:35:17 +02:00
|
|
|
|
|
|
|
enddo
|
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
Ap(ia,jb) = Ap(ia,jb) - 4d0*lambda*chi_A
|
|
|
|
Am(ia,jb) = Am(ia,jb) - 4d0*lambda*chi_A
|
2020-06-01 11:35:17 +02:00
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
Bp(ia,jb) = Bp(ia,jb) - 4d0*lambda*chi_B
|
|
|
|
Bm(ia,jb) = Bm(ia,jb) - 4d0*lambda*chi_B
|
|
|
|
|
|
|
|
chi_Ap = 0d0
|
|
|
|
chi_Am = 0d0
|
|
|
|
|
|
|
|
chi_Bp = 0d0
|
|
|
|
chi_Bm = 0d0
|
2020-06-01 11:35:17 +02:00
|
|
|
|
|
|
|
do kc=1,maxS
|
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
eps_Ap = + OmBSE - OmRPA(kc) - (eGW(a) - eGW(j))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Ap = chi_Ap + rho_RPA(i,j,kc)*rho_RPA(a,b,kc)*eps_Ap/(eps_Ap**2 + eta**2)
|
2020-06-11 15:36:16 +02:00
|
|
|
|
|
|
|
eps_Ap = + OmBSE - OmRPA(kc) - (eGW(b) - eGW(i))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Ap = chi_Ap + rho_RPA(i,j,kc)*rho_RPA(a,b,kc)*eps_Ap/(eps_Ap**2 + eta**2)
|
2020-06-11 15:36:16 +02:00
|
|
|
|
|
|
|
eps_Am = - OmBSE - OmRPA(kc) - (eGW(a) - eGW(j))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Am = chi_Am + rho_RPA(i,j,kc)*rho_RPA(a,b,kc)*eps_Am/(eps_Am**2 + eta**2)
|
2020-06-11 15:36:16 +02:00
|
|
|
|
|
|
|
eps_Am = - OmBSE - OmRPA(kc) - (eGW(b) - eGW(i))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Am = chi_Am + rho_RPA(i,j,kc)*rho_RPA(a,b,kc)*eps_Am/(eps_Am**2 + eta**2)
|
2020-06-11 15:36:16 +02:00
|
|
|
|
|
|
|
eps_Bp = + OmBSE - OmRPA(kc) - (eGW(a) - eGW(b))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Bp = chi_Bp + rho_RPA(i,b,kc)*rho_RPA(a,j,kc)*eps_Bp/(eps_Bp**2 + eta**2)
|
2020-06-01 11:35:17 +02:00
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
eps_Bp = + OmBSE - OmRPA(kc) - (eGW(j) - eGW(i))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Bp = chi_Bp + rho_RPA(i,b,kc)*rho_RPA(a,j,kc)*eps_Bp/(eps_Bp**2 + eta**2)
|
2020-06-01 11:35:17 +02:00
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
eps_Bm = - OmBSE - OmRPA(kc) - (eGW(a) - eGW(b))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Bm = chi_Bm + rho_RPA(i,b,kc)*rho_RPA(a,j,kc)*eps_Bm/(eps_Bm**2 + eta**2)
|
2020-06-01 11:35:17 +02:00
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
eps_Bm = - OmBSE - OmRPA(kc) - (eGW(j) - eGW(i))
|
2020-09-24 11:56:06 +02:00
|
|
|
chi_Bm = chi_Bm + rho_RPA(i,b,kc)*rho_RPA(a,j,kc)*eps_Bm/(eps_Bm**2 + eta**2)
|
2020-06-01 11:35:17 +02:00
|
|
|
|
|
|
|
enddo
|
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
Ap(ia,jb) = Ap(ia,jb) - 2d0*lambda*chi_Ap
|
|
|
|
Am(ia,jb) = Am(ia,jb) - 2d0*lambda*chi_Am
|
2020-06-01 11:35:17 +02:00
|
|
|
|
2020-06-11 15:36:16 +02:00
|
|
|
Bp(ia,jb) = Bp(ia,jb) - 2d0*lambda*chi_Bp
|
|
|
|
Bm(ia,jb) = Bm(ia,jb) - 2d0*lambda*chi_Bm
|
2020-06-01 11:35:17 +02:00
|
|
|
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
end subroutine Bethe_Salpeter_AB_matrix_dynamic
|