Direct Access Backends¶
- class qiskit_aqt_provider._direct.provider.DirectAccessProvider[source]¶
Bases:
objectA provider for direct access resources.
- __init__(*, http_client_factory: ~collections.abc.Callable[[str, str], ~httpx.Client] = <function _http_client_factory>) None[source]¶
Initializes the direct access provider.
- get_resource(base_url: str, access_token: str) DirectAccessResource[source]¶
Gets a direct access resource at the given base URL.
- Parameters:
- Returns:
A direct access resource for the given base URL.
- Return type:
- class qiskit_aqt_provider._direct.resource.DirectAccessResource[source]¶
A resource with direct access.
- restore_job(job_id: str, *, store: JobStore | None = None, delete: bool = False) DirectAccessJob[source]¶
Restore a persisted single-circuit direct-access job.
- run(circuit: QuantumCircuit | Sequence[QuantumCircuit], **kwargs: Unpack[ResourceRunOptions]) JobV1[source]¶
Run a quantum circuit or a sequence of quantum circuits on the resource.
- Parameters:
- Returns:
The job representing the execution of the circuit(s).
- Return type:
- class qiskit_aqt_provider._direct.job.DirectAccessJob[source]¶
A job representing the execution of a circuit on an AQT direct access resource.
- persist(*, store: JobStore | None = None) None[source]¶
Persist this submitted job for restoration in a later process.
- result(*, timeout: float | None = None) Result[source]¶
Blocks until the job finishes processing then returns the result.
- Parameters:
timeout – The maximum number of seconds to wait for the job to finish. If None, wait indefinitely. The resource will however time out the request after 24 hours.
- Raises:
APIError – the operation failed on the target resource.
AQTJobInvalidStateError – if the job was cancelled.
AQTJobFailedError – if the job failed with an error.
qiskit.providers.exceptions.JobTimeoutError – If the job does not reach a final state before the specified timeout.
- Returns:
The result of the circuit evaluation.
- status() JobStatus[source]¶
Return the status of the job, among the values of
JobStatus.- Raises:
AQTCredentialsError – if the user is not authenticated and no access token is available.
AQTCredentialsError – If the provided token is invalid or expired.
AQTRequestError – If there is a network-related error during the request.
AQTValueError – If the job with the specified ID does not exist.
AQTValueError – If the provided job ID is not valid.
AQTApiError – If the API encounters an internal error.
AQTApiError – For any other unexpected errors.
- Returns:
The current status of the job.
- Return type:
- submit() None[source]¶
Do not call — submission is handled by the backend.
This job object represents an execution that has already been submitted via backend.run(). Calling submit() is invalid and always raises a RuntimeError.
- Raises:
RuntimeError – Job submission is performed by backend.run().
- class qiskit_aqt_provider._direct.composite_job.CompositeDirectAccessJob[source]¶
A job representing the execution of multiple circuits on an AQT direct access resource.
- persist(*, store: JobStore | None = None) None[source]¶
Reject persistence because composite jobs submit circuits lazily.
- result(*, timeout: float | None = None) Result[source]¶
Blocks until the job finishes processing then returns the result.
If an error occurs, the remaining circuits are not executed and the whole job is marked as failed.
- Raises:
AQTJobFailedError – if the job failed with an error.
JobTimeoutError – If the job does not reach a final state before the specified timeout.
- Returns:
The result of the circuit evaluation.
- status() JobStatus[source]¶
Return the status of the job, among the values of
JobStatus.- Returns:
The current status of the job.
- Return type:
JobStatus
- submit() None[source]¶
Do not call — submission is handled by the backend.
This job object represents an execution that has already been submitted via backend.run(). Calling submit() is invalid and always raises a RuntimeError.
- Raises:
RuntimeError – Job submission is performed by backend.run().