Haul Quantum AI Framework: a next-gen hybrid quantum-classical ML library
Project description
Haul Quantum
A lightweight, extensible quantum computing framework for Python, designed for research and prototyping. Haul Quantum provides:
- Pure-Python simulation with statevector backends.
- Fluent API via
Engineor directQuantumCircuit. - Chainable gates:
H,X,CNOT,RX,RY,RZ, and more. - Noise modeling and batch simulation support.
- Torch integration for hybrid quantum-classical neural nets.
🚀 Installation
pip install haul-quantum
Or install the latest development build:
git clone https://github.com/amirewontmiss/haul_quantum.git
cd haul_quantum
pip install -e .[dev]
🎯 Quick Start
Using the Engine
from haul_quantum.core.engine import Engine
# Create a 2-qubit circuit, build a Bell state:
eng = Engine(2)
out = eng.h(0).cnot(0,1).simulate()
print(out) # [0.707+0j, 0.707+0j, 0+0j, 0+0j]
# Measure probabilities:
probs = eng.measure()
print(probs) # {'00': 0.5, '01': 0.5}
Direct Circuit API
from haul_quantum.core.circuit import QuantumCircuit
from haul_quantum.core.gates import RX, H, CNOT
qc = QuantumCircuit(3)
qc.h(0).rx(1.23)(1).cnot(0,2)
state = qc.simulate()
📚 API Reference
Engine
| Method | Description |
|---|---|
Engine(n, seed) |
Create engine with n qubits, optional RNG seed. |
h(q) |
Apply Hadamard on qubit q. Returns self. |
x(q) |
Apply Pauli-X on qubit q. Returns self. |
cnot(ctrl, tgt) |
Controlled-NOT (control & target) on two qubits. |
rx(theta)(q) |
Rotation-X by theta on qubit q. |
simulate() |
Return full statevector as a NumPy array. |
measure() |
Return a dict of basis-state probabilities. |
to_qasm() |
Export to OpenQASM 2.0 string. |
reset() |
Clear all gates, preserve qubit count & seed. |
QuantumCircuit
Same API as Engine, but stateless. Useful for circuit transformations, compilation, and exporting without an Engine wrapper.
🔌 Features
- Statevector simulator: Pure NumPy backend, no external dependencies.
- NoiseModel: Apply
bit_flip,phase_flip,depolarizingchannels. - Batch simulation: Collect histograms over many shots.
- Torch integration: Wrap circuits as
torch.nn.Modulefor hybrid training.
🖋️ Contributing
Pull requests and issues welcome! Please read CONTRIBUTING.md for guidelines.
📄 License
MIT © amirewontmiss
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 haul_quantum-0.1.1.tar.gz.
File metadata
- Download URL: haul_quantum-0.1.1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e15dab26c3fae1c5751f136eb02711a464365342f2b0c9793ca7aee173853bee
|
|
| MD5 |
abc128b58c2f7b5d581c48cfe5a0ed62
|
|
| BLAKE2b-256 |
f13ecb35b95f4fa42f30132c420e188a6450c780818a53d945b66d83e32cb599
|
File details
Details for the file haul_quantum-0.1.1-py3-none-any.whl.
File metadata
- Download URL: haul_quantum-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ac99ca77a3bc43df106e06aff5af7af93f6d2dfea20322109d4d7719164f8c8
|
|
| MD5 |
31fba4dfc5d918ec88a919463b13c714
|
|
| BLAKE2b-256 |
362f779fb75fc808407f4e8bd8669bacecee6240e63c3d8dcf3e7a1687e6d9b3
|