mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-08-15 00:38:34 +02:00
complex determinants
This commit is contained in:
parent
31e04c2ab6
commit
c0ee3714e6
@ -21,11 +21,19 @@ BEGIN_PROVIDER [ double precision, barycentric_electronic_energy, (N_states) ]
|
|||||||
|
|
||||||
barycentric_electronic_energy(:) = 0.d0
|
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 istate=1,N_states
|
||||||
do i=1,N_det
|
do i=1,N_det
|
||||||
barycentric_electronic_energy(istate) += psi_coef(i,istate)*psi_coef(i,istate)*diagonal_H_matrix_on_psi_det(i)
|
barycentric_electronic_energy(istate) += psi_coef(i,istate)*psi_coef(i,istate)*diagonal_H_matrix_on_psi_det(i)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
endif
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
@ -30,6 +30,66 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint)
|
|||||||
stop -1
|
stop -1
|
||||||
endif
|
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
|
! Occupied MOs
|
||||||
do ii=1,elec_alpha_num
|
do ii=1,elec_alpha_num
|
||||||
i = occ(ii,1)
|
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)
|
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_two_e_integrals_jj(i,j)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
endif
|
||||||
|
|
||||||
fock_diag_tmp(1,mo_num+1) = E0
|
fock_diag_tmp(1,mo_num+1) = E0
|
||||||
fock_diag_tmp(2,mo_num+1) = E0
|
fock_diag_tmp(2,mo_num+1) = E0
|
||||||
|
@ -401,12 +401,21 @@ BEGIN_PROVIDER [ double precision, weight_occ_pattern, (N_occ_pattern,N_states)
|
|||||||
END_DOC
|
END_DOC
|
||||||
integer :: i,j,k
|
integer :: i,j,k
|
||||||
weight_occ_pattern = 0.d0
|
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
|
do i=1,N_det
|
||||||
j = det_to_occ_pattern(i)
|
j = det_to_occ_pattern(i)
|
||||||
do k=1,N_states
|
do k=1,N_states
|
||||||
weight_occ_pattern(j,k) += psi_coef(i,k) * psi_coef(i,k)
|
weight_occ_pattern(j,k) += psi_coef(i,k) * psi_coef(i,k)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
endif
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, weight_occ_pattern_average, (N_occ_pattern) ]
|
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
|
END_DOC
|
||||||
integer :: i,j,k
|
integer :: i,j,k
|
||||||
weight_occ_pattern_average(:) = 0.d0
|
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
|
do i=1,N_det
|
||||||
j = det_to_occ_pattern(i)
|
j = det_to_occ_pattern(i)
|
||||||
do k=1,N_states
|
do k=1,N_states
|
||||||
weight_occ_pattern_average(j) += psi_coef(i,k) * psi_coef(i,k) * state_average_weight(k)
|
weight_occ_pattern_average(j) += psi_coef(i,k) * psi_coef(i,k) * state_average_weight(k)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
endif
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, psi_occ_pattern_sorted, (N_int,2,N_occ_pattern) ]
|
BEGIN_PROVIDER [ double precision, psi_occ_pattern_sorted, (N_int,2,N_occ_pattern) ]
|
||||||
|
Loading…
Reference in New Issue
Block a user