2019-09-14 15:01:09 +02:00
|
|
|
BEGIN_PROVIDER [ double precision, r2_cc, (spin_occ_num,spin_occ_num,spin_vir_num,spin_vir_num) ]
|
2019-09-17 23:25:40 +02:00
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
2019-09-14 15:01:09 +02:00
|
|
|
! t2 residues in non-canonical CCSD
|
2019-09-17 23:25:40 +02:00
|
|
|
END_DOC
|
2019-09-13 21:12:37 +02:00
|
|
|
integer :: i,j,m,n
|
|
|
|
integer :: a,b,e,f
|
2019-09-14 15:01:09 +02:00
|
|
|
double precision :: x
|
2019-09-17 23:25:40 +02:00
|
|
|
double precision, allocatable :: tmp_oo(:,:), tmp_oo2(:,:)
|
2019-09-17 23:31:12 +02:00
|
|
|
double precision, external :: u_dot_v
|
2019-09-11 17:09:30 +02:00
|
|
|
|
2019-09-17 23:25:40 +02:00
|
|
|
allocate ( tmp_oo(spin_occ_num,spin_occ_num) )
|
|
|
|
|
2019-09-14 15:01:09 +02:00
|
|
|
r2_cc(:,:,:,:) = OOVV(:,:,:,:)
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-17 23:31:12 +02:00
|
|
|
do b=1,spin_vir_num
|
|
|
|
do a=1,spin_vir_num
|
|
|
|
if (a == b) cycle
|
|
|
|
|
|
|
|
do e=1,spin_vir_num
|
|
|
|
x = u_dot_v( t1_cc(1,b), c_spin_fock_matrix_mo_ov(1,e), spin_occ_num )
|
|
|
|
x = c_spin_fock_matrix_mo_vv(b,e) - x*0.5d0
|
|
|
|
if (x == 0.d0) cycle
|
|
|
|
tmp_oo(:,:) = t2_cc(:,:,a,e) * x
|
2019-09-17 23:25:40 +02:00
|
|
|
r2_cc(:,:,a,b) = r2_cc(:,:,a,b) + tmp_oo(:,:)
|
|
|
|
r2_cc(:,:,b,a) = r2_cc(:,:,b,a) - tmp_oo(:,:)
|
2019-09-13 21:12:37 +02:00
|
|
|
end do
|
2019-09-11 17:09:30 +02:00
|
|
|
|
2019-09-17 23:31:12 +02:00
|
|
|
do i=1,spin_occ_num
|
|
|
|
do m=1,spin_occ_num
|
|
|
|
tmp_oo(m,i) = t2_cc(i,m,a,b)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
do j=1,spin_occ_num
|
|
|
|
do i=1,spin_occ_num
|
2019-09-17 23:31:12 +02:00
|
|
|
x = 0.d0
|
2019-09-14 14:15:25 +02:00
|
|
|
do m=1,spin_occ_num
|
2019-09-17 23:31:12 +02:00
|
|
|
do e=1,spin_vir_num
|
|
|
|
x = x + c_spin_fock_matrix_mo_ov(m,e) * &
|
|
|
|
( tmp_oo(m,j)*t1_cc(i,e) - &
|
|
|
|
tmp_oo(m,i)*t1_cc(j,e) )
|
2019-09-11 17:09:30 +02:00
|
|
|
end do
|
|
|
|
end do
|
2019-09-17 23:31:12 +02:00
|
|
|
x = x + u_dot_v( tau_cc(1,1,a,b), cWoooo(1,1,i,j), spin_occ_num*spin_occ_num )
|
|
|
|
x = x * 0.5d0 + &
|
|
|
|
u_dot_v( tmp_oo(1,j), c_spin_fock_matrix_mo_oo(1,i), spin_occ_num ) - &
|
|
|
|
u_dot_v( tmp_oo(1,i), c_spin_fock_matrix_mo_oo(1,j), spin_occ_num )
|
|
|
|
do e=1,spin_vir_num
|
|
|
|
x = x - sum(t2_cc(j,:,a,e)*cWovvo(:,b,e,i))
|
2019-09-11 17:09:30 +02:00
|
|
|
end do
|
2019-09-17 23:31:12 +02:00
|
|
|
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + x
|
2019-09-13 21:12:37 +02:00
|
|
|
end do
|
|
|
|
end do
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-17 23:31:12 +02:00
|
|
|
tmp_oo(:,:) = 0.d0
|
|
|
|
do f=1,spin_vir_num
|
|
|
|
do e=1,spin_vir_num
|
2019-09-17 23:25:40 +02:00
|
|
|
x = 0.5d0*cWvvvv(a,b,e,f)
|
2019-09-17 23:31:12 +02:00
|
|
|
if (x == 0.d0) cycle
|
|
|
|
tmp_oo(:,:) = tmp_oo(:,:) + x*tau_cc(:,:,e,f)
|
2019-09-13 21:12:37 +02:00
|
|
|
end do
|
|
|
|
end do
|
2019-09-17 23:31:12 +02:00
|
|
|
r2_cc(:,:,a,b) = r2_cc(:,:,a,b) + tmp_oo(:,:)
|
2019-09-17 23:25:40 +02:00
|
|
|
|
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
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-17 23:31:12 +02:00
|
|
|
r2_cc(i,j,a,b) = r2_cc(i,j,a,b) + t2_cc(i,m,a,e)*cWovvo(m,b,e,j) - t1_cc(i,e)*x
|
|
|
|
enddo
|
2019-09-13 21:12:37 +02:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-17 23:31:12 +02:00
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
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 15:01:09 +02:00
|
|
|
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)
|
2019-09-13 21:12:37 +02:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-17 23:31:12 +02:00
|
|
|
do e=1,spin_vir_num
|
2019-09-17 23:25:40 +02:00
|
|
|
do j=1,spin_occ_num
|
|
|
|
do m=1,spin_occ_num
|
|
|
|
do i=1,spin_occ_num
|
|
|
|
r2_cc(i,j,a,b) = r2_cc(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
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
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-17 23:25:40 +02:00
|
|
|
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)
|
2019-09-13 21:12:37 +02:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-17 23:31:12 +02:00
|
|
|
do e=1,spin_vir_num
|
2019-09-14 14:15:25 +02:00
|
|
|
do j=1,spin_occ_num
|
|
|
|
do i=1,spin_occ_num
|
|
|
|
do m=1,spin_occ_num
|
2019-09-17 23:25:40 +02:00
|
|
|
r2_cc(i,j,a,b) = r2_cc(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
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-17 23:31:12 +02:00
|
|
|
do e=1,spin_vir_num
|
2019-09-14 14:15:25 +02:00
|
|
|
do j=1,spin_occ_num
|
|
|
|
do i=1,spin_occ_num
|
|
|
|
do m=1,spin_occ_num
|
2019-09-14 15:01:09 +02:00
|
|
|
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)
|
2019-09-13 21:12:37 +02:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
2019-09-17 23:25:40 +02:00
|
|
|
|
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
do j=1,spin_occ_num
|
|
|
|
do e=1,spin_vir_num
|
|
|
|
do i=1,spin_occ_num
|
2019-09-17 23:25:40 +02:00
|
|
|
r2_cc(i,j,a,b) = r2_cc(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
|
2019-09-17 23:25:40 +02:00
|
|
|
|
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
do e=1,spin_vir_num
|
|
|
|
do i=1,spin_occ_num
|
|
|
|
do j=1,spin_occ_num
|
2019-09-14 15:01:09 +02:00
|
|
|
r2_cc(i,j,a,b) = r2_cc(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
|
2019-09-17 23:25:40 +02:00
|
|
|
|
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
do j=1,spin_occ_num
|
|
|
|
do i=1,spin_occ_num
|
|
|
|
do m=1,spin_occ_num
|
2019-09-17 23:25:40 +02:00
|
|
|
r2_cc(i,j,a,b) = r2_cc(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
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-14 14:15:25 +02:00
|
|
|
do j=1,spin_occ_num
|
|
|
|
do i=1,spin_occ_num
|
|
|
|
do m=1,spin_occ_num
|
2019-09-14 15:01:09 +02:00
|
|
|
r2_cc(i,j,a,b) = r2_cc(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
|
2019-09-17 23:25:40 +02:00
|
|
|
|
|
|
|
! Final expression of the t2 residue
|
|
|
|
|
2019-09-14 15:01:09 +02:00
|
|
|
r2_cc(:,:,:,:) = delta_oovv(:,:,:,:)*t2_cc(:,:,:,:) - r2_cc(:,:,:,:)
|
2019-09-17 23:25:40 +02:00
|
|
|
|
2019-09-14 15:01:09 +02:00
|
|
|
END_PROVIDER
|