1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-07-22 18:57:39 +02:00

Merge branch 'add-sparse-datasets' of github.com:TREX-CoE/trexio into add-sparse-datasets

This commit is contained in:
q-posev 2021-12-09 09:28:27 +01:00
commit fcf84ebb8c
2 changed files with 33 additions and 25 deletions

View File

@ -579,7 +579,7 @@ def get_detailed_num_dict (configuration: dict) -> dict:
for k2,v2 in v1.items():
if len(v2[1]) == 0:
tmp_num = f'{k1}_{k2}'
if 'str' not in v2[0]:
if 'int' in v2[0] or 'dim' in v2[0] or 'index' in v2[0]:
tmp_dict = {}
tmp_dict['group'] = k1
tmp_dict['group_num'] = tmp_num

View File

@ -73,19 +73,19 @@ arrays are 0-based. Hence, we introduce the ~index~ type which is an
#+NAME:electron
| Variable | Type | Dimensions | Description |
|----------+-------+------------+-------------------------------------|
| ~up_num~ | ~dim~ | | Number of \uparrow-spin electrons |
| ~dn_num~ | ~dim~ | | Number of \downarrow-spin electrons |
| ~up_num~ | ~int~ | | Number of \uparrow-spin electrons |
| ~dn_num~ | ~int~ | | Number of \downarrow-spin electrons |
#+CALL: json(data=electron, title="electron")
#+RESULTS:
:RESULTS:
:results:
#+begin_src python :tangle trex.json
"electron": {
"up_num" : [ "dim", [] ]
, "dn_num" : [ "dim", [] ]
"up_num" : [ "int", [] ]
, "dn_num" : [ "int", [] ]
} ,
#+end_src
:END:
:end:
* Nucleus (nucleus group)
@ -100,20 +100,22 @@ arrays are 0-based. Hence, we introduce the ~index~ type which is an
| ~coord~ | ~float~ | ~(3,nucleus.num)~ | Coordinates of the atoms |
| ~label~ | ~str~ | ~(nucleus.num)~ | Atom labels |
| ~point_group~ | ~str~ | | Symmetry point group |
| ~repulsion~ | ~float~ | | Nuclear repulsion energy |
#+CALL: json(data=nucleus, title="nucleus")
#+RESULTS:
:RESULTS:
:results:
#+begin_src python :tangle trex.json
"nucleus": {
"num" : [ "dim" , [] ]
, "charge" : [ "float", [ "nucleus.num" ] ]
, "coord" : [ "float", [ "nucleus.num", "3" ] ]
, "label" : [ "str" , [ "nucleus.num" ] ]
, "point_group" : [ "str" , [] ]
"num" : [ "dim" , [] ]
, "charge" : [ "float", [ "nucleus.num" ] ]
, "coord" : [ "float", [ "nucleus.num", "3" ] ]
, "label" : [ "str" , [ "nucleus.num" ] ]
, "point_group" : [ "str" , [] ]
, "repulsion" : [ "float", [] ]
} ,
#+end_src
:END:
:end:
* Effective core potentials (ecp group)
@ -617,15 +619,18 @@ prim_factor =
:end:
* TODO Slater determinants
* TODO Reduced density matrices (rdm group)
* Reduced density matrices (rdm group)
#+NAME: rdm
| Variable | Type | Dimensions | Description |
|------------+----------------+------------------------------------+-------------|
| ~one_e~ | ~float~ | ~(mo.num, mo.num)~ | |
| ~one_e_up~ | ~float~ | ~(mo.num, mo.num)~ | |
| ~one_e_dn~ | ~float~ | ~(mo.num, mo.num)~ | |
| ~two_e~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | |
| Variable | Type | Dimensions | Description |
|-----------+----------------+------------------------------------+-----------------------------------------------------------------------|
| ~1e~ | ~float~ | ~(mo.num, mo.num)~ | One body density matrix |
| ~1e_up~ | ~float~ | ~(mo.num, mo.num)~ | \uparrow-spin component of the one body density matrix |
| ~1e_dn~ | ~float~ | ~(mo.num, mo.num)~ | \downarrow-spin component of the one body density matrix |
| ~2e~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | Two-body reduced density matrix (spin trace) |
| ~2e_upup~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \uparrow\uparrow component of the two-body reduced density matrix |
| ~2e_dndn~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \downarrow\downarrow component of the two-body reduced density matrix |
| ~2e_updn~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \uparrow\downarrow component of the two-body reduced density matrix |
#+CALL: json(data=rdm, title="rdm", last=1)
@ -633,10 +638,13 @@ prim_factor =
:results:
#+begin_src python :tangle trex.json
"rdm": {
"one_e" : [ "float" , [ "mo.num", "mo.num" ] ]
, "one_e_up" : [ "float" , [ "mo.num", "mo.num" ] ]
, "one_e_dn" : [ "float" , [ "mo.num", "mo.num" ] ]
, "two_e" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
"1e" : [ "float" , [ "mo.num", "mo.num" ] ]
, "1e_up" : [ "float" , [ "mo.num", "mo.num" ] ]
, "1e_dn" : [ "float" , [ "mo.num", "mo.num" ] ]
, "2e" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "2e_upup" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "2e_dndn" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "2e_updn" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
}
#+end_src
:end: