9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-09 06:53:38 +01:00
qp2/src/casscf/tot_en.irp.f

102 lines
3.0 KiB
Fortran
Raw Normal View History

2019-06-24 16:42:16 +02:00
BEGIN_PROVIDER [real*8, etwo]
&BEGIN_PROVIDER [real*8, eone]
&BEGIN_PROVIDER [real*8, eone_bis]
&BEGIN_PROVIDER [real*8, etwo_bis]
&BEGIN_PROVIDER [real*8, etwo_ter]
&BEGIN_PROVIDER [real*8, ecore]
&BEGIN_PROVIDER [real*8, ecore_bis]
2019-06-25 16:46:14 +02:00
implicit none
integer :: t,u,v,x,i,ii,tt,uu,vv,xx,j,jj,t3,u3,v3,x3
real*8 :: e_one_all,e_two_all
e_one_all=0.D0
e_two_all=0.D0
2019-07-02 22:52:47 +02:00
do i=1,n_core_inact_orb
ii=list_core_inact(i)
2019-06-25 16:46:14 +02:00
e_one_all+=2.D0*mo_one_e_integrals(ii,ii)
2019-07-02 22:52:47 +02:00
do j=1,n_core_inact_orb
jj=list_core_inact(j)
2019-06-25 16:46:14 +02:00
e_two_all+=2.D0*bielec_PQxx(ii,ii,j,j)-bielec_PQxx(ii,jj,j,i)
end do
do t=1,n_act_orb
tt=list_act(t)
2019-07-02 22:52:47 +02:00
t3=t+n_core_inact_orb
2019-06-25 16:46:14 +02:00
do u=1,n_act_orb
2019-06-24 16:42:16 +02:00
uu=list_act(u)
2019-07-02 22:52:47 +02:00
u3=u+n_core_inact_orb
2019-06-25 16:46:14 +02:00
e_two_all+=D0tu(t,u)*(2.D0*bielec_PQxx(tt,uu,i,i) &
-bielec_PQxx(tt,ii,i,u3))
end do
end do
end do
do t=1,n_act_orb
tt=list_act(t)
do u=1,n_act_orb
uu=list_act(u)
e_one_all+=D0tu(t,u)*mo_one_e_integrals(tt,uu)
do v=1,n_act_orb
2019-07-02 22:52:47 +02:00
v3=v+n_core_inact_orb
2019-06-25 16:46:14 +02:00
do x=1,n_act_orb
2019-07-02 22:52:47 +02:00
x3=x+n_core_inact_orb
2019-06-25 16:46:14 +02:00
e_two_all +=P0tuvx(t,u,v,x)*bielec_PQxx(tt,uu,v3,x3)
2019-06-24 16:42:16 +02:00
end do
end do
2019-06-25 16:46:14 +02:00
end do
end do
ecore =nuclear_repulsion
ecore_bis=nuclear_repulsion
2019-07-02 22:52:47 +02:00
do i=1,n_core_inact_orb
ii=list_core_inact(i)
2019-06-25 16:46:14 +02:00
ecore +=2.D0*mo_one_e_integrals(ii,ii)
ecore_bis+=2.D0*mo_one_e_integrals(ii,ii)
2019-07-02 22:52:47 +02:00
do j=1,n_core_inact_orb
jj=list_core_inact(j)
2019-06-25 16:46:14 +02:00
ecore +=2.D0*bielec_PQxx(ii,ii,j,j)-bielec_PQxx(ii,jj,j,i)
ecore_bis+=2.D0*bielec_PxxQ(ii,i,j,jj)-bielec_PxxQ(ii,j,j,ii)
end do
end do
eone =0.D0
eone_bis=0.D0
etwo =0.D0
etwo_bis=0.D0
etwo_ter=0.D0
do t=1,n_act_orb
tt=list_act(t)
2019-07-02 22:52:47 +02:00
t3=t+n_core_inact_orb
2019-06-25 16:46:14 +02:00
do u=1,n_act_orb
uu=list_act(u)
2019-07-02 22:52:47 +02:00
u3=u+n_core_inact_orb
2019-06-25 16:46:14 +02:00
eone +=D0tu(t,u)*mo_one_e_integrals(tt,uu)
eone_bis+=D0tu(t,u)*mo_one_e_integrals(tt,uu)
2019-07-02 22:52:47 +02:00
do i=1,n_core_inact_orb
ii=list_core_inact(i)
2019-06-25 16:46:14 +02:00
eone +=D0tu(t,u)*(2.D0*bielec_PQxx(tt,uu,i,i) &
-bielec_PQxx(tt,ii,i,u3))
eone_bis+=D0tu(t,u)*(2.D0*bielec_PxxQ(tt,u3,i,ii) &
-bielec_PxxQ(tt,i,i,uu))
2019-06-24 16:42:16 +02:00
end do
2019-06-25 16:46:14 +02:00
do v=1,n_act_orb
vv=list_act(v)
2019-07-02 22:52:47 +02:00
v3=v+n_core_inact_orb
2019-06-25 16:46:14 +02:00
do x=1,n_act_orb
2019-06-24 16:42:16 +02:00
xx=list_act(x)
2019-07-02 22:52:47 +02:00
x3=x+n_core_inact_orb
2019-06-25 16:46:14 +02:00
real*8 :: h1,h2,h3
h1=bielec_PQxx(tt,uu,v3,x3)
h2=bielec_PxxQ(tt,u3,v3,xx)
h3=bielecCI(t,u,v,xx)
2019-06-24 16:42:16 +02:00
etwo +=P0tuvx(t,u,v,x)*h1
etwo_bis+=P0tuvx(t,u,v,x)*h2
etwo_ter+=P0tuvx(t,u,v,x)*h3
if ((h1.ne.h2).or.(h1.ne.h3)) then
2019-06-25 16:46:14 +02:00
write(6,9901) t,u,v,x,h1,h2,h3
9901 format('aie: ',4I4,3E20.12)
2019-06-24 16:42:16 +02:00
end if
end do
end do
2019-06-25 16:46:14 +02:00
end do
end do
2019-06-24 16:42:16 +02:00
END_PROVIDER
2019-06-25 16:46:14 +02:00