Skip to main content

TopQAD SDK for Python

The code in this repository is intended to make access to the TopQAD platform as easy as writing Python!
This guide provides everything you need to set up your local development environment, run the demo script, and understand the core features of the SDK.


1. Development Setup

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

a. Create and Activate a Virtual Environment

This creates an isolated Python environment for the project.

Open your terminal and navigate to the root directory of this project.

Create the 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:
python -m pip install -U pip


b. Install the Package in Editable Mode

This project uses pyproject.toml to manage dependencies. The following command will install the SDK in editable mode (-e) along with all development dependencies. This means any changes you make to the source code are immediately reflected in your environment.

pip install -e .


c. Get Your Refresh Token (Required for Authentication)

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

  1. Visit: https://portal.topqad.1qbit-dev.com/
  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 in your shell or put it in .env file in root:
macOS / Linux:
export TOPQAD_REFRESH_TOKEN="<PASTE_YOUR_TOKEN_HERE>"
Windows:
set TOPQAD_REFRESH_TOKEN="<PASTE_YOUR_TOKEN_HERE>"


d. Verify the Installation

Run the following to check that the topqad-sdk package is installed, see its version, and confirm the installation path:

pip show topqad-sdk

2. Running the Interactive Demo

To see the SDK in action, we have prepared an interactive Jupyter Notebook that demonstrates the core functionality of the Noise Profiler.

To run the demo, open and run the notebook located at:

Noise_Profiler_Demo.ipynb

This notebook will guide you through setting your authentication token and running a simulation.


3. Logging Setup

The SDK supports two ways to configure logging:

  1. Using the TOPQAD_LOG_LEVEL Environment Variable: Set the desired logging level (e.g., INFO, DEBUG, WARNING) in your environment:

    export TOPQAD_LOG_LEVEL=DEBUG
    
  2. Programmatically in Your Code: You can configure the logging level directly in your Python script:

    import logging
    logging.getLogger("topqad_sdk").setLevel(logging.DEBUG)
    

By default, logging is disabled unless explicitly configured using one of the above methods.

SDK Documentation

The SDK documentation contains API references, guides, and examples for interacting with the SDK.

From the project root, run:

cd docs
make html

Once the build completes, open the generated homepage in your browser:

open _build/html/index.html

License

This project is licensed under the Apache 2.0 License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topqad_sdk-0.5.0.tar.gz (187.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topqad_sdk-0.5.0-py3-none-any.whl (146.4 kB view details)

Uploaded Python 3

File details

Details for the file topqad_sdk-0.5.0.tar.gz.

File metadata

  • Download URL: topqad_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 187.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for topqad_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d11ff4999c980bf41a0c382364038832fb442e5c319742eb79dcdc6e1e575bb4
MD5 715f0282548e25c781122f8907283e74
BLAKE2b-256 7da12f2d2d31fc52e70762e42d7081d12785dfdf0429406cf9aab3daca4206c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for topqad_sdk-0.5.0.tar.gz:

Publisher: publish_to_pypi.yml on 1QB-Information-Technologies/topqad-sdk-for-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file topqad_sdk-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: topqad_sdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 146.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for topqad_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbac1f5dfeefc24656d3357ea4997cf15b06ef570ce7aed3254ec6f8367ac098
MD5 20894f3dff0f404165887b3aaa66cec4
BLAKE2b-256 62ee72baadc1eb7657f8c24f8f9263451b5a6d27ac2e9999426fe490cd1a3a43

See more details on using hashes here.

Provenance

The following attestation bundles were made for topqad_sdk-0.5.0-py3-none-any.whl:

Publisher: publish_to_pypi.yml on 1QB-Information-Technologies/topqad-sdk-for-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page