mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 18:16:12 +01:00
Fixed: Bug in Davdison and Davidson_MRCC
This commit is contained in:
parent
f186827ee7
commit
e9b7135b83
@ -66,9 +66,18 @@
|
|||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer, n_exc_active_sze ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Dimension of arrays to avoid zero-sized arrays
|
||||||
|
END_DOC
|
||||||
|
n_exc_active_sze = max(n_exc_active,1)
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, active_excitation_to_determinants_idx, (0:N_det_ref+1, n_exc_active) ]
|
|
||||||
&BEGIN_PROVIDER [ double precision, active_excitation_to_determinants_val, (N_states,N_det_ref+1, n_exc_active) ]
|
|
||||||
|
BEGIN_PROVIDER [ integer, active_excitation_to_determinants_idx, (0:N_det_ref+1, n_exc_active_sze) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, active_excitation_to_determinants_val, (N_states,N_det_ref+1, n_exc_active_sze) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Sparse matrix A containing the matrix to transform the active excitations to
|
! Sparse matrix A containing the matrix to transform the active excitations to
|
||||||
@ -136,10 +145,10 @@ END_PROVIDER
|
|||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, mrcc_AtA_ind, (N_det_ref * n_exc_active) ]
|
BEGIN_PROVIDER [ integer, mrcc_AtA_ind, (N_det_ref * n_exc_active_sze) ]
|
||||||
&BEGIN_PROVIDER [ double precision, mrcc_AtA_val, (N_states, N_det_ref * n_exc_active) ]
|
&BEGIN_PROVIDER [ double precision, mrcc_AtA_val, (N_states, N_det_ref * n_exc_active_sze) ]
|
||||||
&BEGIN_PROVIDER [ integer, mrcc_col_shortcut, (n_exc_active) ]
|
&BEGIN_PROVIDER [ integer, mrcc_col_shortcut, (n_exc_active_sze) ]
|
||||||
&BEGIN_PROVIDER [ integer, mrcc_N_col, (n_exc_active) ]
|
&BEGIN_PROVIDER [ integer, mrcc_N_col, (n_exc_active_sze) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! A is active_excitation_to_determinants in At.A
|
! A is active_excitation_to_determinants in At.A
|
||||||
|
@ -829,7 +829,9 @@ subroutine davidson_diag_hjj_sjj_mrcc(dets_in,u_in,H_jj,S2_jj,energies,dim_in,sz
|
|||||||
state_ok(k) = (dabs(s2(k)-expected_s2) < 0.6d0)
|
state_ok(k) = (dabs(s2(k)-expected_s2) < 0.6d0)
|
||||||
enddo
|
enddo
|
||||||
else
|
else
|
||||||
state_ok(k) = .True.
|
do k=1,size(state_ok)
|
||||||
|
state_ok(k) = .True.
|
||||||
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
do k=1,shift2
|
do k=1,shift2
|
||||||
|
@ -306,7 +306,9 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_jj,energies,dim_in,sze,N_s
|
|||||||
state_ok(k) = (dabs(s2(k)-expected_s2) < 0.6d0)
|
state_ok(k) = (dabs(s2(k)-expected_s2) < 0.6d0)
|
||||||
enddo
|
enddo
|
||||||
else
|
else
|
||||||
state_ok(k) = .True.
|
do k=1,size(state_ok)
|
||||||
|
state_ok(k) = .True.
|
||||||
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
do k=1,shift2
|
do k=1,shift2
|
||||||
@ -385,7 +387,8 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_jj,energies,dim_in,sze,N_s
|
|||||||
do k=1,N_st_diag
|
do k=1,N_st_diag
|
||||||
if (state_ok(k)) then
|
if (state_ok(k)) then
|
||||||
do i=1,sze
|
do i=1,sze
|
||||||
U(i,shift2+k) = (lambda(k) * U(i,shift2+k) - W(i,shift2+k) ) &
|
U(i,shift2+k) = &
|
||||||
|
(lambda(k) * U(i,shift2+k) - W(i,shift2+k) ) &
|
||||||
* (1.d0 + s2(k) * U(i,shift2+k) - S(i,shift2+k) - S_z2_Sz &
|
* (1.d0 + s2(k) * U(i,shift2+k) - S(i,shift2+k) - S_z2_Sz &
|
||||||
)/max(H_jj(i) - lambda (k),1.d-2)
|
)/max(H_jj(i) - lambda (k),1.d-2)
|
||||||
enddo
|
enddo
|
||||||
|
Loading…
Reference in New Issue
Block a user