Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/cipsi/selection.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,13 @@ subroutine fill_buffer_$DOUBLE(i_generator, sp, h1, h2, bannedOrb, banned, fock_
stop -1
endif
pt2_matrix = dabs(pt2_matrix)
iwork(1:N_states+1) = maxloc(pt2_matrix,DIM=1)
! pt2_matrix holds the eigenvectors in its columns (column j is the
! eigenvector of eigvalues(j)). State k keeps the eigenvalue of the
! eigenvector whose largest component is in row k. Reading the
! per-column maxloc instead mixed the eigenvector and state indices
! and corrupted e_pert for N_states >= 3 (issue #433).
do k=1,N_states
iwork(k) = maxloc(pt2_matrix(k,1:N_states+1),DIM=1)
e_pert(k) = eigvalues(iwork(k)) - E0(k)
enddo
endif
Expand Down
Loading