qiskit_dynamics.dispatch.asarray#

asarray(array, dtype=None, order=None, backend=None)[source]#

Convert input array to an array on the specified backend.

This functions like numpy.asarray but optionally supports casting to other registered array backends.

Parameters:
  • array (any) – An array_like input.

  • dtype (Optional[any]) – Optional. The dtype of the returned array. This value must be supported by the specified array backend.

  • order (Optional[str]) – Optional. The array order. This value must be supported by the specified array backend.

  • backend (Optional[str]) – A registered array backend name. If None the default array backend will be used.

Returns:

an array object of the form specified by the backend

kwarg.

Return type:

array