Template Function sequant::left_to_right_binarization_indices

Function Documentation

template<typename T, typename Set = std::set<T>>
auto sequant::left_to_right_binarization_indices(meta::range_of<Set> auto const &rng, Set const &uncontract)

Calculates index sets for a left-to-right contraction sequence.

This function simulates a left-to-right contraction of a sequence of tensors. A factor keeps the atoms that another factor carries or that are in uncontract, and the intermediate after the first (i+1) factors keeps the atoms that the remaining factors carry or that are in uncontract (see open_atoms). Unlike subset_target_indices, nothing is inferred to be external: the callers declare the result’s indices.

Template Parameters:
  • T – The type of the index.

  • Set – The type of the set container.

Parameters:
  • rng – A range of index sets representing the input tensors.

  • uncontract – The set of indices that should remain in the final result (external indices).

Returns:

LTRUncontractedIndices<T, Set> containing the filtered children indices and intermediate indices.