qrisp.interface.Job.cancel#

abstractmethod Job.cancel() bool[source]#

Attempt to cancel the job.

Returns:
bool

True if the cancellation was initiated: either the job is already in CANCELLED state (for synchronous or in-process backends), or the cancel request has been dispatched to the remote backend (for asynchronous hardware backends, the transition to CANCELLED may not yet be visible in status()).

False if the job is already in a terminal state and no action was taken.

Note

For asynchronous remote backends, True means the cancel request was accepted by the server, not that the job has confirmed cancellation. Callers should check status() (or call result()) to determine the final outcome.