10
1
mirror of https://github.com/pfloos/quack synced 2024-12-25 22:03:44 +01:00
QuAcK/src/QuAcK/G0T0.f90

141 lines
4.9 KiB
Fortran
Raw Normal View History

2020-03-11 16:41:20 +01:00
subroutine G0T0(eta,nBas,nC,nO,nV,nR,ENuc,ERHF,ERI,eHF)
2019-10-16 18:14:47 +02:00
2020-03-14 23:00:44 +01:00
! Perform one-shot calculation with a T-matrix self-energy (G0T0)
2019-10-16 18:14:47 +02:00
implicit none
include 'parameters.h'
! Input variables
double precision,intent(in) :: eta
2019-10-18 23:16:37 +02:00
integer,intent(in) :: nBas,nC,nO,nV,nR
2019-10-16 18:14:47 +02:00
double precision,intent(in) :: ENuc
double precision,intent(in) :: ERHF
double precision,intent(in) :: eHF(nBas)
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
! Local variables
2019-10-18 23:16:37 +02:00
integer :: ispin
2019-10-20 08:18:58 +02:00
integer :: nOOs,nOOt
integer :: nVVs,nVVt
2019-10-16 18:14:47 +02:00
double precision :: EcRPA(nspin)
double precision :: EcBSE(nspin)
2019-10-20 08:18:58 +02:00
double precision,allocatable :: Omega1s(:),Omega1t(:)
double precision,allocatable :: X1s(:,:),X1t(:,:)
double precision,allocatable :: Y1s(:,:),Y1t(:,:)
double precision,allocatable :: rho1s(:,:,:),rho1t(:,:,:)
double precision,allocatable :: Omega2s(:),Omega2t(:)
double precision,allocatable :: X2s(:,:),X2t(:,:)
double precision,allocatable :: Y2s(:,:),Y2t(:,:)
double precision,allocatable :: rho2s(:,:,:),rho2t(:,:,:)
2019-10-18 23:16:37 +02:00
double precision,allocatable :: SigT(:)
double precision,allocatable :: Z(:)
2019-10-16 18:14:47 +02:00
2020-03-11 16:41:20 +01:00
double precision,allocatable :: eG0T0(:)
2019-10-16 18:14:47 +02:00
2020-03-11 16:41:20 +01:00
! Output variables
2019-10-16 18:14:47 +02:00
! Hello world
write(*,*)
write(*,*)'************************************************'
write(*,*)'| One-shot G0T0 calculation |'
write(*,*)'************************************************'
write(*,*)
2019-10-20 08:18:58 +02:00
! Dimensions of the rr-RPA linear reponse matrices
2019-10-16 18:14:47 +02:00
2019-10-28 16:34:09 +01:00
nOOs = nO*(nO + 1)/2
nVVs = nV*(nV + 1)/2
2019-10-16 18:14:47 +02:00
2019-10-28 16:34:09 +01:00
nOOt = nO*(nO - 1)/2
nVVt = nV*(nV - 1)/2
2019-10-18 23:16:37 +02:00
2019-10-16 18:14:47 +02:00
! Memory allocation
2019-10-20 08:18:58 +02:00
allocate(Omega1s(nVVs),X1s(nVVs,nVVs),Y1s(nOOs,nVVs), &
Omega2s(nOOs),X2s(nVVs,nOOs),Y2s(nOOs,nOOs), &
2020-03-14 23:00:44 +01:00
rho1s(nBas,nO,nVVs),rho2s(nBas,nV,nOOs), &
2019-10-20 08:18:58 +02:00
Omega1t(nVVt),X1t(nVVt,nVVt),Y1t(nOOt,nVVt), &
2019-10-28 16:34:09 +01:00
Omega2t(nOOt),X2t(nVVt,nOOt),Y2t(nOOt,nOOt), &
2020-03-14 23:00:44 +01:00
rho1t(nBas,nO,nVVt),rho2t(nBas,nV,nOOt), &
2020-03-11 16:41:20 +01:00
SigT(nBas),Z(nBas),eG0T0(nBas))
2019-10-16 18:14:47 +02:00
2019-10-20 08:18:58 +02:00
!----------------------------------------------
! Singlet manifold
!----------------------------------------------
ispin = 1
2019-10-16 18:14:47 +02:00
! Compute linear response
2019-10-20 08:18:58 +02:00
call linear_response_pp(ispin,.false.,nBas,nC,nO,nV,nR, &
nOOs,nVVs,eHF(:),ERI(:,:,:,:), &
Omega1s(:),X1s(:,:),Y1s(:,:), &
Omega2s(:),X2s(:,:),Y2s(:,:), &
2019-10-16 18:14:47 +02:00
EcRPA(ispin))
2019-10-20 08:18:58 +02:00
call print_excitation('pp-RPA (N+2)',ispin,nVVs,Omega1s(:))
call print_excitation('pp-RPA (N-2)',ispin,nOOs,Omega2s(:))
2019-10-16 18:14:47 +02:00
! Compute excitation densities for the T-matrix
2019-10-28 16:34:09 +01:00
call excitation_density_Tmatrix(ispin,nBas,nC,nO,nV,nR,nOOs,nVVs,ERI(:,:,:,:), &
X1s(:,:),Y1s(:,:),rho1s(:,:,:), &
2019-10-20 08:18:58 +02:00
X2s(:,:),Y2s(:,:),rho2s(:,:,:))
!----------------------------------------------
! Triplet manifold
!----------------------------------------------
ispin = 2
2019-10-28 16:34:09 +01:00
! Compute linear response
2019-10-16 18:14:47 +02:00
2019-10-20 08:18:58 +02:00
call linear_response_pp(ispin,.false.,nBas,nC,nO,nV,nR, &
nOOt,nVVt,eHF(:),ERI(:,:,:,:), &
Omega1t(:),X1t(:,:),Y1t(:,:), &
Omega2t(:),X2t(:,:),Y2t(:,:), &
EcRPA(ispin))
call print_excitation('pp-RPA (N+2)',ispin,nVVt,Omega1t(:))
call print_excitation('pp-RPA (N-2)',ispin,nOOt,Omega2t(:))
2019-10-28 16:34:09 +01:00
! Compute excitation densities for the T-matrix
2019-10-20 08:18:58 +02:00
2019-10-28 16:34:09 +01:00
call excitation_density_Tmatrix(ispin,nBas,nC,nO,nV,nR,nOOt,nVVt,ERI(:,:,:,:), &
X1t(:,:),Y1t(:,:),rho1t(:,:,:), &
2019-10-20 08:18:58 +02:00
X2t(:,:),Y2t(:,:),rho2t(:,:,:))
!----------------------------------------------
2019-10-16 18:14:47 +02:00
! Compute T-matrix version of the self-energy
2019-10-20 08:18:58 +02:00
!----------------------------------------------
2019-10-16 18:14:47 +02:00
2019-10-20 08:18:58 +02:00
call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,nOOt,nVVt,eHF(:), &
Omega1s(:),rho1s(:,:,:),Omega2s(:),rho2s(:,:,:), &
Omega1t(:),rho1t(:,:,:),Omega2t(:),rho2t(:,:,:), &
2019-10-18 23:16:37 +02:00
SigT(:))
2019-10-16 18:14:47 +02:00
! Compute renormalization factor for T-matrix self-energy
2019-10-20 08:18:58 +02:00
call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,nOOt,nVVt,eHF(:), &
Omega1s(:),rho1s(:,:,:),Omega2s(:),rho2s(:,:,:), &
Omega1t(:),rho1t(:,:,:),Omega2t(:),rho2t(:,:,:), &
2019-10-16 18:14:47 +02:00
Z(:))
2019-10-20 08:18:58 +02:00
!----------------------------------------------
2019-10-16 18:14:47 +02:00
! Solve the quasi-particle equation
2019-10-20 08:18:58 +02:00
!----------------------------------------------
2019-10-16 18:14:47 +02:00
eG0T0(:) = eHF(:) + Z(:)*SigT(:)
2019-10-20 08:18:58 +02:00
!----------------------------------------------
2019-10-16 18:14:47 +02:00
! Dump results
2019-10-20 08:18:58 +02:00
!----------------------------------------------
2019-10-16 18:14:47 +02:00
2019-10-20 08:18:58 +02:00
call print_G0T0(nBas,nO,eHF(:),ENuc,ERHF,SigT(:),Z(:),eG0T0(:),EcRPA(:))
2019-10-16 18:14:47 +02:00
end subroutine G0T0