Template Function sequant::opt::detail::run_single_term_opt_axes

Function Documentation

template<class Model, typename TIdxs>
std::pair<EvalSequence, container::vector<NodeBatchAnnotation>> sequant::opt::detail::run_single_term_opt_axes(Model const &m, TensorNetwork const &network, TIdxs const &tidxs)

Companion to run_single_term_opt that also reports, for each contraction (-1) node of the returned EvalSequence in emission order, the sliced-set of batchable Index values realized at that node. Requires Model to additionally expose reconstruct_batched_modes (currently only PeakBatchedModel does); see its doc comment for the precise per-node convention (RPN / post-order, left-first, matching the shared build recursion used by reconstruct).

Returns:

The optimal EvalSequence, paired with one container::svector of sliced Index per -1 token of that sequence, in the same left-first post-order the sequence itself was emitted in. For the nt==1 shortcut (no contractions) the modes vector is empty; for the nt==2 shortcut (single contraction, no DP context is built) the modes vector holds one empty entry (no batching info available).