9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-23 03:53:29 +01:00

complex determinants

This commit is contained in:
Kevin Gasperich 2020-02-19 14:55:00 -06:00
parent 31e04c2ab6
commit c0ee3714e6
3 changed files with 87 additions and 0 deletions

View File

@ -21,11 +21,19 @@ BEGIN_PROVIDER [ double precision, barycentric_electronic_energy, (N_states) ]
barycentric_electronic_energy(:) = 0.d0
if (is_complex) then
do istate=1,N_states
do i=1,N_det
barycentric_electronic_energy(istate) += cdabs(psi_coef_complex(i,istate)*psi_coef_complex(i,istate))*diagonal_H_matrix_on_psi_det(i)
enddo
enddo
else
do istate=1,N_states
do i=1,N_det
barycentric_electronic_energy(istate) += psi_coef(i,istate)*psi_coef(i,istate)*diagonal_H_matrix_on_psi_det(i)
enddo
enddo
endif
END_PROVIDER

View File

@ -29,7 +29,67 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint)
call debug_det(det_ref,N_int)
stop -1
endif
if (is_complex) then
! Occupied MOs
do ii=1,elec_alpha_num
i = occ(ii,1)
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + dble(mo_one_e_integrals_complex(i,i))
E0 = E0 + dble(mo_one_e_integrals_complex(i,i))
do jj=1,elec_alpha_num
j = occ(jj,1)
if (i==j) cycle
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj_anti(i,j)
E0 = E0 + 0.5d0*mo_two_e_integrals_jj_anti(i,j)
enddo
do jj=1,elec_beta_num
j = occ(jj,2)
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj(i,j)
E0 = E0 + mo_two_e_integrals_jj(i,j)
enddo
enddo
do ii=1,elec_beta_num
i = occ(ii,2)
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + dble(mo_one_e_integrals_complex(i,i))
E0 = E0 + dble(mo_one_e_integrals_complex(i,i))
do jj=1,elec_beta_num
j = occ(jj,2)
if (i==j) cycle
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj_anti(i,j)
E0 = E0 + 0.5d0*mo_two_e_integrals_jj_anti(i,j)
enddo
do jj=1,elec_alpha_num
j = occ(jj,1)
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj(i,j)
enddo
enddo
! Virtual MOs
do i=1,mo_num
if (fock_diag_tmp(1,i) /= 0.d0) cycle
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + dble(mo_one_e_integrals_complex(i,i))
do jj=1,elec_alpha_num
j = occ(jj,1)
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj_anti(i,j)
enddo
do jj=1,elec_beta_num
j = occ(jj,2)
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_two_e_integrals_jj(i,j)
enddo
enddo
do i=1,mo_num
if (fock_diag_tmp(2,i) /= 0.d0) cycle
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + dble(mo_one_e_integrals_complex(i,i))
do jj=1,elec_beta_num
j = occ(jj,2)
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj_anti(i,j)
enddo
do jj=1,elec_alpha_num
j = occ(jj,1)
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj(i,j)
enddo
enddo
else
! Occupied MOs
do ii=1,elec_alpha_num
i = occ(ii,1)
@ -88,6 +148,7 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint)
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj(i,j)
enddo
enddo
endif
fock_diag_tmp(1,mo_num+1) = E0
fock_diag_tmp(2,mo_num+1) = E0

View File

@ -401,12 +401,21 @@ BEGIN_PROVIDER [ double precision, weight_occ_pattern, (N_occ_pattern,N_states)
END_DOC
integer :: i,j,k
weight_occ_pattern = 0.d0
if (is_complex) then
do i=1,N_det
j = det_to_occ_pattern(i)
do k=1,N_states
weight_occ_pattern(j,k) += cdabs(psi_coef_complex(i,k) * psi_coef_complex(i,k))
enddo
enddo
else
do i=1,N_det
j = det_to_occ_pattern(i)
do k=1,N_states
weight_occ_pattern(j,k) += psi_coef(i,k) * psi_coef(i,k)
enddo
enddo
endif
END_PROVIDER
BEGIN_PROVIDER [ double precision, weight_occ_pattern_average, (N_occ_pattern) ]
@ -416,12 +425,21 @@ BEGIN_PROVIDER [ double precision, weight_occ_pattern_average, (N_occ_pattern) ]
END_DOC
integer :: i,j,k
weight_occ_pattern_average(:) = 0.d0
if (is_complex) then
do i=1,N_det
j = det_to_occ_pattern(i)
do k=1,N_states
weight_occ_pattern_average(j) += cdabs(psi_coef_complex(i,k) * psi_coef_complex(i,k)) * state_average_weight(k)
enddo
enddo
else
do i=1,N_det
j = det_to_occ_pattern(i)
do k=1,N_states
weight_occ_pattern_average(j) += psi_coef(i,k) * psi_coef(i,k) * state_average_weight(k)
enddo
enddo
endif
END_PROVIDER
BEGIN_PROVIDER [ double precision, psi_occ_pattern_sorted, (N_int,2,N_occ_pattern) ]