Tree Tensor Network Algorithms#
The Basis Tree#
- class renormalizer.tn.TreeNodeBasis(basis_sets: Optional[Union[BasisSet, List[BasisSet]]] = None)[source]#
-
- property basis_set#
- class renormalizer.tn.BasisTree(root: TreeNodeBasis)[source]#
Tree of basis sets. The tree nodes are
TreeNodeBasis
.- Parameters:
root (
TreeNodeBasis
) – The root of the tree
- classmethod binary(basis_list: List[BasisSet])[source]#
Generate a binary tree.
- Parameters:
basis_list (list of
BasisSet
) – The basis set list.- Return type:
The constructed basis tree.
- classmethod binary_mctdh(basis_list: List[BasisSet], contract_primitive=False, contract_label=None, dummy_label='MCTDH virtual')[source]#
Construct binary MCTDH tree.
See also
general_mctdh
construct MCTDH tree with any order.
- static find_path(node1: Union[TreeNodeTensor, TreeNodeBasis, TreeNodeEnviron], node2: Union[TreeNodeTensor, TreeNodeBasis, TreeNodeEnviron]) List[Union[TreeNodeTensor, TreeNodeBasis, TreeNodeEnviron]] #
Find the path from node1 to node2. Not most efficient but simple to implement
- classmethod general_mctdh(basis_list: List[BasisSet], tree_order: int, contract_primitive: bool = False, contract_label: Optional[Sequence[bool]] = None, dummy_label='MCTDH virtual')[source]#
MCTDH tree with the specified tree order. The feature of this type of tree is that all physical degrees of freedom are attached to the leaf nodes. Also, each leaf node typically has more than one physical degrees of freedom.
- Parameters:
basis_list (list of
BasisSet
) – The list of basis sets for the system.tree_order (int) – Tree order. For example, 2 means binary tree and 3 means ternary tree.
contract_primitive (bool) –
Whether contract the primitive basis. Defaults to False. If set to True, each primitive basis in
basis_list
will be contracted before attached to the tree. The following is a schematic view, whereo
represents a node andd
means the physical bond.# contract primitive o / \ o o d -> | | <- d
If set to False, the following type of tree will be constructed.
# not contract primitive o d -> / \ <- d d means physical bond
contract_label (list of bool) – If
contract_primitive
is set to True, this list determines which primitive basis should be contracted.dummy_label – The label for the virtual nodes in MCTDH.
- Return type:
The constructed basis tree.
See also
binary_mctdh
construct binary MCTDH tree (tree order is set to 2).
ternary_mctdh
construct ternary MCTDH tree (tree order is set to 3).
- classmethod linear(basis_list: List[BasisSet])[source]#
Generate a linear tree, i.e, MPS.
- Parameters:
basis_list (list of
BasisSet
) – The basis set list.- Return type:
The constructed basis tree.
- postorder_list() List[Union[TreeNodeTensor, TreeNodeBasis, TreeNodeEnviron]] #
- preorder_list(func=None) List[Union[TreeNodeTensor, TreeNodeBasis, TreeNodeEnviron]] #
- property size#
- classmethod ternary_mctdh(basis_list: List[BasisSet], contract_primitive=False, contract_label=None, dummy_label='MCTDH virtual')[source]#
Construct ternary MCTDH tree.
See also
general_mctdh
construct MCTDH tree with any order.