Template Function sequant::apply_canon_phase¶
Defined in File eval.hpp
Function Documentation¶
-
template<Trace EvalTrace = Trace::Default, meta::can_evaluate Node, typename N, bool FHC>
ResultPtr sequant::apply_canon_phase(Node const &nd, ResultPtr res, CacheManager<N, FHC> &cache)¶ Multiply a result by its node’s canonicalization phase, with the trace event and peak accounting that conversion carries.
A cell/cache holds the canonical orientation of a value while every consumer wants the node’s own oriented one; the phase is an involution, so one multiply converts either way. Shared by
evaluate_impl(through itsapply_phaselambda) and the ordered executor’sdetail::compute_cell, so both convert identically — including theMultByPhasetrace event, whosenote_working_setcall is what puts the transient second buffer on the peak monitor.A phase of 1 (the overwhelming majority) returns
resuntouched, with no event and no allocation.