function

function

Express mathematical expressions in terms of computational functions.

class PositionalArgumentFunction(function: Callable[[...], ndarray], argument_order: Iterable[str])[source]

Bases: Function

Wrapper around a function with positional arguments.

This class provides a __call__() that can take a DataSample for a function with positional arguments. Its argument_order redirect the keys in the DataSample to the argument positions in its underlying function.

function: Callable[[...], ndarray]

A function with positional arguments only.

argument_order: Tuple[str, ...]

Ordered labels for each positional argument.

__call__(data: Dict[str, ndarray]) ndarray[source]

Call self as a function.

__eq__(other)

Method generated by attrs for class PositionalArgumentFunction.

class ParametrizedBackendFunction(function: Callable[[...], ndarray], argument_order: Iterable[str], parameters: Mapping[str, Union[complex, float]])[source]

Bases: ParametrizedFunction

Implements ParametrizedFunction for a specific computational back-end.

__call__(data: Dict[str, ndarray]) ndarray[source]

Call self as a function.

property function: Callable[[...], ndarray]
property argument_order: Tuple[str, ...]
property parameters: Dict[str, Union[complex, float]]

Get dict of parameters.

update_parameters(new_parameters: Mapping[str, Union[complex, float]]) None[source]

Update the collection of parameters.

get_source_code(function: Function) str[source]

Get the backend source code used to compile this function.

Submodules and Subpackages