Skip to main content

CleitonForge — neutral benchmarking layer for quantum circuit simulators

Project description

CleitonForge

Neutral benchmarking layer for quantum circuit simulators — Python bindings

PyPI License GitHub

CleitonForge is an open-source, Rust-powered neutral benchmarking and interoperability layer for quantum computing simulators, created by Cleiton Augusto Correa Bezerra.

This package (cleitonforge) exposes the full CleitonForge engine to Python — build circuits, run simulations, parse OpenQASM, and measure performance metrics, all from Python with the speed of native Rust.


Install

pip install cleitonforge

No Rust toolchain required — pre-built wheels for Linux, macOS and Windows.


Quick start

Build and run a circuit

import cleitonforge as cf

# Bell state
circuit = cf.Circuit(2)
circuit.h(0)
circuit.cx(0, 1)

result = cf.run(circuit, shots=1024)
print(result.counts)       # {'00': 512, '11': 512}
print(result.top_states(2))  # [('11', 0.5), ('00', 0.5)]

Run from OpenQASM

qasm = """
OPENQASM 2.0;
qreg q[2];
h q[0];
cx q[0],q[1];
"""

result = cf.run_qasm(qasm, shots=1024)
print(result.counts)

Validate a circuit without simulating

info = cf.validate_qasm(qasm)
# {'qubits': 2, 'gates': 2, 'depth': 2}

Reproducible results with seed

r1 = cf.run(circuit, shots=1024, seed=42)
r2 = cf.run(circuit, shots=1024, seed=42)
assert r1.counts == r2.counts  # always True

Supported gates

Full OpenQASM 3 stdgates.inc gate set: h, x, y, z, s, sdg, t, tdg, sx, sxdg, rx, ry, rz, p, u, cx, cy, cz, ch, csx, crx, cry, crz, cp, cu, swap, ccx, cswap.

IBM/Qiskit aliases (id, cnot, toffoli, fredkin, u2, u3) are automatically translated.


Backends

Name Description
"statevector" Native Rust state-vector simulator (default)
"quantrs2" QuantRS2 backend
result = cf.run(circuit, shots=1024, backend="quantrs2")

Statevector access

result = cf.run(circuit, shots=0)  # shots=0 → exact statevector
for re, im in result.statevector:
    print(complex(re, im))

Why CleitonForge

The quantum computing ecosystem is fragmented: Qiskit, Cirq, PennyLane, Amazon Braket, and multiple Rust simulators each define benchmarks differently. CleitonForge is the neutral arbiter — it measures and compares any backend using the same canonical IR, without favoring any vendor.

  • Canonical IR: every gate carries provenance (source framework, original name)
  • Plugin architecture: add any backend via the SimulationBackend Rust trait
  • OpenQASM 2 and 3 parsing natively in Rust
  • Metrics over canonical IR guarantee fair cross-backend comparison

CLI tool

The Rust CLI (cforge) is available in the main repository:

cforge run --circuit bell.qasm --backends statevector,quantrs2
cforge validate --circuit circuit.qasm

Author

Cleiton Augusto Correa Bezerra Brazilian systems analyst and quantum computing researcher. GitHub · Email


License

Apache 2.0 — same license as OpenQASM and the Rust ecosystem.

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

cleitonforge-0.1.1.tar.gz (71.0 kB view details)

Uploaded Source

Built Distribution

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

cleitonforge-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file cleitonforge-0.1.1.tar.gz.

File metadata

  • Download URL: cleitonforge-0.1.1.tar.gz
  • Upload date:
  • Size: 71.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for cleitonforge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 34adfb004ce59e5e044c94448a53aa38605c450c8e9f4b2f74accdaf29f58100
MD5 4d693103e3dd5fb1e66e92bf18087a5d
BLAKE2b-256 4584022969eccf320271535317663b787e7f534addc8c3c01951e9df7ec9cb50

See more details on using hashes here.

File details

Details for the file cleitonforge-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cleitonforge-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9c200958f831ad8f3216404af0fc9c97415227c7898baabea53e0257b16e3115
MD5 f370bd4cdead532396df3ac9bedb77bc
BLAKE2b-256 c984f3b89de8a6b614f7b615b5c74120ba8b72ac7e7ce3f996c0870f6f03bf04

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