Function sequant::opt::detail::build_subnet_metadata¶
Defined in File single_term.hpp
Function Documentation¶
-
inline SubnetMetadata sequant::opt::detail::build_subnet_metadata(TensorNetwork const &network, container::vector<OptRes> &results)¶
Precomputes canonical-subnet identifiers for every subset of size >= 2 so that structurally equivalent subnetworks share a CSE id.
Builds a
TensorNetworkfor each subset, canonicalizes it, and assigns a dense integer id to each distinct canonical form. The returnedunique_meta_costsis sized to the number of distinct ids and zero-filled; it is populated during the DP as each canonical subnet’s optimal cost becomes known.Side effect:
results[n].indicesmay be reordered bycanonicalize_slots.