Template Function sequant::opt::detail::outer_product_connectivity

Function Documentation

template<typename TIdxs>
inline container::vector<char> sequant::opt::detail::outer_product_connectivity(TensorNetwork const &network, TIdxs const &tidxs, bool prune = true)

Outer-product pruning mask for a term. Returns connected_subsets over contractible_adjacency, EXCEPT it returns an all-connected mask when pruning is disabled (prune == false, or the env SEQUANT_DISABLE_OUTER_PRODUCT_PRUNING force-override) or when the full network is itself disconnected (a genuine product term &#8212; never a CC residual summand, by the linked-cluster theorem). Callers then apply one uniform if (!mask[n]) skip test and get unpruned behavior in those cases.

Parameters:

prune – Whether to prune (OptimizeOptions::prune_outer_products). When false, the returned mask is all-connected (unpruned DP).