9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-06-29 15:54:42 +02:00
qp2/src/two_body_rdm/two_e_dm_mo.irp.f

36 lines
1.1 KiB
Fortran
Raw Normal View History

2021-04-17 02:18:57 +02:00
BEGIN_PROVIDER [double precision, two_e_dm_mo, (mo_num,mo_num,mo_num,mo_num)]
2021-02-22 12:12:30 +01:00
implicit none
BEGIN_DOC
2022-01-11 11:25:48 +01:00
! \sum_{\sigma \sigma'}
! <Psi| a^{\dagger}_{i \sigma} a^{\dagger}_{j \sigma'} a_{l \sigma'} a_{k \sigma} |Psi>
2021-02-22 12:12:30 +01:00
!
2021-05-20 18:19:44 +02:00
! where the indices (i,j,k,l) belong to all MOs.
2021-02-22 12:12:30 +01:00
!
2021-05-20 18:19:44 +02:00
! The normalization (i.e. sum of diagonal elements) is set to $N_{elec} * (N_{elec} - 1)/2$
2021-02-22 12:12:30 +01:00
!
2021-05-20 18:19:44 +02:00
! !!!!! WARNING !!!!! IF "no_core_density" then all elements involving at least one CORE MO are set to zero
! The state-averaged two-electron energy :
2021-02-22 12:12:30 +01:00
!
2022-01-11 11:25:48 +01:00
! \sum_{i,j,k,l = 1, mo_num} two_e_dm_mo(i,j,k,l) * < kk ll | ii jj >
2021-02-22 12:12:30 +01:00
END_DOC
two_e_dm_mo = 0.d0
integer :: i,j,k,l,iorb,jorb,korb,lorb,istate
2021-03-14 01:14:12 +01:00
do l=1,mo_num
lorb = list_core_inact_act(l)
do k=1,mo_num
korb = list_core_inact_act(k)
do j=1,mo_num
jorb = list_core_inact_act(j)
do i=1,mo_num
iorb = list_core_inact_act(i)
2021-04-17 02:18:57 +02:00
two_e_dm_mo(iorb,jorb,korb,lorb) = state_av_full_occ_2_rdm_spin_trace_mo(i,j,k,l)
2021-03-14 01:14:12 +01:00
enddo
enddo
enddo
2021-02-22 12:12:30 +01:00
enddo
2021-04-17 02:18:57 +02:00
two_e_dm_mo(:,:,:,:) = two_e_dm_mo(:,:,:,:) * 2.d0
2021-02-22 12:12:30 +01:00
2021-03-14 01:14:12 +01:00
END_PROVIDER