triqs.gfs.lazy_expressions
Small expression-tree library used by Green’s-function descriptors.
The LazyExpr /
LazyExprTerminal pair lets TRIQS
defer arithmetic on Green’s functions and descriptors until <<
evaluates the resulting tree on a concrete target. For example,
>>> g << iOmega_n + 0.5 - SemiCircular(1.0)
is parsed by the operator overloads on
LazyExprTerminal into a
binary tree of + and - nodes whose leaves are the descriptors
and scalars, and that tree is then walked by
eval_expr_with_context() inside
__lshift__().
End users do not need to touch this module directly; it is documented mainly so that authors of new descriptors understand the protocol.
Functions
|
Walk |
|
Reduce |
|
Recursively reduce |
|
Wrap a Python callable so it can be applied to lazy expressions. |
|
Wrap |
|
Recursively map |
Classes
|
A node in a lazy expression tree. |
Base class for any object that can appear as a leaf of a |