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

172 lines
6.3 KiB
Fortran
Raw Normal View History

2022-01-11 15:23:43 +01:00
subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(singlet,triplet,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,nOOt,nVVt, &
Omega1s,Omega2s,Omega1t,Omega2t,rho1s,rho2s,rho1t,rho2t,eT,eGT, &
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-11 15:23:43 +01:00
logical,intent(in) :: singlet
logical,intent(in) :: triplet
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-11 15:23:43 +01:00
double precision,intent(in) :: OmBSE(nS,nspin)
double precision,intent(in) :: XpY(nS,nS,nspin)
double precision,intent(in) :: XmY(nS,nS,nspin)
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 :: ispin
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
integer :: maxS = 10
2021-10-17 08:11:17 +02:00
double precision :: gapGT
2022-01-11 15:23:43 +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)
allocate(OmDyn(maxS,nspin),ZDyn(maxS,nspin),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-11 15:23:43 +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-11 15:23:43 +01:00
! Compute dynamical T-matrix for alpha-beta block !
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
ispin = 1
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,1d0,eGT,Omega1s,Omega2s,rho1s,rho2s,OmBSE(ia,ispin),dTAs,ZAs)
! Compute dynamical T-matrix for alpha-beta block !
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
ispin = 2
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,1d0,eGT,Omega1t,Omega2t,rho1t,rho2t,OmBSE(ia,ispin),dTAt,ZAt)
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
do ispin=1,nspin
X(:) = 0.5d0*(XpY(ia,:,ispin) + XmY(ia,:,ispin))
Y(:) = 0.5d0*(XpY(ia,:,ispin) - XmY(ia,:,ispin))
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
! First-order correction
if(ispin == 1) then
ZDyn(ia,ispin) = dot_product(X,matmul(ZAt+ZAs,X))
OmDyn(ia,ispin) = dot_product(X,matmul(dTAt+dTAs,X)) - dot_product(X,matmul(TAt+TAs,X))
end if
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
if(ispin == 2) then
ZDyn(ia,ispin) = dot_product(X,matmul(ZAt-ZAs,X))
OmDyn(ia,ispin) = dot_product(X,matmul(dTAt-dTAs,X)) - dot_product(X,matmul(TAt-TAs,X))
end if
ZDyn(ia,ispin) = 1d0/(1d0 - ZDyn(ia,ispin))
OmDyn(ia,ispin) = ZDyn(ia,ispin)*OmDyn(ia,ispin)
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
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-11 15:23:43 +01:00
if(singlet) then
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
ispin = 1
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,*) ' First-order dynamical correction to static singlet 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(*,*) '---------------------------------------------------------------------------------------------------'
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
do ia=1,maxS
write(*,'(2X,I5,5X,F15.6,5X,F15.6,5X,F15.6,5X,F15.6)') &
ia,OmBSE(ia,ispin)*HaToeV,(OmBSE(ia,ispin)+OmDyn(ia,ispin))*HaToeV,OmDyn(ia,ispin)*HaToeV,ZDyn(ia,ispin)
end do
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,*)
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
end if
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
if(triplet) then
2021-10-17 08:11:17 +02:00
2022-01-11 15:23:43 +01:00
ispin = 2
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,*) ' First-order dynamical correction to static triplet 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(*,*) '---------------------------------------------------------------------------------------------------'
do ia=1,maxS
write(*,'(2X,I5,5X,F15.6,5X,F15.6,5X,F15.6,5X,F15.6)') &
ia,OmBSE(ia,ispin)*HaToeV,(OmBSE(ia,ispin)+OmDyn(ia,ispin))*HaToeV,OmDyn(ia,ispin)*HaToeV,ZDyn(ia,ispin)
end do
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,*)
end if
2021-10-17 08:11:17 +02:00
end subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation