2019-06-25 16:46:14 +02:00
|
|
|
use bitmasks
|
2019-06-24 16:42:16 +02:00
|
|
|
|
2019-06-25 16:46:14 +02:00
|
|
|
BEGIN_PROVIDER [real*8, D0tu, (n_act_orb,n_act_orb) ]
|
2019-06-26 01:43:16 +02:00
|
|
|
implicit none
|
2019-06-25 16:46:14 +02:00
|
|
|
BEGIN_DOC
|
2019-06-26 01:43:16 +02:00
|
|
|
! the first-order density matrix in the basis of the starting MOs.
|
|
|
|
! matrix is state averaged.
|
2019-06-25 16:46:14 +02:00
|
|
|
END_DOC
|
2019-06-26 01:43:16 +02:00
|
|
|
integer :: t,u
|
2019-06-25 16:46:14 +02:00
|
|
|
|
2019-06-26 01:43:16 +02:00
|
|
|
do u=1,n_act_orb
|
2019-06-25 16:46:14 +02:00
|
|
|
do t=1,n_act_orb
|
2019-06-26 01:43:16 +02:00
|
|
|
D0tu(t,u) = one_e_dm_mo_alpha_average( list_act(t), list_act(u) ) + &
|
|
|
|
one_e_dm_mo_beta_average ( list_act(t), list_act(u) )
|
|
|
|
enddo
|
|
|
|
enddo
|
2019-06-25 16:46:14 +02:00
|
|
|
|
|
|
|
END_PROVIDER
|
2019-06-24 16:42:16 +02:00
|
|
|
|
2019-06-25 16:46:14 +02:00
|
|
|
BEGIN_PROVIDER [real*8, P0tuvx, (n_act_orb,n_act_orb,n_act_orb,n_act_orb) ]
|
|
|
|
BEGIN_DOC
|
2019-06-29 17:34:20 +02:00
|
|
|
! The second-order density matrix in the basis of the starting MOs ONLY IN THE RANGE OF ACTIVE MOS
|
|
|
|
! The values are state averaged
|
2019-06-25 16:46:14 +02:00
|
|
|
!
|
2019-06-29 17:34:20 +02:00
|
|
|
! We use the spin-free generators of mono-excitations
|
2019-06-25 16:46:14 +02:00
|
|
|
! E_pq destroys q and creates p
|
|
|
|
! D_pq = <0|E_pq|0> = D_qp
|
|
|
|
! P_pqrs = 1/2 <0|E_pq E_rs - delta_qr E_ps|0>
|
|
|
|
!
|
2019-06-29 17:34:20 +02:00
|
|
|
! P0tuvx(p,q,r,s) = chemist notation : 1/2 <0|E_pq E_rs - delta_qr E_ps|0>
|
2019-06-25 16:46:14 +02:00
|
|
|
END_DOC
|
|
|
|
implicit none
|
2019-06-27 23:59:21 +02:00
|
|
|
integer :: t,u,v,x
|
|
|
|
integer :: tt,uu,vv,xx
|
|
|
|
integer :: mu,nu,istate,ispin,jspin,ihole,ipart,jhole,jpart
|
2019-06-25 16:46:14 +02:00
|
|
|
integer :: ierr
|
|
|
|
real*8 :: phase1,phase11,phase12,phase2,phase21,phase22
|
|
|
|
integer :: nu1,nu2,nu11,nu12,nu21,nu22
|
|
|
|
integer :: ierr1,ierr2,ierr11,ierr12,ierr21,ierr22
|
|
|
|
real*8 :: cI_mu(N_states),term
|
|
|
|
integer(bit_kind), dimension(N_int,2) :: det_mu, det_mu_ex
|
|
|
|
integer(bit_kind), dimension(N_int,2) :: det_mu_ex1, det_mu_ex11, det_mu_ex12
|
|
|
|
integer(bit_kind), dimension(N_int,2) :: det_mu_ex2, det_mu_ex21, det_mu_ex22
|
|
|
|
|
2019-06-26 00:51:47 +02:00
|
|
|
if (bavard) then
|
2019-06-29 17:29:32 +02:00
|
|
|
write(6,*) ' providing the 2 body RDM on the active part'
|
2019-06-26 00:51:47 +02:00
|
|
|
endif
|
2019-06-25 16:46:14 +02:00
|
|
|
|
2019-06-27 23:59:21 +02:00
|
|
|
P0tuvx= 0.d0
|
|
|
|
do istate=1,N_states
|
|
|
|
do x = 1, n_act_orb
|
|
|
|
xx = list_act(x)
|
|
|
|
do v = 1, n_act_orb
|
|
|
|
vv = list_act(v)
|
|
|
|
do u = 1, n_act_orb
|
|
|
|
uu = list_act(u)
|
|
|
|
do t = 1, n_act_orb
|
|
|
|
tt = list_act(t)
|
2019-07-16 19:51:53 +02:00
|
|
|
P0tuvx(t,u,v,x) = state_av_act_two_rdm_openmp_spin_trace_mo(t,v,u,x)
|
2019-06-27 23:59:21 +02:00
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2019-06-24 16:42:16 +02:00
|
|
|
END_PROVIDER
|