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, *, 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 through the
access_token
argument or theAQT_TOKEN
environment variable.Hint
If no token is set (neither through the
access_token
argument nor through theAQT_TOKEN
environment variable), the provider is initialized with access to the offline simulators only andNoTokenWarning
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. Thedotenv_path
argument allows to pass a specific file to load environment variables from.- Parameters:
access_token – AQT cloud access token.
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) 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.
- 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.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:
UserWarning
Warning emitted when a provider is initialized with no access token.