Template Function sequant::batch_axis(meta::eval_node auto const&, IndexPredicate const&)

Function Documentation

template<typename IndexPredicate>
inline std::optional<Index> sequant::batch_axis(meta::eval_node auto const &node, IndexPredicate const &accept)

A default axis to batch the subtree at node over: the contracted index (see contracted_indices) that satisfies accept, choosing the one with the largest IndexSpace approximate size &#8212; typically the auxiliary/RI index, whose elimination most reduces the peak intermediate.

Parameters:

accept – a predicate bool(Index const&) selecting which contracted indices are eligible to batch over (e.g. only those in a given IndexSpace). This lets a caller scope batching to specific modes.

Returns:

nullopt if no contracted index satisfies accept.