diff --git a/src/Davidson/diagonalization_hs2.irp.f b/src/Davidson/diagonalization_hs2.irp.f index b2eb8af1..af94f121 100644 --- a/src/Davidson/diagonalization_hs2.irp.f +++ b/src/Davidson/diagonalization_hs2.irp.f @@ -229,13 +229,14 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_jj,energies,dim_in,sze,N_s ! Compute h_kl = = ! ------------------------------------------- - call dgemm('T','N', shift2, N_st_diag, sze, & - 1.d0, U, size(U,1), W(1,shift+1), size(W,1), & - 0.d0, h(1,shift+1), size(h,1)) + call dgemm('T','N', shift2, shift2, sze, & + 1.d0, U(1,1), size(U,1), W(1,1), size(W,1), & + 0.d0, h(1,1), size(h,1)) + + call dgemm('T','N', shift2, shift2, sze, & + 1.d0, U(1,1), size(U,1), S(1,1), size(S,1), & + 0.d0, s_(1,1), size(s_,1)) - call dgemm('T','N', shift2, N_st_diag, sze, & - 1.d0, U, size(U,1), S(1,shift+1), size(S,1), & - 0.d0, s_(1,shift+1), size(s_,1)) ! Diagonalize h ! ------------- diff --git a/src/Determinants/occ_pattern.irp.f b/src/Determinants/occ_pattern.irp.f index 902b54db..6abdf13e 100644 --- a/src/Determinants/occ_pattern.irp.f +++ b/src/Determinants/occ_pattern.irp.f @@ -35,7 +35,7 @@ subroutine occ_pattern_to_dets_size(o,sze,n_alpha,Nint) bmax += popcnt( o(k,1) ) amax -= popcnt( o(k,2) ) enddo - sze = int( min(binom_func(bmax, amax), 1.d8) ) + sze = 2*int( min(binom_func(bmax, amax), 1.d8) ) end @@ -205,26 +205,7 @@ end enddo deallocate(iorder,duplicate,bit_tmp,tmp_array) -! !TODO DEBUG -! integer :: s -! do i=1,N_occ_pattern -! do j=i+1,N_occ_pattern -! s = 0 -! do k=1,N_int -! if((psi_occ_pattern(k,1,j) /= psi_occ_pattern(k,1,i)).or. & -! (psi_occ_pattern(k,2,j) /= psi_occ_pattern(k,2,i))) then -! s=1 -! exit -! endif -! enddo -! if ( s == 0 ) then -! print *, 'Error : occ ', j, 'already in wf' -! call debug_det(psi_occ_pattern(1,1,j),N_int) -! stop -! endif -! enddo -! enddo -! !TODO DEBUG + END_PROVIDER subroutine make_s2_eigenfunction @@ -232,7 +213,7 @@ subroutine make_s2_eigenfunction integer :: i,j,k integer :: smax, s integer(bit_kind), allocatable :: d(:,:,:), det_buffer(:,:,:) - integer :: N_det_new + integer :: N_det_new, iproc integer, parameter :: bufsze = 1000 logical, external :: is_in_wavefunction