1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00
This commit is contained in:
Anthony Scemama 2022-07-01 10:29:44 +02:00
parent d5df21cf0c
commit 5e4531f810
2 changed files with 12 additions and 5 deletions

View File

@ -232,7 +232,7 @@ def iterative_populate_file (filename: str, paths: dict, detailed_all: dict) ->
for line in f_in : for line in f_in :
id = check_triggers(line, triggers) id = check_triggers(line, triggers)
if id == 0: if id == 0:
# special case for proper error handling when deallocting text groups # special case for proper error handling when deallocating text groups
error_handler = ' if (rc != TREXIO_SUCCESS) return rc;\n' error_handler = ' if (rc != TREXIO_SUCCESS) return rc;\n'
populated_line = iterative_replace_line(line, '$group$', detailed_all['groups'], add_line=error_handler) populated_line = iterative_replace_line(line, '$group$', detailed_all['groups'], add_line=error_handler)
f_out.write(populated_line) f_out.write(populated_line)

View File

@ -37,6 +37,8 @@ fetched using multiple function calls to perform I/O on buffers.
For more information on how to read/write sparse data structures, see For more information on how to read/write sparse data structures, see
the [[./examples.html][examples]]. the [[./examples.html][examples]].
For determinants, the ~special~ attribute is present in the type. This
means that the source code is not produced by the generator, but hand-written.
#+begin_src python :tangle trex.json :exports none #+begin_src python :tangle trex.json :exports none
{ {
@ -678,11 +680,16 @@ prim_factor =
in the memory. in the memory.
\[ \[
D_I = \alpha_1 \alpha_2 \ldots \alpha_{n\uparrow} \beta_1 \beta_2 \ldots \beta_{n\downarrow} D_I = \alpha_1 \alpha_2 \ldots \alpha_{n_\uparrow} \beta_1 \beta_2 \ldots \beta_{n_\downarrow}
\] \]
where $\alpha$ and $\beta$ denote $\uparrow$-spin and $\downarrow$-spin electrons, respectively, where $\alpha$ and $\beta$ denote \uparrow-spin and \downarrow-spin electrons, respectively,
$n\uparrow$ and $n\downarrow$ correspond to ~electron.up_num~ and ~electron.dn_num~, respectively. $n_\uparrow$ and $n_\downarrow$ correspond to ~electron.up_num~ and ~electron.dn_num~, respectively.
Note: the ~special~ attribute is present in the types, meaning that the source node is not
produced by the code generator.
An illustration on how to read determinants is presented in the [[./examples.html][examples]].
#+NAME: determinant #+NAME: determinant
| Variable | Type | Dimensions | Description | | Variable | Type | Dimensions | Description |
@ -734,7 +741,7 @@ prim_factor =
The reduced density matrices are defined in the basis of molecular The reduced density matrices are defined in the basis of molecular
orbitals. orbitals.
The $\uparrow$-spin and $\downarrow$-spin components of the one-body The \uparrow-spin and \downarrow-spin components of the one-body
density matrix are given by density matrix are given by
\begin{eqnarray*} \begin{eqnarray*}
\gamma_{ij}^{\uparrow} &=& \langle \Psi | \hat{a}^{\dagger}_{j\alpha}\, \hat{a}_{i\alpha} | \Psi \rangle \\ \gamma_{ij}^{\uparrow} &=& \langle \Psi | \hat{a}^{\dagger}_{j\alpha}\, \hat{a}_{i\alpha} | \Psi \rangle \\