From 61ea409c586c0cd4e99fd4b1cb20222c996a345b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 8 Dec 2021 12:03:14 +0100 Subject: [PATCH] Modified density matrices --- tools/generator_tools.py | 2 +- trex.org | 56 +++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/tools/generator_tools.py b/tools/generator_tools.py index 166183b..37a330e 100644 --- a/tools/generator_tools.py +++ b/tools/generator_tools.py @@ -578,7 +578,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 diff --git a/trex.org b/trex.org index 8336c15..47d4652 100644 --- a/trex.org +++ b/trex.org @@ -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: