Function sequant::canonicalize_tensor_leaf

Function Documentation

ExprPtr sequant::canonicalize_tensor_leaf(Expr &leaf, CanonicalizeOptions opts, const std::function<void(const AbstractTensor&)> &assign)

canonicalizes an Expr that is a tensor leaf, as Tensor::canonicalize does

A leaf in which an index occurs more than once, protoindices included, is a tensor network and is canonicalized as one, with opts; any other is canonicalized in place by the default tensor canonicalizer, through the AbstractTensor interface of leaf .

Parameters:
  • leaf – [inout] an Expr that is an AbstractTensor

  • opts – [in] the canonicalization options

  • assign – [in] assigns the canonical form computed as a tensor network, an object of the same type as leaf , to leaf

Returns:

the byproduct of canonicalization (e.g. a phase), or nullptr