triqs.gfs.lazy_expressions.eval_expr
- triqs.gfs.lazy_expressions.eval_expr(expr)[source]
Reduce
exprusing an evaluation context discovered in its terminals.If
expris not aLazyExpr, it is returned unchanged. Otherwise the function looks for a terminal exposing__lazy_expr_eval_context__()(typically aGf), checks that every such terminal yields a compatible context, and delegates toeval_expr_with_context().- Parameters:
- exprLazyExpr or object
Expression to reduce. Non-
LazyExprvalues are returned unchanged.
- Returns:
- object
Reduced value of the expression (or
expritself if it was not aLazyExpr).
- Raises:
- ValueError
If no terminal can build an evaluation context, or if multiple terminals build incompatible contexts (e.g. Green’s functions on different meshes).