Skip to main content

QuantSDK — Write Quantum Code Once, Run Anywhere

A framework-agnostic quantum computing SDK by TheQuantAI

Version Python versions License CI

Documentation | Getting Started | API Reference | Examples | Discord


What is QuantSDK?

QuantSDK is a framework-agnostic quantum computing SDK that lets you write quantum circuits once and run them on any backend — IBM Quantum, IonQ, GPU simulators, and more.

No more vendor lock-in. No more rewriting circuits for each framework. One API, every quantum computer.

Features

  • Framework-Agnostic — Write once, export to Qiskit or OpenQASM 2.0
  • QuantRouter — Rule-based smart routing picks the best backend for your circuit
  • Cloud Client — Connect to TheQuantCloud for remote execution and job management
  • Pythonic API — Clean fluent interface, minimal boilerplate
  • 50+ Gates — 44 gate classes, 54 named entries including all standard, parametric, and multi-qubit gates
  • Rich Results — Histograms, probabilities, DataFrames, expectation values
  • Interop — Seamless import/export with Qiskit circuits and OpenQASM 2.0
  • Fast Simulator — Pure NumPy statevector simulator, up to 24 qubits
  • Well Tested — 330+ tests across 10 test modules
  • Open Source — Apache 2.0 license

Installation

pip install thequantsdk

With optional backends:

pip install thequantsdk[ibm]     # IBM Quantum + Aer support
pip install thequantsdk[gpu]     # GPU simulator support
pip install thequantsdk[interop] # Qiskit interop
pip install thequantsdk[viz]     # Matplotlib visualization
pip install thequantsdk[all]     # Everything

Quick Start

import quantsdk as qs

# Create a Bell State circuit
circuit = qs.Circuit(2, name="bell_state")
circuit.h(0).cx(0, 1).measure_all()

# Run on local simulator (default)
result = qs.run(circuit, shots=1000, seed=42)

print(result.counts)         # {'00': 503, '11': 497}
print(result.probabilities)  # {'00': 0.503, '11': 0.497}
print(result.most_likely)    # '00'

Run on Real Quantum Hardware

# Run on IBM Quantum
result = qs.run(circuit, backend="ibm_brisbane", shots=1000)

# Run on Aer simulator
result = qs.run(circuit, backend="aer", shots=1000)

# Smart routing — let QuantRouter pick the best backend
result = qs.run(circuit,
    optimize_for="quality",
    max_cost_usd=0.50,
    shots=1000)

Framework Interop

# Export to Qiskit
qiskit_circuit = circuit.to_qiskit()

# Import from Qiskit
qs_circuit = qs.Circuit.from_qiskit(qiskit_circuit)

# Export to OpenQASM 2.0
qasm_str = circuit.to_openqasm()

# Import from OpenQASM
qs_circuit = qs.Circuit.from_openqasm(qasm_str)

Rich Results

result = qs.run(circuit, shots=4000, seed=42)

result.counts              # Raw counts dict
result.probabilities       # Normalized probabilities
result.most_likely         # Most frequent bitstring
result.top_k(3)            # Top 3 outcomes
result.summary()           # Pretty-printed summary
result.expectation_value(0)  # <Z> on qubit 0
result.to_pandas()         # pandas DataFrame
result.plot_histogram()    # Matplotlib histogram
result.to_dict()           # Full serializable dict

Gate Library

QuantSDK includes 44 gate classes with 54 named entries in the gate map:

Category Gates
Pauli X, Y, Z, I
Hadamard H
Phase S, Sdg, T, Tdg, Phase (U1)
Sqrt SX, SXdg
Rotation RX, RY, RZ, R, U2, U3
Controlled CX (CNOT), CY, CZ, CH, CS, CSdg, CSX, CP, CU1, CU3, CRX, CRY, CRZ
Swap SWAP, iSWAP, DCX
Ising RXX, RYY, RZZ, RZX
Multi-Qubit CCX (Toffoli), CCZ, CSWAP (Fredkin), ECR
Utility Measure, Barrier, Reset

Circuit Inspection

circuit = qs.Circuit(3, name="ghz")
circuit.h(0).cx(0, 1).cx(1, 2).measure_all()

circuit.num_qubits       # 3
circuit.depth             # 3
circuit.gate_count        # 6  (H + 2 CX + 3 Measure)
circuit.count_ops()       # {'H': 1, 'CX': 2, 'Measure': 3}
circuit.draw()            # ASCII circuit diagram
circuit.copy()            # Deep copy
circuit.reset_circuit()   # Clear all gates

Examples

The examples/ directory contains 22 Jupyter notebooks organized by difficulty:

Beginner (01-07)

Notebook Topics
01 Hello Quantum First circuit, superposition, measurement
02 Bell States Entanglement, all four Bell states
03 GHZ State Multi-qubit entanglement, scaling
04 Single-Qubit Gates Pauli, phase, rotation gates
05 Multi-Qubit Gates CNOT, Toffoli, SWAP, Fredkin
06 Circuit Inspection Properties, draw, depth analysis
07 Results Visualization Histograms, DataFrames, statistics

Intermediate (08-14)

Notebook Topics
08 Teleportation Quantum teleportation protocol
09 Deutsch-Jozsa Constant vs balanced oracle
10 Bernstein-Vazirani Hidden string problem
11 Simon's Algorithm Period finding
12 Grover's Search Amplitude amplification
13 QFT Quantum Fourier Transform
14 Phase Estimation Eigenvalue estimation

Advanced (15-18)

Notebook Topics
15 VQE Variational Quantum Eigensolver
16 QAOA MaxCut Combinatorial optimization
17 Quantum ML Parameterized classifier
18 Hybrid Algorithms Parameter-shift gradients

Interop & Backends (19-22)

Notebook Topics
19 Qiskit Interop to_qiskit / from_qiskit
20 OpenQASM Interop to_openqasm / from_openqasm
21 Backend Comparison Local vs Aer benchmarks
22 Advanced Gates Full 50+ gate showcase

Architecture

src/quantsdk/
  __init__.py              # Public API: Circuit, Result, run
  circuit.py               # Circuit class with fluent gate API
  gates.py                 # 44 gate classes, 54 GATE_MAP entries
  result.py                # Result with counts, probabilities, viz
  runner.py                # qs.run() multi-backend routing
  backend.py               # Abstract Backend interface
  router.py                # QuantRouter — rule-based smart backend routing
  cloud/
    __init__.py            # CloudClient — TheQuantCloud API client
    config.py              # Cloud configuration and endpoint management
  simulators/
    local.py               # Pure NumPy statevector simulator
  interop/
    qiskit_interop.py      # Qiskit <-> QuantSDK conversion
    openqasm.py            # OpenQASM 2.0 <-> QuantSDK conversion
  backends/
    ibm.py                 # IBM Quantum + Aer backend adapters

Documentation

Full documentation is available at docs.thequantcloud.com:

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Development setup instructions
  • Code style and testing guidelines
  • How to add new gates and backends
  • Commit message conventions

License

Apache 2.0 — see LICENSE for details.

Security

To report security vulnerabilities, please see SECURITY.md.

About TheQuantAI

QuantSDK is built by TheQuantAI — building the infrastructure layer for quantum computing.

Metadata

Release files for thequantsdk 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thequantsdk 0.2.0
File Size Uploaded Provenance
thequantsdk-0.2.0.tar.gz 92.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for thequantsdk 0.2.0
File Interpreter ABI Platform
thequantsdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 160.0 kB

Release files / thequantsdk-0.2.0.tar.gz

Download URL thequantsdk-0.2.0.tar.gz
Size 92.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c35287fb0cfa1a5f61b2d0e1f3cf2270e1170a029b80263388adcc590b9b1104
BLAKE2b-256 checksum
How to use checksums
2048a28c9edf1d6d59e999aed6bc8c1e2ade0279bdd1bb2d18f0882b443e02a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.

Transparency log

Release files / thequantsdk-0.2.0-py3-none-any.whl

Download URL thequantsdk-0.2.0-py3-none-any.whl
Size 67.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d15afa85092f20982f21c65c6e6c323fcbd1d93aa2930725fc55dd130146aeb
BLAKE2b-256 checksum
How to use checksums
5223fc1f69a60c516e6b378e39ec49f83fc7189345004ecb86cda8d341787652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.

Transparency log

Security for thequantsdk 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for thequantsdk-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page