1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-12-23 12:54:35 +01:00
qp_plugins_scemama/devel/cc/r1_cc.irp.f

60 lines
2.0 KiB
FortranFixed
Raw Normal View History

2019-09-14 15:01:09 +02:00
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(:,:)
2019-09-23 18:35:53 +02:00
call dgemm('N','T', &
spin_occ_num, spin_vir_num, spin_vir_num, &
1.d0, t1_cc, size(t1_cc,1), &
c_spin_fock_matrix_mo_vv, size(c_spin_fock_matrix_mo_vv,1), &
1.d0, r1_cc, size(r1_cc,1))
call dgemm('T','N', &
spin_occ_num, spin_vir_num, spin_occ_num, &
-1.d0, c_spin_fock_matrix_mo_oo, size(c_spin_fock_matrix_mo_oo,1),&
t1_cc, size(t1_cc,1), &
1.d0, r1_cc, size(r1_cc,1))
2019-09-14 15:01:09 +02:00
2019-09-23 18:35:53 +02:00
call dgemv('T', spin_occ_num*spin_vir_num, &
spin_occ_num*spin_vir_num, &
1.d0, t2_cc2, spin_occ_num*spin_vir_num, &
c_spin_fock_matrix_mo_ov, 1, &
1.d0, r1_cc, 1)
2019-09-23 19:29:21 +02:00
double precision, external :: u_dot_v
2019-09-23 18:35:53 +02:00
do f=1,spin_vir_num
do a=1,spin_vir_num
do i=1,spin_occ_num
2019-09-23 19:29:21 +02:00
r1_cc(i,a) = r1_cc(i,a) - u_dot_v(t1_cc(1,f), OVOV(1,a,i,f),spin_occ_num)
2019-09-14 15:01:09 +02:00
end do
2019-09-23 18:35:53 +02:00
end do
2019-09-14 15:01:09 +02:00
2019-09-23 19:29:21 +02:00
do e=1,spin_vir_num
2019-09-23 18:35:53 +02:00
call dgemm('N','N', &
spin_occ_num, spin_vir_num, spin_occ_num, &
-0.5d0, t2_cc(1,1,e,f), spin_occ_num, &
OVVV(1,1,e,f), spin_occ_num, &
1.d0, r1_cc, spin_occ_num)
enddo
enddo
2019-09-14 15:01:09 +02:00
2019-09-23 18:35:53 +02:00
call dgemm('T','N', &
spin_occ_num, spin_vir_num, spin_occ_num*spin_occ_num*spin_vir_num, &
-0.5d0, OOVO, spin_occ_num*spin_occ_num*spin_vir_num, &
t2_cc, spin_occ_num*spin_occ_num*spin_vir_num, &
1.d0, r1_cc, spin_occ_num)
2019-09-14 15:01:09 +02:00
! Final expression for t1 residue
r1_cc(:,:) = delta_ov(:,:)*t1_cc(:,:) - r1_cc(:,:)
END_PROVIDER