mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 18:16:28 +01:00
More documentation added.
This commit is contained in:
parent
9e58ab4bb9
commit
bbd20ce87a
@ -216,9 +216,9 @@ This function performce better for cycles with 1 rank-1 update and with a high f
|
|||||||
It will exit with an error code of the denominator is too close to zero.
|
It will exit with an error code of the denominator is too close to zero.
|
||||||
|
|
||||||
The formula that is applied is
|
The formula that is applied is
|
||||||
\begin{equation}
|
\[
|
||||||
(S + uv^T)^{-1} = S^{-1} - \frac{S^{-1} uv^T S^{-1}}{1 + v^T S^{-1} u}
|
(S + uv^T)^{-1} = S^{-1} - \frac{S^{-1} uv^T S^{-1}}{1 + v^T S^{-1} u}
|
||||||
\end{equation}
|
\]
|
||||||
|
|
||||||
where
|
where
|
||||||
$S$ is the Slater-matrix,
|
$S$ is the Slater-matrix,
|
||||||
@ -415,11 +415,9 @@ rc = qmckl_sherman_morrison_c(context, Dim, N_updates, Updates, Updates_index, b
|
|||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
* Woodbury 2x2
|
* Woodbury 2x2
|
||||||
|
|
||||||
This is the Woodbury 3x3 kernel.
|
|
||||||
|
|
||||||
** ~qmckl_woodbury_2~
|
** ~qmckl_woodbury_2~
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:Name: qmckl_woodbury_2
|
:Name: qmckl_woodbury_2
|
||||||
@ -427,11 +425,19 @@ This is the Woodbury 3x3 kernel.
|
|||||||
:FRetType: qmckl_exit_code
|
:FRetType: qmckl_exit_code
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
This is the simplest of the available Sherman-Morrison-Woodbury
|
The simplest version of the generalised Sherman-Morrison-Woodbury kernels. It is used to apply two
|
||||||
kernels in QMCkl. It applies rank-1 updates one by one in the order
|
rank-1 updates at once. The formula used in this algorithm is called the Woodbury Matrix Identity
|
||||||
that is given. It only checks if the denominator in the
|
\[
|
||||||
Sherman-Morrison formula is not too close to zero (and exit with an
|
(S + U V)^{-1} = S^{-1} - C B^{-1} D
|
||||||
error if it does) during the application of an update.
|
\]
|
||||||
|
where
|
||||||
|
$S$ is the Slater-matrix
|
||||||
|
$U$ and $V$ are the matrices containing the updates and the canonical basis matrix
|
||||||
|
$S^{-1}$ is the inverse of the Slater-matrix
|
||||||
|
$C:= S^{-1}U$, a Dim $\times 2$ matrix
|
||||||
|
$B := 1 + VC$, the $2 \times 2$ matrix that is going to be inverted
|
||||||
|
$D := VS^{-1}$, a $2 \times Dim$ matrix
|
||||||
|
|
||||||
|
|
||||||
#+NAME: qmckl_woodbury_2_args
|
#+NAME: qmckl_woodbury_2_args
|
||||||
| qmckl_context | context | in | Global state |
|
| qmckl_context | context | in | Global state |
|
||||||
@ -443,7 +449,12 @@ This is the Woodbury 3x3 kernel.
|
|||||||
|
|
||||||
*** Requirements
|
*** Requirements
|
||||||
|
|
||||||
Add description of the input variables. (see for e.g. qmckl_distance.org)
|
- ~context~ is not ~qmckl_null_context~
|
||||||
|
- ~dim >= 2~
|
||||||
|
- ~updates~ is allocated with at least $2 \times 2 \times 8$ bytes
|
||||||
|
- ~updates_index~ is allocated with $2 \times 8$ bytes
|
||||||
|
- ~breakdown~ is a small number such that $0 < breakdown << 1$
|
||||||
|
- ~slater_inv~ is allocated with at least $dim \times dim \times 8$ bytes
|
||||||
|
|
||||||
*** C header
|
*** C header
|
||||||
|
|
||||||
@ -559,6 +570,8 @@ qmckl_exit_code qmckl_woodbury_2_c(const qmckl_context context,
|
|||||||
|
|
||||||
*** Performance
|
*** Performance
|
||||||
|
|
||||||
|
This function is most efficient when used in cases where there are only 2 rank-1 updates
|
||||||
|
|
||||||
** C interface :noexport:
|
** C interface :noexport:
|
||||||
|
|
||||||
#+CALL: generate_c_interface(table=qmckl_woodbury_2_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
#+CALL: generate_c_interface(table=qmckl_woodbury_2_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
||||||
@ -629,8 +642,6 @@ assert(rc == QMCKL_SUCCESS);
|
|||||||
|
|
||||||
|
|
||||||
* Woodbury 3x3
|
* Woodbury 3x3
|
||||||
|
|
||||||
This is the Woodbury 3x3 kernel.
|
|
||||||
|
|
||||||
** ~qmckl_woodbury_3~
|
** ~qmckl_woodbury_3~
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -639,11 +650,12 @@ This is the Woodbury 3x3 kernel.
|
|||||||
:FRetType: qmckl_exit_code
|
:FRetType: qmckl_exit_code
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
This is the simplest of the available Sherman-Morrison-Woodbury
|
The 3x3 version of the Woodbury 2x2 kernel. It is used to apply three
|
||||||
kernels in QMCkl. It applies rank-1 updates one by one in the order
|
rank-1 updates at once. The formula used in this kernel is the same as for Woodbury 2x2, with the exception of
|
||||||
that is given. It only checks if the denominator in the
|
|
||||||
Sherman-Morrison formula is not too close to zero (and exit with an
|
$C:= S^{-1}U$, a Dim $\times 3$ matrix
|
||||||
error if it does) during the application of an update.
|
$B := 1 + VC$, the $3 \times 3$ matrix that is going to be inverted
|
||||||
|
$D := VS^{-1}$, a $3 \times Dim$ matrix
|
||||||
|
|
||||||
#+NAME: qmckl_woodbury_3_args
|
#+NAME: qmckl_woodbury_3_args
|
||||||
| qmckl_context | context | in | Global state |
|
| qmckl_context | context | in | Global state |
|
||||||
@ -655,7 +667,6 @@ This is the Woodbury 3x3 kernel.
|
|||||||
|
|
||||||
*** Requirements
|
*** Requirements
|
||||||
|
|
||||||
Add description of the input variables. (see for e.g. qmckl_distance.org)
|
|
||||||
|
|
||||||
*** C header
|
*** C header
|
||||||
|
|
||||||
@ -784,6 +795,14 @@ qmckl_exit_code qmckl_woodbury_3_c(const qmckl_context context,
|
|||||||
|
|
||||||
*** Performance...
|
*** Performance...
|
||||||
|
|
||||||
|
- ~context~ is not ~qmckl_null_context~
|
||||||
|
- ~dim >= 2~
|
||||||
|
- ~updates~ is allocated with at least $3 \times 2 \times 8$ bytes
|
||||||
|
- ~updates_index~ is allocated with $3 \times 8$ bytes
|
||||||
|
- ~breakdown~ is a small number such that $0 < breakdown << 1$
|
||||||
|
- ~slater_inv~ is allocated with at least $dim \times dim \times 8$ bytes
|
||||||
|
|
||||||
|
|
||||||
** C interface :noexport:
|
** C interface :noexport:
|
||||||
|
|
||||||
#+CALL: generate_c_interface(table=qmckl_woodbury_3_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
#+CALL: generate_c_interface(table=qmckl_woodbury_3_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
||||||
|
Loading…
Reference in New Issue
Block a user