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

86 lines
2.6 KiB
Fortran
Raw Permalink Normal View History

2023-11-14 13:50:53 +01:00
subroutine ppGRPA(dotest,TDA,nBas,nC,nO,nV,nR,ENuc,EGHF,ERI,dipole_int,eHF)
2023-10-27 13:35:10 +02:00
! Perform ppGRPA calculation
implicit none
include 'parameters.h'
! Input variables
2023-11-11 23:00:00 +01:00
logical,intent(in) :: dotest
2023-10-27 13:35:10 +02:00
logical,intent(in) :: TDA
integer,intent(in) :: nBas
integer,intent(in) :: nC
integer,intent(in) :: nO
integer,intent(in) :: nV
integer,intent(in) :: nR
double precision,intent(in) :: ENuc
2023-11-14 13:50:53 +01:00
double precision,intent(in) :: EGHF
double precision,intent(in) :: eHF(nBas)
2023-10-27 13:35:10 +02:00
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
double precision,intent(in) :: dipole_int(nBas,nBas,ncart)
! Local variables
integer :: ispin
integer :: nOO
integer :: nVV
double precision,allocatable :: Bpp(:,:)
double precision,allocatable :: Cpp(:,:)
double precision,allocatable :: Dpp(:,:)
double precision,allocatable :: Om1(:)
double precision,allocatable :: X1(:,:)
double precision,allocatable :: Y1(:,:)
double precision,allocatable :: Om2(:)
double precision,allocatable :: X2(:,:)
double precision,allocatable :: Y2(:,:)
double precision :: EcRPA
! Hello world
write(*,*)
2023-11-11 23:00:00 +01:00
write(*,*)'**********************************'
write(*,*)'* Generalized pp-RPA Calculation *'
write(*,*)'**********************************'
2023-10-27 13:35:10 +02:00
write(*,*)
! Initialization
EcRPA = 0d0
ispin = 4
nOO = nO*(nO-1)/2
nVV = nV*(nV-1)/2
allocate(Om1(nVV),X1(nVV,nVV),Y1(nOO,nVV),Om2(nOO),X2(nVV,nOO),Y2(nOO,nOO), &
Bpp(nVV,nOO),Cpp(nVV,nVV),Dpp(nOO,nOO))
if(.not.TDA) call ppLR_B(ispin,nBas,nC,nO,nV,nR,nOO,nVV,1d0,ERI,Bpp)
2023-11-14 13:50:53 +01:00
call ppLR_C(ispin,nBas,nC,nO,nV,nR,nVV,1d0,eHF,ERI,Cpp)
call ppLR_D(ispin,nBas,nC,nO,nV,nR,nOO,1d0,eHF,ERI,Dpp)
2023-10-27 13:35:10 +02:00
call ppLR(TDA,nOO,nVV,Bpp,Cpp,Dpp,Om1,X1,Y1,Om2,X2,Y2,EcRPA)
! call print_transition_vectors_pp(.true.,nBas,nC,nO,nV,nR,nOO,nVV,dipole_int,Om1,X1,Y1,Om2,X2,Y2)
2023-11-22 10:07:23 +01:00
call print_excitation_energies('ppRPA@GHF','2p (spinorbital)',nVV,Om1)
call print_excitation_energies('ppRPA@GHF','2h (spinorbital)',nOO,Om2)
2023-10-27 13:35:10 +02:00
write(*,*)
write(*,*)'-------------------------------------------------------------------------------'
2023-11-11 23:00:00 +01:00
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppGRPA correlation energy = ',EcRPA,' au'
2023-11-14 13:50:53 +01:00
write(*,'(2X,A50,F20.10,A3)') 'Tr@ppGRPA total energy = ',ENuc + EGHF + EcRPA,' au'
2023-10-27 13:35:10 +02:00
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)
2023-11-11 23:00:00 +01:00
if(dotest) then
2023-11-14 13:50:53 +01:00
call dump_test_value('G','ppRPA correlation energy',EcRPA)
2023-11-11 23:00:00 +01:00
end if
2023-10-27 13:35:10 +02:00
end subroutine