Write quantum code once, run anywhere. A framework-agnostic quantum computing SDK.
Project description
QuantSDK — Write Quantum Code Once, Run Anywhere
A framework-agnostic quantum computing SDK by TheQuantAI
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:
- Getting Started — Installation, first circuit, core concepts
- API Reference — Circuit, Result, Gates, Runner, Backend
- Tutorials — Bell states, Grover's, VQE, teleportation
- Backend Guides — IBM Quantum, Aer, local simulator
- Contributing — How to contribute
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.
- TheQuantCloud (thequantcloud.com) — Quantum Computing Cloud Platform
- TheQuantDefense (thequantdefense.com) — Quantum Solutions for Defense & Aerospace
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thequantsdk-0.1.0.tar.gz.
File metadata
- Download URL: thequantsdk-0.1.0.tar.gz
- Upload date:
- Size: 91.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a4db4ed6a6faa97b6d2f3dd038113f516d37ab1ff65adbad5e24279b503339a
|
|
| MD5 |
6ebaa3d14be5f988b9f8709aca184e40
|
|
| BLAKE2b-256 |
0e228bb3467a7d7e15c49337edfa91f4a0011a6198eadd22bfb6f5adadd68df4
|
Provenance
The following attestation bundles were made for thequantsdk-0.1.0.tar.gz:
Publisher:
publish.yml on TheQuantAI/quantsdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thequantsdk-0.1.0.tar.gz -
Subject digest:
7a4db4ed6a6faa97b6d2f3dd038113f516d37ab1ff65adbad5e24279b503339a - Sigstore transparency entry: 1102194158
- Sigstore integration time:
-
Permalink:
TheQuantAI/quantsdk@2e9e2eede5b84a68d867f07e2f4b7d4cb60f8120 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TheQuantAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e9e2eede5b84a68d867f07e2f4b7d4cb60f8120 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file thequantsdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: thequantsdk-0.1.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.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecd696cd17b68251ee07324669475bce79f6ac8f8cb4f23e21deac5304e67943
|
|
| MD5 |
f3eb9555e5993de8ceae359716559646
|
|
| BLAKE2b-256 |
7800b1db9e5ce5dc949a30e3a73b42674cacb7a7ad84a1ee47680edd1408fe5a
|
Provenance
The following attestation bundles were made for thequantsdk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on TheQuantAI/quantsdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thequantsdk-0.1.0-py3-none-any.whl -
Subject digest:
ecd696cd17b68251ee07324669475bce79f6ac8f8cb4f23e21deac5304e67943 - Sigstore transparency entry: 1102194164
- Sigstore integration time:
-
Permalink:
TheQuantAI/quantsdk@2e9e2eede5b84a68d867f07e2f4b7d4cb60f8120 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TheQuantAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e9e2eede5b84a68d867f07e2f4b7d4cb60f8120 -
Trigger Event:
workflow_dispatch
-
Statement type: