Template Function sequant::opt::detail::single_term_opt

Function Documentation

template<OptFor Metric, has_index_extent IdxToSz>
EvalSequence sequant::opt::detail::single_term_opt(TensorNetwork const &network, IdxToSz &&idxsz, bool subnet_cse)
Template Parameters:
  • OptFor – Cost metric to optimize for (Flops or Memsize).

  • IdxToSz

Parameters:
  • network – A TensorNetwork object.

  • idxsz – An invocable on Index, that maps Index to its dimension.

  • subnet_cse – Whether to recognize equivalent subnetworks to try minimizing the ops counts.

Returns:

Optimal evaluation sequence under the chosen cost metric. If there are equivalent optimal sequences then the result is the one that keeps the order of tensors in the network as original as possible.