Function sequant::factor_in_canonical_layout¶
Defined in File eval_expr.cpp
Function Documentation¶
-
ExprPtr sequant::factor_in_canonical_layout(EvalExprNode const &node)¶
The value of such a node is laid out by its canonical indices, and nodes of one hash are one value in that layout whatever their indices are labeled. Its
expr()does not tell them apart from other nodes, nor one layout from another: every intermediate has the same label, and the slots of its bra, of its ket and of its aux are each ordered by the labels of the indices. The tensor returned has the slots of each of the three in the order of the canonical indices, and a label made of the hash of the node and of the positions of its slots in the canonical layout, since which of those are in the bra and which in the ket is not fixed by the hash (nodes of bra-ket symmetric factors can differ in it). The canonical indices that are only proto-indices of the slots follow the aux, in their order: the proto-indices of a slot are not ordered, so without these the network would not tell which of them is which in the layout.