Template Function sequant::apply_one_op

Function Documentation

template<meta::can_evaluate Node>
ResultPtr sequant::apply_one_op(Node const &node, ResultPtr const &left, ResultPtr const &right, BackendArrayOps const *aops, container::svector<BatchContextEntry> const &bctx)

The single-op compute kernel.

The raw op applied to already-evaluated operand results, dispatched by node's op type, with the contraction annotation computed from node. Value-in, value-out: it takes the operands’ Result buffers and returns the op’s raw result, touching no cache and no value identity. It is exactly the innermost left->adjoint/pow/broadcast/sum/prod(...) compute that both the tree-walking evaluate_impl and the value/occurrence-driven ordered executor perform, so both reach the op through this one function. Not handled here (all caller-side): a leaf (a leaf_evaluator fetch, not an op), the shaped-product hook (the caller calls this only when the hook declines), apply_phase + store, the in-place-Sum fast path, and all tally / trace / timing / last_op_flops sentinel.

Parameters:
  • aops – the backend array-ops, which shape the modes an EvalOp::Broadcast node adds to its operand

  • bctx – the enclosing batch loops: a mode a Broadcast node adds is restricted to the current batch of the loop over it

Throws:

Exception – if node is an EvalOp::Broadcast node and aops is null