From 502e787323f1e2c195ed1b5d7dfd2f71461f8a8a Mon Sep 17 00:00:00 2001 From: Emmanuel Giner LCT Date: Thu, 24 Oct 2019 13:44:40 +0200 Subject: [PATCH] added general svd for new mo --- configure | 3 +++ src/cipsi/pt2_stoch_routines.irp.f | 14 ++++++++++++++ src/determinants/density_matrix.irp.f | 12 ++++++++++++ src/mo_basis/utils.irp.f | 9 +++++++-- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 21df1b71..b1f608d4 100755 --- a/configure +++ b/configure @@ -3,6 +3,9 @@ # Quantum Package configuration script # +unset CC +unset CXX + TEMP=$(getopt -o c:i:h -l config:,install:,help -n $0 -- "$@") || exit 1 eval set -- "$TEMP" diff --git a/src/cipsi/pt2_stoch_routines.irp.f b/src/cipsi/pt2_stoch_routines.irp.f index 7825d24c..412045e1 100644 --- a/src/cipsi/pt2_stoch_routines.irp.f +++ b/src/cipsi/pt2_stoch_routines.irp.f @@ -523,10 +523,24 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc exit else call pull_pt2_results(zmq_socket_pull, index, eI_task, vI_task, nI_task, task_id, n_tasks, b2) + if(n_tasks > pt2_n_tasks_max)then + print*,'PB !!!' + print*,'If you see this, send an email to Anthony scemama with the following content' + print*,irp_here + print*,'n_tasks,pt2_n_tasks_max = ',n_tasks,pt2_n_tasks_max + stop -1 + endif if (zmq_delete_tasks_async_send(zmq_to_qp_run_socket,task_id,n_tasks,sending) == -1) then stop 'PT2: Unable to delete tasks (send)' endif do i=1,n_tasks + if(index(i).gt.size(eI,2).or.index(i).lt.1)then + print*,'PB !!!' + print*,'If you see this, send an email to Anthony scemama with the following content' + print*,irp_here + print*,'i,index(i),size(ei,2) = ',i,index(i),size(ei,2) + stop -1 + endif eI(1:N_states, index(i)) += eI_task(1:N_states,i) vI(1:N_states, index(i)) += vI_task(1:N_states,i) nI(1:N_states, index(i)) += nI_task(1:N_states,i) diff --git a/src/determinants/density_matrix.irp.f b/src/determinants/density_matrix.irp.f index a930d70b..e69a1803 100644 --- a/src/determinants/density_matrix.irp.f +++ b/src/determinants/density_matrix.irp.f @@ -257,6 +257,18 @@ subroutine set_natural_mos double precision, allocatable :: tmp(:,:) label = "Natural" + integer :: i,j,iorb,jorb + do i = 1, n_virt_orb + iorb = list_virt(i) + do j = 1, n_core_inact_act_orb + jorb = list_core_inact_act(j) + if(one_e_dm_mo(iorb,jorb).ne. 0.d0)then + print*,'AHAHAH' + print*,iorb,jorb,one_e_dm_mo(iorb,jorb) + stop + endif + enddo + enddo call mo_as_svd_vectors_of_mo_matrix_eig(one_e_dm_mo,size(one_e_dm_mo,1),mo_num,mo_num,mo_occ,label) soft_touch mo_occ diff --git a/src/mo_basis/utils.irp.f b/src/mo_basis/utils.irp.f index 77dcf866..64ab3499 100644 --- a/src/mo_basis/utils.irp.f +++ b/src/mo_basis/utils.irp.f @@ -238,8 +238,13 @@ subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label) end -subroutine general_mo_coef_new_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,mo_coef_before,eig,mo_coef_new) +subroutine mo_coef_new_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,mo_coef_before,eig,mo_coef_new) implicit none + BEGIN_DOC +! You enter with matrix in the MO basis defined with the mo_coef_before. +! +! You SVD the matrix and set the eigenvectors as mo_coef_new ordered by increasing singular values + END_DOC integer,intent(in) :: lda,m,n double precision, intent(in) :: matrix(lda,n),mo_coef_before(ao_num,m) double precision, intent(out) :: eig(m),mo_coef_new(ao_num,m) @@ -247,7 +252,7 @@ subroutine general_mo_coef_new_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,mo integer :: i,j double precision :: accu double precision, allocatable :: mo_coef_tmp(:,:), U(:,:),D(:), A(:,:), Vt(:,:), work(:) - !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: mo_coef_new, U, Vt, A + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: U, Vt, A call write_time(6) if (m /= mo_num) then