Template Function sequant::opt::optimize¶
Defined in File optimize.hpp
Function Documentation¶
-
template<typename IdxToSize, typename = std::enable_if_t<std::is_invocable_r_v<size_t, IdxToSize, const Index&>>>
ExprPtr sequant::opt::optimize(ExprPtr const &expr, IdxToSize const &idx2size, bool reorder_sum)¶ - Parameters:
expr – Expression to be optimized.
idxsz – An invocable object that maps an Index object to size.
reorder_sum – If true, the summands are reordered so that terms with common sub-expressions appear closer to each other.
- Returns:
Optimized expression for lower evaluation cost.