10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-29 08:24:51 +02:00

Corrected bug with S2 in davidson

This commit is contained in:
Anthony Scemama 2016-11-04 17:31:39 +01:00
parent a5a34a02f1
commit 6cea98112e
2 changed files with 10 additions and 28 deletions

View File

@ -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 = <u_k | W_l> = <u_k| H |u_l>
! -------------------------------------------
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
! -------------

View File

@ -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