10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-07 22:53:57 +01:00
quantum_package/src/Dets/diagonalize_CI_SC2.irp.f

60 lines
1.7 KiB
FortranFixed
Raw Normal View History

2014-10-07 16:23:19 +02:00
BEGIN_PROVIDER [ double precision, CI_SC2_energy, (N_states_diag) ]
2014-05-30 18:07:04 +02:00
implicit none
BEGIN_DOC
2014-10-07 16:23:19 +02:00
! N_states_diag lowest eigenvalues of the CI matrix
2014-05-30 18:07:04 +02:00
END_DOC
integer :: j
character*(8) :: st
2014-06-02 19:33:42 +02:00
call write_time(output_Dets)
2014-10-07 16:23:19 +02:00
do j=1,N_states_diag
2014-05-30 18:07:04 +02:00
CI_SC2_energy(j) = CI_SC2_electronic_energy(j) + nuclear_repulsion
write(st,'(I4)') j
2014-06-02 19:33:42 +02:00
call write_double(output_Dets,CI_SC2_energy(j),'Energy of state '//trim(st))
2014-05-30 18:07:04 +02:00
enddo
END_PROVIDER
2014-06-06 16:22:54 +02:00
BEGIN_PROVIDER [ double precision, threshold_convergence_SC2]
implicit none
BEGIN_DOC
! convergence of the correlation energy of SC2 iterations
END_DOC
2014-10-06 15:49:16 +02:00
threshold_convergence_SC2 = 1.d-10
2014-06-06 16:22:54 +02:00
END_PROVIDER
2014-10-07 16:23:19 +02:00
BEGIN_PROVIDER [ double precision, CI_SC2_electronic_energy, (N_states_diag) ]
&BEGIN_PROVIDER [ double precision, CI_SC2_eigenvectors, (N_det,N_states_diag) ]
2014-05-30 18:07:04 +02:00
implicit none
BEGIN_DOC
! Eigenvectors/values of the CI matrix
END_DOC
integer :: i,j
2014-10-07 16:23:19 +02:00
do j=1,N_states_diag
2014-05-30 18:07:04 +02:00
do i=1,N_det
2014-10-06 15:49:16 +02:00
CI_SC2_eigenvectors(i,j) = psi_coef(i,j)
2014-05-30 18:07:04 +02:00
enddo
2015-03-19 21:14:52 +01:00
! TODO : check comment
! CI_SC2_electronic_energy(j) = CI_electronic_energy(j)
2014-05-30 18:07:04 +02:00
enddo
call CISD_SC2(psi_det,CI_SC2_eigenvectors,CI_SC2_electronic_energy, &
2014-10-07 16:23:19 +02:00
size(CI_SC2_eigenvectors,1),N_det,N_states_diag,N_int,threshold_convergence_SC2)
2014-05-30 18:07:04 +02:00
END_PROVIDER
subroutine diagonalize_CI_SC2
implicit none
BEGIN_DOC
2014-10-07 16:23:19 +02:00
! Replace the coefficients of the CI states_diag by the coefficients of the
2014-05-30 18:07:04 +02:00
! eigenstates of the CI matrix
END_DOC
integer :: i,j
2014-10-07 16:23:19 +02:00
do j=1,N_states_diag
2014-05-30 18:07:04 +02:00
do i=1,N_det
psi_coef(i,j) = CI_SC2_eigenvectors(i,j)
enddo
enddo
2014-06-04 21:28:43 +02:00
SOFT_TOUCH psi_coef CI_SC2_electronic_energy CI_SC2_energy CI_SC2_eigenvectors
2014-05-30 18:07:04 +02:00
end