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.

Download files

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

Source Distribution

thequantsdk-0.2.0.tar.gz (92.1 kB view details)

Uploaded Source

Built Distribution

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

thequantsdk-0.2.0-py3-none-any.whl (67.9 kB view details)

Uploaded Python 3

File details

Details for the file thequantsdk-0.2.0.tar.gz.

File metadata

  • Download URL: thequantsdk-0.2.0.tar.gz
  • Upload date:
  • Size: 92.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thequantsdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c35287fb0cfa1a5f61b2d0e1f3cf2270e1170a029b80263388adcc590b9b1104
MD5 1441549a6e72c559979dd65a5d8bfc06
BLAKE2b-256 2048a28c9edf1d6d59e999aed6bc8c1e2ade0279bdd1bb2d18f0882b443e02a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for thequantsdk-0.2.0.tar.gz:

Publisher: publish.yml on TheQuantAI/quantsdk

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

File details

Details for the file thequantsdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: thequantsdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thequantsdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d15afa85092f20982f21c65c6e6c323fcbd1d93aa2930725fc55dd130146aeb
MD5 c9b74f0bce74cfda8da7041fe6ae4b9b
BLAKE2b-256 5223fc1f69a60c516e6b378e39ec49f83fc7189345004ecb86cda8d341787652

See more details on using hashes here.

Provenance

The following attestation bundles were made for thequantsdk-0.2.0-py3-none-any.whl:

Publisher: publish.yml on TheQuantAI/quantsdk

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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

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