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

39 lines
848 B
Fortran
Raw Permalink Normal View History

2020-03-26 16:57:46 +01:00
subroutine MP3_correlation_energy(nC,nO,nV,nR,OOVV,t2,v,delta_OOVV,EcMP3)
! Compute the MP3 correlation energy
implicit none
! Input variables
integer,intent(in) :: nC,nO,nV,nR
2020-10-19 14:20:35 +02:00
double precision,intent(in) :: OOVV(nO-nC,nO-nC,nV-nR,nV-nR)
double precision,intent(in) :: t2(nO-nC,nO-nC,nV-nR,nV-nR)
double precision,intent(in) :: v(nO-nC,nO-nC,nV-nR,nV-nR)
double precision,intent(in) :: delta_OOVV(nO-nC,nO-nC,nV-nR,nV-nR)
2020-03-26 16:57:46 +01:00
! Local variables
integer :: i,j,a,b
! Output variables
double precision,intent(out) :: EcMP3
EcMP3 = 0d0
2020-10-19 14:20:35 +02:00
do i=1,nO-nC
do j=1,nO-nC
2020-03-26 16:57:46 +01:00
do a=1,nV-nR
do b=1,nV-nR
EcMP3 = EcMP3 + OOVV(i,j,a,b)*(t2(i,j,a,b) + v(i,j,a,b)/delta_OOVV(i,j,a,b))
2023-12-03 18:47:30 +01:00
end do
end do
end do
end do
2020-03-26 16:57:46 +01:00
EcMP3 = 0.25d0*EcMP3
2023-07-27 11:38:38 +02:00
end subroutine