Function sequant::opt::detail::build_subnet_metadata

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 TensorNetwork for each subset, canonicalizes it, and assigns a dense integer id to each distinct canonical form. The returned unique_meta_costs is 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].indices may be reordered by canonicalize_slots.