Function sequant::opt::detail::batchable_index_list

Function Documentation

inline container::vector<Index> sequant::opt::detail::batchable_index_list(TensorNetwork const &network, std::function<bool(Index const&)> const &is_batchable)

Collects the distinct batchable indices (in appearance order) across all tensors in network.

Iterates over every tensor slot (bra, ket, and aux) and appends an index to the result the first time it is seen and is_batchable returns true for it. The returned list assigns each index a stable bit position: index at position k is bit k of a sliced-set bitmask B.

Parameters:
  • network – The TensorNetwork to scan.

  • is_batchable – Predicate returning true for indices in a batchable space (e.g. a DF/RI auxiliary space).

Returns:

Ordered, deduplicated list of batchable indices.