mqt.qudits.simulation.jobs
¶
Submodules¶
Package Contents¶
- class Job(backend: Backend | None, job_id: str = 'auto', **kwargs)[source]¶
Class to handle jobs
This first version of the Backend abstract class is written to be mostly backwards compatible with the legacy providers interface. This was done to ease the transition for users and provider maintainers to the new versioned providers. Expect future versions of this abstract class to change the data model and interface.
- version = 1¶
- in_final_state() bool [source]¶
Return whether the job is in a final job state such as DONE or ERROR.
- wait_for_final_state(timeout: float | None = None, wait: float = 5, callback: Callable | None = None) None [source]¶
Poll the job status until it progresses to a final state such as DONE or ERROR.
- Parameters:
timeout – Seconds to wait for the job. If None, wait indefinitely.
wait – Seconds between queries.
callback – Callback function invoked after each query.
- Raises:
JobTimeoutError – If the job does not reach a final state before the specified timeout.
- class JobStatus(*args, **kwds)[source]¶
Bases:
enum.Enum
Enumeration for job status.
- INITIALIZING = 'Initializing: Job is being initialized'¶
- QUEUED = 'Queued: Job is waiting in the queue'¶
- VALIDATING = 'Validating: Job is being validated'¶
- RUNNING = 'Running: Job is actively running'¶
- CANCELLED = 'Cancelled: Job has been cancelled'¶
- DONE = 'Done: Job has successfully run'¶
- ERROR = 'Error: Job incurred an error'¶