9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-09 06:53:38 +01:00

added davidson_keywords

This commit is contained in:
eginer 2022-10-24 21:12:12 +02:00
parent 7ebc9da4ce
commit 6ed74608a6
5 changed files with 135 additions and 0 deletions

View File

@ -0,0 +1,54 @@
[threshold_davidson]
type: Threshold
doc: Thresholds of Davidson's algorithm if threshold_davidson_from_pt2 is false.
interface: ezfio,provider,ocaml
default: 1.e-10
[threshold_nonsym_davidson]
type: Threshold
doc: Thresholds of non-symetric Davidson's algorithm
interface: ezfio,provider,ocaml
default: 1.e-5
[davidson_sze_max]
type: Strictly_positive_int
doc: Number of micro-iterations before re-contracting
default: 15
interface: ezfio,provider,ocaml
[state_following]
type: logical
doc: If |true|, the states are re-ordered to match the input states
default: False
interface: ezfio,provider,ocaml
[disk_based_davidson]
type: logical
doc: If |true|, a memory-mapped file may be used to store the W and S2 vectors if not enough RAM is availabl
default: True
interface: ezfio,provider,ocaml
[n_states_diag]
type: States_number
doc: Controls the number of states to consider during the Davdison diagonalization. The number of states is n_states * n_states_diag
default: 4
interface: ezfio,ocaml
[n_det_max_full]
type: Det_number_max
doc: Maximum number of determinants where |H| is fully diagonalized
interface: ezfio,provider,ocaml
default: 1000
[threshold_davidson_from_pt2]
type: logical
doc: Thresholds of Davidson's algorithm is set to E(rPT2)*threshold_davidson_from_pt2
interface: ezfio,provider,ocaml
default: false
[distributed_davidson]
type: logical
doc: If |true|, use the distributed algorithm
default: True
interface: ezfio,provider,ocaml

View File

@ -0,0 +1 @@
ezfio_files

View File

@ -0,0 +1,4 @@
=================
davidson_keywords
=================

View File

@ -0,0 +1,43 @@
! ---
BEGIN_PROVIDER [ integer, n_states_diag ]
implicit none
BEGIN_DOC
! Number of states to consider during the Davdison diagonalization
END_DOC
logical :: has
PROVIDE ezfio_filename
if (mpi_master) then
call ezfio_has_davidson_keywords_n_states_diag(has)
if (has) then
call ezfio_get_davidson_keywords_n_states_diag(n_states_diag)
else
print *, 'davidson_keywords/n_states_diag not found in EZFIO file'
stop 1
endif
n_states_diag = max(2,N_states * N_states_diag)
endif
IRP_IF MPI_DEBUG
print *, irp_here, mpi_rank
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
IRP_ENDIF
IRP_IF MPI
include 'mpif.h'
integer :: ierr
call MPI_BCAST( n_states_diag, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
if (ierr /= MPI_SUCCESS) then
stop 'Unable to read n_states_diag with MPI'
endif
IRP_ENDIF
call write_time(6)
if (mpi_master) then
write(6, *) 'Read n_states_diag'
endif
END_PROVIDER
! ---

View File

@ -0,0 +1,33 @@
use bitmasks
use f77_zmq
! ---
BEGIN_PROVIDER [ integer, nthreads_davidson ]
implicit none
BEGIN_DOC
! Number of threads for Davidson
END_DOC
nthreads_davidson = nproc
character*(32) :: env
call getenv('QP_NTHREADS_DAVIDSON',env)
if (trim(env) /= '') then
read(env,*) nthreads_davidson
call write_int(6,nthreads_davidson,'Target number of threads for <Psi|H|Psi>')
endif
END_PROVIDER
! ---
BEGIN_PROVIDER [ double precision, threshold_davidson_pt2 ]
implicit none
BEGIN_DOC
! Threshold of Davidson's algorithm, using PT2 as a guide
END_DOC
threshold_davidson_pt2 = threshold_davidson
END_PROVIDER
! ---