AQTProvider¶
- class qiskit_aqt_provider.aqt_provider.AQTProvider[source]¶
Bases:
objectProvider 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_tokenargument, or;setting the access token to the
AQT_TOKENenvironment variable.
Hint
If no access token is given, the provider is initialized with access to the offline simulators only and
NoTokenWarningis emitted.The AQT cloud portal URL can be configured using the
AQT_PORTAL_URLenvironment variable.If
load_dotenvis true, environment variables are loaded from a file, by default any.envfile in the working directory or above it in the directory tree. Thedotenv_pathargument 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
.envfile.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.
- 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:
- 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_pathpassed at initialisation. Defaults to True.- Type:
- oidc_config¶
configuration for the OIDC provider. You will not normally need to modify this.
- Type:
- 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.
- class qiskit_aqt_provider.aqt_provider.NoTokenWarning[source]¶
Bases:
UserWarningWarning emitted when a provider is initialized with no access token.