qiskit_dynamics.array.wrap#

wrap(func, wrap_return=True, wrap_args=True, decorator=False)[source]#

Wrap an array backend function to work with Arrays.

Parameters:
  • func (Callable) – A function to wrap.

  • wrap_return (bool) – If True convert results that are registered array backend types into Array objects.

  • wrap_args (bool) – If True also wrap function type args and kwargs of the wrapped function.

  • decorator (bool) – If True the wrapped decorator function func will also wrap the decorated functions.

Returns:

The wrapped function.

Return type:

Callable