qiskit_dynamics.array.wrap#
- wrap(func, wrap_return=True, wrap_args=True, decorator=False)[source]#
Wrap an array backend function to work with
Array
s.- Parameters:
func (
Callable
) – A function to wrap.wrap_return (
bool
) – IfTrue
convert results that are registered array backend types intoArray
objects.wrap_args (
bool
) – IfTrue
also wrap function type args and kwargs of the wrapped function.decorator (
bool
) – IfTrue
the wrapped decorator functionfunc
will also wrap the decorated functions.
- Returns:
The wrapped function.
- Return type:
Callable