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/curly_Fock.irp.f

133 lines
3.7 KiB
FortranFixed
Raw Normal View History

2019-09-14 14:42:46 +02:00
BEGIN_PROVIDER [ double precision, c_spin_fock_matrix_mo_oo, (spin_occ_num,spin_occ_num) ]
2019-09-11 17:09:30 +02:00
implicit none
2019-09-14 14:42:46 +02:00
BEGIN_DOC
! Curly F in Occupied-Occupied block
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
2019-09-23 19:29:21 +02:00
do i=1,spin_occ_num
do m=1,spin_occ_num
2019-09-17 23:25:40 +02:00
if (m /= i) then
c_spin_fock_matrix_mo_oo(m,i) = spin_fock_matrix_mo_oo(m,i)
else
c_spin_fock_matrix_mo_oo(m,i) = 0.d0
endif
2019-09-23 19:29:21 +02:00
end do
end do
2019-09-14 14:42:46 +02:00
2019-09-23 19:29:21 +02:00
do e=1,spin_vir_num
do i=1,spin_occ_num
do n=1,spin_occ_num
do m=1,spin_occ_num
c_spin_fock_matrix_mo_oo(m,i) = c_spin_fock_matrix_mo_oo(m,i) +&
OOOV(m,n,i,e) * t1_cc(n,e)
2019-09-11 17:09:30 +02:00
end do
end do
end do
end do
2019-09-23 19:29:21 +02:00
call dgemm('N','T', &
spin_occ_num, spin_occ_num, spin_vir_num, &
0.5d0, spin_fock_matrix_mo_ov, spin_occ_num, &
t1_cc, spin_occ_num, &
1.d0, c_spin_fock_matrix_mo_oo, spin_occ_num)
call dgemm('N','T', &
spin_occ_num, spin_occ_num, spin_vir_num*spin_occ_num*spin_vir_num,&
0.5d0, OOVV, spin_occ_num, &
taus, spin_occ_num, &
1.d0, c_spin_fock_matrix_mo_oo, spin_occ_num)
2019-09-14 14:42:46 +02:00
END_PROVIDER
2019-09-11 17:09:30 +02:00
2019-09-17 23:31:12 +02:00
BEGIN_PROVIDER [ double precision, c_spin_fock_matrix_mo_oo_transp, (spin_occ_num,spin_occ_num) ]
implicit none
BEGIN_DOC
! Transpose of c_spin_fock_matrix_mo_oo
END_DOC
integer :: i,j
do i=1,spin_occ_num
do j=1,spin_occ_num
c_spin_fock_matrix_mo_oo_transp(j,i) = c_spin_fock_matrix_mo_oo(i,j)
enddo
enddo
END_PROVIDER
2019-09-11 17:09:30 +02:00
2019-09-14 14:42:46 +02:00
BEGIN_PROVIDER [ double precision, c_spin_fock_matrix_mo_ov, (spin_occ_num,spin_vir_num) ]
implicit none
BEGIN_DOC
! Curly F in Occupied-Virtual block
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
c_spin_fock_matrix_mo_ov(:,:) = spin_fock_matrix_mo_ov(:,:)
2019-09-14 14:15:25 +02:00
do m=1,spin_occ_num
do e=1,spin_vir_num
2019-09-11 17:09:30 +02:00
2019-09-14 14:15:25 +02:00
do n=1,spin_occ_num
do f=1,spin_vir_num
2019-09-14 14:42:46 +02:00
c_spin_fock_matrix_mo_ov(m,e) = c_spin_fock_matrix_mo_ov(m,e) + t1_cc(n,f)*OOVV(m,n,e,f)
2019-09-11 17:09:30 +02:00
end do
end do
2019-09-14 14:42:46 +02:00
2019-09-11 17:09:30 +02:00
end do
end do
2019-09-14 14:42:46 +02:00
END_PROVIDER
2019-09-11 17:09:30 +02:00
2019-09-14 14:42:46 +02:00
BEGIN_PROVIDER [ double precision, c_spin_fock_matrix_mo_vv, (spin_vir_num,spin_vir_num) ]
implicit none
BEGIN_DOC
! Curly F in Occupied-Virtual block
END_DOC
integer :: i,j,m,n
integer :: a,b,e,f
2019-09-23 19:29:21 +02:00
2019-09-14 14:15:25 +02:00
do a=1,spin_vir_num
do e=1,spin_vir_num
2019-09-14 14:42:46 +02:00
2019-09-17 23:25:40 +02:00
if (a /= e) then
c_spin_fock_matrix_mo_vv(a,e) = spin_fock_matrix_mo_vv(a,e)
else
c_spin_fock_matrix_mo_vv(a,e) = 0.d0
endif
2019-09-14 14:42:46 +02:00
2019-09-23 19:29:21 +02:00
end do
end do
call dgemm('T','N', &
spin_vir_num, spin_vir_num, spin_occ_num, &
-0.5d0, t1_cc, size(t1_cc,1), &
spin_fock_matrix_mo_ov, size(spin_fock_matrix_mo_ov,1), &
1.d0, c_spin_fock_matrix_mo_vv, size(c_spin_fock_matrix_mo_vv,1))
do e=1,spin_vir_num
do a=1,spin_vir_num
do f=1,spin_vir_num
do m=1,spin_occ_num
c_spin_fock_matrix_mo_vv(a,e) = c_spin_fock_matrix_mo_vv(a,e) + &
t1_cc(m,f)*OVVV(m,a,f,e)
2019-09-11 17:09:30 +02:00
end do
end do
end do
end do
2019-09-23 19:29:21 +02:00
call dgemm('T','N', &
spin_vir_num, spin_vir_num, spin_occ_num*spin_occ_num*spin_vir_num,&
-0.5d0, taus, spin_occ_num*spin_occ_num*spin_vir_num, &
OOVV, spin_occ_num*spin_occ_num*spin_vir_num, &
1.d0, c_spin_fock_matrix_mo_vv, spin_vir_num)
2019-09-14 14:42:46 +02:00
END_PROVIDER
2019-09-11 17:09:30 +02:00