9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 14:03:37 +01:00

complex cis and cisd

This commit is contained in:
Kevin Gasperich 2020-07-01 13:20:35 -05:00
parent 10bcd38c45
commit d2dc64c422
5 changed files with 49 additions and 16 deletions

View File

@ -130,9 +130,15 @@ class H_apply(object):
!$OMP END PARALLEL
call dsort(H_jj,iorder,N_det)
if (is_complex) then
do k=1,N_states
psi_coef_complex(iorder(k),k) = (1.d0,0.d0)
enddo
else
do k=1,N_states
psi_coef(iorder(k),k) = 1.d0
enddo
endif
deallocate(H_jj,iorder)
"""
@ -141,7 +147,11 @@ class H_apply(object):
if (s2_eig) then
call make_s2_eigenfunction
endif
if (is_complex) then
SOFT_TOUCH psi_det psi_coef_complex N_det
else
SOFT_TOUCH psi_det psi_coef N_det
endif
"""
s["printout_now"] = """write(6,*) &
100.*float(i_generator)/float(N_det_generators), '% in ', wall_1-wall_0, 's'"""

View File

@ -77,8 +77,13 @@ subroutine run
endif
call ezfio_set_cis_energy(CI_energy)
if (is_complex) then
psi_coef_complex = ci_eigenvectors_complex
SOFT_TOUCH psi_coef_complex
else
psi_coef = ci_eigenvectors
SOFT_TOUCH psi_coef
endif
call save_wavefunction
end

View File

@ -61,16 +61,29 @@ subroutine run
else
call H_apply_cisd
endif
if (is_complex) then
psi_coef_complex = ci_eigenvectors_complex
SOFT_TOUCH psi_coef_complex
else
psi_coef = ci_eigenvectors
SOFT_TOUCH psi_coef
endif
call save_wavefunction
call ezfio_set_cisd_energy(CI_energy)
if (is_complex) then
do i = 1,N_states
k = maxloc(cdabs(psi_coef_sorted_complex(1:N_det,i)),dim=1)
delta_E = CI_electronic_energy(i) - diag_h_mat_elem(psi_det_sorted(1,1,k),N_int)
cisdq(i) = CI_energy(i) + delta_E * (1.d0 - cdabs(psi_coef_sorted_complex(k,i))**2)
enddo
else
do i = 1,N_states
k = maxloc(dabs(psi_coef_sorted(1:N_det,i)),dim=1)
delta_E = CI_electronic_energy(i) - diag_h_mat_elem(psi_det_sorted(1,1,k),N_int)
cisdq(i) = CI_energy(i) + delta_E * (1.d0 - psi_coef_sorted(k,i)**2)
enddo
endif
print *, 'N_det = ', N_det
print*,''
print*,'******************************'

View File

@ -20,8 +20,13 @@ subroutine run_cisd
print*, i ,CI_energy(i) - CI_energy(1)
enddo
endif
if (is_complex) then
psi_coef_complex = ci_eigenvectors_complex
SOFT_TOUCH psi_coef_complex
else
psi_coef = ci_eigenvectors
SOFT_TOUCH psi_coef
endif
call save_wavefunction
call ezfio_set_cisd_energy(CI_energy)

View File

@ -256,7 +256,7 @@ subroutine copy_H_apply_buffer_to_wf
call remove_duplicates_in_psi_det(found_duplicates)
do k=1,N_states
call normalize(psi_coef_complex(1,k),N_det)
call normalize_complex(psi_coef_complex(1,k),N_det)
enddo
SOFT_TOUCH N_det psi_det psi_coef_complex
else