TopQAD1Qbit

Installing the TopQAD SDK

Follow these steps to set up a local environment for developing and testing the SDK.

Supported Python Versions

The TopQAD SDK supports Python 3.10 through 3.12 for development and testing. Newer Python versions (3.13 and above) are not officially supported.

1. Create and Activate a Virtual Environment

There are many tools that can be used to create a virtual environment. We will demonstrate Python's built-in venv module, which creates an isolated Python environment so that we can avoid mismatching dependencies with already installed Python packages.

Open your terminal and navigate to the folder where you want to create a virtual environment.

Create a virtual environment:

python3 -m venv .venv

Activate the environment:

macOS / Linux:

source .venv/bin/activate

Windows:

.\.venv\Scripts\activate

Your terminal prompt should now begin with "(.venv)".

Update pip to ensure it has access to all the dependencies we need to install:

python -m pip install -U pip

2. Install the Package

Use pip to install the topqad-sdk package and all related dependencies:

pip install topqad-sdk

3. Get Your Refresh Token (Required for Authentication)

To use the SDK, you will need to obtain a TOPQAD_REFRESH_TOKEN from the TopQAD portal.

  1. Visit the TopQAD portal.
  2. Go through the registration process and log in.
  3. Click your profile picture in the top right.
  4. Select "Get refresh token".
  5. Copy the token shown.

⚠️ Security Note: Your refresh token is as sensitive as a password. Keep it safe and never commit it to source control.

Set the environment variable directly in your shell, or navigate to the directory where you will be running Python, and use the following command to store your refresh token in a .env file (replace "PASTE_YOUR_TOKEN" with the value of your token):

echo TOPQAD_REFRESH_TOKEN="PASTE_YOUR_TOKEN_HERE" >> .env

4. Verify the Installation

Verify that the topqad-sdk package has been installed, check its version, and confirm the installation path:

pip show topqad-sdk

5. Upgrade or Downgrade the Version

Upgrade the topqad-sdk package using the following command as new versions are announced, and gain access to the latest features:

pip install --upgrade topqad-sdk

Revert to a previous release of the topqad-sdk package, for example, to maintain compatibility with local workflows:

pip install --upgrade topqad-sdk==<VERSION_NUMBER>

Note: replace "<VERSION_NUMBER>" with the target version number, for example, 0.4.0.


License

This project is licensed under the Apache 2.0 License.