Function sequant::canonicalize(ExprPtr&)

Function Documentation

ExprPtr &sequant::canonicalize(ExprPtr &expr)

Recursively canonicalizes an Expr and replaces it as needed

Note

the canonicalization options are those of the default context

Parameters:

expr – [inout] expression to be canonicalized; may be replaced (i.e. &expr may be mutated by call); a Sum left with at most one summand, or a Product with one factor and a unit scalar, is replaced by that summand or factor (or 0), canonicalized on its own

Returns:

expr to facilitate chaining