1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-12-22 20:34:05 +01:00

Removed r1 and r2

This commit is contained in:
Anthony Scemama 2019-09-14 15:01:09 +02:00
parent 8b131877c4
commit 34c08ae5a6
7 changed files with 130 additions and 252 deletions

View File

@ -25,13 +25,6 @@ subroutine CCSD
double precision :: EcCCT
double precision :: get_two_e_integral,u_dot_v
double precision,allocatable :: cWoooo(:,:,:,:)
double precision,allocatable :: cWvvvv(:,:,:,:)
double precision,allocatable :: cWovvo(:,:,:,:)
double precision,allocatable :: r1(:,:)
double precision,allocatable :: r2(:,:,:,:)
! Hello world
write(*,*)
@ -58,12 +51,6 @@ subroutine CCSD
! Initialization
allocate(cWoooo(spin_occ_num,spin_occ_num,spin_occ_num,spin_occ_num), &
cWvvvv(spin_vir_num,spin_vir_num,spin_vir_num,spin_vir_num), &
cWovvo(spin_occ_num,spin_vir_num,spin_vir_num,spin_occ_num), &
r1(spin_occ_num,spin_vir_num), &
r2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num))
Conv = 1d0
nSCF = 0
@ -84,28 +71,16 @@ subroutine CCSD
do while(Conv > thresh .and. nSCF < maxSCF)
! Excrement
nSCF = nSCF + 1
call form_cw_nc (cWoooo,cWovvo,cWvvvv)
! Compute residuals
call form_r1_nc(spin_fock_matrix_mo_ov, &
c_spin_fock_matrix_mo_oo,c_spin_fock_matrix_mo_ov,c_spin_fock_matrix_mo_vv,r1)
call form_r2_nc(c_spin_fock_matrix_mo_oo,c_spin_fock_matrix_mo_ov,c_spin_fock_matrix_mo_vv, &
cWoooo,cWvvvv,cWovvo,r2)
! Check convergence
Conv = max(maxval(abs(r1(:,:))),maxval(abs(r2(:,:,:,:))))
Conv = max(maxval(abs(r1_cc(:,:))),maxval(abs(r2_cc(:,:,:,:))))
! Update
t1_cc(:,:) = t1_cc(:,:) - r1(:,:) /delta_OV (:,:)
t2_cc(:,:,:,:) = t2_cc(:,:,:,:) - r2(:,:,:,:)/delta_OOVV(:,:,:,:)
t1_cc(:,:) = t1_cc(:,:) - r1_cc(:,:) /delta_OV (:,:)
t2_cc(:,:,:,:) = t2_cc(:,:,:,:) - r2_cc(:,:,:,:)/delta_OOVV(:,:,:,:)
TOUCH t1_cc t2_cc
! Compute correlation energy
@ -139,11 +114,6 @@ subroutine CCSD
end if
! Deallocate memory
deallocate( &
cWoooo,cWvvvv,cWovvo, &
r1,r2)
!------------------------------------------------------------------------
! (T) correction

View File

@ -1,24 +1,10 @@
subroutine form_cW_nc(cWoooo,cWovvo,cWvvvv)
! Compute W terms in CCSD
BEGIN_PROVIDER [ double precision, cWoooo, (spin_occ_num,spin_occ_num,spin_occ_num,spin_occ_num) ]
implicit none
! Local variables
BEGIN_DOC
! Curly W in occ-occ-occ-occ block
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
double precision,external :: Kronecker_Delta
double precision :: x
! Output variables
double precision,intent(out) :: cWoooo(spin_occ_num,spin_occ_num,spin_occ_num,spin_occ_num)
double precision,intent(out) :: cWovvo(spin_occ_num,spin_vir_num,spin_vir_num,spin_occ_num)
double precision,intent(out) :: cWvvvv(spin_vir_num,spin_vir_num,spin_vir_num,spin_vir_num)
! OOOO block
cWoooo(:,:,:,:) = OOOO(:,:,:,:)
@ -27,13 +13,16 @@ subroutine form_cW_nc(cWoooo,cWovvo,cWvvvv)
do i=1,spin_occ_num
do n=1,spin_occ_num
do m=1,spin_occ_num
cWoooo(m,n,i,j) = cWoooo(m,n,i,j) + t1_cc(j,e)*OOOV(m,n,i,e) - t1_cc(i,e)*OOOV(m,n,j,e)
cWoooo(m,n,i,j) = cWoooo(m,n,i,j) + &
t1_cc(j,e)*OOOV(m,n,i,e) - &
t1_cc(i,e)*OOOV(m,n,j,e)
end do
end do
end do
end do
end do
double precision :: x
do f=1,spin_vir_num
do e=1,spin_vir_num
do j=1,spin_occ_num
@ -49,7 +38,17 @@ subroutine form_cW_nc(cWoooo,cWovvo,cWvvvv)
end do
end do
! OVVO block
END_PROVIDER
BEGIN_PROVIDER [ double precision, cWovvo, (spin_occ_num,spin_vir_num,spin_vir_num,spin_occ_num) ]
implicit none
BEGIN_DOC
! Curly W in occ-vir-vir-occ block
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
double precision :: x
cWovvo(:,:,:,:) = OVVO(:,:,:,:)
@ -92,7 +91,17 @@ subroutine form_cW_nc(cWoooo,cWovvo,cWvvvv)
end do
end do
! VVVV block
END_PROVIDER
BEGIN_PROVIDER [ double precision, cWvvvv, (spin_vir_num,spin_vir_num,spin_vir_num,spin_vir_num) ]
implicit none
BEGIN_DOC
! Curly W in vir-vir-vir-vir block
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
double precision :: x
cWvvvv(:,:,:,:) = VVVV(:,:,:,:)
@ -124,5 +133,6 @@ subroutine form_cW_nc(cWoooo,cWovvo,cWvvvv)
end do
end do
END_PROVIDER
end subroutine form_cW_nc

View File

@ -1,70 +0,0 @@
subroutine form_r1(hvv,hoo,hvo,t1,t2,tau,r1)
! Form tau in CCSD
implicit none
! Input variables
double precision,intent(in) :: hvv(spin_vir_num,spin_vir_num)
double precision,intent(in) :: hoo(spin_occ_num,spin_occ_num)
double precision,intent(in) :: hvo(spin_vir_num,spin_occ_num)
double precision,intent(in) :: t1(spin_occ_num,spin_vir_num)
double precision,intent(in) :: t2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
double precision,intent(in) :: tau(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
! Local variables
integer :: i,j,k,l
integer :: a,b,c,d
! Output variables
double precision,intent(out) :: r1(spin_occ_num,spin_vir_num)
r1(:,:) = 0d0
do a=1,spin_vir_num
do i=1,spin_occ_num
do b=1,spin_vir_num
r1(i,a) = r1(i,a) + hvv(b,a)*t1(i,b)
end do
do j=1,spin_occ_num
r1(i,a) = r1(i,a) - hoo(i,j)*t1(j,a)
end do
do j=1,spin_occ_num
do b=1,spin_vir_num
r1(i,a) = r1(i,a) + hvo(b,j)*(t2(i,j,a,b) + t1(i,b)*t1(j,a))
end do
end do
do b=1,spin_vir_num
do j=1,spin_occ_num
r1(i,a) = r1(i,a) + OVVO(i,b,a,j)*t1(j,b)
end do
end do
do c=1,spin_vir_num
do b=1,spin_vir_num
do j=1,spin_occ_num
r1(i,a) = r1(i,a) - OVVV(j,a,b,c)*tau(i,j,b,c)
end do
end do
end do
do b=1,spin_vir_num
do k=1,spin_occ_num
do j=1,spin_occ_num
r1(i,a) = r1(i,a) - OOOV(j,k,i,b)*tau(j,k,a,b)
end do
end do
end do
end do
end do
end subroutine form_r1

View File

@ -1,72 +0,0 @@
subroutine form_r1_nc(Fov,cFoo,cFov,cFvv,r1)
! Form residues for t1 in non-canonical CCSD
implicit none
! Input variables
double precision,intent(in) :: Fov(spin_occ_num,spin_vir_num)
double precision,intent(in) :: cFoo(spin_occ_num,spin_occ_num)
double precision,intent(in) :: cFov(spin_occ_num,spin_vir_num)
double precision,intent(in) :: cFvv(spin_vir_num,spin_vir_num)
! Local variables
integer :: i,j,m,n
integer :: a,b,e,f
! Output variables
double precision,intent(out) :: r1(spin_occ_num,spin_vir_num)
r1(:,:) = Fov(:,:)
do i=1,spin_occ_num
do a=1,spin_vir_num
do e=1,spin_vir_num
r1(i,a) = r1(i,a) + t1_cc(i,e)*cFvv(a,e)
end do
do m=1,spin_occ_num
r1(i,a) = r1(i,a) - t1_cc(m,a)*cFoo(m,i)
end do
do m=1,spin_occ_num
do e=1,spin_vir_num
r1(i,a) = r1(i,a) + t2_cc(i,m,a,e)*cFov(m,e)
end do
end do
do n=1,spin_occ_num
do f=1,spin_vir_num
r1(i,a) = r1(i,a) - t1_cc(n,f)*OVOV(n,a,i,f)
end do
end do
do m=1,spin_occ_num
do e=1,spin_vir_num
do f=1,spin_vir_num
r1(i,a) = r1(i,a) - 0.5d0*t2_cc(i,m,e,f)*OVVV(m,a,e,f)
end do
end do
end do
do m=1,spin_occ_num
do n=1,spin_occ_num
do e=1,spin_vir_num
r1(i,a) = r1(i,a) - 0.5d0*t2_cc(m,n,a,e)*OOVO(n,m,e,i)
end do
end do
end do
end do
end do
! Final expression for t1 residue
r1(:,:) = delta_ov(:,:)*t1_cc(:,:) - r1(:,:)
end subroutine form_r1_nc

58
devel/cc/r1_cc.irp.f Normal file
View File

@ -0,0 +1,58 @@
BEGIN_PROVIDER [ double precision, r1_cc, (spin_occ_num,spin_vir_num) ]
implicit none
BEGIN_DOC
! Residues for t1 in non-canonical CCSD
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
r1_cc(:,:) = spin_fock_matrix_mo_ov(:,:)
do i=1,spin_occ_num
do a=1,spin_vir_num
do e=1,spin_vir_num
r1_cc(i,a) = r1_cc(i,a) + t1_cc(i,e)*c_spin_fock_matrix_mo_vv(a,e)
end do
do m=1,spin_occ_num
r1_cc(i,a) = r1_cc(i,a) - t1_cc(m,a)*c_spin_fock_matrix_mo_oo(m,i)
end do
do m=1,spin_occ_num
do e=1,spin_vir_num
r1_cc(i,a) = r1_cc(i,a) + t2_cc(i,m,a,e)*c_spin_fock_matrix_mo_ov(m,e)
end do
end do
do n=1,spin_occ_num
do f=1,spin_vir_num
r1_cc(i,a) = r1_cc(i,a) - t1_cc(n,f)*OVOV(n,a,i,f)
end do
end do
do m=1,spin_occ_num
do e=1,spin_vir_num
do f=1,spin_vir_num
r1_cc(i,a) = r1_cc(i,a) - 0.5d0*t2_cc(i,m,e,f)*OVVV(m,a,e,f)
end do
end do
end do
do m=1,spin_occ_num
do n=1,spin_occ_num
do e=1,spin_vir_num
r1_cc(i,a) = r1_cc(i,a) - 0.5d0*t2_cc(m,n,a,e)*OOVO(n,m,e,i)
end do
end do
end do
end do
end do
! Final expression for t1 residue
r1_cc(:,:) = delta_ov(:,:)*t1_cc(:,:) - r1_cc(:,:)
END_PROVIDER

View File

@ -1,38 +1,20 @@
subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
! Form t2 residues in non-canonical CCSD
BEGIN_PROVIDER [ double precision, r2_cc, (spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num) ]
implicit none
! Input variables
double precision,intent(in) :: cFoo(spin_occ_num,spin_occ_num)
double precision,intent(in) :: cFov(spin_occ_num,spin_vir_num)
double precision,intent(in) :: cFvv(spin_vir_num,spin_vir_num)
double precision,intent(in) :: cWoooo(spin_occ_num,spin_occ_num,spin_occ_num,spin_occ_num)
double precision,intent(in) :: cWvvvv(spin_vir_num,spin_vir_num,spin_vir_num,spin_vir_num)
double precision,intent(in) :: cWovvo(spin_occ_num,spin_vir_num,spin_vir_num,spin_occ_num)
double precision :: x
! Local variables
BEGIN_DOC
! t2 residues in non-canonical CCSD
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
double precision :: x
! Output variables
double precision,intent(out) :: r2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
r2(:,:,:,:) = OOVV(:,:,:,:)
r2_cc(:,:,:,:) = OOVV(:,:,:,:)
do e=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(i,j,a,e)*cFvv(b,e)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t2_cc(i,j,a,e)*c_spin_fock_matrix_mo_vv(b,e)
end do
end do
end do
@ -45,7 +27,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do a=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(i,j,b,e)*cFvv(a,e)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t2_cc(i,j,b,e)*c_spin_fock_matrix_mo_vv(a,e)
end do
end do
end do
@ -61,7 +43,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
x = 0.5d0*t2_cc(i,j,a,e)
if (x /= 0.d0) then
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - x*t1_cc(m,b)*cFov(m,e)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - x*t1_cc(m,b)*c_spin_fock_matrix_mo_ov(m,e)
end do
endif
end do
@ -79,7 +61,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
x = 0.5d0*t2_cc(i,j,b,e)
if (x /= 0.d0) then
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + x*t1_cc(m,a)*cFov(m,e)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + x*t1_cc(m,a)*c_spin_fock_matrix_mo_ov(m,e)
end do
endif
end do
@ -93,9 +75,9 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do a=1,spin_vir_num
do j=1,spin_occ_num
do m=1,spin_occ_num
x = cFoo(m,j)
x = c_spin_fock_matrix_mo_oo(m,j)
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(i,m,a,b)*x
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t2_cc(i,m,a,b)*x
end do
end do
end do
@ -107,7 +89,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(j,m,a,b)*cFoo(m,i)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t2_cc(j,m,a,b)*c_spin_fock_matrix_mo_oo(m,i)
end do
end do
end do
@ -119,11 +101,11 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do a=1,spin_vir_num
do e=1,spin_vir_num
do m=1,spin_occ_num
x = 0.5d0*cFov(m,e)
x = 0.5d0*c_spin_fock_matrix_mo_ov(m,e)
if (x == 0.d0) cycle
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - x*t2_cc(i,m,a,b)*t1_cc(j,e)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - x*t2_cc(i,m,a,b)*t1_cc(j,e)
end do
end do
end do
@ -136,10 +118,10 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do a=1,spin_vir_num
do e=1,spin_vir_num
do m=1,spin_occ_num
x = 0.5d0*cFov(m,e)
x = 0.5d0*c_spin_fock_matrix_mo_ov(m,e)
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + x*t2_cc(j,m,a,b)*t1_cc(i,e)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + x*t2_cc(j,m,a,b)*t1_cc(i,e)
end do
end do
end do
@ -154,7 +136,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do i=1,spin_occ_num
do n=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + 0.5d0*tau_cc(m,n,a,b)*cWoooo(m,n,i,j)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + 0.5d0*tau_cc(m,n,a,b)*cWoooo(m,n,i,j)
end do
end do
end do
@ -170,7 +152,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
x = 0.5d0*cWvvvv(a,b,e,f)
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + x*tau_cc(i,j,e,f)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + x*tau_cc(i,j,e,f)
end do
end do
end do
@ -185,7 +167,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do e=1,spin_vir_num
do m=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(i,m,a,e)*cWovvo(m,b,e,j)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t2_cc(i,m,a,e)*cWovvo(m,b,e,j)
end do
end do
end do
@ -200,7 +182,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do m=1,spin_occ_num
x = t1_cc(m,a)*OVVO(m,b,e,j)
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(i,e)*x
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t1_cc(i,e)*x
end do
end do
end do
@ -214,7 +196,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(j,m,a,e)*cWovvo(m,b,e,i)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t2_cc(j,m,a,e)*cWovvo(m,b,e,i)
end do
end do
end do
@ -228,7 +210,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(j,e)*t1_cc(m,a)*OVVO(m,b,e,i)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t1_cc(j,e)*t1_cc(m,a)*OVVO(m,b,e,i)
end do
end do
end do
@ -242,7 +224,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do m=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(i,m,b,e)*cWovvo(m,a,e,j)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t2_cc(i,m,b,e)*cWovvo(m,a,e,j)
end do
end do
end do
@ -256,7 +238,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do e=1,spin_vir_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(i,e)*t1_cc(m,b)*OVVO(m,a,e,j)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t1_cc(i,e)*t1_cc(m,b)*OVVO(m,a,e,j)
end do
end do
end do
@ -270,7 +252,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(j,m,b,e)*cWovvo(m,a,e,i)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t2_cc(j,m,b,e)*cWovvo(m,a,e,i)
end do
end do
end do
@ -284,7 +266,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(j,e)*t1_cc(m,b)*OVVO(m,a,e,i)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t1_cc(j,e)*t1_cc(m,b)*OVVO(m,a,e,i)
end do
end do
end do
@ -298,7 +280,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do e=1,spin_vir_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(i,e)*VVVO(a,b,e,j)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t1_cc(i,e)*VVVO(a,b,e,j)
end do
end do
end do
@ -311,7 +293,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do e=1,spin_vir_num
do i=1,spin_occ_num
do j=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(j,e)*VVVO(a,b,e,i)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t1_cc(j,e)*VVVO(a,b,e,i)
end do
end do
end do
@ -324,7 +306,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(m,a)*OVOO(m,b,i,j)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) - t1_cc(m,a)*OVOO(m,b,i,j)
end do
end do
end do
@ -336,7 +318,7 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
do j=1,spin_occ_num
do i=1,spin_occ_num
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(m,b)*OVOO(m,a,i,j)
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t1_cc(m,b)*OVOO(m,a,i,j)
end do
end do
end do
@ -345,6 +327,6 @@ subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
! Final expression of the t2 residue
r2(:,:,:,:) = delta_oovv(:,:,:,:)*t2_cc(:,:,:,:) - r2(:,:,:,:)
r2_cc(:,:,:,:) = delta_oovv(:,:,:,:)*t2_cc(:,:,:,:) - r2_cc(:,:,:,:)
end subroutine form_r2_nc
END_PROVIDER