Template Function sequant::binarize(ResultExpr const&, const BinarizationOptions&)

Function Documentation

template<typename ExprT = EvalExpr>
FullBinaryNode<ExprT> sequant::binarize(ResultExpr const &res, const BinarizationOptions &opts = {})

Creates a binary tree for evaluation from a ResultExpr. External indices are deduced from res (its non-null slots). Each summand of a broadcast Sum on the rhs (see is_valid(const ResultExpr&)) that lacks some of the head’s indices becomes an EvalOp::Broadcast node over the head’s indices.

Throws:

Exception – if a summand of a Sum on the rhs lacks an aux index of the head