2024-09-06 22:14:51 +02:00
|
|
|
subroutine crGRPA(dotest,TDA,nOrb,nC,nO,nV,nR,nS,ENuc,EGHF,ERI,dipole_int,eHF)
|
2023-11-14 13:50:53 +01:00
|
|
|
|
|
|
|
! Crossed-ring channel of the random phase approximation
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
include 'quadrature.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
logical,intent(in) :: dotest
|
|
|
|
|
|
|
|
logical,intent(in) :: TDA
|
2024-09-06 22:14:51 +02:00
|
|
|
integer,intent(in) :: nOrb
|
2023-11-14 13:50:53 +01:00
|
|
|
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) :: EGHF
|
2024-09-06 22:14:51 +02:00
|
|
|
double precision,intent(in) :: eHF(nOrb)
|
|
|
|
double precision,intent(in) :: ERI(nOrb,nOrb,nOrb,nOrb)
|
|
|
|
double precision,intent(in) :: dipole_int(nOrb,nOrb,ncart)
|
2023-11-14 13:50:53 +01:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
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(*,*)'* Generalized cr-RPA Calculation *'
|
|
|
|
write(*,*)'**********************************'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
! TDA
|
|
|
|
|
|
|
|
if(TDA) then
|
|
|
|
write(*,*) 'Tamm-Dancoff approximation activated!'
|
|
|
|
write(*,*)
|
|
|
|
end if
|
|
|
|
|
|
|
|
! Initialization
|
|
|
|
|
|
|
|
dRPA = .false.
|
|
|
|
EcRPA = 0d0
|
|
|
|
|
|
|
|
! Memory allocation
|
|
|
|
|
2023-11-20 21:34:08 +01:00
|
|
|
allocate(Om(nS),XpY(nS,nS),XmY(nS,nS),Aph(nS,nS),Bph(nS,nS))
|
2023-11-14 13:50:53 +01:00
|
|
|
|
2024-09-06 22:14:51 +02:00
|
|
|
call phLR_A(dRPA,nOrb,nC,nO,nV,nR,nS,-1d0,eHF,ERI,Aph)
|
|
|
|
if(.not.TDA) call phLR_B(dRPA,nOrb,nC,nO,nV,nR,nS,-1d0,ERI,Bph)
|
2023-11-14 13:50:53 +01:00
|
|
|
|
2024-09-06 22:14:51 +02:00
|
|
|
call phGLR(TDA,nS,Aph,Bph,EcRPA,Om,XpY,XmY)
|
2023-11-22 10:07:23 +01:00
|
|
|
call print_excitation_energies('crRPA@GHF','spinorbital',nS,Om)
|
2024-09-06 22:14:51 +02:00
|
|
|
call phLR_transition_vectors(.true.,nOrb,nC,nO,nV,nR,nS,dipole_int,Om,XpY,XmY)
|
2023-11-14 13:50:53 +01:00
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@crRPA correlation energy = ',EcRPA,' au'
|
|
|
|
write(*,'(2X,A50,F20.10,A3)') 'Tr@crRPA total energy = ',ENuc + EGHF + EcRPA,' au'
|
|
|
|
write(*,*)'-------------------------------------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
if(dotest) then
|
|
|
|
|
|
|
|
call dump_test_value('G','crRPA correlation energy',EcRPA)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine
|