4
1
mirror of https://github.com/pfloos/quack synced 2024-06-02 11:25:28 +02:00
quack/src/GW/self_energy_exchange_diag.f90

44 lines
979 B
Fortran
Raw Normal View History

2021-02-15 17:27:06 +01:00
subroutine self_energy_exchange_diag(nBas,c,P,ERI,SigX)
! Compute the diagonal elements of the exchange part of the self-energy
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nBas
double precision,intent(in) :: c(nBas,nBas)
double precision,intent(in) :: P(nBas,nBas)
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
! Local variables
2022-01-26 13:05:16 +01:00
integer :: mu,nu
integer :: q
2021-02-15 17:27:06 +01:00
double precision,allocatable :: Fx(:,:)
! Output variables
double precision,intent(out) :: SigX(nBas)
! Compute exchange part of the self-energy in the AO basis
allocate(Fx(nBas,nBas))
call exchange_matrix_AO_basis(nBas,P,ERI,Fx)
! Compute exchange part of the self-energy in the MO basis
SigX(:) = 0d0
do q=1,nBas
do mu=1,nBas
do nu=1,nBas
SigX(q) = SigX(q) + c(mu,q)*Fx(mu,nu)*c(nu,q)
end do
end do
end do
deallocate(Fx)
2023-07-28 15:00:17 +02:00
end subroutine