Skip to main content

Multi-paradigm quantum computing SDK — Grover, QAOA, VQE, Shor, QSVM, surface code, entity resolution

Project description

Quanta SDK

Multi-paradigm quantum computing SDK for Python

Version Python License Tests Benchmark QASMBench Platform


Quanta is a clean, modular quantum computing SDK designed for researchers, engineers and developers. It provides a 3-layer abstraction — from high-level declarative APIs (search(), factor()) to low-level DAG manipulation and QASM export — so you can work at the level that fits your problem.

Key highlights:

  • Shor, VQE, QAOA, QSVM, Grover — production-grade quantum algorithms
  • DAG-based IR with 3-pass compiler and topology-aware qubit routing
  • Statevector simulator up to 27 qubits with optional JAX/CuPy GPU acceleration
  • Surface code QEC, BB84 QKD, and error correction primitives
  • Real-world demo: quantum entity resolution for customer deduplication

Table of Contents

Quick Start

from quanta import circuit, H, CX, measure, run

@circuit(qubits=2)
def bell(q):
    H(q[0])
    CX(q[0], q[1])
    return measure(q)

result = run(bell, shots=1024)
print(result)
╔══════════════════════════════════════════════════╗
║  Quanta Result: bell                            ║
╠──────────────────────────────────────────────────╣
║  |00>  ████████████████████  50.5%              ║
║  |11>  ███████████████████   49.5%              ║
╠──────────────────────────────────────────────────╣
║  0.71|00> + 0.71|11>                            ║
╚══════════════════════════════════════════════════╝

Architecture

┌──────────────────────────────────────────────────────────┐
│  Layer 3 — Declarative API                               │
│  search() · optimize() · vqe() · factor() · qsvm()      │
│  portfolio_optimize() · resolve() · multi_agent()        │
├──────────────────────────────────────────────────────────┤
│  Layer 2 — Circuit API                                   │
│  @circuit · H · CX · RZ · measure · run · sweep          │
│  custom_gate() · 17 built-in gates                       │
├──────────────────────────────────────────────────────────┤
│  Layer 1 — Physical Layer                                │
│  DAG IR · 3-pass compiler · qubit routing · QASM I/O     │
│  statevector · density matrix · JAX/CuPy acceleration    │
└──────────────────────────────────────────────────────────┘

Features

Core

  • 17 built-in gates — H, X, Y, Z, CX, CCX, SWAP, RX, RY, RZ, S, T, and more
  • custom_gate(name, matrix) — define your own unitary gates
  • @circuit decorator — write quantum circuits as Python functions
  • sweep(circuit, params) — parameter scans for variational algorithms

Compiler & IR

  • DAG-based intermediate representation — directed acyclic graph for circuit analysis
  • 3-pass optimizer — gate cancellation, gate merging, basis translation
  • Topology-aware routing — SWAP insertion for linear, ring, and grid topologies
  • QASM 2.0/3.0 — import external circuits and export for cross-SDK interop

Simulators

  • Statevector — tensor contraction engine, up to 27 qubits (100s, 2GB)
  • Density matrix — mixed states + Kraus noise channels, up to 13 qubits
  • Accelerated backend — auto-detects JAX-GPU / CuPy; falls back to NumPy on CPU

Error Correction

  • Bit-flip, Phase-flip, Steane [[7,1,3]] codes
  • Surface code [[d²,1,d]] — logical qubits with configurable distance, threshold ~1%

Security

  • BB84 QKD — quantum key distribution with eavesdropper detection (Example →)

Algorithms

Algorithm Module Use Case Example
Grover layer3.search Unstructured search (√N speedup) 05 →
QAOA layer3.optimize Combinatorial optimization 07 →
VQE layer3.vqe Molecular ground-state energy 06 →
Shor layer3.shor Integer factoring (RSA) 10 →
QSVM layer3.qsvm Quantum kernel classification 10 →
Multi-Agent layer3.agent Quantum agent-based modeling 09 →
Portfolio layer3.finance Financial portfolio optimization 07 →
Hamiltonian layer3.hamiltonian Molecular simulation (H₂, LiH, HeH⁺) 06 →
Entity Resolution layer3.entity_resolution Customer deduplication (QAOA) 11 →

Examples & Use Cases

Run any example with python -m quanta.examples.<name>:

01 Bell State

EPR pair — the simplest entanglement demonstration.

python -m quanta.examples.01_bell_state

02 GHZ State

Multi-qubit entanglement: all-or-nothing correlations.

python -m quanta.examples.02_ghz_state

03 Quantum Teleportation

Transfer an unknown quantum state using entanglement + classical bits.

python -m quanta.examples.03_teleportation

04 Deutsch-Jozsa

Determine if a function is constant or balanced in one query.

python -m quanta.examples.04_deutsch_jozsa

05 Grover Search

Quadratic speedup for unstructured search — finds target with 99.9% probability.

python -m quanta.examples.05_grover

06 Molecular Energy

H₂ and HeH⁺ ground state via VQE + Hamiltonian time evolution.

python -m quanta.examples.06_molecule_energy

07 Portfolio Optimization

Quantum-optimized stock portfolios — tech vs crypto, conservative vs aggressive.

python -m quanta.examples.07_portfolio_optimization

08 QKD BB84

Quantum key distribution — detect eavesdroppers via ~25% error rate.

python -m quanta.examples.08_qkd_bb84

09 Full Demo

All SDK features in one script — circuits, custom gates, VQE, Grover, noise, routing, QASM.

python -m quanta.examples.09_full_demo

10 Quantum Benchmark

8-test quality litmus test — Bell fidelity, CHSH, teleportation, Grover, VQE, Shor, QSVM, surface code.

python -m quanta.examples.10_quantum_benchmark

11 Entity Resolution

Real-world use case: OTA customer deduplication with QAOA vs classical greedy.
25 records, 8 columns, Turkish name handling, 3-layer blocking pipeline.
Result: QAOA 86% accuracy vs Greedy 64%.

python -m quanta.examples.11_entity_resolution

Quality Benchmark

Turnusol Test — 8/8 🏆

# Test Result Metric
1 Bell State Fidelity F = 1.0000
2 CHSH Inequality S = 2.8284 (Tsirelson bound)
3 Quantum Teleportation Unitarity preserved
4 Grover Amplification 99.9% target probability
5 VQE Convergence (H₂) 0.000054 Ha error
6 Shor Factoring 15 = 3 × 5
7 QSVM Classification 100% accuracy
8 Surface Code QEC 0% logical error rate

QASMBench — 10/10

All standard QASMBench circuits import, compile, and simulate correctly:
bell · ghz · qft · teleportation · deutsch-jozsa · grover · adder · vqe_ansatz · swap_test · random

Large circuit support: GHZ-20 (710ms), QFT-20 (3.5s), Random-24 (12s).

Benchpress Compatible

Includes QuantaBenchpressBackend adapter for cross-SDK benchmarking alongside Qiskit, Cirq, and Braket using the Benchpress framework.

Installation

# Clone and install
git clone https://github.com/ONMARTECH/quanta-sdk.git
cd quanta-sdk
pip install -e ".[dev]"

# Run tests
pytest

# Run benchmark
python -m quanta.examples.10_quantum_benchmark

Optional GPU acceleration:

pip install jax jaxlib   # JAX GPU backend
pip install cupy          # NVIDIA CUDA backend

Documentation

Document Description
Architecture (EN) System design, DAG IR, compiler pipeline
Architecture (TR) Türkçe mimari dokümanı
Features (EN) Complete feature list
Comparison (EN) vs Qiskit, Cirq, Braket
CHANGELOG Version history

Project Stats

Files:       86          Languages:   Python
Lines:       11,770      Tests:       150+
Algorithms:  9           Examples:    11
Simulators:  3           QEC Codes:   4
QASM:        2.0 + 3.0   Max Qubits:  27

Author

Abdullah Enes SARIONMARTECH

info@onmartech.com

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check issues page.

License

Apache License 2.0


Built for the quantum computing community

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

quanta_sdk-0.5.0.tar.gz (101.6 kB view details)

Uploaded Source

Built Distribution

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

quanta_sdk-0.5.0-py3-none-any.whl (107.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for quanta_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1710027b8c8f03897904f251626639b56fb9981e1c63bb8b7596f44ff9b9c111
MD5 50b0e11f3c6c2377132928b44be1c154
BLAKE2b-256 50dcc6ff78627b41716004b2bf657dd27fbc91943ebf1642cc3ecd140593c58a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for quanta_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9c5aefe329f5167b94025add623e3746af50a6ae6ff0c648748c1e7b3fbaaf3
MD5 126ca001188aea9a4580edb618826444
BLAKE2b-256 dda9e6fe044ab19346dd395d7995faf50da57d566c82ea319c4f612f1015dc7a

See more details on using hashes here.

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