qiskit_dynamics.dispatch.requires_backend#

requires_backend(backend)[source]#

Return a function and class decorator for checking a backend is available.

If the the required backend is not in the list of available_backends() any decorated function or method will raise an exception when called, and any decorated class will raise an exeption when its __init__ is called.

Parameters:

backend (str) – the backend name required by class or function.

Returns:

A decorator that may be used to specify that a function, class,

or class method requires a specific backend to be installed.

Return type:

Callable