4
1
mirror of https://github.com/pfloos/quack synced 2024-11-09 07:33:55 +01:00
quack/src/GT/Bethe_Salpeter_Tmatrix_dynamic_perturbation.f90

134 lines
4.7 KiB
Fortran
Raw Normal View History

2022-09-09 21:48:50 +02:00
subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOab,nVVab,nOOaa,nVVaa, &
Om1ab,Om2ab,Om1aa,Om2aa,rho1ab,rho2ab,rho1aa,rho2aa,eT,eGT, &
dipole_int,OmBSE,XpY,XmY,TAab,TAaa)
2022-01-11 15:23:43 +01:00
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-09-09 21:48:50 +02:00
integer,intent(in) :: nOOab
integer,intent(in) :: nVVab
integer,intent(in) :: nOOaa
integer,intent(in) :: nVVaa
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
2022-09-09 21:48:50 +02:00
double precision,intent(in) :: Om1ab(nVVab)
double precision,intent(in) :: Om2ab(nOOab)
double precision,intent(in) :: rho1ab(nBas,nBas,nVVab)
double precision,intent(in) :: rho2ab(nBas,nBas,nOOab)
double precision,intent(in) :: Om1aa(nVVaa)
double precision,intent(in) :: Om2aa(nOOaa)
double precision,intent(in) :: rho1aa(nBas,nBas,nVVaa)
double precision,intent(in) :: rho2aa(nBas,nBas,nOOaa)
2022-01-11 15:23:43 +01:00
2022-09-09 21:48:50 +02:00
double precision,intent(in) :: TAab(nS,nS)
double precision,intent(in) :: TAaa(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-09-09 21:48:50 +02:00
double precision,allocatable :: dTAab(:,:)
double precision,allocatable :: ZAab(:,:)
2021-10-17 08:11:17 +02:00
2022-09-09 21:48:50 +02:00
double precision,allocatable :: dTAaa(:,:)
double precision,allocatable :: ZAaa(:,:)
2021-10-17 08:11:17 +02:00
! Memory allocation
2022-01-11 15:23:43 +01:00
maxS = min(nS,maxS)
2022-09-09 21:48:50 +02:00
allocate(OmDyn(maxS),ZDyn(maxS),X(nS),Y(nS),dTAab(nS,nS),ZAab(nS,nS),dTAaa(nS,nS),ZAaa(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-09-09 21:48:50 +02:00
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOab,nVVab,1d0,eGT,Om1ab,Om2ab,rho1ab,rho2ab,OmBSE(ia),dTAab,ZAab)
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-09-09 21:48:50 +02:00
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOaa,nVVaa,1d0,eGT,Om1aa,Om2aa,rho1aa,rho2aa,OmBSE(ia),dTAaa,ZAaa)
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-09-09 21:48:50 +02:00
ZDyn(ia) = - dot_product(X,matmul(ZAaa+ZAab,X))
OmDyn(ia) = - dot_product(X,matmul(dTAaa+dTAab,X)) + dot_product(X,matmul(TAaa+TAab,X))
2022-01-17 08:02:11 +01:00
end if
if(ispin == 2) then
2022-09-09 21:48:50 +02:00
ZDyn(ia) = - dot_product(X,matmul(ZAaa-ZAab,X))
OmDyn(ia) = - dot_product(X,matmul(dTAaa-dTAab,X)) + dot_product(X,matmul(TAaa-TAab,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