From 56fe012b25688b5a5dbc9af187df28670eab5d2c Mon Sep 17 00:00:00 2001 From: Kevin Gasperich Date: Tue, 15 Nov 2022 14:55:42 -0600 Subject: [PATCH] fixed spin shift problem for complex --- src/davidson/diagonalization_hs2_dressed.irp.f | 4 ++-- src/davidson/diagonalize_ci.irp.f | 2 +- src/determinants/s2_cplx.irp.f | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/davidson/diagonalization_hs2_dressed.irp.f b/src/davidson/diagonalization_hs2_dressed.irp.f index ccde8965..9ebdee63 100644 --- a/src/davidson/diagonalization_hs2_dressed.irp.f +++ b/src/davidson/diagonalization_hs2_dressed.irp.f @@ -1206,7 +1206,7 @@ subroutine davidson_diag_hjj_sjj_complex(dets_in,u_in,H_jj,s2_out,energies,dim_i if (s2_eig) then h_p = s_ do k=1,shift2 - h_p(k,k) = h_p(k,k) + (S_z2_Sz - expected_s2) + h_p(k,k) = h_p(k,k) - expected_s2 enddo if (only_expected_s2) then alpha = 0.1d0 @@ -1252,7 +1252,7 @@ subroutine davidson_diag_hjj_sjj_complex(dets_in,u_in,H_jj,s2_out,energies,dim_i (0.d0,0.d0), s_, size(s_,1)) do k=1,shift2 - s2(k) = dble(s_(k,k)) + S_z2_Sz + s2(k) = dble(s_(k,k)) enddo if (only_expected_s2) then diff --git a/src/davidson/diagonalize_ci.irp.f b/src/davidson/diagonalize_ci.irp.f index 1dde4c63..39e58ab6 100644 --- a/src/davidson/diagonalize_ci.irp.f +++ b/src/davidson/diagonalize_ci.irp.f @@ -310,7 +310,7 @@ END_PROVIDER H_prime(1:N_det,1:N_det) = h_matrix_all_dets_complex(1:N_det,1:N_det) + & alpha * s2_matrix_all_dets(1:N_det,1:N_det) do j=1,N_det - H_prime(j,j) = H_prime(j,j) + alpha*(s_z2_sz - expected_s2) + H_prime(j,j) = H_prime(j,j) - alpha*expected_s2 enddo call lapack_diag_complex(eigenvalues,eigenvectors,H_prime,size(H_prime,1),N_det) ci_electronic_energy_complex(:) = 0.d0 diff --git a/src/determinants/s2_cplx.irp.f b/src/determinants/s2_cplx.irp.f index 4db82f14..4bdf244c 100644 --- a/src/determinants/s2_cplx.irp.f +++ b/src/determinants/s2_cplx.irp.f @@ -20,7 +20,7 @@ subroutine u_0_S2_u_0_complex(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8) call s2_u_0_nstates_complex(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) do i=1,N_st - e_0(i) = dble(u_dot_v_complex(u_0(1,i),v_0(1,i),n))/u_dot_u_complex(u_0(1,i),n) + S_z2_Sz + e_0(i) = dble(u_dot_v_complex(u_0(1,i),v_0(1,i),n))/u_dot_u_complex(u_0(1,i),n) enddo end