1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 22:53:42 +01:00
qp_plugins_scemama/devel/cc/form_r2_nc.irp.f

351 lines
7.8 KiB
FortranFixed
Raw Normal View History

2019-09-14 14:32:41 +02:00
subroutine form_r2_nc(cFoo,cFov,cFvv,cWoooo,cWvvvv,cWovvo,r2)
2019-09-11 17:09:30 +02:00
! Form t2 residues in non-canonical CCSD
implicit none
! Input variables
2019-09-14 14:15:25 +02:00
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)
2019-09-13 21:12:37 +02:00
2019-09-14 14:15:25 +02:00
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)
2019-09-13 21:12:37 +02:00
double precision :: x
2019-09-11 17:09:30 +02:00
! Local variables
2019-09-13 21:12:37 +02:00
integer :: i,j,m,n
integer :: a,b,e,f
2019-09-11 17:09:30 +02:00
! Output variables
2019-09-14 14:15:25 +02:00
double precision,intent(out) :: r2(spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num)
2019-09-11 17:09:30 +02:00
r2(:,:,:,:) = OOVV(:,:,:,:)
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(i,j,a,e)*cFvv(b,e)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(i,j,b,e)*cFvv(a,e)
2019-09-11 17:09:30 +02:00
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-13 21:12:37 +02:00
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
x = 0.5d0*t2_cc(i,j,a,e)
2019-09-13 21:12:37 +02:00
if (x /= 0.d0) then
2019-09-14 14:15:25 +02:00
do m=1,spin_occ_num
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - x*t1_cc(m,b)*cFov(m,e)
2019-09-13 21:12:37 +02:00
end do
endif
2019-09-11 17:09:30 +02:00
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
x = 0.5d0*t2_cc(i,j,b,e)
2019-09-13 21:12:37 +02:00
if (x /= 0.d0) then
2019-09-14 14:15:25 +02:00
do m=1,spin_occ_num
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + x*t1_cc(m,a)*cFov(m,e)
2019-09-13 21:12:37 +02:00
end do
endif
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
do b=1,spin_vir_num
do a=1,spin_vir_num
do j=1,spin_occ_num
do m=1,spin_occ_num
2019-09-13 21:12:37 +02:00
x = cFoo(m,j)
2019-09-14 14:15:25 +02:00
do i=1,spin_occ_num
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(i,m,a,b)*x
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(j,m,a,b)*cFoo(m,i)
2019-09-11 17:09:30 +02:00
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-13 21:12:37 +02:00
2019-09-14 14:15:25 +02:00
do b=1,spin_vir_num
do a=1,spin_vir_num
do e=1,spin_vir_num
do m=1,spin_occ_num
2019-09-13 21:12:37 +02:00
x = 0.5d0*cFov(m,e)
if (x == 0.d0) cycle
2019-09-14 14:15:25 +02:00
do j=1,spin_occ_num
do i=1,spin_occ_num
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - x*t2_cc(i,m,a,b)*t1_cc(j,e)
2019-09-11 17:09:30 +02:00
end do
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-13 21:12:37 +02:00
2019-09-14 14:15:25 +02:00
do b=1,spin_vir_num
do a=1,spin_vir_num
do e=1,spin_vir_num
do m=1,spin_occ_num
2019-09-13 21:12:37 +02:00
x = 0.5d0*cFov(m,e)
2019-09-14 14:15:25 +02:00
do j=1,spin_occ_num
do i=1,spin_occ_num
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + x*t2_cc(j,m,a,b)*t1_cc(i,e)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:32:41 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + 0.5d0*tau_cc(m,n,a,b)*cWoooo(m,n,i,j)
2019-09-11 17:09:30 +02:00
end do
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-14 14:15:25 +02:00
do f=1,spin_vir_num
do e=1,spin_vir_num
do b=1,spin_vir_num
do a=1,spin_vir_num
2019-09-13 21:12:37 +02:00
x = 0.5d0*cWvvvv(a,b,e,f)
2019-09-14 14:15:25 +02:00
do j=1,spin_occ_num
do i=1,spin_occ_num
2019-09-14 14:32:41 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + x*tau_cc(i,j,e,f)
2019-09-11 17:09:30 +02:00
end do
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(i,m,a,e)*cWovvo(m,b,e,j)
2019-09-11 17:09:30 +02:00
end do
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
x = t1_cc(m,a)*OVVO(m,b,e,j)
2019-09-14 14:15:25 +02:00
do i=1,spin_occ_num
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(i,e)*x
2019-09-13 21:12:37 +02:00
end do
end do
2019-09-11 17:09:30 +02:00
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(j,m,a,e)*cWovvo(m,b,e,i)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(j,e)*t1_cc(m,a)*OVVO(m,b,e,i)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t2_cc(i,m,b,e)*cWovvo(m,a,e,j)
2019-09-13 21:12:37 +02:00
end do
end do
2019-09-11 17:09:30 +02:00
end do
2019-09-13 21:12:37 +02:00
end do
end do
end do
2019-09-11 17:09:30 +02:00
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(i,e)*t1_cc(m,b)*OVVO(m,a,e,j)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t2_cc(j,m,b,e)*cWovvo(m,a,e,i)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(j,e)*t1_cc(m,b)*OVVO(m,a,e,i)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(i,e)*VVVO(a,b,e,j)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(j,e)*VVVO(a,b,e,i)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) - t1_cc(m,a)*OVOO(m,b,i,j)
2019-09-13 21:12:37 +02:00
end do
end do
end do
end do
end do
2019-09-14 14:15:25 +02:00
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
2019-09-14 14:20:55 +02:00
r2(i,j,a,b) = r2(i,j,a,b) + t1_cc(m,b)*OVOO(m,a,i,j)
2019-09-13 21:12:37 +02:00
end do
2019-09-11 17:09:30 +02:00
end do
end do
end do
end do
! Final expression of the t2 residue
2019-09-14 14:20:55 +02:00
r2(:,:,:,:) = delta_oovv(:,:,:,:)*t2_cc(:,:,:,:) - r2(:,:,:,:)
2019-09-11 17:09:30 +02:00
end subroutine form_r2_nc