Function sequant::subset_target_indices¶
Defined in File indices.hpp
Function Documentation¶
-
auto sequant::subset_target_indices(meta::range_of<Index, 2> auto const &rng, meta::range_of<Index> auto const &tixs, container::vector<char> const *connected = nullptr)¶
Determines the open indices for all subsets of a given range of index groups.
result[mask]is the set of atoms (see carried_atoms) that the subset ofrngselected bymaskkeeps open (see open_atoms). The external indices aretixsplus the slot indices that occur once inrng, which are external even if undeclared; an index carried only as a protoindex cannot be inferred that way and must be intixsto stay open where nothing else carries it. A singleton subset keeps all of its slots.- Parameters:
rng – A range of ranges of
Index: the slots of each tensor. The $i$-th bit of a mask being set means the $i$-th group is in the subset.tixs – A range of
Indexrepresenting the global target indices (e.g., indices of the result tensor).connected – Optional pruning mask: when non-null, only
result[i]with(*connected)[i]set are computed, the rest are left empty.
- Returns:
A vector of sets, where
result[mask]contains the set of openIndexobjects for the subset defined bymask.