10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 20:35:19 +01:00

Single state diagonalization in MRCC

This commit is contained in:
Anthony Scemama 2016-11-20 22:55:10 +01:00
parent 7f9d19346e
commit f2fdcb379d
2 changed files with 13 additions and 11 deletions

View File

@ -150,17 +150,15 @@ END_PROVIDER
allocate (eigenvectors(size(CI_eigenvectors_dressed,1),size(CI_eigenvectors_dressed,2)), &
eigenvalues(size(CI_electronic_energy_dressed,1)))
do mrcc_state=1,N_states
do j=1,min(N_states,N_det)
do i=1,N_det
eigenvectors(i,j) = psi_coef(i,j)
enddo
do i=1,N_det
eigenvectors(i,1) = psi_coef(i,mrcc_state)
enddo
call davidson_diag_mrcc_HS2(psi_det,eigenvectors,&
size(eigenvectors,1), &
eigenvalues,N_det,N_states,N_states_diag,N_int, &
eigenvalues,N_det,1,N_states_diag,N_int, &
output_determinants,mrcc_state)
CI_eigenvectors_dressed(1:N_det,mrcc_state) = eigenvectors(1:N_det,mrcc_state)
CI_electronic_energy_dressed(mrcc_state) = eigenvalues(mrcc_state)
CI_eigenvectors_dressed(1:N_det,mrcc_state) = eigenvectors(1:N_det,1)
CI_electronic_energy_dressed(mrcc_state) = eigenvalues(1)
if (mrcc_state == 1) then
do k=N_states+1,N_states_diag
CI_eigenvectors_dressed(1:N_det,k) = eigenvectors(1:N_det,k)

View File

@ -41,11 +41,15 @@ subroutine run(N_st,energy)
print *, 'MRCEPA0 Iteration', iteration
print *, '==========================='
print *, ''
E_old = sum(ci_energy_dressed)
call write_double(6,ci_energy_dressed(1),"MRCEPA0 energy")
E_old = sum(ci_energy_dressed(1:N_states))
do i=1,N_st
call write_double(6,ci_energy_dressed(i),"MRCEPA0 energy")
enddo
call diagonalize_ci_dressed(lambda)
E_new = sum(ci_energy_dressed)
delta_E = dabs(E_new - E_old)
E_new = sum(ci_energy_dressed(1:N_states))
delta_E = (E_new - E_old)/dble(N_states)
call write_double(6,delta_E,"delta_E")
delta_E = dabs(delta_E)
call save_wavefunction
call ezfio_set_mrcepa0_energy(ci_energy_dressed(1))
if (iteration >= n_it_mrcc_max) then