From 7c2ed4214ed0f387357d762fb50a90588445e5ec Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 18 Sep 2016 00:33:19 +0200 Subject: [PATCH] Corrected S2 for MRCC --- plugins/MRCC_Utils/davidson.irp.f | 7 ++++--- plugins/MRCC_Utils/mrcc_utils.irp.f | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/MRCC_Utils/davidson.irp.f b/plugins/MRCC_Utils/davidson.irp.f index 746fef7a..ece34dee 100644 --- a/plugins/MRCC_Utils/davidson.irp.f +++ b/plugins/MRCC_Utils/davidson.irp.f @@ -404,14 +404,14 @@ subroutine u_0_H_u_0_mrcc_nstates(e_0,u_0,n,keys_tmp,Nint,istate,N_st,sze_8) END_DOC integer, intent(in) :: n,Nint,N_st,sze_8 double precision, intent(out) :: e_0(N_st) - double precision, intent(in) :: u_0(n,N_st) + double precision, intent(in) :: u_0(sze_8,N_st) integer(bit_kind),intent(in) :: keys_tmp(Nint,2,n) integer,intent(in) :: istate - double precision :: H_jj(n) - double precision :: v_0(n,N_st) + double precision, allocatable :: v_0(:,:), H_jj(:) double precision :: u_dot_u,u_dot_v,diag_H_mat_elem integer :: i,j + allocate(H_jj(n), v_0(sze_8,N_st)) do i = 1, n H_jj(i) = diag_H_mat_elem(keys_tmp(1,1,i),Nint) enddo @@ -424,6 +424,7 @@ subroutine u_0_H_u_0_mrcc_nstates(e_0,u_0,n,keys_tmp,Nint,istate,N_st,sze_8) do i=1,N_st e_0(i) = u_dot_v(v_0(1,i),u_0(1,i),n)/u_dot_u(u_0(1,i),n) enddo + deallocate(H_jj, v_0) end diff --git a/plugins/MRCC_Utils/mrcc_utils.irp.f b/plugins/MRCC_Utils/mrcc_utils.irp.f index 9c638845..c2f57369 100644 --- a/plugins/MRCC_Utils/mrcc_utils.irp.f +++ b/plugins/MRCC_Utils/mrcc_utils.irp.f @@ -246,7 +246,7 @@ END_PROVIDER psi_coef(i,j) = CI_eigenvectors_dressed(i,j) enddo enddo - call u_0_H_u_0_nstates(e_array,psi_coef,n_det,psi_det,N_int,N_states_diag,psi_det_size) + call u_0_H_u_0_mrcc_nstates(e_array,psi_coef,n_det,psi_det,N_int,mrcc_state,N_states_diag,psi_det_size) ! Browsing the "n_states_diag" states and getting the lowest in energy "n_states" ones that have the S^2 value ! closer to the "expected_s2" set as input