1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 14:43:41 +01:00
This commit is contained in:
Anthony Scemama 2020-12-24 00:25:57 +01:00
parent aa7ac08615
commit b177795477
2 changed files with 9 additions and 7 deletions

View File

@ -8,7 +8,7 @@ BEGIN_PROVIDER [ double precision, energy_det_i, (N_det) ]
do k=1,N_det do k=1,N_det
call bitstring_to_list(psi_det(1,1,k), list, n, N_int) call bitstring_to_list(psi_det(1,1,k), list, n, N_int)
energy_det_i(k) = nuclear_repulsion energy_det_i(k) = 0.d0
do i=1,n do i=1,n
energy_det_i(k) += fock_matrix_diag_mo(list(i)) energy_det_i(k) += fock_matrix_diag_mo(list(i))
enddo enddo

View File

@ -13,20 +13,22 @@ program mpn
call generate_fci_space call generate_fci_space
allocate(c_pert(N_det,0:mp_order)) allocate(c_pert(N_det,0:mp_order))
allocate(s2(N_det)) allocate(s2(N_det))
allocate(e_pert(mp_order+1)) allocate(e_pert(0:mp_order))
e_pert = 0.d0 e_pert(0) = energy_det_i(1)
c_pert(:,:) = 0.d0 c_pert(:,:) = 0.d0
c_pert(1,0) = 1.d0 c_pert(1,0) = 1.d0
e_pert(1) = nuclear_repulsion e_pert(1) = hf_energy - e_pert(0) - nuclear_repulsion
do k=1,mp_order do k=1,mp_order
! H_ij C^(k-1) ! H_ij C^(k-1)
call h_s2_u_0_nstates_zmq(c_pert(1,k),s2,c_pert(1,k-1),1,N_det) call h_s2_u_0_nstates_zmq(c_pert(1,k),s2,c_pert(1,k-1),1,N_det)
if (k>1) then
e_pert(k) += c_pert(1,k) e_pert(k) += c_pert(1,k)
print *, k, e_pert(k), sum(e_pert) endif
print *, k, e_pert(k), sum(e_pert) + nuclear_repulsion
c_pert(1,k) = 0.d0
c_pert(:,k) = -c_pert(:,k) c_pert(:,k) = -c_pert(:,k)
c_pert(1,k) = 0.d0
do l=1,k do l=1,k
do i=2,N_det do i=2,N_det
c_pert(i,k) = c_pert(i,k) + e_pert(l) * c_pert(i,k-l) c_pert(i,k) = c_pert(i,k) + e_pert(l) * c_pert(i,k-l)