mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-01-03 01:56:13 +01:00
Patch the generator
This commit is contained in:
parent
738d8de5ca
commit
3a7707ed86
@ -4,7 +4,6 @@ from generator_tools import *
|
||||
# --------------------- GET CONFIGURATION FROM THE TREX.JSON ---------------- #
|
||||
config_file = 'trex.json'
|
||||
trex_config = read_json(config_file)
|
||||
trex_config.pop('determinant')
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
# -------------------- GET ATTRIBUTES FROM THE CONFIGURATION ---------------- #
|
||||
|
@ -517,7 +517,7 @@ def get_dtype_dict (dtype: str, target: str, rank = None, int_len_printf = None)
|
||||
group_dset_format_printf_16 = '"'
|
||||
group_dset_format_printf_32 = '"'
|
||||
group_dset_format_scanf = ''
|
||||
for i in range(rank):
|
||||
for _ in range(rank):
|
||||
group_dset_format_printf_8 += item_printf_8
|
||||
group_dset_format_printf_16 += item_printf_16
|
||||
group_dset_format_printf_32 += item_printf_32
|
||||
@ -644,11 +644,16 @@ def split_dset_dict_detailed (datasets: dict) -> tuple:
|
||||
dset_string_dict = {}
|
||||
dset_sparse_dict = {}
|
||||
for k,v in datasets.items():
|
||||
|
||||
# create a temp dictionary
|
||||
tmp_dict = {}
|
||||
rank = len(v[1])
|
||||
datatype = v[0]
|
||||
|
||||
# skip the data which has 'special' datatype (e.g. determinants for which the code is not templated)
|
||||
if 'special' in datatype:
|
||||
continue
|
||||
|
||||
# define whether the dset is sparse
|
||||
is_sparse = False
|
||||
int_len_printf = {}
|
||||
|
14
trex.org
14
trex.org
@ -641,7 +641,7 @@ prim_factor =
|
||||
can be expanded in the basis of Slater determinants $D_I$ as follows
|
||||
|
||||
\[
|
||||
|\Psi> = \sum_I C_I |D_I>
|
||||
| \Psi> = \sum_I C_I | D_I>
|
||||
\]
|
||||
|
||||
For relatively small expansions, a given determinant can be represented as a list of ~mo.num~ occupation numbers.
|
||||
@ -651,7 +651,7 @@ prim_factor =
|
||||
|
||||
\[
|
||||
| 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,
|
||||
$n\uparrow$ and $n\downarrow$ correspond to ~electron.up_num~ and ~electron.dn_num~, respectively.
|
||||
@ -660,10 +660,10 @@ prim_factor =
|
||||
|
||||
#+NAME: determinant
|
||||
| Variable | Type | Dimensions | Description |
|
||||
|---------------+----------------+------------------------+--------------------------------------------------------|
|
||||
|---------------+-----------------+------------------------+--------------------------------------------------------|
|
||||
| ~num~ | ~dim~ | | Number of determinants |
|
||||
| ~list~ | ~int bitfield~ | ~(determinant.num, 2)~ | List of determinants as integer bit fields |
|
||||
| ~coefficient~ | ~float~ | ~(determinant.num)~ | Coefficients of the determinants from the CI expansion |
|
||||
| ~list~ | ~int special~ | ~(determinant.num, 2)~ | List of determinants as integer bit fields |
|
||||
| ~coefficient~ | ~float special~ | ~(determinant.num)~ | Coefficients of the determinants from the CI expansion |
|
||||
|
||||
#+CALL: json(data=determinant, title="determinant")
|
||||
|
||||
@ -672,8 +672,8 @@ prim_factor =
|
||||
#+begin_src python :tangle trex.json
|
||||
"determinant": {
|
||||
"num" : [ "dim" , [] ]
|
||||
, "list" : [ "int binary", [ "2", "determinant.num" ] ]
|
||||
, "coefficient" : [ "float" , [ "determinant.num" ] ]
|
||||
, "list" : [ "int special" , [ "2", "determinant.num" ] ]
|
||||
, "coefficient" : [ "float special", [ "determinant.num" ] ]
|
||||
} ,
|
||||
#+end_src
|
||||
:end:
|
||||
|
Loading…
Reference in New Issue
Block a user