FunctionGenerator

class madspace.FunctionGenerator(self: madspace._madspace_py.FunctionGenerator, name: str, arg_types: madspace._madspace_py.NamedTypes, return_types: madspace._madspace_py.NamedTypes)

Bases: pybind11_object

Base class for compute-graph functions that are not invertible mappings.

A FunctionGenerator builds a Function from named Arguments to named Returns. Unlike Mapping it has no inverse and produces no Jacobian weight. It is used for the pieces of the integrand that only need to be evaluated in one direction: cuts, observables, histograms, matrix elements, PDF and scale evaluation, and the trainable networks. Concrete subclasses list their arguments and returns individually. Subclasses may be written in Python by deriving from this class.

References

Parameters:
  • name – Identifier used for the generated compute graph.

  • arg_types – Types of the values consumed by the function.

  • return_types – Types of the values produced by the function.

build_function(*args, **kwargs)

Overloaded function.

  1. build_function(self: madspace._madspace_py.FunctionGenerator, builder: madspace._madspace_py.FunctionBuilder, args: collections.abc.Sequence[madspace._madspace_py.Value]) -> madspace._madspace_py.NamedValues

Add the function to fb and return its named results.

The positional overload attaches names from arg_types().

  1. build_function(self: madspace._madspace_py.FunctionGenerator, builder: madspace._madspace_py.FunctionBuilder, args: madspace._madspace_py.NamedValues) -> madspace._madspace_py.NamedValues

Add the function to fb and return its named results.

The positional overload attaches names from arg_types().

function(self: madspace._madspace_py.FunctionGenerator) → madspace._madspace_py.Function

Build a standalone Function.

release_inputs()