general_superstaq.superstaq_client

Client for making requests to Superstaq’s API.

Attributes

RECOGNISED_CIRCUIT_TYPES

The circuit types that are currently implemented within the SuperstaqClient.

TQuboKey

Classes

ApiVersion

The supported API versions.

Functions

find_api_key(→ str)

Function to try to load a Superstaq API key from the environment or a key file.

read_ibm_credentials(→ dict[str, str])

Function to try to read IBM credentials from .qiskit/qiskit-ibm.json.

Module Contents

class general_superstaq.superstaq_client.ApiVersion

Bases: str, enum.Enum

The supported API versions.

V0_2_0 = 'v0.2.0'
V0_3_0 = 'v0.3.0'
general_superstaq.superstaq_client.find_api_key() str

Function to try to load a Superstaq API key from the environment or a key file.

Raises:
  • OSError – If the Superstaq API key could not be found in the environment.

  • EnvironmentError – If the Superstaq API key could not be found.

Returns:

Superstaq API key string.

general_superstaq.superstaq_client.read_ibm_credentials(ibmq_name: str | None) dict[str, str]

Function to try to read IBM credentials from .qiskit/qiskit-ibm.json.

Parameters:

ibmq_name – The name under which the IBM account credentials are locally stored.

Raises:
  • FileNotFoundError – If the configuration file is not found.

  • KeyError – If the provided ibmq_name does not have credentials stored in the config file or token and/or channel keys are missing for the credentials of the account under ibmq_name.

  • ValueError – If no ibmq_name is provided and multiple accounts are found with none marked as default.

Returns:

Dictionary containing the IBM token, channel, and instance (if available).

general_superstaq.superstaq_client.RECOGNISED_CIRCUIT_TYPES

The circuit types that are currently implemented within the SuperstaqClient.

general_superstaq.superstaq_client.TQuboKey