class qiskit_aqt_provider.aqt_job.AQTJob[source]#

Handle for quantum circuits jobs running on AQT backends.

Jobs contain one or more quantum circuits that are executed with a common set of options (see AQTOptions).

Job handles should be retrieved from calls to qiskit.execute or, both of which immediately submit the job for execution. The result() method allows blocking until a job completes:

>>> import qiskit
>>> from qiskit.providers import JobStatus
>>> from qiskit_aqt_provider import AQTProvider
>>> backend = AQTProvider("").get_backend("offline_simulator_no_noise")
>>> qc = qiskit.QuantumCircuit(1)
>>> _ = qc.rx(3.14, 0)
>>> _ = qc.measure_all()
>>> job = qiskit.execute(qc, backend, shots=100)
>>> result = job.result()
>>> job.status() is JobStatus.DONE
>>> result.success
>>> result.get_counts()
{'1': 100}
__init__(backend: AQTResource, circuits: List[QuantumCircuit], options: AQTOptions)[source]#

Initialize an AQTJob instance.


AQTJob instances should not be created directly. Use to submit circuits for execution and retrieve a job handle.

  • backend – backend to run the job on.

  • circuits – list of circuits to execute.

  • options – overridden resource options for this job.

property error_message: str | None#

Error message for this job (if any).

persist(*, store_path: Path | None = None) Path[source]#

Save this job to local persistent storage.


Only jobs that have been submitted for execution can be persisted (a valid job_id is required).


store_path – local persistent storage directory. By default, use a standard cache directory.


The path to the job data in local persistent storage.


RuntimeError – the job was never submitted for execution.

progress() Progress[source]#

Progress information for this job.

classmethod restore(job_id: str, *, access_token: str | None = None, store_path: Path | None = None, remove_from_store: bool = True) Self[source]#

Restore a job handle from local persistent storage.


The default local storage path depends on the qiskit_aqt_provider package version. Job persisted with a different package version will therefore not be found!


If the job’s execution backend is an offline simulator, the job is re-submitted to the simulation backend and the new job ID differs from the one passed to this function.

  • job_id – identifier of the job to retrieve.

  • access_token – access token for the AQT cloud. See AQTProvider.

  • store_path – local persistent storage directory. By default, use a standard cache directory.

  • remove_from_store – if True, remove the retrieved job’s data from persistent storage after a successful load.


A job handle for the passed job_id.


JobNotFoundError – the target job was not found in persistent storage.

result() Result[source]#

Block until all circuits have been evaluated and return the combined result.

Success or error is signalled by the success field in the returned Result instance.


The combined result of all circuit evaluations.

status() JobStatus[source]#

Query the job’s status.


Aggregated job status for all the circuits in this job.

submit() None[source]#

Submit this job for execution.

This operation is not blocking. Use result() to block until the job completes.


RuntimeError – this job was already submitted.

class qiskit_aqt_provider.aqt_job.Progress[source]#

Progress information of a job.

finished_count: int#

Number of completed circuits.

total_count: int#

Total number of circuits in the job.

class qiskit_aqt_provider.persistence.JobNotFoundError[source]#

Bases: Exception

A job was not found in persistent storage.