1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 14:43:41 +01:00

Removed nO nV

This commit is contained in:
Anthony Scemama 2019-09-14 14:15:25 +02:00
parent 170f59c9cd
commit a6e87526b1
19 changed files with 448 additions and 486 deletions

View File

@ -18,8 +18,6 @@ subroutine CCSD
integer :: p,q,r,s
double precision :: start_CCSDT,end_CCSDT,t_CCSDT
integer :: nBas2
integer :: nO
integer :: nV
integer :: nSCF
double precision :: Conv
double precision :: EcMP2
@ -67,29 +65,24 @@ subroutine CCSD
nBas2 = spin_mo_num
! Define occupied and virtual spaces
nO = spin_occ_num
nV = spin_vir_num
! Guess amplitudes
allocate(t1(nO,nV),t2(nO,nO,nV,nV),tau(nO,nO,nV,nV),taus(nO,nO,nV,nV))
allocate(t1(spin_occ_num,spin_vir_num),t2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num),tau(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num),taus(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num))
t1(:,:) = t1_guess(:,:)
t2(:,:,:,:) = t2_guess(:,:,:,:)
! Initialization
allocate(cFvv(nV,nV),cFoo(nO,nO),cFov(nO,nV), &
cWoooo(nO,nO,nO,nO),cWvvvv(nV,nV,nV,nV),cWovvo(nO,nV,nV,nO), &
r1(nO,nV),r2(nO,nO,nV,nV))
allocate(cFvv(spin_vir_num,spin_vir_num),cFoo(spin_occ_num,spin_occ_num),cFov(spin_occ_num,spin_vir_num), &
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
call form_taus_nc(nO,nV,t1,t2,taus)
call form_tau_nc (nO,nV,t1,t2,tau)
call form_taus_nc(t1,t2,taus)
call form_tau_nc (t1,t2,tau)
EcMP2 = 0.25d0*u_dot_v(OOVV,tau,size(OOVV))
write(*,'(1X,A10,1X,F10.6)') 'Ec(MP2) = ',EcMP2
@ -112,21 +105,21 @@ subroutine CCSD
nSCF = nSCF + 1
call form_cf_nc (nO,nV,t1,taus, &
call form_cf_nc (t1,taus, &
spin_fock_matrix_mo_oo, &
spin_fock_matrix_mo_ov, &
spin_fock_matrix_mo_vv, &
cFoo,cFov,cFvv)
call form_cw_nc (nO,nV,t1,t2,tau, &
call form_cw_nc (t1,t2,tau, &
cWoooo,cWovvo,cWvvvv)
! Compute residuals
call form_r1_nc(nO,nV,t1,t2,spin_fock_matrix_mo_ov, &
call form_r1_nc(t1,t2,spin_fock_matrix_mo_ov, &
cFoo,cFov,cFvv,r1)
call form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv, &
call form_r2_nc(t1,t2,tau,cFoo,cFov,cFvv, &
cWoooo,cWvvvv,cWovvo,r2)
! Check convergence
@ -138,12 +131,12 @@ subroutine CCSD
t1(:,:) = t1(:,:) - r1(:,:) /delta_OV (:,:)
t2(:,:,:,:) = t2(:,:,:,:) - r2(:,:,:,:)/delta_OOVV(:,:,:,:)
call form_taus_nc(nO,nV,t1,t2,taus)
call form_tau_nc (nO,nV,t1,t2,tau)
call form_taus_nc(t1,t2,taus)
call form_tau_nc (t1,t2,tau)
! Compute correlation energy
call CCSD_Ec_nc(nO,nV,t1,t2,spin_fock_matrix_mo_ov,EcCCSD)
call CCSD_Ec_nc(t1,t2,spin_fock_matrix_mo_ov,EcCCSD)
! Dump results
@ -186,7 +179,7 @@ subroutine CCSD
if(doCCSDT) then
write(*,*) "Starting (T) calculation"
! call cpu_time(start_CCSDT)V
call CCSDT(nO,nV,t1,t2,EcCCT)
call CCSDT(t1,t2,EcCCT)
! call cpu_time(end_CCSDT)
call write_time(6)

View File

@ -1,4 +1,4 @@
subroutine CCSDT(nO,nV,t1,t2,EcCCT)
subroutine CCSDT(t1,t2,EcCCT)
! Compute the (T) correction of the CCSD(T) energy
@ -6,10 +6,8 @@ subroutine CCSDT(nO,nV,t1,t2,EcCCT)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
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)
! Local variables
@ -22,14 +20,14 @@ subroutine CCSDT(nO,nV,t1,t2,EcCCT)
! Memory allocation
allocate(ub(nO,nO,nO,nV,nV,nV),ubb(nO,nO,nO,nV,nV,nV))
allocate(ub(spin_occ_num,spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num,spin_vir_num),ubb(spin_occ_num,spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num,spin_vir_num))
! Form CCSD(T) quantities
call form_ub(nO,nV,t1,ub)
call form_ub(t1,ub)
call form_ubb(nO,nV,t2,ubb)
call form_ubb(t2,ubb)
call form_T(nO,nV,ub,ubb,EcCCT)
call form_T(ub,ubb,EcCCT)
end subroutine CCSDT

View File

@ -1,4 +1,4 @@
subroutine CCSD_Ec_nc(nO,nV,t1,t2,Fov,EcCCSD)
subroutine CCSD_Ec_nc(t1,t2,Fov,EcCCSD)
! Compute the CCSD correlatio energy in non-conanical form
@ -6,12 +6,10 @@ subroutine CCSD_Ec_nc(nO,nV,t1,t2,Fov,EcCCSD)
! Input variables
integer,intent(in) :: nO,nV
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) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: Fov(nO,nV)
double precision,intent(in) :: Fov(spin_occ_num,spin_vir_num)
! Local variables
@ -27,8 +25,8 @@ subroutine CCSD_Ec_nc(nO,nV,t1,t2,Fov,EcCCSD)
! Singles contribution
do i=1,nO
do a=1,nV
do i=1,spin_occ_num
do a=1,spin_vir_num
EcCCSD = EcCCSD + Fov(i,a)*t1(i,a)
@ -37,10 +35,10 @@ subroutine CCSD_Ec_nc(nO,nV,t1,t2,Fov,EcCCSD)
! Doubles contribution
do i=1,nO
do j=1,nO
do a=1,nV
do b=1,nV
do i=1,spin_occ_num
do j=1,spin_occ_num
do a=1,spin_vir_num
do b=1,spin_vir_num
EcCCSD = EcCCSD &
+ 0.5d0*OOVV(i,j,a,b)*t1(i,a)*t1(j,b) &

View File

@ -1,4 +1,4 @@
subroutine MP2(nBas,nC,nO,nV,nR,ERI,ENuc,EHF,e,EcMP2)
subroutine MP2(nBas,nC,nR,ERI,ENuc,EHF,e,EcMP2)
! Perform third-order Moller-Plesset calculation
@ -6,7 +6,7 @@ subroutine MP2(nBas,nC,nO,nV,nR,ERI,ENuc,EHF,e,EcMP2)
! Input variables
integer,intent(in) :: nBas,nC,nO,nV,nR
integer,intent(in) :: nBas,nC,nR
double precision,intent(in) :: ENuc,EHF
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas),e(nBas)
@ -31,10 +31,10 @@ subroutine MP2(nBas,nC,nO,nV,nR,ERI,ENuc,EHF,e,EcMP2)
E2a = 0d0
E2b = 0d0
do i=nC+1,nO
do j=nC+1,nO
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
do i=nC+1,spin_occ_num
do j=nC+1,spin_occ_num
do a=spin_occ_num+1,nBas-nR
do b=spin_occ_num+1,nBas-nR
eps = e(i) + e(j) - e(a) - e(b)

View File

@ -1,4 +1,4 @@
subroutine form_T(nO,nV,ub,ubb,EcCCT)
subroutine form_T(ub,ubb,EcCCT)
! Compute (T) correction
@ -6,10 +6,8 @@ subroutine form_T(nO,nV,ub,ubb,EcCCT)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: ub(nO,nO,nO,nV,nV,nV)
double precision,intent(in) :: ubb(nO,nO,nO,nV,nV,nV)
double precision,intent(in) :: ub(spin_occ_num,spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num,spin_vir_num)
double precision,intent(in) :: ubb(spin_occ_num,spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num,spin_vir_num)
! Local variables
@ -22,12 +20,12 @@ subroutine form_T(nO,nV,ub,ubb,EcCCT)
EcCCT = 0d0
do c=1,nV
do b=1,nV
do a=1,nV
do k=1,nO
do j=1,nO
do i=1,nO
do c=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
do k=1,spin_occ_num
do j=1,spin_occ_num
do i=1,spin_occ_num
EcCCT = EcCCT &
+ (ub(i,j,k,a,b,c) + ubb(i,j,k,a,b,c)) &

View File

@ -1,4 +1,4 @@
subroutine form_abh(nO,nV,t1,tau,aoooo,bvvvv,hovvo)
subroutine form_abh(t1,tau,aoooo,bvvvv,hovvo)
! Scuseria Eqs. (11),(12) and (13)
@ -6,10 +6,8 @@ subroutine form_abh(nO,nV,t1,tau,aoooo,bvvvv,hovvo)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: tau(nO,nO,nV,nV)
double precision,intent(in) :: t1(spin_occ_num,spin_vir_num)
double precision,intent(in) :: tau(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
! Local variables
@ -18,27 +16,27 @@ subroutine form_abh(nO,nV,t1,tau,aoooo,bvvvv,hovvo)
! Output variables
double precision,intent(out) :: aoooo(nO,nO,nO,nO)
double precision,intent(out) :: bvvvv(nV,nV,nV,nV)
double precision,intent(out) :: hovvo(nO,nV,nV,nO)
double precision,intent(out) :: aoooo(spin_occ_num,spin_occ_num,spin_occ_num,spin_occ_num)
double precision,intent(out) :: bvvvv(spin_vir_num,spin_vir_num,spin_vir_num,spin_vir_num)
double precision,intent(out) :: hovvo(spin_occ_num,spin_vir_num,spin_vir_num,spin_occ_num)
aoooo(:,:,:,:) = OOOO(:,:,:,:)
do l=1,nO
do k=1,nO
do j=1,nO
do i=1,nO
do l=1,spin_occ_num
do k=1,spin_occ_num
do j=1,spin_occ_num
do i=1,spin_occ_num
do c=1,nV
do c=1,spin_vir_num
aoooo(i,j,k,l) = aoooo(i,j,k,l) + OVOO(i,c,k,l)*t1(j,c)
end do
do c=1,nV
do c=1,spin_vir_num
aoooo(i,j,k,l) = aoooo(i,j,k,l) - OVOO(j,c,k,l)*t1(i,c)
end do
do d=1,nV
do c=1,nV
do d=1,spin_vir_num
do c=1,spin_vir_num
aoooo(i,j,k,l) = aoooo(i,j,k,l) + OOVV(k,l,c,d)*tau(i,j,c,d)
end do
end do
@ -50,16 +48,16 @@ subroutine form_abh(nO,nV,t1,tau,aoooo,bvvvv,hovvo)
bvvvv(:,:,:,:) = VVVV(:,:,:,:)
do b=1,nV
do a=1,nV
do d=1,nV
do c=1,nV
do b=1,spin_vir_num
do a=1,spin_vir_num
do d=1,spin_vir_num
do c=1,spin_vir_num
do k=1,nO
do k=1,spin_occ_num
bvvvv(c,d,a,b) = bvvvv(c,d,a,b) - VOVV(a,k,c,d)*t1(k,b)
end do
do k=1,nO
do k=1,spin_occ_num
bvvvv(c,d,a,b) = bvvvv(c,d,a,b) + VOVV(b,k,c,d)*t1(k,a)
end do
@ -70,21 +68,21 @@ subroutine form_abh(nO,nV,t1,tau,aoooo,bvvvv,hovvo)
hovvo(:,:,:,:) = OVVO(:,:,:,:)
do k=1,nO
do a=1,nV
do c=1,nV
do i=1,nO
do k=1,spin_occ_num
do a=1,spin_vir_num
do c=1,spin_vir_num
do i=1,spin_occ_num
do l=1,nO
do l=1,spin_occ_num
hovvo(i,c,a,k) = hovvo(i,c,a,k) - OVOO(i,c,l,k)*t1(l,a)
end do
do d=1,nV
do d=1,spin_vir_num
hovvo(i,c,a,k) = hovvo(i,c,a,k) + OVVV(k,a,c,d)*t1(i,d)
end do
do d=1,nV
do l=1,nO
do d=1,spin_vir_num
do l=1,spin_occ_num
hovvo(i,c,a,k) = hovvo(i,c,a,k) - OOVV(k,l,c,d)*tau(i,l,d,a)
end do
end do

View File

@ -1,4 +1,4 @@
subroutine form_cF_nc(nO,nV,t1,taus,Foo,Fov,Fvv,cFoo,cFov,cFvv)
subroutine form_cF_nc(t1,taus,Foo,Fov,Fvv,cFoo,cFov,cFvv)
! Compute F terms in CCSD
@ -6,14 +6,12 @@ subroutine form_cF_nc(nO,nV,t1,taus,Foo,Fov,Fvv,cFoo,cFov,cFvv)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(spin_occ_num,spin_vir_num)
double precision,intent(in) :: taus(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: taus(nO,nO,nV,nV)
double precision,intent(in) :: Foo(nO,nO)
double precision,intent(in) :: Fov(nO,nV)
double precision,intent(in) :: Fvv(nV,nV)
double precision,intent(in) :: Foo(spin_occ_num,spin_occ_num)
double precision,intent(in) :: Fov(spin_occ_num,spin_vir_num)
double precision,intent(in) :: Fvv(spin_vir_num,spin_vir_num)
! Local variables
@ -23,30 +21,30 @@ subroutine form_cF_nc(nO,nV,t1,taus,Foo,Fov,Fvv,cFoo,cFov,cFvv)
! Output variables
double precision,intent(out) :: cFoo(nO,nO)
double precision,intent(out) :: cFov(nO,nV)
double precision,intent(out) :: cFvv(nV,nV)
double precision,intent(out) :: cFoo(spin_occ_num,spin_occ_num)
double precision,intent(out) :: cFov(spin_occ_num,spin_vir_num)
double precision,intent(out) :: cFvv(spin_vir_num,spin_vir_num)
! Occupied-occupied block
do m=1,nO
do i=1,nO
do m=1,spin_occ_num
do i=1,spin_occ_num
cFoo(m,i) = (1d0 - Kronecker_delta(m,i))*Foo(m,i)
do e=1,nV
do e=1,spin_vir_num
cFoo(m,i) = cFoo(m,i) + 0.5d0*t1(i,e)*Fov(m,e)
end do
do e=1,nV
do n=1,nO
do e=1,spin_vir_num
do n=1,spin_occ_num
cFoo(m,i) = cFoo(m,i) + t1(n,e)*OOOV(m,n,i,e)
end do
end do
do e=1,nV
do n=1,nO
do f=1,nV
do e=1,spin_vir_num
do n=1,spin_occ_num
do f=1,spin_vir_num
cFoo(m,i) = cFoo(m,i) + 0.5d0*taus(i,n,e,f)*OOVV(m,n,e,f)
end do
end do
@ -59,11 +57,11 @@ subroutine form_cF_nc(nO,nV,t1,taus,Foo,Fov,Fvv,cFoo,cFov,cFvv)
cFov(:,:) = Fov(:,:)
do m=1,nO
do e=1,nV
do m=1,spin_occ_num
do e=1,spin_vir_num
do n=1,nO
do f=1,nV
do n=1,spin_occ_num
do f=1,spin_vir_num
cFov(m,e) = cFov(m,e) + t1(n,f)*OOVV(m,n,e,f)
end do
end do
@ -73,24 +71,24 @@ subroutine form_cF_nc(nO,nV,t1,taus,Foo,Fov,Fvv,cFoo,cFov,cFvv)
! Virtual-virtual block
do a=1,nV
do e=1,nV
do a=1,spin_vir_num
do e=1,spin_vir_num
cFvv(a,e) = (1d0 - Kronecker_delta(a,e))*Fvv(a,e)
do m=1,nO
do m=1,spin_occ_num
cFvv(a,e) = cFvv(a,e) - 0.5d0*t1(m,a)*Fov(m,e)
end do
do m=1,nO
do f=1,nV
do m=1,spin_occ_num
do f=1,spin_vir_num
cFvv(a,e) = cFvv(a,e) + t1(m,f)*OVVV(m,a,f,e)
end do
end do
do m=1,nO
do n=1,nO
do f=1,nV
do m=1,spin_occ_num
do n=1,spin_occ_num
do f=1,spin_vir_num
cFvv(a,e) = cFvv(a,e) - 0.5d0*taus(m,n,a,f)*OOVV(m,n,e,f)
end do
end do

View File

@ -1,4 +1,4 @@
subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
subroutine form_cW_nc(t1,t2,tau,cWoooo,cWovvo,cWvvvv)
! Compute W terms in CCSD
@ -6,11 +6,9 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: tau(nO,nO,nV,nV)
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
@ -21,20 +19,20 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
! Output variables
double precision,intent(out) :: cWoooo(nO,nO,nO,nO)
double precision,intent(out) :: cWovvo(nO,nV,nV,nO)
double precision,intent(out) :: cWvvvv(nV,nV,nV,nV)
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(:,:,:,:)
do e=1,nV
do j=1,nO
do i=1,nO
do n=1,nO
do m=1,nO
do e=1,spin_vir_num
do j=1,spin_occ_num
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(j,e)*OOOV(m,n,i,e) - t1(i,e)*OOOV(m,n,j,e)
end do
end do
@ -42,13 +40,13 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
end do
end do
do f=1,nV
do e=1,nV
do j=1,nO
do i=1,nO
do f=1,spin_vir_num
do e=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
x = 0.25d0*tau(i,j,e,f)
do n=1,nO
do m=1,nO
do n=1,spin_occ_num
do m=1,spin_occ_num
cWoooo(m,n,i,j) = cWoooo(m,n,i,j) + x*OOVV(m,n,e,f)
end do
end do
@ -61,11 +59,11 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
cWovvo(:,:,:,:) = OVVO(:,:,:,:)
do f=1,nV
do j=1,nO
do e=1,nV
do b=1,nV
do m=1,nO
do f=1,spin_vir_num
do j=1,spin_occ_num
do e=1,spin_vir_num
do b=1,spin_vir_num
do m=1,spin_occ_num
cWovvo(m,b,e,j) = cWovvo(m,b,e,j) + t1(j,f)*OVVV(m,b,e,f)
end do
end do
@ -73,11 +71,11 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
end do
end do
do j=1,nO
do e=1,nV
do b=1,nV
do n=1,nO
do m=1,nO
do j=1,spin_occ_num
do e=1,spin_vir_num
do b=1,spin_vir_num
do n=1,spin_occ_num
do m=1,spin_occ_num
cWovvo(m,b,e,j) = cWovvo(m,b,e,j) - t1(n,b)*OOVO(m,n,e,j)
end do
end do
@ -85,13 +83,13 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
end do
end do
do j=1,nO
do f=1,nV
do b=1,nV
do n=1,nO
do j=1,spin_occ_num
do f=1,spin_vir_num
do b=1,spin_vir_num
do n=1,spin_occ_num
x = 0.5d0*t2(j,n,f,b) + t1(j,f)*t1(n,b)
do e=1,nV
do m=1,nO
do e=1,spin_vir_num
do m=1,spin_occ_num
cWovvo(m,b,e,j) = cWovvo(m,b,e,j) - x *OOVV(m,n,e,f)
end do
end do
@ -104,11 +102,11 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
cWvvvv(:,:,:,:) = VVVV(:,:,:,:)
do f=1,nV
do e=1,nV
do b=1,nV
do a=1,nV
do m=1,nO
do f=1,spin_vir_num
do e=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
do m=1,spin_occ_num
cWvvvv(a,b,e,f) = cWvvvv(a,b,e,f) - t1(m,b)*VOVV(a,m,e,f) + t1(m,a)*VOVV(b,m,e,f)
end do
end do
@ -116,13 +114,13 @@ subroutine form_cW_nc(nO,nV,t1,t2,tau,cWoooo,cWovvo,cWvvvv)
end do
end do
do f=1,nV
do e=1,nV
do b=1,nV
do a=1,nV
do f=1,spin_vir_num
do e=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
x = 0.d0
do n=1,nO
do m=1,nO
do n=1,spin_occ_num
do m=1,spin_occ_num
x = x + tau(m,n,a,b)*OOVV(m,n,e,f)
end do
end do

View File

@ -1,4 +1,4 @@
subroutine form_g(nO,nV,hvv,hoo,t1,gvv,goo)
subroutine form_g(hvv,hoo,t1,gvv,goo)
! Scuseria Eqs. (9), (10)
@ -6,12 +6,10 @@ subroutine form_g(nO,nV,hvv,hoo,t1,gvv,goo)
! Input variables
integer,intent(in) :: nO,nV
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) :: hvv(nV,nV)
double precision,intent(in) :: hoo(nO,nO)
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t1(spin_occ_num,spin_vir_num)
! Local variables
@ -20,15 +18,15 @@ subroutine form_g(nO,nV,hvv,hoo,t1,gvv,goo)
! Output variables
double precision,intent(out) :: gvv(nV,nV)
double precision,intent(out) :: goo(nO,nO)
double precision,intent(out) :: gvv(spin_vir_num,spin_vir_num)
double precision,intent(out) :: goo(spin_occ_num,spin_occ_num)
gvv(:,:) = hvv(:,:)
do a=1,nV
do c=1,nV
do d=1,nV
do k=1,nO
do a=1,spin_vir_num
do c=1,spin_vir_num
do d=1,spin_vir_num
do k=1,spin_occ_num
gvv(c,a) = gvv(c,a) + VOVV(a,k,c,d)*t1(k,d)
end do
end do
@ -37,10 +35,10 @@ subroutine form_g(nO,nV,hvv,hoo,t1,gvv,goo)
goo(:,:) = hoo(:,:)
do k=1,nO
do i=1,nO
do c=1,nV
do l=1,nO
do k=1,spin_occ_num
do i=1,spin_occ_num
do c=1,spin_vir_num
do l=1,spin_occ_num
goo(i,k) = goo(i,k) + OOOV(k,l,i,c)*t1(l,c)
end do
end do

View File

@ -1,4 +1,4 @@
subroutine form_h(nO,nV,t1,tau,hvv,hoo,hvo)
subroutine form_h(t1,tau,hvv,hoo,hvo)
! Scuseria Eqs. (5), (6) and (7)
@ -6,10 +6,8 @@ subroutine form_h(nO,nV,t1,tau,hvv,hoo,hvo)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: tau(nO,nO,nV,nV)
double precision,intent(in) :: t1(spin_occ_num,spin_vir_num)
double precision,intent(in) :: tau(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
! Local variables
@ -18,18 +16,18 @@ subroutine form_h(nO,nV,t1,tau,hvv,hoo,hvo)
! Output variables
double precision,intent(out) :: hvv(nV,nV)
double precision,intent(out) :: hoo(nO,nO)
double precision,intent(out) :: hvo(nV,nO)
double precision,intent(out) :: hvv(spin_vir_num,spin_vir_num)
double precision,intent(out) :: hoo(spin_occ_num,spin_occ_num)
double precision,intent(out) :: hvo(spin_vir_num,spin_occ_num)
hvv(:,:) = 0d0
do b=1,nV
do b=1,spin_vir_num
hvv(b,b) = eV(b)
do a=1,nV
do j=1,nO
do k=1,nO
do c=1,nV
do a=1,spin_vir_num
do j=1,spin_occ_num
do k=1,spin_occ_num
do c=1,spin_vir_num
hvv(b,a) = hvv(b,a) - OOVV(j,k,b,c)*tau(j,k,a,c)
@ -41,12 +39,12 @@ subroutine form_h(nO,nV,t1,tau,hvv,hoo,hvo)
hoo(:,:) = 0d0
do i=1,nO
do i=1,spin_occ_num
hoo(i,i) = eO(i)
do j=1,nO
do k=1,nO
do b=1,nV
do c=1,nV
do j=1,spin_occ_num
do k=1,spin_occ_num
do b=1,spin_vir_num
do c=1,spin_vir_num
hoo(i,j) = hoo(i,j) + OOVV(j,k,b,c)*tau(i,k,b,c)
@ -58,10 +56,10 @@ subroutine form_h(nO,nV,t1,tau,hvv,hoo,hvo)
hvo(:,:) = 0d0
do j=1,nO
do b=1,nV
do c=1,nV
do k=1,nO
do j=1,spin_occ_num
do b=1,spin_vir_num
do c=1,spin_vir_num
do k=1,spin_occ_num
hvo(b,j) = hvo(b,j) + OOVV(j,k,b,c)*t1(k,c)

View File

@ -1,4 +1,4 @@
subroutine form_r1(nO,nV,hvv,hoo,hvo,t1,t2,tau,r1)
subroutine form_r1(hvv,hoo,hvo,t1,t2,tau,r1)
! Form tau in CCSD
@ -6,15 +6,13 @@ subroutine form_r1(nO,nV,hvv,hoo,hvo,t1,t2,tau,r1)
! Input variables
integer,intent(in) :: nO,nV
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) :: hvv(nV,nV)
double precision,intent(in) :: hoo(nO,nO)
double precision,intent(in) :: hvo(nV,nO)
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: tau(nO,nO,nV,nV)
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
@ -23,44 +21,44 @@ subroutine form_r1(nO,nV,hvv,hoo,hvo,t1,t2,tau,r1)
! Output variables
double precision,intent(out) :: r1(nO,nV)
double precision,intent(out) :: r1(spin_occ_num,spin_vir_num)
r1(:,:) = 0d0
do a=1,nV
do i=1,nO
do a=1,spin_vir_num
do i=1,spin_occ_num
do b=1,nV
do b=1,spin_vir_num
r1(i,a) = r1(i,a) + hvv(b,a)*t1(i,b)
end do
do j=1,nO
do j=1,spin_occ_num
r1(i,a) = r1(i,a) - hoo(i,j)*t1(j,a)
end do
do j=1,nO
do b=1,nV
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,nV
do j=1,nO
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,nV
do b=1,nV
do j=1,nO
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,nV
do k=1,nO
do j=1,nO
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

View File

@ -1,4 +1,4 @@
subroutine form_r1_nc(nO,nV,t1,t2,Fov,cFoo,cFov,cFvv,r1)
subroutine form_r1_nc(t1,t2,Fov,cFoo,cFov,cFvv,r1)
! Form residues for t1 in non-canonical CCSD
@ -6,16 +6,14 @@ subroutine form_r1_nc(nO,nV,t1,t2,Fov,cFoo,cFov,cFvv,r1)
! Input variables
integer,intent(in) :: nO,nV
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) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: Fov(spin_occ_num,spin_vir_num)
double precision,intent(in) :: Fov(nO,nV)
double precision,intent(in) :: cFoo(nO,nO)
double precision,intent(in) :: cFov(nO,nV)
double precision,intent(in) :: cFvv(nV,nV)
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
@ -24,44 +22,44 @@ subroutine form_r1_nc(nO,nV,t1,t2,Fov,cFoo,cFov,cFvv,r1)
! Output variables
double precision,intent(out) :: r1(nO,nV)
double precision,intent(out) :: r1(spin_occ_num,spin_vir_num)
r1(:,:) = Fov(:,:)
do i=1,nO
do a=1,nV
do i=1,spin_occ_num
do a=1,spin_vir_num
do e=1,nV
do e=1,spin_vir_num
r1(i,a) = r1(i,a) + t1(i,e)*cFvv(a,e)
end do
do m=1,nO
do m=1,spin_occ_num
r1(i,a) = r1(i,a) - t1(m,a)*cFoo(m,i)
end do
do m=1,nO
do e=1,nV
do m=1,spin_occ_num
do e=1,spin_vir_num
r1(i,a) = r1(i,a) + t2(i,m,a,e)*cFov(m,e)
end do
end do
do n=1,nO
do f=1,nV
do n=1,spin_occ_num
do f=1,spin_vir_num
r1(i,a) = r1(i,a) - t1(n,f)*OVOV(n,a,i,f)
end do
end do
do m=1,nO
do e=1,nV
do f=1,nV
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(i,m,e,f)*OVVV(m,a,e,f)
end do
end do
end do
do m=1,nO
do n=1,nO
do e=1,nV
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(m,n,a,e)*OOVO(n,m,e,i)
end do
end do

View File

@ -1,4 +1,4 @@
subroutine form_r2(nO,nV,gvv,goo,aoooo,bvvvv,hovvo,t1,t2,tau,r2)
subroutine form_r2(gvv,goo,aoooo,bvvvv,hovvo,t1,t2,tau,r2)
! Form tau in CCSD
@ -6,17 +6,15 @@ subroutine form_r2(nO,nV,gvv,goo,aoooo,bvvvv,hovvo,t1,t2,tau,r2)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: gvv(spin_vir_num,spin_vir_num)
double precision,intent(in) :: goo(spin_occ_num,spin_occ_num)
double precision,intent(in) :: aoooo(spin_occ_num,spin_occ_num,spin_occ_num,spin_occ_num)
double precision,intent(in) :: bvvvv(spin_vir_num,spin_vir_num,spin_vir_num,spin_vir_num)
double precision,intent(in) :: hovvo(spin_occ_num,spin_vir_num,spin_vir_num,spin_occ_num)
double precision,intent(in) :: gvv(nV,nV)
double precision,intent(in) :: goo(nO,nO)
double precision,intent(in) :: aoooo(nO,nO,nO,nO)
double precision,intent(in) :: bvvvv(nV,nV,nV,nV)
double precision,intent(in) :: hovvo(nO,nV,nV,nO)
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: tau(nO,nO,nV,nV)
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
@ -25,106 +23,106 @@ subroutine form_r2(nO,nV,gvv,goo,aoooo,bvvvv,hovvo,t1,t2,tau,r2)
! Output variables
double precision,intent(out) :: r2(nO,nO,nV,nV)
double precision,intent(out) :: r2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
r2(:,:,:,:) = OOVV(:,:,:,:)
!$OMP PARALLEL DO DEFAULT(NONE) &
!$OMP SHARED(nO,nV,r2,aoooo,bvvvv,gvv,goo,tau,OVOO,OVVV,t1,t2,hovvo,OVVO) &
!$OMP SHARED(spin_occ_num,spin_vir_num,r2,aoooo,bvvvv,gvv,goo,tau,OVOO,OVVV,t1,t2,hovvo,OVVO) &
!$OMP PRIVATE(i,j,a,b,k,l,c,d)
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
do k=1,nO
do l=1,nO
do k=1,spin_occ_num
do l=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + aoooo(i,j,k,l)*tau(k,l,a,b)
end do
end do
do d=1,nV
do c=1,nV
do d=1,spin_vir_num
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) + bvvvv(c,d,a,b)*tau(i,j,c,d)
end do
end do
do c=1,nV
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) + gvv(c,a)*t2(i,j,c,b)
end do
do k=1,nO
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + OVOO(k,a,i,j)*t1(k,b)
end do
do c=1,nV
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) - gvv(c,b)*t2(i,j,c,a)
end do
do k=1,nO
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - OVOO(k,b,i,j)*t1(k,a)
end do
do k=1,nO
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - goo(i,k)*t2(k,j,a,b)
end do
do c=1,nV
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) + OVVV(j,c,b,a)*t1(i,c)
end do
do k=1,nO
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + goo(j,k)*t2(k,i,a,b)
end do
do c=1,nV
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) - OVVV(i,c,b,a)*t1(j,c)
end do
do k=1,nO
do c=1,nV
do k=1,spin_occ_num
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) + hovvo(i,c,a,k)*t2(j,k,b,c)
end do
end do
do k=1,nO
do c=1,nV
do k=1,spin_occ_num
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) - OVVO(i,c,a,k)*t1(j,c)*t1(k,b)
end do
end do
do k=1,nO
do c=1,nV
do k=1,spin_occ_num
do c=1,spin_vir_num
r2(i,j,a,b) = r2(i,j,a,b) - hovvo(j,c,a,k)*t2(i,k,b,c)
end do
end do
do c=1,nV
do k=1,nO
do c=1,spin_vir_num
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + OVVO(j,c,a,k)*t1(i,c)*t1(k,b)
end do
end do
do c=1,nV
do k=1,nO
do c=1,spin_vir_num
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - hovvo(i,c,b,k)*t2(j,k,a,c)
end do
end do
do c=1,nV
do k=1,nO
do c=1,spin_vir_num
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + OVVO(i,c,b,k)*t1(j,c)*t1(k,a)
end do
end do
do c=1,nV
do k=1,nO
do c=1,spin_vir_num
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + hovvo(j,c,b,k)*t2(i,k,a,c)
end do
end do
do c=1,nV
do k=1,nO
do c=1,spin_vir_num
do k=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - OVVO(j,c,b,k)*t1(i,c)*t1(k,a)
end do
end do

View File

@ -1,4 +1,4 @@
subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
subroutine form_r2_nc(t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
! Form t2 residues in non-canonical CCSD
@ -6,19 +6,17 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
! Input variables
integer,intent(in) :: nO,nV
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) :: cFoo(nO,nO)
double precision,intent(in) :: cFov(nO,nV)
double precision,intent(in) :: cFvv(nV,nV)
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,intent(in) :: cWoooo(nO,nO,nO,nO)
double precision,intent(in) :: cWvvvv(nV,nV,nV,nV)
double precision,intent(in) :: cWovvo(nO,nV,nV,nO)
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: tau(nO,nO,nV,nV)
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)
double precision :: x
! Local variables
@ -28,15 +26,15 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
! Output variables
double precision,intent(out) :: r2(nO,nO,nV,nV)
double precision,intent(out) :: r2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
r2(:,:,:,:) = OOVV(:,:,:,:)
do e=1,nV
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
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(i,j,a,e)*cFvv(b,e)
end do
end do
@ -45,11 +43,11 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do e=1,nV
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
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(i,j,b,e)*cFvv(a,e)
end do
end do
@ -58,14 +56,14 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do e=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do b=1,spin_vir_num
do e=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
x = 0.5d0*t2(i,j,a,e)
if (x /= 0.d0) then
do m=1,nO
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - x*t1(m,b)*cFov(m,e)
end do
endif
@ -76,14 +74,14 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do e=1,nV
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
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
x = 0.5d0*t2(i,j,b,e)
if (x /= 0.d0) then
do m=1,nO
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + x*t1(m,a)*cFov(m,e)
end do
endif
@ -94,12 +92,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do j=1,nO
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do m=1,spin_occ_num
x = cFoo(m,j)
do i=1,nO
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t2(i,m,a,b)*x
end do
end do
@ -107,11 +105,11 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
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(j,m,a,b)*cFoo(m,i)
end do
end do
@ -120,14 +118,14 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do e=1,nV
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do e=1,spin_vir_num
do m=1,spin_occ_num
x = 0.5d0*cFov(m,e)
if (x == 0.d0) cycle
do j=1,nO
do i=1,nO
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - x*t2(i,m,a,b)*t1(j,e)
end do
end do
@ -137,13 +135,13 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do e=1,nV
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do e=1,spin_vir_num
do m=1,spin_occ_num
x = 0.5d0*cFov(m,e)
do j=1,nO
do i=1,nO
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + x*t2(j,m,a,b)*t1(i,e)
end do
end do
@ -153,12 +151,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do n=1,nO
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
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(m,n,a,b)*cWoooo(m,n,i,j)
end do
end do
@ -168,13 +166,13 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do f=1,nV
do e=1,nV
do b=1,nV
do a=1,nV
do f=1,spin_vir_num
do e=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
x = 0.5d0*cWvvvv(a,b,e,f)
do j=1,nO
do i=1,nO
do j=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + x*tau(i,j,e,f)
end do
end do
@ -184,12 +182,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do j=1,nO
do e=1,nV
do m=1,nO
do i=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
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(i,m,a,e)*cWovvo(m,b,e,j)
end do
end do
@ -198,13 +196,13 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do b=1,nV
do a=1,nV
do j=1,nO
do e=1,nV
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do e=1,spin_vir_num
do m=1,spin_occ_num
x = t1(m,a)*OVVO(m,b,e,j)
do i=1,nO
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t1(i,e)*x
end do
end do
@ -213,12 +211,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do b=1,nV
do e=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do m=1,nO
do b=1,spin_vir_num
do e=1,spin_vir_num
do a=1,spin_vir_num
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(j,m,a,e)*cWovvo(m,b,e,i)
end do
end do
@ -227,12 +225,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do b=1,nV
do a=1,nV
do e=1,nV
do j=1,nO
do i=1,nO
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do e=1,spin_vir_num
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(j,e)*t1(m,a)*OVVO(m,b,e,i)
end do
end do
@ -241,12 +239,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do e=1,nV
do b=1,nV
do a=1,nV
do j=1,nO
do m=1,nO
do i=1,nO
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 m=1,spin_occ_num
do i=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) - t2(i,m,b,e)*cWovvo(m,a,e,j)
end do
end do
@ -255,12 +253,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do b=1,nV
do a=1,nV
do j=1,nO
do e=1,nV
do i=1,nO
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
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(i,e)*t1(m,b)*OVVO(m,a,e,j)
end do
end do
@ -269,12 +267,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do e=1,nV
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do m=1,nO
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
do m=1,spin_occ_num
r2(i,j,a,b) = r2(i,j,a,b) + t2(j,m,b,e)*cWovvo(m,a,e,i)
end do
end do
@ -283,12 +281,12 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do b=1,nV
do e=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do m=1,nO
do b=1,spin_vir_num
do e=1,spin_vir_num
do a=1,spin_vir_num
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(j,e)*t1(m,b)*OVVO(m,a,e,i)
end do
end do
@ -298,11 +296,11 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do j=1,nO
do e=1,nV
do i=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
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(i,e)*VVVO(a,b,e,j)
end do
end do
@ -311,11 +309,11 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do e=1,nV
do i=1,nO
do j=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
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(j,e)*VVVO(a,b,e,i)
end do
end do
@ -324,11 +322,11 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
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(m,a)*OVOO(m,b,i,j)
end do
end do
@ -336,11 +334,11 @@ subroutine form_r2_nc(nO,nV,t1,t2,tau,cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
end do
end do
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do m=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
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(m,b)*OVOO(m,a,i,j)
end do
end do

View File

@ -1,4 +1,4 @@
subroutine form_tau(nO,nV,t1,t2,tau)
subroutine form_tau(t1,t2,tau)
! Form tau in CCSD
@ -6,9 +6,8 @@ subroutine form_tau(nO,nV,t1,t2,tau)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
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)
! Local variables
@ -17,12 +16,12 @@ subroutine form_tau(nO,nV,t1,t2,tau)
! Output variables
double precision,intent(out) :: tau(nO,nO,nV,nV)
double precision,intent(out) :: tau(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
tau(i,j,a,b) = 0.5d0*t2(i,j,a,b) + t1(i,a)*t1(j,b)

View File

@ -1,4 +1,4 @@
subroutine form_tau_nc(nO,nV,t1,t2,tau)
subroutine form_tau_nc(t1,t2,tau)
! Form tau in CCSD
@ -6,9 +6,8 @@ subroutine form_tau_nc(nO,nV,t1,t2,tau)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
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)
! Local variables
@ -17,12 +16,12 @@ subroutine form_tau_nc(nO,nV,t1,t2,tau)
! Output variables
double precision,intent(out) :: tau(nO,nO,nV,nV)
double precision,intent(out) :: tau(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
tau(i,j,a,b) = t2(i,j,a,b) + t1(i,a)*t1(j,b) - t1(i,b)*t1(j,a)

View File

@ -1,4 +1,4 @@
subroutine form_taus_nc(nO,nV,t1,t2,taus)
subroutine form_taus_nc(t1,t2,taus)
! Form tau in CCSD
@ -6,9 +6,8 @@ subroutine form_taus_nc(nO,nV,t1,t2,taus)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t2(nO,nO,nV,nV)
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)
! Local variables
@ -17,12 +16,12 @@ subroutine form_taus_nc(nO,nV,t1,t2,taus)
! Output variables
double precision,intent(out) :: taus(nO,nO,nV,nV)
double precision,intent(out) :: taus(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
do b=1,nV
do a=1,nV
do j=1,nO
do i=1,nO
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do i=1,spin_occ_num
taus(i,j,a,b) = t2(i,j,a,b) + 0.5d0*(t1(i,a)*t1(j,b) - t1(i,b)*t1(j,a))

View File

@ -1,4 +1,4 @@
subroutine form_ub(nO,nV,t1,ub)
subroutine form_ub(t1,ub)
! Form 1st term in (T) correction
@ -6,9 +6,7 @@ subroutine form_ub(nO,nV,t1,ub)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t1(nO,nV)
double precision,intent(in) :: t1(spin_occ_num,spin_vir_num)
! Local variables
@ -17,14 +15,14 @@ subroutine form_ub(nO,nV,t1,ub)
! Output variables
double precision,intent(out) :: ub(nO,nO,nO,nV,nV,nV)
double precision,intent(out) :: ub(spin_occ_num,spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num,spin_vir_num)
do c=1,nV
do b=1,nV
do a=1,nV
do k=1,nO
do j=1,nO
do i=1,nO
do c=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
do k=1,spin_occ_num
do j=1,spin_occ_num
do i=1,spin_occ_num
ub(i,j,k,a,b,c) = t1(i,a)*OOVV(j,k,b,c) &
+ t1(i,b)*OOVV(j,k,c,a) &

View File

@ -1,4 +1,4 @@
subroutine form_ubb(nO,nV,t2,ubb)
subroutine form_ubb(t2,ubb)
! Form 2nd term in (T) correction
@ -6,9 +6,7 @@ subroutine form_ubb(nO,nV,t2,ubb)
! Input variables
integer,intent(in) :: nO,nV
double precision,intent(in) :: t2(nO,nO,nV,nV)
double precision,intent(in) :: t2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
! Local variables
@ -17,18 +15,18 @@ subroutine form_ubb(nO,nV,t2,ubb)
! Output variables
double precision,intent(out) :: ubb(nO,nO,nO,nV,nV,nV)
double precision,intent(out) :: ubb(spin_occ_num,spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num,spin_vir_num)
ubb(:,:,:,:,:,:) = 0d0
do c=1,nV
do b=1,nV
do a=1,nV
do k=1,nO
do j=1,nO
do i=1,nO
do c=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
do k=1,spin_occ_num
do j=1,spin_occ_num
do i=1,spin_occ_num
do e=1,nV
do e=1,spin_vir_num
ubb(i,j,k,a,b,c) = ubb(i,j,k,a,b,c) &
+ t2(i,j,a,e)*VVVO(b,c,e,k) &
+ t2(i,j,b,e)*VVVO(c,a,e,k) &
@ -41,7 +39,7 @@ subroutine form_ubb(nO,nV,t2,ubb)
+ t2(j,k,c,e)*VVVO(a,b,e,i)
end do
do m=1,nO
do m=1,spin_occ_num
ubb(i,j,k,a,b,c) = ubb(i,j,k,a,b,c) &
+ t2(i,m,a,b)*VOOO(c,m,j,k) &
+ t2(i,m,b,c)*VOOO(a,m,j,k) &