AQTProvider

class qiskit_aqt_provider.aqt_provider.AQTProvider[source]

Bases: object

Provider for backends from Alpine Quantum Technologies (AQT).

__init__(access_token: str | None = None, arnica_config: ArnicaConfig | None = None, *, load_dotenv: bool = True, dotenv_path: str | Path | None = None) None[source]

Initialize the AQT provider.

The access token for the AQT cloud can be provided either by:
  • calling log_in() and successfully authenticating, or;

  • passing an access token as the access_token argument, or;

  • setting the access token to the AQT_TOKEN environment variable.

Hint

If no access token is given, the provider is initialized with access to the offline simulators only and NoTokenWarning is emitted.

The AQT cloud portal URL can be configured using the AQT_PORTAL_URL environment variable.

If load_dotenv is true, environment variables are loaded from a file, by default any .env file in the working directory or above it in the directory tree. The dotenv_path argument allows to pass a specific file to load environment variables from.

Parameters:
  • access_token – AQT cloud access token.

  • arnica_config – configuration for the AQT Arnica service.

  • load_dotenv – whether to load environment variables from a .env file.

  • dotenv_path – path to the environment file. This implies load_dotenv.

backends(name: str | Pattern[str] | None = None, *, backend_type: Literal['device', 'simulator', 'offline_simulator'] | None = None, workspace: str | Pattern[str] | None = None) BackendsTable[source]

Search for cloud backends matching given criteria.

With no arguments, return all backends accessible with the configured access token.

Filters can be either strings or regular expression patterns. Strings filter by exact match.

Parameters:
  • name – filter for the backend name.

  • backend_type – if given, restrict the search to the given backend type.

  • workspace – filter for the workspace ID.

Returns:

Collection of backends accessible with the given access token that match the given criteria.

get_backend(name: str | Pattern[str] | None = None, *, backend_type: Literal['device', 'simulator', 'offline_simulator'] | None = None, workspace: str | Pattern[str] | None = None, available_qubits: int | None = None) AQTResource[source]

Return a handle for a cloud quantum computing resource matching the specified filtering.

Parameters:
  • name – filter for the backend name.

  • backend_type – if given, restrict the search to the given backend type.

  • workspace – if given, restrict to matching workspace IDs.

  • available_qubits – only valid for offline_simulator-type backends. If given, set the size of the quantum register to simulate.

Returns:

backend matching the filtering.

Return type:

Backend

Raises:

QiskitBackendNotFoundError – if no backend could be found or more than one backend matches the filtering criteria.

get_direct_access_backend(base_url: str, /) AQTDirectAccessResource[source]

Return a handle for a direct-access quantum computing resource.

Parameters:

base_url – URL of the direct-access interface.

log_in() None[source]

Log in to the AQT cloud and store the access token.

class qiskit_aqt_provider.aqt_provider.ArnicaConfig[source]

Configuration for the SDK.

arnica_url

the base URL of the Arnica API. Defaults to “https://arnica.aqt.eu/api”.

Type:

str

client_id

the ID to use for authentication with client credentials. Defaults to None.

Type:

str | None

client_secret

the secret to use for authentication with client credentials. Defaults to None.

Type:

str | None

store_access_token

when True, the access (and any refresh) token will be persisted to the store_path passed at initialisation. Defaults to True.

Type:

bool

oidc_config

configuration for the OIDC provider. You will not normally need to modify this.

Type:

object

__init__(store_path: Path | None = None) None[source]

Initializes the configuration.

Parameters:

store_path – Local persistent storage directory. Defaults to a standard cache directory.

class qiskit_aqt_provider.aqt_provider.BackendsTable[source]

Bases: Sequence[AQTResource]

Pretty-printable collection of AQT cloud backends.

The __str__() method returns a plain text table representation of the available backends. The _repr_html_() method returns an HTML representation that is automatically used in IPython/Jupyter notebooks.

__str__() str[source]

Plain-text table representation.

_repr_html_() str[source]

HTML table representation (for IPython/Jupyter).

by_workspace() dict[str, list[AQTResource]][source]

Backends grouped by workspace ID.

class qiskit_aqt_provider.aqt_provider.NoTokenWarning[source]

Bases: UserWarning

Warning emitted when a provider is initialized with no access token.