triqs.gfs.lazy_expressions.transform

triqs.gfs.lazy_expressions.transform(expr, Fnode, Fterm=<function <lambda>>)[source]

Recursively map Fnode / Fterm over a lazy expression.

Parameters:
exprLazyExpr

Expression to rewrite.

Fnodecallable

Fnode(tag, childs) -> (tag, childs) applied at every non-terminal node.

Ftermcallable, optional

Fterm(value) -> value applied at every terminal. Default is the identity.

Returns:
LazyExpr

A new tree obtained by applying the rewrites bottom-up.