mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
complex cis and cisd
This commit is contained in:
parent
10bcd38c45
commit
d2dc64c422
@ -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'"""
|
||||
|
@ -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
|
||||
|
@ -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*,'******************************'
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user