10
1
mirror of https://github.com/pfloos/quack synced 2024-12-25 13:53:41 +01:00
QuAcK/src/GT/Bethe_Salpeter_Tmatrix_dynamic_perturbation.f90

136 lines
4.8 KiB
Fortran
Raw Normal View History

2022-01-17 08:02:11 +01:00
subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,nOOt,nVVt, &
Omega1s,Omega2s,Omega1t,Omega2t,rho1s,rho2s,rho1t,rho2t,eT,eGT, &
2022-01-11 15:23:43 +01:00
dipole_int,OmBSE,XpY,XmY,TAs,TBs,TAt,TBt)
2021-10-17 08:11:17 +02:00
! Compute dynamical effects via perturbation theory for BSE@GT
implicit none
include 'parameters.h'
! Input variables
2022-01-17 08:02:11 +01:00
integer,intent(in) :: ispin
2021-10-17 08:11:17 +02:00
logical,intent(in) :: dTDA
double precision,intent(in) :: eta
integer,intent(in) :: nBas
integer,intent(in) :: nC
integer,intent(in) :: nO
integer,intent(in) :: nV
integer,intent(in) :: nR
integer,intent(in) :: nS
2022-01-11 15:23:43 +01:00
integer,intent(in) :: nOOs
integer,intent(in) :: nVVs
integer,intent(in) :: nOOt
integer,intent(in) :: nVVt
2021-10-17 08:11:17 +02:00
double precision,intent(in) :: eT(nBas)
double precision,intent(in) :: eGT(nBas)
double precision,intent(in) :: dipole_int(nBas,nBas,ncart)
2022-01-17 08:02:11 +01:00
double precision,intent(in) :: OmBSE(nS)
double precision,intent(in) :: XpY(nS,nS)
double precision,intent(in) :: XmY(nS,nS)
2022-01-11 15:23:43 +01:00
double precision,intent(in) :: Omega1s(nVVs)
double precision,intent(in) :: Omega2s(nOOs)
double precision,intent(in) :: rho1s(nBas,nBas,nVVs)
double precision,intent(in) :: rho2s(nBas,nBas,nOOs)
double precision,intent(in) :: Omega1t(nVVt)
double precision,intent(in) :: Omega2t(nOOt)
double precision,intent(in) :: rho1t(nBas,nBas,nVVt)
double precision,intent(in) :: rho2t(nBas,nBas,nOOt)
double precision,intent(in) :: TAs(nS,nS)
double precision,intent(in) :: TBs(nS,nS)
double precision,intent(in) :: TAt(nS,nS)
double precision,intent(in) :: TBt(nS,nS)
2021-10-17 08:11:17 +02:00
! Local variables
integer :: ia
2022-01-11 15:23:43 +01:00
integer :: maxS = 10
2021-10-17 08:11:17 +02:00
double precision :: gapGT
2022-01-17 08:02:11 +01:00
double precision,allocatable :: OmDyn(:)
double precision,allocatable :: ZDyn(:)
2021-10-17 08:11:17 +02:00
double precision,allocatable :: X(:)
double precision,allocatable :: Y(:)
2022-01-11 15:23:43 +01:00
double precision,allocatable :: dTAs(:,:)
double precision,allocatable :: ZAs(:,:)
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
double precision,allocatable :: dTAt(:,:)
double precision,allocatable :: ZAt(:,:)
2021-10-17 08:11:17 +02:00
! Memory allocation
2022-01-11 15:23:43 +01:00
maxS = min(nS,maxS)
2022-01-17 08:02:11 +01:00
allocate(OmDyn(maxS),ZDyn(maxS),X(nS),Y(nS),dTAs(nS,nS),ZAs(nS,nS),dTAt(nS,nS),ZAt(nS,nS))
2021-10-17 08:11:17 +02:00
if(dTDA) then
write(*,*)
write(*,*) '*** dynamical TDA activated ***'
write(*,*)
2022-01-11 15:23:43 +01:00
else
print*, ' Beyond-TDA dynamical correction for BSE@GT NYI'
return
2021-10-17 08:11:17 +02:00
end if
2022-01-17 08:02:11 +01:00
OmDyn(:) = 0d0
ZDyn(:) = 0d0
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
do ia=1,maxS
2021-10-17 08:11:17 +02:00
2022-01-17 08:02:11 +01:00
! Compute dynamical T-matrix for alpha-beta block
2021-10-17 08:11:17 +02:00
2022-01-17 08:02:11 +01:00
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,1d0,eGT,Omega1s,Omega2s,rho1s,rho2s,OmBSE(ia),dTAs,ZAs)
2022-01-11 15:23:43 +01:00
2022-01-17 08:02:11 +01:00
! Compute dynamical T-matrix for alpha-beta block
2021-10-17 08:11:17 +02:00
2022-01-17 08:02:11 +01:00
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,1d0,eGT,Omega1t,Omega2t,rho1t,rho2t,OmBSE(ia),dTAt,ZAt)
2022-01-11 15:23:43 +01:00
2022-01-17 08:02:11 +01:00
X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
! First-order correction
if(ispin == 1) then
2022-01-24 10:29:27 +01:00
ZDyn(ia) = - dot_product(X,matmul(ZAt+ZAs,X))
OmDyn(ia) = - dot_product(X,matmul(dTAt+dTAs,X)) + dot_product(X,matmul(TAt+TAs,X))
2022-01-17 08:02:11 +01:00
end if
if(ispin == 2) then
2022-01-24 10:29:27 +01:00
ZDyn(ia) = - dot_product(X,matmul(ZAt-ZAs,X))
OmDyn(ia) = - dot_product(X,matmul(dTAt-dTAs,X)) + dot_product(X,matmul(TAt-TAs,X))
2022-01-17 08:02:11 +01:00
end if
ZDyn(ia) = 1d0/(1d0 - ZDyn(ia))
OmDyn(ia) = ZDyn(ia)*OmDyn(ia)
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
end do
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
!--------------!
! Dump results !
!--------------!
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
gapGT = eGT(nO+1) - eGT(nO)
2021-10-17 08:11:17 +02:00
2022-01-17 08:02:11 +01:00
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,*) ' First-order dynamical correction to static Bethe-Salpeter excitation energies '
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,'(A57,F10.6,A3)') ' BSE neutral excitation must be lower than the GT gap = ',gapGT*HaToeV,' eV'
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,'(2X,A5,1X,A20,1X,A20,1X,A20,1X,A20)') '#','Static (eV)','Dynamic (eV)','Correction (eV)','Renorm. (eV)'
write(*,*) '---------------------------------------------------------------------------------------------------'
2022-01-11 15:23:43 +01:00
2022-01-17 08:02:11 +01:00
do ia=1,maxS
write(*,'(2X,I5,5X,F15.6,5X,F15.6,5X,F15.6,5X,F15.6)') &
ia,OmBSE(ia)*HaToeV,(OmBSE(ia)+OmDyn(ia))*HaToeV,OmDyn(ia)*HaToeV,ZDyn(ia)
end do
2022-01-11 15:23:43 +01:00
2022-01-17 08:02:11 +01:00
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,*)
2021-10-17 08:11:17 +02:00
end subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation