mirror of
https://github.com/pfloos/quack
synced 2024-08-31 08:33:43 +02:00
80 lines
2.3 KiB
Fortran
80 lines
2.3 KiB
Fortran
![]() |
subroutine phGRPAx(TDA,nBas,nC,nO,nV,nR,nS,ENuc,EHF,ERI,dipole_int,e)
|
||
|
|
||
|
! Perform random phase approximation calculation with exchange (aka TDHF)
|
||
|
|
||
|
implicit none
|
||
|
include 'parameters.h'
|
||
|
include 'quadrature.h'
|
||
|
|
||
|
! Input variables
|
||
|
|
||
|
logical,intent(in) :: TDA
|
||
|
integer,intent(in) :: nBas
|
||
|
integer,intent(in) :: nC
|
||
|
integer,intent(in) :: nO
|
||
|
integer,intent(in) :: nV
|
||
|
integer,intent(in) :: nR
|
||
|
integer,intent(in) :: nS
|
||
|
double precision,intent(in) :: ENuc
|
||
|
double precision,intent(in) :: EHF
|
||
|
double precision,intent(in) :: e(nBas)
|
||
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
||
|
double precision,intent(in) :: dipole_int(nBas,nBas,ncart)
|
||
|
|
||
|
! Local variables
|
||
|
|
||
|
integer :: ispin
|
||
|
logical :: dRPA
|
||
|
double precision,allocatable :: Aph(:,:)
|
||
|
double precision,allocatable :: Bph(:,:)
|
||
|
double precision,allocatable :: Om(:)
|
||
|
double precision,allocatable :: XpY(:,:)
|
||
|
double precision,allocatable :: XmY(:,:)
|
||
|
|
||
|
double precision :: EcRPA
|
||
|
|
||
|
! Hello world
|
||
|
|
||
|
write(*,*)
|
||
|
write(*,*)'***********************************************************'
|
||
|
write(*,*)'| Random phase approximation calculation with exchange |'
|
||
|
write(*,*)'***********************************************************'
|
||
|
write(*,*)
|
||
|
|
||
|
! TDA
|
||
|
|
||
|
if(TDA) then
|
||
|
write(*,*) 'Tamm-Dancoff approximation activated!'
|
||
|
write(*,*) ' => RPAx + TDA = CIS '
|
||
|
write(*,*)
|
||
|
end if
|
||
|
|
||
|
! Initialization
|
||
|
|
||
|
dRPA = .false.
|
||
|
|
||
|
EcRPA = 0d0
|
||
|
|
||
|
! Memory allocation
|
||
|
|
||
|
allocate(Om(nS),XpY(nS,nS),XmY(nS,nS),Aph(nS,nS))
|
||
|
if(.not.TDA) allocate(Bph(nS,nS))
|
||
|
|
||
|
ispin = 3
|
||
|
|
||
|
call phLR_A(ispin,dRPA,nBas,nC,nO,nV,nR,nS,1d0,e,ERI,Aph)
|
||
|
if(.not.TDA) call phLR_B(ispin,dRPA,nBas,nC,nO,nV,nR,nS,1d0,ERI,Bph)
|
||
|
|
||
|
call phLR(TDA,nS,Aph,Bph,EcRPA,Om,XpY,XmY)
|
||
|
call print_excitation_energies('phRPAx@GHF',ispin,nS,Om)
|
||
|
call phLR_transition_vectors(.true.,nBas,nC,nO,nV,nR,nS,dipole_int,Om,XpY,XmY)
|
||
|
|
||
|
write(*,*)
|
||
|
write(*,*)'-------------------------------------------------------------------------------'
|
||
|
write(*,'(2X,A50,F20.10)') 'Tr@phRPAx correlation energy =',EcRPA
|
||
|
write(*,'(2X,A50,F20.10)') 'Tr@phRPAx total energy =',ENuc + EHF + EcRPA
|
||
|
write(*,*)'-------------------------------------------------------------------------------'
|
||
|
write(*,*)
|
||
|
|
||
|
end subroutine
|