Function sequant::subset_index_counts

Function Documentation

auto sequant::subset_index_counts(meta::range_of<Index, 2> auto const &rng)

Computes index counts for all subsets of a given range of index groups.

This function generates a vector where each element corresponds to a subset of the input range rng. The subsets are indexed by a bitmask, where the $i$-th bit being set means the $i$-th element of rng is included in the subset. For each subset, it counts the occurrences of each Index.

Parameters:

rng – A range of ranges of Index. The outer range represents a collection of index groups (e.g., indices of multiple tensors).

Returns:

A vector of maps, where result[mask] contains a map of Index to its count in the subset defined by mask.