10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 22:53:52 +01:00
QuantumPackage/src/two_body_rdm/two_e_dm_mo.irp.f

39 lines
1.3 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
2023-08-22 10:49:59 +02:00
!$OMP PARALLEL DO PRIVATE(i,j,k,l,iorb,jorb,korb,lorb) &
!$OMP DEFAULT(NONE) SHARED(n_core_inact_act_orb, list_core_inact_act, &
!$OMP two_e_dm_mo, state_av_full_occ_2_rdm_spin_trace_mo)
2023-05-05 12:25:37 +02:00
do l=1,n_core_inact_act_orb
2021-03-14 01:14:12 +01:00
lorb = list_core_inact_act(l)
2023-05-05 12:25:37 +02:00
do k=1,n_core_inact_act_orb
2021-03-14 01:14:12 +01:00
korb = list_core_inact_act(k)
2023-05-05 12:25:37 +02:00
do j=1,n_core_inact_act_orb
2021-03-14 01:14:12 +01:00
jorb = list_core_inact_act(j)
2023-05-05 12:25:37 +02:00
do i=1,n_core_inact_act_orb
2021-03-14 01:14:12 +01:00
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
2023-08-22 10:49:59 +02:00
!$OMP END PARALLEL DO
2021-02-22 12:12:30 +01:00
2021-03-14 01:14:12 +01:00
END_PROVIDER