Skip to main content

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

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.

Project details


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.1.0.tar.gz (91.2 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.1.0-py3-none-any.whl (67.9 kB view details)

Uploaded Python 3

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

Hashes for thequantsdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7a4db4ed6a6faa97b6d2f3dd038113f516d37ab1ff65adbad5e24279b503339a
MD5 6ebaa3d14be5f988b9f8709aca184e40
BLAKE2b-256 0e228bb3467a7d7e15c49337edfa91f4a0011a6198eadd22bfb6f5adadd68df4

See more details on using hashes here.

Provenance

The following attestation bundles were made for thequantsdk-0.1.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.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

Hashes for thequantsdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ecd696cd17b68251ee07324669475bce79f6ac8f8cb4f23e21deac5304e67943
MD5 f3eb9555e5993de8ceae359716559646
BLAKE2b-256 7800b1db9e5ce5dc949a30e3a73b42674cacb7a7ad84a1ee47680edd1408fe5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for thequantsdk-0.1.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.

Supported by

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