triqs.gfs.lazy_expressions.LazyExpr
- class triqs.gfs.lazy_expressions.LazyExpr(*args)[source]
Bases:
__auxA node in a lazy expression tree.
Each node carries a
tagand a list ofchilds. Tags are:"T"— terminal;childs[0]is the wrapped value (descriptor, scalar, …)."+","-","*","/"— binary arithmetic; the two children are themselvesLazyExprnodes."F"— function application;childs[0]is a terminal wrapping the callable, the remaining children are its arguments.
Operator overloads on the parent
__auxbuild these trees from Python expressions (a + b,f(a, b), …).- Parameters:
- *args
Single argument — if it is a
LazyExpritstagandchildsare aliased; otherwise the argument is wrapped as a terminal (tag = 'T').Two or more arguments — first is interpreted as the
tag, the rest aschilds.
Attributes
tag
(str) Node kind.
childs
(list) Child nodes (or wrapped payload for terminals).
Methods
copy()Shallow copy of this node (children are shared).
Wrapped payload, or
Noneif this node is not a leaf.Whether this node is a leaf node.
set_from(y)In-place assignment:
selfis rewritten to matchy.