Direct Access Backends

class qiskit_aqt_provider._direct.provider.DirectAccessProvider[source]

Bases: object

A 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.

close() → None[source]

Closes the provider, releasing any resources it holds.

get_resource(base_url: str, access_token: str) → DirectAccessResource[source]

Gets a direct access resource at the given base URL.

Parameters:
  • base_url (str) – The base URL of the resource’s API.

  • access_token (str) – The access token to use for authentication when accessing the resource.

Returns:

A direct access resource for the given base URL.

Return type:

DirectAccessResource

class qiskit_aqt_provider._direct.resource.DirectAccessResource[source]

A resource with direct access.

property id: str

The resource’s identifier.

property max_circuits: int

Maximum number of circuits per batch.

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:
  • circuit (QuantumCircuit | Sequence[QuantumCircuit]) – The quantum circuit(s) to run.

  • shots (int | None) – The number of shots to execute. If not provided, the default from the resource’s options will be used.

  • memory (bool | None) – Whether to return memory slots. Default is False.

Returns:

The job representing the execution of the circuit(s).

Return type:

qiskit.providers.JobV1

property target: Target

The resource’s target.

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:
Returns:

The result of the circuit evaluation.

status() → JobStatus[source]

Return the status of the job, among the values of JobStatus.

Raises:
Returns:

The current status of the job.

Return type:

qiskit.providers.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().

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().