triqs.gfs.descriptor_base.Function
- class triqs.gfs.descriptor_base.Function(function)[source]
Bases:
BaseDescriptor wrapping a Python callable.
When applied to a Green’s function with mesh values \(\{x_i\}\), sets
G.data[i] = function(x_i)for every mesh point.- Parameters:
- functioncallable
A function
f(mesh_value) -> scalar or numpy.ndarraymatching the target’starget_shape.
Attributes
function
(callable) The stored function
f, accessible as an attribute.Methods
__call__(G)Fill
G.datawithfunctionevaluated at every mesh point.Examples
>>> from triqs.gfs.descriptor_base import Function >>> g << Function(lambda w: 1.0 / (w - 0.5))