Function sequant::eval::build_site_of

Function Documentation

inline container::svector<Index> sequant::eval::build_site_of(meta::eval_node auto const &node, BatchPolicy const &policy)

The at-node build-site of the value rooted at node: the batch-loop axes (per policy.is_batchable_index()) that appear at this node &#8212; carried in node's own result indices, or contracted at node.

Deliberately not a subtree union: in the ordered-scope model every node is itself a value, and a value is one contraction of already -cached operand values (its children), so its build-site is only the axes it carries or contracts at its own node &#8212; the axes below it belong to the operand values’ own (separately-analyzed) build-sites, not to this one. Concretely, the union of

  • node's own canon_indices() (its result/free indices), and

  • node's own contracted_indices(node) (see eval.hpp; empty for a leaf or a non-product node), filtered to the batchable subset. The result is de-duplicated by Index identity (space + ordinal + proto-indices); order follows first discovery (carried indices, then contracted indices).