Template Function sequant::detail::stringify_expr

Function Documentation

template<typename Represent>
std::string sequant::detail::stringify_expr(const Expr &expr, std::string_view product_separator, Represent &&represent, std::string_view who)

Renders expr in infix notation: sums as a + b, products as their scalar prefactor (if not 1) and factors joined by product_separator

Parameters:
  • expr – the expression to render

  • product_separator – the separator between the factors of a Product

  • represent – renders a Tensor, Variable, Constant or Power; invoked with the expression cast to its concrete type

  • who – names the caller in the exception message

Throws:

Exception – if expr contains any other type of expression