mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-25 05:51:46 +02:00
removed small contributions
This commit is contained in:
parent
d8350efb49
commit
186b3a9e57
@ -14,36 +14,3 @@ BEGIN_PROVIDER [ double precision, H_matrix_all_dets,(N_det,N_det) ]
|
|||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
subroutine remove_small_contributions
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Remove determinants with small contributions
|
|
||||||
END_DOC
|
|
||||||
integer :: i,j,k, N_removed
|
|
||||||
logical keep
|
|
||||||
N_removed = 0
|
|
||||||
do i=N_det,1,-1
|
|
||||||
keep = .False.
|
|
||||||
do j=1,N_states
|
|
||||||
keep = keep .or. (dabs(psi_coef(i,j)) > selection_criterion_min)
|
|
||||||
enddo
|
|
||||||
if (.not.keep) then
|
|
||||||
do k=i+1,N_det
|
|
||||||
do j=1,N_int
|
|
||||||
psi_det(j,1,k-1) = psi_det(j,1,k)
|
|
||||||
psi_det(j,2,k-1) = psi_det(j,2,k)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
do j=1,N_states
|
|
||||||
do k=i+1,N_det
|
|
||||||
psi_coef(k-1,j) = psi_coef(k,j)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
N_removed += 1
|
|
||||||
endif
|
|
||||||
enddo
|
|
||||||
if (N_removed > 0) then
|
|
||||||
N_det -= N_removed
|
|
||||||
call write_int(output_dets,N_removed, 'Removed determinants')
|
|
||||||
endif
|
|
||||||
end
|
|
||||||
|
@ -188,6 +188,9 @@ Documentation
|
|||||||
`fill_h_apply_buffer_selection <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/selection.irp.f#L1>`_
|
`fill_h_apply_buffer_selection <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/selection.irp.f#L1>`_
|
||||||
Fill the H_apply buffer with determiants for the selection
|
Fill the H_apply buffer with determiants for the selection
|
||||||
|
|
||||||
|
`remove_small_contributions <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/selection.irp.f#L80>`_
|
||||||
|
Remove determinants with small contributions
|
||||||
|
|
||||||
`selection_criterion <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/selection.irp.f#L67>`_
|
`selection_criterion <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/selection.irp.f#L67>`_
|
||||||
Threshold to select determinants. Set by selection routines.
|
Threshold to select determinants. Set by selection routines.
|
||||||
|
|
||||||
|
@ -77,3 +77,36 @@ end
|
|||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
subroutine remove_small_contributions
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Remove determinants with small contributions
|
||||||
|
END_DOC
|
||||||
|
integer :: i,j,k, N_removed
|
||||||
|
logical keep
|
||||||
|
N_removed = 0
|
||||||
|
do i=N_det,1,-1
|
||||||
|
keep = .False.
|
||||||
|
do j=1,N_states
|
||||||
|
keep = keep .or. (dabs(psi_coef(i,j)) > selection_criterion_min)
|
||||||
|
enddo
|
||||||
|
if (.not.keep) then
|
||||||
|
do k=i+1,N_det
|
||||||
|
do j=1,N_int
|
||||||
|
psi_det(j,1,k-1) = psi_det(j,1,k)
|
||||||
|
psi_det(j,2,k-1) = psi_det(j,2,k)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
do j=1,N_states
|
||||||
|
do k=i+1,N_det
|
||||||
|
psi_coef(k-1,j) = psi_coef(k,j)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
N_removed += 1
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
if (N_removed > 0) then
|
||||||
|
N_det -= N_removed
|
||||||
|
call write_int(output_dets,N_removed, 'Removed determinants')
|
||||||
|
endif
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user