9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01:00

Davidson without diagonal option

This commit is contained in:
Anthony Scemama 2021-06-18 12:45:41 +02:00
parent 2ef1e128e1
commit 66baf49ca6
2 changed files with 22 additions and 7 deletions

View File

@ -58,3 +58,8 @@ doc: Maximum number of determinants where |H| is fully diagonalized
interface: ezfio,provider,ocaml
default: 1000
[without_diagonal]
type: logical
doc: If |true|, don't use denominator
default: False
interface: ezfio,provider,ocaml

View File

@ -447,6 +447,7 @@ subroutine davidson_diag_csf_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,sze_csf,N
! Compute residual vector and davidson step
! -----------------------------------------
if (without_diagonal) then
!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(i,k)
do k=1,N_st_diag
do i=1,sze
@ -455,6 +456,15 @@ subroutine davidson_diag_csf_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,sze_csf,N
enddo
enddo
!$OMP END PARALLEL DO
else
!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(i,k)
do k=1,N_st_diag
do i=1,sze
U(i,k) = (lambda(k) * U(i,k) - W(i,k) )
enddo
enddo
!$OMP END PARALLEL DO
endif
do k=1,N_st
residual_norm(k) = u_dot_u(U(1,k),sze)